1package documentdb 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 10 "context" 11 "encoding/json" 12 "github.com/Azure/go-autorest/autorest" 13 "github.com/Azure/go-autorest/autorest/azure" 14 "github.com/Azure/go-autorest/autorest/date" 15 "github.com/Azure/go-autorest/autorest/to" 16 "github.com/Azure/go-autorest/tracing" 17 "net/http" 18) 19 20// The package's fully qualified name. 21const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/cosmos-db/mgmt/2021-03-01-preview/documentdb" 22 23// APIProperties ... 24type APIProperties struct { 25 // ServerVersion - Describes the ServerVersion of an a MongoDB account. Possible values include: 'ServerVersionThreeFullStopTwo', 'ServerVersionThreeFullStopSix', 'ServerVersionFourFullStopZero' 26 ServerVersion ServerVersion `json:"serverVersion,omitempty"` 27} 28 29// ARMProxyResource the resource model definition for a ARM proxy resource. It will have everything other 30// than required location and tags 31type ARMProxyResource struct { 32 // ID - READ-ONLY; The unique resource identifier of the database account. 33 ID *string `json:"id,omitempty"` 34 // Name - READ-ONLY; The name of the database account. 35 Name *string `json:"name,omitempty"` 36 // Type - READ-ONLY; The type of Azure resource. 37 Type *string `json:"type,omitempty"` 38} 39 40// MarshalJSON is the custom marshaler for ARMProxyResource. 41func (apr ARMProxyResource) MarshalJSON() ([]byte, error) { 42 objectMap := make(map[string]interface{}) 43 return json.Marshal(objectMap) 44} 45 46// ARMResourceProperties the core properties of ARM resources. 47type ARMResourceProperties struct { 48 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 49 ID *string `json:"id,omitempty"` 50 // Name - READ-ONLY; The name of the ARM resource. 51 Name *string `json:"name,omitempty"` 52 // Type - READ-ONLY; The type of Azure resource. 53 Type *string `json:"type,omitempty"` 54 // Location - The location of the resource group to which the resource belongs. 55 Location *string `json:"location,omitempty"` 56 Tags map[string]*string `json:"tags"` 57 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 58} 59 60// MarshalJSON is the custom marshaler for ARMResourceProperties. 61func (arp ARMResourceProperties) MarshalJSON() ([]byte, error) { 62 objectMap := make(map[string]interface{}) 63 if arp.Location != nil { 64 objectMap["location"] = arp.Location 65 } 66 if arp.Tags != nil { 67 objectMap["tags"] = arp.Tags 68 } 69 if arp.Identity != nil { 70 objectMap["identity"] = arp.Identity 71 } 72 return json.Marshal(objectMap) 73} 74 75// AutoscaleSettings ... 76type AutoscaleSettings struct { 77 // MaxThroughput - Represents maximum throughput, the resource can scale up to. 78 MaxThroughput *int32 `json:"maxThroughput,omitempty"` 79} 80 81// AutoscaleSettingsResource cosmos DB provisioned throughput settings object 82type AutoscaleSettingsResource struct { 83 // MaxThroughput - Represents maximum throughput container can scale up to. 84 MaxThroughput *int32 `json:"maxThroughput,omitempty"` 85 // AutoUpgradePolicy - Cosmos DB resource auto-upgrade policy 86 AutoUpgradePolicy *AutoUpgradePolicyResource `json:"autoUpgradePolicy,omitempty"` 87 // TargetMaxThroughput - READ-ONLY; Represents target maximum throughput container can scale up to once offer is no longer in pending state. 88 TargetMaxThroughput *int32 `json:"targetMaxThroughput,omitempty"` 89} 90 91// MarshalJSON is the custom marshaler for AutoscaleSettingsResource. 92func (asr AutoscaleSettingsResource) MarshalJSON() ([]byte, error) { 93 objectMap := make(map[string]interface{}) 94 if asr.MaxThroughput != nil { 95 objectMap["maxThroughput"] = asr.MaxThroughput 96 } 97 if asr.AutoUpgradePolicy != nil { 98 objectMap["autoUpgradePolicy"] = asr.AutoUpgradePolicy 99 } 100 return json.Marshal(objectMap) 101} 102 103// AutoUpgradePolicyResource cosmos DB resource auto-upgrade policy 104type AutoUpgradePolicyResource struct { 105 // ThroughputPolicy - Represents throughput policy which service must adhere to for auto-upgrade 106 ThroughputPolicy *ThroughputPolicyResource `json:"throughputPolicy,omitempty"` 107} 108 109// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. 110type AzureEntityResource struct { 111 // Etag - READ-ONLY; Resource Etag. 112 Etag *string `json:"etag,omitempty"` 113 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 114 ID *string `json:"id,omitempty"` 115 // Name - READ-ONLY; The name of the resource 116 Name *string `json:"name,omitempty"` 117 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 118 Type *string `json:"type,omitempty"` 119} 120 121// MarshalJSON is the custom marshaler for AzureEntityResource. 122func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { 123 objectMap := make(map[string]interface{}) 124 return json.Marshal(objectMap) 125} 126 127// BasicBackupPolicy the object representing the policy for taking backups on an account. 128type BasicBackupPolicy interface { 129 AsPeriodicModeBackupPolicy() (*PeriodicModeBackupPolicy, bool) 130 AsContinuousModeBackupPolicy() (*ContinuousModeBackupPolicy, bool) 131 AsBackupPolicy() (*BackupPolicy, bool) 132} 133 134// BackupPolicy the object representing the policy for taking backups on an account. 135type BackupPolicy struct { 136 // Type - Possible values include: 'TypeBackupPolicy', 'TypePeriodic', 'TypeContinuous' 137 Type Type `json:"type,omitempty"` 138} 139 140func unmarshalBasicBackupPolicy(body []byte) (BasicBackupPolicy, error) { 141 var m map[string]interface{} 142 err := json.Unmarshal(body, &m) 143 if err != nil { 144 return nil, err 145 } 146 147 switch m["type"] { 148 case string(TypePeriodic): 149 var pmbp PeriodicModeBackupPolicy 150 err := json.Unmarshal(body, &pmbp) 151 return pmbp, err 152 case string(TypeContinuous): 153 var cmbp ContinuousModeBackupPolicy 154 err := json.Unmarshal(body, &cmbp) 155 return cmbp, err 156 default: 157 var bp BackupPolicy 158 err := json.Unmarshal(body, &bp) 159 return bp, err 160 } 161} 162func unmarshalBasicBackupPolicyArray(body []byte) ([]BasicBackupPolicy, error) { 163 var rawMessages []*json.RawMessage 164 err := json.Unmarshal(body, &rawMessages) 165 if err != nil { 166 return nil, err 167 } 168 169 bpArray := make([]BasicBackupPolicy, len(rawMessages)) 170 171 for index, rawMessage := range rawMessages { 172 bp, err := unmarshalBasicBackupPolicy(*rawMessage) 173 if err != nil { 174 return nil, err 175 } 176 bpArray[index] = bp 177 } 178 return bpArray, nil 179} 180 181// MarshalJSON is the custom marshaler for BackupPolicy. 182func (bp BackupPolicy) MarshalJSON() ([]byte, error) { 183 bp.Type = TypeBackupPolicy 184 objectMap := make(map[string]interface{}) 185 if bp.Type != "" { 186 objectMap["type"] = bp.Type 187 } 188 return json.Marshal(objectMap) 189} 190 191// AsPeriodicModeBackupPolicy is the BasicBackupPolicy implementation for BackupPolicy. 192func (bp BackupPolicy) AsPeriodicModeBackupPolicy() (*PeriodicModeBackupPolicy, bool) { 193 return nil, false 194} 195 196// AsContinuousModeBackupPolicy is the BasicBackupPolicy implementation for BackupPolicy. 197func (bp BackupPolicy) AsContinuousModeBackupPolicy() (*ContinuousModeBackupPolicy, bool) { 198 return nil, false 199} 200 201// AsBackupPolicy is the BasicBackupPolicy implementation for BackupPolicy. 202func (bp BackupPolicy) AsBackupPolicy() (*BackupPolicy, bool) { 203 return &bp, true 204} 205 206// AsBasicBackupPolicy is the BasicBackupPolicy implementation for BackupPolicy. 207func (bp BackupPolicy) AsBasicBackupPolicy() (BasicBackupPolicy, bool) { 208 return &bp, true 209} 210 211// BackupResource a restorable backup of a Cassandra cluster. 212type BackupResource struct { 213 autorest.Response `json:"-"` 214 Properties *BackupResourceProperties `json:"properties,omitempty"` 215 // ID - READ-ONLY; The unique resource identifier of the database account. 216 ID *string `json:"id,omitempty"` 217 // Name - READ-ONLY; The name of the database account. 218 Name *string `json:"name,omitempty"` 219 // Type - READ-ONLY; The type of Azure resource. 220 Type *string `json:"type,omitempty"` 221} 222 223// MarshalJSON is the custom marshaler for BackupResource. 224func (br BackupResource) MarshalJSON() ([]byte, error) { 225 objectMap := make(map[string]interface{}) 226 if br.Properties != nil { 227 objectMap["properties"] = br.Properties 228 } 229 return json.Marshal(objectMap) 230} 231 232// BackupResourceProperties ... 233type BackupResourceProperties struct { 234 // Timestamp - The time this backup was taken, formatted like 2021-01-21T17:35:21 235 Timestamp *date.Time `json:"timestamp,omitempty"` 236} 237 238// Capability cosmos DB capability object 239type Capability struct { 240 // Name - Name of the Cosmos DB capability. For example, "name": "EnableCassandra". Current values also include "EnableTable" and "EnableGremlin". 241 Name *string `json:"name,omitempty"` 242} 243 244// CassandraClustersCreateUpdateFuture an abstraction for monitoring and retrieving the results of a 245// long-running operation. 246type CassandraClustersCreateUpdateFuture struct { 247 azure.FutureAPI 248 // Result returns the result of the asynchronous operation. 249 // If the operation has not completed it will return an error. 250 Result func(CassandraClustersClient) (ClusterResource, error) 251} 252 253// UnmarshalJSON is the custom unmarshaller for CreateFuture. 254func (future *CassandraClustersCreateUpdateFuture) UnmarshalJSON(body []byte) error { 255 var azFuture azure.Future 256 if err := json.Unmarshal(body, &azFuture); err != nil { 257 return err 258 } 259 future.FutureAPI = &azFuture 260 future.Result = future.result 261 return nil 262} 263 264// result is the default implementation for CassandraClustersCreateUpdateFuture.Result. 265func (future *CassandraClustersCreateUpdateFuture) result(client CassandraClustersClient) (cr ClusterResource, err error) { 266 var done bool 267 done, err = future.DoneWithContext(context.Background(), client) 268 if err != nil { 269 err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersCreateUpdateFuture", "Result", future.Response(), "Polling failure") 270 return 271 } 272 if !done { 273 cr.Response.Response = future.Response() 274 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraClustersCreateUpdateFuture") 275 return 276 } 277 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 278 if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent { 279 cr, err = client.CreateUpdateResponder(cr.Response.Response) 280 if err != nil { 281 err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersCreateUpdateFuture", "Result", cr.Response.Response, "Failure responding to request") 282 } 283 } 284 return 285} 286 287// CassandraClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 288// operation. 289type CassandraClustersDeleteFuture struct { 290 azure.FutureAPI 291 // Result returns the result of the asynchronous operation. 292 // If the operation has not completed it will return an error. 293 Result func(CassandraClustersClient) (autorest.Response, error) 294} 295 296// UnmarshalJSON is the custom unmarshaller for CreateFuture. 297func (future *CassandraClustersDeleteFuture) UnmarshalJSON(body []byte) error { 298 var azFuture azure.Future 299 if err := json.Unmarshal(body, &azFuture); err != nil { 300 return err 301 } 302 future.FutureAPI = &azFuture 303 future.Result = future.result 304 return nil 305} 306 307// result is the default implementation for CassandraClustersDeleteFuture.Result. 308func (future *CassandraClustersDeleteFuture) result(client CassandraClustersClient) (ar autorest.Response, err error) { 309 var done bool 310 done, err = future.DoneWithContext(context.Background(), client) 311 if err != nil { 312 err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersDeleteFuture", "Result", future.Response(), "Polling failure") 313 return 314 } 315 if !done { 316 ar.Response = future.Response() 317 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraClustersDeleteFuture") 318 return 319 } 320 ar.Response = future.Response() 321 return 322} 323 324// CassandraClustersFetchNodeStatusFuture an abstraction for monitoring and retrieving the results of a 325// long-running operation. 326type CassandraClustersFetchNodeStatusFuture struct { 327 azure.FutureAPI 328 // Result returns the result of the asynchronous operation. 329 // If the operation has not completed it will return an error. 330 Result func(CassandraClustersClient) (ClusterNodeStatus, error) 331} 332 333// UnmarshalJSON is the custom unmarshaller for CreateFuture. 334func (future *CassandraClustersFetchNodeStatusFuture) UnmarshalJSON(body []byte) error { 335 var azFuture azure.Future 336 if err := json.Unmarshal(body, &azFuture); err != nil { 337 return err 338 } 339 future.FutureAPI = &azFuture 340 future.Result = future.result 341 return nil 342} 343 344// result is the default implementation for CassandraClustersFetchNodeStatusFuture.Result. 345func (future *CassandraClustersFetchNodeStatusFuture) result(client CassandraClustersClient) (cns ClusterNodeStatus, err error) { 346 var done bool 347 done, err = future.DoneWithContext(context.Background(), client) 348 if err != nil { 349 err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersFetchNodeStatusFuture", "Result", future.Response(), "Polling failure") 350 return 351 } 352 if !done { 353 cns.Response.Response = future.Response() 354 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraClustersFetchNodeStatusFuture") 355 return 356 } 357 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 358 if cns.Response.Response, err = future.GetResult(sender); err == nil && cns.Response.Response.StatusCode != http.StatusNoContent { 359 cns, err = client.FetchNodeStatusResponder(cns.Response.Response) 360 if err != nil { 361 err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersFetchNodeStatusFuture", "Result", cns.Response.Response, "Failure responding to request") 362 } 363 } 364 return 365} 366 367// CassandraClustersRequestRepairFuture an abstraction for monitoring and retrieving the results of a 368// long-running operation. 369type CassandraClustersRequestRepairFuture struct { 370 azure.FutureAPI 371 // Result returns the result of the asynchronous operation. 372 // If the operation has not completed it will return an error. 373 Result func(CassandraClustersClient) (autorest.Response, error) 374} 375 376// UnmarshalJSON is the custom unmarshaller for CreateFuture. 377func (future *CassandraClustersRequestRepairFuture) UnmarshalJSON(body []byte) error { 378 var azFuture azure.Future 379 if err := json.Unmarshal(body, &azFuture); err != nil { 380 return err 381 } 382 future.FutureAPI = &azFuture 383 future.Result = future.result 384 return nil 385} 386 387// result is the default implementation for CassandraClustersRequestRepairFuture.Result. 388func (future *CassandraClustersRequestRepairFuture) result(client CassandraClustersClient) (ar autorest.Response, err error) { 389 var done bool 390 done, err = future.DoneWithContext(context.Background(), client) 391 if err != nil { 392 err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersRequestRepairFuture", "Result", future.Response(), "Polling failure") 393 return 394 } 395 if !done { 396 ar.Response = future.Response() 397 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraClustersRequestRepairFuture") 398 return 399 } 400 ar.Response = future.Response() 401 return 402} 403 404// CassandraClustersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 405// operation. 406type CassandraClustersUpdateFuture struct { 407 azure.FutureAPI 408 // Result returns the result of the asynchronous operation. 409 // If the operation has not completed it will return an error. 410 Result func(CassandraClustersClient) (ClusterResource, error) 411} 412 413// UnmarshalJSON is the custom unmarshaller for CreateFuture. 414func (future *CassandraClustersUpdateFuture) UnmarshalJSON(body []byte) error { 415 var azFuture azure.Future 416 if err := json.Unmarshal(body, &azFuture); err != nil { 417 return err 418 } 419 future.FutureAPI = &azFuture 420 future.Result = future.result 421 return nil 422} 423 424// result is the default implementation for CassandraClustersUpdateFuture.Result. 425func (future *CassandraClustersUpdateFuture) result(client CassandraClustersClient) (cr ClusterResource, err error) { 426 var done bool 427 done, err = future.DoneWithContext(context.Background(), client) 428 if err != nil { 429 err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersUpdateFuture", "Result", future.Response(), "Polling failure") 430 return 431 } 432 if !done { 433 cr.Response.Response = future.Response() 434 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraClustersUpdateFuture") 435 return 436 } 437 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 438 if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent { 439 cr, err = client.UpdateResponder(cr.Response.Response) 440 if err != nil { 441 err = autorest.NewErrorWithError(err, "documentdb.CassandraClustersUpdateFuture", "Result", cr.Response.Response, "Failure responding to request") 442 } 443 } 444 return 445} 446 447// CassandraDataCentersCreateUpdateFuture an abstraction for monitoring and retrieving the results of a 448// long-running operation. 449type CassandraDataCentersCreateUpdateFuture struct { 450 azure.FutureAPI 451 // Result returns the result of the asynchronous operation. 452 // If the operation has not completed it will return an error. 453 Result func(CassandraDataCentersClient) (DataCenterResource, error) 454} 455 456// UnmarshalJSON is the custom unmarshaller for CreateFuture. 457func (future *CassandraDataCentersCreateUpdateFuture) UnmarshalJSON(body []byte) error { 458 var azFuture azure.Future 459 if err := json.Unmarshal(body, &azFuture); err != nil { 460 return err 461 } 462 future.FutureAPI = &azFuture 463 future.Result = future.result 464 return nil 465} 466 467// result is the default implementation for CassandraDataCentersCreateUpdateFuture.Result. 468func (future *CassandraDataCentersCreateUpdateFuture) result(client CassandraDataCentersClient) (dcr DataCenterResource, err error) { 469 var done bool 470 done, err = future.DoneWithContext(context.Background(), client) 471 if err != nil { 472 err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersCreateUpdateFuture", "Result", future.Response(), "Polling failure") 473 return 474 } 475 if !done { 476 dcr.Response.Response = future.Response() 477 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraDataCentersCreateUpdateFuture") 478 return 479 } 480 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 481 if dcr.Response.Response, err = future.GetResult(sender); err == nil && dcr.Response.Response.StatusCode != http.StatusNoContent { 482 dcr, err = client.CreateUpdateResponder(dcr.Response.Response) 483 if err != nil { 484 err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersCreateUpdateFuture", "Result", dcr.Response.Response, "Failure responding to request") 485 } 486 } 487 return 488} 489 490// CassandraDataCentersDeleteFuture an abstraction for monitoring and retrieving the results of a 491// long-running operation. 492type CassandraDataCentersDeleteFuture struct { 493 azure.FutureAPI 494 // Result returns the result of the asynchronous operation. 495 // If the operation has not completed it will return an error. 496 Result func(CassandraDataCentersClient) (autorest.Response, error) 497} 498 499// UnmarshalJSON is the custom unmarshaller for CreateFuture. 500func (future *CassandraDataCentersDeleteFuture) UnmarshalJSON(body []byte) error { 501 var azFuture azure.Future 502 if err := json.Unmarshal(body, &azFuture); err != nil { 503 return err 504 } 505 future.FutureAPI = &azFuture 506 future.Result = future.result 507 return nil 508} 509 510// result is the default implementation for CassandraDataCentersDeleteFuture.Result. 511func (future *CassandraDataCentersDeleteFuture) result(client CassandraDataCentersClient) (ar autorest.Response, err error) { 512 var done bool 513 done, err = future.DoneWithContext(context.Background(), client) 514 if err != nil { 515 err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersDeleteFuture", "Result", future.Response(), "Polling failure") 516 return 517 } 518 if !done { 519 ar.Response = future.Response() 520 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraDataCentersDeleteFuture") 521 return 522 } 523 ar.Response = future.Response() 524 return 525} 526 527// CassandraDataCentersUpdateFuture an abstraction for monitoring and retrieving the results of a 528// long-running operation. 529type CassandraDataCentersUpdateFuture struct { 530 azure.FutureAPI 531 // Result returns the result of the asynchronous operation. 532 // If the operation has not completed it will return an error. 533 Result func(CassandraDataCentersClient) (DataCenterResource, error) 534} 535 536// UnmarshalJSON is the custom unmarshaller for CreateFuture. 537func (future *CassandraDataCentersUpdateFuture) UnmarshalJSON(body []byte) error { 538 var azFuture azure.Future 539 if err := json.Unmarshal(body, &azFuture); err != nil { 540 return err 541 } 542 future.FutureAPI = &azFuture 543 future.Result = future.result 544 return nil 545} 546 547// result is the default implementation for CassandraDataCentersUpdateFuture.Result. 548func (future *CassandraDataCentersUpdateFuture) result(client CassandraDataCentersClient) (dcr DataCenterResource, err error) { 549 var done bool 550 done, err = future.DoneWithContext(context.Background(), client) 551 if err != nil { 552 err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersUpdateFuture", "Result", future.Response(), "Polling failure") 553 return 554 } 555 if !done { 556 dcr.Response.Response = future.Response() 557 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraDataCentersUpdateFuture") 558 return 559 } 560 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 561 if dcr.Response.Response, err = future.GetResult(sender); err == nil && dcr.Response.Response.StatusCode != http.StatusNoContent { 562 dcr, err = client.UpdateResponder(dcr.Response.Response) 563 if err != nil { 564 err = autorest.NewErrorWithError(err, "documentdb.CassandraDataCentersUpdateFuture", "Result", dcr.Response.Response, "Failure responding to request") 565 } 566 } 567 return 568} 569 570// CassandraKeyspaceCreateUpdateParameters parameters to create and update Cosmos DB Cassandra keyspace. 571type CassandraKeyspaceCreateUpdateParameters struct { 572 // CassandraKeyspaceCreateUpdateProperties - Properties to create and update Azure Cosmos DB Cassandra keyspace. 573 *CassandraKeyspaceCreateUpdateProperties `json:"properties,omitempty"` 574 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 575 ID *string `json:"id,omitempty"` 576 // Name - READ-ONLY; The name of the ARM resource. 577 Name *string `json:"name,omitempty"` 578 // Type - READ-ONLY; The type of Azure resource. 579 Type *string `json:"type,omitempty"` 580 // Location - The location of the resource group to which the resource belongs. 581 Location *string `json:"location,omitempty"` 582 Tags map[string]*string `json:"tags"` 583 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 584} 585 586// MarshalJSON is the custom marshaler for CassandraKeyspaceCreateUpdateParameters. 587func (ckcup CassandraKeyspaceCreateUpdateParameters) MarshalJSON() ([]byte, error) { 588 objectMap := make(map[string]interface{}) 589 if ckcup.CassandraKeyspaceCreateUpdateProperties != nil { 590 objectMap["properties"] = ckcup.CassandraKeyspaceCreateUpdateProperties 591 } 592 if ckcup.Location != nil { 593 objectMap["location"] = ckcup.Location 594 } 595 if ckcup.Tags != nil { 596 objectMap["tags"] = ckcup.Tags 597 } 598 if ckcup.Identity != nil { 599 objectMap["identity"] = ckcup.Identity 600 } 601 return json.Marshal(objectMap) 602} 603 604// UnmarshalJSON is the custom unmarshaler for CassandraKeyspaceCreateUpdateParameters struct. 605func (ckcup *CassandraKeyspaceCreateUpdateParameters) UnmarshalJSON(body []byte) error { 606 var m map[string]*json.RawMessage 607 err := json.Unmarshal(body, &m) 608 if err != nil { 609 return err 610 } 611 for k, v := range m { 612 switch k { 613 case "properties": 614 if v != nil { 615 var cassandraKeyspaceCreateUpdateProperties CassandraKeyspaceCreateUpdateProperties 616 err = json.Unmarshal(*v, &cassandraKeyspaceCreateUpdateProperties) 617 if err != nil { 618 return err 619 } 620 ckcup.CassandraKeyspaceCreateUpdateProperties = &cassandraKeyspaceCreateUpdateProperties 621 } 622 case "id": 623 if v != nil { 624 var ID string 625 err = json.Unmarshal(*v, &ID) 626 if err != nil { 627 return err 628 } 629 ckcup.ID = &ID 630 } 631 case "name": 632 if v != nil { 633 var name string 634 err = json.Unmarshal(*v, &name) 635 if err != nil { 636 return err 637 } 638 ckcup.Name = &name 639 } 640 case "type": 641 if v != nil { 642 var typeVar string 643 err = json.Unmarshal(*v, &typeVar) 644 if err != nil { 645 return err 646 } 647 ckcup.Type = &typeVar 648 } 649 case "location": 650 if v != nil { 651 var location string 652 err = json.Unmarshal(*v, &location) 653 if err != nil { 654 return err 655 } 656 ckcup.Location = &location 657 } 658 case "tags": 659 if v != nil { 660 var tags map[string]*string 661 err = json.Unmarshal(*v, &tags) 662 if err != nil { 663 return err 664 } 665 ckcup.Tags = tags 666 } 667 case "identity": 668 if v != nil { 669 var identity ManagedServiceIdentity 670 err = json.Unmarshal(*v, &identity) 671 if err != nil { 672 return err 673 } 674 ckcup.Identity = &identity 675 } 676 } 677 } 678 679 return nil 680} 681 682// CassandraKeyspaceCreateUpdateProperties properties to create and update Azure Cosmos DB Cassandra 683// keyspace. 684type CassandraKeyspaceCreateUpdateProperties struct { 685 // Resource - The standard JSON format of a Cassandra keyspace 686 Resource *CassandraKeyspaceResource `json:"resource,omitempty"` 687 // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. 688 Options *CreateUpdateOptions `json:"options,omitempty"` 689} 690 691// CassandraKeyspaceGetProperties the properties of an Azure Cosmos DB Cassandra keyspace 692type CassandraKeyspaceGetProperties struct { 693 Resource *CassandraKeyspaceGetPropertiesResource `json:"resource,omitempty"` 694 Options *CassandraKeyspaceGetPropertiesOptions `json:"options,omitempty"` 695} 696 697// CassandraKeyspaceGetPropertiesOptions ... 698type CassandraKeyspaceGetPropertiesOptions struct { 699 // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. 700 Throughput *int32 `json:"throughput,omitempty"` 701 // AutoscaleSettings - Specifies the Autoscale settings. 702 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` 703} 704 705// CassandraKeyspaceGetPropertiesResource ... 706type CassandraKeyspaceGetPropertiesResource struct { 707 // ID - Name of the Cosmos DB Cassandra keyspace 708 ID *string `json:"id,omitempty"` 709 // Rid - READ-ONLY; A system generated property. A unique identifier. 710 Rid *string `json:"_rid,omitempty"` 711 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 712 Ts *float64 `json:"_ts,omitempty"` 713 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 714 Etag *string `json:"_etag,omitempty"` 715} 716 717// MarshalJSON is the custom marshaler for CassandraKeyspaceGetPropertiesResource. 718func (ckgp CassandraKeyspaceGetPropertiesResource) MarshalJSON() ([]byte, error) { 719 objectMap := make(map[string]interface{}) 720 if ckgp.ID != nil { 721 objectMap["id"] = ckgp.ID 722 } 723 return json.Marshal(objectMap) 724} 725 726// CassandraKeyspaceGetResults an Azure Cosmos DB Cassandra keyspace. 727type CassandraKeyspaceGetResults struct { 728 autorest.Response `json:"-"` 729 // CassandraKeyspaceGetProperties - The properties of an Azure Cosmos DB Cassandra keyspace 730 *CassandraKeyspaceGetProperties `json:"properties,omitempty"` 731 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 732 ID *string `json:"id,omitempty"` 733 // Name - READ-ONLY; The name of the ARM resource. 734 Name *string `json:"name,omitempty"` 735 // Type - READ-ONLY; The type of Azure resource. 736 Type *string `json:"type,omitempty"` 737 // Location - The location of the resource group to which the resource belongs. 738 Location *string `json:"location,omitempty"` 739 Tags map[string]*string `json:"tags"` 740 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 741} 742 743// MarshalJSON is the custom marshaler for CassandraKeyspaceGetResults. 744func (ckgr CassandraKeyspaceGetResults) MarshalJSON() ([]byte, error) { 745 objectMap := make(map[string]interface{}) 746 if ckgr.CassandraKeyspaceGetProperties != nil { 747 objectMap["properties"] = ckgr.CassandraKeyspaceGetProperties 748 } 749 if ckgr.Location != nil { 750 objectMap["location"] = ckgr.Location 751 } 752 if ckgr.Tags != nil { 753 objectMap["tags"] = ckgr.Tags 754 } 755 if ckgr.Identity != nil { 756 objectMap["identity"] = ckgr.Identity 757 } 758 return json.Marshal(objectMap) 759} 760 761// UnmarshalJSON is the custom unmarshaler for CassandraKeyspaceGetResults struct. 762func (ckgr *CassandraKeyspaceGetResults) UnmarshalJSON(body []byte) error { 763 var m map[string]*json.RawMessage 764 err := json.Unmarshal(body, &m) 765 if err != nil { 766 return err 767 } 768 for k, v := range m { 769 switch k { 770 case "properties": 771 if v != nil { 772 var cassandraKeyspaceGetProperties CassandraKeyspaceGetProperties 773 err = json.Unmarshal(*v, &cassandraKeyspaceGetProperties) 774 if err != nil { 775 return err 776 } 777 ckgr.CassandraKeyspaceGetProperties = &cassandraKeyspaceGetProperties 778 } 779 case "id": 780 if v != nil { 781 var ID string 782 err = json.Unmarshal(*v, &ID) 783 if err != nil { 784 return err 785 } 786 ckgr.ID = &ID 787 } 788 case "name": 789 if v != nil { 790 var name string 791 err = json.Unmarshal(*v, &name) 792 if err != nil { 793 return err 794 } 795 ckgr.Name = &name 796 } 797 case "type": 798 if v != nil { 799 var typeVar string 800 err = json.Unmarshal(*v, &typeVar) 801 if err != nil { 802 return err 803 } 804 ckgr.Type = &typeVar 805 } 806 case "location": 807 if v != nil { 808 var location string 809 err = json.Unmarshal(*v, &location) 810 if err != nil { 811 return err 812 } 813 ckgr.Location = &location 814 } 815 case "tags": 816 if v != nil { 817 var tags map[string]*string 818 err = json.Unmarshal(*v, &tags) 819 if err != nil { 820 return err 821 } 822 ckgr.Tags = tags 823 } 824 case "identity": 825 if v != nil { 826 var identity ManagedServiceIdentity 827 err = json.Unmarshal(*v, &identity) 828 if err != nil { 829 return err 830 } 831 ckgr.Identity = &identity 832 } 833 } 834 } 835 836 return nil 837} 838 839// CassandraKeyspaceListResult the List operation response, that contains the Cassandra keyspaces and their 840// properties. 841type CassandraKeyspaceListResult struct { 842 autorest.Response `json:"-"` 843 // Value - READ-ONLY; List of Cassandra keyspaces and their properties. 844 Value *[]CassandraKeyspaceGetResults `json:"value,omitempty"` 845} 846 847// MarshalJSON is the custom marshaler for CassandraKeyspaceListResult. 848func (cklr CassandraKeyspaceListResult) MarshalJSON() ([]byte, error) { 849 objectMap := make(map[string]interface{}) 850 return json.Marshal(objectMap) 851} 852 853// CassandraKeyspaceResource cosmos DB Cassandra keyspace resource object 854type CassandraKeyspaceResource struct { 855 // ID - Name of the Cosmos DB Cassandra keyspace 856 ID *string `json:"id,omitempty"` 857} 858 859// CassandraPartitionKey cosmos DB Cassandra table partition key 860type CassandraPartitionKey struct { 861 // Name - Name of the Cosmos DB Cassandra table partition key 862 Name *string `json:"name,omitempty"` 863} 864 865// CassandraResourcesCreateUpdateCassandraKeyspaceFuture an abstraction for monitoring and retrieving the 866// results of a long-running operation. 867type CassandraResourcesCreateUpdateCassandraKeyspaceFuture struct { 868 azure.FutureAPI 869 // Result returns the result of the asynchronous operation. 870 // If the operation has not completed it will return an error. 871 Result func(CassandraResourcesClient) (CassandraKeyspaceGetResults, error) 872} 873 874// UnmarshalJSON is the custom unmarshaller for CreateFuture. 875func (future *CassandraResourcesCreateUpdateCassandraKeyspaceFuture) UnmarshalJSON(body []byte) error { 876 var azFuture azure.Future 877 if err := json.Unmarshal(body, &azFuture); err != nil { 878 return err 879 } 880 future.FutureAPI = &azFuture 881 future.Result = future.result 882 return nil 883} 884 885// result is the default implementation for CassandraResourcesCreateUpdateCassandraKeyspaceFuture.Result. 886func (future *CassandraResourcesCreateUpdateCassandraKeyspaceFuture) result(client CassandraResourcesClient) (ckgr CassandraKeyspaceGetResults, err error) { 887 var done bool 888 done, err = future.DoneWithContext(context.Background(), client) 889 if err != nil { 890 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture", "Result", future.Response(), "Polling failure") 891 return 892 } 893 if !done { 894 ckgr.Response.Response = future.Response() 895 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture") 896 return 897 } 898 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 899 if ckgr.Response.Response, err = future.GetResult(sender); err == nil && ckgr.Response.Response.StatusCode != http.StatusNoContent { 900 ckgr, err = client.CreateUpdateCassandraKeyspaceResponder(ckgr.Response.Response) 901 if err != nil { 902 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraKeyspaceFuture", "Result", ckgr.Response.Response, "Failure responding to request") 903 } 904 } 905 return 906} 907 908// CassandraResourcesCreateUpdateCassandraTableFuture an abstraction for monitoring and retrieving the 909// results of a long-running operation. 910type CassandraResourcesCreateUpdateCassandraTableFuture struct { 911 azure.FutureAPI 912 // Result returns the result of the asynchronous operation. 913 // If the operation has not completed it will return an error. 914 Result func(CassandraResourcesClient) (CassandraTableGetResults, error) 915} 916 917// UnmarshalJSON is the custom unmarshaller for CreateFuture. 918func (future *CassandraResourcesCreateUpdateCassandraTableFuture) UnmarshalJSON(body []byte) error { 919 var azFuture azure.Future 920 if err := json.Unmarshal(body, &azFuture); err != nil { 921 return err 922 } 923 future.FutureAPI = &azFuture 924 future.Result = future.result 925 return nil 926} 927 928// result is the default implementation for CassandraResourcesCreateUpdateCassandraTableFuture.Result. 929func (future *CassandraResourcesCreateUpdateCassandraTableFuture) result(client CassandraResourcesClient) (ctgr CassandraTableGetResults, err error) { 930 var done bool 931 done, err = future.DoneWithContext(context.Background(), client) 932 if err != nil { 933 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraTableFuture", "Result", future.Response(), "Polling failure") 934 return 935 } 936 if !done { 937 ctgr.Response.Response = future.Response() 938 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesCreateUpdateCassandraTableFuture") 939 return 940 } 941 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 942 if ctgr.Response.Response, err = future.GetResult(sender); err == nil && ctgr.Response.Response.StatusCode != http.StatusNoContent { 943 ctgr, err = client.CreateUpdateCassandraTableResponder(ctgr.Response.Response) 944 if err != nil { 945 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesCreateUpdateCassandraTableFuture", "Result", ctgr.Response.Response, "Failure responding to request") 946 } 947 } 948 return 949} 950 951// CassandraResourcesDeleteCassandraKeyspaceFuture an abstraction for monitoring and retrieving the results 952// of a long-running operation. 953type CassandraResourcesDeleteCassandraKeyspaceFuture struct { 954 azure.FutureAPI 955 // Result returns the result of the asynchronous operation. 956 // If the operation has not completed it will return an error. 957 Result func(CassandraResourcesClient) (autorest.Response, error) 958} 959 960// UnmarshalJSON is the custom unmarshaller for CreateFuture. 961func (future *CassandraResourcesDeleteCassandraKeyspaceFuture) UnmarshalJSON(body []byte) error { 962 var azFuture azure.Future 963 if err := json.Unmarshal(body, &azFuture); err != nil { 964 return err 965 } 966 future.FutureAPI = &azFuture 967 future.Result = future.result 968 return nil 969} 970 971// result is the default implementation for CassandraResourcesDeleteCassandraKeyspaceFuture.Result. 972func (future *CassandraResourcesDeleteCassandraKeyspaceFuture) result(client CassandraResourcesClient) (ar autorest.Response, err error) { 973 var done bool 974 done, err = future.DoneWithContext(context.Background(), client) 975 if err != nil { 976 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesDeleteCassandraKeyspaceFuture", "Result", future.Response(), "Polling failure") 977 return 978 } 979 if !done { 980 ar.Response = future.Response() 981 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesDeleteCassandraKeyspaceFuture") 982 return 983 } 984 ar.Response = future.Response() 985 return 986} 987 988// CassandraResourcesDeleteCassandraTableFuture an abstraction for monitoring and retrieving the results of 989// a long-running operation. 990type CassandraResourcesDeleteCassandraTableFuture struct { 991 azure.FutureAPI 992 // Result returns the result of the asynchronous operation. 993 // If the operation has not completed it will return an error. 994 Result func(CassandraResourcesClient) (autorest.Response, error) 995} 996 997// UnmarshalJSON is the custom unmarshaller for CreateFuture. 998func (future *CassandraResourcesDeleteCassandraTableFuture) UnmarshalJSON(body []byte) error { 999 var azFuture azure.Future 1000 if err := json.Unmarshal(body, &azFuture); err != nil { 1001 return err 1002 } 1003 future.FutureAPI = &azFuture 1004 future.Result = future.result 1005 return nil 1006} 1007 1008// result is the default implementation for CassandraResourcesDeleteCassandraTableFuture.Result. 1009func (future *CassandraResourcesDeleteCassandraTableFuture) result(client CassandraResourcesClient) (ar autorest.Response, err error) { 1010 var done bool 1011 done, err = future.DoneWithContext(context.Background(), client) 1012 if err != nil { 1013 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesDeleteCassandraTableFuture", "Result", future.Response(), "Polling failure") 1014 return 1015 } 1016 if !done { 1017 ar.Response = future.Response() 1018 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesDeleteCassandraTableFuture") 1019 return 1020 } 1021 ar.Response = future.Response() 1022 return 1023} 1024 1025// CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture an abstraction for monitoring and retrieving 1026// the results of a long-running operation. 1027type CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture struct { 1028 azure.FutureAPI 1029 // Result returns the result of the asynchronous operation. 1030 // If the operation has not completed it will return an error. 1031 Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) 1032} 1033 1034// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1035func (future *CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture) UnmarshalJSON(body []byte) error { 1036 var azFuture azure.Future 1037 if err := json.Unmarshal(body, &azFuture); err != nil { 1038 return err 1039 } 1040 future.FutureAPI = &azFuture 1041 future.Result = future.result 1042 return nil 1043} 1044 1045// result is the default implementation for CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture.Result. 1046func (future *CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 1047 var done bool 1048 done, err = future.DoneWithContext(context.Background(), client) 1049 if err != nil { 1050 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture", "Result", future.Response(), "Polling failure") 1051 return 1052 } 1053 if !done { 1054 tsgr.Response.Response = future.Response() 1055 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture") 1056 return 1057 } 1058 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1059 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 1060 tsgr, err = client.MigrateCassandraKeyspaceToAutoscaleResponder(tsgr.Response.Response) 1061 if err != nil { 1062 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraKeyspaceToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") 1063 } 1064 } 1065 return 1066} 1067 1068// CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture an abstraction for monitoring and 1069// retrieving the results of a long-running operation. 1070type CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture struct { 1071 azure.FutureAPI 1072 // Result returns the result of the asynchronous operation. 1073 // If the operation has not completed it will return an error. 1074 Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) 1075} 1076 1077// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1078func (future *CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture) UnmarshalJSON(body []byte) error { 1079 var azFuture azure.Future 1080 if err := json.Unmarshal(body, &azFuture); err != nil { 1081 return err 1082 } 1083 future.FutureAPI = &azFuture 1084 future.Result = future.result 1085 return nil 1086} 1087 1088// result is the default implementation for CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture.Result. 1089func (future *CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 1090 var done bool 1091 done, err = future.DoneWithContext(context.Background(), client) 1092 if err != nil { 1093 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture", "Result", future.Response(), "Polling failure") 1094 return 1095 } 1096 if !done { 1097 tsgr.Response.Response = future.Response() 1098 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture") 1099 return 1100 } 1101 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1102 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 1103 tsgr, err = client.MigrateCassandraKeyspaceToManualThroughputResponder(tsgr.Response.Response) 1104 if err != nil { 1105 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraKeyspaceToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 1106 } 1107 } 1108 return 1109} 1110 1111// CassandraResourcesMigrateCassandraTableToAutoscaleFuture an abstraction for monitoring and retrieving 1112// the results of a long-running operation. 1113type CassandraResourcesMigrateCassandraTableToAutoscaleFuture struct { 1114 azure.FutureAPI 1115 // Result returns the result of the asynchronous operation. 1116 // If the operation has not completed it will return an error. 1117 Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) 1118} 1119 1120// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1121func (future *CassandraResourcesMigrateCassandraTableToAutoscaleFuture) UnmarshalJSON(body []byte) error { 1122 var azFuture azure.Future 1123 if err := json.Unmarshal(body, &azFuture); err != nil { 1124 return err 1125 } 1126 future.FutureAPI = &azFuture 1127 future.Result = future.result 1128 return nil 1129} 1130 1131// result is the default implementation for CassandraResourcesMigrateCassandraTableToAutoscaleFuture.Result. 1132func (future *CassandraResourcesMigrateCassandraTableToAutoscaleFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 1133 var done bool 1134 done, err = future.DoneWithContext(context.Background(), client) 1135 if err != nil { 1136 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraTableToAutoscaleFuture", "Result", future.Response(), "Polling failure") 1137 return 1138 } 1139 if !done { 1140 tsgr.Response.Response = future.Response() 1141 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraTableToAutoscaleFuture") 1142 return 1143 } 1144 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1145 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 1146 tsgr, err = client.MigrateCassandraTableToAutoscaleResponder(tsgr.Response.Response) 1147 if err != nil { 1148 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraTableToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") 1149 } 1150 } 1151 return 1152} 1153 1154// CassandraResourcesMigrateCassandraTableToManualThroughputFuture an abstraction for monitoring and 1155// retrieving the results of a long-running operation. 1156type CassandraResourcesMigrateCassandraTableToManualThroughputFuture struct { 1157 azure.FutureAPI 1158 // Result returns the result of the asynchronous operation. 1159 // If the operation has not completed it will return an error. 1160 Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) 1161} 1162 1163// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1164func (future *CassandraResourcesMigrateCassandraTableToManualThroughputFuture) UnmarshalJSON(body []byte) error { 1165 var azFuture azure.Future 1166 if err := json.Unmarshal(body, &azFuture); err != nil { 1167 return err 1168 } 1169 future.FutureAPI = &azFuture 1170 future.Result = future.result 1171 return nil 1172} 1173 1174// result is the default implementation for CassandraResourcesMigrateCassandraTableToManualThroughputFuture.Result. 1175func (future *CassandraResourcesMigrateCassandraTableToManualThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 1176 var done bool 1177 done, err = future.DoneWithContext(context.Background(), client) 1178 if err != nil { 1179 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraTableToManualThroughputFuture", "Result", future.Response(), "Polling failure") 1180 return 1181 } 1182 if !done { 1183 tsgr.Response.Response = future.Response() 1184 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesMigrateCassandraTableToManualThroughputFuture") 1185 return 1186 } 1187 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1188 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 1189 tsgr, err = client.MigrateCassandraTableToManualThroughputResponder(tsgr.Response.Response) 1190 if err != nil { 1191 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesMigrateCassandraTableToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 1192 } 1193 } 1194 return 1195} 1196 1197// CassandraResourcesUpdateCassandraKeyspaceThroughputFuture an abstraction for monitoring and retrieving 1198// the results of a long-running operation. 1199type CassandraResourcesUpdateCassandraKeyspaceThroughputFuture struct { 1200 azure.FutureAPI 1201 // Result returns the result of the asynchronous operation. 1202 // If the operation has not completed it will return an error. 1203 Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) 1204} 1205 1206// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1207func (future *CassandraResourcesUpdateCassandraKeyspaceThroughputFuture) UnmarshalJSON(body []byte) error { 1208 var azFuture azure.Future 1209 if err := json.Unmarshal(body, &azFuture); err != nil { 1210 return err 1211 } 1212 future.FutureAPI = &azFuture 1213 future.Result = future.result 1214 return nil 1215} 1216 1217// result is the default implementation for CassandraResourcesUpdateCassandraKeyspaceThroughputFuture.Result. 1218func (future *CassandraResourcesUpdateCassandraKeyspaceThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 1219 var done bool 1220 done, err = future.DoneWithContext(context.Background(), client) 1221 if err != nil { 1222 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture", "Result", future.Response(), "Polling failure") 1223 return 1224 } 1225 if !done { 1226 tsgr.Response.Response = future.Response() 1227 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture") 1228 return 1229 } 1230 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1231 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 1232 tsgr, err = client.UpdateCassandraKeyspaceThroughputResponder(tsgr.Response.Response) 1233 if err != nil { 1234 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraKeyspaceThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 1235 } 1236 } 1237 return 1238} 1239 1240// CassandraResourcesUpdateCassandraTableThroughputFuture an abstraction for monitoring and retrieving the 1241// results of a long-running operation. 1242type CassandraResourcesUpdateCassandraTableThroughputFuture struct { 1243 azure.FutureAPI 1244 // Result returns the result of the asynchronous operation. 1245 // If the operation has not completed it will return an error. 1246 Result func(CassandraResourcesClient) (ThroughputSettingsGetResults, error) 1247} 1248 1249// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1250func (future *CassandraResourcesUpdateCassandraTableThroughputFuture) UnmarshalJSON(body []byte) error { 1251 var azFuture azure.Future 1252 if err := json.Unmarshal(body, &azFuture); err != nil { 1253 return err 1254 } 1255 future.FutureAPI = &azFuture 1256 future.Result = future.result 1257 return nil 1258} 1259 1260// result is the default implementation for CassandraResourcesUpdateCassandraTableThroughputFuture.Result. 1261func (future *CassandraResourcesUpdateCassandraTableThroughputFuture) result(client CassandraResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 1262 var done bool 1263 done, err = future.DoneWithContext(context.Background(), client) 1264 if err != nil { 1265 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture", "Result", future.Response(), "Polling failure") 1266 return 1267 } 1268 if !done { 1269 tsgr.Response.Response = future.Response() 1270 err = azure.NewAsyncOpIncompleteError("documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture") 1271 return 1272 } 1273 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1274 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 1275 tsgr, err = client.UpdateCassandraTableThroughputResponder(tsgr.Response.Response) 1276 if err != nil { 1277 err = autorest.NewErrorWithError(err, "documentdb.CassandraResourcesUpdateCassandraTableThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 1278 } 1279 } 1280 return 1281} 1282 1283// CassandraSchema cosmos DB Cassandra table schema 1284type CassandraSchema struct { 1285 // Columns - List of Cassandra table columns. 1286 Columns *[]Column `json:"columns,omitempty"` 1287 // PartitionKeys - List of partition key. 1288 PartitionKeys *[]CassandraPartitionKey `json:"partitionKeys,omitempty"` 1289 // ClusterKeys - List of cluster key. 1290 ClusterKeys *[]ClusterKey `json:"clusterKeys,omitempty"` 1291} 1292 1293// CassandraTableCreateUpdateParameters parameters to create and update Cosmos DB Cassandra table. 1294type CassandraTableCreateUpdateParameters struct { 1295 // CassandraTableCreateUpdateProperties - Properties to create and update Azure Cosmos DB Cassandra table. 1296 *CassandraTableCreateUpdateProperties `json:"properties,omitempty"` 1297 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 1298 ID *string `json:"id,omitempty"` 1299 // Name - READ-ONLY; The name of the ARM resource. 1300 Name *string `json:"name,omitempty"` 1301 // Type - READ-ONLY; The type of Azure resource. 1302 Type *string `json:"type,omitempty"` 1303 // Location - The location of the resource group to which the resource belongs. 1304 Location *string `json:"location,omitempty"` 1305 Tags map[string]*string `json:"tags"` 1306 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 1307} 1308 1309// MarshalJSON is the custom marshaler for CassandraTableCreateUpdateParameters. 1310func (ctcup CassandraTableCreateUpdateParameters) MarshalJSON() ([]byte, error) { 1311 objectMap := make(map[string]interface{}) 1312 if ctcup.CassandraTableCreateUpdateProperties != nil { 1313 objectMap["properties"] = ctcup.CassandraTableCreateUpdateProperties 1314 } 1315 if ctcup.Location != nil { 1316 objectMap["location"] = ctcup.Location 1317 } 1318 if ctcup.Tags != nil { 1319 objectMap["tags"] = ctcup.Tags 1320 } 1321 if ctcup.Identity != nil { 1322 objectMap["identity"] = ctcup.Identity 1323 } 1324 return json.Marshal(objectMap) 1325} 1326 1327// UnmarshalJSON is the custom unmarshaler for CassandraTableCreateUpdateParameters struct. 1328func (ctcup *CassandraTableCreateUpdateParameters) UnmarshalJSON(body []byte) error { 1329 var m map[string]*json.RawMessage 1330 err := json.Unmarshal(body, &m) 1331 if err != nil { 1332 return err 1333 } 1334 for k, v := range m { 1335 switch k { 1336 case "properties": 1337 if v != nil { 1338 var cassandraTableCreateUpdateProperties CassandraTableCreateUpdateProperties 1339 err = json.Unmarshal(*v, &cassandraTableCreateUpdateProperties) 1340 if err != nil { 1341 return err 1342 } 1343 ctcup.CassandraTableCreateUpdateProperties = &cassandraTableCreateUpdateProperties 1344 } 1345 case "id": 1346 if v != nil { 1347 var ID string 1348 err = json.Unmarshal(*v, &ID) 1349 if err != nil { 1350 return err 1351 } 1352 ctcup.ID = &ID 1353 } 1354 case "name": 1355 if v != nil { 1356 var name string 1357 err = json.Unmarshal(*v, &name) 1358 if err != nil { 1359 return err 1360 } 1361 ctcup.Name = &name 1362 } 1363 case "type": 1364 if v != nil { 1365 var typeVar string 1366 err = json.Unmarshal(*v, &typeVar) 1367 if err != nil { 1368 return err 1369 } 1370 ctcup.Type = &typeVar 1371 } 1372 case "location": 1373 if v != nil { 1374 var location string 1375 err = json.Unmarshal(*v, &location) 1376 if err != nil { 1377 return err 1378 } 1379 ctcup.Location = &location 1380 } 1381 case "tags": 1382 if v != nil { 1383 var tags map[string]*string 1384 err = json.Unmarshal(*v, &tags) 1385 if err != nil { 1386 return err 1387 } 1388 ctcup.Tags = tags 1389 } 1390 case "identity": 1391 if v != nil { 1392 var identity ManagedServiceIdentity 1393 err = json.Unmarshal(*v, &identity) 1394 if err != nil { 1395 return err 1396 } 1397 ctcup.Identity = &identity 1398 } 1399 } 1400 } 1401 1402 return nil 1403} 1404 1405// CassandraTableCreateUpdateProperties properties to create and update Azure Cosmos DB Cassandra table. 1406type CassandraTableCreateUpdateProperties struct { 1407 // Resource - The standard JSON format of a Cassandra table 1408 Resource *CassandraTableResource `json:"resource,omitempty"` 1409 // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. 1410 Options *CreateUpdateOptions `json:"options,omitempty"` 1411} 1412 1413// CassandraTableGetProperties the properties of an Azure Cosmos DB Cassandra table 1414type CassandraTableGetProperties struct { 1415 Resource *CassandraTableGetPropertiesResource `json:"resource,omitempty"` 1416 Options *CassandraTableGetPropertiesOptions `json:"options,omitempty"` 1417} 1418 1419// CassandraTableGetPropertiesOptions ... 1420type CassandraTableGetPropertiesOptions struct { 1421 // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. 1422 Throughput *int32 `json:"throughput,omitempty"` 1423 // AutoscaleSettings - Specifies the Autoscale settings. 1424 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` 1425} 1426 1427// CassandraTableGetPropertiesResource ... 1428type CassandraTableGetPropertiesResource struct { 1429 // ID - Name of the Cosmos DB Cassandra table 1430 ID *string `json:"id,omitempty"` 1431 // DefaultTTL - Time to live of the Cosmos DB Cassandra table 1432 DefaultTTL *int32 `json:"defaultTtl,omitempty"` 1433 // Schema - Schema of the Cosmos DB Cassandra table 1434 Schema *CassandraSchema `json:"schema,omitempty"` 1435 // AnalyticalStorageTTL - Analytical TTL. 1436 AnalyticalStorageTTL *int32 `json:"analyticalStorageTtl,omitempty"` 1437 // Rid - READ-ONLY; A system generated property. A unique identifier. 1438 Rid *string `json:"_rid,omitempty"` 1439 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 1440 Ts *float64 `json:"_ts,omitempty"` 1441 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 1442 Etag *string `json:"_etag,omitempty"` 1443} 1444 1445// MarshalJSON is the custom marshaler for CassandraTableGetPropertiesResource. 1446func (ctgp CassandraTableGetPropertiesResource) MarshalJSON() ([]byte, error) { 1447 objectMap := make(map[string]interface{}) 1448 if ctgp.ID != nil { 1449 objectMap["id"] = ctgp.ID 1450 } 1451 if ctgp.DefaultTTL != nil { 1452 objectMap["defaultTtl"] = ctgp.DefaultTTL 1453 } 1454 if ctgp.Schema != nil { 1455 objectMap["schema"] = ctgp.Schema 1456 } 1457 if ctgp.AnalyticalStorageTTL != nil { 1458 objectMap["analyticalStorageTtl"] = ctgp.AnalyticalStorageTTL 1459 } 1460 return json.Marshal(objectMap) 1461} 1462 1463// CassandraTableGetResults an Azure Cosmos DB Cassandra table. 1464type CassandraTableGetResults struct { 1465 autorest.Response `json:"-"` 1466 // CassandraTableGetProperties - The properties of an Azure Cosmos DB Cassandra table 1467 *CassandraTableGetProperties `json:"properties,omitempty"` 1468 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 1469 ID *string `json:"id,omitempty"` 1470 // Name - READ-ONLY; The name of the ARM resource. 1471 Name *string `json:"name,omitempty"` 1472 // Type - READ-ONLY; The type of Azure resource. 1473 Type *string `json:"type,omitempty"` 1474 // Location - The location of the resource group to which the resource belongs. 1475 Location *string `json:"location,omitempty"` 1476 Tags map[string]*string `json:"tags"` 1477 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 1478} 1479 1480// MarshalJSON is the custom marshaler for CassandraTableGetResults. 1481func (ctgr CassandraTableGetResults) MarshalJSON() ([]byte, error) { 1482 objectMap := make(map[string]interface{}) 1483 if ctgr.CassandraTableGetProperties != nil { 1484 objectMap["properties"] = ctgr.CassandraTableGetProperties 1485 } 1486 if ctgr.Location != nil { 1487 objectMap["location"] = ctgr.Location 1488 } 1489 if ctgr.Tags != nil { 1490 objectMap["tags"] = ctgr.Tags 1491 } 1492 if ctgr.Identity != nil { 1493 objectMap["identity"] = ctgr.Identity 1494 } 1495 return json.Marshal(objectMap) 1496} 1497 1498// UnmarshalJSON is the custom unmarshaler for CassandraTableGetResults struct. 1499func (ctgr *CassandraTableGetResults) UnmarshalJSON(body []byte) error { 1500 var m map[string]*json.RawMessage 1501 err := json.Unmarshal(body, &m) 1502 if err != nil { 1503 return err 1504 } 1505 for k, v := range m { 1506 switch k { 1507 case "properties": 1508 if v != nil { 1509 var cassandraTableGetProperties CassandraTableGetProperties 1510 err = json.Unmarshal(*v, &cassandraTableGetProperties) 1511 if err != nil { 1512 return err 1513 } 1514 ctgr.CassandraTableGetProperties = &cassandraTableGetProperties 1515 } 1516 case "id": 1517 if v != nil { 1518 var ID string 1519 err = json.Unmarshal(*v, &ID) 1520 if err != nil { 1521 return err 1522 } 1523 ctgr.ID = &ID 1524 } 1525 case "name": 1526 if v != nil { 1527 var name string 1528 err = json.Unmarshal(*v, &name) 1529 if err != nil { 1530 return err 1531 } 1532 ctgr.Name = &name 1533 } 1534 case "type": 1535 if v != nil { 1536 var typeVar string 1537 err = json.Unmarshal(*v, &typeVar) 1538 if err != nil { 1539 return err 1540 } 1541 ctgr.Type = &typeVar 1542 } 1543 case "location": 1544 if v != nil { 1545 var location string 1546 err = json.Unmarshal(*v, &location) 1547 if err != nil { 1548 return err 1549 } 1550 ctgr.Location = &location 1551 } 1552 case "tags": 1553 if v != nil { 1554 var tags map[string]*string 1555 err = json.Unmarshal(*v, &tags) 1556 if err != nil { 1557 return err 1558 } 1559 ctgr.Tags = tags 1560 } 1561 case "identity": 1562 if v != nil { 1563 var identity ManagedServiceIdentity 1564 err = json.Unmarshal(*v, &identity) 1565 if err != nil { 1566 return err 1567 } 1568 ctgr.Identity = &identity 1569 } 1570 } 1571 } 1572 1573 return nil 1574} 1575 1576// CassandraTableListResult the List operation response, that contains the Cassandra tables and their 1577// properties. 1578type CassandraTableListResult struct { 1579 autorest.Response `json:"-"` 1580 // Value - READ-ONLY; List of Cassandra tables and their properties. 1581 Value *[]CassandraTableGetResults `json:"value,omitempty"` 1582} 1583 1584// MarshalJSON is the custom marshaler for CassandraTableListResult. 1585func (ctlr CassandraTableListResult) MarshalJSON() ([]byte, error) { 1586 objectMap := make(map[string]interface{}) 1587 return json.Marshal(objectMap) 1588} 1589 1590// CassandraTableResource cosmos DB Cassandra table resource object 1591type CassandraTableResource struct { 1592 // ID - Name of the Cosmos DB Cassandra table 1593 ID *string `json:"id,omitempty"` 1594 // DefaultTTL - Time to live of the Cosmos DB Cassandra table 1595 DefaultTTL *int32 `json:"defaultTtl,omitempty"` 1596 // Schema - Schema of the Cosmos DB Cassandra table 1597 Schema *CassandraSchema `json:"schema,omitempty"` 1598 // AnalyticalStorageTTL - Analytical TTL. 1599 AnalyticalStorageTTL *int32 `json:"analyticalStorageTtl,omitempty"` 1600} 1601 1602// Certificate ... 1603type Certificate struct { 1604 // Pem - PEM formatted public key. 1605 Pem *string `json:"pem,omitempty"` 1606} 1607 1608// CloudError an error response from the service. 1609type CloudError struct { 1610 Error *ErrorResponse `json:"error,omitempty"` 1611} 1612 1613// ClusterKey cosmos DB Cassandra table cluster key 1614type ClusterKey struct { 1615 // Name - Name of the Cosmos DB Cassandra table cluster key 1616 Name *string `json:"name,omitempty"` 1617 // OrderBy - Order of the Cosmos DB Cassandra table cluster key, only support "Asc" and "Desc" 1618 OrderBy *string `json:"orderBy,omitempty"` 1619} 1620 1621// ClusterNodeStatus the status of all nodes in the cluster (as returned by 'nodetool status'). 1622type ClusterNodeStatus struct { 1623 autorest.Response `json:"-"` 1624 // Nodes - Information about nodes in the cluster (corresponds to what is returned from nodetool info). 1625 Nodes *[]ClusterNodeStatusNodesItem `json:"nodes,omitempty"` 1626} 1627 1628// ClusterNodeStatusNodesItem ... 1629type ClusterNodeStatusNodesItem struct { 1630 // Datacenter - The Cassandra data center this node resides in. 1631 Datacenter *string `json:"datacenter,omitempty"` 1632 // Status - Indicates whether the node is functioning or not. Possible values include: 'NodeStatusUp', 'NodeStatusDown' 1633 Status NodeStatus `json:"status,omitempty"` 1634 // State - The state of the node in relation to the cluster. Possible values include: 'NodeStateNormal', 'NodeStateLeaving', 'NodeStateJoining', 'NodeStateMoving', 'NodeStateStopped' 1635 State NodeState `json:"state,omitempty"` 1636 // Address - The node's URL. 1637 Address *string `json:"address,omitempty"` 1638 // Load - The amount of file system data in the data directory (e.g., 47.66 KB), excluding all content in the snapshots subdirectories. Because all SSTable data files are included, any data that is not cleaned up (such as TTL-expired cell or tombstoned data) is counted. 1639 Load *string `json:"load,omitempty"` 1640 // Tokens - List of tokens. 1641 Tokens *[]string `json:"tokens,omitempty"` 1642 // Owns - The percentage of the data owned by the node per datacenter times the replication factor (e.g., 33.3, or null if the data is not available). For example, a node can own 33% of the ring, but shows 100% if the replication factor is 3. For non-system keyspaces, the endpoint percentage ownership information is shown. 1643 Owns *float64 `json:"owns,omitempty"` 1644 // HostID - The network ID of the node. 1645 HostID *string `json:"hostId,omitempty"` 1646 // Rack - The rack this node is part of. 1647 Rack *string `json:"rack,omitempty"` 1648} 1649 1650// ClusterResource representation of a managed Cassandra cluster. 1651type ClusterResource struct { 1652 autorest.Response `json:"-"` 1653 // Properties - Properties of a managed Cassandra cluster. 1654 Properties *ClusterResourceProperties `json:"properties,omitempty"` 1655 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 1656 ID *string `json:"id,omitempty"` 1657 // Name - READ-ONLY; The name of the ARM resource. 1658 Name *string `json:"name,omitempty"` 1659 // Type - READ-ONLY; The type of Azure resource. 1660 Type *string `json:"type,omitempty"` 1661 // Location - The location of the resource group to which the resource belongs. 1662 Location *string `json:"location,omitempty"` 1663 Tags map[string]*string `json:"tags"` 1664 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 1665} 1666 1667// MarshalJSON is the custom marshaler for ClusterResource. 1668func (cr ClusterResource) MarshalJSON() ([]byte, error) { 1669 objectMap := make(map[string]interface{}) 1670 if cr.Properties != nil { 1671 objectMap["properties"] = cr.Properties 1672 } 1673 if cr.Location != nil { 1674 objectMap["location"] = cr.Location 1675 } 1676 if cr.Tags != nil { 1677 objectMap["tags"] = cr.Tags 1678 } 1679 if cr.Identity != nil { 1680 objectMap["identity"] = cr.Identity 1681 } 1682 return json.Marshal(objectMap) 1683} 1684 1685// ClusterResourceProperties properties of a managed Cassandra cluster. 1686type ClusterResourceProperties struct { 1687 // ProvisioningState - Possible values include: 'ManagedCassandraProvisioningStateCreating', 'ManagedCassandraProvisioningStateUpdating', 'ManagedCassandraProvisioningStateDeleting', 'ManagedCassandraProvisioningStateSucceeded', 'ManagedCassandraProvisioningStateFailed', 'ManagedCassandraProvisioningStateCanceled' 1688 ProvisioningState ManagedCassandraProvisioningState `json:"provisioningState,omitempty"` 1689 // RestoreFromBackupID - To create an empty cluster, omit this field or set it to null. To restore a backup into a new cluster, set this field to the resource id of the backup. 1690 RestoreFromBackupID *string `json:"restoreFromBackupId,omitempty"` 1691 // DelegatedManagementSubnetID - Resource id of a subnet that this cluster's management service should have its network interface attached to. The subnet must be routable to all subnets that will be delegated to data centers. The resource id must be of the form '/subscriptions/<subscription id>/resourceGroups/<resource group>/providers/Microsoft.Network/virtualNetworks/<virtual network>/subnets/<subnet>' 1692 DelegatedManagementSubnetID *string `json:"delegatedManagementSubnetId,omitempty"` 1693 // CassandraVersion - Which version of Cassandra should this cluster converge to running (e.g., 3.11). When updated, the cluster may take some time to migrate to the new version. 1694 CassandraVersion *string `json:"cassandraVersion,omitempty"` 1695 // ClusterNameOverride - If you need to set the clusterName property in cassandra.yaml to something besides the resource name of the cluster, set the value to use on this property. 1696 ClusterNameOverride *string `json:"clusterNameOverride,omitempty"` 1697 // AuthenticationMethod - Which authentication method Cassandra should use to authenticate clients. 'None' turns off authentication, so should not be used except in emergencies. 'Cassandra' is the default password based authentication. The default is 'Cassandra'. Possible values include: 'AuthenticationMethodNone', 'AuthenticationMethodCassandra' 1698 AuthenticationMethod AuthenticationMethod `json:"authenticationMethod,omitempty"` 1699 // InitialCassandraAdminPassword - Initial password for clients connecting as admin to the cluster. Should be changed after cluster creation. Returns null on GET. This field only applies when the authenticationMethod field is 'Cassandra'. 1700 InitialCassandraAdminPassword *string `json:"initialCassandraAdminPassword,omitempty"` 1701 // HoursBetweenBackups - Number of hours to wait between taking a backup of the cluster. To disable backups, set this property to 0. 1702 HoursBetweenBackups *int32 `json:"hoursBetweenBackups,omitempty"` 1703 // PrometheusEndpoint - Hostname or IP address where the Prometheus endpoint containing data about the managed Cassandra nodes can be reached. 1704 PrometheusEndpoint *SeedNode `json:"prometheusEndpoint,omitempty"` 1705 // RepairEnabled - Should automatic repairs run on this cluster? If omitted, this is true, and should stay true unless you are running a hybrid cluster where you are already doing your own repairs. 1706 RepairEnabled *bool `json:"repairEnabled,omitempty"` 1707 // ClientCertificates - List of TLS certificates used to authorize clients connecting to the cluster. All connections are TLS encrypted whether clientCertificates is set or not, but if clientCertificates is set, the managed Cassandra cluster will reject all connections not bearing a TLS client certificate that can be validated from one or more of the public certificates in this property. 1708 ClientCertificates *[]Certificate `json:"clientCertificates,omitempty"` 1709 // ExternalGossipCertificates - List of TLS certificates used to authorize gossip from unmanaged data centers. The TLS certificates of all nodes in unmanaged data centers must be verifiable using one of the certificates provided in this property. 1710 ExternalGossipCertificates *[]Certificate `json:"externalGossipCertificates,omitempty"` 1711 // GossipCertificates - READ-ONLY; List of TLS certificates that unmanaged nodes must trust for gossip with managed nodes. All managed nodes will present TLS client certificates that are verifiable using one of the certificates provided in this property. 1712 GossipCertificates *[]Certificate `json:"gossipCertificates,omitempty"` 1713 // ExternalSeedNodes - List of IP addresses of seed nodes in unmanaged data centers. These will be added to the seed node lists of all managed nodes. 1714 ExternalSeedNodes *[]SeedNode `json:"externalSeedNodes,omitempty"` 1715 // SeedNodes - READ-ONLY; List of IP addresses of seed nodes in the managed data centers. These should be added to the seed node lists of all unmanaged nodes. 1716 SeedNodes *[]SeedNode `json:"seedNodes,omitempty"` 1717} 1718 1719// MarshalJSON is the custom marshaler for ClusterResourceProperties. 1720func (cr ClusterResourceProperties) MarshalJSON() ([]byte, error) { 1721 objectMap := make(map[string]interface{}) 1722 if cr.ProvisioningState != "" { 1723 objectMap["provisioningState"] = cr.ProvisioningState 1724 } 1725 if cr.RestoreFromBackupID != nil { 1726 objectMap["restoreFromBackupId"] = cr.RestoreFromBackupID 1727 } 1728 if cr.DelegatedManagementSubnetID != nil { 1729 objectMap["delegatedManagementSubnetId"] = cr.DelegatedManagementSubnetID 1730 } 1731 if cr.CassandraVersion != nil { 1732 objectMap["cassandraVersion"] = cr.CassandraVersion 1733 } 1734 if cr.ClusterNameOverride != nil { 1735 objectMap["clusterNameOverride"] = cr.ClusterNameOverride 1736 } 1737 if cr.AuthenticationMethod != "" { 1738 objectMap["authenticationMethod"] = cr.AuthenticationMethod 1739 } 1740 if cr.InitialCassandraAdminPassword != nil { 1741 objectMap["initialCassandraAdminPassword"] = cr.InitialCassandraAdminPassword 1742 } 1743 if cr.HoursBetweenBackups != nil { 1744 objectMap["hoursBetweenBackups"] = cr.HoursBetweenBackups 1745 } 1746 if cr.PrometheusEndpoint != nil { 1747 objectMap["prometheusEndpoint"] = cr.PrometheusEndpoint 1748 } 1749 if cr.RepairEnabled != nil { 1750 objectMap["repairEnabled"] = cr.RepairEnabled 1751 } 1752 if cr.ClientCertificates != nil { 1753 objectMap["clientCertificates"] = cr.ClientCertificates 1754 } 1755 if cr.ExternalGossipCertificates != nil { 1756 objectMap["externalGossipCertificates"] = cr.ExternalGossipCertificates 1757 } 1758 if cr.ExternalSeedNodes != nil { 1759 objectMap["externalSeedNodes"] = cr.ExternalSeedNodes 1760 } 1761 return json.Marshal(objectMap) 1762} 1763 1764// Column cosmos DB Cassandra table column 1765type Column struct { 1766 // Name - Name of the Cosmos DB Cassandra table column 1767 Name *string `json:"name,omitempty"` 1768 // Type - Type of the Cosmos DB Cassandra table column 1769 Type *string `json:"type,omitempty"` 1770} 1771 1772// CompositePath ... 1773type CompositePath struct { 1774 // Path - The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) 1775 Path *string `json:"path,omitempty"` 1776 // Order - Sort order for composite paths. Possible values include: 'CompositePathSortOrderAscending', 'CompositePathSortOrderDescending' 1777 Order CompositePathSortOrder `json:"order,omitempty"` 1778} 1779 1780// ConflictResolutionPolicy the conflict resolution policy for the container. 1781type ConflictResolutionPolicy struct { 1782 // Mode - Indicates the conflict resolution mode. Possible values include: 'ConflictResolutionModeLastWriterWins', 'ConflictResolutionModeCustom' 1783 Mode ConflictResolutionMode `json:"mode,omitempty"` 1784 // ConflictResolutionPath - The conflict resolution path in the case of LastWriterWins mode. 1785 ConflictResolutionPath *string `json:"conflictResolutionPath,omitempty"` 1786 // ConflictResolutionProcedure - The procedure to resolve conflicts in the case of custom mode. 1787 ConflictResolutionProcedure *string `json:"conflictResolutionProcedure,omitempty"` 1788} 1789 1790// ConsistencyPolicy the consistency policy for the Cosmos DB database account. 1791type ConsistencyPolicy struct { 1792 // DefaultConsistencyLevel - The default consistency level and configuration settings of the Cosmos DB account. Possible values include: 'DefaultConsistencyLevelEventual', 'DefaultConsistencyLevelSession', 'DefaultConsistencyLevelBoundedStaleness', 'DefaultConsistencyLevelStrong', 'DefaultConsistencyLevelConsistentPrefix' 1793 DefaultConsistencyLevel DefaultConsistencyLevel `json:"defaultConsistencyLevel,omitempty"` 1794 // 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'. 1795 MaxStalenessPrefix *int64 `json:"maxStalenessPrefix,omitempty"` 1796 // 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'. 1797 MaxIntervalInSeconds *int32 `json:"maxIntervalInSeconds,omitempty"` 1798} 1799 1800// ContainerPartitionKey the configuration of the partition key to be used for partitioning data into 1801// multiple partitions 1802type ContainerPartitionKey struct { 1803 // Paths - List of paths using which data within the container can be partitioned 1804 Paths *[]string `json:"paths,omitempty"` 1805 // Kind - Indicates the kind of algorithm used for partitioning. For MultiHash, multiple partition keys (upto three maximum) are supported for container create. Possible values include: 'PartitionKindHash', 'PartitionKindRange', 'PartitionKindMultiHash' 1806 Kind PartitionKind `json:"kind,omitempty"` 1807 // Version - Indicates the version of the partition key definition 1808 Version *int32 `json:"version,omitempty"` 1809 // SystemKey - READ-ONLY; Indicates if the container is using a system generated partition key 1810 SystemKey *bool `json:"systemKey,omitempty"` 1811} 1812 1813// MarshalJSON is the custom marshaler for ContainerPartitionKey. 1814func (cpk ContainerPartitionKey) MarshalJSON() ([]byte, error) { 1815 objectMap := make(map[string]interface{}) 1816 if cpk.Paths != nil { 1817 objectMap["paths"] = cpk.Paths 1818 } 1819 if cpk.Kind != "" { 1820 objectMap["kind"] = cpk.Kind 1821 } 1822 if cpk.Version != nil { 1823 objectMap["version"] = cpk.Version 1824 } 1825 return json.Marshal(objectMap) 1826} 1827 1828// ContinuousModeBackupPolicy the object representing continuous mode backup policy. 1829type ContinuousModeBackupPolicy struct { 1830 // Type - Possible values include: 'TypeBackupPolicy', 'TypePeriodic', 'TypeContinuous' 1831 Type Type `json:"type,omitempty"` 1832} 1833 1834// MarshalJSON is the custom marshaler for ContinuousModeBackupPolicy. 1835func (cmbp ContinuousModeBackupPolicy) MarshalJSON() ([]byte, error) { 1836 cmbp.Type = TypeContinuous 1837 objectMap := make(map[string]interface{}) 1838 if cmbp.Type != "" { 1839 objectMap["type"] = cmbp.Type 1840 } 1841 return json.Marshal(objectMap) 1842} 1843 1844// AsPeriodicModeBackupPolicy is the BasicBackupPolicy implementation for ContinuousModeBackupPolicy. 1845func (cmbp ContinuousModeBackupPolicy) AsPeriodicModeBackupPolicy() (*PeriodicModeBackupPolicy, bool) { 1846 return nil, false 1847} 1848 1849// AsContinuousModeBackupPolicy is the BasicBackupPolicy implementation for ContinuousModeBackupPolicy. 1850func (cmbp ContinuousModeBackupPolicy) AsContinuousModeBackupPolicy() (*ContinuousModeBackupPolicy, bool) { 1851 return &cmbp, true 1852} 1853 1854// AsBackupPolicy is the BasicBackupPolicy implementation for ContinuousModeBackupPolicy. 1855func (cmbp ContinuousModeBackupPolicy) AsBackupPolicy() (*BackupPolicy, bool) { 1856 return nil, false 1857} 1858 1859// AsBasicBackupPolicy is the BasicBackupPolicy implementation for ContinuousModeBackupPolicy. 1860func (cmbp ContinuousModeBackupPolicy) AsBasicBackupPolicy() (BasicBackupPolicy, bool) { 1861 return &cmbp, true 1862} 1863 1864// CorsPolicy the CORS policy for the Cosmos DB database account. 1865type CorsPolicy struct { 1866 // AllowedOrigins - The origin domains that are permitted to make a request against the service via CORS. 1867 AllowedOrigins *string `json:"allowedOrigins,omitempty"` 1868 // AllowedMethods - The methods (HTTP request verbs) that the origin domain may use for a CORS request. 1869 AllowedMethods *string `json:"allowedMethods,omitempty"` 1870 // AllowedHeaders - The request headers that the origin domain may specify on the CORS request. 1871 AllowedHeaders *string `json:"allowedHeaders,omitempty"` 1872 // ExposedHeaders - The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer. 1873 ExposedHeaders *string `json:"exposedHeaders,omitempty"` 1874 // MaxAgeInSeconds - The maximum amount time that a browser should cache the preflight OPTIONS request. 1875 MaxAgeInSeconds *int64 `json:"maxAgeInSeconds,omitempty"` 1876} 1877 1878// CreateUpdateOptions createUpdateOptions are a list of key-value pairs that describe the resource. 1879// Supported keys are "If-Match", "If-None-Match", "Session-Token" and "Throughput" 1880type CreateUpdateOptions struct { 1881 // Throughput - Request Units per second. For example, "throughput": 10000. 1882 Throughput *int32 `json:"throughput,omitempty"` 1883 // AutoscaleSettings - Specifies the Autoscale settings. 1884 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` 1885} 1886 1887// DatabaseAccountConnectionString connection string for the Cosmos DB account 1888type DatabaseAccountConnectionString struct { 1889 // ConnectionString - READ-ONLY; Value of the connection string 1890 ConnectionString *string `json:"connectionString,omitempty"` 1891 // Description - READ-ONLY; Description of the connection string 1892 Description *string `json:"description,omitempty"` 1893} 1894 1895// MarshalJSON is the custom marshaler for DatabaseAccountConnectionString. 1896func (dacs DatabaseAccountConnectionString) MarshalJSON() ([]byte, error) { 1897 objectMap := make(map[string]interface{}) 1898 return json.Marshal(objectMap) 1899} 1900 1901// DatabaseAccountCreateUpdateParameters parameters to create and update Cosmos DB database accounts. 1902type DatabaseAccountCreateUpdateParameters struct { 1903 // Kind - Indicates the type of database account. This can only be set at database account creation. Possible values include: 'DatabaseAccountKindGlobalDocumentDB', 'DatabaseAccountKindMongoDB', 'DatabaseAccountKindParse' 1904 Kind DatabaseAccountKind `json:"kind,omitempty"` 1905 Properties BasicDatabaseAccountCreateUpdateProperties `json:"properties,omitempty"` 1906 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 1907 ID *string `json:"id,omitempty"` 1908 // Name - READ-ONLY; The name of the ARM resource. 1909 Name *string `json:"name,omitempty"` 1910 // Type - READ-ONLY; The type of Azure resource. 1911 Type *string `json:"type,omitempty"` 1912 // Location - The location of the resource group to which the resource belongs. 1913 Location *string `json:"location,omitempty"` 1914 Tags map[string]*string `json:"tags"` 1915 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 1916} 1917 1918// MarshalJSON is the custom marshaler for DatabaseAccountCreateUpdateParameters. 1919func (dacup DatabaseAccountCreateUpdateParameters) MarshalJSON() ([]byte, error) { 1920 objectMap := make(map[string]interface{}) 1921 if dacup.Kind != "" { 1922 objectMap["kind"] = dacup.Kind 1923 } 1924 objectMap["properties"] = dacup.Properties 1925 if dacup.Location != nil { 1926 objectMap["location"] = dacup.Location 1927 } 1928 if dacup.Tags != nil { 1929 objectMap["tags"] = dacup.Tags 1930 } 1931 if dacup.Identity != nil { 1932 objectMap["identity"] = dacup.Identity 1933 } 1934 return json.Marshal(objectMap) 1935} 1936 1937// UnmarshalJSON is the custom unmarshaler for DatabaseAccountCreateUpdateParameters struct. 1938func (dacup *DatabaseAccountCreateUpdateParameters) UnmarshalJSON(body []byte) error { 1939 var m map[string]*json.RawMessage 1940 err := json.Unmarshal(body, &m) 1941 if err != nil { 1942 return err 1943 } 1944 for k, v := range m { 1945 switch k { 1946 case "kind": 1947 if v != nil { 1948 var kind DatabaseAccountKind 1949 err = json.Unmarshal(*v, &kind) 1950 if err != nil { 1951 return err 1952 } 1953 dacup.Kind = kind 1954 } 1955 case "properties": 1956 if v != nil { 1957 properties, err := unmarshalBasicDatabaseAccountCreateUpdateProperties(*v) 1958 if err != nil { 1959 return err 1960 } 1961 dacup.Properties = properties 1962 } 1963 case "id": 1964 if v != nil { 1965 var ID string 1966 err = json.Unmarshal(*v, &ID) 1967 if err != nil { 1968 return err 1969 } 1970 dacup.ID = &ID 1971 } 1972 case "name": 1973 if v != nil { 1974 var name string 1975 err = json.Unmarshal(*v, &name) 1976 if err != nil { 1977 return err 1978 } 1979 dacup.Name = &name 1980 } 1981 case "type": 1982 if v != nil { 1983 var typeVar string 1984 err = json.Unmarshal(*v, &typeVar) 1985 if err != nil { 1986 return err 1987 } 1988 dacup.Type = &typeVar 1989 } 1990 case "location": 1991 if v != nil { 1992 var location string 1993 err = json.Unmarshal(*v, &location) 1994 if err != nil { 1995 return err 1996 } 1997 dacup.Location = &location 1998 } 1999 case "tags": 2000 if v != nil { 2001 var tags map[string]*string 2002 err = json.Unmarshal(*v, &tags) 2003 if err != nil { 2004 return err 2005 } 2006 dacup.Tags = tags 2007 } 2008 case "identity": 2009 if v != nil { 2010 var identity ManagedServiceIdentity 2011 err = json.Unmarshal(*v, &identity) 2012 if err != nil { 2013 return err 2014 } 2015 dacup.Identity = &identity 2016 } 2017 } 2018 } 2019 2020 return nil 2021} 2022 2023// BasicDatabaseAccountCreateUpdateProperties properties to create and update Azure Cosmos DB database accounts. 2024type BasicDatabaseAccountCreateUpdateProperties interface { 2025 AsDefaultRequestDatabaseAccountCreateUpdateProperties() (*DefaultRequestDatabaseAccountCreateUpdateProperties, bool) 2026 AsRestoreReqeustDatabaseAccountCreateUpdateProperties() (*RestoreReqeustDatabaseAccountCreateUpdateProperties, bool) 2027 AsDatabaseAccountCreateUpdateProperties() (*DatabaseAccountCreateUpdateProperties, bool) 2028} 2029 2030// DatabaseAccountCreateUpdateProperties properties to create and update Azure Cosmos DB database accounts. 2031type DatabaseAccountCreateUpdateProperties struct { 2032 // ConsistencyPolicy - The consistency policy for the Cosmos DB account. 2033 ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"` 2034 // Locations - An array that contains the georeplication locations enabled for the Cosmos DB account. 2035 Locations *[]Location `json:"locations,omitempty"` 2036 // DatabaseAccountOfferType - The offer type for the database 2037 DatabaseAccountOfferType *string `json:"databaseAccountOfferType,omitempty"` 2038 // IPRules - List of IpRules. 2039 IPRules *[]IPAddressOrRange `json:"ipRules,omitempty"` 2040 // IsVirtualNetworkFilterEnabled - Flag to indicate whether to enable/disable Virtual Network ACL rules. 2041 IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"` 2042 // 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. 2043 EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"` 2044 // Capabilities - List of Cosmos DB capabilities for the account 2045 Capabilities *[]Capability `json:"capabilities,omitempty"` 2046 // VirtualNetworkRules - List of Virtual Network ACL rules configured for the Cosmos DB account. 2047 VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` 2048 // EnableMultipleWriteLocations - Enables the account to write in multiple locations 2049 EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` 2050 // EnableCassandraConnector - Enables the cassandra connector on the Cosmos DB C* account 2051 EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"` 2052 // ConnectorOffer - The cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'ConnectorOfferSmall' 2053 ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"` 2054 // DisableKeyBasedMetadataWriteAccess - Disable write operations on metadata resources (databases, containers, throughput) via account keys 2055 DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"` 2056 // KeyVaultKeyURI - The URI of the key vault 2057 KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"` 2058 // PublicNetworkAccess - Whether requests from Public Network are allowed. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' 2059 PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` 2060 // EnableFreeTier - Flag to indicate whether Free Tier is enabled. 2061 EnableFreeTier *bool `json:"enableFreeTier,omitempty"` 2062 // APIProperties - API specific properties. Currently, supported only for MongoDB API. 2063 APIProperties *APIProperties `json:"apiProperties,omitempty"` 2064 // EnableAnalyticalStorage - Flag to indicate whether to enable storage analytics. 2065 EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"` 2066 // BackupPolicy - The object representing the policy for taking backups on an account. 2067 BackupPolicy BasicBackupPolicy `json:"backupPolicy,omitempty"` 2068 // Cors - The CORS policy for the Cosmos DB database account. 2069 Cors *[]CorsPolicy `json:"cors,omitempty"` 2070 // NetworkACLBypass - Indicates what services are allowed to bypass firewall checks. Possible values include: 'NetworkACLBypassNone', 'NetworkACLBypassAzureServices' 2071 NetworkACLBypass NetworkACLBypass `json:"networkAclBypass,omitempty"` 2072 // NetworkACLBypassResourceIds - An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. 2073 NetworkACLBypassResourceIds *[]string `json:"networkAclBypassResourceIds,omitempty"` 2074 // CreateMode - Possible values include: 'CreateModeBasicDatabaseAccountCreateUpdatePropertiesCreateModeDatabaseAccountCreateUpdateProperties', 'CreateModeBasicDatabaseAccountCreateUpdatePropertiesCreateModeDefault', 'CreateModeBasicDatabaseAccountCreateUpdatePropertiesCreateModeRestore' 2075 CreateMode CreateModeBasicDatabaseAccountCreateUpdateProperties `json:"createMode,omitempty"` 2076} 2077 2078func unmarshalBasicDatabaseAccountCreateUpdateProperties(body []byte) (BasicDatabaseAccountCreateUpdateProperties, error) { 2079 var m map[string]interface{} 2080 err := json.Unmarshal(body, &m) 2081 if err != nil { 2082 return nil, err 2083 } 2084 2085 switch m["createMode"] { 2086 case string(CreateModeBasicDatabaseAccountCreateUpdatePropertiesCreateModeDefault): 2087 var drdacup DefaultRequestDatabaseAccountCreateUpdateProperties 2088 err := json.Unmarshal(body, &drdacup) 2089 return drdacup, err 2090 case string(CreateModeBasicDatabaseAccountCreateUpdatePropertiesCreateModeRestore): 2091 var rrdacup RestoreReqeustDatabaseAccountCreateUpdateProperties 2092 err := json.Unmarshal(body, &rrdacup) 2093 return rrdacup, err 2094 default: 2095 var dacup DatabaseAccountCreateUpdateProperties 2096 err := json.Unmarshal(body, &dacup) 2097 return dacup, err 2098 } 2099} 2100func unmarshalBasicDatabaseAccountCreateUpdatePropertiesArray(body []byte) ([]BasicDatabaseAccountCreateUpdateProperties, error) { 2101 var rawMessages []*json.RawMessage 2102 err := json.Unmarshal(body, &rawMessages) 2103 if err != nil { 2104 return nil, err 2105 } 2106 2107 dacupArray := make([]BasicDatabaseAccountCreateUpdateProperties, len(rawMessages)) 2108 2109 for index, rawMessage := range rawMessages { 2110 dacup, err := unmarshalBasicDatabaseAccountCreateUpdateProperties(*rawMessage) 2111 if err != nil { 2112 return nil, err 2113 } 2114 dacupArray[index] = dacup 2115 } 2116 return dacupArray, nil 2117} 2118 2119// MarshalJSON is the custom marshaler for DatabaseAccountCreateUpdateProperties. 2120func (dacup DatabaseAccountCreateUpdateProperties) MarshalJSON() ([]byte, error) { 2121 dacup.CreateMode = CreateModeBasicDatabaseAccountCreateUpdatePropertiesCreateModeDatabaseAccountCreateUpdateProperties 2122 objectMap := make(map[string]interface{}) 2123 if dacup.ConsistencyPolicy != nil { 2124 objectMap["consistencyPolicy"] = dacup.ConsistencyPolicy 2125 } 2126 if dacup.Locations != nil { 2127 objectMap["locations"] = dacup.Locations 2128 } 2129 if dacup.DatabaseAccountOfferType != nil { 2130 objectMap["databaseAccountOfferType"] = dacup.DatabaseAccountOfferType 2131 } 2132 if dacup.IPRules != nil { 2133 objectMap["ipRules"] = dacup.IPRules 2134 } 2135 if dacup.IsVirtualNetworkFilterEnabled != nil { 2136 objectMap["isVirtualNetworkFilterEnabled"] = dacup.IsVirtualNetworkFilterEnabled 2137 } 2138 if dacup.EnableAutomaticFailover != nil { 2139 objectMap["enableAutomaticFailover"] = dacup.EnableAutomaticFailover 2140 } 2141 if dacup.Capabilities != nil { 2142 objectMap["capabilities"] = dacup.Capabilities 2143 } 2144 if dacup.VirtualNetworkRules != nil { 2145 objectMap["virtualNetworkRules"] = dacup.VirtualNetworkRules 2146 } 2147 if dacup.EnableMultipleWriteLocations != nil { 2148 objectMap["enableMultipleWriteLocations"] = dacup.EnableMultipleWriteLocations 2149 } 2150 if dacup.EnableCassandraConnector != nil { 2151 objectMap["enableCassandraConnector"] = dacup.EnableCassandraConnector 2152 } 2153 if dacup.ConnectorOffer != "" { 2154 objectMap["connectorOffer"] = dacup.ConnectorOffer 2155 } 2156 if dacup.DisableKeyBasedMetadataWriteAccess != nil { 2157 objectMap["disableKeyBasedMetadataWriteAccess"] = dacup.DisableKeyBasedMetadataWriteAccess 2158 } 2159 if dacup.KeyVaultKeyURI != nil { 2160 objectMap["keyVaultKeyUri"] = dacup.KeyVaultKeyURI 2161 } 2162 if dacup.PublicNetworkAccess != "" { 2163 objectMap["publicNetworkAccess"] = dacup.PublicNetworkAccess 2164 } 2165 if dacup.EnableFreeTier != nil { 2166 objectMap["enableFreeTier"] = dacup.EnableFreeTier 2167 } 2168 if dacup.APIProperties != nil { 2169 objectMap["apiProperties"] = dacup.APIProperties 2170 } 2171 if dacup.EnableAnalyticalStorage != nil { 2172 objectMap["enableAnalyticalStorage"] = dacup.EnableAnalyticalStorage 2173 } 2174 objectMap["backupPolicy"] = dacup.BackupPolicy 2175 if dacup.Cors != nil { 2176 objectMap["cors"] = dacup.Cors 2177 } 2178 if dacup.NetworkACLBypass != "" { 2179 objectMap["networkAclBypass"] = dacup.NetworkACLBypass 2180 } 2181 if dacup.NetworkACLBypassResourceIds != nil { 2182 objectMap["networkAclBypassResourceIds"] = dacup.NetworkACLBypassResourceIds 2183 } 2184 if dacup.CreateMode != "" { 2185 objectMap["createMode"] = dacup.CreateMode 2186 } 2187 return json.Marshal(objectMap) 2188} 2189 2190// AsDefaultRequestDatabaseAccountCreateUpdateProperties is the BasicDatabaseAccountCreateUpdateProperties implementation for DatabaseAccountCreateUpdateProperties. 2191func (dacup DatabaseAccountCreateUpdateProperties) AsDefaultRequestDatabaseAccountCreateUpdateProperties() (*DefaultRequestDatabaseAccountCreateUpdateProperties, bool) { 2192 return nil, false 2193} 2194 2195// AsRestoreReqeustDatabaseAccountCreateUpdateProperties is the BasicDatabaseAccountCreateUpdateProperties implementation for DatabaseAccountCreateUpdateProperties. 2196func (dacup DatabaseAccountCreateUpdateProperties) AsRestoreReqeustDatabaseAccountCreateUpdateProperties() (*RestoreReqeustDatabaseAccountCreateUpdateProperties, bool) { 2197 return nil, false 2198} 2199 2200// AsDatabaseAccountCreateUpdateProperties is the BasicDatabaseAccountCreateUpdateProperties implementation for DatabaseAccountCreateUpdateProperties. 2201func (dacup DatabaseAccountCreateUpdateProperties) AsDatabaseAccountCreateUpdateProperties() (*DatabaseAccountCreateUpdateProperties, bool) { 2202 return &dacup, true 2203} 2204 2205// AsBasicDatabaseAccountCreateUpdateProperties is the BasicDatabaseAccountCreateUpdateProperties implementation for DatabaseAccountCreateUpdateProperties. 2206func (dacup DatabaseAccountCreateUpdateProperties) AsBasicDatabaseAccountCreateUpdateProperties() (BasicDatabaseAccountCreateUpdateProperties, bool) { 2207 return &dacup, true 2208} 2209 2210// UnmarshalJSON is the custom unmarshaler for DatabaseAccountCreateUpdateProperties struct. 2211func (dacup *DatabaseAccountCreateUpdateProperties) UnmarshalJSON(body []byte) error { 2212 var m map[string]*json.RawMessage 2213 err := json.Unmarshal(body, &m) 2214 if err != nil { 2215 return err 2216 } 2217 for k, v := range m { 2218 switch k { 2219 case "consistencyPolicy": 2220 if v != nil { 2221 var consistencyPolicy ConsistencyPolicy 2222 err = json.Unmarshal(*v, &consistencyPolicy) 2223 if err != nil { 2224 return err 2225 } 2226 dacup.ConsistencyPolicy = &consistencyPolicy 2227 } 2228 case "locations": 2229 if v != nil { 2230 var locations []Location 2231 err = json.Unmarshal(*v, &locations) 2232 if err != nil { 2233 return err 2234 } 2235 dacup.Locations = &locations 2236 } 2237 case "databaseAccountOfferType": 2238 if v != nil { 2239 var databaseAccountOfferType string 2240 err = json.Unmarshal(*v, &databaseAccountOfferType) 2241 if err != nil { 2242 return err 2243 } 2244 dacup.DatabaseAccountOfferType = &databaseAccountOfferType 2245 } 2246 case "ipRules": 2247 if v != nil { 2248 var IPRules []IPAddressOrRange 2249 err = json.Unmarshal(*v, &IPRules) 2250 if err != nil { 2251 return err 2252 } 2253 dacup.IPRules = &IPRules 2254 } 2255 case "isVirtualNetworkFilterEnabled": 2256 if v != nil { 2257 var isVirtualNetworkFilterEnabled bool 2258 err = json.Unmarshal(*v, &isVirtualNetworkFilterEnabled) 2259 if err != nil { 2260 return err 2261 } 2262 dacup.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled 2263 } 2264 case "enableAutomaticFailover": 2265 if v != nil { 2266 var enableAutomaticFailover bool 2267 err = json.Unmarshal(*v, &enableAutomaticFailover) 2268 if err != nil { 2269 return err 2270 } 2271 dacup.EnableAutomaticFailover = &enableAutomaticFailover 2272 } 2273 case "capabilities": 2274 if v != nil { 2275 var capabilities []Capability 2276 err = json.Unmarshal(*v, &capabilities) 2277 if err != nil { 2278 return err 2279 } 2280 dacup.Capabilities = &capabilities 2281 } 2282 case "virtualNetworkRules": 2283 if v != nil { 2284 var virtualNetworkRules []VirtualNetworkRule 2285 err = json.Unmarshal(*v, &virtualNetworkRules) 2286 if err != nil { 2287 return err 2288 } 2289 dacup.VirtualNetworkRules = &virtualNetworkRules 2290 } 2291 case "enableMultipleWriteLocations": 2292 if v != nil { 2293 var enableMultipleWriteLocations bool 2294 err = json.Unmarshal(*v, &enableMultipleWriteLocations) 2295 if err != nil { 2296 return err 2297 } 2298 dacup.EnableMultipleWriteLocations = &enableMultipleWriteLocations 2299 } 2300 case "enableCassandraConnector": 2301 if v != nil { 2302 var enableCassandraConnector bool 2303 err = json.Unmarshal(*v, &enableCassandraConnector) 2304 if err != nil { 2305 return err 2306 } 2307 dacup.EnableCassandraConnector = &enableCassandraConnector 2308 } 2309 case "connectorOffer": 2310 if v != nil { 2311 var connectorOffer ConnectorOffer 2312 err = json.Unmarshal(*v, &connectorOffer) 2313 if err != nil { 2314 return err 2315 } 2316 dacup.ConnectorOffer = connectorOffer 2317 } 2318 case "disableKeyBasedMetadataWriteAccess": 2319 if v != nil { 2320 var disableKeyBasedMetadataWriteAccess bool 2321 err = json.Unmarshal(*v, &disableKeyBasedMetadataWriteAccess) 2322 if err != nil { 2323 return err 2324 } 2325 dacup.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess 2326 } 2327 case "keyVaultKeyUri": 2328 if v != nil { 2329 var keyVaultKeyURI string 2330 err = json.Unmarshal(*v, &keyVaultKeyURI) 2331 if err != nil { 2332 return err 2333 } 2334 dacup.KeyVaultKeyURI = &keyVaultKeyURI 2335 } 2336 case "publicNetworkAccess": 2337 if v != nil { 2338 var publicNetworkAccess PublicNetworkAccess 2339 err = json.Unmarshal(*v, &publicNetworkAccess) 2340 if err != nil { 2341 return err 2342 } 2343 dacup.PublicNetworkAccess = publicNetworkAccess 2344 } 2345 case "enableFreeTier": 2346 if v != nil { 2347 var enableFreeTier bool 2348 err = json.Unmarshal(*v, &enableFreeTier) 2349 if err != nil { 2350 return err 2351 } 2352 dacup.EnableFreeTier = &enableFreeTier 2353 } 2354 case "apiProperties": 2355 if v != nil { 2356 var APIProperties APIProperties 2357 err = json.Unmarshal(*v, &APIProperties) 2358 if err != nil { 2359 return err 2360 } 2361 dacup.APIProperties = &APIProperties 2362 } 2363 case "enableAnalyticalStorage": 2364 if v != nil { 2365 var enableAnalyticalStorage bool 2366 err = json.Unmarshal(*v, &enableAnalyticalStorage) 2367 if err != nil { 2368 return err 2369 } 2370 dacup.EnableAnalyticalStorage = &enableAnalyticalStorage 2371 } 2372 case "backupPolicy": 2373 if v != nil { 2374 backupPolicy, err := unmarshalBasicBackupPolicy(*v) 2375 if err != nil { 2376 return err 2377 } 2378 dacup.BackupPolicy = backupPolicy 2379 } 2380 case "cors": 2381 if v != nil { 2382 var cors []CorsPolicy 2383 err = json.Unmarshal(*v, &cors) 2384 if err != nil { 2385 return err 2386 } 2387 dacup.Cors = &cors 2388 } 2389 case "networkAclBypass": 2390 if v != nil { 2391 var networkACLBypass NetworkACLBypass 2392 err = json.Unmarshal(*v, &networkACLBypass) 2393 if err != nil { 2394 return err 2395 } 2396 dacup.NetworkACLBypass = networkACLBypass 2397 } 2398 case "networkAclBypassResourceIds": 2399 if v != nil { 2400 var networkACLBypassResourceIds []string 2401 err = json.Unmarshal(*v, &networkACLBypassResourceIds) 2402 if err != nil { 2403 return err 2404 } 2405 dacup.NetworkACLBypassResourceIds = &networkACLBypassResourceIds 2406 } 2407 case "createMode": 2408 if v != nil { 2409 var createMode CreateModeBasicDatabaseAccountCreateUpdateProperties 2410 err = json.Unmarshal(*v, &createMode) 2411 if err != nil { 2412 return err 2413 } 2414 dacup.CreateMode = createMode 2415 } 2416 } 2417 } 2418 2419 return nil 2420} 2421 2422// DatabaseAccountGetProperties properties for the database account. 2423type DatabaseAccountGetProperties struct { 2424 ProvisioningState *string `json:"provisioningState,omitempty"` 2425 // DocumentEndpoint - READ-ONLY; The connection endpoint for the Cosmos DB database account. 2426 DocumentEndpoint *string `json:"documentEndpoint,omitempty"` 2427 // DatabaseAccountOfferType - READ-ONLY; The offer type for the Cosmos DB database account. Default value: Standard. Possible values include: 'DatabaseAccountOfferTypeStandard' 2428 DatabaseAccountOfferType DatabaseAccountOfferType `json:"databaseAccountOfferType,omitempty"` 2429 // IPRules - List of IpRules. 2430 IPRules *[]IPAddressOrRange `json:"ipRules,omitempty"` 2431 // IsVirtualNetworkFilterEnabled - Flag to indicate whether to enable/disable Virtual Network ACL rules. 2432 IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"` 2433 // 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. 2434 EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"` 2435 // ConsistencyPolicy - The consistency policy for the Cosmos DB database account. 2436 ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"` 2437 // Capabilities - List of Cosmos DB capabilities for the account 2438 Capabilities *[]Capability `json:"capabilities,omitempty"` 2439 // WriteLocations - READ-ONLY; An array that contains the write location for the Cosmos DB account. 2440 WriteLocations *[]Location `json:"writeLocations,omitempty"` 2441 // ReadLocations - READ-ONLY; An array that contains of the read locations enabled for the Cosmos DB account. 2442 ReadLocations *[]Location `json:"readLocations,omitempty"` 2443 // Locations - READ-ONLY; An array that contains all of the locations enabled for the Cosmos DB account. 2444 Locations *[]Location `json:"locations,omitempty"` 2445 // FailoverPolicies - READ-ONLY; An array that contains the regions ordered by their failover priorities. 2446 FailoverPolicies *[]FailoverPolicy `json:"failoverPolicies,omitempty"` 2447 // VirtualNetworkRules - List of Virtual Network ACL rules configured for the Cosmos DB account. 2448 VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` 2449 // PrivateEndpointConnections - READ-ONLY; List of Private Endpoint Connections configured for the Cosmos DB account. 2450 PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` 2451 // EnableMultipleWriteLocations - Enables the account to write in multiple locations 2452 EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` 2453 // EnableCassandraConnector - Enables the cassandra connector on the Cosmos DB C* account 2454 EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"` 2455 // ConnectorOffer - The cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'ConnectorOfferSmall' 2456 ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"` 2457 // DisableKeyBasedMetadataWriteAccess - Disable write operations on metadata resources (databases, containers, throughput) via account keys 2458 DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"` 2459 // KeyVaultKeyURI - The URI of the key vault 2460 KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"` 2461 // PublicNetworkAccess - Whether requests from Public Network are allowed. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' 2462 PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` 2463 // EnableFreeTier - Flag to indicate whether Free Tier is enabled. 2464 EnableFreeTier *bool `json:"enableFreeTier,omitempty"` 2465 // APIProperties - API specific properties. 2466 APIProperties *APIProperties `json:"apiProperties,omitempty"` 2467 // EnableAnalyticalStorage - Flag to indicate whether to enable storage analytics. 2468 EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"` 2469 // InstanceID - READ-ONLY; A unique identifier assigned to the database account 2470 InstanceID *string `json:"instanceId,omitempty"` 2471 // CreateMode - Enum to indicate the mode of account creation. Possible values include: 'CreateModeDefault', 'CreateModeRestore' 2472 CreateMode CreateMode `json:"createMode,omitempty"` 2473 // RestoreParameters - Parameters to indicate the information about the restore. 2474 RestoreParameters *RestoreParameters `json:"restoreParameters,omitempty"` 2475 // BackupPolicy - The object representing the policy for taking backups on an account. 2476 BackupPolicy BasicBackupPolicy `json:"backupPolicy,omitempty"` 2477 // Cors - The CORS policy for the Cosmos DB database account. 2478 Cors *[]CorsPolicy `json:"cors,omitempty"` 2479 // NetworkACLBypass - Indicates what services are allowed to bypass firewall checks. Possible values include: 'NetworkACLBypassNone', 'NetworkACLBypassAzureServices' 2480 NetworkACLBypass NetworkACLBypass `json:"networkAclBypass,omitempty"` 2481 // NetworkACLBypassResourceIds - An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. 2482 NetworkACLBypassResourceIds *[]string `json:"networkAclBypassResourceIds,omitempty"` 2483} 2484 2485// MarshalJSON is the custom marshaler for DatabaseAccountGetProperties. 2486func (dagp DatabaseAccountGetProperties) MarshalJSON() ([]byte, error) { 2487 objectMap := make(map[string]interface{}) 2488 if dagp.ProvisioningState != nil { 2489 objectMap["provisioningState"] = dagp.ProvisioningState 2490 } 2491 if dagp.IPRules != nil { 2492 objectMap["ipRules"] = dagp.IPRules 2493 } 2494 if dagp.IsVirtualNetworkFilterEnabled != nil { 2495 objectMap["isVirtualNetworkFilterEnabled"] = dagp.IsVirtualNetworkFilterEnabled 2496 } 2497 if dagp.EnableAutomaticFailover != nil { 2498 objectMap["enableAutomaticFailover"] = dagp.EnableAutomaticFailover 2499 } 2500 if dagp.ConsistencyPolicy != nil { 2501 objectMap["consistencyPolicy"] = dagp.ConsistencyPolicy 2502 } 2503 if dagp.Capabilities != nil { 2504 objectMap["capabilities"] = dagp.Capabilities 2505 } 2506 if dagp.VirtualNetworkRules != nil { 2507 objectMap["virtualNetworkRules"] = dagp.VirtualNetworkRules 2508 } 2509 if dagp.EnableMultipleWriteLocations != nil { 2510 objectMap["enableMultipleWriteLocations"] = dagp.EnableMultipleWriteLocations 2511 } 2512 if dagp.EnableCassandraConnector != nil { 2513 objectMap["enableCassandraConnector"] = dagp.EnableCassandraConnector 2514 } 2515 if dagp.ConnectorOffer != "" { 2516 objectMap["connectorOffer"] = dagp.ConnectorOffer 2517 } 2518 if dagp.DisableKeyBasedMetadataWriteAccess != nil { 2519 objectMap["disableKeyBasedMetadataWriteAccess"] = dagp.DisableKeyBasedMetadataWriteAccess 2520 } 2521 if dagp.KeyVaultKeyURI != nil { 2522 objectMap["keyVaultKeyUri"] = dagp.KeyVaultKeyURI 2523 } 2524 if dagp.PublicNetworkAccess != "" { 2525 objectMap["publicNetworkAccess"] = dagp.PublicNetworkAccess 2526 } 2527 if dagp.EnableFreeTier != nil { 2528 objectMap["enableFreeTier"] = dagp.EnableFreeTier 2529 } 2530 if dagp.APIProperties != nil { 2531 objectMap["apiProperties"] = dagp.APIProperties 2532 } 2533 if dagp.EnableAnalyticalStorage != nil { 2534 objectMap["enableAnalyticalStorage"] = dagp.EnableAnalyticalStorage 2535 } 2536 if dagp.CreateMode != "" { 2537 objectMap["createMode"] = dagp.CreateMode 2538 } 2539 if dagp.RestoreParameters != nil { 2540 objectMap["restoreParameters"] = dagp.RestoreParameters 2541 } 2542 objectMap["backupPolicy"] = dagp.BackupPolicy 2543 if dagp.Cors != nil { 2544 objectMap["cors"] = dagp.Cors 2545 } 2546 if dagp.NetworkACLBypass != "" { 2547 objectMap["networkAclBypass"] = dagp.NetworkACLBypass 2548 } 2549 if dagp.NetworkACLBypassResourceIds != nil { 2550 objectMap["networkAclBypassResourceIds"] = dagp.NetworkACLBypassResourceIds 2551 } 2552 return json.Marshal(objectMap) 2553} 2554 2555// UnmarshalJSON is the custom unmarshaler for DatabaseAccountGetProperties struct. 2556func (dagp *DatabaseAccountGetProperties) UnmarshalJSON(body []byte) error { 2557 var m map[string]*json.RawMessage 2558 err := json.Unmarshal(body, &m) 2559 if err != nil { 2560 return err 2561 } 2562 for k, v := range m { 2563 switch k { 2564 case "provisioningState": 2565 if v != nil { 2566 var provisioningState string 2567 err = json.Unmarshal(*v, &provisioningState) 2568 if err != nil { 2569 return err 2570 } 2571 dagp.ProvisioningState = &provisioningState 2572 } 2573 case "documentEndpoint": 2574 if v != nil { 2575 var documentEndpoint string 2576 err = json.Unmarshal(*v, &documentEndpoint) 2577 if err != nil { 2578 return err 2579 } 2580 dagp.DocumentEndpoint = &documentEndpoint 2581 } 2582 case "databaseAccountOfferType": 2583 if v != nil { 2584 var databaseAccountOfferType DatabaseAccountOfferType 2585 err = json.Unmarshal(*v, &databaseAccountOfferType) 2586 if err != nil { 2587 return err 2588 } 2589 dagp.DatabaseAccountOfferType = databaseAccountOfferType 2590 } 2591 case "ipRules": 2592 if v != nil { 2593 var IPRules []IPAddressOrRange 2594 err = json.Unmarshal(*v, &IPRules) 2595 if err != nil { 2596 return err 2597 } 2598 dagp.IPRules = &IPRules 2599 } 2600 case "isVirtualNetworkFilterEnabled": 2601 if v != nil { 2602 var isVirtualNetworkFilterEnabled bool 2603 err = json.Unmarshal(*v, &isVirtualNetworkFilterEnabled) 2604 if err != nil { 2605 return err 2606 } 2607 dagp.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled 2608 } 2609 case "enableAutomaticFailover": 2610 if v != nil { 2611 var enableAutomaticFailover bool 2612 err = json.Unmarshal(*v, &enableAutomaticFailover) 2613 if err != nil { 2614 return err 2615 } 2616 dagp.EnableAutomaticFailover = &enableAutomaticFailover 2617 } 2618 case "consistencyPolicy": 2619 if v != nil { 2620 var consistencyPolicy ConsistencyPolicy 2621 err = json.Unmarshal(*v, &consistencyPolicy) 2622 if err != nil { 2623 return err 2624 } 2625 dagp.ConsistencyPolicy = &consistencyPolicy 2626 } 2627 case "capabilities": 2628 if v != nil { 2629 var capabilities []Capability 2630 err = json.Unmarshal(*v, &capabilities) 2631 if err != nil { 2632 return err 2633 } 2634 dagp.Capabilities = &capabilities 2635 } 2636 case "writeLocations": 2637 if v != nil { 2638 var writeLocations []Location 2639 err = json.Unmarshal(*v, &writeLocations) 2640 if err != nil { 2641 return err 2642 } 2643 dagp.WriteLocations = &writeLocations 2644 } 2645 case "readLocations": 2646 if v != nil { 2647 var readLocations []Location 2648 err = json.Unmarshal(*v, &readLocations) 2649 if err != nil { 2650 return err 2651 } 2652 dagp.ReadLocations = &readLocations 2653 } 2654 case "locations": 2655 if v != nil { 2656 var locations []Location 2657 err = json.Unmarshal(*v, &locations) 2658 if err != nil { 2659 return err 2660 } 2661 dagp.Locations = &locations 2662 } 2663 case "failoverPolicies": 2664 if v != nil { 2665 var failoverPolicies []FailoverPolicy 2666 err = json.Unmarshal(*v, &failoverPolicies) 2667 if err != nil { 2668 return err 2669 } 2670 dagp.FailoverPolicies = &failoverPolicies 2671 } 2672 case "virtualNetworkRules": 2673 if v != nil { 2674 var virtualNetworkRules []VirtualNetworkRule 2675 err = json.Unmarshal(*v, &virtualNetworkRules) 2676 if err != nil { 2677 return err 2678 } 2679 dagp.VirtualNetworkRules = &virtualNetworkRules 2680 } 2681 case "privateEndpointConnections": 2682 if v != nil { 2683 var privateEndpointConnections []PrivateEndpointConnection 2684 err = json.Unmarshal(*v, &privateEndpointConnections) 2685 if err != nil { 2686 return err 2687 } 2688 dagp.PrivateEndpointConnections = &privateEndpointConnections 2689 } 2690 case "enableMultipleWriteLocations": 2691 if v != nil { 2692 var enableMultipleWriteLocations bool 2693 err = json.Unmarshal(*v, &enableMultipleWriteLocations) 2694 if err != nil { 2695 return err 2696 } 2697 dagp.EnableMultipleWriteLocations = &enableMultipleWriteLocations 2698 } 2699 case "enableCassandraConnector": 2700 if v != nil { 2701 var enableCassandraConnector bool 2702 err = json.Unmarshal(*v, &enableCassandraConnector) 2703 if err != nil { 2704 return err 2705 } 2706 dagp.EnableCassandraConnector = &enableCassandraConnector 2707 } 2708 case "connectorOffer": 2709 if v != nil { 2710 var connectorOffer ConnectorOffer 2711 err = json.Unmarshal(*v, &connectorOffer) 2712 if err != nil { 2713 return err 2714 } 2715 dagp.ConnectorOffer = connectorOffer 2716 } 2717 case "disableKeyBasedMetadataWriteAccess": 2718 if v != nil { 2719 var disableKeyBasedMetadataWriteAccess bool 2720 err = json.Unmarshal(*v, &disableKeyBasedMetadataWriteAccess) 2721 if err != nil { 2722 return err 2723 } 2724 dagp.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess 2725 } 2726 case "keyVaultKeyUri": 2727 if v != nil { 2728 var keyVaultKeyURI string 2729 err = json.Unmarshal(*v, &keyVaultKeyURI) 2730 if err != nil { 2731 return err 2732 } 2733 dagp.KeyVaultKeyURI = &keyVaultKeyURI 2734 } 2735 case "publicNetworkAccess": 2736 if v != nil { 2737 var publicNetworkAccess PublicNetworkAccess 2738 err = json.Unmarshal(*v, &publicNetworkAccess) 2739 if err != nil { 2740 return err 2741 } 2742 dagp.PublicNetworkAccess = publicNetworkAccess 2743 } 2744 case "enableFreeTier": 2745 if v != nil { 2746 var enableFreeTier bool 2747 err = json.Unmarshal(*v, &enableFreeTier) 2748 if err != nil { 2749 return err 2750 } 2751 dagp.EnableFreeTier = &enableFreeTier 2752 } 2753 case "apiProperties": 2754 if v != nil { 2755 var APIProperties APIProperties 2756 err = json.Unmarshal(*v, &APIProperties) 2757 if err != nil { 2758 return err 2759 } 2760 dagp.APIProperties = &APIProperties 2761 } 2762 case "enableAnalyticalStorage": 2763 if v != nil { 2764 var enableAnalyticalStorage bool 2765 err = json.Unmarshal(*v, &enableAnalyticalStorage) 2766 if err != nil { 2767 return err 2768 } 2769 dagp.EnableAnalyticalStorage = &enableAnalyticalStorage 2770 } 2771 case "instanceId": 2772 if v != nil { 2773 var instanceID string 2774 err = json.Unmarshal(*v, &instanceID) 2775 if err != nil { 2776 return err 2777 } 2778 dagp.InstanceID = &instanceID 2779 } 2780 case "createMode": 2781 if v != nil { 2782 var createMode CreateMode 2783 err = json.Unmarshal(*v, &createMode) 2784 if err != nil { 2785 return err 2786 } 2787 dagp.CreateMode = createMode 2788 } 2789 case "restoreParameters": 2790 if v != nil { 2791 var restoreParameters RestoreParameters 2792 err = json.Unmarshal(*v, &restoreParameters) 2793 if err != nil { 2794 return err 2795 } 2796 dagp.RestoreParameters = &restoreParameters 2797 } 2798 case "backupPolicy": 2799 if v != nil { 2800 backupPolicy, err := unmarshalBasicBackupPolicy(*v) 2801 if err != nil { 2802 return err 2803 } 2804 dagp.BackupPolicy = backupPolicy 2805 } 2806 case "cors": 2807 if v != nil { 2808 var cors []CorsPolicy 2809 err = json.Unmarshal(*v, &cors) 2810 if err != nil { 2811 return err 2812 } 2813 dagp.Cors = &cors 2814 } 2815 case "networkAclBypass": 2816 if v != nil { 2817 var networkACLBypass NetworkACLBypass 2818 err = json.Unmarshal(*v, &networkACLBypass) 2819 if err != nil { 2820 return err 2821 } 2822 dagp.NetworkACLBypass = networkACLBypass 2823 } 2824 case "networkAclBypassResourceIds": 2825 if v != nil { 2826 var networkACLBypassResourceIds []string 2827 err = json.Unmarshal(*v, &networkACLBypassResourceIds) 2828 if err != nil { 2829 return err 2830 } 2831 dagp.NetworkACLBypassResourceIds = &networkACLBypassResourceIds 2832 } 2833 } 2834 } 2835 2836 return nil 2837} 2838 2839// DatabaseAccountGetResults an Azure Cosmos DB database account. 2840type DatabaseAccountGetResults struct { 2841 autorest.Response `json:"-"` 2842 // Kind - Indicates the type of database account. This can only be set at database account creation. Possible values include: 'DatabaseAccountKindGlobalDocumentDB', 'DatabaseAccountKindMongoDB', 'DatabaseAccountKindParse' 2843 Kind DatabaseAccountKind `json:"kind,omitempty"` 2844 *DatabaseAccountGetProperties `json:"properties,omitempty"` 2845 // SystemData - READ-ONLY; The system meta data relating to this resource. 2846 SystemData *SystemData `json:"systemData,omitempty"` 2847 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 2848 ID *string `json:"id,omitempty"` 2849 // Name - READ-ONLY; The name of the ARM resource. 2850 Name *string `json:"name,omitempty"` 2851 // Type - READ-ONLY; The type of Azure resource. 2852 Type *string `json:"type,omitempty"` 2853 // Location - The location of the resource group to which the resource belongs. 2854 Location *string `json:"location,omitempty"` 2855 Tags map[string]*string `json:"tags"` 2856 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 2857} 2858 2859// MarshalJSON is the custom marshaler for DatabaseAccountGetResults. 2860func (dagr DatabaseAccountGetResults) MarshalJSON() ([]byte, error) { 2861 objectMap := make(map[string]interface{}) 2862 if dagr.Kind != "" { 2863 objectMap["kind"] = dagr.Kind 2864 } 2865 if dagr.DatabaseAccountGetProperties != nil { 2866 objectMap["properties"] = dagr.DatabaseAccountGetProperties 2867 } 2868 if dagr.Location != nil { 2869 objectMap["location"] = dagr.Location 2870 } 2871 if dagr.Tags != nil { 2872 objectMap["tags"] = dagr.Tags 2873 } 2874 if dagr.Identity != nil { 2875 objectMap["identity"] = dagr.Identity 2876 } 2877 return json.Marshal(objectMap) 2878} 2879 2880// UnmarshalJSON is the custom unmarshaler for DatabaseAccountGetResults struct. 2881func (dagr *DatabaseAccountGetResults) UnmarshalJSON(body []byte) error { 2882 var m map[string]*json.RawMessage 2883 err := json.Unmarshal(body, &m) 2884 if err != nil { 2885 return err 2886 } 2887 for k, v := range m { 2888 switch k { 2889 case "kind": 2890 if v != nil { 2891 var kind DatabaseAccountKind 2892 err = json.Unmarshal(*v, &kind) 2893 if err != nil { 2894 return err 2895 } 2896 dagr.Kind = kind 2897 } 2898 case "properties": 2899 if v != nil { 2900 var databaseAccountGetProperties DatabaseAccountGetProperties 2901 err = json.Unmarshal(*v, &databaseAccountGetProperties) 2902 if err != nil { 2903 return err 2904 } 2905 dagr.DatabaseAccountGetProperties = &databaseAccountGetProperties 2906 } 2907 case "systemData": 2908 if v != nil { 2909 var systemData SystemData 2910 err = json.Unmarshal(*v, &systemData) 2911 if err != nil { 2912 return err 2913 } 2914 dagr.SystemData = &systemData 2915 } 2916 case "id": 2917 if v != nil { 2918 var ID string 2919 err = json.Unmarshal(*v, &ID) 2920 if err != nil { 2921 return err 2922 } 2923 dagr.ID = &ID 2924 } 2925 case "name": 2926 if v != nil { 2927 var name string 2928 err = json.Unmarshal(*v, &name) 2929 if err != nil { 2930 return err 2931 } 2932 dagr.Name = &name 2933 } 2934 case "type": 2935 if v != nil { 2936 var typeVar string 2937 err = json.Unmarshal(*v, &typeVar) 2938 if err != nil { 2939 return err 2940 } 2941 dagr.Type = &typeVar 2942 } 2943 case "location": 2944 if v != nil { 2945 var location string 2946 err = json.Unmarshal(*v, &location) 2947 if err != nil { 2948 return err 2949 } 2950 dagr.Location = &location 2951 } 2952 case "tags": 2953 if v != nil { 2954 var tags map[string]*string 2955 err = json.Unmarshal(*v, &tags) 2956 if err != nil { 2957 return err 2958 } 2959 dagr.Tags = tags 2960 } 2961 case "identity": 2962 if v != nil { 2963 var identity ManagedServiceIdentity 2964 err = json.Unmarshal(*v, &identity) 2965 if err != nil { 2966 return err 2967 } 2968 dagr.Identity = &identity 2969 } 2970 } 2971 } 2972 2973 return nil 2974} 2975 2976// DatabaseAccountListConnectionStringsResult the connection strings for the given database account. 2977type DatabaseAccountListConnectionStringsResult struct { 2978 autorest.Response `json:"-"` 2979 // ConnectionStrings - An array that contains the connection strings for the Cosmos DB account. 2980 ConnectionStrings *[]DatabaseAccountConnectionString `json:"connectionStrings,omitempty"` 2981} 2982 2983// DatabaseAccountListKeysResult the access keys for the given database account. 2984type DatabaseAccountListKeysResult struct { 2985 autorest.Response `json:"-"` 2986 // PrimaryMasterKey - READ-ONLY; Base 64 encoded value of the primary read-write key. 2987 PrimaryMasterKey *string `json:"primaryMasterKey,omitempty"` 2988 // SecondaryMasterKey - READ-ONLY; Base 64 encoded value of the secondary read-write key. 2989 SecondaryMasterKey *string `json:"secondaryMasterKey,omitempty"` 2990 // PrimaryReadonlyMasterKey - READ-ONLY; Base 64 encoded value of the primary read-only key. 2991 PrimaryReadonlyMasterKey *string `json:"primaryReadonlyMasterKey,omitempty"` 2992 // SecondaryReadonlyMasterKey - READ-ONLY; Base 64 encoded value of the secondary read-only key. 2993 SecondaryReadonlyMasterKey *string `json:"secondaryReadonlyMasterKey,omitempty"` 2994} 2995 2996// MarshalJSON is the custom marshaler for DatabaseAccountListKeysResult. 2997func (dalkr DatabaseAccountListKeysResult) MarshalJSON() ([]byte, error) { 2998 objectMap := make(map[string]interface{}) 2999 return json.Marshal(objectMap) 3000} 3001 3002// DatabaseAccountListReadOnlyKeysResult the read-only access keys for the given database account. 3003type DatabaseAccountListReadOnlyKeysResult struct { 3004 autorest.Response `json:"-"` 3005 // PrimaryReadonlyMasterKey - READ-ONLY; Base 64 encoded value of the primary read-only key. 3006 PrimaryReadonlyMasterKey *string `json:"primaryReadonlyMasterKey,omitempty"` 3007 // SecondaryReadonlyMasterKey - READ-ONLY; Base 64 encoded value of the secondary read-only key. 3008 SecondaryReadonlyMasterKey *string `json:"secondaryReadonlyMasterKey,omitempty"` 3009} 3010 3011// MarshalJSON is the custom marshaler for DatabaseAccountListReadOnlyKeysResult. 3012func (dalrokr DatabaseAccountListReadOnlyKeysResult) MarshalJSON() ([]byte, error) { 3013 objectMap := make(map[string]interface{}) 3014 return json.Marshal(objectMap) 3015} 3016 3017// DatabaseAccountRegenerateKeyParameters parameters to regenerate the keys within the database account. 3018type DatabaseAccountRegenerateKeyParameters struct { 3019 // KeyKind - The access key to regenerate. Possible values include: 'KeyKindPrimary', 'KeyKindSecondary', 'KeyKindPrimaryReadonly', 'KeyKindSecondaryReadonly' 3020 KeyKind KeyKind `json:"keyKind,omitempty"` 3021} 3022 3023// DatabaseAccountsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 3024// long-running operation. 3025type DatabaseAccountsCreateOrUpdateFuture struct { 3026 azure.FutureAPI 3027 // Result returns the result of the asynchronous operation. 3028 // If the operation has not completed it will return an error. 3029 Result func(DatabaseAccountsClient) (DatabaseAccountGetResults, error) 3030} 3031 3032// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3033func (future *DatabaseAccountsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 3034 var azFuture azure.Future 3035 if err := json.Unmarshal(body, &azFuture); err != nil { 3036 return err 3037 } 3038 future.FutureAPI = &azFuture 3039 future.Result = future.result 3040 return nil 3041} 3042 3043// result is the default implementation for DatabaseAccountsCreateOrUpdateFuture.Result. 3044func (future *DatabaseAccountsCreateOrUpdateFuture) result(client DatabaseAccountsClient) (dagr DatabaseAccountGetResults, err error) { 3045 var done bool 3046 done, err = future.DoneWithContext(context.Background(), client) 3047 if err != nil { 3048 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3049 return 3050 } 3051 if !done { 3052 dagr.Response.Response = future.Response() 3053 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsCreateOrUpdateFuture") 3054 return 3055 } 3056 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3057 if dagr.Response.Response, err = future.GetResult(sender); err == nil && dagr.Response.Response.StatusCode != http.StatusNoContent { 3058 dagr, err = client.CreateOrUpdateResponder(dagr.Response.Response) 3059 if err != nil { 3060 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsCreateOrUpdateFuture", "Result", dagr.Response.Response, "Failure responding to request") 3061 } 3062 } 3063 return 3064} 3065 3066// DatabaseAccountsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 3067// operation. 3068type DatabaseAccountsDeleteFuture struct { 3069 azure.FutureAPI 3070 // Result returns the result of the asynchronous operation. 3071 // If the operation has not completed it will return an error. 3072 Result func(DatabaseAccountsClient) (autorest.Response, error) 3073} 3074 3075// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3076func (future *DatabaseAccountsDeleteFuture) UnmarshalJSON(body []byte) error { 3077 var azFuture azure.Future 3078 if err := json.Unmarshal(body, &azFuture); err != nil { 3079 return err 3080 } 3081 future.FutureAPI = &azFuture 3082 future.Result = future.result 3083 return nil 3084} 3085 3086// result is the default implementation for DatabaseAccountsDeleteFuture.Result. 3087func (future *DatabaseAccountsDeleteFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) { 3088 var done bool 3089 done, err = future.DoneWithContext(context.Background(), client) 3090 if err != nil { 3091 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsDeleteFuture", "Result", future.Response(), "Polling failure") 3092 return 3093 } 3094 if !done { 3095 ar.Response = future.Response() 3096 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsDeleteFuture") 3097 return 3098 } 3099 ar.Response = future.Response() 3100 return 3101} 3102 3103// DatabaseAccountsFailoverPriorityChangeFuture an abstraction for monitoring and retrieving the results of 3104// a long-running operation. 3105type DatabaseAccountsFailoverPriorityChangeFuture struct { 3106 azure.FutureAPI 3107 // Result returns the result of the asynchronous operation. 3108 // If the operation has not completed it will return an error. 3109 Result func(DatabaseAccountsClient) (autorest.Response, error) 3110} 3111 3112// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3113func (future *DatabaseAccountsFailoverPriorityChangeFuture) UnmarshalJSON(body []byte) error { 3114 var azFuture azure.Future 3115 if err := json.Unmarshal(body, &azFuture); err != nil { 3116 return err 3117 } 3118 future.FutureAPI = &azFuture 3119 future.Result = future.result 3120 return nil 3121} 3122 3123// result is the default implementation for DatabaseAccountsFailoverPriorityChangeFuture.Result. 3124func (future *DatabaseAccountsFailoverPriorityChangeFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) { 3125 var done bool 3126 done, err = future.DoneWithContext(context.Background(), client) 3127 if err != nil { 3128 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsFailoverPriorityChangeFuture", "Result", future.Response(), "Polling failure") 3129 return 3130 } 3131 if !done { 3132 ar.Response = future.Response() 3133 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsFailoverPriorityChangeFuture") 3134 return 3135 } 3136 ar.Response = future.Response() 3137 return 3138} 3139 3140// DatabaseAccountsListResult the List operation response, that contains the database accounts and their 3141// properties. 3142type DatabaseAccountsListResult struct { 3143 autorest.Response `json:"-"` 3144 // Value - READ-ONLY; List of database account and their properties. 3145 Value *[]DatabaseAccountGetResults `json:"value,omitempty"` 3146} 3147 3148// MarshalJSON is the custom marshaler for DatabaseAccountsListResult. 3149func (dalr DatabaseAccountsListResult) MarshalJSON() ([]byte, error) { 3150 objectMap := make(map[string]interface{}) 3151 return json.Marshal(objectMap) 3152} 3153 3154// DatabaseAccountsOfflineRegionFuture an abstraction for monitoring and retrieving the results of a 3155// long-running operation. 3156type DatabaseAccountsOfflineRegionFuture struct { 3157 azure.FutureAPI 3158 // Result returns the result of the asynchronous operation. 3159 // If the operation has not completed it will return an error. 3160 Result func(DatabaseAccountsClient) (autorest.Response, error) 3161} 3162 3163// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3164func (future *DatabaseAccountsOfflineRegionFuture) UnmarshalJSON(body []byte) error { 3165 var azFuture azure.Future 3166 if err := json.Unmarshal(body, &azFuture); err != nil { 3167 return err 3168 } 3169 future.FutureAPI = &azFuture 3170 future.Result = future.result 3171 return nil 3172} 3173 3174// result is the default implementation for DatabaseAccountsOfflineRegionFuture.Result. 3175func (future *DatabaseAccountsOfflineRegionFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) { 3176 var done bool 3177 done, err = future.DoneWithContext(context.Background(), client) 3178 if err != nil { 3179 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsOfflineRegionFuture", "Result", future.Response(), "Polling failure") 3180 return 3181 } 3182 if !done { 3183 ar.Response = future.Response() 3184 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsOfflineRegionFuture") 3185 return 3186 } 3187 ar.Response = future.Response() 3188 return 3189} 3190 3191// DatabaseAccountsOnlineRegionFuture an abstraction for monitoring and retrieving the results of a 3192// long-running operation. 3193type DatabaseAccountsOnlineRegionFuture struct { 3194 azure.FutureAPI 3195 // Result returns the result of the asynchronous operation. 3196 // If the operation has not completed it will return an error. 3197 Result func(DatabaseAccountsClient) (autorest.Response, error) 3198} 3199 3200// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3201func (future *DatabaseAccountsOnlineRegionFuture) UnmarshalJSON(body []byte) error { 3202 var azFuture azure.Future 3203 if err := json.Unmarshal(body, &azFuture); err != nil { 3204 return err 3205 } 3206 future.FutureAPI = &azFuture 3207 future.Result = future.result 3208 return nil 3209} 3210 3211// result is the default implementation for DatabaseAccountsOnlineRegionFuture.Result. 3212func (future *DatabaseAccountsOnlineRegionFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) { 3213 var done bool 3214 done, err = future.DoneWithContext(context.Background(), client) 3215 if err != nil { 3216 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsOnlineRegionFuture", "Result", future.Response(), "Polling failure") 3217 return 3218 } 3219 if !done { 3220 ar.Response = future.Response() 3221 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsOnlineRegionFuture") 3222 return 3223 } 3224 ar.Response = future.Response() 3225 return 3226} 3227 3228// DatabaseAccountsRegenerateKeyFuture an abstraction for monitoring and retrieving the results of a 3229// long-running operation. 3230type DatabaseAccountsRegenerateKeyFuture struct { 3231 azure.FutureAPI 3232 // Result returns the result of the asynchronous operation. 3233 // If the operation has not completed it will return an error. 3234 Result func(DatabaseAccountsClient) (autorest.Response, error) 3235} 3236 3237// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3238func (future *DatabaseAccountsRegenerateKeyFuture) UnmarshalJSON(body []byte) error { 3239 var azFuture azure.Future 3240 if err := json.Unmarshal(body, &azFuture); err != nil { 3241 return err 3242 } 3243 future.FutureAPI = &azFuture 3244 future.Result = future.result 3245 return nil 3246} 3247 3248// result is the default implementation for DatabaseAccountsRegenerateKeyFuture.Result. 3249func (future *DatabaseAccountsRegenerateKeyFuture) result(client DatabaseAccountsClient) (ar autorest.Response, err error) { 3250 var done bool 3251 done, err = future.DoneWithContext(context.Background(), client) 3252 if err != nil { 3253 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsRegenerateKeyFuture", "Result", future.Response(), "Polling failure") 3254 return 3255 } 3256 if !done { 3257 ar.Response = future.Response() 3258 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsRegenerateKeyFuture") 3259 return 3260 } 3261 ar.Response = future.Response() 3262 return 3263} 3264 3265// DatabaseAccountsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 3266// operation. 3267type DatabaseAccountsUpdateFuture struct { 3268 azure.FutureAPI 3269 // Result returns the result of the asynchronous operation. 3270 // If the operation has not completed it will return an error. 3271 Result func(DatabaseAccountsClient) (DatabaseAccountGetResults, error) 3272} 3273 3274// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3275func (future *DatabaseAccountsUpdateFuture) UnmarshalJSON(body []byte) error { 3276 var azFuture azure.Future 3277 if err := json.Unmarshal(body, &azFuture); err != nil { 3278 return err 3279 } 3280 future.FutureAPI = &azFuture 3281 future.Result = future.result 3282 return nil 3283} 3284 3285// result is the default implementation for DatabaseAccountsUpdateFuture.Result. 3286func (future *DatabaseAccountsUpdateFuture) result(client DatabaseAccountsClient) (dagr DatabaseAccountGetResults, err error) { 3287 var done bool 3288 done, err = future.DoneWithContext(context.Background(), client) 3289 if err != nil { 3290 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsUpdateFuture", "Result", future.Response(), "Polling failure") 3291 return 3292 } 3293 if !done { 3294 dagr.Response.Response = future.Response() 3295 err = azure.NewAsyncOpIncompleteError("documentdb.DatabaseAccountsUpdateFuture") 3296 return 3297 } 3298 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3299 if dagr.Response.Response, err = future.GetResult(sender); err == nil && dagr.Response.Response.StatusCode != http.StatusNoContent { 3300 dagr, err = client.UpdateResponder(dagr.Response.Response) 3301 if err != nil { 3302 err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsUpdateFuture", "Result", dagr.Response.Response, "Failure responding to request") 3303 } 3304 } 3305 return 3306} 3307 3308// DatabaseAccountUpdateParameters parameters for patching Azure Cosmos DB database account properties. 3309type DatabaseAccountUpdateParameters struct { 3310 Tags map[string]*string `json:"tags"` 3311 // Location - The location of the resource group to which the resource belongs. 3312 Location *string `json:"location,omitempty"` 3313 *DatabaseAccountUpdateProperties `json:"properties,omitempty"` 3314 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 3315} 3316 3317// MarshalJSON is the custom marshaler for DatabaseAccountUpdateParameters. 3318func (daup DatabaseAccountUpdateParameters) MarshalJSON() ([]byte, error) { 3319 objectMap := make(map[string]interface{}) 3320 if daup.Tags != nil { 3321 objectMap["tags"] = daup.Tags 3322 } 3323 if daup.Location != nil { 3324 objectMap["location"] = daup.Location 3325 } 3326 if daup.DatabaseAccountUpdateProperties != nil { 3327 objectMap["properties"] = daup.DatabaseAccountUpdateProperties 3328 } 3329 if daup.Identity != nil { 3330 objectMap["identity"] = daup.Identity 3331 } 3332 return json.Marshal(objectMap) 3333} 3334 3335// UnmarshalJSON is the custom unmarshaler for DatabaseAccountUpdateParameters struct. 3336func (daup *DatabaseAccountUpdateParameters) UnmarshalJSON(body []byte) error { 3337 var m map[string]*json.RawMessage 3338 err := json.Unmarshal(body, &m) 3339 if err != nil { 3340 return err 3341 } 3342 for k, v := range m { 3343 switch k { 3344 case "tags": 3345 if v != nil { 3346 var tags map[string]*string 3347 err = json.Unmarshal(*v, &tags) 3348 if err != nil { 3349 return err 3350 } 3351 daup.Tags = tags 3352 } 3353 case "location": 3354 if v != nil { 3355 var location string 3356 err = json.Unmarshal(*v, &location) 3357 if err != nil { 3358 return err 3359 } 3360 daup.Location = &location 3361 } 3362 case "properties": 3363 if v != nil { 3364 var databaseAccountUpdateProperties DatabaseAccountUpdateProperties 3365 err = json.Unmarshal(*v, &databaseAccountUpdateProperties) 3366 if err != nil { 3367 return err 3368 } 3369 daup.DatabaseAccountUpdateProperties = &databaseAccountUpdateProperties 3370 } 3371 case "identity": 3372 if v != nil { 3373 var identity ManagedServiceIdentity 3374 err = json.Unmarshal(*v, &identity) 3375 if err != nil { 3376 return err 3377 } 3378 daup.Identity = &identity 3379 } 3380 } 3381 } 3382 3383 return nil 3384} 3385 3386// DatabaseAccountUpdateProperties properties to update Azure Cosmos DB database accounts. 3387type DatabaseAccountUpdateProperties struct { 3388 // ConsistencyPolicy - The consistency policy for the Cosmos DB account. 3389 ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"` 3390 // Locations - An array that contains the georeplication locations enabled for the Cosmos DB account. 3391 Locations *[]Location `json:"locations,omitempty"` 3392 // IPRules - List of IpRules. 3393 IPRules *[]IPAddressOrRange `json:"ipRules,omitempty"` 3394 // IsVirtualNetworkFilterEnabled - Flag to indicate whether to enable/disable Virtual Network ACL rules. 3395 IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"` 3396 // 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. 3397 EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"` 3398 // Capabilities - List of Cosmos DB capabilities for the account 3399 Capabilities *[]Capability `json:"capabilities,omitempty"` 3400 // VirtualNetworkRules - List of Virtual Network ACL rules configured for the Cosmos DB account. 3401 VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` 3402 // EnableMultipleWriteLocations - Enables the account to write in multiple locations 3403 EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` 3404 // EnableCassandraConnector - Enables the cassandra connector on the Cosmos DB C* account 3405 EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"` 3406 // ConnectorOffer - The cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'ConnectorOfferSmall' 3407 ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"` 3408 // DisableKeyBasedMetadataWriteAccess - Disable write operations on metadata resources (databases, containers, throughput) via account keys 3409 DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"` 3410 // KeyVaultKeyURI - The URI of the key vault 3411 KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"` 3412 // PublicNetworkAccess - Whether requests from Public Network are allowed. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' 3413 PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` 3414 // EnableFreeTier - Flag to indicate whether Free Tier is enabled. 3415 EnableFreeTier *bool `json:"enableFreeTier,omitempty"` 3416 // APIProperties - API specific properties. Currently, supported only for MongoDB API. 3417 APIProperties *APIProperties `json:"apiProperties,omitempty"` 3418 // EnableAnalyticalStorage - Flag to indicate whether to enable storage analytics. 3419 EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"` 3420 // BackupPolicy - The object representing the policy for taking backups on an account. 3421 BackupPolicy BasicBackupPolicy `json:"backupPolicy,omitempty"` 3422 // Cors - The CORS policy for the Cosmos DB database account. 3423 Cors *[]CorsPolicy `json:"cors,omitempty"` 3424 // NetworkACLBypass - Indicates what services are allowed to bypass firewall checks. Possible values include: 'NetworkACLBypassNone', 'NetworkACLBypassAzureServices' 3425 NetworkACLBypass NetworkACLBypass `json:"networkAclBypass,omitempty"` 3426 // NetworkACLBypassResourceIds - An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. 3427 NetworkACLBypassResourceIds *[]string `json:"networkAclBypassResourceIds,omitempty"` 3428} 3429 3430// UnmarshalJSON is the custom unmarshaler for DatabaseAccountUpdateProperties struct. 3431func (daup *DatabaseAccountUpdateProperties) UnmarshalJSON(body []byte) error { 3432 var m map[string]*json.RawMessage 3433 err := json.Unmarshal(body, &m) 3434 if err != nil { 3435 return err 3436 } 3437 for k, v := range m { 3438 switch k { 3439 case "consistencyPolicy": 3440 if v != nil { 3441 var consistencyPolicy ConsistencyPolicy 3442 err = json.Unmarshal(*v, &consistencyPolicy) 3443 if err != nil { 3444 return err 3445 } 3446 daup.ConsistencyPolicy = &consistencyPolicy 3447 } 3448 case "locations": 3449 if v != nil { 3450 var locations []Location 3451 err = json.Unmarshal(*v, &locations) 3452 if err != nil { 3453 return err 3454 } 3455 daup.Locations = &locations 3456 } 3457 case "ipRules": 3458 if v != nil { 3459 var IPRules []IPAddressOrRange 3460 err = json.Unmarshal(*v, &IPRules) 3461 if err != nil { 3462 return err 3463 } 3464 daup.IPRules = &IPRules 3465 } 3466 case "isVirtualNetworkFilterEnabled": 3467 if v != nil { 3468 var isVirtualNetworkFilterEnabled bool 3469 err = json.Unmarshal(*v, &isVirtualNetworkFilterEnabled) 3470 if err != nil { 3471 return err 3472 } 3473 daup.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled 3474 } 3475 case "enableAutomaticFailover": 3476 if v != nil { 3477 var enableAutomaticFailover bool 3478 err = json.Unmarshal(*v, &enableAutomaticFailover) 3479 if err != nil { 3480 return err 3481 } 3482 daup.EnableAutomaticFailover = &enableAutomaticFailover 3483 } 3484 case "capabilities": 3485 if v != nil { 3486 var capabilities []Capability 3487 err = json.Unmarshal(*v, &capabilities) 3488 if err != nil { 3489 return err 3490 } 3491 daup.Capabilities = &capabilities 3492 } 3493 case "virtualNetworkRules": 3494 if v != nil { 3495 var virtualNetworkRules []VirtualNetworkRule 3496 err = json.Unmarshal(*v, &virtualNetworkRules) 3497 if err != nil { 3498 return err 3499 } 3500 daup.VirtualNetworkRules = &virtualNetworkRules 3501 } 3502 case "enableMultipleWriteLocations": 3503 if v != nil { 3504 var enableMultipleWriteLocations bool 3505 err = json.Unmarshal(*v, &enableMultipleWriteLocations) 3506 if err != nil { 3507 return err 3508 } 3509 daup.EnableMultipleWriteLocations = &enableMultipleWriteLocations 3510 } 3511 case "enableCassandraConnector": 3512 if v != nil { 3513 var enableCassandraConnector bool 3514 err = json.Unmarshal(*v, &enableCassandraConnector) 3515 if err != nil { 3516 return err 3517 } 3518 daup.EnableCassandraConnector = &enableCassandraConnector 3519 } 3520 case "connectorOffer": 3521 if v != nil { 3522 var connectorOffer ConnectorOffer 3523 err = json.Unmarshal(*v, &connectorOffer) 3524 if err != nil { 3525 return err 3526 } 3527 daup.ConnectorOffer = connectorOffer 3528 } 3529 case "disableKeyBasedMetadataWriteAccess": 3530 if v != nil { 3531 var disableKeyBasedMetadataWriteAccess bool 3532 err = json.Unmarshal(*v, &disableKeyBasedMetadataWriteAccess) 3533 if err != nil { 3534 return err 3535 } 3536 daup.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess 3537 } 3538 case "keyVaultKeyUri": 3539 if v != nil { 3540 var keyVaultKeyURI string 3541 err = json.Unmarshal(*v, &keyVaultKeyURI) 3542 if err != nil { 3543 return err 3544 } 3545 daup.KeyVaultKeyURI = &keyVaultKeyURI 3546 } 3547 case "publicNetworkAccess": 3548 if v != nil { 3549 var publicNetworkAccess PublicNetworkAccess 3550 err = json.Unmarshal(*v, &publicNetworkAccess) 3551 if err != nil { 3552 return err 3553 } 3554 daup.PublicNetworkAccess = publicNetworkAccess 3555 } 3556 case "enableFreeTier": 3557 if v != nil { 3558 var enableFreeTier bool 3559 err = json.Unmarshal(*v, &enableFreeTier) 3560 if err != nil { 3561 return err 3562 } 3563 daup.EnableFreeTier = &enableFreeTier 3564 } 3565 case "apiProperties": 3566 if v != nil { 3567 var APIProperties APIProperties 3568 err = json.Unmarshal(*v, &APIProperties) 3569 if err != nil { 3570 return err 3571 } 3572 daup.APIProperties = &APIProperties 3573 } 3574 case "enableAnalyticalStorage": 3575 if v != nil { 3576 var enableAnalyticalStorage bool 3577 err = json.Unmarshal(*v, &enableAnalyticalStorage) 3578 if err != nil { 3579 return err 3580 } 3581 daup.EnableAnalyticalStorage = &enableAnalyticalStorage 3582 } 3583 case "backupPolicy": 3584 if v != nil { 3585 backupPolicy, err := unmarshalBasicBackupPolicy(*v) 3586 if err != nil { 3587 return err 3588 } 3589 daup.BackupPolicy = backupPolicy 3590 } 3591 case "cors": 3592 if v != nil { 3593 var cors []CorsPolicy 3594 err = json.Unmarshal(*v, &cors) 3595 if err != nil { 3596 return err 3597 } 3598 daup.Cors = &cors 3599 } 3600 case "networkAclBypass": 3601 if v != nil { 3602 var networkACLBypass NetworkACLBypass 3603 err = json.Unmarshal(*v, &networkACLBypass) 3604 if err != nil { 3605 return err 3606 } 3607 daup.NetworkACLBypass = networkACLBypass 3608 } 3609 case "networkAclBypassResourceIds": 3610 if v != nil { 3611 var networkACLBypassResourceIds []string 3612 err = json.Unmarshal(*v, &networkACLBypassResourceIds) 3613 if err != nil { 3614 return err 3615 } 3616 daup.NetworkACLBypassResourceIds = &networkACLBypassResourceIds 3617 } 3618 } 3619 } 3620 3621 return nil 3622} 3623 3624// DatabaseRestoreResource specific Databases to restore. 3625type DatabaseRestoreResource struct { 3626 // DatabaseName - The name of the database available for restore. 3627 DatabaseName *string `json:"databaseName,omitempty"` 3628 // CollectionNames - The names of the collections available for restore. 3629 CollectionNames *[]string `json:"collectionNames,omitempty"` 3630} 3631 3632// DataCenterResource a managed Cassandra data center. 3633type DataCenterResource struct { 3634 autorest.Response `json:"-"` 3635 // Properties - Properties of a managed Cassandra data center. 3636 Properties *DataCenterResourceProperties `json:"properties,omitempty"` 3637 // ID - READ-ONLY; The unique resource identifier of the database account. 3638 ID *string `json:"id,omitempty"` 3639 // Name - READ-ONLY; The name of the database account. 3640 Name *string `json:"name,omitempty"` 3641 // Type - READ-ONLY; The type of Azure resource. 3642 Type *string `json:"type,omitempty"` 3643} 3644 3645// MarshalJSON is the custom marshaler for DataCenterResource. 3646func (dcr DataCenterResource) MarshalJSON() ([]byte, error) { 3647 objectMap := make(map[string]interface{}) 3648 if dcr.Properties != nil { 3649 objectMap["properties"] = dcr.Properties 3650 } 3651 return json.Marshal(objectMap) 3652} 3653 3654// DataCenterResourceProperties properties of a managed Cassandra data center. 3655type DataCenterResourceProperties struct { 3656 // ProvisioningState - Possible values include: 'ManagedCassandraProvisioningStateCreating', 'ManagedCassandraProvisioningStateUpdating', 'ManagedCassandraProvisioningStateDeleting', 'ManagedCassandraProvisioningStateSucceeded', 'ManagedCassandraProvisioningStateFailed', 'ManagedCassandraProvisioningStateCanceled' 3657 ProvisioningState ManagedCassandraProvisioningState `json:"provisioningState,omitempty"` 3658 // DataCenterLocation - The region this data center should be created in. 3659 DataCenterLocation *string `json:"dataCenterLocation,omitempty"` 3660 // DelegatedSubnetID - Resource id of a subnet the nodes in this data center should have their network interfaces connected to. The subnet must be in the same region specified in 'dataCenterLocation' and must be able to route to the subnet specified in the cluster's 'delegatedManagementSubnetId' property. This resource id will be of the form '/subscriptions/<subscription id>/resourceGroups/<resource group>/providers/Microsoft.Network/virtualNetworks/<virtual network>/subnets/<subnet>'. 3661 DelegatedSubnetID *string `json:"delegatedSubnetId,omitempty"` 3662 // NodeCount - The number of nodes the data center should have. This is the desired number. After it is set, it may take some time for the data center to be scaled to match. To monitor the number of nodes and their status, use the fetchNodeStatus method on the cluster. 3663 NodeCount *int32 `json:"nodeCount,omitempty"` 3664 // SeedNodes - READ-ONLY; IP addresses for seed nodes in this data center. This is for reference. Generally you will want to use the seedNodes property on the cluster, which aggregates the seed nodes from all data centers in the cluster. 3665 SeedNodes *[]SeedNode `json:"seedNodes,omitempty"` 3666 // Base64EncodedCassandraYamlFragment - A fragment of a cassandra.yaml configuration file to be included in the cassandra.yaml for all nodes in this data center. The fragment should be Base64 encoded, and only a subset of keys are allowed. 3667 Base64EncodedCassandraYamlFragment *string `json:"base64EncodedCassandraYamlFragment,omitempty"` 3668} 3669 3670// MarshalJSON is the custom marshaler for DataCenterResourceProperties. 3671func (dcr DataCenterResourceProperties) MarshalJSON() ([]byte, error) { 3672 objectMap := make(map[string]interface{}) 3673 if dcr.ProvisioningState != "" { 3674 objectMap["provisioningState"] = dcr.ProvisioningState 3675 } 3676 if dcr.DataCenterLocation != nil { 3677 objectMap["dataCenterLocation"] = dcr.DataCenterLocation 3678 } 3679 if dcr.DelegatedSubnetID != nil { 3680 objectMap["delegatedSubnetId"] = dcr.DelegatedSubnetID 3681 } 3682 if dcr.NodeCount != nil { 3683 objectMap["nodeCount"] = dcr.NodeCount 3684 } 3685 if dcr.Base64EncodedCassandraYamlFragment != nil { 3686 objectMap["base64EncodedCassandraYamlFragment"] = dcr.Base64EncodedCassandraYamlFragment 3687 } 3688 return json.Marshal(objectMap) 3689} 3690 3691// DefaultRequestDatabaseAccountCreateUpdateProperties properties for non-restore Azure Cosmos DB database 3692// account requests. 3693type DefaultRequestDatabaseAccountCreateUpdateProperties struct { 3694 // ConsistencyPolicy - The consistency policy for the Cosmos DB account. 3695 ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"` 3696 // Locations - An array that contains the georeplication locations enabled for the Cosmos DB account. 3697 Locations *[]Location `json:"locations,omitempty"` 3698 // DatabaseAccountOfferType - The offer type for the database 3699 DatabaseAccountOfferType *string `json:"databaseAccountOfferType,omitempty"` 3700 // IPRules - List of IpRules. 3701 IPRules *[]IPAddressOrRange `json:"ipRules,omitempty"` 3702 // IsVirtualNetworkFilterEnabled - Flag to indicate whether to enable/disable Virtual Network ACL rules. 3703 IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"` 3704 // 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. 3705 EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"` 3706 // Capabilities - List of Cosmos DB capabilities for the account 3707 Capabilities *[]Capability `json:"capabilities,omitempty"` 3708 // VirtualNetworkRules - List of Virtual Network ACL rules configured for the Cosmos DB account. 3709 VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` 3710 // EnableMultipleWriteLocations - Enables the account to write in multiple locations 3711 EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` 3712 // EnableCassandraConnector - Enables the cassandra connector on the Cosmos DB C* account 3713 EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"` 3714 // ConnectorOffer - The cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'ConnectorOfferSmall' 3715 ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"` 3716 // DisableKeyBasedMetadataWriteAccess - Disable write operations on metadata resources (databases, containers, throughput) via account keys 3717 DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"` 3718 // KeyVaultKeyURI - The URI of the key vault 3719 KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"` 3720 // PublicNetworkAccess - Whether requests from Public Network are allowed. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' 3721 PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` 3722 // EnableFreeTier - Flag to indicate whether Free Tier is enabled. 3723 EnableFreeTier *bool `json:"enableFreeTier,omitempty"` 3724 // APIProperties - API specific properties. Currently, supported only for MongoDB API. 3725 APIProperties *APIProperties `json:"apiProperties,omitempty"` 3726 // EnableAnalyticalStorage - Flag to indicate whether to enable storage analytics. 3727 EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"` 3728 // BackupPolicy - The object representing the policy for taking backups on an account. 3729 BackupPolicy BasicBackupPolicy `json:"backupPolicy,omitempty"` 3730 // Cors - The CORS policy for the Cosmos DB database account. 3731 Cors *[]CorsPolicy `json:"cors,omitempty"` 3732 // NetworkACLBypass - Indicates what services are allowed to bypass firewall checks. Possible values include: 'NetworkACLBypassNone', 'NetworkACLBypassAzureServices' 3733 NetworkACLBypass NetworkACLBypass `json:"networkAclBypass,omitempty"` 3734 // NetworkACLBypassResourceIds - An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. 3735 NetworkACLBypassResourceIds *[]string `json:"networkAclBypassResourceIds,omitempty"` 3736 // CreateMode - Possible values include: 'CreateModeBasicDatabaseAccountCreateUpdatePropertiesCreateModeDatabaseAccountCreateUpdateProperties', 'CreateModeBasicDatabaseAccountCreateUpdatePropertiesCreateModeDefault', 'CreateModeBasicDatabaseAccountCreateUpdatePropertiesCreateModeRestore' 3737 CreateMode CreateModeBasicDatabaseAccountCreateUpdateProperties `json:"createMode,omitempty"` 3738} 3739 3740// MarshalJSON is the custom marshaler for DefaultRequestDatabaseAccountCreateUpdateProperties. 3741func (drdacup DefaultRequestDatabaseAccountCreateUpdateProperties) MarshalJSON() ([]byte, error) { 3742 drdacup.CreateMode = CreateModeBasicDatabaseAccountCreateUpdatePropertiesCreateModeDefault 3743 objectMap := make(map[string]interface{}) 3744 if drdacup.ConsistencyPolicy != nil { 3745 objectMap["consistencyPolicy"] = drdacup.ConsistencyPolicy 3746 } 3747 if drdacup.Locations != nil { 3748 objectMap["locations"] = drdacup.Locations 3749 } 3750 if drdacup.DatabaseAccountOfferType != nil { 3751 objectMap["databaseAccountOfferType"] = drdacup.DatabaseAccountOfferType 3752 } 3753 if drdacup.IPRules != nil { 3754 objectMap["ipRules"] = drdacup.IPRules 3755 } 3756 if drdacup.IsVirtualNetworkFilterEnabled != nil { 3757 objectMap["isVirtualNetworkFilterEnabled"] = drdacup.IsVirtualNetworkFilterEnabled 3758 } 3759 if drdacup.EnableAutomaticFailover != nil { 3760 objectMap["enableAutomaticFailover"] = drdacup.EnableAutomaticFailover 3761 } 3762 if drdacup.Capabilities != nil { 3763 objectMap["capabilities"] = drdacup.Capabilities 3764 } 3765 if drdacup.VirtualNetworkRules != nil { 3766 objectMap["virtualNetworkRules"] = drdacup.VirtualNetworkRules 3767 } 3768 if drdacup.EnableMultipleWriteLocations != nil { 3769 objectMap["enableMultipleWriteLocations"] = drdacup.EnableMultipleWriteLocations 3770 } 3771 if drdacup.EnableCassandraConnector != nil { 3772 objectMap["enableCassandraConnector"] = drdacup.EnableCassandraConnector 3773 } 3774 if drdacup.ConnectorOffer != "" { 3775 objectMap["connectorOffer"] = drdacup.ConnectorOffer 3776 } 3777 if drdacup.DisableKeyBasedMetadataWriteAccess != nil { 3778 objectMap["disableKeyBasedMetadataWriteAccess"] = drdacup.DisableKeyBasedMetadataWriteAccess 3779 } 3780 if drdacup.KeyVaultKeyURI != nil { 3781 objectMap["keyVaultKeyUri"] = drdacup.KeyVaultKeyURI 3782 } 3783 if drdacup.PublicNetworkAccess != "" { 3784 objectMap["publicNetworkAccess"] = drdacup.PublicNetworkAccess 3785 } 3786 if drdacup.EnableFreeTier != nil { 3787 objectMap["enableFreeTier"] = drdacup.EnableFreeTier 3788 } 3789 if drdacup.APIProperties != nil { 3790 objectMap["apiProperties"] = drdacup.APIProperties 3791 } 3792 if drdacup.EnableAnalyticalStorage != nil { 3793 objectMap["enableAnalyticalStorage"] = drdacup.EnableAnalyticalStorage 3794 } 3795 objectMap["backupPolicy"] = drdacup.BackupPolicy 3796 if drdacup.Cors != nil { 3797 objectMap["cors"] = drdacup.Cors 3798 } 3799 if drdacup.NetworkACLBypass != "" { 3800 objectMap["networkAclBypass"] = drdacup.NetworkACLBypass 3801 } 3802 if drdacup.NetworkACLBypassResourceIds != nil { 3803 objectMap["networkAclBypassResourceIds"] = drdacup.NetworkACLBypassResourceIds 3804 } 3805 if drdacup.CreateMode != "" { 3806 objectMap["createMode"] = drdacup.CreateMode 3807 } 3808 return json.Marshal(objectMap) 3809} 3810 3811// AsDefaultRequestDatabaseAccountCreateUpdateProperties is the BasicDatabaseAccountCreateUpdateProperties implementation for DefaultRequestDatabaseAccountCreateUpdateProperties. 3812func (drdacup DefaultRequestDatabaseAccountCreateUpdateProperties) AsDefaultRequestDatabaseAccountCreateUpdateProperties() (*DefaultRequestDatabaseAccountCreateUpdateProperties, bool) { 3813 return &drdacup, true 3814} 3815 3816// AsRestoreReqeustDatabaseAccountCreateUpdateProperties is the BasicDatabaseAccountCreateUpdateProperties implementation for DefaultRequestDatabaseAccountCreateUpdateProperties. 3817func (drdacup DefaultRequestDatabaseAccountCreateUpdateProperties) AsRestoreReqeustDatabaseAccountCreateUpdateProperties() (*RestoreReqeustDatabaseAccountCreateUpdateProperties, bool) { 3818 return nil, false 3819} 3820 3821// AsDatabaseAccountCreateUpdateProperties is the BasicDatabaseAccountCreateUpdateProperties implementation for DefaultRequestDatabaseAccountCreateUpdateProperties. 3822func (drdacup DefaultRequestDatabaseAccountCreateUpdateProperties) AsDatabaseAccountCreateUpdateProperties() (*DatabaseAccountCreateUpdateProperties, bool) { 3823 return nil, false 3824} 3825 3826// AsBasicDatabaseAccountCreateUpdateProperties is the BasicDatabaseAccountCreateUpdateProperties implementation for DefaultRequestDatabaseAccountCreateUpdateProperties. 3827func (drdacup DefaultRequestDatabaseAccountCreateUpdateProperties) AsBasicDatabaseAccountCreateUpdateProperties() (BasicDatabaseAccountCreateUpdateProperties, bool) { 3828 return &drdacup, true 3829} 3830 3831// UnmarshalJSON is the custom unmarshaler for DefaultRequestDatabaseAccountCreateUpdateProperties struct. 3832func (drdacup *DefaultRequestDatabaseAccountCreateUpdateProperties) UnmarshalJSON(body []byte) error { 3833 var m map[string]*json.RawMessage 3834 err := json.Unmarshal(body, &m) 3835 if err != nil { 3836 return err 3837 } 3838 for k, v := range m { 3839 switch k { 3840 case "consistencyPolicy": 3841 if v != nil { 3842 var consistencyPolicy ConsistencyPolicy 3843 err = json.Unmarshal(*v, &consistencyPolicy) 3844 if err != nil { 3845 return err 3846 } 3847 drdacup.ConsistencyPolicy = &consistencyPolicy 3848 } 3849 case "locations": 3850 if v != nil { 3851 var locations []Location 3852 err = json.Unmarshal(*v, &locations) 3853 if err != nil { 3854 return err 3855 } 3856 drdacup.Locations = &locations 3857 } 3858 case "databaseAccountOfferType": 3859 if v != nil { 3860 var databaseAccountOfferType string 3861 err = json.Unmarshal(*v, &databaseAccountOfferType) 3862 if err != nil { 3863 return err 3864 } 3865 drdacup.DatabaseAccountOfferType = &databaseAccountOfferType 3866 } 3867 case "ipRules": 3868 if v != nil { 3869 var IPRules []IPAddressOrRange 3870 err = json.Unmarshal(*v, &IPRules) 3871 if err != nil { 3872 return err 3873 } 3874 drdacup.IPRules = &IPRules 3875 } 3876 case "isVirtualNetworkFilterEnabled": 3877 if v != nil { 3878 var isVirtualNetworkFilterEnabled bool 3879 err = json.Unmarshal(*v, &isVirtualNetworkFilterEnabled) 3880 if err != nil { 3881 return err 3882 } 3883 drdacup.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled 3884 } 3885 case "enableAutomaticFailover": 3886 if v != nil { 3887 var enableAutomaticFailover bool 3888 err = json.Unmarshal(*v, &enableAutomaticFailover) 3889 if err != nil { 3890 return err 3891 } 3892 drdacup.EnableAutomaticFailover = &enableAutomaticFailover 3893 } 3894 case "capabilities": 3895 if v != nil { 3896 var capabilities []Capability 3897 err = json.Unmarshal(*v, &capabilities) 3898 if err != nil { 3899 return err 3900 } 3901 drdacup.Capabilities = &capabilities 3902 } 3903 case "virtualNetworkRules": 3904 if v != nil { 3905 var virtualNetworkRules []VirtualNetworkRule 3906 err = json.Unmarshal(*v, &virtualNetworkRules) 3907 if err != nil { 3908 return err 3909 } 3910 drdacup.VirtualNetworkRules = &virtualNetworkRules 3911 } 3912 case "enableMultipleWriteLocations": 3913 if v != nil { 3914 var enableMultipleWriteLocations bool 3915 err = json.Unmarshal(*v, &enableMultipleWriteLocations) 3916 if err != nil { 3917 return err 3918 } 3919 drdacup.EnableMultipleWriteLocations = &enableMultipleWriteLocations 3920 } 3921 case "enableCassandraConnector": 3922 if v != nil { 3923 var enableCassandraConnector bool 3924 err = json.Unmarshal(*v, &enableCassandraConnector) 3925 if err != nil { 3926 return err 3927 } 3928 drdacup.EnableCassandraConnector = &enableCassandraConnector 3929 } 3930 case "connectorOffer": 3931 if v != nil { 3932 var connectorOffer ConnectorOffer 3933 err = json.Unmarshal(*v, &connectorOffer) 3934 if err != nil { 3935 return err 3936 } 3937 drdacup.ConnectorOffer = connectorOffer 3938 } 3939 case "disableKeyBasedMetadataWriteAccess": 3940 if v != nil { 3941 var disableKeyBasedMetadataWriteAccess bool 3942 err = json.Unmarshal(*v, &disableKeyBasedMetadataWriteAccess) 3943 if err != nil { 3944 return err 3945 } 3946 drdacup.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess 3947 } 3948 case "keyVaultKeyUri": 3949 if v != nil { 3950 var keyVaultKeyURI string 3951 err = json.Unmarshal(*v, &keyVaultKeyURI) 3952 if err != nil { 3953 return err 3954 } 3955 drdacup.KeyVaultKeyURI = &keyVaultKeyURI 3956 } 3957 case "publicNetworkAccess": 3958 if v != nil { 3959 var publicNetworkAccess PublicNetworkAccess 3960 err = json.Unmarshal(*v, &publicNetworkAccess) 3961 if err != nil { 3962 return err 3963 } 3964 drdacup.PublicNetworkAccess = publicNetworkAccess 3965 } 3966 case "enableFreeTier": 3967 if v != nil { 3968 var enableFreeTier bool 3969 err = json.Unmarshal(*v, &enableFreeTier) 3970 if err != nil { 3971 return err 3972 } 3973 drdacup.EnableFreeTier = &enableFreeTier 3974 } 3975 case "apiProperties": 3976 if v != nil { 3977 var APIProperties APIProperties 3978 err = json.Unmarshal(*v, &APIProperties) 3979 if err != nil { 3980 return err 3981 } 3982 drdacup.APIProperties = &APIProperties 3983 } 3984 case "enableAnalyticalStorage": 3985 if v != nil { 3986 var enableAnalyticalStorage bool 3987 err = json.Unmarshal(*v, &enableAnalyticalStorage) 3988 if err != nil { 3989 return err 3990 } 3991 drdacup.EnableAnalyticalStorage = &enableAnalyticalStorage 3992 } 3993 case "backupPolicy": 3994 if v != nil { 3995 backupPolicy, err := unmarshalBasicBackupPolicy(*v) 3996 if err != nil { 3997 return err 3998 } 3999 drdacup.BackupPolicy = backupPolicy 4000 } 4001 case "cors": 4002 if v != nil { 4003 var cors []CorsPolicy 4004 err = json.Unmarshal(*v, &cors) 4005 if err != nil { 4006 return err 4007 } 4008 drdacup.Cors = &cors 4009 } 4010 case "networkAclBypass": 4011 if v != nil { 4012 var networkACLBypass NetworkACLBypass 4013 err = json.Unmarshal(*v, &networkACLBypass) 4014 if err != nil { 4015 return err 4016 } 4017 drdacup.NetworkACLBypass = networkACLBypass 4018 } 4019 case "networkAclBypassResourceIds": 4020 if v != nil { 4021 var networkACLBypassResourceIds []string 4022 err = json.Unmarshal(*v, &networkACLBypassResourceIds) 4023 if err != nil { 4024 return err 4025 } 4026 drdacup.NetworkACLBypassResourceIds = &networkACLBypassResourceIds 4027 } 4028 case "createMode": 4029 if v != nil { 4030 var createMode CreateModeBasicDatabaseAccountCreateUpdateProperties 4031 err = json.Unmarshal(*v, &createMode) 4032 if err != nil { 4033 return err 4034 } 4035 drdacup.CreateMode = createMode 4036 } 4037 } 4038 } 4039 4040 return nil 4041} 4042 4043// ErrorResponse error Response. 4044type ErrorResponse struct { 4045 // Code - Error code. 4046 Code *string `json:"code,omitempty"` 4047 // Message - Error message indicating why the operation failed. 4048 Message *string `json:"message,omitempty"` 4049} 4050 4051// ExcludedPath ... 4052type ExcludedPath struct { 4053 // Path - The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) 4054 Path *string `json:"path,omitempty"` 4055} 4056 4057// ExtendedResourceProperties the system generated resource properties associated with SQL databases, SQL 4058// containers, Gremlin databases and Gremlin graphs. 4059type ExtendedResourceProperties struct { 4060 // Rid - READ-ONLY; A system generated property. A unique identifier. 4061 Rid *string `json:"_rid,omitempty"` 4062 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 4063 Ts *float64 `json:"_ts,omitempty"` 4064 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 4065 Etag *string `json:"_etag,omitempty"` 4066} 4067 4068// MarshalJSON is the custom marshaler for ExtendedResourceProperties. 4069func (erp ExtendedResourceProperties) MarshalJSON() ([]byte, error) { 4070 objectMap := make(map[string]interface{}) 4071 return json.Marshal(objectMap) 4072} 4073 4074// FailoverPolicies the list of new failover policies for the failover priority change. 4075type FailoverPolicies struct { 4076 // FailoverPolicies - List of failover policies. 4077 FailoverPolicies *[]FailoverPolicy `json:"failoverPolicies,omitempty"` 4078} 4079 4080// FailoverPolicy the failover policy for a given region of a database account. 4081type FailoverPolicy struct { 4082 // ID - READ-ONLY; The unique identifier of the region in which the database account replicates to. Example: <accountName>-<locationName>. 4083 ID *string `json:"id,omitempty"` 4084 // LocationName - The name of the region in which the database account exists. 4085 LocationName *string `json:"locationName,omitempty"` 4086 // 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. 4087 FailoverPriority *int32 `json:"failoverPriority,omitempty"` 4088} 4089 4090// MarshalJSON is the custom marshaler for FailoverPolicy. 4091func (fp FailoverPolicy) MarshalJSON() ([]byte, error) { 4092 objectMap := make(map[string]interface{}) 4093 if fp.LocationName != nil { 4094 objectMap["locationName"] = fp.LocationName 4095 } 4096 if fp.FailoverPriority != nil { 4097 objectMap["failoverPriority"] = fp.FailoverPriority 4098 } 4099 return json.Marshal(objectMap) 4100} 4101 4102// GremlinDatabaseCreateUpdateParameters parameters to create and update Cosmos DB Gremlin database. 4103type GremlinDatabaseCreateUpdateParameters struct { 4104 // GremlinDatabaseCreateUpdateProperties - Properties to create and update Azure Cosmos DB Gremlin database. 4105 *GremlinDatabaseCreateUpdateProperties `json:"properties,omitempty"` 4106 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 4107 ID *string `json:"id,omitempty"` 4108 // Name - READ-ONLY; The name of the ARM resource. 4109 Name *string `json:"name,omitempty"` 4110 // Type - READ-ONLY; The type of Azure resource. 4111 Type *string `json:"type,omitempty"` 4112 // Location - The location of the resource group to which the resource belongs. 4113 Location *string `json:"location,omitempty"` 4114 Tags map[string]*string `json:"tags"` 4115 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 4116} 4117 4118// MarshalJSON is the custom marshaler for GremlinDatabaseCreateUpdateParameters. 4119func (gdcup GremlinDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { 4120 objectMap := make(map[string]interface{}) 4121 if gdcup.GremlinDatabaseCreateUpdateProperties != nil { 4122 objectMap["properties"] = gdcup.GremlinDatabaseCreateUpdateProperties 4123 } 4124 if gdcup.Location != nil { 4125 objectMap["location"] = gdcup.Location 4126 } 4127 if gdcup.Tags != nil { 4128 objectMap["tags"] = gdcup.Tags 4129 } 4130 if gdcup.Identity != nil { 4131 objectMap["identity"] = gdcup.Identity 4132 } 4133 return json.Marshal(objectMap) 4134} 4135 4136// UnmarshalJSON is the custom unmarshaler for GremlinDatabaseCreateUpdateParameters struct. 4137func (gdcup *GremlinDatabaseCreateUpdateParameters) UnmarshalJSON(body []byte) error { 4138 var m map[string]*json.RawMessage 4139 err := json.Unmarshal(body, &m) 4140 if err != nil { 4141 return err 4142 } 4143 for k, v := range m { 4144 switch k { 4145 case "properties": 4146 if v != nil { 4147 var gremlinDatabaseCreateUpdateProperties GremlinDatabaseCreateUpdateProperties 4148 err = json.Unmarshal(*v, &gremlinDatabaseCreateUpdateProperties) 4149 if err != nil { 4150 return err 4151 } 4152 gdcup.GremlinDatabaseCreateUpdateProperties = &gremlinDatabaseCreateUpdateProperties 4153 } 4154 case "id": 4155 if v != nil { 4156 var ID string 4157 err = json.Unmarshal(*v, &ID) 4158 if err != nil { 4159 return err 4160 } 4161 gdcup.ID = &ID 4162 } 4163 case "name": 4164 if v != nil { 4165 var name string 4166 err = json.Unmarshal(*v, &name) 4167 if err != nil { 4168 return err 4169 } 4170 gdcup.Name = &name 4171 } 4172 case "type": 4173 if v != nil { 4174 var typeVar string 4175 err = json.Unmarshal(*v, &typeVar) 4176 if err != nil { 4177 return err 4178 } 4179 gdcup.Type = &typeVar 4180 } 4181 case "location": 4182 if v != nil { 4183 var location string 4184 err = json.Unmarshal(*v, &location) 4185 if err != nil { 4186 return err 4187 } 4188 gdcup.Location = &location 4189 } 4190 case "tags": 4191 if v != nil { 4192 var tags map[string]*string 4193 err = json.Unmarshal(*v, &tags) 4194 if err != nil { 4195 return err 4196 } 4197 gdcup.Tags = tags 4198 } 4199 case "identity": 4200 if v != nil { 4201 var identity ManagedServiceIdentity 4202 err = json.Unmarshal(*v, &identity) 4203 if err != nil { 4204 return err 4205 } 4206 gdcup.Identity = &identity 4207 } 4208 } 4209 } 4210 4211 return nil 4212} 4213 4214// GremlinDatabaseCreateUpdateProperties properties to create and update Azure Cosmos DB Gremlin database. 4215type GremlinDatabaseCreateUpdateProperties struct { 4216 // Resource - The standard JSON format of a Gremlin database 4217 Resource *GremlinDatabaseResource `json:"resource,omitempty"` 4218 // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. 4219 Options *CreateUpdateOptions `json:"options,omitempty"` 4220} 4221 4222// GremlinDatabaseGetProperties the properties of an Azure Cosmos DB SQL database 4223type GremlinDatabaseGetProperties struct { 4224 Resource *GremlinDatabaseGetPropertiesResource `json:"resource,omitempty"` 4225 Options *GremlinDatabaseGetPropertiesOptions `json:"options,omitempty"` 4226} 4227 4228// GremlinDatabaseGetPropertiesOptions ... 4229type GremlinDatabaseGetPropertiesOptions struct { 4230 // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. 4231 Throughput *int32 `json:"throughput,omitempty"` 4232 // AutoscaleSettings - Specifies the Autoscale settings. 4233 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` 4234} 4235 4236// GremlinDatabaseGetPropertiesResource ... 4237type GremlinDatabaseGetPropertiesResource struct { 4238 // ID - Name of the Cosmos DB Gremlin database 4239 ID *string `json:"id,omitempty"` 4240 // Rid - READ-ONLY; A system generated property. A unique identifier. 4241 Rid *string `json:"_rid,omitempty"` 4242 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 4243 Ts *float64 `json:"_ts,omitempty"` 4244 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 4245 Etag *string `json:"_etag,omitempty"` 4246} 4247 4248// MarshalJSON is the custom marshaler for GremlinDatabaseGetPropertiesResource. 4249func (gdgp GremlinDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) { 4250 objectMap := make(map[string]interface{}) 4251 if gdgp.ID != nil { 4252 objectMap["id"] = gdgp.ID 4253 } 4254 return json.Marshal(objectMap) 4255} 4256 4257// GremlinDatabaseGetResults an Azure Cosmos DB Gremlin database. 4258type GremlinDatabaseGetResults struct { 4259 autorest.Response `json:"-"` 4260 // GremlinDatabaseGetProperties - The properties of an Azure Cosmos DB SQL database 4261 *GremlinDatabaseGetProperties `json:"properties,omitempty"` 4262 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 4263 ID *string `json:"id,omitempty"` 4264 // Name - READ-ONLY; The name of the ARM resource. 4265 Name *string `json:"name,omitempty"` 4266 // Type - READ-ONLY; The type of Azure resource. 4267 Type *string `json:"type,omitempty"` 4268 // Location - The location of the resource group to which the resource belongs. 4269 Location *string `json:"location,omitempty"` 4270 Tags map[string]*string `json:"tags"` 4271 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 4272} 4273 4274// MarshalJSON is the custom marshaler for GremlinDatabaseGetResults. 4275func (gdgr GremlinDatabaseGetResults) MarshalJSON() ([]byte, error) { 4276 objectMap := make(map[string]interface{}) 4277 if gdgr.GremlinDatabaseGetProperties != nil { 4278 objectMap["properties"] = gdgr.GremlinDatabaseGetProperties 4279 } 4280 if gdgr.Location != nil { 4281 objectMap["location"] = gdgr.Location 4282 } 4283 if gdgr.Tags != nil { 4284 objectMap["tags"] = gdgr.Tags 4285 } 4286 if gdgr.Identity != nil { 4287 objectMap["identity"] = gdgr.Identity 4288 } 4289 return json.Marshal(objectMap) 4290} 4291 4292// UnmarshalJSON is the custom unmarshaler for GremlinDatabaseGetResults struct. 4293func (gdgr *GremlinDatabaseGetResults) UnmarshalJSON(body []byte) error { 4294 var m map[string]*json.RawMessage 4295 err := json.Unmarshal(body, &m) 4296 if err != nil { 4297 return err 4298 } 4299 for k, v := range m { 4300 switch k { 4301 case "properties": 4302 if v != nil { 4303 var gremlinDatabaseGetProperties GremlinDatabaseGetProperties 4304 err = json.Unmarshal(*v, &gremlinDatabaseGetProperties) 4305 if err != nil { 4306 return err 4307 } 4308 gdgr.GremlinDatabaseGetProperties = &gremlinDatabaseGetProperties 4309 } 4310 case "id": 4311 if v != nil { 4312 var ID string 4313 err = json.Unmarshal(*v, &ID) 4314 if err != nil { 4315 return err 4316 } 4317 gdgr.ID = &ID 4318 } 4319 case "name": 4320 if v != nil { 4321 var name string 4322 err = json.Unmarshal(*v, &name) 4323 if err != nil { 4324 return err 4325 } 4326 gdgr.Name = &name 4327 } 4328 case "type": 4329 if v != nil { 4330 var typeVar string 4331 err = json.Unmarshal(*v, &typeVar) 4332 if err != nil { 4333 return err 4334 } 4335 gdgr.Type = &typeVar 4336 } 4337 case "location": 4338 if v != nil { 4339 var location string 4340 err = json.Unmarshal(*v, &location) 4341 if err != nil { 4342 return err 4343 } 4344 gdgr.Location = &location 4345 } 4346 case "tags": 4347 if v != nil { 4348 var tags map[string]*string 4349 err = json.Unmarshal(*v, &tags) 4350 if err != nil { 4351 return err 4352 } 4353 gdgr.Tags = tags 4354 } 4355 case "identity": 4356 if v != nil { 4357 var identity ManagedServiceIdentity 4358 err = json.Unmarshal(*v, &identity) 4359 if err != nil { 4360 return err 4361 } 4362 gdgr.Identity = &identity 4363 } 4364 } 4365 } 4366 4367 return nil 4368} 4369 4370// GremlinDatabaseListResult the List operation response, that contains the Gremlin databases and their 4371// properties. 4372type GremlinDatabaseListResult struct { 4373 autorest.Response `json:"-"` 4374 // Value - READ-ONLY; List of Gremlin databases and their properties. 4375 Value *[]GremlinDatabaseGetResults `json:"value,omitempty"` 4376} 4377 4378// MarshalJSON is the custom marshaler for GremlinDatabaseListResult. 4379func (gdlr GremlinDatabaseListResult) MarshalJSON() ([]byte, error) { 4380 objectMap := make(map[string]interface{}) 4381 return json.Marshal(objectMap) 4382} 4383 4384// GremlinDatabaseResource cosmos DB Gremlin database resource object 4385type GremlinDatabaseResource struct { 4386 // ID - Name of the Cosmos DB Gremlin database 4387 ID *string `json:"id,omitempty"` 4388} 4389 4390// GremlinGraphCreateUpdateParameters parameters to create and update Cosmos DB Gremlin graph. 4391type GremlinGraphCreateUpdateParameters struct { 4392 // GremlinGraphCreateUpdateProperties - Properties to create and update Azure Cosmos DB Gremlin graph. 4393 *GremlinGraphCreateUpdateProperties `json:"properties,omitempty"` 4394 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 4395 ID *string `json:"id,omitempty"` 4396 // Name - READ-ONLY; The name of the ARM resource. 4397 Name *string `json:"name,omitempty"` 4398 // Type - READ-ONLY; The type of Azure resource. 4399 Type *string `json:"type,omitempty"` 4400 // Location - The location of the resource group to which the resource belongs. 4401 Location *string `json:"location,omitempty"` 4402 Tags map[string]*string `json:"tags"` 4403 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 4404} 4405 4406// MarshalJSON is the custom marshaler for GremlinGraphCreateUpdateParameters. 4407func (ggcup GremlinGraphCreateUpdateParameters) MarshalJSON() ([]byte, error) { 4408 objectMap := make(map[string]interface{}) 4409 if ggcup.GremlinGraphCreateUpdateProperties != nil { 4410 objectMap["properties"] = ggcup.GremlinGraphCreateUpdateProperties 4411 } 4412 if ggcup.Location != nil { 4413 objectMap["location"] = ggcup.Location 4414 } 4415 if ggcup.Tags != nil { 4416 objectMap["tags"] = ggcup.Tags 4417 } 4418 if ggcup.Identity != nil { 4419 objectMap["identity"] = ggcup.Identity 4420 } 4421 return json.Marshal(objectMap) 4422} 4423 4424// UnmarshalJSON is the custom unmarshaler for GremlinGraphCreateUpdateParameters struct. 4425func (ggcup *GremlinGraphCreateUpdateParameters) UnmarshalJSON(body []byte) error { 4426 var m map[string]*json.RawMessage 4427 err := json.Unmarshal(body, &m) 4428 if err != nil { 4429 return err 4430 } 4431 for k, v := range m { 4432 switch k { 4433 case "properties": 4434 if v != nil { 4435 var gremlinGraphCreateUpdateProperties GremlinGraphCreateUpdateProperties 4436 err = json.Unmarshal(*v, &gremlinGraphCreateUpdateProperties) 4437 if err != nil { 4438 return err 4439 } 4440 ggcup.GremlinGraphCreateUpdateProperties = &gremlinGraphCreateUpdateProperties 4441 } 4442 case "id": 4443 if v != nil { 4444 var ID string 4445 err = json.Unmarshal(*v, &ID) 4446 if err != nil { 4447 return err 4448 } 4449 ggcup.ID = &ID 4450 } 4451 case "name": 4452 if v != nil { 4453 var name string 4454 err = json.Unmarshal(*v, &name) 4455 if err != nil { 4456 return err 4457 } 4458 ggcup.Name = &name 4459 } 4460 case "type": 4461 if v != nil { 4462 var typeVar string 4463 err = json.Unmarshal(*v, &typeVar) 4464 if err != nil { 4465 return err 4466 } 4467 ggcup.Type = &typeVar 4468 } 4469 case "location": 4470 if v != nil { 4471 var location string 4472 err = json.Unmarshal(*v, &location) 4473 if err != nil { 4474 return err 4475 } 4476 ggcup.Location = &location 4477 } 4478 case "tags": 4479 if v != nil { 4480 var tags map[string]*string 4481 err = json.Unmarshal(*v, &tags) 4482 if err != nil { 4483 return err 4484 } 4485 ggcup.Tags = tags 4486 } 4487 case "identity": 4488 if v != nil { 4489 var identity ManagedServiceIdentity 4490 err = json.Unmarshal(*v, &identity) 4491 if err != nil { 4492 return err 4493 } 4494 ggcup.Identity = &identity 4495 } 4496 } 4497 } 4498 4499 return nil 4500} 4501 4502// GremlinGraphCreateUpdateProperties properties to create and update Azure Cosmos DB Gremlin graph. 4503type GremlinGraphCreateUpdateProperties struct { 4504 // Resource - The standard JSON format of a Gremlin graph 4505 Resource *GremlinGraphResource `json:"resource,omitempty"` 4506 // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. 4507 Options *CreateUpdateOptions `json:"options,omitempty"` 4508} 4509 4510// GremlinGraphGetProperties the properties of an Azure Cosmos DB Gremlin graph 4511type GremlinGraphGetProperties struct { 4512 Resource *GremlinGraphGetPropertiesResource `json:"resource,omitempty"` 4513 Options *GremlinGraphGetPropertiesOptions `json:"options,omitempty"` 4514} 4515 4516// GremlinGraphGetPropertiesOptions ... 4517type GremlinGraphGetPropertiesOptions struct { 4518 // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. 4519 Throughput *int32 `json:"throughput,omitempty"` 4520 // AutoscaleSettings - Specifies the Autoscale settings. 4521 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` 4522} 4523 4524// GremlinGraphGetPropertiesResource ... 4525type GremlinGraphGetPropertiesResource struct { 4526 // ID - Name of the Cosmos DB Gremlin graph 4527 ID *string `json:"id,omitempty"` 4528 // IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph 4529 IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` 4530 // PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions 4531 PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` 4532 // DefaultTTL - Default time to live 4533 DefaultTTL *int32 `json:"defaultTtl,omitempty"` 4534 // UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. 4535 UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` 4536 // ConflictResolutionPolicy - The conflict resolution policy for the graph. 4537 ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` 4538 // Rid - READ-ONLY; A system generated property. A unique identifier. 4539 Rid *string `json:"_rid,omitempty"` 4540 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 4541 Ts *float64 `json:"_ts,omitempty"` 4542 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 4543 Etag *string `json:"_etag,omitempty"` 4544} 4545 4546// MarshalJSON is the custom marshaler for GremlinGraphGetPropertiesResource. 4547func (gggp GremlinGraphGetPropertiesResource) MarshalJSON() ([]byte, error) { 4548 objectMap := make(map[string]interface{}) 4549 if gggp.ID != nil { 4550 objectMap["id"] = gggp.ID 4551 } 4552 if gggp.IndexingPolicy != nil { 4553 objectMap["indexingPolicy"] = gggp.IndexingPolicy 4554 } 4555 if gggp.PartitionKey != nil { 4556 objectMap["partitionKey"] = gggp.PartitionKey 4557 } 4558 if gggp.DefaultTTL != nil { 4559 objectMap["defaultTtl"] = gggp.DefaultTTL 4560 } 4561 if gggp.UniqueKeyPolicy != nil { 4562 objectMap["uniqueKeyPolicy"] = gggp.UniqueKeyPolicy 4563 } 4564 if gggp.ConflictResolutionPolicy != nil { 4565 objectMap["conflictResolutionPolicy"] = gggp.ConflictResolutionPolicy 4566 } 4567 return json.Marshal(objectMap) 4568} 4569 4570// GremlinGraphGetResults an Azure Cosmos DB Gremlin graph. 4571type GremlinGraphGetResults struct { 4572 autorest.Response `json:"-"` 4573 // GremlinGraphGetProperties - The properties of an Azure Cosmos DB Gremlin graph 4574 *GremlinGraphGetProperties `json:"properties,omitempty"` 4575 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 4576 ID *string `json:"id,omitempty"` 4577 // Name - READ-ONLY; The name of the ARM resource. 4578 Name *string `json:"name,omitempty"` 4579 // Type - READ-ONLY; The type of Azure resource. 4580 Type *string `json:"type,omitempty"` 4581 // Location - The location of the resource group to which the resource belongs. 4582 Location *string `json:"location,omitempty"` 4583 Tags map[string]*string `json:"tags"` 4584 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 4585} 4586 4587// MarshalJSON is the custom marshaler for GremlinGraphGetResults. 4588func (gggr GremlinGraphGetResults) MarshalJSON() ([]byte, error) { 4589 objectMap := make(map[string]interface{}) 4590 if gggr.GremlinGraphGetProperties != nil { 4591 objectMap["properties"] = gggr.GremlinGraphGetProperties 4592 } 4593 if gggr.Location != nil { 4594 objectMap["location"] = gggr.Location 4595 } 4596 if gggr.Tags != nil { 4597 objectMap["tags"] = gggr.Tags 4598 } 4599 if gggr.Identity != nil { 4600 objectMap["identity"] = gggr.Identity 4601 } 4602 return json.Marshal(objectMap) 4603} 4604 4605// UnmarshalJSON is the custom unmarshaler for GremlinGraphGetResults struct. 4606func (gggr *GremlinGraphGetResults) UnmarshalJSON(body []byte) error { 4607 var m map[string]*json.RawMessage 4608 err := json.Unmarshal(body, &m) 4609 if err != nil { 4610 return err 4611 } 4612 for k, v := range m { 4613 switch k { 4614 case "properties": 4615 if v != nil { 4616 var gremlinGraphGetProperties GremlinGraphGetProperties 4617 err = json.Unmarshal(*v, &gremlinGraphGetProperties) 4618 if err != nil { 4619 return err 4620 } 4621 gggr.GremlinGraphGetProperties = &gremlinGraphGetProperties 4622 } 4623 case "id": 4624 if v != nil { 4625 var ID string 4626 err = json.Unmarshal(*v, &ID) 4627 if err != nil { 4628 return err 4629 } 4630 gggr.ID = &ID 4631 } 4632 case "name": 4633 if v != nil { 4634 var name string 4635 err = json.Unmarshal(*v, &name) 4636 if err != nil { 4637 return err 4638 } 4639 gggr.Name = &name 4640 } 4641 case "type": 4642 if v != nil { 4643 var typeVar string 4644 err = json.Unmarshal(*v, &typeVar) 4645 if err != nil { 4646 return err 4647 } 4648 gggr.Type = &typeVar 4649 } 4650 case "location": 4651 if v != nil { 4652 var location string 4653 err = json.Unmarshal(*v, &location) 4654 if err != nil { 4655 return err 4656 } 4657 gggr.Location = &location 4658 } 4659 case "tags": 4660 if v != nil { 4661 var tags map[string]*string 4662 err = json.Unmarshal(*v, &tags) 4663 if err != nil { 4664 return err 4665 } 4666 gggr.Tags = tags 4667 } 4668 case "identity": 4669 if v != nil { 4670 var identity ManagedServiceIdentity 4671 err = json.Unmarshal(*v, &identity) 4672 if err != nil { 4673 return err 4674 } 4675 gggr.Identity = &identity 4676 } 4677 } 4678 } 4679 4680 return nil 4681} 4682 4683// GremlinGraphListResult the List operation response, that contains the graphs and their properties. 4684type GremlinGraphListResult struct { 4685 autorest.Response `json:"-"` 4686 // Value - READ-ONLY; List of graphs and their properties. 4687 Value *[]GremlinGraphGetResults `json:"value,omitempty"` 4688} 4689 4690// MarshalJSON is the custom marshaler for GremlinGraphListResult. 4691func (gglr GremlinGraphListResult) MarshalJSON() ([]byte, error) { 4692 objectMap := make(map[string]interface{}) 4693 return json.Marshal(objectMap) 4694} 4695 4696// GremlinGraphResource cosmos DB Gremlin graph resource object 4697type GremlinGraphResource struct { 4698 // ID - Name of the Cosmos DB Gremlin graph 4699 ID *string `json:"id,omitempty"` 4700 // IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the graph 4701 IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` 4702 // PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions 4703 PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` 4704 // DefaultTTL - Default time to live 4705 DefaultTTL *int32 `json:"defaultTtl,omitempty"` 4706 // UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. 4707 UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` 4708 // ConflictResolutionPolicy - The conflict resolution policy for the graph. 4709 ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` 4710} 4711 4712// GremlinResourcesCreateUpdateGremlinDatabaseFuture an abstraction for monitoring and retrieving the 4713// results of a long-running operation. 4714type GremlinResourcesCreateUpdateGremlinDatabaseFuture struct { 4715 azure.FutureAPI 4716 // Result returns the result of the asynchronous operation. 4717 // If the operation has not completed it will return an error. 4718 Result func(GremlinResourcesClient) (GremlinDatabaseGetResults, error) 4719} 4720 4721// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4722func (future *GremlinResourcesCreateUpdateGremlinDatabaseFuture) UnmarshalJSON(body []byte) error { 4723 var azFuture azure.Future 4724 if err := json.Unmarshal(body, &azFuture); err != nil { 4725 return err 4726 } 4727 future.FutureAPI = &azFuture 4728 future.Result = future.result 4729 return nil 4730} 4731 4732// result is the default implementation for GremlinResourcesCreateUpdateGremlinDatabaseFuture.Result. 4733func (future *GremlinResourcesCreateUpdateGremlinDatabaseFuture) result(client GremlinResourcesClient) (gdgr GremlinDatabaseGetResults, err error) { 4734 var done bool 4735 done, err = future.DoneWithContext(context.Background(), client) 4736 if err != nil { 4737 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture", "Result", future.Response(), "Polling failure") 4738 return 4739 } 4740 if !done { 4741 gdgr.Response.Response = future.Response() 4742 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture") 4743 return 4744 } 4745 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4746 if gdgr.Response.Response, err = future.GetResult(sender); err == nil && gdgr.Response.Response.StatusCode != http.StatusNoContent { 4747 gdgr, err = client.CreateUpdateGremlinDatabaseResponder(gdgr.Response.Response) 4748 if err != nil { 4749 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinDatabaseFuture", "Result", gdgr.Response.Response, "Failure responding to request") 4750 } 4751 } 4752 return 4753} 4754 4755// GremlinResourcesCreateUpdateGremlinGraphFuture an abstraction for monitoring and retrieving the results 4756// of a long-running operation. 4757type GremlinResourcesCreateUpdateGremlinGraphFuture struct { 4758 azure.FutureAPI 4759 // Result returns the result of the asynchronous operation. 4760 // If the operation has not completed it will return an error. 4761 Result func(GremlinResourcesClient) (GremlinGraphGetResults, error) 4762} 4763 4764// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4765func (future *GremlinResourcesCreateUpdateGremlinGraphFuture) UnmarshalJSON(body []byte) error { 4766 var azFuture azure.Future 4767 if err := json.Unmarshal(body, &azFuture); err != nil { 4768 return err 4769 } 4770 future.FutureAPI = &azFuture 4771 future.Result = future.result 4772 return nil 4773} 4774 4775// result is the default implementation for GremlinResourcesCreateUpdateGremlinGraphFuture.Result. 4776func (future *GremlinResourcesCreateUpdateGremlinGraphFuture) result(client GremlinResourcesClient) (gggr GremlinGraphGetResults, err error) { 4777 var done bool 4778 done, err = future.DoneWithContext(context.Background(), client) 4779 if err != nil { 4780 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture", "Result", future.Response(), "Polling failure") 4781 return 4782 } 4783 if !done { 4784 gggr.Response.Response = future.Response() 4785 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture") 4786 return 4787 } 4788 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4789 if gggr.Response.Response, err = future.GetResult(sender); err == nil && gggr.Response.Response.StatusCode != http.StatusNoContent { 4790 gggr, err = client.CreateUpdateGremlinGraphResponder(gggr.Response.Response) 4791 if err != nil { 4792 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesCreateUpdateGremlinGraphFuture", "Result", gggr.Response.Response, "Failure responding to request") 4793 } 4794 } 4795 return 4796} 4797 4798// GremlinResourcesDeleteGremlinDatabaseFuture an abstraction for monitoring and retrieving the results of 4799// a long-running operation. 4800type GremlinResourcesDeleteGremlinDatabaseFuture struct { 4801 azure.FutureAPI 4802 // Result returns the result of the asynchronous operation. 4803 // If the operation has not completed it will return an error. 4804 Result func(GremlinResourcesClient) (autorest.Response, error) 4805} 4806 4807// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4808func (future *GremlinResourcesDeleteGremlinDatabaseFuture) UnmarshalJSON(body []byte) error { 4809 var azFuture azure.Future 4810 if err := json.Unmarshal(body, &azFuture); err != nil { 4811 return err 4812 } 4813 future.FutureAPI = &azFuture 4814 future.Result = future.result 4815 return nil 4816} 4817 4818// result is the default implementation for GremlinResourcesDeleteGremlinDatabaseFuture.Result. 4819func (future *GremlinResourcesDeleteGremlinDatabaseFuture) result(client GremlinResourcesClient) (ar autorest.Response, err error) { 4820 var done bool 4821 done, err = future.DoneWithContext(context.Background(), client) 4822 if err != nil { 4823 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesDeleteGremlinDatabaseFuture", "Result", future.Response(), "Polling failure") 4824 return 4825 } 4826 if !done { 4827 ar.Response = future.Response() 4828 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesDeleteGremlinDatabaseFuture") 4829 return 4830 } 4831 ar.Response = future.Response() 4832 return 4833} 4834 4835// GremlinResourcesDeleteGremlinGraphFuture an abstraction for monitoring and retrieving the results of a 4836// long-running operation. 4837type GremlinResourcesDeleteGremlinGraphFuture struct { 4838 azure.FutureAPI 4839 // Result returns the result of the asynchronous operation. 4840 // If the operation has not completed it will return an error. 4841 Result func(GremlinResourcesClient) (autorest.Response, error) 4842} 4843 4844// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4845func (future *GremlinResourcesDeleteGremlinGraphFuture) UnmarshalJSON(body []byte) error { 4846 var azFuture azure.Future 4847 if err := json.Unmarshal(body, &azFuture); err != nil { 4848 return err 4849 } 4850 future.FutureAPI = &azFuture 4851 future.Result = future.result 4852 return nil 4853} 4854 4855// result is the default implementation for GremlinResourcesDeleteGremlinGraphFuture.Result. 4856func (future *GremlinResourcesDeleteGremlinGraphFuture) result(client GremlinResourcesClient) (ar autorest.Response, err error) { 4857 var done bool 4858 done, err = future.DoneWithContext(context.Background(), client) 4859 if err != nil { 4860 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesDeleteGremlinGraphFuture", "Result", future.Response(), "Polling failure") 4861 return 4862 } 4863 if !done { 4864 ar.Response = future.Response() 4865 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesDeleteGremlinGraphFuture") 4866 return 4867 } 4868 ar.Response = future.Response() 4869 return 4870} 4871 4872// GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture an abstraction for monitoring and retrieving the 4873// results of a long-running operation. 4874type GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture struct { 4875 azure.FutureAPI 4876 // Result returns the result of the asynchronous operation. 4877 // If the operation has not completed it will return an error. 4878 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error) 4879} 4880 4881// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4882func (future *GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture) UnmarshalJSON(body []byte) error { 4883 var azFuture azure.Future 4884 if err := json.Unmarshal(body, &azFuture); err != nil { 4885 return err 4886 } 4887 future.FutureAPI = &azFuture 4888 future.Result = future.result 4889 return nil 4890} 4891 4892// result is the default implementation for GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture.Result. 4893func (future *GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 4894 var done bool 4895 done, err = future.DoneWithContext(context.Background(), client) 4896 if err != nil { 4897 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture", "Result", future.Response(), "Polling failure") 4898 return 4899 } 4900 if !done { 4901 tsgr.Response.Response = future.Response() 4902 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture") 4903 return 4904 } 4905 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4906 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 4907 tsgr, err = client.MigrateGremlinDatabaseToAutoscaleResponder(tsgr.Response.Response) 4908 if err != nil { 4909 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") 4910 } 4911 } 4912 return 4913} 4914 4915// GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture an abstraction for monitoring and 4916// retrieving the results of a long-running operation. 4917type GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture struct { 4918 azure.FutureAPI 4919 // Result returns the result of the asynchronous operation. 4920 // If the operation has not completed it will return an error. 4921 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error) 4922} 4923 4924// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4925func (future *GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture) UnmarshalJSON(body []byte) error { 4926 var azFuture azure.Future 4927 if err := json.Unmarshal(body, &azFuture); err != nil { 4928 return err 4929 } 4930 future.FutureAPI = &azFuture 4931 future.Result = future.result 4932 return nil 4933} 4934 4935// result is the default implementation for GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture.Result. 4936func (future *GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 4937 var done bool 4938 done, err = future.DoneWithContext(context.Background(), client) 4939 if err != nil { 4940 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture", "Result", future.Response(), "Polling failure") 4941 return 4942 } 4943 if !done { 4944 tsgr.Response.Response = future.Response() 4945 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture") 4946 return 4947 } 4948 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4949 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 4950 tsgr, err = client.MigrateGremlinDatabaseToManualThroughputResponder(tsgr.Response.Response) 4951 if err != nil { 4952 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinDatabaseToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 4953 } 4954 } 4955 return 4956} 4957 4958// GremlinResourcesMigrateGremlinGraphToAutoscaleFuture an abstraction for monitoring and retrieving the 4959// results of a long-running operation. 4960type GremlinResourcesMigrateGremlinGraphToAutoscaleFuture struct { 4961 azure.FutureAPI 4962 // Result returns the result of the asynchronous operation. 4963 // If the operation has not completed it will return an error. 4964 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error) 4965} 4966 4967// UnmarshalJSON is the custom unmarshaller for CreateFuture. 4968func (future *GremlinResourcesMigrateGremlinGraphToAutoscaleFuture) UnmarshalJSON(body []byte) error { 4969 var azFuture azure.Future 4970 if err := json.Unmarshal(body, &azFuture); err != nil { 4971 return err 4972 } 4973 future.FutureAPI = &azFuture 4974 future.Result = future.result 4975 return nil 4976} 4977 4978// result is the default implementation for GremlinResourcesMigrateGremlinGraphToAutoscaleFuture.Result. 4979func (future *GremlinResourcesMigrateGremlinGraphToAutoscaleFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 4980 var done bool 4981 done, err = future.DoneWithContext(context.Background(), client) 4982 if err != nil { 4983 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToAutoscaleFuture", "Result", future.Response(), "Polling failure") 4984 return 4985 } 4986 if !done { 4987 tsgr.Response.Response = future.Response() 4988 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinGraphToAutoscaleFuture") 4989 return 4990 } 4991 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4992 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 4993 tsgr, err = client.MigrateGremlinGraphToAutoscaleResponder(tsgr.Response.Response) 4994 if err != nil { 4995 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") 4996 } 4997 } 4998 return 4999} 5000 5001// GremlinResourcesMigrateGremlinGraphToManualThroughputFuture an abstraction for monitoring and retrieving 5002// the results of a long-running operation. 5003type GremlinResourcesMigrateGremlinGraphToManualThroughputFuture struct { 5004 azure.FutureAPI 5005 // Result returns the result of the asynchronous operation. 5006 // If the operation has not completed it will return an error. 5007 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error) 5008} 5009 5010// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5011func (future *GremlinResourcesMigrateGremlinGraphToManualThroughputFuture) UnmarshalJSON(body []byte) error { 5012 var azFuture azure.Future 5013 if err := json.Unmarshal(body, &azFuture); err != nil { 5014 return err 5015 } 5016 future.FutureAPI = &azFuture 5017 future.Result = future.result 5018 return nil 5019} 5020 5021// result is the default implementation for GremlinResourcesMigrateGremlinGraphToManualThroughputFuture.Result. 5022func (future *GremlinResourcesMigrateGremlinGraphToManualThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 5023 var done bool 5024 done, err = future.DoneWithContext(context.Background(), client) 5025 if err != nil { 5026 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToManualThroughputFuture", "Result", future.Response(), "Polling failure") 5027 return 5028 } 5029 if !done { 5030 tsgr.Response.Response = future.Response() 5031 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesMigrateGremlinGraphToManualThroughputFuture") 5032 return 5033 } 5034 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5035 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 5036 tsgr, err = client.MigrateGremlinGraphToManualThroughputResponder(tsgr.Response.Response) 5037 if err != nil { 5038 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesMigrateGremlinGraphToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 5039 } 5040 } 5041 return 5042} 5043 5044// GremlinResourcesUpdateGremlinDatabaseThroughputFuture an abstraction for monitoring and retrieving the 5045// results of a long-running operation. 5046type GremlinResourcesUpdateGremlinDatabaseThroughputFuture struct { 5047 azure.FutureAPI 5048 // Result returns the result of the asynchronous operation. 5049 // If the operation has not completed it will return an error. 5050 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error) 5051} 5052 5053// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5054func (future *GremlinResourcesUpdateGremlinDatabaseThroughputFuture) UnmarshalJSON(body []byte) error { 5055 var azFuture azure.Future 5056 if err := json.Unmarshal(body, &azFuture); err != nil { 5057 return err 5058 } 5059 future.FutureAPI = &azFuture 5060 future.Result = future.result 5061 return nil 5062} 5063 5064// result is the default implementation for GremlinResourcesUpdateGremlinDatabaseThroughputFuture.Result. 5065func (future *GremlinResourcesUpdateGremlinDatabaseThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 5066 var done bool 5067 done, err = future.DoneWithContext(context.Background(), client) 5068 if err != nil { 5069 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture", "Result", future.Response(), "Polling failure") 5070 return 5071 } 5072 if !done { 5073 tsgr.Response.Response = future.Response() 5074 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture") 5075 return 5076 } 5077 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5078 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 5079 tsgr, err = client.UpdateGremlinDatabaseThroughputResponder(tsgr.Response.Response) 5080 if err != nil { 5081 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinDatabaseThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 5082 } 5083 } 5084 return 5085} 5086 5087// GremlinResourcesUpdateGremlinGraphThroughputFuture an abstraction for monitoring and retrieving the 5088// results of a long-running operation. 5089type GremlinResourcesUpdateGremlinGraphThroughputFuture struct { 5090 azure.FutureAPI 5091 // Result returns the result of the asynchronous operation. 5092 // If the operation has not completed it will return an error. 5093 Result func(GremlinResourcesClient) (ThroughputSettingsGetResults, error) 5094} 5095 5096// UnmarshalJSON is the custom unmarshaller for CreateFuture. 5097func (future *GremlinResourcesUpdateGremlinGraphThroughputFuture) UnmarshalJSON(body []byte) error { 5098 var azFuture azure.Future 5099 if err := json.Unmarshal(body, &azFuture); err != nil { 5100 return err 5101 } 5102 future.FutureAPI = &azFuture 5103 future.Result = future.result 5104 return nil 5105} 5106 5107// result is the default implementation for GremlinResourcesUpdateGremlinGraphThroughputFuture.Result. 5108func (future *GremlinResourcesUpdateGremlinGraphThroughputFuture) result(client GremlinResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 5109 var done bool 5110 done, err = future.DoneWithContext(context.Background(), client) 5111 if err != nil { 5112 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture", "Result", future.Response(), "Polling failure") 5113 return 5114 } 5115 if !done { 5116 tsgr.Response.Response = future.Response() 5117 err = azure.NewAsyncOpIncompleteError("documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture") 5118 return 5119 } 5120 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5121 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 5122 tsgr, err = client.UpdateGremlinGraphThroughputResponder(tsgr.Response.Response) 5123 if err != nil { 5124 err = autorest.NewErrorWithError(err, "documentdb.GremlinResourcesUpdateGremlinGraphThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 5125 } 5126 } 5127 return 5128} 5129 5130// IncludedPath the paths that are included in indexing 5131type IncludedPath struct { 5132 // Path - The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) 5133 Path *string `json:"path,omitempty"` 5134 // Indexes - List of indexes for this path 5135 Indexes *[]Indexes `json:"indexes,omitempty"` 5136} 5137 5138// Indexes the indexes for the path. 5139type Indexes struct { 5140 // DataType - The datatype for which the indexing behavior is applied to. Possible values include: 'DataTypeString', 'DataTypeNumber', 'DataTypePoint', 'DataTypePolygon', 'DataTypeLineString', 'DataTypeMultiPolygon' 5141 DataType DataType `json:"dataType,omitempty"` 5142 // Precision - The precision of the index. -1 is maximum precision. 5143 Precision *int32 `json:"precision,omitempty"` 5144 // Kind - Indicates the type of index. Possible values include: 'IndexKindHash', 'IndexKindRange', 'IndexKindSpatial' 5145 Kind IndexKind `json:"kind,omitempty"` 5146} 5147 5148// IndexingPolicy cosmos DB indexing policy 5149type IndexingPolicy struct { 5150 // Automatic - Indicates if the indexing policy is automatic 5151 Automatic *bool `json:"automatic,omitempty"` 5152 // IndexingMode - Indicates the indexing mode. Possible values include: 'IndexingModeConsistent', 'IndexingModeLazy', 'IndexingModeNone' 5153 IndexingMode IndexingMode `json:"indexingMode,omitempty"` 5154 // IncludedPaths - List of paths to include in the indexing 5155 IncludedPaths *[]IncludedPath `json:"includedPaths,omitempty"` 5156 // ExcludedPaths - List of paths to exclude from indexing 5157 ExcludedPaths *[]ExcludedPath `json:"excludedPaths,omitempty"` 5158 // CompositeIndexes - List of composite path list 5159 CompositeIndexes *[][]CompositePath `json:"compositeIndexes,omitempty"` 5160 // SpatialIndexes - List of spatial specifics 5161 SpatialIndexes *[]SpatialSpec `json:"spatialIndexes,omitempty"` 5162} 5163 5164// IPAddressOrRange ipAddressOrRange object 5165type IPAddressOrRange struct { 5166 // IPAddressOrRange - A single IPv4 address or a single IPv4 address range in CIDR format. Provided IPs must be well-formatted and cannot be contained in one of the following ranges: 10.0.0.0/8, 100.64.0.0/10, 172.16.0.0/12, 192.168.0.0/16, since these are not enforceable by the IP address filter. Example of valid inputs: “23.40.210.245” or “23.40.210.0/8”. 5167 IPAddressOrRange *string `json:"ipAddressOrRange,omitempty"` 5168} 5169 5170// ListBackups list of restorable backups for a Cassandra cluster. 5171type ListBackups struct { 5172 autorest.Response `json:"-"` 5173 // Value - READ-ONLY; Container for array of backups. 5174 Value *[]BackupResource `json:"value,omitempty"` 5175} 5176 5177// MarshalJSON is the custom marshaler for ListBackups. 5178func (lb ListBackups) MarshalJSON() ([]byte, error) { 5179 objectMap := make(map[string]interface{}) 5180 return json.Marshal(objectMap) 5181} 5182 5183// ListClusters list of managed Cassandra clusters. 5184type ListClusters struct { 5185 autorest.Response `json:"-"` 5186 // Value - Container for the array of clusters. 5187 Value *[]ClusterResource `json:"value,omitempty"` 5188} 5189 5190// ListDataCenters list of managed Cassandra data centers and their properties. 5191type ListDataCenters struct { 5192 autorest.Response `json:"-"` 5193 // Value - READ-ONLY; Container for array of data centers. 5194 Value *[]DataCenterResource `json:"value,omitempty"` 5195} 5196 5197// MarshalJSON is the custom marshaler for ListDataCenters. 5198func (ldc ListDataCenters) MarshalJSON() ([]byte, error) { 5199 objectMap := make(map[string]interface{}) 5200 return json.Marshal(objectMap) 5201} 5202 5203// Location a region in which the Azure Cosmos DB database account is deployed. 5204type Location struct { 5205 // ID - READ-ONLY; The unique identifier of the region within the database account. Example: <accountName>-<locationName>. 5206 ID *string `json:"id,omitempty"` 5207 // LocationName - The name of the region. 5208 LocationName *string `json:"locationName,omitempty"` 5209 // DocumentEndpoint - READ-ONLY; The connection endpoint for the specific region. Example: https://<accountName>-<locationName>.documents.azure.com:443/ 5210 DocumentEndpoint *string `json:"documentEndpoint,omitempty"` 5211 ProvisioningState *string `json:"provisioningState,omitempty"` 5212 // 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. 5213 FailoverPriority *int32 `json:"failoverPriority,omitempty"` 5214 // IsZoneRedundant - Flag to indicate whether or not this region is an AvailabilityZone region 5215 IsZoneRedundant *bool `json:"isZoneRedundant,omitempty"` 5216} 5217 5218// MarshalJSON is the custom marshaler for Location. 5219func (l Location) MarshalJSON() ([]byte, error) { 5220 objectMap := make(map[string]interface{}) 5221 if l.LocationName != nil { 5222 objectMap["locationName"] = l.LocationName 5223 } 5224 if l.ProvisioningState != nil { 5225 objectMap["provisioningState"] = l.ProvisioningState 5226 } 5227 if l.FailoverPriority != nil { 5228 objectMap["failoverPriority"] = l.FailoverPriority 5229 } 5230 if l.IsZoneRedundant != nil { 5231 objectMap["isZoneRedundant"] = l.IsZoneRedundant 5232 } 5233 return json.Marshal(objectMap) 5234} 5235 5236// LocationGetResult cosmos DB location get result 5237type LocationGetResult struct { 5238 autorest.Response `json:"-"` 5239 // Properties - Cosmos DB location metadata 5240 Properties *LocationProperties `json:"properties,omitempty"` 5241 // ID - READ-ONLY; The unique resource identifier of the database account. 5242 ID *string `json:"id,omitempty"` 5243 // Name - READ-ONLY; The name of the database account. 5244 Name *string `json:"name,omitempty"` 5245 // Type - READ-ONLY; The type of Azure resource. 5246 Type *string `json:"type,omitempty"` 5247} 5248 5249// MarshalJSON is the custom marshaler for LocationGetResult. 5250func (lgr LocationGetResult) MarshalJSON() ([]byte, error) { 5251 objectMap := make(map[string]interface{}) 5252 if lgr.Properties != nil { 5253 objectMap["properties"] = lgr.Properties 5254 } 5255 return json.Marshal(objectMap) 5256} 5257 5258// LocationListResult the List operation response, that contains Cosmos DB locations and their properties. 5259type LocationListResult struct { 5260 autorest.Response `json:"-"` 5261 // Value - READ-ONLY; List of Cosmos DB locations and their properties. 5262 Value *[]LocationGetResult `json:"value,omitempty"` 5263} 5264 5265// MarshalJSON is the custom marshaler for LocationListResult. 5266func (llr LocationListResult) MarshalJSON() ([]byte, error) { 5267 objectMap := make(map[string]interface{}) 5268 return json.Marshal(objectMap) 5269} 5270 5271// LocationProperties cosmos DB location metadata 5272type LocationProperties struct { 5273 // Status - READ-ONLY; The current status of location in Azure. 5274 Status *string `json:"status,omitempty"` 5275 // SupportsAvailabilityZone - READ-ONLY; Flag indicating whether the location supports availability zones or not. 5276 SupportsAvailabilityZone *bool `json:"supportsAvailabilityZone,omitempty"` 5277 // IsResidencyRestricted - READ-ONLY; Flag indicating whether the location is residency sensitive. 5278 IsResidencyRestricted *bool `json:"isResidencyRestricted,omitempty"` 5279 // BackupStorageRedundancies - READ-ONLY; The properties of available backup storage redundancies. 5280 BackupStorageRedundancies *[]BackupStorageRedundancy `json:"backupStorageRedundancies,omitempty"` 5281} 5282 5283// MarshalJSON is the custom marshaler for LocationProperties. 5284func (lp LocationProperties) MarshalJSON() ([]byte, error) { 5285 objectMap := make(map[string]interface{}) 5286 return json.Marshal(objectMap) 5287} 5288 5289// ManagedServiceIdentity identity for the resource. 5290type ManagedServiceIdentity struct { 5291 // PrincipalID - READ-ONLY; The principal id of the system assigned identity. This property will only be provided for a system assigned identity. 5292 PrincipalID *string `json:"principalId,omitempty"` 5293 // TenantID - READ-ONLY; The tenant id of the system assigned identity. This property will only be provided for a system assigned identity. 5294 TenantID *string `json:"tenantId,omitempty"` 5295 // Type - The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' 5296 Type ResourceIdentityType `json:"type,omitempty"` 5297 // UserAssignedIdentities - The list of user identities associated with resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. 5298 UserAssignedIdentities map[string]*ManagedServiceIdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 5299} 5300 5301// MarshalJSON is the custom marshaler for ManagedServiceIdentity. 5302func (msi ManagedServiceIdentity) MarshalJSON() ([]byte, error) { 5303 objectMap := make(map[string]interface{}) 5304 if msi.Type != "" { 5305 objectMap["type"] = msi.Type 5306 } 5307 if msi.UserAssignedIdentities != nil { 5308 objectMap["userAssignedIdentities"] = msi.UserAssignedIdentities 5309 } 5310 return json.Marshal(objectMap) 5311} 5312 5313// ManagedServiceIdentityUserAssignedIdentitiesValue ... 5314type ManagedServiceIdentityUserAssignedIdentitiesValue struct { 5315 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 5316 PrincipalID *string `json:"principalId,omitempty"` 5317 // ClientID - READ-ONLY; The client id of user assigned identity. 5318 ClientID *string `json:"clientId,omitempty"` 5319} 5320 5321// MarshalJSON is the custom marshaler for ManagedServiceIdentityUserAssignedIdentitiesValue. 5322func (msiAiv ManagedServiceIdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { 5323 objectMap := make(map[string]interface{}) 5324 return json.Marshal(objectMap) 5325} 5326 5327// Metric metric data 5328type Metric struct { 5329 // StartTime - READ-ONLY; The start time for the metric (ISO-8601 format). 5330 StartTime *date.Time `json:"startTime,omitempty"` 5331 // EndTime - READ-ONLY; The end time for the metric (ISO-8601 format). 5332 EndTime *date.Time `json:"endTime,omitempty"` 5333 // TimeGrain - READ-ONLY; The time grain to be used to summarize the metric values. 5334 TimeGrain *string `json:"timeGrain,omitempty"` 5335 // Unit - The unit of the metric. Possible values include: 'UnitTypeCount', 'UnitTypeBytes', 'UnitTypeSeconds', 'UnitTypePercent', 'UnitTypeCountPerSecond', 'UnitTypeBytesPerSecond', 'UnitTypeMilliseconds' 5336 Unit UnitType `json:"unit,omitempty"` 5337 // Name - READ-ONLY; The name information for the metric. 5338 Name *MetricName `json:"name,omitempty"` 5339 // MetricValues - READ-ONLY; The metric values for the specified time window and timestep. 5340 MetricValues *[]MetricValue `json:"metricValues,omitempty"` 5341} 5342 5343// MarshalJSON is the custom marshaler for Metric. 5344func (mVar Metric) MarshalJSON() ([]byte, error) { 5345 objectMap := make(map[string]interface{}) 5346 if mVar.Unit != "" { 5347 objectMap["unit"] = mVar.Unit 5348 } 5349 return json.Marshal(objectMap) 5350} 5351 5352// MetricAvailability the availability of the metric. 5353type MetricAvailability struct { 5354 // TimeGrain - READ-ONLY; The time grain to be used to summarize the metric values. 5355 TimeGrain *string `json:"timeGrain,omitempty"` 5356 // Retention - READ-ONLY; The retention for the metric values. 5357 Retention *string `json:"retention,omitempty"` 5358} 5359 5360// MarshalJSON is the custom marshaler for MetricAvailability. 5361func (ma MetricAvailability) MarshalJSON() ([]byte, error) { 5362 objectMap := make(map[string]interface{}) 5363 return json.Marshal(objectMap) 5364} 5365 5366// MetricDefinition the definition of a metric. 5367type MetricDefinition struct { 5368 // MetricAvailabilities - READ-ONLY; The list of metric availabilities for the account. 5369 MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"` 5370 // PrimaryAggregationType - READ-ONLY; The primary aggregation type of the metric. Possible values include: 'PrimaryAggregationTypeNone', 'PrimaryAggregationTypeAverage', 'PrimaryAggregationTypeTotal', 'PrimaryAggregationTypeMinimum', 'PrimaryAggregationTypeMaximum', 'PrimaryAggregationTypeLast' 5371 PrimaryAggregationType PrimaryAggregationType `json:"primaryAggregationType,omitempty"` 5372 // Unit - The unit of the metric. Possible values include: 'UnitTypeCount', 'UnitTypeBytes', 'UnitTypeSeconds', 'UnitTypePercent', 'UnitTypeCountPerSecond', 'UnitTypeBytesPerSecond', 'UnitTypeMilliseconds' 5373 Unit UnitType `json:"unit,omitempty"` 5374 // ResourceURI - READ-ONLY; The resource uri of the database. 5375 ResourceURI *string `json:"resourceUri,omitempty"` 5376 // Name - READ-ONLY; The name information for the metric. 5377 Name *MetricName `json:"name,omitempty"` 5378} 5379 5380// MarshalJSON is the custom marshaler for MetricDefinition. 5381func (md MetricDefinition) MarshalJSON() ([]byte, error) { 5382 objectMap := make(map[string]interface{}) 5383 if md.Unit != "" { 5384 objectMap["unit"] = md.Unit 5385 } 5386 return json.Marshal(objectMap) 5387} 5388 5389// MetricDefinitionsListResult the response to a list metric definitions request. 5390type MetricDefinitionsListResult struct { 5391 autorest.Response `json:"-"` 5392 // Value - READ-ONLY; The list of metric definitions for the account. 5393 Value *[]MetricDefinition `json:"value,omitempty"` 5394} 5395 5396// MarshalJSON is the custom marshaler for MetricDefinitionsListResult. 5397func (mdlr MetricDefinitionsListResult) MarshalJSON() ([]byte, error) { 5398 objectMap := make(map[string]interface{}) 5399 return json.Marshal(objectMap) 5400} 5401 5402// MetricListResult the response to a list metrics request. 5403type MetricListResult struct { 5404 autorest.Response `json:"-"` 5405 // Value - READ-ONLY; The list of metrics for the account. 5406 Value *[]Metric `json:"value,omitempty"` 5407} 5408 5409// MarshalJSON is the custom marshaler for MetricListResult. 5410func (mlr MetricListResult) MarshalJSON() ([]byte, error) { 5411 objectMap := make(map[string]interface{}) 5412 return json.Marshal(objectMap) 5413} 5414 5415// MetricName a metric name. 5416type MetricName struct { 5417 // Value - READ-ONLY; The name of the metric. 5418 Value *string `json:"value,omitempty"` 5419 // LocalizedValue - READ-ONLY; The friendly name of the metric. 5420 LocalizedValue *string `json:"localizedValue,omitempty"` 5421} 5422 5423// MarshalJSON is the custom marshaler for MetricName. 5424func (mn MetricName) MarshalJSON() ([]byte, error) { 5425 objectMap := make(map[string]interface{}) 5426 return json.Marshal(objectMap) 5427} 5428 5429// MetricValue represents metrics values. 5430type MetricValue struct { 5431 // Count - READ-ONLY; The number of values for the metric. 5432 Count *float64 `json:"_count,omitempty"` 5433 // Average - READ-ONLY; The average value of the metric. 5434 Average *float64 `json:"average,omitempty"` 5435 // Maximum - READ-ONLY; The max value of the metric. 5436 Maximum *float64 `json:"maximum,omitempty"` 5437 // Minimum - READ-ONLY; The min value of the metric. 5438 Minimum *float64 `json:"minimum,omitempty"` 5439 // Timestamp - READ-ONLY; The metric timestamp (ISO-8601 format). 5440 Timestamp *date.Time `json:"timestamp,omitempty"` 5441 // Total - READ-ONLY; The total value of the metric. 5442 Total *float64 `json:"total,omitempty"` 5443} 5444 5445// MarshalJSON is the custom marshaler for MetricValue. 5446func (mv MetricValue) MarshalJSON() ([]byte, error) { 5447 objectMap := make(map[string]interface{}) 5448 return json.Marshal(objectMap) 5449} 5450 5451// MongoDBCollectionCreateUpdateParameters parameters to create and update Cosmos DB MongoDB collection. 5452type MongoDBCollectionCreateUpdateParameters struct { 5453 // MongoDBCollectionCreateUpdateProperties - Properties to create and update Azure Cosmos DB MongoDB collection. 5454 *MongoDBCollectionCreateUpdateProperties `json:"properties,omitempty"` 5455 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 5456 ID *string `json:"id,omitempty"` 5457 // Name - READ-ONLY; The name of the ARM resource. 5458 Name *string `json:"name,omitempty"` 5459 // Type - READ-ONLY; The type of Azure resource. 5460 Type *string `json:"type,omitempty"` 5461 // Location - The location of the resource group to which the resource belongs. 5462 Location *string `json:"location,omitempty"` 5463 Tags map[string]*string `json:"tags"` 5464 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 5465} 5466 5467// MarshalJSON is the custom marshaler for MongoDBCollectionCreateUpdateParameters. 5468func (mdccup MongoDBCollectionCreateUpdateParameters) MarshalJSON() ([]byte, error) { 5469 objectMap := make(map[string]interface{}) 5470 if mdccup.MongoDBCollectionCreateUpdateProperties != nil { 5471 objectMap["properties"] = mdccup.MongoDBCollectionCreateUpdateProperties 5472 } 5473 if mdccup.Location != nil { 5474 objectMap["location"] = mdccup.Location 5475 } 5476 if mdccup.Tags != nil { 5477 objectMap["tags"] = mdccup.Tags 5478 } 5479 if mdccup.Identity != nil { 5480 objectMap["identity"] = mdccup.Identity 5481 } 5482 return json.Marshal(objectMap) 5483} 5484 5485// UnmarshalJSON is the custom unmarshaler for MongoDBCollectionCreateUpdateParameters struct. 5486func (mdccup *MongoDBCollectionCreateUpdateParameters) UnmarshalJSON(body []byte) error { 5487 var m map[string]*json.RawMessage 5488 err := json.Unmarshal(body, &m) 5489 if err != nil { 5490 return err 5491 } 5492 for k, v := range m { 5493 switch k { 5494 case "properties": 5495 if v != nil { 5496 var mongoDBCollectionCreateUpdateProperties MongoDBCollectionCreateUpdateProperties 5497 err = json.Unmarshal(*v, &mongoDBCollectionCreateUpdateProperties) 5498 if err != nil { 5499 return err 5500 } 5501 mdccup.MongoDBCollectionCreateUpdateProperties = &mongoDBCollectionCreateUpdateProperties 5502 } 5503 case "id": 5504 if v != nil { 5505 var ID string 5506 err = json.Unmarshal(*v, &ID) 5507 if err != nil { 5508 return err 5509 } 5510 mdccup.ID = &ID 5511 } 5512 case "name": 5513 if v != nil { 5514 var name string 5515 err = json.Unmarshal(*v, &name) 5516 if err != nil { 5517 return err 5518 } 5519 mdccup.Name = &name 5520 } 5521 case "type": 5522 if v != nil { 5523 var typeVar string 5524 err = json.Unmarshal(*v, &typeVar) 5525 if err != nil { 5526 return err 5527 } 5528 mdccup.Type = &typeVar 5529 } 5530 case "location": 5531 if v != nil { 5532 var location string 5533 err = json.Unmarshal(*v, &location) 5534 if err != nil { 5535 return err 5536 } 5537 mdccup.Location = &location 5538 } 5539 case "tags": 5540 if v != nil { 5541 var tags map[string]*string 5542 err = json.Unmarshal(*v, &tags) 5543 if err != nil { 5544 return err 5545 } 5546 mdccup.Tags = tags 5547 } 5548 case "identity": 5549 if v != nil { 5550 var identity ManagedServiceIdentity 5551 err = json.Unmarshal(*v, &identity) 5552 if err != nil { 5553 return err 5554 } 5555 mdccup.Identity = &identity 5556 } 5557 } 5558 } 5559 5560 return nil 5561} 5562 5563// MongoDBCollectionCreateUpdateProperties properties to create and update Azure Cosmos DB MongoDB 5564// collection. 5565type MongoDBCollectionCreateUpdateProperties struct { 5566 // Resource - The standard JSON format of a MongoDB collection 5567 Resource *MongoDBCollectionResource `json:"resource,omitempty"` 5568 // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. 5569 Options *CreateUpdateOptions `json:"options,omitempty"` 5570} 5571 5572// MongoDBCollectionGetProperties the properties of an Azure Cosmos DB MongoDB collection 5573type MongoDBCollectionGetProperties struct { 5574 Resource *MongoDBCollectionGetPropertiesResource `json:"resource,omitempty"` 5575 Options *MongoDBCollectionGetPropertiesOptions `json:"options,omitempty"` 5576} 5577 5578// MongoDBCollectionGetPropertiesOptions ... 5579type MongoDBCollectionGetPropertiesOptions struct { 5580 // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. 5581 Throughput *int32 `json:"throughput,omitempty"` 5582 // AutoscaleSettings - Specifies the Autoscale settings. 5583 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` 5584} 5585 5586// MongoDBCollectionGetPropertiesResource ... 5587type MongoDBCollectionGetPropertiesResource struct { 5588 // ID - Name of the Cosmos DB MongoDB collection 5589 ID *string `json:"id,omitempty"` 5590 // ShardKey - A key-value pair of shard keys to be applied for the request. 5591 ShardKey map[string]*string `json:"shardKey"` 5592 // Indexes - List of index keys 5593 Indexes *[]MongoIndex `json:"indexes,omitempty"` 5594 // AnalyticalStorageTTL - Analytical TTL. 5595 AnalyticalStorageTTL *int32 `json:"analyticalStorageTtl,omitempty"` 5596 // Rid - READ-ONLY; A system generated property. A unique identifier. 5597 Rid *string `json:"_rid,omitempty"` 5598 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 5599 Ts *float64 `json:"_ts,omitempty"` 5600 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 5601 Etag *string `json:"_etag,omitempty"` 5602} 5603 5604// MarshalJSON is the custom marshaler for MongoDBCollectionGetPropertiesResource. 5605func (mdcgp MongoDBCollectionGetPropertiesResource) MarshalJSON() ([]byte, error) { 5606 objectMap := make(map[string]interface{}) 5607 if mdcgp.ID != nil { 5608 objectMap["id"] = mdcgp.ID 5609 } 5610 if mdcgp.ShardKey != nil { 5611 objectMap["shardKey"] = mdcgp.ShardKey 5612 } 5613 if mdcgp.Indexes != nil { 5614 objectMap["indexes"] = mdcgp.Indexes 5615 } 5616 if mdcgp.AnalyticalStorageTTL != nil { 5617 objectMap["analyticalStorageTtl"] = mdcgp.AnalyticalStorageTTL 5618 } 5619 return json.Marshal(objectMap) 5620} 5621 5622// MongoDBCollectionGetResults an Azure Cosmos DB MongoDB collection. 5623type MongoDBCollectionGetResults struct { 5624 autorest.Response `json:"-"` 5625 // MongoDBCollectionGetProperties - The properties of an Azure Cosmos DB MongoDB collection 5626 *MongoDBCollectionGetProperties `json:"properties,omitempty"` 5627 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 5628 ID *string `json:"id,omitempty"` 5629 // Name - READ-ONLY; The name of the ARM resource. 5630 Name *string `json:"name,omitempty"` 5631 // Type - READ-ONLY; The type of Azure resource. 5632 Type *string `json:"type,omitempty"` 5633 // Location - The location of the resource group to which the resource belongs. 5634 Location *string `json:"location,omitempty"` 5635 Tags map[string]*string `json:"tags"` 5636 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 5637} 5638 5639// MarshalJSON is the custom marshaler for MongoDBCollectionGetResults. 5640func (mdcgr MongoDBCollectionGetResults) MarshalJSON() ([]byte, error) { 5641 objectMap := make(map[string]interface{}) 5642 if mdcgr.MongoDBCollectionGetProperties != nil { 5643 objectMap["properties"] = mdcgr.MongoDBCollectionGetProperties 5644 } 5645 if mdcgr.Location != nil { 5646 objectMap["location"] = mdcgr.Location 5647 } 5648 if mdcgr.Tags != nil { 5649 objectMap["tags"] = mdcgr.Tags 5650 } 5651 if mdcgr.Identity != nil { 5652 objectMap["identity"] = mdcgr.Identity 5653 } 5654 return json.Marshal(objectMap) 5655} 5656 5657// UnmarshalJSON is the custom unmarshaler for MongoDBCollectionGetResults struct. 5658func (mdcgr *MongoDBCollectionGetResults) UnmarshalJSON(body []byte) error { 5659 var m map[string]*json.RawMessage 5660 err := json.Unmarshal(body, &m) 5661 if err != nil { 5662 return err 5663 } 5664 for k, v := range m { 5665 switch k { 5666 case "properties": 5667 if v != nil { 5668 var mongoDBCollectionGetProperties MongoDBCollectionGetProperties 5669 err = json.Unmarshal(*v, &mongoDBCollectionGetProperties) 5670 if err != nil { 5671 return err 5672 } 5673 mdcgr.MongoDBCollectionGetProperties = &mongoDBCollectionGetProperties 5674 } 5675 case "id": 5676 if v != nil { 5677 var ID string 5678 err = json.Unmarshal(*v, &ID) 5679 if err != nil { 5680 return err 5681 } 5682 mdcgr.ID = &ID 5683 } 5684 case "name": 5685 if v != nil { 5686 var name string 5687 err = json.Unmarshal(*v, &name) 5688 if err != nil { 5689 return err 5690 } 5691 mdcgr.Name = &name 5692 } 5693 case "type": 5694 if v != nil { 5695 var typeVar string 5696 err = json.Unmarshal(*v, &typeVar) 5697 if err != nil { 5698 return err 5699 } 5700 mdcgr.Type = &typeVar 5701 } 5702 case "location": 5703 if v != nil { 5704 var location string 5705 err = json.Unmarshal(*v, &location) 5706 if err != nil { 5707 return err 5708 } 5709 mdcgr.Location = &location 5710 } 5711 case "tags": 5712 if v != nil { 5713 var tags map[string]*string 5714 err = json.Unmarshal(*v, &tags) 5715 if err != nil { 5716 return err 5717 } 5718 mdcgr.Tags = tags 5719 } 5720 case "identity": 5721 if v != nil { 5722 var identity ManagedServiceIdentity 5723 err = json.Unmarshal(*v, &identity) 5724 if err != nil { 5725 return err 5726 } 5727 mdcgr.Identity = &identity 5728 } 5729 } 5730 } 5731 5732 return nil 5733} 5734 5735// MongoDBCollectionListResult the List operation response, that contains the MongoDB collections and their 5736// properties. 5737type MongoDBCollectionListResult struct { 5738 autorest.Response `json:"-"` 5739 // Value - READ-ONLY; List of MongoDB collections and their properties. 5740 Value *[]MongoDBCollectionGetResults `json:"value,omitempty"` 5741} 5742 5743// MarshalJSON is the custom marshaler for MongoDBCollectionListResult. 5744func (mdclr MongoDBCollectionListResult) MarshalJSON() ([]byte, error) { 5745 objectMap := make(map[string]interface{}) 5746 return json.Marshal(objectMap) 5747} 5748 5749// MongoDBCollectionResource cosmos DB MongoDB collection resource object 5750type MongoDBCollectionResource struct { 5751 // ID - Name of the Cosmos DB MongoDB collection 5752 ID *string `json:"id,omitempty"` 5753 // ShardKey - A key-value pair of shard keys to be applied for the request. 5754 ShardKey map[string]*string `json:"shardKey"` 5755 // Indexes - List of index keys 5756 Indexes *[]MongoIndex `json:"indexes,omitempty"` 5757 // AnalyticalStorageTTL - Analytical TTL. 5758 AnalyticalStorageTTL *int32 `json:"analyticalStorageTtl,omitempty"` 5759} 5760 5761// MarshalJSON is the custom marshaler for MongoDBCollectionResource. 5762func (mdcr MongoDBCollectionResource) MarshalJSON() ([]byte, error) { 5763 objectMap := make(map[string]interface{}) 5764 if mdcr.ID != nil { 5765 objectMap["id"] = mdcr.ID 5766 } 5767 if mdcr.ShardKey != nil { 5768 objectMap["shardKey"] = mdcr.ShardKey 5769 } 5770 if mdcr.Indexes != nil { 5771 objectMap["indexes"] = mdcr.Indexes 5772 } 5773 if mdcr.AnalyticalStorageTTL != nil { 5774 objectMap["analyticalStorageTtl"] = mdcr.AnalyticalStorageTTL 5775 } 5776 return json.Marshal(objectMap) 5777} 5778 5779// MongoDBDatabaseCreateUpdateParameters parameters to create and update Cosmos DB MongoDB database. 5780type MongoDBDatabaseCreateUpdateParameters struct { 5781 // MongoDBDatabaseCreateUpdateProperties - Properties to create and update Azure Cosmos DB MongoDB database. 5782 *MongoDBDatabaseCreateUpdateProperties `json:"properties,omitempty"` 5783 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 5784 ID *string `json:"id,omitempty"` 5785 // Name - READ-ONLY; The name of the ARM resource. 5786 Name *string `json:"name,omitempty"` 5787 // Type - READ-ONLY; The type of Azure resource. 5788 Type *string `json:"type,omitempty"` 5789 // Location - The location of the resource group to which the resource belongs. 5790 Location *string `json:"location,omitempty"` 5791 Tags map[string]*string `json:"tags"` 5792 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 5793} 5794 5795// MarshalJSON is the custom marshaler for MongoDBDatabaseCreateUpdateParameters. 5796func (mddcup MongoDBDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { 5797 objectMap := make(map[string]interface{}) 5798 if mddcup.MongoDBDatabaseCreateUpdateProperties != nil { 5799 objectMap["properties"] = mddcup.MongoDBDatabaseCreateUpdateProperties 5800 } 5801 if mddcup.Location != nil { 5802 objectMap["location"] = mddcup.Location 5803 } 5804 if mddcup.Tags != nil { 5805 objectMap["tags"] = mddcup.Tags 5806 } 5807 if mddcup.Identity != nil { 5808 objectMap["identity"] = mddcup.Identity 5809 } 5810 return json.Marshal(objectMap) 5811} 5812 5813// UnmarshalJSON is the custom unmarshaler for MongoDBDatabaseCreateUpdateParameters struct. 5814func (mddcup *MongoDBDatabaseCreateUpdateParameters) UnmarshalJSON(body []byte) error { 5815 var m map[string]*json.RawMessage 5816 err := json.Unmarshal(body, &m) 5817 if err != nil { 5818 return err 5819 } 5820 for k, v := range m { 5821 switch k { 5822 case "properties": 5823 if v != nil { 5824 var mongoDBDatabaseCreateUpdateProperties MongoDBDatabaseCreateUpdateProperties 5825 err = json.Unmarshal(*v, &mongoDBDatabaseCreateUpdateProperties) 5826 if err != nil { 5827 return err 5828 } 5829 mddcup.MongoDBDatabaseCreateUpdateProperties = &mongoDBDatabaseCreateUpdateProperties 5830 } 5831 case "id": 5832 if v != nil { 5833 var ID string 5834 err = json.Unmarshal(*v, &ID) 5835 if err != nil { 5836 return err 5837 } 5838 mddcup.ID = &ID 5839 } 5840 case "name": 5841 if v != nil { 5842 var name string 5843 err = json.Unmarshal(*v, &name) 5844 if err != nil { 5845 return err 5846 } 5847 mddcup.Name = &name 5848 } 5849 case "type": 5850 if v != nil { 5851 var typeVar string 5852 err = json.Unmarshal(*v, &typeVar) 5853 if err != nil { 5854 return err 5855 } 5856 mddcup.Type = &typeVar 5857 } 5858 case "location": 5859 if v != nil { 5860 var location string 5861 err = json.Unmarshal(*v, &location) 5862 if err != nil { 5863 return err 5864 } 5865 mddcup.Location = &location 5866 } 5867 case "tags": 5868 if v != nil { 5869 var tags map[string]*string 5870 err = json.Unmarshal(*v, &tags) 5871 if err != nil { 5872 return err 5873 } 5874 mddcup.Tags = tags 5875 } 5876 case "identity": 5877 if v != nil { 5878 var identity ManagedServiceIdentity 5879 err = json.Unmarshal(*v, &identity) 5880 if err != nil { 5881 return err 5882 } 5883 mddcup.Identity = &identity 5884 } 5885 } 5886 } 5887 5888 return nil 5889} 5890 5891// MongoDBDatabaseCreateUpdateProperties properties to create and update Azure Cosmos DB MongoDB database. 5892type MongoDBDatabaseCreateUpdateProperties struct { 5893 // Resource - The standard JSON format of a MongoDB database 5894 Resource *MongoDBDatabaseResource `json:"resource,omitempty"` 5895 // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. 5896 Options *CreateUpdateOptions `json:"options,omitempty"` 5897} 5898 5899// MongoDBDatabaseGetProperties the properties of an Azure Cosmos DB MongoDB database 5900type MongoDBDatabaseGetProperties struct { 5901 Resource *MongoDBDatabaseGetPropertiesResource `json:"resource,omitempty"` 5902 Options *MongoDBDatabaseGetPropertiesOptions `json:"options,omitempty"` 5903} 5904 5905// MongoDBDatabaseGetPropertiesOptions ... 5906type MongoDBDatabaseGetPropertiesOptions struct { 5907 // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. 5908 Throughput *int32 `json:"throughput,omitempty"` 5909 // AutoscaleSettings - Specifies the Autoscale settings. 5910 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` 5911} 5912 5913// MongoDBDatabaseGetPropertiesResource ... 5914type MongoDBDatabaseGetPropertiesResource struct { 5915 // ID - Name of the Cosmos DB MongoDB database 5916 ID *string `json:"id,omitempty"` 5917 // Rid - READ-ONLY; A system generated property. A unique identifier. 5918 Rid *string `json:"_rid,omitempty"` 5919 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 5920 Ts *float64 `json:"_ts,omitempty"` 5921 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 5922 Etag *string `json:"_etag,omitempty"` 5923} 5924 5925// MarshalJSON is the custom marshaler for MongoDBDatabaseGetPropertiesResource. 5926func (mddgp MongoDBDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) { 5927 objectMap := make(map[string]interface{}) 5928 if mddgp.ID != nil { 5929 objectMap["id"] = mddgp.ID 5930 } 5931 return json.Marshal(objectMap) 5932} 5933 5934// MongoDBDatabaseGetResults an Azure Cosmos DB MongoDB database. 5935type MongoDBDatabaseGetResults struct { 5936 autorest.Response `json:"-"` 5937 // MongoDBDatabaseGetProperties - The properties of an Azure Cosmos DB MongoDB database 5938 *MongoDBDatabaseGetProperties `json:"properties,omitempty"` 5939 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 5940 ID *string `json:"id,omitempty"` 5941 // Name - READ-ONLY; The name of the ARM resource. 5942 Name *string `json:"name,omitempty"` 5943 // Type - READ-ONLY; The type of Azure resource. 5944 Type *string `json:"type,omitempty"` 5945 // Location - The location of the resource group to which the resource belongs. 5946 Location *string `json:"location,omitempty"` 5947 Tags map[string]*string `json:"tags"` 5948 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 5949} 5950 5951// MarshalJSON is the custom marshaler for MongoDBDatabaseGetResults. 5952func (mddgr MongoDBDatabaseGetResults) MarshalJSON() ([]byte, error) { 5953 objectMap := make(map[string]interface{}) 5954 if mddgr.MongoDBDatabaseGetProperties != nil { 5955 objectMap["properties"] = mddgr.MongoDBDatabaseGetProperties 5956 } 5957 if mddgr.Location != nil { 5958 objectMap["location"] = mddgr.Location 5959 } 5960 if mddgr.Tags != nil { 5961 objectMap["tags"] = mddgr.Tags 5962 } 5963 if mddgr.Identity != nil { 5964 objectMap["identity"] = mddgr.Identity 5965 } 5966 return json.Marshal(objectMap) 5967} 5968 5969// UnmarshalJSON is the custom unmarshaler for MongoDBDatabaseGetResults struct. 5970func (mddgr *MongoDBDatabaseGetResults) UnmarshalJSON(body []byte) error { 5971 var m map[string]*json.RawMessage 5972 err := json.Unmarshal(body, &m) 5973 if err != nil { 5974 return err 5975 } 5976 for k, v := range m { 5977 switch k { 5978 case "properties": 5979 if v != nil { 5980 var mongoDBDatabaseGetProperties MongoDBDatabaseGetProperties 5981 err = json.Unmarshal(*v, &mongoDBDatabaseGetProperties) 5982 if err != nil { 5983 return err 5984 } 5985 mddgr.MongoDBDatabaseGetProperties = &mongoDBDatabaseGetProperties 5986 } 5987 case "id": 5988 if v != nil { 5989 var ID string 5990 err = json.Unmarshal(*v, &ID) 5991 if err != nil { 5992 return err 5993 } 5994 mddgr.ID = &ID 5995 } 5996 case "name": 5997 if v != nil { 5998 var name string 5999 err = json.Unmarshal(*v, &name) 6000 if err != nil { 6001 return err 6002 } 6003 mddgr.Name = &name 6004 } 6005 case "type": 6006 if v != nil { 6007 var typeVar string 6008 err = json.Unmarshal(*v, &typeVar) 6009 if err != nil { 6010 return err 6011 } 6012 mddgr.Type = &typeVar 6013 } 6014 case "location": 6015 if v != nil { 6016 var location string 6017 err = json.Unmarshal(*v, &location) 6018 if err != nil { 6019 return err 6020 } 6021 mddgr.Location = &location 6022 } 6023 case "tags": 6024 if v != nil { 6025 var tags map[string]*string 6026 err = json.Unmarshal(*v, &tags) 6027 if err != nil { 6028 return err 6029 } 6030 mddgr.Tags = tags 6031 } 6032 case "identity": 6033 if v != nil { 6034 var identity ManagedServiceIdentity 6035 err = json.Unmarshal(*v, &identity) 6036 if err != nil { 6037 return err 6038 } 6039 mddgr.Identity = &identity 6040 } 6041 } 6042 } 6043 6044 return nil 6045} 6046 6047// MongoDBDatabaseListResult the List operation response, that contains the MongoDB databases and their 6048// properties. 6049type MongoDBDatabaseListResult struct { 6050 autorest.Response `json:"-"` 6051 // Value - READ-ONLY; List of MongoDB databases and their properties. 6052 Value *[]MongoDBDatabaseGetResults `json:"value,omitempty"` 6053} 6054 6055// MarshalJSON is the custom marshaler for MongoDBDatabaseListResult. 6056func (mddlr MongoDBDatabaseListResult) MarshalJSON() ([]byte, error) { 6057 objectMap := make(map[string]interface{}) 6058 return json.Marshal(objectMap) 6059} 6060 6061// MongoDBDatabaseResource cosmos DB MongoDB database resource object 6062type MongoDBDatabaseResource struct { 6063 // ID - Name of the Cosmos DB MongoDB database 6064 ID *string `json:"id,omitempty"` 6065} 6066 6067// MongoDBResourcesCreateUpdateMongoDBCollectionFuture an abstraction for monitoring and retrieving the 6068// results of a long-running operation. 6069type MongoDBResourcesCreateUpdateMongoDBCollectionFuture struct { 6070 azure.FutureAPI 6071 // Result returns the result of the asynchronous operation. 6072 // If the operation has not completed it will return an error. 6073 Result func(MongoDBResourcesClient) (MongoDBCollectionGetResults, error) 6074} 6075 6076// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6077func (future *MongoDBResourcesCreateUpdateMongoDBCollectionFuture) UnmarshalJSON(body []byte) error { 6078 var azFuture azure.Future 6079 if err := json.Unmarshal(body, &azFuture); err != nil { 6080 return err 6081 } 6082 future.FutureAPI = &azFuture 6083 future.Result = future.result 6084 return nil 6085} 6086 6087// result is the default implementation for MongoDBResourcesCreateUpdateMongoDBCollectionFuture.Result. 6088func (future *MongoDBResourcesCreateUpdateMongoDBCollectionFuture) result(client MongoDBResourcesClient) (mdcgr MongoDBCollectionGetResults, err error) { 6089 var done bool 6090 done, err = future.DoneWithContext(context.Background(), client) 6091 if err != nil { 6092 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture", "Result", future.Response(), "Polling failure") 6093 return 6094 } 6095 if !done { 6096 mdcgr.Response.Response = future.Response() 6097 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture") 6098 return 6099 } 6100 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6101 if mdcgr.Response.Response, err = future.GetResult(sender); err == nil && mdcgr.Response.Response.StatusCode != http.StatusNoContent { 6102 mdcgr, err = client.CreateUpdateMongoDBCollectionResponder(mdcgr.Response.Response) 6103 if err != nil { 6104 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBCollectionFuture", "Result", mdcgr.Response.Response, "Failure responding to request") 6105 } 6106 } 6107 return 6108} 6109 6110// MongoDBResourcesCreateUpdateMongoDBDatabaseFuture an abstraction for monitoring and retrieving the 6111// results of a long-running operation. 6112type MongoDBResourcesCreateUpdateMongoDBDatabaseFuture struct { 6113 azure.FutureAPI 6114 // Result returns the result of the asynchronous operation. 6115 // If the operation has not completed it will return an error. 6116 Result func(MongoDBResourcesClient) (MongoDBDatabaseGetResults, error) 6117} 6118 6119// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6120func (future *MongoDBResourcesCreateUpdateMongoDBDatabaseFuture) UnmarshalJSON(body []byte) error { 6121 var azFuture azure.Future 6122 if err := json.Unmarshal(body, &azFuture); err != nil { 6123 return err 6124 } 6125 future.FutureAPI = &azFuture 6126 future.Result = future.result 6127 return nil 6128} 6129 6130// result is the default implementation for MongoDBResourcesCreateUpdateMongoDBDatabaseFuture.Result. 6131func (future *MongoDBResourcesCreateUpdateMongoDBDatabaseFuture) result(client MongoDBResourcesClient) (mddgr MongoDBDatabaseGetResults, err error) { 6132 var done bool 6133 done, err = future.DoneWithContext(context.Background(), client) 6134 if err != nil { 6135 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture", "Result", future.Response(), "Polling failure") 6136 return 6137 } 6138 if !done { 6139 mddgr.Response.Response = future.Response() 6140 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture") 6141 return 6142 } 6143 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6144 if mddgr.Response.Response, err = future.GetResult(sender); err == nil && mddgr.Response.Response.StatusCode != http.StatusNoContent { 6145 mddgr, err = client.CreateUpdateMongoDBDatabaseResponder(mddgr.Response.Response) 6146 if err != nil { 6147 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesCreateUpdateMongoDBDatabaseFuture", "Result", mddgr.Response.Response, "Failure responding to request") 6148 } 6149 } 6150 return 6151} 6152 6153// MongoDBResourcesDeleteMongoDBCollectionFuture an abstraction for monitoring and retrieving the results 6154// of a long-running operation. 6155type MongoDBResourcesDeleteMongoDBCollectionFuture struct { 6156 azure.FutureAPI 6157 // Result returns the result of the asynchronous operation. 6158 // If the operation has not completed it will return an error. 6159 Result func(MongoDBResourcesClient) (autorest.Response, error) 6160} 6161 6162// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6163func (future *MongoDBResourcesDeleteMongoDBCollectionFuture) UnmarshalJSON(body []byte) error { 6164 var azFuture azure.Future 6165 if err := json.Unmarshal(body, &azFuture); err != nil { 6166 return err 6167 } 6168 future.FutureAPI = &azFuture 6169 future.Result = future.result 6170 return nil 6171} 6172 6173// result is the default implementation for MongoDBResourcesDeleteMongoDBCollectionFuture.Result. 6174func (future *MongoDBResourcesDeleteMongoDBCollectionFuture) result(client MongoDBResourcesClient) (ar autorest.Response, err error) { 6175 var done bool 6176 done, err = future.DoneWithContext(context.Background(), client) 6177 if err != nil { 6178 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesDeleteMongoDBCollectionFuture", "Result", future.Response(), "Polling failure") 6179 return 6180 } 6181 if !done { 6182 ar.Response = future.Response() 6183 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesDeleteMongoDBCollectionFuture") 6184 return 6185 } 6186 ar.Response = future.Response() 6187 return 6188} 6189 6190// MongoDBResourcesDeleteMongoDBDatabaseFuture an abstraction for monitoring and retrieving the results of 6191// a long-running operation. 6192type MongoDBResourcesDeleteMongoDBDatabaseFuture struct { 6193 azure.FutureAPI 6194 // Result returns the result of the asynchronous operation. 6195 // If the operation has not completed it will return an error. 6196 Result func(MongoDBResourcesClient) (autorest.Response, error) 6197} 6198 6199// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6200func (future *MongoDBResourcesDeleteMongoDBDatabaseFuture) UnmarshalJSON(body []byte) error { 6201 var azFuture azure.Future 6202 if err := json.Unmarshal(body, &azFuture); err != nil { 6203 return err 6204 } 6205 future.FutureAPI = &azFuture 6206 future.Result = future.result 6207 return nil 6208} 6209 6210// result is the default implementation for MongoDBResourcesDeleteMongoDBDatabaseFuture.Result. 6211func (future *MongoDBResourcesDeleteMongoDBDatabaseFuture) result(client MongoDBResourcesClient) (ar autorest.Response, err error) { 6212 var done bool 6213 done, err = future.DoneWithContext(context.Background(), client) 6214 if err != nil { 6215 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesDeleteMongoDBDatabaseFuture", "Result", future.Response(), "Polling failure") 6216 return 6217 } 6218 if !done { 6219 ar.Response = future.Response() 6220 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesDeleteMongoDBDatabaseFuture") 6221 return 6222 } 6223 ar.Response = future.Response() 6224 return 6225} 6226 6227// MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture an abstraction for monitoring and retrieving 6228// the results of a long-running operation. 6229type MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture struct { 6230 azure.FutureAPI 6231 // Result returns the result of the asynchronous operation. 6232 // If the operation has not completed it will return an error. 6233 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error) 6234} 6235 6236// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6237func (future *MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture) UnmarshalJSON(body []byte) error { 6238 var azFuture azure.Future 6239 if err := json.Unmarshal(body, &azFuture); err != nil { 6240 return err 6241 } 6242 future.FutureAPI = &azFuture 6243 future.Result = future.result 6244 return nil 6245} 6246 6247// result is the default implementation for MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture.Result. 6248func (future *MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 6249 var done bool 6250 done, err = future.DoneWithContext(context.Background(), client) 6251 if err != nil { 6252 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture", "Result", future.Response(), "Polling failure") 6253 return 6254 } 6255 if !done { 6256 tsgr.Response.Response = future.Response() 6257 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture") 6258 return 6259 } 6260 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6261 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 6262 tsgr, err = client.MigrateMongoDBCollectionToAutoscaleResponder(tsgr.Response.Response) 6263 if err != nil { 6264 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") 6265 } 6266 } 6267 return 6268} 6269 6270// MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture an abstraction for monitoring and 6271// retrieving the results of a long-running operation. 6272type MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture struct { 6273 azure.FutureAPI 6274 // Result returns the result of the asynchronous operation. 6275 // If the operation has not completed it will return an error. 6276 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error) 6277} 6278 6279// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6280func (future *MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture) UnmarshalJSON(body []byte) error { 6281 var azFuture azure.Future 6282 if err := json.Unmarshal(body, &azFuture); err != nil { 6283 return err 6284 } 6285 future.FutureAPI = &azFuture 6286 future.Result = future.result 6287 return nil 6288} 6289 6290// result is the default implementation for MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture.Result. 6291func (future *MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 6292 var done bool 6293 done, err = future.DoneWithContext(context.Background(), client) 6294 if err != nil { 6295 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture", "Result", future.Response(), "Polling failure") 6296 return 6297 } 6298 if !done { 6299 tsgr.Response.Response = future.Response() 6300 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture") 6301 return 6302 } 6303 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6304 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 6305 tsgr, err = client.MigrateMongoDBCollectionToManualThroughputResponder(tsgr.Response.Response) 6306 if err != nil { 6307 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBCollectionToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 6308 } 6309 } 6310 return 6311} 6312 6313// MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture an abstraction for monitoring and retrieving the 6314// results of a long-running operation. 6315type MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture struct { 6316 azure.FutureAPI 6317 // Result returns the result of the asynchronous operation. 6318 // If the operation has not completed it will return an error. 6319 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error) 6320} 6321 6322// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6323func (future *MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture) UnmarshalJSON(body []byte) error { 6324 var azFuture azure.Future 6325 if err := json.Unmarshal(body, &azFuture); err != nil { 6326 return err 6327 } 6328 future.FutureAPI = &azFuture 6329 future.Result = future.result 6330 return nil 6331} 6332 6333// result is the default implementation for MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture.Result. 6334func (future *MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 6335 var done bool 6336 done, err = future.DoneWithContext(context.Background(), client) 6337 if err != nil { 6338 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture", "Result", future.Response(), "Polling failure") 6339 return 6340 } 6341 if !done { 6342 tsgr.Response.Response = future.Response() 6343 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture") 6344 return 6345 } 6346 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6347 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 6348 tsgr, err = client.MigrateMongoDBDatabaseToAutoscaleResponder(tsgr.Response.Response) 6349 if err != nil { 6350 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") 6351 } 6352 } 6353 return 6354} 6355 6356// MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture an abstraction for monitoring and 6357// retrieving the results of a long-running operation. 6358type MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture struct { 6359 azure.FutureAPI 6360 // Result returns the result of the asynchronous operation. 6361 // If the operation has not completed it will return an error. 6362 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error) 6363} 6364 6365// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6366func (future *MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture) UnmarshalJSON(body []byte) error { 6367 var azFuture azure.Future 6368 if err := json.Unmarshal(body, &azFuture); err != nil { 6369 return err 6370 } 6371 future.FutureAPI = &azFuture 6372 future.Result = future.result 6373 return nil 6374} 6375 6376// result is the default implementation for MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture.Result. 6377func (future *MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 6378 var done bool 6379 done, err = future.DoneWithContext(context.Background(), client) 6380 if err != nil { 6381 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture", "Result", future.Response(), "Polling failure") 6382 return 6383 } 6384 if !done { 6385 tsgr.Response.Response = future.Response() 6386 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture") 6387 return 6388 } 6389 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6390 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 6391 tsgr, err = client.MigrateMongoDBDatabaseToManualThroughputResponder(tsgr.Response.Response) 6392 if err != nil { 6393 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesMigrateMongoDBDatabaseToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 6394 } 6395 } 6396 return 6397} 6398 6399// MongoDBResourcesUpdateMongoDBCollectionThroughputFuture an abstraction for monitoring and retrieving the 6400// results of a long-running operation. 6401type MongoDBResourcesUpdateMongoDBCollectionThroughputFuture struct { 6402 azure.FutureAPI 6403 // Result returns the result of the asynchronous operation. 6404 // If the operation has not completed it will return an error. 6405 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error) 6406} 6407 6408// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6409func (future *MongoDBResourcesUpdateMongoDBCollectionThroughputFuture) UnmarshalJSON(body []byte) error { 6410 var azFuture azure.Future 6411 if err := json.Unmarshal(body, &azFuture); err != nil { 6412 return err 6413 } 6414 future.FutureAPI = &azFuture 6415 future.Result = future.result 6416 return nil 6417} 6418 6419// result is the default implementation for MongoDBResourcesUpdateMongoDBCollectionThroughputFuture.Result. 6420func (future *MongoDBResourcesUpdateMongoDBCollectionThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 6421 var done bool 6422 done, err = future.DoneWithContext(context.Background(), client) 6423 if err != nil { 6424 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture", "Result", future.Response(), "Polling failure") 6425 return 6426 } 6427 if !done { 6428 tsgr.Response.Response = future.Response() 6429 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture") 6430 return 6431 } 6432 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6433 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 6434 tsgr, err = client.UpdateMongoDBCollectionThroughputResponder(tsgr.Response.Response) 6435 if err != nil { 6436 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBCollectionThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 6437 } 6438 } 6439 return 6440} 6441 6442// MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture an abstraction for monitoring and retrieving the 6443// results of a long-running operation. 6444type MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture struct { 6445 azure.FutureAPI 6446 // Result returns the result of the asynchronous operation. 6447 // If the operation has not completed it will return an error. 6448 Result func(MongoDBResourcesClient) (ThroughputSettingsGetResults, error) 6449} 6450 6451// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6452func (future *MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture) UnmarshalJSON(body []byte) error { 6453 var azFuture azure.Future 6454 if err := json.Unmarshal(body, &azFuture); err != nil { 6455 return err 6456 } 6457 future.FutureAPI = &azFuture 6458 future.Result = future.result 6459 return nil 6460} 6461 6462// result is the default implementation for MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture.Result. 6463func (future *MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture) result(client MongoDBResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 6464 var done bool 6465 done, err = future.DoneWithContext(context.Background(), client) 6466 if err != nil { 6467 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture", "Result", future.Response(), "Polling failure") 6468 return 6469 } 6470 if !done { 6471 tsgr.Response.Response = future.Response() 6472 err = azure.NewAsyncOpIncompleteError("documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture") 6473 return 6474 } 6475 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6476 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 6477 tsgr, err = client.UpdateMongoDBDatabaseThroughputResponder(tsgr.Response.Response) 6478 if err != nil { 6479 err = autorest.NewErrorWithError(err, "documentdb.MongoDBResourcesUpdateMongoDBDatabaseThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 6480 } 6481 } 6482 return 6483} 6484 6485// MongoIndex cosmos DB MongoDB collection index key 6486type MongoIndex struct { 6487 // Key - Cosmos DB MongoDB collection index keys 6488 Key *MongoIndexKeys `json:"key,omitempty"` 6489 // Options - Cosmos DB MongoDB collection index key options 6490 Options *MongoIndexOptions `json:"options,omitempty"` 6491} 6492 6493// MongoIndexKeys cosmos DB MongoDB collection resource object 6494type MongoIndexKeys struct { 6495 // Keys - List of keys for each MongoDB collection in the Azure Cosmos DB service 6496 Keys *[]string `json:"keys,omitempty"` 6497} 6498 6499// MongoIndexOptions cosmos DB MongoDB collection index options 6500type MongoIndexOptions struct { 6501 // ExpireAfterSeconds - Expire after seconds 6502 ExpireAfterSeconds *int32 `json:"expireAfterSeconds,omitempty"` 6503 // Unique - Is unique or not 6504 Unique *bool `json:"unique,omitempty"` 6505} 6506 6507// NotebookWorkspace a notebook workspace resource 6508type NotebookWorkspace struct { 6509 autorest.Response `json:"-"` 6510 // NotebookWorkspaceProperties - Resource properties. 6511 *NotebookWorkspaceProperties `json:"properties,omitempty"` 6512 // ID - READ-ONLY; The unique resource identifier of the database account. 6513 ID *string `json:"id,omitempty"` 6514 // Name - READ-ONLY; The name of the database account. 6515 Name *string `json:"name,omitempty"` 6516 // Type - READ-ONLY; The type of Azure resource. 6517 Type *string `json:"type,omitempty"` 6518} 6519 6520// MarshalJSON is the custom marshaler for NotebookWorkspace. 6521func (nw NotebookWorkspace) MarshalJSON() ([]byte, error) { 6522 objectMap := make(map[string]interface{}) 6523 if nw.NotebookWorkspaceProperties != nil { 6524 objectMap["properties"] = nw.NotebookWorkspaceProperties 6525 } 6526 return json.Marshal(objectMap) 6527} 6528 6529// UnmarshalJSON is the custom unmarshaler for NotebookWorkspace struct. 6530func (nw *NotebookWorkspace) UnmarshalJSON(body []byte) error { 6531 var m map[string]*json.RawMessage 6532 err := json.Unmarshal(body, &m) 6533 if err != nil { 6534 return err 6535 } 6536 for k, v := range m { 6537 switch k { 6538 case "properties": 6539 if v != nil { 6540 var notebookWorkspaceProperties NotebookWorkspaceProperties 6541 err = json.Unmarshal(*v, ¬ebookWorkspaceProperties) 6542 if err != nil { 6543 return err 6544 } 6545 nw.NotebookWorkspaceProperties = ¬ebookWorkspaceProperties 6546 } 6547 case "id": 6548 if v != nil { 6549 var ID string 6550 err = json.Unmarshal(*v, &ID) 6551 if err != nil { 6552 return err 6553 } 6554 nw.ID = &ID 6555 } 6556 case "name": 6557 if v != nil { 6558 var name string 6559 err = json.Unmarshal(*v, &name) 6560 if err != nil { 6561 return err 6562 } 6563 nw.Name = &name 6564 } 6565 case "type": 6566 if v != nil { 6567 var typeVar string 6568 err = json.Unmarshal(*v, &typeVar) 6569 if err != nil { 6570 return err 6571 } 6572 nw.Type = &typeVar 6573 } 6574 } 6575 } 6576 6577 return nil 6578} 6579 6580// NotebookWorkspaceConnectionInfoResult the connection info for the given notebook workspace 6581type NotebookWorkspaceConnectionInfoResult struct { 6582 autorest.Response `json:"-"` 6583 // AuthToken - READ-ONLY; Specifies auth token used for connecting to Notebook server (uses token-based auth). 6584 AuthToken *string `json:"authToken,omitempty"` 6585 // NotebookServerEndpoint - READ-ONLY; Specifies the endpoint of Notebook server. 6586 NotebookServerEndpoint *string `json:"notebookServerEndpoint,omitempty"` 6587} 6588 6589// MarshalJSON is the custom marshaler for NotebookWorkspaceConnectionInfoResult. 6590func (nwcir NotebookWorkspaceConnectionInfoResult) MarshalJSON() ([]byte, error) { 6591 objectMap := make(map[string]interface{}) 6592 return json.Marshal(objectMap) 6593} 6594 6595// NotebookWorkspaceCreateUpdateParameters parameters to create a notebook workspace resource 6596type NotebookWorkspaceCreateUpdateParameters struct { 6597 // ID - READ-ONLY; The unique resource identifier of the database account. 6598 ID *string `json:"id,omitempty"` 6599 // Name - READ-ONLY; The name of the database account. 6600 Name *string `json:"name,omitempty"` 6601 // Type - READ-ONLY; The type of Azure resource. 6602 Type *string `json:"type,omitempty"` 6603} 6604 6605// MarshalJSON is the custom marshaler for NotebookWorkspaceCreateUpdateParameters. 6606func (nwcup NotebookWorkspaceCreateUpdateParameters) MarshalJSON() ([]byte, error) { 6607 objectMap := make(map[string]interface{}) 6608 return json.Marshal(objectMap) 6609} 6610 6611// NotebookWorkspaceListResult a list of notebook workspace resources 6612type NotebookWorkspaceListResult struct { 6613 autorest.Response `json:"-"` 6614 // Value - Array of notebook workspace resources 6615 Value *[]NotebookWorkspace `json:"value,omitempty"` 6616} 6617 6618// NotebookWorkspaceProperties properties of a notebook workspace resource. 6619type NotebookWorkspaceProperties struct { 6620 // NotebookServerEndpoint - READ-ONLY; Specifies the endpoint of Notebook server. 6621 NotebookServerEndpoint *string `json:"notebookServerEndpoint,omitempty"` 6622 // Status - READ-ONLY; Status of the notebook workspace. Possible values are: Creating, Online, Deleting, Failed, Updating. 6623 Status *string `json:"status,omitempty"` 6624} 6625 6626// MarshalJSON is the custom marshaler for NotebookWorkspaceProperties. 6627func (nwp NotebookWorkspaceProperties) MarshalJSON() ([]byte, error) { 6628 objectMap := make(map[string]interface{}) 6629 return json.Marshal(objectMap) 6630} 6631 6632// NotebookWorkspacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 6633// long-running operation. 6634type NotebookWorkspacesCreateOrUpdateFuture struct { 6635 azure.FutureAPI 6636 // Result returns the result of the asynchronous operation. 6637 // If the operation has not completed it will return an error. 6638 Result func(NotebookWorkspacesClient) (NotebookWorkspace, error) 6639} 6640 6641// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6642func (future *NotebookWorkspacesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 6643 var azFuture azure.Future 6644 if err := json.Unmarshal(body, &azFuture); err != nil { 6645 return err 6646 } 6647 future.FutureAPI = &azFuture 6648 future.Result = future.result 6649 return nil 6650} 6651 6652// result is the default implementation for NotebookWorkspacesCreateOrUpdateFuture.Result. 6653func (future *NotebookWorkspacesCreateOrUpdateFuture) result(client NotebookWorkspacesClient) (nw NotebookWorkspace, err error) { 6654 var done bool 6655 done, err = future.DoneWithContext(context.Background(), client) 6656 if err != nil { 6657 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 6658 return 6659 } 6660 if !done { 6661 nw.Response.Response = future.Response() 6662 err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesCreateOrUpdateFuture") 6663 return 6664 } 6665 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6666 if nw.Response.Response, err = future.GetResult(sender); err == nil && nw.Response.Response.StatusCode != http.StatusNoContent { 6667 nw, err = client.CreateOrUpdateResponder(nw.Response.Response) 6668 if err != nil { 6669 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesCreateOrUpdateFuture", "Result", nw.Response.Response, "Failure responding to request") 6670 } 6671 } 6672 return 6673} 6674 6675// NotebookWorkspacesDeleteFuture an abstraction for monitoring and retrieving the results of a 6676// long-running operation. 6677type NotebookWorkspacesDeleteFuture struct { 6678 azure.FutureAPI 6679 // Result returns the result of the asynchronous operation. 6680 // If the operation has not completed it will return an error. 6681 Result func(NotebookWorkspacesClient) (autorest.Response, error) 6682} 6683 6684// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6685func (future *NotebookWorkspacesDeleteFuture) UnmarshalJSON(body []byte) error { 6686 var azFuture azure.Future 6687 if err := json.Unmarshal(body, &azFuture); err != nil { 6688 return err 6689 } 6690 future.FutureAPI = &azFuture 6691 future.Result = future.result 6692 return nil 6693} 6694 6695// result is the default implementation for NotebookWorkspacesDeleteFuture.Result. 6696func (future *NotebookWorkspacesDeleteFuture) result(client NotebookWorkspacesClient) (ar autorest.Response, err error) { 6697 var done bool 6698 done, err = future.DoneWithContext(context.Background(), client) 6699 if err != nil { 6700 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesDeleteFuture", "Result", future.Response(), "Polling failure") 6701 return 6702 } 6703 if !done { 6704 ar.Response = future.Response() 6705 err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesDeleteFuture") 6706 return 6707 } 6708 ar.Response = future.Response() 6709 return 6710} 6711 6712// NotebookWorkspacesRegenerateAuthTokenFuture an abstraction for monitoring and retrieving the results of 6713// a long-running operation. 6714type NotebookWorkspacesRegenerateAuthTokenFuture struct { 6715 azure.FutureAPI 6716 // Result returns the result of the asynchronous operation. 6717 // If the operation has not completed it will return an error. 6718 Result func(NotebookWorkspacesClient) (autorest.Response, error) 6719} 6720 6721// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6722func (future *NotebookWorkspacesRegenerateAuthTokenFuture) UnmarshalJSON(body []byte) error { 6723 var azFuture azure.Future 6724 if err := json.Unmarshal(body, &azFuture); err != nil { 6725 return err 6726 } 6727 future.FutureAPI = &azFuture 6728 future.Result = future.result 6729 return nil 6730} 6731 6732// result is the default implementation for NotebookWorkspacesRegenerateAuthTokenFuture.Result. 6733func (future *NotebookWorkspacesRegenerateAuthTokenFuture) result(client NotebookWorkspacesClient) (ar autorest.Response, err error) { 6734 var done bool 6735 done, err = future.DoneWithContext(context.Background(), client) 6736 if err != nil { 6737 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesRegenerateAuthTokenFuture", "Result", future.Response(), "Polling failure") 6738 return 6739 } 6740 if !done { 6741 ar.Response = future.Response() 6742 err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesRegenerateAuthTokenFuture") 6743 return 6744 } 6745 ar.Response = future.Response() 6746 return 6747} 6748 6749// NotebookWorkspacesStartFuture an abstraction for monitoring and retrieving the results of a long-running 6750// operation. 6751type NotebookWorkspacesStartFuture struct { 6752 azure.FutureAPI 6753 // Result returns the result of the asynchronous operation. 6754 // If the operation has not completed it will return an error. 6755 Result func(NotebookWorkspacesClient) (autorest.Response, error) 6756} 6757 6758// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6759func (future *NotebookWorkspacesStartFuture) UnmarshalJSON(body []byte) error { 6760 var azFuture azure.Future 6761 if err := json.Unmarshal(body, &azFuture); err != nil { 6762 return err 6763 } 6764 future.FutureAPI = &azFuture 6765 future.Result = future.result 6766 return nil 6767} 6768 6769// result is the default implementation for NotebookWorkspacesStartFuture.Result. 6770func (future *NotebookWorkspacesStartFuture) result(client NotebookWorkspacesClient) (ar autorest.Response, err error) { 6771 var done bool 6772 done, err = future.DoneWithContext(context.Background(), client) 6773 if err != nil { 6774 err = autorest.NewErrorWithError(err, "documentdb.NotebookWorkspacesStartFuture", "Result", future.Response(), "Polling failure") 6775 return 6776 } 6777 if !done { 6778 ar.Response = future.Response() 6779 err = azure.NewAsyncOpIncompleteError("documentdb.NotebookWorkspacesStartFuture") 6780 return 6781 } 6782 ar.Response = future.Response() 6783 return 6784} 6785 6786// Operation REST API operation 6787type Operation struct { 6788 // Name - Operation name: {provider}/{resource}/{operation} 6789 Name *string `json:"name,omitempty"` 6790 // Display - The object that represents the operation. 6791 Display *OperationDisplay `json:"display,omitempty"` 6792} 6793 6794// OperationDisplay the object that represents the operation. 6795type OperationDisplay struct { 6796 // Provider - Service provider: Microsoft.ResourceProvider 6797 Provider *string `json:"Provider,omitempty"` 6798 // Resource - Resource on which the operation is performed: Profile, endpoint, etc. 6799 Resource *string `json:"Resource,omitempty"` 6800 // Operation - Operation type: Read, write, delete, etc. 6801 Operation *string `json:"Operation,omitempty"` 6802 // Description - Description of operation 6803 Description *string `json:"Description,omitempty"` 6804} 6805 6806// OperationListResult result of the request to list Resource Provider operations. It contains a list of 6807// operations and a URL link to get the next set of results. 6808type OperationListResult struct { 6809 autorest.Response `json:"-"` 6810 // Value - List of operations supported by the Resource Provider. 6811 Value *[]Operation `json:"value,omitempty"` 6812 // NextLink - URL to get the next set of operation list results if there are any. 6813 NextLink *string `json:"nextLink,omitempty"` 6814} 6815 6816// OperationListResultIterator provides access to a complete listing of Operation values. 6817type OperationListResultIterator struct { 6818 i int 6819 page OperationListResultPage 6820} 6821 6822// NextWithContext advances to the next value. If there was an error making 6823// the request the iterator does not advance and the error is returned. 6824func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { 6825 if tracing.IsEnabled() { 6826 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") 6827 defer func() { 6828 sc := -1 6829 if iter.Response().Response.Response != nil { 6830 sc = iter.Response().Response.Response.StatusCode 6831 } 6832 tracing.EndSpan(ctx, sc, err) 6833 }() 6834 } 6835 iter.i++ 6836 if iter.i < len(iter.page.Values()) { 6837 return nil 6838 } 6839 err = iter.page.NextWithContext(ctx) 6840 if err != nil { 6841 iter.i-- 6842 return err 6843 } 6844 iter.i = 0 6845 return nil 6846} 6847 6848// Next advances to the next value. If there was an error making 6849// the request the iterator does not advance and the error is returned. 6850// Deprecated: Use NextWithContext() instead. 6851func (iter *OperationListResultIterator) Next() error { 6852 return iter.NextWithContext(context.Background()) 6853} 6854 6855// NotDone returns true if the enumeration should be started or is not yet complete. 6856func (iter OperationListResultIterator) NotDone() bool { 6857 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6858} 6859 6860// Response returns the raw server response from the last page request. 6861func (iter OperationListResultIterator) Response() OperationListResult { 6862 return iter.page.Response() 6863} 6864 6865// Value returns the current value or a zero-initialized value if the 6866// iterator has advanced beyond the end of the collection. 6867func (iter OperationListResultIterator) Value() Operation { 6868 if !iter.page.NotDone() { 6869 return Operation{} 6870 } 6871 return iter.page.Values()[iter.i] 6872} 6873 6874// Creates a new instance of the OperationListResultIterator type. 6875func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { 6876 return OperationListResultIterator{page: page} 6877} 6878 6879// IsEmpty returns true if the ListResult contains no values. 6880func (olr OperationListResult) IsEmpty() bool { 6881 return olr.Value == nil || len(*olr.Value) == 0 6882} 6883 6884// hasNextLink returns true if the NextLink is not empty. 6885func (olr OperationListResult) hasNextLink() bool { 6886 return olr.NextLink != nil && len(*olr.NextLink) != 0 6887} 6888 6889// operationListResultPreparer prepares a request to retrieve the next set of results. 6890// It returns nil if no more results exist. 6891func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { 6892 if !olr.hasNextLink() { 6893 return nil, nil 6894 } 6895 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6896 autorest.AsJSON(), 6897 autorest.AsGet(), 6898 autorest.WithBaseURL(to.String(olr.NextLink))) 6899} 6900 6901// OperationListResultPage contains a page of Operation values. 6902type OperationListResultPage struct { 6903 fn func(context.Context, OperationListResult) (OperationListResult, error) 6904 olr OperationListResult 6905} 6906 6907// NextWithContext advances to the next page of values. If there was an error making 6908// the request the page does not advance and the error is returned. 6909func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { 6910 if tracing.IsEnabled() { 6911 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") 6912 defer func() { 6913 sc := -1 6914 if page.Response().Response.Response != nil { 6915 sc = page.Response().Response.Response.StatusCode 6916 } 6917 tracing.EndSpan(ctx, sc, err) 6918 }() 6919 } 6920 for { 6921 next, err := page.fn(ctx, page.olr) 6922 if err != nil { 6923 return err 6924 } 6925 page.olr = next 6926 if !next.hasNextLink() || !next.IsEmpty() { 6927 break 6928 } 6929 } 6930 return nil 6931} 6932 6933// Next advances to the next page of values. If there was an error making 6934// the request the page does not advance and the error is returned. 6935// Deprecated: Use NextWithContext() instead. 6936func (page *OperationListResultPage) Next() error { 6937 return page.NextWithContext(context.Background()) 6938} 6939 6940// NotDone returns true if the page enumeration should be started or is not yet complete. 6941func (page OperationListResultPage) NotDone() bool { 6942 return !page.olr.IsEmpty() 6943} 6944 6945// Response returns the raw server response from the last page request. 6946func (page OperationListResultPage) Response() OperationListResult { 6947 return page.olr 6948} 6949 6950// Values returns the slice of values for the current page or nil if there are no values. 6951func (page OperationListResultPage) Values() []Operation { 6952 if page.olr.IsEmpty() { 6953 return nil 6954 } 6955 return *page.olr.Value 6956} 6957 6958// Creates a new instance of the OperationListResultPage type. 6959func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { 6960 return OperationListResultPage{ 6961 fn: getNextPage, 6962 olr: cur, 6963 } 6964} 6965 6966// OptionsResource cosmos DB options resource object 6967type OptionsResource struct { 6968 // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. 6969 Throughput *int32 `json:"throughput,omitempty"` 6970 // AutoscaleSettings - Specifies the Autoscale settings. 6971 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` 6972} 6973 6974// PartitionMetric the metric values for a single partition. 6975type PartitionMetric struct { 6976 // PartitionID - READ-ONLY; The partition id (GUID identifier) of the metric values. 6977 PartitionID *string `json:"partitionId,omitempty"` 6978 // PartitionKeyRangeID - READ-ONLY; The partition key range id (integer identifier) of the metric values. 6979 PartitionKeyRangeID *string `json:"partitionKeyRangeId,omitempty"` 6980 // StartTime - READ-ONLY; The start time for the metric (ISO-8601 format). 6981 StartTime *date.Time `json:"startTime,omitempty"` 6982 // EndTime - READ-ONLY; The end time for the metric (ISO-8601 format). 6983 EndTime *date.Time `json:"endTime,omitempty"` 6984 // TimeGrain - READ-ONLY; The time grain to be used to summarize the metric values. 6985 TimeGrain *string `json:"timeGrain,omitempty"` 6986 // Unit - The unit of the metric. Possible values include: 'UnitTypeCount', 'UnitTypeBytes', 'UnitTypeSeconds', 'UnitTypePercent', 'UnitTypeCountPerSecond', 'UnitTypeBytesPerSecond', 'UnitTypeMilliseconds' 6987 Unit UnitType `json:"unit,omitempty"` 6988 // Name - READ-ONLY; The name information for the metric. 6989 Name *MetricName `json:"name,omitempty"` 6990 // MetricValues - READ-ONLY; The metric values for the specified time window and timestep. 6991 MetricValues *[]MetricValue `json:"metricValues,omitempty"` 6992} 6993 6994// MarshalJSON is the custom marshaler for PartitionMetric. 6995func (pm PartitionMetric) MarshalJSON() ([]byte, error) { 6996 objectMap := make(map[string]interface{}) 6997 if pm.Unit != "" { 6998 objectMap["unit"] = pm.Unit 6999 } 7000 return json.Marshal(objectMap) 7001} 7002 7003// PartitionMetricListResult the response to a list partition metrics request. 7004type PartitionMetricListResult struct { 7005 autorest.Response `json:"-"` 7006 // Value - READ-ONLY; The list of partition-level metrics for the account. 7007 Value *[]PartitionMetric `json:"value,omitempty"` 7008} 7009 7010// MarshalJSON is the custom marshaler for PartitionMetricListResult. 7011func (pmlr PartitionMetricListResult) MarshalJSON() ([]byte, error) { 7012 objectMap := make(map[string]interface{}) 7013 return json.Marshal(objectMap) 7014} 7015 7016// PartitionUsage the partition level usage data for a usage request. 7017type PartitionUsage struct { 7018 // PartitionID - READ-ONLY; The partition id (GUID identifier) of the usages. 7019 PartitionID *string `json:"partitionId,omitempty"` 7020 // PartitionKeyRangeID - READ-ONLY; The partition key range id (integer identifier) of the usages. 7021 PartitionKeyRangeID *string `json:"partitionKeyRangeId,omitempty"` 7022 // Unit - The unit of the metric. Possible values include: 'UnitTypeCount', 'UnitTypeBytes', 'UnitTypeSeconds', 'UnitTypePercent', 'UnitTypeCountPerSecond', 'UnitTypeBytesPerSecond', 'UnitTypeMilliseconds' 7023 Unit UnitType `json:"unit,omitempty"` 7024 // Name - READ-ONLY; The name information for the metric. 7025 Name *MetricName `json:"name,omitempty"` 7026 // QuotaPeriod - READ-ONLY; The quota period used to summarize the usage values. 7027 QuotaPeriod *string `json:"quotaPeriod,omitempty"` 7028 // Limit - READ-ONLY; Maximum value for this metric 7029 Limit *int64 `json:"limit,omitempty"` 7030 // CurrentValue - READ-ONLY; Current value for this metric 7031 CurrentValue *int64 `json:"currentValue,omitempty"` 7032} 7033 7034// MarshalJSON is the custom marshaler for PartitionUsage. 7035func (pu PartitionUsage) MarshalJSON() ([]byte, error) { 7036 objectMap := make(map[string]interface{}) 7037 if pu.Unit != "" { 7038 objectMap["unit"] = pu.Unit 7039 } 7040 return json.Marshal(objectMap) 7041} 7042 7043// PartitionUsagesResult the response to a list partition level usage request. 7044type PartitionUsagesResult struct { 7045 autorest.Response `json:"-"` 7046 // Value - READ-ONLY; The list of partition-level usages for the database. A usage is a point in time metric 7047 Value *[]PartitionUsage `json:"value,omitempty"` 7048} 7049 7050// MarshalJSON is the custom marshaler for PartitionUsagesResult. 7051func (pur PartitionUsagesResult) MarshalJSON() ([]byte, error) { 7052 objectMap := make(map[string]interface{}) 7053 return json.Marshal(objectMap) 7054} 7055 7056// PercentileMetric percentile Metric data 7057type PercentileMetric struct { 7058 // StartTime - READ-ONLY; The start time for the metric (ISO-8601 format). 7059 StartTime *date.Time `json:"startTime,omitempty"` 7060 // EndTime - READ-ONLY; The end time for the metric (ISO-8601 format). 7061 EndTime *date.Time `json:"endTime,omitempty"` 7062 // TimeGrain - READ-ONLY; The time grain to be used to summarize the metric values. 7063 TimeGrain *string `json:"timeGrain,omitempty"` 7064 // Unit - The unit of the metric. Possible values include: 'UnitTypeCount', 'UnitTypeBytes', 'UnitTypeSeconds', 'UnitTypePercent', 'UnitTypeCountPerSecond', 'UnitTypeBytesPerSecond', 'UnitTypeMilliseconds' 7065 Unit UnitType `json:"unit,omitempty"` 7066 // Name - READ-ONLY; The name information for the metric. 7067 Name *MetricName `json:"name,omitempty"` 7068 // MetricValues - READ-ONLY; The percentile metric values for the specified time window and timestep. 7069 MetricValues *[]PercentileMetricValue `json:"metricValues,omitempty"` 7070} 7071 7072// MarshalJSON is the custom marshaler for PercentileMetric. 7073func (pm PercentileMetric) MarshalJSON() ([]byte, error) { 7074 objectMap := make(map[string]interface{}) 7075 if pm.Unit != "" { 7076 objectMap["unit"] = pm.Unit 7077 } 7078 return json.Marshal(objectMap) 7079} 7080 7081// PercentileMetricListResult the response to a list percentile metrics request. 7082type PercentileMetricListResult struct { 7083 autorest.Response `json:"-"` 7084 // Value - READ-ONLY; The list of percentile metrics for the account. 7085 Value *[]PercentileMetric `json:"value,omitempty"` 7086} 7087 7088// MarshalJSON is the custom marshaler for PercentileMetricListResult. 7089func (pmlr PercentileMetricListResult) MarshalJSON() ([]byte, error) { 7090 objectMap := make(map[string]interface{}) 7091 return json.Marshal(objectMap) 7092} 7093 7094// PercentileMetricValue represents percentile metrics values. 7095type PercentileMetricValue struct { 7096 // P10 - READ-ONLY; The 10th percentile value for the metric. 7097 P10 *float64 `json:"P10,omitempty"` 7098 // P25 - READ-ONLY; The 25th percentile value for the metric. 7099 P25 *float64 `json:"P25,omitempty"` 7100 // P50 - READ-ONLY; The 50th percentile value for the metric. 7101 P50 *float64 `json:"P50,omitempty"` 7102 // P75 - READ-ONLY; The 75th percentile value for the metric. 7103 P75 *float64 `json:"P75,omitempty"` 7104 // P90 - READ-ONLY; The 90th percentile value for the metric. 7105 P90 *float64 `json:"P90,omitempty"` 7106 // P95 - READ-ONLY; The 95th percentile value for the metric. 7107 P95 *float64 `json:"P95,omitempty"` 7108 // P99 - READ-ONLY; The 99th percentile value for the metric. 7109 P99 *float64 `json:"P99,omitempty"` 7110 // Count - READ-ONLY; The number of values for the metric. 7111 Count *float64 `json:"_count,omitempty"` 7112 // Average - READ-ONLY; The average value of the metric. 7113 Average *float64 `json:"average,omitempty"` 7114 // Maximum - READ-ONLY; The max value of the metric. 7115 Maximum *float64 `json:"maximum,omitempty"` 7116 // Minimum - READ-ONLY; The min value of the metric. 7117 Minimum *float64 `json:"minimum,omitempty"` 7118 // Timestamp - READ-ONLY; The metric timestamp (ISO-8601 format). 7119 Timestamp *date.Time `json:"timestamp,omitempty"` 7120 // Total - READ-ONLY; The total value of the metric. 7121 Total *float64 `json:"total,omitempty"` 7122} 7123 7124// MarshalJSON is the custom marshaler for PercentileMetricValue. 7125func (pmv PercentileMetricValue) MarshalJSON() ([]byte, error) { 7126 objectMap := make(map[string]interface{}) 7127 return json.Marshal(objectMap) 7128} 7129 7130// PeriodicModeBackupPolicy the object representing periodic mode backup policy. 7131type PeriodicModeBackupPolicy struct { 7132 // PeriodicModeProperties - Configuration values for periodic mode backup 7133 PeriodicModeProperties *PeriodicModeProperties `json:"periodicModeProperties,omitempty"` 7134 // Type - Possible values include: 'TypeBackupPolicy', 'TypePeriodic', 'TypeContinuous' 7135 Type Type `json:"type,omitempty"` 7136} 7137 7138// MarshalJSON is the custom marshaler for PeriodicModeBackupPolicy. 7139func (pmbp PeriodicModeBackupPolicy) MarshalJSON() ([]byte, error) { 7140 pmbp.Type = TypePeriodic 7141 objectMap := make(map[string]interface{}) 7142 if pmbp.PeriodicModeProperties != nil { 7143 objectMap["periodicModeProperties"] = pmbp.PeriodicModeProperties 7144 } 7145 if pmbp.Type != "" { 7146 objectMap["type"] = pmbp.Type 7147 } 7148 return json.Marshal(objectMap) 7149} 7150 7151// AsPeriodicModeBackupPolicy is the BasicBackupPolicy implementation for PeriodicModeBackupPolicy. 7152func (pmbp PeriodicModeBackupPolicy) AsPeriodicModeBackupPolicy() (*PeriodicModeBackupPolicy, bool) { 7153 return &pmbp, true 7154} 7155 7156// AsContinuousModeBackupPolicy is the BasicBackupPolicy implementation for PeriodicModeBackupPolicy. 7157func (pmbp PeriodicModeBackupPolicy) AsContinuousModeBackupPolicy() (*ContinuousModeBackupPolicy, bool) { 7158 return nil, false 7159} 7160 7161// AsBackupPolicy is the BasicBackupPolicy implementation for PeriodicModeBackupPolicy. 7162func (pmbp PeriodicModeBackupPolicy) AsBackupPolicy() (*BackupPolicy, bool) { 7163 return nil, false 7164} 7165 7166// AsBasicBackupPolicy is the BasicBackupPolicy implementation for PeriodicModeBackupPolicy. 7167func (pmbp PeriodicModeBackupPolicy) AsBasicBackupPolicy() (BasicBackupPolicy, bool) { 7168 return &pmbp, true 7169} 7170 7171// PeriodicModeProperties configuration values for periodic mode backup 7172type PeriodicModeProperties struct { 7173 // BackupIntervalInMinutes - An integer representing the interval in minutes between two backups 7174 BackupIntervalInMinutes *int32 `json:"backupIntervalInMinutes,omitempty"` 7175 // BackupRetentionIntervalInHours - An integer representing the time (in hours) that each backup is retained 7176 BackupRetentionIntervalInHours *int32 `json:"backupRetentionIntervalInHours,omitempty"` 7177 // BackupStorageRedundancy - Enum to indicate type of backup residency. Possible values include: 'BackupStorageRedundancyGeo', 'BackupStorageRedundancyLocal', 'BackupStorageRedundancyZone' 7178 BackupStorageRedundancy BackupStorageRedundancy `json:"backupStorageRedundancy,omitempty"` 7179} 7180 7181// Permission the set of data plane operations permitted through this Role Definition. 7182type Permission struct { 7183 // DataActions - An array of data actions that are allowed. 7184 DataActions *[]string `json:"dataActions,omitempty"` 7185 // NotDataActions - An array of data actions that are denied. 7186 NotDataActions *[]string `json:"notDataActions,omitempty"` 7187} 7188 7189// PrivateEndpointConnection a private endpoint connection 7190type PrivateEndpointConnection struct { 7191 autorest.Response `json:"-"` 7192 // PrivateEndpointConnectionProperties - Resource properties. 7193 *PrivateEndpointConnectionProperties `json:"properties,omitempty"` 7194 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 7195 ID *string `json:"id,omitempty"` 7196 // Name - READ-ONLY; The name of the resource 7197 Name *string `json:"name,omitempty"` 7198 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 7199 Type *string `json:"type,omitempty"` 7200} 7201 7202// MarshalJSON is the custom marshaler for PrivateEndpointConnection. 7203func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { 7204 objectMap := make(map[string]interface{}) 7205 if pec.PrivateEndpointConnectionProperties != nil { 7206 objectMap["properties"] = pec.PrivateEndpointConnectionProperties 7207 } 7208 return json.Marshal(objectMap) 7209} 7210 7211// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. 7212func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { 7213 var m map[string]*json.RawMessage 7214 err := json.Unmarshal(body, &m) 7215 if err != nil { 7216 return err 7217 } 7218 for k, v := range m { 7219 switch k { 7220 case "properties": 7221 if v != nil { 7222 var privateEndpointConnectionProperties PrivateEndpointConnectionProperties 7223 err = json.Unmarshal(*v, &privateEndpointConnectionProperties) 7224 if err != nil { 7225 return err 7226 } 7227 pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties 7228 } 7229 case "id": 7230 if v != nil { 7231 var ID string 7232 err = json.Unmarshal(*v, &ID) 7233 if err != nil { 7234 return err 7235 } 7236 pec.ID = &ID 7237 } 7238 case "name": 7239 if v != nil { 7240 var name string 7241 err = json.Unmarshal(*v, &name) 7242 if err != nil { 7243 return err 7244 } 7245 pec.Name = &name 7246 } 7247 case "type": 7248 if v != nil { 7249 var typeVar string 7250 err = json.Unmarshal(*v, &typeVar) 7251 if err != nil { 7252 return err 7253 } 7254 pec.Type = &typeVar 7255 } 7256 } 7257 } 7258 7259 return nil 7260} 7261 7262// PrivateEndpointConnectionListResult a list of private endpoint connections 7263type PrivateEndpointConnectionListResult struct { 7264 autorest.Response `json:"-"` 7265 // Value - Array of private endpoint connections 7266 Value *[]PrivateEndpointConnection `json:"value,omitempty"` 7267} 7268 7269// PrivateEndpointConnectionProperties properties of a private endpoint connection. 7270type PrivateEndpointConnectionProperties struct { 7271 // PrivateEndpoint - Private endpoint which the connection belongs to. 7272 PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"` 7273 // PrivateLinkServiceConnectionState - Connection State of the Private Endpoint Connection. 7274 PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"` 7275 // GroupID - Group id of the private endpoint. 7276 GroupID *string `json:"groupId,omitempty"` 7277 // ProvisioningState - Provisioning state of the private endpoint. 7278 ProvisioningState *string `json:"provisioningState,omitempty"` 7279} 7280 7281// PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 7282// of a long-running operation. 7283type PrivateEndpointConnectionsCreateOrUpdateFuture struct { 7284 azure.FutureAPI 7285 // Result returns the result of the asynchronous operation. 7286 // If the operation has not completed it will return an error. 7287 Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error) 7288} 7289 7290// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7291func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 7292 var azFuture azure.Future 7293 if err := json.Unmarshal(body, &azFuture); err != nil { 7294 return err 7295 } 7296 future.FutureAPI = &azFuture 7297 future.Result = future.result 7298 return nil 7299} 7300 7301// result is the default implementation for PrivateEndpointConnectionsCreateOrUpdateFuture.Result. 7302func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) { 7303 var done bool 7304 done, err = future.DoneWithContext(context.Background(), client) 7305 if err != nil { 7306 err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 7307 return 7308 } 7309 if !done { 7310 pec.Response.Response = future.Response() 7311 err = azure.NewAsyncOpIncompleteError("documentdb.PrivateEndpointConnectionsCreateOrUpdateFuture") 7312 return 7313 } 7314 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7315 if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { 7316 pec, err = client.CreateOrUpdateResponder(pec.Response.Response) 7317 if err != nil { 7318 err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pec.Response.Response, "Failure responding to request") 7319 } 7320 } 7321 return 7322} 7323 7324// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a 7325// long-running operation. 7326type PrivateEndpointConnectionsDeleteFuture struct { 7327 azure.FutureAPI 7328 // Result returns the result of the asynchronous operation. 7329 // If the operation has not completed it will return an error. 7330 Result func(PrivateEndpointConnectionsClient) (autorest.Response, error) 7331} 7332 7333// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7334func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { 7335 var azFuture azure.Future 7336 if err := json.Unmarshal(body, &azFuture); err != nil { 7337 return err 7338 } 7339 future.FutureAPI = &azFuture 7340 future.Result = future.result 7341 return nil 7342} 7343 7344// result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result. 7345func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) { 7346 var done bool 7347 done, err = future.DoneWithContext(context.Background(), client) 7348 if err != nil { 7349 err = autorest.NewErrorWithError(err, "documentdb.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") 7350 return 7351 } 7352 if !done { 7353 ar.Response = future.Response() 7354 err = azure.NewAsyncOpIncompleteError("documentdb.PrivateEndpointConnectionsDeleteFuture") 7355 return 7356 } 7357 ar.Response = future.Response() 7358 return 7359} 7360 7361// PrivateEndpointProperty private endpoint which the connection belongs to. 7362type PrivateEndpointProperty struct { 7363 // ID - Resource id of the private endpoint. 7364 ID *string `json:"id,omitempty"` 7365} 7366 7367// PrivateLinkResource a private link resource 7368type PrivateLinkResource struct { 7369 autorest.Response `json:"-"` 7370 // PrivateLinkResourceProperties - Resource properties. 7371 *PrivateLinkResourceProperties `json:"properties,omitempty"` 7372 // ID - READ-ONLY; The unique resource identifier of the database account. 7373 ID *string `json:"id,omitempty"` 7374 // Name - READ-ONLY; The name of the database account. 7375 Name *string `json:"name,omitempty"` 7376 // Type - READ-ONLY; The type of Azure resource. 7377 Type *string `json:"type,omitempty"` 7378} 7379 7380// MarshalJSON is the custom marshaler for PrivateLinkResource. 7381func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { 7382 objectMap := make(map[string]interface{}) 7383 if plr.PrivateLinkResourceProperties != nil { 7384 objectMap["properties"] = plr.PrivateLinkResourceProperties 7385 } 7386 return json.Marshal(objectMap) 7387} 7388 7389// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. 7390func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error { 7391 var m map[string]*json.RawMessage 7392 err := json.Unmarshal(body, &m) 7393 if err != nil { 7394 return err 7395 } 7396 for k, v := range m { 7397 switch k { 7398 case "properties": 7399 if v != nil { 7400 var privateLinkResourceProperties PrivateLinkResourceProperties 7401 err = json.Unmarshal(*v, &privateLinkResourceProperties) 7402 if err != nil { 7403 return err 7404 } 7405 plr.PrivateLinkResourceProperties = &privateLinkResourceProperties 7406 } 7407 case "id": 7408 if v != nil { 7409 var ID string 7410 err = json.Unmarshal(*v, &ID) 7411 if err != nil { 7412 return err 7413 } 7414 plr.ID = &ID 7415 } 7416 case "name": 7417 if v != nil { 7418 var name string 7419 err = json.Unmarshal(*v, &name) 7420 if err != nil { 7421 return err 7422 } 7423 plr.Name = &name 7424 } 7425 case "type": 7426 if v != nil { 7427 var typeVar string 7428 err = json.Unmarshal(*v, &typeVar) 7429 if err != nil { 7430 return err 7431 } 7432 plr.Type = &typeVar 7433 } 7434 } 7435 } 7436 7437 return nil 7438} 7439 7440// PrivateLinkResourceListResult a list of private link resources 7441type PrivateLinkResourceListResult struct { 7442 autorest.Response `json:"-"` 7443 // Value - Array of private link resources 7444 Value *[]PrivateLinkResource `json:"value,omitempty"` 7445} 7446 7447// PrivateLinkResourceProperties properties of a private link resource. 7448type PrivateLinkResourceProperties struct { 7449 // GroupID - READ-ONLY; The private link resource group id. 7450 GroupID *string `json:"groupId,omitempty"` 7451 // RequiredMembers - READ-ONLY; The private link resource required member names. 7452 RequiredMembers *[]string `json:"requiredMembers,omitempty"` 7453 // RequiredZoneNames - READ-ONLY; The private link resource required zone names. 7454 RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` 7455} 7456 7457// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. 7458func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { 7459 objectMap := make(map[string]interface{}) 7460 return json.Marshal(objectMap) 7461} 7462 7463// PrivateLinkServiceConnectionStateProperty connection State of the Private Endpoint Connection. 7464type PrivateLinkServiceConnectionStateProperty struct { 7465 // Status - The private link service connection status. 7466 Status *string `json:"status,omitempty"` 7467 // Description - The private link service connection description. 7468 Description *string `json:"description,omitempty"` 7469 // ActionsRequired - READ-ONLY; Any action that is required beyond basic workflow (approve/ reject/ disconnect) 7470 ActionsRequired *string `json:"actionsRequired,omitempty"` 7471} 7472 7473// MarshalJSON is the custom marshaler for PrivateLinkServiceConnectionStateProperty. 7474func (plscsp PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { 7475 objectMap := make(map[string]interface{}) 7476 if plscsp.Status != nil { 7477 objectMap["status"] = plscsp.Status 7478 } 7479 if plscsp.Description != nil { 7480 objectMap["description"] = plscsp.Description 7481 } 7482 return json.Marshal(objectMap) 7483} 7484 7485// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not 7486// have tags and a location 7487type ProxyResource struct { 7488 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 7489 ID *string `json:"id,omitempty"` 7490 // Name - READ-ONLY; The name of the resource 7491 Name *string `json:"name,omitempty"` 7492 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 7493 Type *string `json:"type,omitempty"` 7494} 7495 7496// MarshalJSON is the custom marshaler for ProxyResource. 7497func (pr ProxyResource) MarshalJSON() ([]byte, error) { 7498 objectMap := make(map[string]interface{}) 7499 return json.Marshal(objectMap) 7500} 7501 7502// RegionForOnlineOffline cosmos DB region to online or offline. 7503type RegionForOnlineOffline struct { 7504 // Region - Cosmos DB region, with spaces between words and each word capitalized. 7505 Region *string `json:"region,omitempty"` 7506} 7507 7508// RepairPostBody specification of the keyspaces and tables to run repair on. 7509type RepairPostBody struct { 7510 // Keyspace - The name of the keyspace that repair should be run on. 7511 Keyspace *string `json:"keyspace,omitempty"` 7512 // Tables - List of tables in the keyspace to repair. If omitted, repair all tables in the keyspace. 7513 Tables *[]string `json:"tables,omitempty"` 7514} 7515 7516// Resource common fields that are returned in the response for all Azure Resource Manager resources 7517type Resource struct { 7518 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 7519 ID *string `json:"id,omitempty"` 7520 // Name - READ-ONLY; The name of the resource 7521 Name *string `json:"name,omitempty"` 7522 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 7523 Type *string `json:"type,omitempty"` 7524} 7525 7526// MarshalJSON is the custom marshaler for Resource. 7527func (r Resource) MarshalJSON() ([]byte, error) { 7528 objectMap := make(map[string]interface{}) 7529 return json.Marshal(objectMap) 7530} 7531 7532// RestorableDatabaseAccountGetResult a Azure Cosmos DB restorable database account. 7533type RestorableDatabaseAccountGetResult struct { 7534 autorest.Response `json:"-"` 7535 // RestorableDatabaseAccountProperties - The properties of a restorable database account. 7536 *RestorableDatabaseAccountProperties `json:"properties,omitempty"` 7537 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 7538 ID *string `json:"id,omitempty"` 7539 // Name - READ-ONLY; The name of the ARM resource. 7540 Name *string `json:"name,omitempty"` 7541 // Type - READ-ONLY; The type of Azure resource. 7542 Type *string `json:"type,omitempty"` 7543 // Location - The location of the resource group to which the resource belongs. 7544 Location *string `json:"location,omitempty"` 7545} 7546 7547// MarshalJSON is the custom marshaler for RestorableDatabaseAccountGetResult. 7548func (rdagr RestorableDatabaseAccountGetResult) MarshalJSON() ([]byte, error) { 7549 objectMap := make(map[string]interface{}) 7550 if rdagr.RestorableDatabaseAccountProperties != nil { 7551 objectMap["properties"] = rdagr.RestorableDatabaseAccountProperties 7552 } 7553 if rdagr.Location != nil { 7554 objectMap["location"] = rdagr.Location 7555 } 7556 return json.Marshal(objectMap) 7557} 7558 7559// UnmarshalJSON is the custom unmarshaler for RestorableDatabaseAccountGetResult struct. 7560func (rdagr *RestorableDatabaseAccountGetResult) UnmarshalJSON(body []byte) error { 7561 var m map[string]*json.RawMessage 7562 err := json.Unmarshal(body, &m) 7563 if err != nil { 7564 return err 7565 } 7566 for k, v := range m { 7567 switch k { 7568 case "properties": 7569 if v != nil { 7570 var restorableDatabaseAccountProperties RestorableDatabaseAccountProperties 7571 err = json.Unmarshal(*v, &restorableDatabaseAccountProperties) 7572 if err != nil { 7573 return err 7574 } 7575 rdagr.RestorableDatabaseAccountProperties = &restorableDatabaseAccountProperties 7576 } 7577 case "id": 7578 if v != nil { 7579 var ID string 7580 err = json.Unmarshal(*v, &ID) 7581 if err != nil { 7582 return err 7583 } 7584 rdagr.ID = &ID 7585 } 7586 case "name": 7587 if v != nil { 7588 var name string 7589 err = json.Unmarshal(*v, &name) 7590 if err != nil { 7591 return err 7592 } 7593 rdagr.Name = &name 7594 } 7595 case "type": 7596 if v != nil { 7597 var typeVar string 7598 err = json.Unmarshal(*v, &typeVar) 7599 if err != nil { 7600 return err 7601 } 7602 rdagr.Type = &typeVar 7603 } 7604 case "location": 7605 if v != nil { 7606 var location string 7607 err = json.Unmarshal(*v, &location) 7608 if err != nil { 7609 return err 7610 } 7611 rdagr.Location = &location 7612 } 7613 } 7614 } 7615 7616 return nil 7617} 7618 7619// RestorableDatabaseAccountProperties the properties of a restorable database account. 7620type RestorableDatabaseAccountProperties struct { 7621 // AccountName - The name of the global database account 7622 AccountName *string `json:"accountName,omitempty"` 7623 // CreationTime - The creation time of the restorable database account (ISO-8601 format). 7624 CreationTime *date.Time `json:"creationTime,omitempty"` 7625 // DeletionTime - The time at which the restorable database account has been deleted (ISO-8601 format). 7626 DeletionTime *date.Time `json:"deletionTime,omitempty"` 7627 // APIType - READ-ONLY; The API type of the restorable database account. Possible values include: 'APITypeMongoDB', 'APITypeGremlin', 'APITypeCassandra', 'APITypeTable', 'APITypeSQL', 'APITypeGremlinV2' 7628 APIType APIType `json:"apiType,omitempty"` 7629 // RestorableLocations - READ-ONLY; List of regions where the of the database account can be restored from. 7630 RestorableLocations *[]RestorableLocationResource `json:"restorableLocations,omitempty"` 7631} 7632 7633// MarshalJSON is the custom marshaler for RestorableDatabaseAccountProperties. 7634func (rdap RestorableDatabaseAccountProperties) MarshalJSON() ([]byte, error) { 7635 objectMap := make(map[string]interface{}) 7636 if rdap.AccountName != nil { 7637 objectMap["accountName"] = rdap.AccountName 7638 } 7639 if rdap.CreationTime != nil { 7640 objectMap["creationTime"] = rdap.CreationTime 7641 } 7642 if rdap.DeletionTime != nil { 7643 objectMap["deletionTime"] = rdap.DeletionTime 7644 } 7645 return json.Marshal(objectMap) 7646} 7647 7648// RestorableDatabaseAccountsListResult the List operation response, that contains the restorable database 7649// accounts and their properties. 7650type RestorableDatabaseAccountsListResult struct { 7651 autorest.Response `json:"-"` 7652 // Value - READ-ONLY; List of restorable database accounts and their properties. 7653 Value *[]RestorableDatabaseAccountGetResult `json:"value,omitempty"` 7654} 7655 7656// MarshalJSON is the custom marshaler for RestorableDatabaseAccountsListResult. 7657func (rdalr RestorableDatabaseAccountsListResult) MarshalJSON() ([]byte, error) { 7658 objectMap := make(map[string]interface{}) 7659 return json.Marshal(objectMap) 7660} 7661 7662// RestorableLocationResource properties of the regional restorable account. 7663type RestorableLocationResource struct { 7664 // LocationName - READ-ONLY; The location of the regional restorable account. 7665 LocationName *string `json:"locationName,omitempty"` 7666 // RegionalDatabaseAccountInstanceID - READ-ONLY; The instance id of the regional restorable account. 7667 RegionalDatabaseAccountInstanceID *string `json:"regionalDatabaseAccountInstanceId,omitempty"` 7668 // CreationTime - READ-ONLY; The creation time of the regional restorable database account (ISO-8601 format). 7669 CreationTime *date.Time `json:"creationTime,omitempty"` 7670 // DeletionTime - READ-ONLY; The time at which the regional restorable database account has been deleted (ISO-8601 format). 7671 DeletionTime *date.Time `json:"deletionTime,omitempty"` 7672} 7673 7674// MarshalJSON is the custom marshaler for RestorableLocationResource. 7675func (rlr RestorableLocationResource) MarshalJSON() ([]byte, error) { 7676 objectMap := make(map[string]interface{}) 7677 return json.Marshal(objectMap) 7678} 7679 7680// RestorableMongodbCollectionGetResult an Azure Cosmos DB MongoDB collection event 7681type RestorableMongodbCollectionGetResult struct { 7682 // RestorableMongodbCollectionProperties - The properties of a MongoDB collection event. 7683 *RestorableMongodbCollectionProperties `json:"properties,omitempty"` 7684 // ID - READ-ONLY; The unique resource Identifier of the ARM resource. 7685 ID *string `json:"id,omitempty"` 7686 // Name - READ-ONLY; The name of the ARM resource. 7687 Name *string `json:"name,omitempty"` 7688 // Type - READ-ONLY; The type of Azure resource. 7689 Type *string `json:"type,omitempty"` 7690} 7691 7692// MarshalJSON is the custom marshaler for RestorableMongodbCollectionGetResult. 7693func (rmcgr RestorableMongodbCollectionGetResult) MarshalJSON() ([]byte, error) { 7694 objectMap := make(map[string]interface{}) 7695 if rmcgr.RestorableMongodbCollectionProperties != nil { 7696 objectMap["properties"] = rmcgr.RestorableMongodbCollectionProperties 7697 } 7698 return json.Marshal(objectMap) 7699} 7700 7701// UnmarshalJSON is the custom unmarshaler for RestorableMongodbCollectionGetResult struct. 7702func (rmcgr *RestorableMongodbCollectionGetResult) UnmarshalJSON(body []byte) error { 7703 var m map[string]*json.RawMessage 7704 err := json.Unmarshal(body, &m) 7705 if err != nil { 7706 return err 7707 } 7708 for k, v := range m { 7709 switch k { 7710 case "properties": 7711 if v != nil { 7712 var restorableMongodbCollectionProperties RestorableMongodbCollectionProperties 7713 err = json.Unmarshal(*v, &restorableMongodbCollectionProperties) 7714 if err != nil { 7715 return err 7716 } 7717 rmcgr.RestorableMongodbCollectionProperties = &restorableMongodbCollectionProperties 7718 } 7719 case "id": 7720 if v != nil { 7721 var ID string 7722 err = json.Unmarshal(*v, &ID) 7723 if err != nil { 7724 return err 7725 } 7726 rmcgr.ID = &ID 7727 } 7728 case "name": 7729 if v != nil { 7730 var name string 7731 err = json.Unmarshal(*v, &name) 7732 if err != nil { 7733 return err 7734 } 7735 rmcgr.Name = &name 7736 } 7737 case "type": 7738 if v != nil { 7739 var typeVar string 7740 err = json.Unmarshal(*v, &typeVar) 7741 if err != nil { 7742 return err 7743 } 7744 rmcgr.Type = &typeVar 7745 } 7746 } 7747 } 7748 7749 return nil 7750} 7751 7752// RestorableMongodbCollectionProperties the properties of an Azure Cosmos DB MongoDB collection event 7753type RestorableMongodbCollectionProperties struct { 7754 // Resource - The resource of an Azure Cosmos DB MongoDB collection event 7755 Resource *RestorableMongodbCollectionPropertiesResource `json:"resource,omitempty"` 7756} 7757 7758// RestorableMongodbCollectionPropertiesResource the resource of an Azure Cosmos DB MongoDB collection 7759// event 7760type RestorableMongodbCollectionPropertiesResource struct { 7761 // Rid - READ-ONLY; A system generated property. A unique identifier. 7762 Rid *string `json:"_rid,omitempty"` 7763 // OperationType - READ-ONLY; The operation type of this collection event. Possible values include: 'OperationTypeCreate', 'OperationTypeReplace', 'OperationTypeDelete', 'OperationTypeSystemOperation' 7764 OperationType OperationType `json:"operationType,omitempty"` 7765 // EventTimestamp - READ-ONLY; The time when this collection event happened. 7766 EventTimestamp *string `json:"eventTimestamp,omitempty"` 7767 // OwnerID - READ-ONLY; The name of this MongoDB collection. 7768 OwnerID *string `json:"ownerId,omitempty"` 7769 // OwnerResourceID - READ-ONLY; The resource ID of this MongoDB collection. 7770 OwnerResourceID *string `json:"ownerResourceId,omitempty"` 7771} 7772 7773// MarshalJSON is the custom marshaler for RestorableMongodbCollectionPropertiesResource. 7774func (rmcp RestorableMongodbCollectionPropertiesResource) MarshalJSON() ([]byte, error) { 7775 objectMap := make(map[string]interface{}) 7776 return json.Marshal(objectMap) 7777} 7778 7779// RestorableMongodbCollectionsListResult the List operation response, that contains the MongoDB collection 7780// events and their properties. 7781type RestorableMongodbCollectionsListResult struct { 7782 autorest.Response `json:"-"` 7783 // Value - READ-ONLY; List of MongoDB collection events and their properties. 7784 Value *[]RestorableMongodbCollectionGetResult `json:"value,omitempty"` 7785} 7786 7787// MarshalJSON is the custom marshaler for RestorableMongodbCollectionsListResult. 7788func (rmclr RestorableMongodbCollectionsListResult) MarshalJSON() ([]byte, error) { 7789 objectMap := make(map[string]interface{}) 7790 return json.Marshal(objectMap) 7791} 7792 7793// RestorableMongodbDatabaseGetResult an Azure Cosmos DB MongoDB database event 7794type RestorableMongodbDatabaseGetResult struct { 7795 // RestorableMongodbDatabaseProperties - The properties of a MongoDB database event. 7796 *RestorableMongodbDatabaseProperties `json:"properties,omitempty"` 7797 // ID - READ-ONLY; The unique resource Identifier of the ARM resource. 7798 ID *string `json:"id,omitempty"` 7799 // Name - READ-ONLY; The name of the ARM resource. 7800 Name *string `json:"name,omitempty"` 7801 // Type - READ-ONLY; The type of Azure resource. 7802 Type *string `json:"type,omitempty"` 7803} 7804 7805// MarshalJSON is the custom marshaler for RestorableMongodbDatabaseGetResult. 7806func (rmdgr RestorableMongodbDatabaseGetResult) MarshalJSON() ([]byte, error) { 7807 objectMap := make(map[string]interface{}) 7808 if rmdgr.RestorableMongodbDatabaseProperties != nil { 7809 objectMap["properties"] = rmdgr.RestorableMongodbDatabaseProperties 7810 } 7811 return json.Marshal(objectMap) 7812} 7813 7814// UnmarshalJSON is the custom unmarshaler for RestorableMongodbDatabaseGetResult struct. 7815func (rmdgr *RestorableMongodbDatabaseGetResult) UnmarshalJSON(body []byte) error { 7816 var m map[string]*json.RawMessage 7817 err := json.Unmarshal(body, &m) 7818 if err != nil { 7819 return err 7820 } 7821 for k, v := range m { 7822 switch k { 7823 case "properties": 7824 if v != nil { 7825 var restorableMongodbDatabaseProperties RestorableMongodbDatabaseProperties 7826 err = json.Unmarshal(*v, &restorableMongodbDatabaseProperties) 7827 if err != nil { 7828 return err 7829 } 7830 rmdgr.RestorableMongodbDatabaseProperties = &restorableMongodbDatabaseProperties 7831 } 7832 case "id": 7833 if v != nil { 7834 var ID string 7835 err = json.Unmarshal(*v, &ID) 7836 if err != nil { 7837 return err 7838 } 7839 rmdgr.ID = &ID 7840 } 7841 case "name": 7842 if v != nil { 7843 var name string 7844 err = json.Unmarshal(*v, &name) 7845 if err != nil { 7846 return err 7847 } 7848 rmdgr.Name = &name 7849 } 7850 case "type": 7851 if v != nil { 7852 var typeVar string 7853 err = json.Unmarshal(*v, &typeVar) 7854 if err != nil { 7855 return err 7856 } 7857 rmdgr.Type = &typeVar 7858 } 7859 } 7860 } 7861 7862 return nil 7863} 7864 7865// RestorableMongodbDatabaseProperties the properties of an Azure Cosmos DB MongoDB database event 7866type RestorableMongodbDatabaseProperties struct { 7867 // Resource - The resource of an Azure Cosmos DB MongoDB database event 7868 Resource *RestorableMongodbDatabasePropertiesResource `json:"resource,omitempty"` 7869} 7870 7871// RestorableMongodbDatabasePropertiesResource the resource of an Azure Cosmos DB MongoDB database event 7872type RestorableMongodbDatabasePropertiesResource struct { 7873 // Rid - READ-ONLY; A system generated property. A unique identifier. 7874 Rid *string `json:"_rid,omitempty"` 7875 // OperationType - READ-ONLY; The operation type of this database event. Possible values include: 'OperationTypeCreate', 'OperationTypeReplace', 'OperationTypeDelete', 'OperationTypeSystemOperation' 7876 OperationType OperationType `json:"operationType,omitempty"` 7877 // EventTimestamp - READ-ONLY; The time when this database event happened. 7878 EventTimestamp *string `json:"eventTimestamp,omitempty"` 7879 // OwnerID - READ-ONLY; The name of this MongoDB database. 7880 OwnerID *string `json:"ownerId,omitempty"` 7881 // OwnerResourceID - READ-ONLY; The resource ID of this MongoDB database. 7882 OwnerResourceID *string `json:"ownerResourceId,omitempty"` 7883} 7884 7885// MarshalJSON is the custom marshaler for RestorableMongodbDatabasePropertiesResource. 7886func (rmdp RestorableMongodbDatabasePropertiesResource) MarshalJSON() ([]byte, error) { 7887 objectMap := make(map[string]interface{}) 7888 return json.Marshal(objectMap) 7889} 7890 7891// RestorableMongodbDatabasesListResult the List operation response, that contains the MongoDB database 7892// events and their properties. 7893type RestorableMongodbDatabasesListResult struct { 7894 autorest.Response `json:"-"` 7895 // Value - READ-ONLY; List of MongoDB database events and their properties. 7896 Value *[]RestorableMongodbDatabaseGetResult `json:"value,omitempty"` 7897} 7898 7899// MarshalJSON is the custom marshaler for RestorableMongodbDatabasesListResult. 7900func (rmdlr RestorableMongodbDatabasesListResult) MarshalJSON() ([]byte, error) { 7901 objectMap := make(map[string]interface{}) 7902 return json.Marshal(objectMap) 7903} 7904 7905// RestorableMongodbResourcesListResult the List operation response, that contains the restorable MongoDB 7906// resources. 7907type RestorableMongodbResourcesListResult struct { 7908 autorest.Response `json:"-"` 7909 // Value - READ-ONLY; List of restorable MongoDB resources, including the database and collection names. 7910 Value *[]DatabaseRestoreResource `json:"value,omitempty"` 7911} 7912 7913// MarshalJSON is the custom marshaler for RestorableMongodbResourcesListResult. 7914func (rmrlr RestorableMongodbResourcesListResult) MarshalJSON() ([]byte, error) { 7915 objectMap := make(map[string]interface{}) 7916 return json.Marshal(objectMap) 7917} 7918 7919// RestorableSQLContainerGetResult an Azure Cosmos DB SQL container event 7920type RestorableSQLContainerGetResult struct { 7921 // RestorableSQLContainerProperties - The properties of a SQL container event. 7922 *RestorableSQLContainerProperties `json:"properties,omitempty"` 7923 // ID - READ-ONLY; The unique resource Identifier of the ARM resource. 7924 ID *string `json:"id,omitempty"` 7925 // Name - READ-ONLY; The name of the ARM resource. 7926 Name *string `json:"name,omitempty"` 7927 // Type - READ-ONLY; The type of Azure resource. 7928 Type *string `json:"type,omitempty"` 7929} 7930 7931// MarshalJSON is the custom marshaler for RestorableSQLContainerGetResult. 7932func (rscgr RestorableSQLContainerGetResult) MarshalJSON() ([]byte, error) { 7933 objectMap := make(map[string]interface{}) 7934 if rscgr.RestorableSQLContainerProperties != nil { 7935 objectMap["properties"] = rscgr.RestorableSQLContainerProperties 7936 } 7937 return json.Marshal(objectMap) 7938} 7939 7940// UnmarshalJSON is the custom unmarshaler for RestorableSQLContainerGetResult struct. 7941func (rscgr *RestorableSQLContainerGetResult) UnmarshalJSON(body []byte) error { 7942 var m map[string]*json.RawMessage 7943 err := json.Unmarshal(body, &m) 7944 if err != nil { 7945 return err 7946 } 7947 for k, v := range m { 7948 switch k { 7949 case "properties": 7950 if v != nil { 7951 var restorableSQLContainerProperties RestorableSQLContainerProperties 7952 err = json.Unmarshal(*v, &restorableSQLContainerProperties) 7953 if err != nil { 7954 return err 7955 } 7956 rscgr.RestorableSQLContainerProperties = &restorableSQLContainerProperties 7957 } 7958 case "id": 7959 if v != nil { 7960 var ID string 7961 err = json.Unmarshal(*v, &ID) 7962 if err != nil { 7963 return err 7964 } 7965 rscgr.ID = &ID 7966 } 7967 case "name": 7968 if v != nil { 7969 var name string 7970 err = json.Unmarshal(*v, &name) 7971 if err != nil { 7972 return err 7973 } 7974 rscgr.Name = &name 7975 } 7976 case "type": 7977 if v != nil { 7978 var typeVar string 7979 err = json.Unmarshal(*v, &typeVar) 7980 if err != nil { 7981 return err 7982 } 7983 rscgr.Type = &typeVar 7984 } 7985 } 7986 } 7987 7988 return nil 7989} 7990 7991// RestorableSQLContainerProperties the properties of an Azure Cosmos DB SQL container event 7992type RestorableSQLContainerProperties struct { 7993 // Resource - The resource of an Azure Cosmos DB SQL container event 7994 Resource *RestorableSQLContainerPropertiesResource `json:"resource,omitempty"` 7995} 7996 7997// RestorableSQLContainerPropertiesResource the resource of an Azure Cosmos DB SQL container event 7998type RestorableSQLContainerPropertiesResource struct { 7999 // Rid - READ-ONLY; A system generated property. A unique identifier. 8000 Rid *string `json:"_rid,omitempty"` 8001 // OperationType - READ-ONLY; The operation type of this container event. Possible values include: 'OperationTypeCreate', 'OperationTypeReplace', 'OperationTypeDelete', 'OperationTypeSystemOperation' 8002 OperationType OperationType `json:"operationType,omitempty"` 8003 // EventTimestamp - READ-ONLY; The when this container event happened. 8004 EventTimestamp *string `json:"eventTimestamp,omitempty"` 8005 // OwnerID - READ-ONLY; The name of this SQL container. 8006 OwnerID *string `json:"ownerId,omitempty"` 8007 // OwnerResourceID - READ-ONLY; The resource ID of this SQL container. 8008 OwnerResourceID *string `json:"ownerResourceId,omitempty"` 8009 // Container - Cosmos DB SQL container resource object 8010 Container *RestorableSQLContainerPropertiesResourceContainer `json:"container,omitempty"` 8011} 8012 8013// MarshalJSON is the custom marshaler for RestorableSQLContainerPropertiesResource. 8014func (rscp RestorableSQLContainerPropertiesResource) MarshalJSON() ([]byte, error) { 8015 objectMap := make(map[string]interface{}) 8016 if rscp.Container != nil { 8017 objectMap["container"] = rscp.Container 8018 } 8019 return json.Marshal(objectMap) 8020} 8021 8022// RestorableSQLContainerPropertiesResourceContainer cosmos DB SQL container resource object 8023type RestorableSQLContainerPropertiesResourceContainer struct { 8024 // ID - Name of the Cosmos DB SQL container 8025 ID *string `json:"id,omitempty"` 8026 // IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container 8027 IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` 8028 // PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions 8029 PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` 8030 // DefaultTTL - Default time to live 8031 DefaultTTL *int32 `json:"defaultTtl,omitempty"` 8032 // UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. 8033 UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` 8034 // ConflictResolutionPolicy - The conflict resolution policy for the container. 8035 ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` 8036 // AnalyticalStorageTTL - Analytical TTL. 8037 AnalyticalStorageTTL *int64 `json:"analyticalStorageTtl,omitempty"` 8038 // Rid - READ-ONLY; A system generated property. A unique identifier. 8039 Rid *string `json:"_rid,omitempty"` 8040 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 8041 Ts *float64 `json:"_ts,omitempty"` 8042 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 8043 Etag *string `json:"_etag,omitempty"` 8044 // Self - READ-ONLY; A system generated property that specifies the addressable path of the container resource. 8045 Self *string `json:"_self,omitempty"` 8046} 8047 8048// MarshalJSON is the custom marshaler for RestorableSQLContainerPropertiesResourceContainer. 8049func (rscp RestorableSQLContainerPropertiesResourceContainer) MarshalJSON() ([]byte, error) { 8050 objectMap := make(map[string]interface{}) 8051 if rscp.ID != nil { 8052 objectMap["id"] = rscp.ID 8053 } 8054 if rscp.IndexingPolicy != nil { 8055 objectMap["indexingPolicy"] = rscp.IndexingPolicy 8056 } 8057 if rscp.PartitionKey != nil { 8058 objectMap["partitionKey"] = rscp.PartitionKey 8059 } 8060 if rscp.DefaultTTL != nil { 8061 objectMap["defaultTtl"] = rscp.DefaultTTL 8062 } 8063 if rscp.UniqueKeyPolicy != nil { 8064 objectMap["uniqueKeyPolicy"] = rscp.UniqueKeyPolicy 8065 } 8066 if rscp.ConflictResolutionPolicy != nil { 8067 objectMap["conflictResolutionPolicy"] = rscp.ConflictResolutionPolicy 8068 } 8069 if rscp.AnalyticalStorageTTL != nil { 8070 objectMap["analyticalStorageTtl"] = rscp.AnalyticalStorageTTL 8071 } 8072 return json.Marshal(objectMap) 8073} 8074 8075// RestorableSQLContainersListResult the List operation response, that contains the SQL container events 8076// and their properties. 8077type RestorableSQLContainersListResult struct { 8078 autorest.Response `json:"-"` 8079 // Value - READ-ONLY; List of SQL container events and their properties. 8080 Value *[]RestorableSQLContainerGetResult `json:"value,omitempty"` 8081} 8082 8083// MarshalJSON is the custom marshaler for RestorableSQLContainersListResult. 8084func (rsclr RestorableSQLContainersListResult) MarshalJSON() ([]byte, error) { 8085 objectMap := make(map[string]interface{}) 8086 return json.Marshal(objectMap) 8087} 8088 8089// RestorableSQLDatabaseGetResult an Azure Cosmos DB SQL database event 8090type RestorableSQLDatabaseGetResult struct { 8091 // RestorableSQLDatabaseProperties - The properties of a SQL database event. 8092 *RestorableSQLDatabaseProperties `json:"properties,omitempty"` 8093 // ID - READ-ONLY; The unique resource Identifier of the ARM resource. 8094 ID *string `json:"id,omitempty"` 8095 // Name - READ-ONLY; The name of the ARM resource. 8096 Name *string `json:"name,omitempty"` 8097 // Type - READ-ONLY; The type of Azure resource. 8098 Type *string `json:"type,omitempty"` 8099} 8100 8101// MarshalJSON is the custom marshaler for RestorableSQLDatabaseGetResult. 8102func (rsdgr RestorableSQLDatabaseGetResult) MarshalJSON() ([]byte, error) { 8103 objectMap := make(map[string]interface{}) 8104 if rsdgr.RestorableSQLDatabaseProperties != nil { 8105 objectMap["properties"] = rsdgr.RestorableSQLDatabaseProperties 8106 } 8107 return json.Marshal(objectMap) 8108} 8109 8110// UnmarshalJSON is the custom unmarshaler for RestorableSQLDatabaseGetResult struct. 8111func (rsdgr *RestorableSQLDatabaseGetResult) UnmarshalJSON(body []byte) error { 8112 var m map[string]*json.RawMessage 8113 err := json.Unmarshal(body, &m) 8114 if err != nil { 8115 return err 8116 } 8117 for k, v := range m { 8118 switch k { 8119 case "properties": 8120 if v != nil { 8121 var restorableSQLDatabaseProperties RestorableSQLDatabaseProperties 8122 err = json.Unmarshal(*v, &restorableSQLDatabaseProperties) 8123 if err != nil { 8124 return err 8125 } 8126 rsdgr.RestorableSQLDatabaseProperties = &restorableSQLDatabaseProperties 8127 } 8128 case "id": 8129 if v != nil { 8130 var ID string 8131 err = json.Unmarshal(*v, &ID) 8132 if err != nil { 8133 return err 8134 } 8135 rsdgr.ID = &ID 8136 } 8137 case "name": 8138 if v != nil { 8139 var name string 8140 err = json.Unmarshal(*v, &name) 8141 if err != nil { 8142 return err 8143 } 8144 rsdgr.Name = &name 8145 } 8146 case "type": 8147 if v != nil { 8148 var typeVar string 8149 err = json.Unmarshal(*v, &typeVar) 8150 if err != nil { 8151 return err 8152 } 8153 rsdgr.Type = &typeVar 8154 } 8155 } 8156 } 8157 8158 return nil 8159} 8160 8161// RestorableSQLDatabaseProperties the properties of an Azure Cosmos DB SQL database event 8162type RestorableSQLDatabaseProperties struct { 8163 // Resource - The resource of an Azure Cosmos DB SQL database event 8164 Resource *RestorableSQLDatabasePropertiesResource `json:"resource,omitempty"` 8165} 8166 8167// RestorableSQLDatabasePropertiesResource the resource of an Azure Cosmos DB SQL database event 8168type RestorableSQLDatabasePropertiesResource struct { 8169 // Rid - READ-ONLY; A system generated property. A unique identifier. 8170 Rid *string `json:"_rid,omitempty"` 8171 // OperationType - READ-ONLY; The operation type of this database event. Possible values include: 'OperationTypeCreate', 'OperationTypeReplace', 'OperationTypeDelete', 'OperationTypeSystemOperation' 8172 OperationType OperationType `json:"operationType,omitempty"` 8173 // EventTimestamp - READ-ONLY; The time when this database event happened. 8174 EventTimestamp *string `json:"eventTimestamp,omitempty"` 8175 // OwnerID - READ-ONLY; The name of the SQL database. 8176 OwnerID *string `json:"ownerId,omitempty"` 8177 // OwnerResourceID - READ-ONLY; The resource ID of the SQL database. 8178 OwnerResourceID *string `json:"ownerResourceId,omitempty"` 8179 // Database - Cosmos DB SQL database resource object 8180 Database *RestorableSQLDatabasePropertiesResourceDatabase `json:"database,omitempty"` 8181} 8182 8183// MarshalJSON is the custom marshaler for RestorableSQLDatabasePropertiesResource. 8184func (rsdp RestorableSQLDatabasePropertiesResource) MarshalJSON() ([]byte, error) { 8185 objectMap := make(map[string]interface{}) 8186 if rsdp.Database != nil { 8187 objectMap["database"] = rsdp.Database 8188 } 8189 return json.Marshal(objectMap) 8190} 8191 8192// RestorableSQLDatabasePropertiesResourceDatabase cosmos DB SQL database resource object 8193type RestorableSQLDatabasePropertiesResourceDatabase struct { 8194 // ID - Name of the Cosmos DB SQL database 8195 ID *string `json:"id,omitempty"` 8196 // Rid - READ-ONLY; A system generated property. A unique identifier. 8197 Rid *string `json:"_rid,omitempty"` 8198 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 8199 Ts *float64 `json:"_ts,omitempty"` 8200 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 8201 Etag *string `json:"_etag,omitempty"` 8202 // Colls - READ-ONLY; A system generated property that specified the addressable path of the collections resource. 8203 Colls *string `json:"_colls,omitempty"` 8204 // Users - READ-ONLY; A system generated property that specifies the addressable path of the users resource. 8205 Users *string `json:"_users,omitempty"` 8206 // Self - READ-ONLY; A system generated property that specifies the addressable path of the database resource. 8207 Self *string `json:"_self,omitempty"` 8208} 8209 8210// MarshalJSON is the custom marshaler for RestorableSQLDatabasePropertiesResourceDatabase. 8211func (rsdp RestorableSQLDatabasePropertiesResourceDatabase) MarshalJSON() ([]byte, error) { 8212 objectMap := make(map[string]interface{}) 8213 if rsdp.ID != nil { 8214 objectMap["id"] = rsdp.ID 8215 } 8216 return json.Marshal(objectMap) 8217} 8218 8219// RestorableSQLDatabasesListResult the List operation response, that contains the SQL database events and 8220// their properties. 8221type RestorableSQLDatabasesListResult struct { 8222 autorest.Response `json:"-"` 8223 // Value - READ-ONLY; List of SQL database events and their properties. 8224 Value *[]RestorableSQLDatabaseGetResult `json:"value,omitempty"` 8225} 8226 8227// MarshalJSON is the custom marshaler for RestorableSQLDatabasesListResult. 8228func (rsdlr RestorableSQLDatabasesListResult) MarshalJSON() ([]byte, error) { 8229 objectMap := make(map[string]interface{}) 8230 return json.Marshal(objectMap) 8231} 8232 8233// RestorableSQLResourcesListResult the List operation response, that contains the restorable SQL 8234// resources. 8235type RestorableSQLResourcesListResult struct { 8236 autorest.Response `json:"-"` 8237 // Value - READ-ONLY; List of restorable SQL resources, including the database and collection names. 8238 Value *[]DatabaseRestoreResource `json:"value,omitempty"` 8239} 8240 8241// MarshalJSON is the custom marshaler for RestorableSQLResourcesListResult. 8242func (rsrlr RestorableSQLResourcesListResult) MarshalJSON() ([]byte, error) { 8243 objectMap := make(map[string]interface{}) 8244 return json.Marshal(objectMap) 8245} 8246 8247// RestoreParameters parameters to indicate the information about the restore. 8248type RestoreParameters struct { 8249 // RestoreMode - Describes the mode of the restore. Possible values include: 'RestoreModePointInTime' 8250 RestoreMode RestoreMode `json:"restoreMode,omitempty"` 8251 // RestoreSource - The id of the restorable database account from which the restore has to be initiated. For example: /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName} 8252 RestoreSource *string `json:"restoreSource,omitempty"` 8253 // RestoreTimestampInUtc - Time to which the account has to be restored (ISO-8601 format). 8254 RestoreTimestampInUtc *date.Time `json:"restoreTimestampInUtc,omitempty"` 8255 // DatabasesToRestore - List of specific databases available for restore. 8256 DatabasesToRestore *[]DatabaseRestoreResource `json:"databasesToRestore,omitempty"` 8257} 8258 8259// RestoreReqeustDatabaseAccountCreateUpdateProperties properties to restore Azure Cosmos DB database 8260// account. 8261type RestoreReqeustDatabaseAccountCreateUpdateProperties struct { 8262 // RestoreParameters - Parameters to indicate the information about the restore. 8263 RestoreParameters *RestoreParameters `json:"restoreParameters,omitempty"` 8264 // ConsistencyPolicy - The consistency policy for the Cosmos DB account. 8265 ConsistencyPolicy *ConsistencyPolicy `json:"consistencyPolicy,omitempty"` 8266 // Locations - An array that contains the georeplication locations enabled for the Cosmos DB account. 8267 Locations *[]Location `json:"locations,omitempty"` 8268 // DatabaseAccountOfferType - The offer type for the database 8269 DatabaseAccountOfferType *string `json:"databaseAccountOfferType,omitempty"` 8270 // IPRules - List of IpRules. 8271 IPRules *[]IPAddressOrRange `json:"ipRules,omitempty"` 8272 // IsVirtualNetworkFilterEnabled - Flag to indicate whether to enable/disable Virtual Network ACL rules. 8273 IsVirtualNetworkFilterEnabled *bool `json:"isVirtualNetworkFilterEnabled,omitempty"` 8274 // 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. 8275 EnableAutomaticFailover *bool `json:"enableAutomaticFailover,omitempty"` 8276 // Capabilities - List of Cosmos DB capabilities for the account 8277 Capabilities *[]Capability `json:"capabilities,omitempty"` 8278 // VirtualNetworkRules - List of Virtual Network ACL rules configured for the Cosmos DB account. 8279 VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` 8280 // EnableMultipleWriteLocations - Enables the account to write in multiple locations 8281 EnableMultipleWriteLocations *bool `json:"enableMultipleWriteLocations,omitempty"` 8282 // EnableCassandraConnector - Enables the cassandra connector on the Cosmos DB C* account 8283 EnableCassandraConnector *bool `json:"enableCassandraConnector,omitempty"` 8284 // ConnectorOffer - The cassandra connector offer type for the Cosmos DB database C* account. Possible values include: 'ConnectorOfferSmall' 8285 ConnectorOffer ConnectorOffer `json:"connectorOffer,omitempty"` 8286 // DisableKeyBasedMetadataWriteAccess - Disable write operations on metadata resources (databases, containers, throughput) via account keys 8287 DisableKeyBasedMetadataWriteAccess *bool `json:"disableKeyBasedMetadataWriteAccess,omitempty"` 8288 // KeyVaultKeyURI - The URI of the key vault 8289 KeyVaultKeyURI *string `json:"keyVaultKeyUri,omitempty"` 8290 // PublicNetworkAccess - Whether requests from Public Network are allowed. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' 8291 PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` 8292 // EnableFreeTier - Flag to indicate whether Free Tier is enabled. 8293 EnableFreeTier *bool `json:"enableFreeTier,omitempty"` 8294 // APIProperties - API specific properties. Currently, supported only for MongoDB API. 8295 APIProperties *APIProperties `json:"apiProperties,omitempty"` 8296 // EnableAnalyticalStorage - Flag to indicate whether to enable storage analytics. 8297 EnableAnalyticalStorage *bool `json:"enableAnalyticalStorage,omitempty"` 8298 // BackupPolicy - The object representing the policy for taking backups on an account. 8299 BackupPolicy BasicBackupPolicy `json:"backupPolicy,omitempty"` 8300 // Cors - The CORS policy for the Cosmos DB database account. 8301 Cors *[]CorsPolicy `json:"cors,omitempty"` 8302 // NetworkACLBypass - Indicates what services are allowed to bypass firewall checks. Possible values include: 'NetworkACLBypassNone', 'NetworkACLBypassAzureServices' 8303 NetworkACLBypass NetworkACLBypass `json:"networkAclBypass,omitempty"` 8304 // NetworkACLBypassResourceIds - An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. 8305 NetworkACLBypassResourceIds *[]string `json:"networkAclBypassResourceIds,omitempty"` 8306 // CreateMode - Possible values include: 'CreateModeBasicDatabaseAccountCreateUpdatePropertiesCreateModeDatabaseAccountCreateUpdateProperties', 'CreateModeBasicDatabaseAccountCreateUpdatePropertiesCreateModeDefault', 'CreateModeBasicDatabaseAccountCreateUpdatePropertiesCreateModeRestore' 8307 CreateMode CreateModeBasicDatabaseAccountCreateUpdateProperties `json:"createMode,omitempty"` 8308} 8309 8310// MarshalJSON is the custom marshaler for RestoreReqeustDatabaseAccountCreateUpdateProperties. 8311func (rrdacup RestoreReqeustDatabaseAccountCreateUpdateProperties) MarshalJSON() ([]byte, error) { 8312 rrdacup.CreateMode = CreateModeBasicDatabaseAccountCreateUpdatePropertiesCreateModeRestore 8313 objectMap := make(map[string]interface{}) 8314 if rrdacup.RestoreParameters != nil { 8315 objectMap["restoreParameters"] = rrdacup.RestoreParameters 8316 } 8317 if rrdacup.ConsistencyPolicy != nil { 8318 objectMap["consistencyPolicy"] = rrdacup.ConsistencyPolicy 8319 } 8320 if rrdacup.Locations != nil { 8321 objectMap["locations"] = rrdacup.Locations 8322 } 8323 if rrdacup.DatabaseAccountOfferType != nil { 8324 objectMap["databaseAccountOfferType"] = rrdacup.DatabaseAccountOfferType 8325 } 8326 if rrdacup.IPRules != nil { 8327 objectMap["ipRules"] = rrdacup.IPRules 8328 } 8329 if rrdacup.IsVirtualNetworkFilterEnabled != nil { 8330 objectMap["isVirtualNetworkFilterEnabled"] = rrdacup.IsVirtualNetworkFilterEnabled 8331 } 8332 if rrdacup.EnableAutomaticFailover != nil { 8333 objectMap["enableAutomaticFailover"] = rrdacup.EnableAutomaticFailover 8334 } 8335 if rrdacup.Capabilities != nil { 8336 objectMap["capabilities"] = rrdacup.Capabilities 8337 } 8338 if rrdacup.VirtualNetworkRules != nil { 8339 objectMap["virtualNetworkRules"] = rrdacup.VirtualNetworkRules 8340 } 8341 if rrdacup.EnableMultipleWriteLocations != nil { 8342 objectMap["enableMultipleWriteLocations"] = rrdacup.EnableMultipleWriteLocations 8343 } 8344 if rrdacup.EnableCassandraConnector != nil { 8345 objectMap["enableCassandraConnector"] = rrdacup.EnableCassandraConnector 8346 } 8347 if rrdacup.ConnectorOffer != "" { 8348 objectMap["connectorOffer"] = rrdacup.ConnectorOffer 8349 } 8350 if rrdacup.DisableKeyBasedMetadataWriteAccess != nil { 8351 objectMap["disableKeyBasedMetadataWriteAccess"] = rrdacup.DisableKeyBasedMetadataWriteAccess 8352 } 8353 if rrdacup.KeyVaultKeyURI != nil { 8354 objectMap["keyVaultKeyUri"] = rrdacup.KeyVaultKeyURI 8355 } 8356 if rrdacup.PublicNetworkAccess != "" { 8357 objectMap["publicNetworkAccess"] = rrdacup.PublicNetworkAccess 8358 } 8359 if rrdacup.EnableFreeTier != nil { 8360 objectMap["enableFreeTier"] = rrdacup.EnableFreeTier 8361 } 8362 if rrdacup.APIProperties != nil { 8363 objectMap["apiProperties"] = rrdacup.APIProperties 8364 } 8365 if rrdacup.EnableAnalyticalStorage != nil { 8366 objectMap["enableAnalyticalStorage"] = rrdacup.EnableAnalyticalStorage 8367 } 8368 objectMap["backupPolicy"] = rrdacup.BackupPolicy 8369 if rrdacup.Cors != nil { 8370 objectMap["cors"] = rrdacup.Cors 8371 } 8372 if rrdacup.NetworkACLBypass != "" { 8373 objectMap["networkAclBypass"] = rrdacup.NetworkACLBypass 8374 } 8375 if rrdacup.NetworkACLBypassResourceIds != nil { 8376 objectMap["networkAclBypassResourceIds"] = rrdacup.NetworkACLBypassResourceIds 8377 } 8378 if rrdacup.CreateMode != "" { 8379 objectMap["createMode"] = rrdacup.CreateMode 8380 } 8381 return json.Marshal(objectMap) 8382} 8383 8384// AsDefaultRequestDatabaseAccountCreateUpdateProperties is the BasicDatabaseAccountCreateUpdateProperties implementation for RestoreReqeustDatabaseAccountCreateUpdateProperties. 8385func (rrdacup RestoreReqeustDatabaseAccountCreateUpdateProperties) AsDefaultRequestDatabaseAccountCreateUpdateProperties() (*DefaultRequestDatabaseAccountCreateUpdateProperties, bool) { 8386 return nil, false 8387} 8388 8389// AsRestoreReqeustDatabaseAccountCreateUpdateProperties is the BasicDatabaseAccountCreateUpdateProperties implementation for RestoreReqeustDatabaseAccountCreateUpdateProperties. 8390func (rrdacup RestoreReqeustDatabaseAccountCreateUpdateProperties) AsRestoreReqeustDatabaseAccountCreateUpdateProperties() (*RestoreReqeustDatabaseAccountCreateUpdateProperties, bool) { 8391 return &rrdacup, true 8392} 8393 8394// AsDatabaseAccountCreateUpdateProperties is the BasicDatabaseAccountCreateUpdateProperties implementation for RestoreReqeustDatabaseAccountCreateUpdateProperties. 8395func (rrdacup RestoreReqeustDatabaseAccountCreateUpdateProperties) AsDatabaseAccountCreateUpdateProperties() (*DatabaseAccountCreateUpdateProperties, bool) { 8396 return nil, false 8397} 8398 8399// AsBasicDatabaseAccountCreateUpdateProperties is the BasicDatabaseAccountCreateUpdateProperties implementation for RestoreReqeustDatabaseAccountCreateUpdateProperties. 8400func (rrdacup RestoreReqeustDatabaseAccountCreateUpdateProperties) AsBasicDatabaseAccountCreateUpdateProperties() (BasicDatabaseAccountCreateUpdateProperties, bool) { 8401 return &rrdacup, true 8402} 8403 8404// UnmarshalJSON is the custom unmarshaler for RestoreReqeustDatabaseAccountCreateUpdateProperties struct. 8405func (rrdacup *RestoreReqeustDatabaseAccountCreateUpdateProperties) UnmarshalJSON(body []byte) error { 8406 var m map[string]*json.RawMessage 8407 err := json.Unmarshal(body, &m) 8408 if err != nil { 8409 return err 8410 } 8411 for k, v := range m { 8412 switch k { 8413 case "restoreParameters": 8414 if v != nil { 8415 var restoreParameters RestoreParameters 8416 err = json.Unmarshal(*v, &restoreParameters) 8417 if err != nil { 8418 return err 8419 } 8420 rrdacup.RestoreParameters = &restoreParameters 8421 } 8422 case "consistencyPolicy": 8423 if v != nil { 8424 var consistencyPolicy ConsistencyPolicy 8425 err = json.Unmarshal(*v, &consistencyPolicy) 8426 if err != nil { 8427 return err 8428 } 8429 rrdacup.ConsistencyPolicy = &consistencyPolicy 8430 } 8431 case "locations": 8432 if v != nil { 8433 var locations []Location 8434 err = json.Unmarshal(*v, &locations) 8435 if err != nil { 8436 return err 8437 } 8438 rrdacup.Locations = &locations 8439 } 8440 case "databaseAccountOfferType": 8441 if v != nil { 8442 var databaseAccountOfferType string 8443 err = json.Unmarshal(*v, &databaseAccountOfferType) 8444 if err != nil { 8445 return err 8446 } 8447 rrdacup.DatabaseAccountOfferType = &databaseAccountOfferType 8448 } 8449 case "ipRules": 8450 if v != nil { 8451 var IPRules []IPAddressOrRange 8452 err = json.Unmarshal(*v, &IPRules) 8453 if err != nil { 8454 return err 8455 } 8456 rrdacup.IPRules = &IPRules 8457 } 8458 case "isVirtualNetworkFilterEnabled": 8459 if v != nil { 8460 var isVirtualNetworkFilterEnabled bool 8461 err = json.Unmarshal(*v, &isVirtualNetworkFilterEnabled) 8462 if err != nil { 8463 return err 8464 } 8465 rrdacup.IsVirtualNetworkFilterEnabled = &isVirtualNetworkFilterEnabled 8466 } 8467 case "enableAutomaticFailover": 8468 if v != nil { 8469 var enableAutomaticFailover bool 8470 err = json.Unmarshal(*v, &enableAutomaticFailover) 8471 if err != nil { 8472 return err 8473 } 8474 rrdacup.EnableAutomaticFailover = &enableAutomaticFailover 8475 } 8476 case "capabilities": 8477 if v != nil { 8478 var capabilities []Capability 8479 err = json.Unmarshal(*v, &capabilities) 8480 if err != nil { 8481 return err 8482 } 8483 rrdacup.Capabilities = &capabilities 8484 } 8485 case "virtualNetworkRules": 8486 if v != nil { 8487 var virtualNetworkRules []VirtualNetworkRule 8488 err = json.Unmarshal(*v, &virtualNetworkRules) 8489 if err != nil { 8490 return err 8491 } 8492 rrdacup.VirtualNetworkRules = &virtualNetworkRules 8493 } 8494 case "enableMultipleWriteLocations": 8495 if v != nil { 8496 var enableMultipleWriteLocations bool 8497 err = json.Unmarshal(*v, &enableMultipleWriteLocations) 8498 if err != nil { 8499 return err 8500 } 8501 rrdacup.EnableMultipleWriteLocations = &enableMultipleWriteLocations 8502 } 8503 case "enableCassandraConnector": 8504 if v != nil { 8505 var enableCassandraConnector bool 8506 err = json.Unmarshal(*v, &enableCassandraConnector) 8507 if err != nil { 8508 return err 8509 } 8510 rrdacup.EnableCassandraConnector = &enableCassandraConnector 8511 } 8512 case "connectorOffer": 8513 if v != nil { 8514 var connectorOffer ConnectorOffer 8515 err = json.Unmarshal(*v, &connectorOffer) 8516 if err != nil { 8517 return err 8518 } 8519 rrdacup.ConnectorOffer = connectorOffer 8520 } 8521 case "disableKeyBasedMetadataWriteAccess": 8522 if v != nil { 8523 var disableKeyBasedMetadataWriteAccess bool 8524 err = json.Unmarshal(*v, &disableKeyBasedMetadataWriteAccess) 8525 if err != nil { 8526 return err 8527 } 8528 rrdacup.DisableKeyBasedMetadataWriteAccess = &disableKeyBasedMetadataWriteAccess 8529 } 8530 case "keyVaultKeyUri": 8531 if v != nil { 8532 var keyVaultKeyURI string 8533 err = json.Unmarshal(*v, &keyVaultKeyURI) 8534 if err != nil { 8535 return err 8536 } 8537 rrdacup.KeyVaultKeyURI = &keyVaultKeyURI 8538 } 8539 case "publicNetworkAccess": 8540 if v != nil { 8541 var publicNetworkAccess PublicNetworkAccess 8542 err = json.Unmarshal(*v, &publicNetworkAccess) 8543 if err != nil { 8544 return err 8545 } 8546 rrdacup.PublicNetworkAccess = publicNetworkAccess 8547 } 8548 case "enableFreeTier": 8549 if v != nil { 8550 var enableFreeTier bool 8551 err = json.Unmarshal(*v, &enableFreeTier) 8552 if err != nil { 8553 return err 8554 } 8555 rrdacup.EnableFreeTier = &enableFreeTier 8556 } 8557 case "apiProperties": 8558 if v != nil { 8559 var APIProperties APIProperties 8560 err = json.Unmarshal(*v, &APIProperties) 8561 if err != nil { 8562 return err 8563 } 8564 rrdacup.APIProperties = &APIProperties 8565 } 8566 case "enableAnalyticalStorage": 8567 if v != nil { 8568 var enableAnalyticalStorage bool 8569 err = json.Unmarshal(*v, &enableAnalyticalStorage) 8570 if err != nil { 8571 return err 8572 } 8573 rrdacup.EnableAnalyticalStorage = &enableAnalyticalStorage 8574 } 8575 case "backupPolicy": 8576 if v != nil { 8577 backupPolicy, err := unmarshalBasicBackupPolicy(*v) 8578 if err != nil { 8579 return err 8580 } 8581 rrdacup.BackupPolicy = backupPolicy 8582 } 8583 case "cors": 8584 if v != nil { 8585 var cors []CorsPolicy 8586 err = json.Unmarshal(*v, &cors) 8587 if err != nil { 8588 return err 8589 } 8590 rrdacup.Cors = &cors 8591 } 8592 case "networkAclBypass": 8593 if v != nil { 8594 var networkACLBypass NetworkACLBypass 8595 err = json.Unmarshal(*v, &networkACLBypass) 8596 if err != nil { 8597 return err 8598 } 8599 rrdacup.NetworkACLBypass = networkACLBypass 8600 } 8601 case "networkAclBypassResourceIds": 8602 if v != nil { 8603 var networkACLBypassResourceIds []string 8604 err = json.Unmarshal(*v, &networkACLBypassResourceIds) 8605 if err != nil { 8606 return err 8607 } 8608 rrdacup.NetworkACLBypassResourceIds = &networkACLBypassResourceIds 8609 } 8610 case "createMode": 8611 if v != nil { 8612 var createMode CreateModeBasicDatabaseAccountCreateUpdateProperties 8613 err = json.Unmarshal(*v, &createMode) 8614 if err != nil { 8615 return err 8616 } 8617 rrdacup.CreateMode = createMode 8618 } 8619 } 8620 } 8621 8622 return nil 8623} 8624 8625// SeedNode ... 8626type SeedNode struct { 8627 // IPAddress - IP address of this seed node. 8628 IPAddress *string `json:"ipAddress,omitempty"` 8629} 8630 8631// SpatialSpec ... 8632type SpatialSpec struct { 8633 // Path - The path for which the indexing behavior applies to. Index paths typically start with root and end with wildcard (/path/*) 8634 Path *string `json:"path,omitempty"` 8635 // Types - List of path's spatial type 8636 Types *[]SpatialType `json:"types,omitempty"` 8637} 8638 8639// SQLContainerCreateUpdateParameters parameters to create and update Cosmos DB container. 8640type SQLContainerCreateUpdateParameters struct { 8641 // SQLContainerCreateUpdateProperties - Properties to create and update Azure Cosmos DB container. 8642 *SQLContainerCreateUpdateProperties `json:"properties,omitempty"` 8643 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 8644 ID *string `json:"id,omitempty"` 8645 // Name - READ-ONLY; The name of the ARM resource. 8646 Name *string `json:"name,omitempty"` 8647 // Type - READ-ONLY; The type of Azure resource. 8648 Type *string `json:"type,omitempty"` 8649 // Location - The location of the resource group to which the resource belongs. 8650 Location *string `json:"location,omitempty"` 8651 Tags map[string]*string `json:"tags"` 8652 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 8653} 8654 8655// MarshalJSON is the custom marshaler for SQLContainerCreateUpdateParameters. 8656func (sccup SQLContainerCreateUpdateParameters) MarshalJSON() ([]byte, error) { 8657 objectMap := make(map[string]interface{}) 8658 if sccup.SQLContainerCreateUpdateProperties != nil { 8659 objectMap["properties"] = sccup.SQLContainerCreateUpdateProperties 8660 } 8661 if sccup.Location != nil { 8662 objectMap["location"] = sccup.Location 8663 } 8664 if sccup.Tags != nil { 8665 objectMap["tags"] = sccup.Tags 8666 } 8667 if sccup.Identity != nil { 8668 objectMap["identity"] = sccup.Identity 8669 } 8670 return json.Marshal(objectMap) 8671} 8672 8673// UnmarshalJSON is the custom unmarshaler for SQLContainerCreateUpdateParameters struct. 8674func (sccup *SQLContainerCreateUpdateParameters) UnmarshalJSON(body []byte) error { 8675 var m map[string]*json.RawMessage 8676 err := json.Unmarshal(body, &m) 8677 if err != nil { 8678 return err 8679 } 8680 for k, v := range m { 8681 switch k { 8682 case "properties": 8683 if v != nil { 8684 var SQLContainerCreateUpdateProperties SQLContainerCreateUpdateProperties 8685 err = json.Unmarshal(*v, &SQLContainerCreateUpdateProperties) 8686 if err != nil { 8687 return err 8688 } 8689 sccup.SQLContainerCreateUpdateProperties = &SQLContainerCreateUpdateProperties 8690 } 8691 case "id": 8692 if v != nil { 8693 var ID string 8694 err = json.Unmarshal(*v, &ID) 8695 if err != nil { 8696 return err 8697 } 8698 sccup.ID = &ID 8699 } 8700 case "name": 8701 if v != nil { 8702 var name string 8703 err = json.Unmarshal(*v, &name) 8704 if err != nil { 8705 return err 8706 } 8707 sccup.Name = &name 8708 } 8709 case "type": 8710 if v != nil { 8711 var typeVar string 8712 err = json.Unmarshal(*v, &typeVar) 8713 if err != nil { 8714 return err 8715 } 8716 sccup.Type = &typeVar 8717 } 8718 case "location": 8719 if v != nil { 8720 var location string 8721 err = json.Unmarshal(*v, &location) 8722 if err != nil { 8723 return err 8724 } 8725 sccup.Location = &location 8726 } 8727 case "tags": 8728 if v != nil { 8729 var tags map[string]*string 8730 err = json.Unmarshal(*v, &tags) 8731 if err != nil { 8732 return err 8733 } 8734 sccup.Tags = tags 8735 } 8736 case "identity": 8737 if v != nil { 8738 var identity ManagedServiceIdentity 8739 err = json.Unmarshal(*v, &identity) 8740 if err != nil { 8741 return err 8742 } 8743 sccup.Identity = &identity 8744 } 8745 } 8746 } 8747 8748 return nil 8749} 8750 8751// SQLContainerCreateUpdateProperties properties to create and update Azure Cosmos DB container. 8752type SQLContainerCreateUpdateProperties struct { 8753 // Resource - The standard JSON format of a container 8754 Resource *SQLContainerResource `json:"resource,omitempty"` 8755 // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. 8756 Options *CreateUpdateOptions `json:"options,omitempty"` 8757} 8758 8759// SQLContainerGetProperties the properties of an Azure Cosmos DB container 8760type SQLContainerGetProperties struct { 8761 Resource *SQLContainerGetPropertiesResource `json:"resource,omitempty"` 8762 Options *SQLContainerGetPropertiesOptions `json:"options,omitempty"` 8763} 8764 8765// SQLContainerGetPropertiesOptions ... 8766type SQLContainerGetPropertiesOptions struct { 8767 // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. 8768 Throughput *int32 `json:"throughput,omitempty"` 8769 // AutoscaleSettings - Specifies the Autoscale settings. 8770 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` 8771} 8772 8773// SQLContainerGetPropertiesResource ... 8774type SQLContainerGetPropertiesResource struct { 8775 // ID - Name of the Cosmos DB SQL container 8776 ID *string `json:"id,omitempty"` 8777 // IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container 8778 IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` 8779 // PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions 8780 PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` 8781 // DefaultTTL - Default time to live 8782 DefaultTTL *int32 `json:"defaultTtl,omitempty"` 8783 // UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. 8784 UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` 8785 // ConflictResolutionPolicy - The conflict resolution policy for the container. 8786 ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` 8787 // AnalyticalStorageTTL - Analytical TTL. 8788 AnalyticalStorageTTL *int64 `json:"analyticalStorageTtl,omitempty"` 8789 // Rid - READ-ONLY; A system generated property. A unique identifier. 8790 Rid *string `json:"_rid,omitempty"` 8791 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 8792 Ts *float64 `json:"_ts,omitempty"` 8793 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 8794 Etag *string `json:"_etag,omitempty"` 8795} 8796 8797// MarshalJSON is the custom marshaler for SQLContainerGetPropertiesResource. 8798func (scgp SQLContainerGetPropertiesResource) MarshalJSON() ([]byte, error) { 8799 objectMap := make(map[string]interface{}) 8800 if scgp.ID != nil { 8801 objectMap["id"] = scgp.ID 8802 } 8803 if scgp.IndexingPolicy != nil { 8804 objectMap["indexingPolicy"] = scgp.IndexingPolicy 8805 } 8806 if scgp.PartitionKey != nil { 8807 objectMap["partitionKey"] = scgp.PartitionKey 8808 } 8809 if scgp.DefaultTTL != nil { 8810 objectMap["defaultTtl"] = scgp.DefaultTTL 8811 } 8812 if scgp.UniqueKeyPolicy != nil { 8813 objectMap["uniqueKeyPolicy"] = scgp.UniqueKeyPolicy 8814 } 8815 if scgp.ConflictResolutionPolicy != nil { 8816 objectMap["conflictResolutionPolicy"] = scgp.ConflictResolutionPolicy 8817 } 8818 if scgp.AnalyticalStorageTTL != nil { 8819 objectMap["analyticalStorageTtl"] = scgp.AnalyticalStorageTTL 8820 } 8821 return json.Marshal(objectMap) 8822} 8823 8824// SQLContainerGetResults an Azure Cosmos DB container. 8825type SQLContainerGetResults struct { 8826 autorest.Response `json:"-"` 8827 // SQLContainerGetProperties - The properties of an Azure Cosmos DB container 8828 *SQLContainerGetProperties `json:"properties,omitempty"` 8829 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 8830 ID *string `json:"id,omitempty"` 8831 // Name - READ-ONLY; The name of the ARM resource. 8832 Name *string `json:"name,omitempty"` 8833 // Type - READ-ONLY; The type of Azure resource. 8834 Type *string `json:"type,omitempty"` 8835 // Location - The location of the resource group to which the resource belongs. 8836 Location *string `json:"location,omitempty"` 8837 Tags map[string]*string `json:"tags"` 8838 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 8839} 8840 8841// MarshalJSON is the custom marshaler for SQLContainerGetResults. 8842func (scgr SQLContainerGetResults) MarshalJSON() ([]byte, error) { 8843 objectMap := make(map[string]interface{}) 8844 if scgr.SQLContainerGetProperties != nil { 8845 objectMap["properties"] = scgr.SQLContainerGetProperties 8846 } 8847 if scgr.Location != nil { 8848 objectMap["location"] = scgr.Location 8849 } 8850 if scgr.Tags != nil { 8851 objectMap["tags"] = scgr.Tags 8852 } 8853 if scgr.Identity != nil { 8854 objectMap["identity"] = scgr.Identity 8855 } 8856 return json.Marshal(objectMap) 8857} 8858 8859// UnmarshalJSON is the custom unmarshaler for SQLContainerGetResults struct. 8860func (scgr *SQLContainerGetResults) UnmarshalJSON(body []byte) error { 8861 var m map[string]*json.RawMessage 8862 err := json.Unmarshal(body, &m) 8863 if err != nil { 8864 return err 8865 } 8866 for k, v := range m { 8867 switch k { 8868 case "properties": 8869 if v != nil { 8870 var SQLContainerGetProperties SQLContainerGetProperties 8871 err = json.Unmarshal(*v, &SQLContainerGetProperties) 8872 if err != nil { 8873 return err 8874 } 8875 scgr.SQLContainerGetProperties = &SQLContainerGetProperties 8876 } 8877 case "id": 8878 if v != nil { 8879 var ID string 8880 err = json.Unmarshal(*v, &ID) 8881 if err != nil { 8882 return err 8883 } 8884 scgr.ID = &ID 8885 } 8886 case "name": 8887 if v != nil { 8888 var name string 8889 err = json.Unmarshal(*v, &name) 8890 if err != nil { 8891 return err 8892 } 8893 scgr.Name = &name 8894 } 8895 case "type": 8896 if v != nil { 8897 var typeVar string 8898 err = json.Unmarshal(*v, &typeVar) 8899 if err != nil { 8900 return err 8901 } 8902 scgr.Type = &typeVar 8903 } 8904 case "location": 8905 if v != nil { 8906 var location string 8907 err = json.Unmarshal(*v, &location) 8908 if err != nil { 8909 return err 8910 } 8911 scgr.Location = &location 8912 } 8913 case "tags": 8914 if v != nil { 8915 var tags map[string]*string 8916 err = json.Unmarshal(*v, &tags) 8917 if err != nil { 8918 return err 8919 } 8920 scgr.Tags = tags 8921 } 8922 case "identity": 8923 if v != nil { 8924 var identity ManagedServiceIdentity 8925 err = json.Unmarshal(*v, &identity) 8926 if err != nil { 8927 return err 8928 } 8929 scgr.Identity = &identity 8930 } 8931 } 8932 } 8933 8934 return nil 8935} 8936 8937// SQLContainerListResult the List operation response, that contains the containers and their properties. 8938type SQLContainerListResult struct { 8939 autorest.Response `json:"-"` 8940 // Value - READ-ONLY; List of containers and their properties. 8941 Value *[]SQLContainerGetResults `json:"value,omitempty"` 8942} 8943 8944// MarshalJSON is the custom marshaler for SQLContainerListResult. 8945func (sclr SQLContainerListResult) MarshalJSON() ([]byte, error) { 8946 objectMap := make(map[string]interface{}) 8947 return json.Marshal(objectMap) 8948} 8949 8950// SQLContainerResource cosmos DB SQL container resource object 8951type SQLContainerResource struct { 8952 // ID - Name of the Cosmos DB SQL container 8953 ID *string `json:"id,omitempty"` 8954 // IndexingPolicy - The configuration of the indexing policy. By default, the indexing is automatic for all document paths within the container 8955 IndexingPolicy *IndexingPolicy `json:"indexingPolicy,omitempty"` 8956 // PartitionKey - The configuration of the partition key to be used for partitioning data into multiple partitions 8957 PartitionKey *ContainerPartitionKey `json:"partitionKey,omitempty"` 8958 // DefaultTTL - Default time to live 8959 DefaultTTL *int32 `json:"defaultTtl,omitempty"` 8960 // UniqueKeyPolicy - The unique key policy configuration for specifying uniqueness constraints on documents in the collection in the Azure Cosmos DB service. 8961 UniqueKeyPolicy *UniqueKeyPolicy `json:"uniqueKeyPolicy,omitempty"` 8962 // ConflictResolutionPolicy - The conflict resolution policy for the container. 8963 ConflictResolutionPolicy *ConflictResolutionPolicy `json:"conflictResolutionPolicy,omitempty"` 8964 // AnalyticalStorageTTL - Analytical TTL. 8965 AnalyticalStorageTTL *int64 `json:"analyticalStorageTtl,omitempty"` 8966} 8967 8968// SQLDatabaseCreateUpdateParameters parameters to create and update Cosmos DB SQL database. 8969type SQLDatabaseCreateUpdateParameters struct { 8970 // SQLDatabaseCreateUpdateProperties - Properties to create and update Azure Cosmos DB SQL database. 8971 *SQLDatabaseCreateUpdateProperties `json:"properties,omitempty"` 8972 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 8973 ID *string `json:"id,omitempty"` 8974 // Name - READ-ONLY; The name of the ARM resource. 8975 Name *string `json:"name,omitempty"` 8976 // Type - READ-ONLY; The type of Azure resource. 8977 Type *string `json:"type,omitempty"` 8978 // Location - The location of the resource group to which the resource belongs. 8979 Location *string `json:"location,omitempty"` 8980 Tags map[string]*string `json:"tags"` 8981 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 8982} 8983 8984// MarshalJSON is the custom marshaler for SQLDatabaseCreateUpdateParameters. 8985func (sdcup SQLDatabaseCreateUpdateParameters) MarshalJSON() ([]byte, error) { 8986 objectMap := make(map[string]interface{}) 8987 if sdcup.SQLDatabaseCreateUpdateProperties != nil { 8988 objectMap["properties"] = sdcup.SQLDatabaseCreateUpdateProperties 8989 } 8990 if sdcup.Location != nil { 8991 objectMap["location"] = sdcup.Location 8992 } 8993 if sdcup.Tags != nil { 8994 objectMap["tags"] = sdcup.Tags 8995 } 8996 if sdcup.Identity != nil { 8997 objectMap["identity"] = sdcup.Identity 8998 } 8999 return json.Marshal(objectMap) 9000} 9001 9002// UnmarshalJSON is the custom unmarshaler for SQLDatabaseCreateUpdateParameters struct. 9003func (sdcup *SQLDatabaseCreateUpdateParameters) UnmarshalJSON(body []byte) error { 9004 var m map[string]*json.RawMessage 9005 err := json.Unmarshal(body, &m) 9006 if err != nil { 9007 return err 9008 } 9009 for k, v := range m { 9010 switch k { 9011 case "properties": 9012 if v != nil { 9013 var SQLDatabaseCreateUpdateProperties SQLDatabaseCreateUpdateProperties 9014 err = json.Unmarshal(*v, &SQLDatabaseCreateUpdateProperties) 9015 if err != nil { 9016 return err 9017 } 9018 sdcup.SQLDatabaseCreateUpdateProperties = &SQLDatabaseCreateUpdateProperties 9019 } 9020 case "id": 9021 if v != nil { 9022 var ID string 9023 err = json.Unmarshal(*v, &ID) 9024 if err != nil { 9025 return err 9026 } 9027 sdcup.ID = &ID 9028 } 9029 case "name": 9030 if v != nil { 9031 var name string 9032 err = json.Unmarshal(*v, &name) 9033 if err != nil { 9034 return err 9035 } 9036 sdcup.Name = &name 9037 } 9038 case "type": 9039 if v != nil { 9040 var typeVar string 9041 err = json.Unmarshal(*v, &typeVar) 9042 if err != nil { 9043 return err 9044 } 9045 sdcup.Type = &typeVar 9046 } 9047 case "location": 9048 if v != nil { 9049 var location string 9050 err = json.Unmarshal(*v, &location) 9051 if err != nil { 9052 return err 9053 } 9054 sdcup.Location = &location 9055 } 9056 case "tags": 9057 if v != nil { 9058 var tags map[string]*string 9059 err = json.Unmarshal(*v, &tags) 9060 if err != nil { 9061 return err 9062 } 9063 sdcup.Tags = tags 9064 } 9065 case "identity": 9066 if v != nil { 9067 var identity ManagedServiceIdentity 9068 err = json.Unmarshal(*v, &identity) 9069 if err != nil { 9070 return err 9071 } 9072 sdcup.Identity = &identity 9073 } 9074 } 9075 } 9076 9077 return nil 9078} 9079 9080// SQLDatabaseCreateUpdateProperties properties to create and update Azure Cosmos DB SQL database. 9081type SQLDatabaseCreateUpdateProperties struct { 9082 // Resource - The standard JSON format of a SQL database 9083 Resource *SQLDatabaseResource `json:"resource,omitempty"` 9084 // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. 9085 Options *CreateUpdateOptions `json:"options,omitempty"` 9086} 9087 9088// SQLDatabaseGetProperties the properties of an Azure Cosmos DB SQL database 9089type SQLDatabaseGetProperties struct { 9090 Resource *SQLDatabaseGetPropertiesResource `json:"resource,omitempty"` 9091 Options *SQLDatabaseGetPropertiesOptions `json:"options,omitempty"` 9092} 9093 9094// SQLDatabaseGetPropertiesOptions ... 9095type SQLDatabaseGetPropertiesOptions struct { 9096 // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. 9097 Throughput *int32 `json:"throughput,omitempty"` 9098 // AutoscaleSettings - Specifies the Autoscale settings. 9099 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` 9100} 9101 9102// SQLDatabaseGetPropertiesResource ... 9103type SQLDatabaseGetPropertiesResource struct { 9104 // ID - Name of the Cosmos DB SQL database 9105 ID *string `json:"id,omitempty"` 9106 // Rid - READ-ONLY; A system generated property. A unique identifier. 9107 Rid *string `json:"_rid,omitempty"` 9108 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 9109 Ts *float64 `json:"_ts,omitempty"` 9110 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 9111 Etag *string `json:"_etag,omitempty"` 9112 // Colls - A system generated property that specified the addressable path of the collections resource. 9113 Colls *string `json:"_colls,omitempty"` 9114 // Users - A system generated property that specifies the addressable path of the users resource. 9115 Users *string `json:"_users,omitempty"` 9116} 9117 9118// MarshalJSON is the custom marshaler for SQLDatabaseGetPropertiesResource. 9119func (sdgp SQLDatabaseGetPropertiesResource) MarshalJSON() ([]byte, error) { 9120 objectMap := make(map[string]interface{}) 9121 if sdgp.ID != nil { 9122 objectMap["id"] = sdgp.ID 9123 } 9124 if sdgp.Colls != nil { 9125 objectMap["_colls"] = sdgp.Colls 9126 } 9127 if sdgp.Users != nil { 9128 objectMap["_users"] = sdgp.Users 9129 } 9130 return json.Marshal(objectMap) 9131} 9132 9133// SQLDatabaseGetResults an Azure Cosmos DB SQL database. 9134type SQLDatabaseGetResults struct { 9135 autorest.Response `json:"-"` 9136 // SQLDatabaseGetProperties - The properties of an Azure Cosmos DB SQL database 9137 *SQLDatabaseGetProperties `json:"properties,omitempty"` 9138 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 9139 ID *string `json:"id,omitempty"` 9140 // Name - READ-ONLY; The name of the ARM resource. 9141 Name *string `json:"name,omitempty"` 9142 // Type - READ-ONLY; The type of Azure resource. 9143 Type *string `json:"type,omitempty"` 9144 // Location - The location of the resource group to which the resource belongs. 9145 Location *string `json:"location,omitempty"` 9146 Tags map[string]*string `json:"tags"` 9147 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 9148} 9149 9150// MarshalJSON is the custom marshaler for SQLDatabaseGetResults. 9151func (sdgr SQLDatabaseGetResults) MarshalJSON() ([]byte, error) { 9152 objectMap := make(map[string]interface{}) 9153 if sdgr.SQLDatabaseGetProperties != nil { 9154 objectMap["properties"] = sdgr.SQLDatabaseGetProperties 9155 } 9156 if sdgr.Location != nil { 9157 objectMap["location"] = sdgr.Location 9158 } 9159 if sdgr.Tags != nil { 9160 objectMap["tags"] = sdgr.Tags 9161 } 9162 if sdgr.Identity != nil { 9163 objectMap["identity"] = sdgr.Identity 9164 } 9165 return json.Marshal(objectMap) 9166} 9167 9168// UnmarshalJSON is the custom unmarshaler for SQLDatabaseGetResults struct. 9169func (sdgr *SQLDatabaseGetResults) UnmarshalJSON(body []byte) error { 9170 var m map[string]*json.RawMessage 9171 err := json.Unmarshal(body, &m) 9172 if err != nil { 9173 return err 9174 } 9175 for k, v := range m { 9176 switch k { 9177 case "properties": 9178 if v != nil { 9179 var SQLDatabaseGetProperties SQLDatabaseGetProperties 9180 err = json.Unmarshal(*v, &SQLDatabaseGetProperties) 9181 if err != nil { 9182 return err 9183 } 9184 sdgr.SQLDatabaseGetProperties = &SQLDatabaseGetProperties 9185 } 9186 case "id": 9187 if v != nil { 9188 var ID string 9189 err = json.Unmarshal(*v, &ID) 9190 if err != nil { 9191 return err 9192 } 9193 sdgr.ID = &ID 9194 } 9195 case "name": 9196 if v != nil { 9197 var name string 9198 err = json.Unmarshal(*v, &name) 9199 if err != nil { 9200 return err 9201 } 9202 sdgr.Name = &name 9203 } 9204 case "type": 9205 if v != nil { 9206 var typeVar string 9207 err = json.Unmarshal(*v, &typeVar) 9208 if err != nil { 9209 return err 9210 } 9211 sdgr.Type = &typeVar 9212 } 9213 case "location": 9214 if v != nil { 9215 var location string 9216 err = json.Unmarshal(*v, &location) 9217 if err != nil { 9218 return err 9219 } 9220 sdgr.Location = &location 9221 } 9222 case "tags": 9223 if v != nil { 9224 var tags map[string]*string 9225 err = json.Unmarshal(*v, &tags) 9226 if err != nil { 9227 return err 9228 } 9229 sdgr.Tags = tags 9230 } 9231 case "identity": 9232 if v != nil { 9233 var identity ManagedServiceIdentity 9234 err = json.Unmarshal(*v, &identity) 9235 if err != nil { 9236 return err 9237 } 9238 sdgr.Identity = &identity 9239 } 9240 } 9241 } 9242 9243 return nil 9244} 9245 9246// SQLDatabaseListResult the List operation response, that contains the SQL databases and their properties. 9247type SQLDatabaseListResult struct { 9248 autorest.Response `json:"-"` 9249 // Value - READ-ONLY; List of SQL databases and their properties. 9250 Value *[]SQLDatabaseGetResults `json:"value,omitempty"` 9251} 9252 9253// MarshalJSON is the custom marshaler for SQLDatabaseListResult. 9254func (sdlr SQLDatabaseListResult) MarshalJSON() ([]byte, error) { 9255 objectMap := make(map[string]interface{}) 9256 return json.Marshal(objectMap) 9257} 9258 9259// SQLDatabaseResource cosmos DB SQL database resource object 9260type SQLDatabaseResource struct { 9261 // ID - Name of the Cosmos DB SQL database 9262 ID *string `json:"id,omitempty"` 9263} 9264 9265// SQLResourcesCreateUpdateSQLContainerFuture an abstraction for monitoring and retrieving the results of a 9266// long-running operation. 9267type SQLResourcesCreateUpdateSQLContainerFuture struct { 9268 azure.FutureAPI 9269 // Result returns the result of the asynchronous operation. 9270 // If the operation has not completed it will return an error. 9271 Result func(SQLResourcesClient) (SQLContainerGetResults, error) 9272} 9273 9274// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9275func (future *SQLResourcesCreateUpdateSQLContainerFuture) UnmarshalJSON(body []byte) error { 9276 var azFuture azure.Future 9277 if err := json.Unmarshal(body, &azFuture); err != nil { 9278 return err 9279 } 9280 future.FutureAPI = &azFuture 9281 future.Result = future.result 9282 return nil 9283} 9284 9285// result is the default implementation for SQLResourcesCreateUpdateSQLContainerFuture.Result. 9286func (future *SQLResourcesCreateUpdateSQLContainerFuture) result(client SQLResourcesClient) (scgr SQLContainerGetResults, err error) { 9287 var done bool 9288 done, err = future.DoneWithContext(context.Background(), client) 9289 if err != nil { 9290 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLContainerFuture", "Result", future.Response(), "Polling failure") 9291 return 9292 } 9293 if !done { 9294 scgr.Response.Response = future.Response() 9295 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLContainerFuture") 9296 return 9297 } 9298 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9299 if scgr.Response.Response, err = future.GetResult(sender); err == nil && scgr.Response.Response.StatusCode != http.StatusNoContent { 9300 scgr, err = client.CreateUpdateSQLContainerResponder(scgr.Response.Response) 9301 if err != nil { 9302 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLContainerFuture", "Result", scgr.Response.Response, "Failure responding to request") 9303 } 9304 } 9305 return 9306} 9307 9308// SQLResourcesCreateUpdateSQLDatabaseFuture an abstraction for monitoring and retrieving the results of a 9309// long-running operation. 9310type SQLResourcesCreateUpdateSQLDatabaseFuture struct { 9311 azure.FutureAPI 9312 // Result returns the result of the asynchronous operation. 9313 // If the operation has not completed it will return an error. 9314 Result func(SQLResourcesClient) (SQLDatabaseGetResults, error) 9315} 9316 9317// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9318func (future *SQLResourcesCreateUpdateSQLDatabaseFuture) UnmarshalJSON(body []byte) error { 9319 var azFuture azure.Future 9320 if err := json.Unmarshal(body, &azFuture); err != nil { 9321 return err 9322 } 9323 future.FutureAPI = &azFuture 9324 future.Result = future.result 9325 return nil 9326} 9327 9328// result is the default implementation for SQLResourcesCreateUpdateSQLDatabaseFuture.Result. 9329func (future *SQLResourcesCreateUpdateSQLDatabaseFuture) result(client SQLResourcesClient) (sdgr SQLDatabaseGetResults, err error) { 9330 var done bool 9331 done, err = future.DoneWithContext(context.Background(), client) 9332 if err != nil { 9333 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture", "Result", future.Response(), "Polling failure") 9334 return 9335 } 9336 if !done { 9337 sdgr.Response.Response = future.Response() 9338 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture") 9339 return 9340 } 9341 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9342 if sdgr.Response.Response, err = future.GetResult(sender); err == nil && sdgr.Response.Response.StatusCode != http.StatusNoContent { 9343 sdgr, err = client.CreateUpdateSQLDatabaseResponder(sdgr.Response.Response) 9344 if err != nil { 9345 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLDatabaseFuture", "Result", sdgr.Response.Response, "Failure responding to request") 9346 } 9347 } 9348 return 9349} 9350 9351// SQLResourcesCreateUpdateSQLRoleAssignmentFuture an abstraction for monitoring and retrieving the results 9352// of a long-running operation. 9353type SQLResourcesCreateUpdateSQLRoleAssignmentFuture struct { 9354 azure.FutureAPI 9355 // Result returns the result of the asynchronous operation. 9356 // If the operation has not completed it will return an error. 9357 Result func(SQLResourcesClient) (SQLRoleAssignmentGetResults, error) 9358} 9359 9360// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9361func (future *SQLResourcesCreateUpdateSQLRoleAssignmentFuture) UnmarshalJSON(body []byte) error { 9362 var azFuture azure.Future 9363 if err := json.Unmarshal(body, &azFuture); err != nil { 9364 return err 9365 } 9366 future.FutureAPI = &azFuture 9367 future.Result = future.result 9368 return nil 9369} 9370 9371// result is the default implementation for SQLResourcesCreateUpdateSQLRoleAssignmentFuture.Result. 9372func (future *SQLResourcesCreateUpdateSQLRoleAssignmentFuture) result(client SQLResourcesClient) (sragr SQLRoleAssignmentGetResults, err error) { 9373 var done bool 9374 done, err = future.DoneWithContext(context.Background(), client) 9375 if err != nil { 9376 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLRoleAssignmentFuture", "Result", future.Response(), "Polling failure") 9377 return 9378 } 9379 if !done { 9380 sragr.Response.Response = future.Response() 9381 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLRoleAssignmentFuture") 9382 return 9383 } 9384 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9385 if sragr.Response.Response, err = future.GetResult(sender); err == nil && sragr.Response.Response.StatusCode != http.StatusNoContent { 9386 sragr, err = client.CreateUpdateSQLRoleAssignmentResponder(sragr.Response.Response) 9387 if err != nil { 9388 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLRoleAssignmentFuture", "Result", sragr.Response.Response, "Failure responding to request") 9389 } 9390 } 9391 return 9392} 9393 9394// SQLResourcesCreateUpdateSQLRoleDefinitionFuture an abstraction for monitoring and retrieving the results 9395// of a long-running operation. 9396type SQLResourcesCreateUpdateSQLRoleDefinitionFuture struct { 9397 azure.FutureAPI 9398 // Result returns the result of the asynchronous operation. 9399 // If the operation has not completed it will return an error. 9400 Result func(SQLResourcesClient) (SQLRoleDefinitionGetResults, error) 9401} 9402 9403// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9404func (future *SQLResourcesCreateUpdateSQLRoleDefinitionFuture) UnmarshalJSON(body []byte) error { 9405 var azFuture azure.Future 9406 if err := json.Unmarshal(body, &azFuture); err != nil { 9407 return err 9408 } 9409 future.FutureAPI = &azFuture 9410 future.Result = future.result 9411 return nil 9412} 9413 9414// result is the default implementation for SQLResourcesCreateUpdateSQLRoleDefinitionFuture.Result. 9415func (future *SQLResourcesCreateUpdateSQLRoleDefinitionFuture) result(client SQLResourcesClient) (srdgr SQLRoleDefinitionGetResults, err error) { 9416 var done bool 9417 done, err = future.DoneWithContext(context.Background(), client) 9418 if err != nil { 9419 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLRoleDefinitionFuture", "Result", future.Response(), "Polling failure") 9420 return 9421 } 9422 if !done { 9423 srdgr.Response.Response = future.Response() 9424 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLRoleDefinitionFuture") 9425 return 9426 } 9427 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9428 if srdgr.Response.Response, err = future.GetResult(sender); err == nil && srdgr.Response.Response.StatusCode != http.StatusNoContent { 9429 srdgr, err = client.CreateUpdateSQLRoleDefinitionResponder(srdgr.Response.Response) 9430 if err != nil { 9431 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLRoleDefinitionFuture", "Result", srdgr.Response.Response, "Failure responding to request") 9432 } 9433 } 9434 return 9435} 9436 9437// SQLResourcesCreateUpdateSQLStoredProcedureFuture an abstraction for monitoring and retrieving the 9438// results of a long-running operation. 9439type SQLResourcesCreateUpdateSQLStoredProcedureFuture struct { 9440 azure.FutureAPI 9441 // Result returns the result of the asynchronous operation. 9442 // If the operation has not completed it will return an error. 9443 Result func(SQLResourcesClient) (SQLStoredProcedureGetResults, error) 9444} 9445 9446// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9447func (future *SQLResourcesCreateUpdateSQLStoredProcedureFuture) UnmarshalJSON(body []byte) error { 9448 var azFuture azure.Future 9449 if err := json.Unmarshal(body, &azFuture); err != nil { 9450 return err 9451 } 9452 future.FutureAPI = &azFuture 9453 future.Result = future.result 9454 return nil 9455} 9456 9457// result is the default implementation for SQLResourcesCreateUpdateSQLStoredProcedureFuture.Result. 9458func (future *SQLResourcesCreateUpdateSQLStoredProcedureFuture) result(client SQLResourcesClient) (sspgr SQLStoredProcedureGetResults, err error) { 9459 var done bool 9460 done, err = future.DoneWithContext(context.Background(), client) 9461 if err != nil { 9462 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture", "Result", future.Response(), "Polling failure") 9463 return 9464 } 9465 if !done { 9466 sspgr.Response.Response = future.Response() 9467 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture") 9468 return 9469 } 9470 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9471 if sspgr.Response.Response, err = future.GetResult(sender); err == nil && sspgr.Response.Response.StatusCode != http.StatusNoContent { 9472 sspgr, err = client.CreateUpdateSQLStoredProcedureResponder(sspgr.Response.Response) 9473 if err != nil { 9474 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLStoredProcedureFuture", "Result", sspgr.Response.Response, "Failure responding to request") 9475 } 9476 } 9477 return 9478} 9479 9480// SQLResourcesCreateUpdateSQLTriggerFuture an abstraction for monitoring and retrieving the results of a 9481// long-running operation. 9482type SQLResourcesCreateUpdateSQLTriggerFuture struct { 9483 azure.FutureAPI 9484 // Result returns the result of the asynchronous operation. 9485 // If the operation has not completed it will return an error. 9486 Result func(SQLResourcesClient) (SQLTriggerGetResults, error) 9487} 9488 9489// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9490func (future *SQLResourcesCreateUpdateSQLTriggerFuture) UnmarshalJSON(body []byte) error { 9491 var azFuture azure.Future 9492 if err := json.Unmarshal(body, &azFuture); err != nil { 9493 return err 9494 } 9495 future.FutureAPI = &azFuture 9496 future.Result = future.result 9497 return nil 9498} 9499 9500// result is the default implementation for SQLResourcesCreateUpdateSQLTriggerFuture.Result. 9501func (future *SQLResourcesCreateUpdateSQLTriggerFuture) result(client SQLResourcesClient) (stgr SQLTriggerGetResults, err error) { 9502 var done bool 9503 done, err = future.DoneWithContext(context.Background(), client) 9504 if err != nil { 9505 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLTriggerFuture", "Result", future.Response(), "Polling failure") 9506 return 9507 } 9508 if !done { 9509 stgr.Response.Response = future.Response() 9510 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLTriggerFuture") 9511 return 9512 } 9513 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9514 if stgr.Response.Response, err = future.GetResult(sender); err == nil && stgr.Response.Response.StatusCode != http.StatusNoContent { 9515 stgr, err = client.CreateUpdateSQLTriggerResponder(stgr.Response.Response) 9516 if err != nil { 9517 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLTriggerFuture", "Result", stgr.Response.Response, "Failure responding to request") 9518 } 9519 } 9520 return 9521} 9522 9523// SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture an abstraction for monitoring and retrieving the 9524// results of a long-running operation. 9525type SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture struct { 9526 azure.FutureAPI 9527 // Result returns the result of the asynchronous operation. 9528 // If the operation has not completed it will return an error. 9529 Result func(SQLResourcesClient) (SQLUserDefinedFunctionGetResults, error) 9530} 9531 9532// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9533func (future *SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture) UnmarshalJSON(body []byte) error { 9534 var azFuture azure.Future 9535 if err := json.Unmarshal(body, &azFuture); err != nil { 9536 return err 9537 } 9538 future.FutureAPI = &azFuture 9539 future.Result = future.result 9540 return nil 9541} 9542 9543// result is the default implementation for SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture.Result. 9544func (future *SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture) result(client SQLResourcesClient) (sudfgr SQLUserDefinedFunctionGetResults, err error) { 9545 var done bool 9546 done, err = future.DoneWithContext(context.Background(), client) 9547 if err != nil { 9548 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture", "Result", future.Response(), "Polling failure") 9549 return 9550 } 9551 if !done { 9552 sudfgr.Response.Response = future.Response() 9553 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture") 9554 return 9555 } 9556 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9557 if sudfgr.Response.Response, err = future.GetResult(sender); err == nil && sudfgr.Response.Response.StatusCode != http.StatusNoContent { 9558 sudfgr, err = client.CreateUpdateSQLUserDefinedFunctionResponder(sudfgr.Response.Response) 9559 if err != nil { 9560 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesCreateUpdateSQLUserDefinedFunctionFuture", "Result", sudfgr.Response.Response, "Failure responding to request") 9561 } 9562 } 9563 return 9564} 9565 9566// SQLResourcesDeleteSQLContainerFuture an abstraction for monitoring and retrieving the results of a 9567// long-running operation. 9568type SQLResourcesDeleteSQLContainerFuture struct { 9569 azure.FutureAPI 9570 // Result returns the result of the asynchronous operation. 9571 // If the operation has not completed it will return an error. 9572 Result func(SQLResourcesClient) (autorest.Response, error) 9573} 9574 9575// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9576func (future *SQLResourcesDeleteSQLContainerFuture) UnmarshalJSON(body []byte) error { 9577 var azFuture azure.Future 9578 if err := json.Unmarshal(body, &azFuture); err != nil { 9579 return err 9580 } 9581 future.FutureAPI = &azFuture 9582 future.Result = future.result 9583 return nil 9584} 9585 9586// result is the default implementation for SQLResourcesDeleteSQLContainerFuture.Result. 9587func (future *SQLResourcesDeleteSQLContainerFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { 9588 var done bool 9589 done, err = future.DoneWithContext(context.Background(), client) 9590 if err != nil { 9591 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLContainerFuture", "Result", future.Response(), "Polling failure") 9592 return 9593 } 9594 if !done { 9595 ar.Response = future.Response() 9596 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLContainerFuture") 9597 return 9598 } 9599 ar.Response = future.Response() 9600 return 9601} 9602 9603// SQLResourcesDeleteSQLDatabaseFuture an abstraction for monitoring and retrieving the results of a 9604// long-running operation. 9605type SQLResourcesDeleteSQLDatabaseFuture struct { 9606 azure.FutureAPI 9607 // Result returns the result of the asynchronous operation. 9608 // If the operation has not completed it will return an error. 9609 Result func(SQLResourcesClient) (autorest.Response, error) 9610} 9611 9612// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9613func (future *SQLResourcesDeleteSQLDatabaseFuture) UnmarshalJSON(body []byte) error { 9614 var azFuture azure.Future 9615 if err := json.Unmarshal(body, &azFuture); err != nil { 9616 return err 9617 } 9618 future.FutureAPI = &azFuture 9619 future.Result = future.result 9620 return nil 9621} 9622 9623// result is the default implementation for SQLResourcesDeleteSQLDatabaseFuture.Result. 9624func (future *SQLResourcesDeleteSQLDatabaseFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { 9625 var done bool 9626 done, err = future.DoneWithContext(context.Background(), client) 9627 if err != nil { 9628 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLDatabaseFuture", "Result", future.Response(), "Polling failure") 9629 return 9630 } 9631 if !done { 9632 ar.Response = future.Response() 9633 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLDatabaseFuture") 9634 return 9635 } 9636 ar.Response = future.Response() 9637 return 9638} 9639 9640// SQLResourcesDeleteSQLRoleAssignmentFuture an abstraction for monitoring and retrieving the results of a 9641// long-running operation. 9642type SQLResourcesDeleteSQLRoleAssignmentFuture struct { 9643 azure.FutureAPI 9644 // Result returns the result of the asynchronous operation. 9645 // If the operation has not completed it will return an error. 9646 Result func(SQLResourcesClient) (autorest.Response, error) 9647} 9648 9649// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9650func (future *SQLResourcesDeleteSQLRoleAssignmentFuture) UnmarshalJSON(body []byte) error { 9651 var azFuture azure.Future 9652 if err := json.Unmarshal(body, &azFuture); err != nil { 9653 return err 9654 } 9655 future.FutureAPI = &azFuture 9656 future.Result = future.result 9657 return nil 9658} 9659 9660// result is the default implementation for SQLResourcesDeleteSQLRoleAssignmentFuture.Result. 9661func (future *SQLResourcesDeleteSQLRoleAssignmentFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { 9662 var done bool 9663 done, err = future.DoneWithContext(context.Background(), client) 9664 if err != nil { 9665 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLRoleAssignmentFuture", "Result", future.Response(), "Polling failure") 9666 return 9667 } 9668 if !done { 9669 ar.Response = future.Response() 9670 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLRoleAssignmentFuture") 9671 return 9672 } 9673 ar.Response = future.Response() 9674 return 9675} 9676 9677// SQLResourcesDeleteSQLRoleDefinitionFuture an abstraction for monitoring and retrieving the results of a 9678// long-running operation. 9679type SQLResourcesDeleteSQLRoleDefinitionFuture struct { 9680 azure.FutureAPI 9681 // Result returns the result of the asynchronous operation. 9682 // If the operation has not completed it will return an error. 9683 Result func(SQLResourcesClient) (autorest.Response, error) 9684} 9685 9686// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9687func (future *SQLResourcesDeleteSQLRoleDefinitionFuture) UnmarshalJSON(body []byte) error { 9688 var azFuture azure.Future 9689 if err := json.Unmarshal(body, &azFuture); err != nil { 9690 return err 9691 } 9692 future.FutureAPI = &azFuture 9693 future.Result = future.result 9694 return nil 9695} 9696 9697// result is the default implementation for SQLResourcesDeleteSQLRoleDefinitionFuture.Result. 9698func (future *SQLResourcesDeleteSQLRoleDefinitionFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { 9699 var done bool 9700 done, err = future.DoneWithContext(context.Background(), client) 9701 if err != nil { 9702 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLRoleDefinitionFuture", "Result", future.Response(), "Polling failure") 9703 return 9704 } 9705 if !done { 9706 ar.Response = future.Response() 9707 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLRoleDefinitionFuture") 9708 return 9709 } 9710 ar.Response = future.Response() 9711 return 9712} 9713 9714// SQLResourcesDeleteSQLStoredProcedureFuture an abstraction for monitoring and retrieving the results of a 9715// long-running operation. 9716type SQLResourcesDeleteSQLStoredProcedureFuture struct { 9717 azure.FutureAPI 9718 // Result returns the result of the asynchronous operation. 9719 // If the operation has not completed it will return an error. 9720 Result func(SQLResourcesClient) (autorest.Response, error) 9721} 9722 9723// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9724func (future *SQLResourcesDeleteSQLStoredProcedureFuture) UnmarshalJSON(body []byte) error { 9725 var azFuture azure.Future 9726 if err := json.Unmarshal(body, &azFuture); err != nil { 9727 return err 9728 } 9729 future.FutureAPI = &azFuture 9730 future.Result = future.result 9731 return nil 9732} 9733 9734// result is the default implementation for SQLResourcesDeleteSQLStoredProcedureFuture.Result. 9735func (future *SQLResourcesDeleteSQLStoredProcedureFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { 9736 var done bool 9737 done, err = future.DoneWithContext(context.Background(), client) 9738 if err != nil { 9739 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLStoredProcedureFuture", "Result", future.Response(), "Polling failure") 9740 return 9741 } 9742 if !done { 9743 ar.Response = future.Response() 9744 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLStoredProcedureFuture") 9745 return 9746 } 9747 ar.Response = future.Response() 9748 return 9749} 9750 9751// SQLResourcesDeleteSQLTriggerFuture an abstraction for monitoring and retrieving the results of a 9752// long-running operation. 9753type SQLResourcesDeleteSQLTriggerFuture struct { 9754 azure.FutureAPI 9755 // Result returns the result of the asynchronous operation. 9756 // If the operation has not completed it will return an error. 9757 Result func(SQLResourcesClient) (autorest.Response, error) 9758} 9759 9760// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9761func (future *SQLResourcesDeleteSQLTriggerFuture) UnmarshalJSON(body []byte) error { 9762 var azFuture azure.Future 9763 if err := json.Unmarshal(body, &azFuture); err != nil { 9764 return err 9765 } 9766 future.FutureAPI = &azFuture 9767 future.Result = future.result 9768 return nil 9769} 9770 9771// result is the default implementation for SQLResourcesDeleteSQLTriggerFuture.Result. 9772func (future *SQLResourcesDeleteSQLTriggerFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { 9773 var done bool 9774 done, err = future.DoneWithContext(context.Background(), client) 9775 if err != nil { 9776 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLTriggerFuture", "Result", future.Response(), "Polling failure") 9777 return 9778 } 9779 if !done { 9780 ar.Response = future.Response() 9781 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLTriggerFuture") 9782 return 9783 } 9784 ar.Response = future.Response() 9785 return 9786} 9787 9788// SQLResourcesDeleteSQLUserDefinedFunctionFuture an abstraction for monitoring and retrieving the results 9789// of a long-running operation. 9790type SQLResourcesDeleteSQLUserDefinedFunctionFuture struct { 9791 azure.FutureAPI 9792 // Result returns the result of the asynchronous operation. 9793 // If the operation has not completed it will return an error. 9794 Result func(SQLResourcesClient) (autorest.Response, error) 9795} 9796 9797// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9798func (future *SQLResourcesDeleteSQLUserDefinedFunctionFuture) UnmarshalJSON(body []byte) error { 9799 var azFuture azure.Future 9800 if err := json.Unmarshal(body, &azFuture); err != nil { 9801 return err 9802 } 9803 future.FutureAPI = &azFuture 9804 future.Result = future.result 9805 return nil 9806} 9807 9808// result is the default implementation for SQLResourcesDeleteSQLUserDefinedFunctionFuture.Result. 9809func (future *SQLResourcesDeleteSQLUserDefinedFunctionFuture) result(client SQLResourcesClient) (ar autorest.Response, err error) { 9810 var done bool 9811 done, err = future.DoneWithContext(context.Background(), client) 9812 if err != nil { 9813 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesDeleteSQLUserDefinedFunctionFuture", "Result", future.Response(), "Polling failure") 9814 return 9815 } 9816 if !done { 9817 ar.Response = future.Response() 9818 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesDeleteSQLUserDefinedFunctionFuture") 9819 return 9820 } 9821 ar.Response = future.Response() 9822 return 9823} 9824 9825// SQLResourcesMigrateSQLContainerToAutoscaleFuture an abstraction for monitoring and retrieving the 9826// results of a long-running operation. 9827type SQLResourcesMigrateSQLContainerToAutoscaleFuture struct { 9828 azure.FutureAPI 9829 // Result returns the result of the asynchronous operation. 9830 // If the operation has not completed it will return an error. 9831 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error) 9832} 9833 9834// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9835func (future *SQLResourcesMigrateSQLContainerToAutoscaleFuture) UnmarshalJSON(body []byte) error { 9836 var azFuture azure.Future 9837 if err := json.Unmarshal(body, &azFuture); err != nil { 9838 return err 9839 } 9840 future.FutureAPI = &azFuture 9841 future.Result = future.result 9842 return nil 9843} 9844 9845// result is the default implementation for SQLResourcesMigrateSQLContainerToAutoscaleFuture.Result. 9846func (future *SQLResourcesMigrateSQLContainerToAutoscaleFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 9847 var done bool 9848 done, err = future.DoneWithContext(context.Background(), client) 9849 if err != nil { 9850 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToAutoscaleFuture", "Result", future.Response(), "Polling failure") 9851 return 9852 } 9853 if !done { 9854 tsgr.Response.Response = future.Response() 9855 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLContainerToAutoscaleFuture") 9856 return 9857 } 9858 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9859 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 9860 tsgr, err = client.MigrateSQLContainerToAutoscaleResponder(tsgr.Response.Response) 9861 if err != nil { 9862 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") 9863 } 9864 } 9865 return 9866} 9867 9868// SQLResourcesMigrateSQLContainerToManualThroughputFuture an abstraction for monitoring and retrieving the 9869// results of a long-running operation. 9870type SQLResourcesMigrateSQLContainerToManualThroughputFuture struct { 9871 azure.FutureAPI 9872 // Result returns the result of the asynchronous operation. 9873 // If the operation has not completed it will return an error. 9874 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error) 9875} 9876 9877// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9878func (future *SQLResourcesMigrateSQLContainerToManualThroughputFuture) UnmarshalJSON(body []byte) error { 9879 var azFuture azure.Future 9880 if err := json.Unmarshal(body, &azFuture); err != nil { 9881 return err 9882 } 9883 future.FutureAPI = &azFuture 9884 future.Result = future.result 9885 return nil 9886} 9887 9888// result is the default implementation for SQLResourcesMigrateSQLContainerToManualThroughputFuture.Result. 9889func (future *SQLResourcesMigrateSQLContainerToManualThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 9890 var done bool 9891 done, err = future.DoneWithContext(context.Background(), client) 9892 if err != nil { 9893 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToManualThroughputFuture", "Result", future.Response(), "Polling failure") 9894 return 9895 } 9896 if !done { 9897 tsgr.Response.Response = future.Response() 9898 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLContainerToManualThroughputFuture") 9899 return 9900 } 9901 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9902 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 9903 tsgr, err = client.MigrateSQLContainerToManualThroughputResponder(tsgr.Response.Response) 9904 if err != nil { 9905 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLContainerToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 9906 } 9907 } 9908 return 9909} 9910 9911// SQLResourcesMigrateSQLDatabaseToAutoscaleFuture an abstraction for monitoring and retrieving the results 9912// of a long-running operation. 9913type SQLResourcesMigrateSQLDatabaseToAutoscaleFuture struct { 9914 azure.FutureAPI 9915 // Result returns the result of the asynchronous operation. 9916 // If the operation has not completed it will return an error. 9917 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error) 9918} 9919 9920// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9921func (future *SQLResourcesMigrateSQLDatabaseToAutoscaleFuture) UnmarshalJSON(body []byte) error { 9922 var azFuture azure.Future 9923 if err := json.Unmarshal(body, &azFuture); err != nil { 9924 return err 9925 } 9926 future.FutureAPI = &azFuture 9927 future.Result = future.result 9928 return nil 9929} 9930 9931// result is the default implementation for SQLResourcesMigrateSQLDatabaseToAutoscaleFuture.Result. 9932func (future *SQLResourcesMigrateSQLDatabaseToAutoscaleFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 9933 var done bool 9934 done, err = future.DoneWithContext(context.Background(), client) 9935 if err != nil { 9936 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToAutoscaleFuture", "Result", future.Response(), "Polling failure") 9937 return 9938 } 9939 if !done { 9940 tsgr.Response.Response = future.Response() 9941 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLDatabaseToAutoscaleFuture") 9942 return 9943 } 9944 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9945 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 9946 tsgr, err = client.MigrateSQLDatabaseToAutoscaleResponder(tsgr.Response.Response) 9947 if err != nil { 9948 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") 9949 } 9950 } 9951 return 9952} 9953 9954// SQLResourcesMigrateSQLDatabaseToManualThroughputFuture an abstraction for monitoring and retrieving the 9955// results of a long-running operation. 9956type SQLResourcesMigrateSQLDatabaseToManualThroughputFuture struct { 9957 azure.FutureAPI 9958 // Result returns the result of the asynchronous operation. 9959 // If the operation has not completed it will return an error. 9960 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error) 9961} 9962 9963// UnmarshalJSON is the custom unmarshaller for CreateFuture. 9964func (future *SQLResourcesMigrateSQLDatabaseToManualThroughputFuture) UnmarshalJSON(body []byte) error { 9965 var azFuture azure.Future 9966 if err := json.Unmarshal(body, &azFuture); err != nil { 9967 return err 9968 } 9969 future.FutureAPI = &azFuture 9970 future.Result = future.result 9971 return nil 9972} 9973 9974// result is the default implementation for SQLResourcesMigrateSQLDatabaseToManualThroughputFuture.Result. 9975func (future *SQLResourcesMigrateSQLDatabaseToManualThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 9976 var done bool 9977 done, err = future.DoneWithContext(context.Background(), client) 9978 if err != nil { 9979 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToManualThroughputFuture", "Result", future.Response(), "Polling failure") 9980 return 9981 } 9982 if !done { 9983 tsgr.Response.Response = future.Response() 9984 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesMigrateSQLDatabaseToManualThroughputFuture") 9985 return 9986 } 9987 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9988 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 9989 tsgr, err = client.MigrateSQLDatabaseToManualThroughputResponder(tsgr.Response.Response) 9990 if err != nil { 9991 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesMigrateSQLDatabaseToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 9992 } 9993 } 9994 return 9995} 9996 9997// SQLResourcesUpdateSQLContainerThroughputFuture an abstraction for monitoring and retrieving the results 9998// of a long-running operation. 9999type SQLResourcesUpdateSQLContainerThroughputFuture struct { 10000 azure.FutureAPI 10001 // Result returns the result of the asynchronous operation. 10002 // If the operation has not completed it will return an error. 10003 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error) 10004} 10005 10006// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10007func (future *SQLResourcesUpdateSQLContainerThroughputFuture) UnmarshalJSON(body []byte) error { 10008 var azFuture azure.Future 10009 if err := json.Unmarshal(body, &azFuture); err != nil { 10010 return err 10011 } 10012 future.FutureAPI = &azFuture 10013 future.Result = future.result 10014 return nil 10015} 10016 10017// result is the default implementation for SQLResourcesUpdateSQLContainerThroughputFuture.Result. 10018func (future *SQLResourcesUpdateSQLContainerThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 10019 var done bool 10020 done, err = future.DoneWithContext(context.Background(), client) 10021 if err != nil { 10022 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLContainerThroughputFuture", "Result", future.Response(), "Polling failure") 10023 return 10024 } 10025 if !done { 10026 tsgr.Response.Response = future.Response() 10027 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesUpdateSQLContainerThroughputFuture") 10028 return 10029 } 10030 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10031 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 10032 tsgr, err = client.UpdateSQLContainerThroughputResponder(tsgr.Response.Response) 10033 if err != nil { 10034 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLContainerThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 10035 } 10036 } 10037 return 10038} 10039 10040// SQLResourcesUpdateSQLDatabaseThroughputFuture an abstraction for monitoring and retrieving the results 10041// of a long-running operation. 10042type SQLResourcesUpdateSQLDatabaseThroughputFuture struct { 10043 azure.FutureAPI 10044 // Result returns the result of the asynchronous operation. 10045 // If the operation has not completed it will return an error. 10046 Result func(SQLResourcesClient) (ThroughputSettingsGetResults, error) 10047} 10048 10049// UnmarshalJSON is the custom unmarshaller for CreateFuture. 10050func (future *SQLResourcesUpdateSQLDatabaseThroughputFuture) UnmarshalJSON(body []byte) error { 10051 var azFuture azure.Future 10052 if err := json.Unmarshal(body, &azFuture); err != nil { 10053 return err 10054 } 10055 future.FutureAPI = &azFuture 10056 future.Result = future.result 10057 return nil 10058} 10059 10060// result is the default implementation for SQLResourcesUpdateSQLDatabaseThroughputFuture.Result. 10061func (future *SQLResourcesUpdateSQLDatabaseThroughputFuture) result(client SQLResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 10062 var done bool 10063 done, err = future.DoneWithContext(context.Background(), client) 10064 if err != nil { 10065 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture", "Result", future.Response(), "Polling failure") 10066 return 10067 } 10068 if !done { 10069 tsgr.Response.Response = future.Response() 10070 err = azure.NewAsyncOpIncompleteError("documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture") 10071 return 10072 } 10073 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10074 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 10075 tsgr, err = client.UpdateSQLDatabaseThroughputResponder(tsgr.Response.Response) 10076 if err != nil { 10077 err = autorest.NewErrorWithError(err, "documentdb.SQLResourcesUpdateSQLDatabaseThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 10078 } 10079 } 10080 return 10081} 10082 10083// SQLRoleAssignmentCreateUpdateParameters parameters to create and update an Azure Cosmos DB SQL Role 10084// Assignment. 10085type SQLRoleAssignmentCreateUpdateParameters struct { 10086 // SQLRoleAssignmentResource - Properties to create and update an Azure Cosmos DB SQL Role Assignment. 10087 *SQLRoleAssignmentResource `json:"properties,omitempty"` 10088} 10089 10090// MarshalJSON is the custom marshaler for SQLRoleAssignmentCreateUpdateParameters. 10091func (sracup SQLRoleAssignmentCreateUpdateParameters) MarshalJSON() ([]byte, error) { 10092 objectMap := make(map[string]interface{}) 10093 if sracup.SQLRoleAssignmentResource != nil { 10094 objectMap["properties"] = sracup.SQLRoleAssignmentResource 10095 } 10096 return json.Marshal(objectMap) 10097} 10098 10099// UnmarshalJSON is the custom unmarshaler for SQLRoleAssignmentCreateUpdateParameters struct. 10100func (sracup *SQLRoleAssignmentCreateUpdateParameters) UnmarshalJSON(body []byte) error { 10101 var m map[string]*json.RawMessage 10102 err := json.Unmarshal(body, &m) 10103 if err != nil { 10104 return err 10105 } 10106 for k, v := range m { 10107 switch k { 10108 case "properties": 10109 if v != nil { 10110 var SQLRoleAssignmentResource SQLRoleAssignmentResource 10111 err = json.Unmarshal(*v, &SQLRoleAssignmentResource) 10112 if err != nil { 10113 return err 10114 } 10115 sracup.SQLRoleAssignmentResource = &SQLRoleAssignmentResource 10116 } 10117 } 10118 } 10119 10120 return nil 10121} 10122 10123// SQLRoleAssignmentGetResults an Azure Cosmos DB Role Assignment 10124type SQLRoleAssignmentGetResults struct { 10125 autorest.Response `json:"-"` 10126 // SQLRoleAssignmentResource - Properties related to the Role Assignment. 10127 *SQLRoleAssignmentResource `json:"properties,omitempty"` 10128 // ID - READ-ONLY; The unique resource identifier of the database account. 10129 ID *string `json:"id,omitempty"` 10130 // Name - READ-ONLY; The name of the database account. 10131 Name *string `json:"name,omitempty"` 10132 // Type - READ-ONLY; The type of Azure resource. 10133 Type *string `json:"type,omitempty"` 10134} 10135 10136// MarshalJSON is the custom marshaler for SQLRoleAssignmentGetResults. 10137func (sragr SQLRoleAssignmentGetResults) MarshalJSON() ([]byte, error) { 10138 objectMap := make(map[string]interface{}) 10139 if sragr.SQLRoleAssignmentResource != nil { 10140 objectMap["properties"] = sragr.SQLRoleAssignmentResource 10141 } 10142 return json.Marshal(objectMap) 10143} 10144 10145// UnmarshalJSON is the custom unmarshaler for SQLRoleAssignmentGetResults struct. 10146func (sragr *SQLRoleAssignmentGetResults) UnmarshalJSON(body []byte) error { 10147 var m map[string]*json.RawMessage 10148 err := json.Unmarshal(body, &m) 10149 if err != nil { 10150 return err 10151 } 10152 for k, v := range m { 10153 switch k { 10154 case "properties": 10155 if v != nil { 10156 var SQLRoleAssignmentResource SQLRoleAssignmentResource 10157 err = json.Unmarshal(*v, &SQLRoleAssignmentResource) 10158 if err != nil { 10159 return err 10160 } 10161 sragr.SQLRoleAssignmentResource = &SQLRoleAssignmentResource 10162 } 10163 case "id": 10164 if v != nil { 10165 var ID string 10166 err = json.Unmarshal(*v, &ID) 10167 if err != nil { 10168 return err 10169 } 10170 sragr.ID = &ID 10171 } 10172 case "name": 10173 if v != nil { 10174 var name string 10175 err = json.Unmarshal(*v, &name) 10176 if err != nil { 10177 return err 10178 } 10179 sragr.Name = &name 10180 } 10181 case "type": 10182 if v != nil { 10183 var typeVar string 10184 err = json.Unmarshal(*v, &typeVar) 10185 if err != nil { 10186 return err 10187 } 10188 sragr.Type = &typeVar 10189 } 10190 } 10191 } 10192 10193 return nil 10194} 10195 10196// SQLRoleAssignmentListResult the relevant Role Assignments. 10197type SQLRoleAssignmentListResult struct { 10198 autorest.Response `json:"-"` 10199 // Value - READ-ONLY; List of Role Assignments and their properties 10200 Value *[]SQLRoleAssignmentGetResults `json:"value,omitempty"` 10201} 10202 10203// MarshalJSON is the custom marshaler for SQLRoleAssignmentListResult. 10204func (sralr SQLRoleAssignmentListResult) MarshalJSON() ([]byte, error) { 10205 objectMap := make(map[string]interface{}) 10206 return json.Marshal(objectMap) 10207} 10208 10209// SQLRoleAssignmentResource azure Cosmos DB SQL Role Assignment resource object. 10210type SQLRoleAssignmentResource struct { 10211 // RoleDefinitionID - The unique identifier for the associated Role Definition. 10212 RoleDefinitionID *string `json:"roleDefinitionId,omitempty"` 10213 // Scope - The data plane resource path for which access is being granted through this Role Assignment. 10214 Scope *string `json:"scope,omitempty"` 10215 // PrincipalID - The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through this Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the subscription. 10216 PrincipalID *string `json:"principalId,omitempty"` 10217} 10218 10219// SQLRoleDefinitionCreateUpdateParameters parameters to create and update an Azure Cosmos DB SQL Role 10220// Definition. 10221type SQLRoleDefinitionCreateUpdateParameters struct { 10222 // SQLRoleDefinitionResource - Properties to create and update an Azure Cosmos DB SQL Role Definition. 10223 *SQLRoleDefinitionResource `json:"properties,omitempty"` 10224} 10225 10226// MarshalJSON is the custom marshaler for SQLRoleDefinitionCreateUpdateParameters. 10227func (srdcup SQLRoleDefinitionCreateUpdateParameters) MarshalJSON() ([]byte, error) { 10228 objectMap := make(map[string]interface{}) 10229 if srdcup.SQLRoleDefinitionResource != nil { 10230 objectMap["properties"] = srdcup.SQLRoleDefinitionResource 10231 } 10232 return json.Marshal(objectMap) 10233} 10234 10235// UnmarshalJSON is the custom unmarshaler for SQLRoleDefinitionCreateUpdateParameters struct. 10236func (srdcup *SQLRoleDefinitionCreateUpdateParameters) UnmarshalJSON(body []byte) error { 10237 var m map[string]*json.RawMessage 10238 err := json.Unmarshal(body, &m) 10239 if err != nil { 10240 return err 10241 } 10242 for k, v := range m { 10243 switch k { 10244 case "properties": 10245 if v != nil { 10246 var SQLRoleDefinitionResource SQLRoleDefinitionResource 10247 err = json.Unmarshal(*v, &SQLRoleDefinitionResource) 10248 if err != nil { 10249 return err 10250 } 10251 srdcup.SQLRoleDefinitionResource = &SQLRoleDefinitionResource 10252 } 10253 } 10254 } 10255 10256 return nil 10257} 10258 10259// SQLRoleDefinitionGetResults an Azure Cosmos DB SQL Role Definition. 10260type SQLRoleDefinitionGetResults struct { 10261 autorest.Response `json:"-"` 10262 // SQLRoleDefinitionResource - Properties related to the Role Definition. 10263 *SQLRoleDefinitionResource `json:"properties,omitempty"` 10264 // ID - READ-ONLY; The unique resource identifier of the database account. 10265 ID *string `json:"id,omitempty"` 10266 // Name - READ-ONLY; The name of the database account. 10267 Name *string `json:"name,omitempty"` 10268 // Type - READ-ONLY; The type of Azure resource. 10269 Type *string `json:"type,omitempty"` 10270} 10271 10272// MarshalJSON is the custom marshaler for SQLRoleDefinitionGetResults. 10273func (srdgr SQLRoleDefinitionGetResults) MarshalJSON() ([]byte, error) { 10274 objectMap := make(map[string]interface{}) 10275 if srdgr.SQLRoleDefinitionResource != nil { 10276 objectMap["properties"] = srdgr.SQLRoleDefinitionResource 10277 } 10278 return json.Marshal(objectMap) 10279} 10280 10281// UnmarshalJSON is the custom unmarshaler for SQLRoleDefinitionGetResults struct. 10282func (srdgr *SQLRoleDefinitionGetResults) UnmarshalJSON(body []byte) error { 10283 var m map[string]*json.RawMessage 10284 err := json.Unmarshal(body, &m) 10285 if err != nil { 10286 return err 10287 } 10288 for k, v := range m { 10289 switch k { 10290 case "properties": 10291 if v != nil { 10292 var SQLRoleDefinitionResource SQLRoleDefinitionResource 10293 err = json.Unmarshal(*v, &SQLRoleDefinitionResource) 10294 if err != nil { 10295 return err 10296 } 10297 srdgr.SQLRoleDefinitionResource = &SQLRoleDefinitionResource 10298 } 10299 case "id": 10300 if v != nil { 10301 var ID string 10302 err = json.Unmarshal(*v, &ID) 10303 if err != nil { 10304 return err 10305 } 10306 srdgr.ID = &ID 10307 } 10308 case "name": 10309 if v != nil { 10310 var name string 10311 err = json.Unmarshal(*v, &name) 10312 if err != nil { 10313 return err 10314 } 10315 srdgr.Name = &name 10316 } 10317 case "type": 10318 if v != nil { 10319 var typeVar string 10320 err = json.Unmarshal(*v, &typeVar) 10321 if err != nil { 10322 return err 10323 } 10324 srdgr.Type = &typeVar 10325 } 10326 } 10327 } 10328 10329 return nil 10330} 10331 10332// SQLRoleDefinitionListResult the relevant Role Definitions. 10333type SQLRoleDefinitionListResult struct { 10334 autorest.Response `json:"-"` 10335 // Value - READ-ONLY; List of Role Definitions and their properties. 10336 Value *[]SQLRoleDefinitionGetResults `json:"value,omitempty"` 10337} 10338 10339// MarshalJSON is the custom marshaler for SQLRoleDefinitionListResult. 10340func (srdlr SQLRoleDefinitionListResult) MarshalJSON() ([]byte, error) { 10341 objectMap := make(map[string]interface{}) 10342 return json.Marshal(objectMap) 10343} 10344 10345// SQLRoleDefinitionResource azure Cosmos DB SQL Role Definition resource object. 10346type SQLRoleDefinitionResource struct { 10347 // RoleName - A user-friendly name for the Role Definition. Must be unique for the database account. 10348 RoleName *string `json:"roleName,omitempty"` 10349 // Type - Indicates whether the Role Definition was built-in or user created. Possible values include: 'RoleDefinitionTypeBuiltInRole', 'RoleDefinitionTypeCustomRole' 10350 Type RoleDefinitionType `json:"type,omitempty"` 10351 // AssignableScopes - A set of fully qualified Scopes at or below which Role Assignments may be created using this Role Definition. This will allow application of this Role Definition on the entire database account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not exist. 10352 AssignableScopes *[]string `json:"assignableScopes,omitempty"` 10353 // Permissions - The set of operations allowed through this Role Definition. 10354 Permissions *[]Permission `json:"permissions,omitempty"` 10355} 10356 10357// SQLStoredProcedureCreateUpdateParameters parameters to create and update Cosmos DB storedProcedure. 10358type SQLStoredProcedureCreateUpdateParameters struct { 10359 // SQLStoredProcedureCreateUpdateProperties - Properties to create and update Azure Cosmos DB storedProcedure. 10360 *SQLStoredProcedureCreateUpdateProperties `json:"properties,omitempty"` 10361 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 10362 ID *string `json:"id,omitempty"` 10363 // Name - READ-ONLY; The name of the ARM resource. 10364 Name *string `json:"name,omitempty"` 10365 // Type - READ-ONLY; The type of Azure resource. 10366 Type *string `json:"type,omitempty"` 10367 // Location - The location of the resource group to which the resource belongs. 10368 Location *string `json:"location,omitempty"` 10369 Tags map[string]*string `json:"tags"` 10370 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 10371} 10372 10373// MarshalJSON is the custom marshaler for SQLStoredProcedureCreateUpdateParameters. 10374func (sspcup SQLStoredProcedureCreateUpdateParameters) MarshalJSON() ([]byte, error) { 10375 objectMap := make(map[string]interface{}) 10376 if sspcup.SQLStoredProcedureCreateUpdateProperties != nil { 10377 objectMap["properties"] = sspcup.SQLStoredProcedureCreateUpdateProperties 10378 } 10379 if sspcup.Location != nil { 10380 objectMap["location"] = sspcup.Location 10381 } 10382 if sspcup.Tags != nil { 10383 objectMap["tags"] = sspcup.Tags 10384 } 10385 if sspcup.Identity != nil { 10386 objectMap["identity"] = sspcup.Identity 10387 } 10388 return json.Marshal(objectMap) 10389} 10390 10391// UnmarshalJSON is the custom unmarshaler for SQLStoredProcedureCreateUpdateParameters struct. 10392func (sspcup *SQLStoredProcedureCreateUpdateParameters) UnmarshalJSON(body []byte) error { 10393 var m map[string]*json.RawMessage 10394 err := json.Unmarshal(body, &m) 10395 if err != nil { 10396 return err 10397 } 10398 for k, v := range m { 10399 switch k { 10400 case "properties": 10401 if v != nil { 10402 var SQLStoredProcedureCreateUpdateProperties SQLStoredProcedureCreateUpdateProperties 10403 err = json.Unmarshal(*v, &SQLStoredProcedureCreateUpdateProperties) 10404 if err != nil { 10405 return err 10406 } 10407 sspcup.SQLStoredProcedureCreateUpdateProperties = &SQLStoredProcedureCreateUpdateProperties 10408 } 10409 case "id": 10410 if v != nil { 10411 var ID string 10412 err = json.Unmarshal(*v, &ID) 10413 if err != nil { 10414 return err 10415 } 10416 sspcup.ID = &ID 10417 } 10418 case "name": 10419 if v != nil { 10420 var name string 10421 err = json.Unmarshal(*v, &name) 10422 if err != nil { 10423 return err 10424 } 10425 sspcup.Name = &name 10426 } 10427 case "type": 10428 if v != nil { 10429 var typeVar string 10430 err = json.Unmarshal(*v, &typeVar) 10431 if err != nil { 10432 return err 10433 } 10434 sspcup.Type = &typeVar 10435 } 10436 case "location": 10437 if v != nil { 10438 var location string 10439 err = json.Unmarshal(*v, &location) 10440 if err != nil { 10441 return err 10442 } 10443 sspcup.Location = &location 10444 } 10445 case "tags": 10446 if v != nil { 10447 var tags map[string]*string 10448 err = json.Unmarshal(*v, &tags) 10449 if err != nil { 10450 return err 10451 } 10452 sspcup.Tags = tags 10453 } 10454 case "identity": 10455 if v != nil { 10456 var identity ManagedServiceIdentity 10457 err = json.Unmarshal(*v, &identity) 10458 if err != nil { 10459 return err 10460 } 10461 sspcup.Identity = &identity 10462 } 10463 } 10464 } 10465 10466 return nil 10467} 10468 10469// SQLStoredProcedureCreateUpdateProperties properties to create and update Azure Cosmos DB 10470// storedProcedure. 10471type SQLStoredProcedureCreateUpdateProperties struct { 10472 // Resource - The standard JSON format of a storedProcedure 10473 Resource *SQLStoredProcedureResource `json:"resource,omitempty"` 10474 // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. 10475 Options *CreateUpdateOptions `json:"options,omitempty"` 10476} 10477 10478// SQLStoredProcedureGetProperties the properties of an Azure Cosmos DB StoredProcedure 10479type SQLStoredProcedureGetProperties struct { 10480 Resource *SQLStoredProcedureGetPropertiesResource `json:"resource,omitempty"` 10481} 10482 10483// SQLStoredProcedureGetPropertiesResource ... 10484type SQLStoredProcedureGetPropertiesResource struct { 10485 // ID - Name of the Cosmos DB SQL storedProcedure 10486 ID *string `json:"id,omitempty"` 10487 // Body - Body of the Stored Procedure 10488 Body *string `json:"body,omitempty"` 10489 // Rid - READ-ONLY; A system generated property. A unique identifier. 10490 Rid *string `json:"_rid,omitempty"` 10491 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 10492 Ts *float64 `json:"_ts,omitempty"` 10493 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 10494 Etag *string `json:"_etag,omitempty"` 10495} 10496 10497// MarshalJSON is the custom marshaler for SQLStoredProcedureGetPropertiesResource. 10498func (sspgp SQLStoredProcedureGetPropertiesResource) MarshalJSON() ([]byte, error) { 10499 objectMap := make(map[string]interface{}) 10500 if sspgp.ID != nil { 10501 objectMap["id"] = sspgp.ID 10502 } 10503 if sspgp.Body != nil { 10504 objectMap["body"] = sspgp.Body 10505 } 10506 return json.Marshal(objectMap) 10507} 10508 10509// SQLStoredProcedureGetResults an Azure Cosmos DB storedProcedure. 10510type SQLStoredProcedureGetResults struct { 10511 autorest.Response `json:"-"` 10512 // SQLStoredProcedureGetProperties - The properties of an Azure Cosmos DB storedProcedure 10513 *SQLStoredProcedureGetProperties `json:"properties,omitempty"` 10514 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 10515 ID *string `json:"id,omitempty"` 10516 // Name - READ-ONLY; The name of the ARM resource. 10517 Name *string `json:"name,omitempty"` 10518 // Type - READ-ONLY; The type of Azure resource. 10519 Type *string `json:"type,omitempty"` 10520 // Location - The location of the resource group to which the resource belongs. 10521 Location *string `json:"location,omitempty"` 10522 Tags map[string]*string `json:"tags"` 10523 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 10524} 10525 10526// MarshalJSON is the custom marshaler for SQLStoredProcedureGetResults. 10527func (sspgr SQLStoredProcedureGetResults) MarshalJSON() ([]byte, error) { 10528 objectMap := make(map[string]interface{}) 10529 if sspgr.SQLStoredProcedureGetProperties != nil { 10530 objectMap["properties"] = sspgr.SQLStoredProcedureGetProperties 10531 } 10532 if sspgr.Location != nil { 10533 objectMap["location"] = sspgr.Location 10534 } 10535 if sspgr.Tags != nil { 10536 objectMap["tags"] = sspgr.Tags 10537 } 10538 if sspgr.Identity != nil { 10539 objectMap["identity"] = sspgr.Identity 10540 } 10541 return json.Marshal(objectMap) 10542} 10543 10544// UnmarshalJSON is the custom unmarshaler for SQLStoredProcedureGetResults struct. 10545func (sspgr *SQLStoredProcedureGetResults) UnmarshalJSON(body []byte) error { 10546 var m map[string]*json.RawMessage 10547 err := json.Unmarshal(body, &m) 10548 if err != nil { 10549 return err 10550 } 10551 for k, v := range m { 10552 switch k { 10553 case "properties": 10554 if v != nil { 10555 var SQLStoredProcedureGetProperties SQLStoredProcedureGetProperties 10556 err = json.Unmarshal(*v, &SQLStoredProcedureGetProperties) 10557 if err != nil { 10558 return err 10559 } 10560 sspgr.SQLStoredProcedureGetProperties = &SQLStoredProcedureGetProperties 10561 } 10562 case "id": 10563 if v != nil { 10564 var ID string 10565 err = json.Unmarshal(*v, &ID) 10566 if err != nil { 10567 return err 10568 } 10569 sspgr.ID = &ID 10570 } 10571 case "name": 10572 if v != nil { 10573 var name string 10574 err = json.Unmarshal(*v, &name) 10575 if err != nil { 10576 return err 10577 } 10578 sspgr.Name = &name 10579 } 10580 case "type": 10581 if v != nil { 10582 var typeVar string 10583 err = json.Unmarshal(*v, &typeVar) 10584 if err != nil { 10585 return err 10586 } 10587 sspgr.Type = &typeVar 10588 } 10589 case "location": 10590 if v != nil { 10591 var location string 10592 err = json.Unmarshal(*v, &location) 10593 if err != nil { 10594 return err 10595 } 10596 sspgr.Location = &location 10597 } 10598 case "tags": 10599 if v != nil { 10600 var tags map[string]*string 10601 err = json.Unmarshal(*v, &tags) 10602 if err != nil { 10603 return err 10604 } 10605 sspgr.Tags = tags 10606 } 10607 case "identity": 10608 if v != nil { 10609 var identity ManagedServiceIdentity 10610 err = json.Unmarshal(*v, &identity) 10611 if err != nil { 10612 return err 10613 } 10614 sspgr.Identity = &identity 10615 } 10616 } 10617 } 10618 10619 return nil 10620} 10621 10622// SQLStoredProcedureListResult the List operation response, that contains the storedProcedures and their 10623// properties. 10624type SQLStoredProcedureListResult struct { 10625 autorest.Response `json:"-"` 10626 // Value - READ-ONLY; List of storedProcedures and their properties. 10627 Value *[]SQLStoredProcedureGetResults `json:"value,omitempty"` 10628} 10629 10630// MarshalJSON is the custom marshaler for SQLStoredProcedureListResult. 10631func (ssplr SQLStoredProcedureListResult) MarshalJSON() ([]byte, error) { 10632 objectMap := make(map[string]interface{}) 10633 return json.Marshal(objectMap) 10634} 10635 10636// SQLStoredProcedureResource cosmos DB SQL storedProcedure resource object 10637type SQLStoredProcedureResource struct { 10638 // ID - Name of the Cosmos DB SQL storedProcedure 10639 ID *string `json:"id,omitempty"` 10640 // Body - Body of the Stored Procedure 10641 Body *string `json:"body,omitempty"` 10642} 10643 10644// SQLTriggerCreateUpdateParameters parameters to create and update Cosmos DB trigger. 10645type SQLTriggerCreateUpdateParameters struct { 10646 // SQLTriggerCreateUpdateProperties - Properties to create and update Azure Cosmos DB trigger. 10647 *SQLTriggerCreateUpdateProperties `json:"properties,omitempty"` 10648 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 10649 ID *string `json:"id,omitempty"` 10650 // Name - READ-ONLY; The name of the ARM resource. 10651 Name *string `json:"name,omitempty"` 10652 // Type - READ-ONLY; The type of Azure resource. 10653 Type *string `json:"type,omitempty"` 10654 // Location - The location of the resource group to which the resource belongs. 10655 Location *string `json:"location,omitempty"` 10656 Tags map[string]*string `json:"tags"` 10657 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 10658} 10659 10660// MarshalJSON is the custom marshaler for SQLTriggerCreateUpdateParameters. 10661func (stcup SQLTriggerCreateUpdateParameters) MarshalJSON() ([]byte, error) { 10662 objectMap := make(map[string]interface{}) 10663 if stcup.SQLTriggerCreateUpdateProperties != nil { 10664 objectMap["properties"] = stcup.SQLTriggerCreateUpdateProperties 10665 } 10666 if stcup.Location != nil { 10667 objectMap["location"] = stcup.Location 10668 } 10669 if stcup.Tags != nil { 10670 objectMap["tags"] = stcup.Tags 10671 } 10672 if stcup.Identity != nil { 10673 objectMap["identity"] = stcup.Identity 10674 } 10675 return json.Marshal(objectMap) 10676} 10677 10678// UnmarshalJSON is the custom unmarshaler for SQLTriggerCreateUpdateParameters struct. 10679func (stcup *SQLTriggerCreateUpdateParameters) UnmarshalJSON(body []byte) error { 10680 var m map[string]*json.RawMessage 10681 err := json.Unmarshal(body, &m) 10682 if err != nil { 10683 return err 10684 } 10685 for k, v := range m { 10686 switch k { 10687 case "properties": 10688 if v != nil { 10689 var SQLTriggerCreateUpdateProperties SQLTriggerCreateUpdateProperties 10690 err = json.Unmarshal(*v, &SQLTriggerCreateUpdateProperties) 10691 if err != nil { 10692 return err 10693 } 10694 stcup.SQLTriggerCreateUpdateProperties = &SQLTriggerCreateUpdateProperties 10695 } 10696 case "id": 10697 if v != nil { 10698 var ID string 10699 err = json.Unmarshal(*v, &ID) 10700 if err != nil { 10701 return err 10702 } 10703 stcup.ID = &ID 10704 } 10705 case "name": 10706 if v != nil { 10707 var name string 10708 err = json.Unmarshal(*v, &name) 10709 if err != nil { 10710 return err 10711 } 10712 stcup.Name = &name 10713 } 10714 case "type": 10715 if v != nil { 10716 var typeVar string 10717 err = json.Unmarshal(*v, &typeVar) 10718 if err != nil { 10719 return err 10720 } 10721 stcup.Type = &typeVar 10722 } 10723 case "location": 10724 if v != nil { 10725 var location string 10726 err = json.Unmarshal(*v, &location) 10727 if err != nil { 10728 return err 10729 } 10730 stcup.Location = &location 10731 } 10732 case "tags": 10733 if v != nil { 10734 var tags map[string]*string 10735 err = json.Unmarshal(*v, &tags) 10736 if err != nil { 10737 return err 10738 } 10739 stcup.Tags = tags 10740 } 10741 case "identity": 10742 if v != nil { 10743 var identity ManagedServiceIdentity 10744 err = json.Unmarshal(*v, &identity) 10745 if err != nil { 10746 return err 10747 } 10748 stcup.Identity = &identity 10749 } 10750 } 10751 } 10752 10753 return nil 10754} 10755 10756// SQLTriggerCreateUpdateProperties properties to create and update Azure Cosmos DB trigger. 10757type SQLTriggerCreateUpdateProperties struct { 10758 // Resource - The standard JSON format of a trigger 10759 Resource *SQLTriggerResource `json:"resource,omitempty"` 10760 // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. 10761 Options *CreateUpdateOptions `json:"options,omitempty"` 10762} 10763 10764// SQLTriggerGetProperties the properties of an Azure Cosmos DB trigger 10765type SQLTriggerGetProperties struct { 10766 Resource *SQLTriggerGetPropertiesResource `json:"resource,omitempty"` 10767} 10768 10769// SQLTriggerGetPropertiesResource ... 10770type SQLTriggerGetPropertiesResource struct { 10771 // ID - Name of the Cosmos DB SQL trigger 10772 ID *string `json:"id,omitempty"` 10773 // Body - Body of the Trigger 10774 Body *string `json:"body,omitempty"` 10775 // TriggerType - Type of the Trigger. Possible values include: 'TriggerTypePre', 'TriggerTypePost' 10776 TriggerType TriggerType `json:"triggerType,omitempty"` 10777 // TriggerOperation - The operation the trigger is associated with. Possible values include: 'TriggerOperationAll', 'TriggerOperationCreate', 'TriggerOperationUpdate', 'TriggerOperationDelete', 'TriggerOperationReplace' 10778 TriggerOperation TriggerOperation `json:"triggerOperation,omitempty"` 10779 // Rid - READ-ONLY; A system generated property. A unique identifier. 10780 Rid *string `json:"_rid,omitempty"` 10781 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 10782 Ts *float64 `json:"_ts,omitempty"` 10783 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 10784 Etag *string `json:"_etag,omitempty"` 10785} 10786 10787// MarshalJSON is the custom marshaler for SQLTriggerGetPropertiesResource. 10788func (stgp SQLTriggerGetPropertiesResource) MarshalJSON() ([]byte, error) { 10789 objectMap := make(map[string]interface{}) 10790 if stgp.ID != nil { 10791 objectMap["id"] = stgp.ID 10792 } 10793 if stgp.Body != nil { 10794 objectMap["body"] = stgp.Body 10795 } 10796 if stgp.TriggerType != "" { 10797 objectMap["triggerType"] = stgp.TriggerType 10798 } 10799 if stgp.TriggerOperation != "" { 10800 objectMap["triggerOperation"] = stgp.TriggerOperation 10801 } 10802 return json.Marshal(objectMap) 10803} 10804 10805// SQLTriggerGetResults an Azure Cosmos DB trigger. 10806type SQLTriggerGetResults struct { 10807 autorest.Response `json:"-"` 10808 // SQLTriggerGetProperties - The properties of an Azure Cosmos DB trigger 10809 *SQLTriggerGetProperties `json:"properties,omitempty"` 10810 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 10811 ID *string `json:"id,omitempty"` 10812 // Name - READ-ONLY; The name of the ARM resource. 10813 Name *string `json:"name,omitempty"` 10814 // Type - READ-ONLY; The type of Azure resource. 10815 Type *string `json:"type,omitempty"` 10816 // Location - The location of the resource group to which the resource belongs. 10817 Location *string `json:"location,omitempty"` 10818 Tags map[string]*string `json:"tags"` 10819 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 10820} 10821 10822// MarshalJSON is the custom marshaler for SQLTriggerGetResults. 10823func (stgr SQLTriggerGetResults) MarshalJSON() ([]byte, error) { 10824 objectMap := make(map[string]interface{}) 10825 if stgr.SQLTriggerGetProperties != nil { 10826 objectMap["properties"] = stgr.SQLTriggerGetProperties 10827 } 10828 if stgr.Location != nil { 10829 objectMap["location"] = stgr.Location 10830 } 10831 if stgr.Tags != nil { 10832 objectMap["tags"] = stgr.Tags 10833 } 10834 if stgr.Identity != nil { 10835 objectMap["identity"] = stgr.Identity 10836 } 10837 return json.Marshal(objectMap) 10838} 10839 10840// UnmarshalJSON is the custom unmarshaler for SQLTriggerGetResults struct. 10841func (stgr *SQLTriggerGetResults) UnmarshalJSON(body []byte) error { 10842 var m map[string]*json.RawMessage 10843 err := json.Unmarshal(body, &m) 10844 if err != nil { 10845 return err 10846 } 10847 for k, v := range m { 10848 switch k { 10849 case "properties": 10850 if v != nil { 10851 var SQLTriggerGetProperties SQLTriggerGetProperties 10852 err = json.Unmarshal(*v, &SQLTriggerGetProperties) 10853 if err != nil { 10854 return err 10855 } 10856 stgr.SQLTriggerGetProperties = &SQLTriggerGetProperties 10857 } 10858 case "id": 10859 if v != nil { 10860 var ID string 10861 err = json.Unmarshal(*v, &ID) 10862 if err != nil { 10863 return err 10864 } 10865 stgr.ID = &ID 10866 } 10867 case "name": 10868 if v != nil { 10869 var name string 10870 err = json.Unmarshal(*v, &name) 10871 if err != nil { 10872 return err 10873 } 10874 stgr.Name = &name 10875 } 10876 case "type": 10877 if v != nil { 10878 var typeVar string 10879 err = json.Unmarshal(*v, &typeVar) 10880 if err != nil { 10881 return err 10882 } 10883 stgr.Type = &typeVar 10884 } 10885 case "location": 10886 if v != nil { 10887 var location string 10888 err = json.Unmarshal(*v, &location) 10889 if err != nil { 10890 return err 10891 } 10892 stgr.Location = &location 10893 } 10894 case "tags": 10895 if v != nil { 10896 var tags map[string]*string 10897 err = json.Unmarshal(*v, &tags) 10898 if err != nil { 10899 return err 10900 } 10901 stgr.Tags = tags 10902 } 10903 case "identity": 10904 if v != nil { 10905 var identity ManagedServiceIdentity 10906 err = json.Unmarshal(*v, &identity) 10907 if err != nil { 10908 return err 10909 } 10910 stgr.Identity = &identity 10911 } 10912 } 10913 } 10914 10915 return nil 10916} 10917 10918// SQLTriggerListResult the List operation response, that contains the triggers and their properties. 10919type SQLTriggerListResult struct { 10920 autorest.Response `json:"-"` 10921 // Value - READ-ONLY; List of triggers and their properties. 10922 Value *[]SQLTriggerGetResults `json:"value,omitempty"` 10923} 10924 10925// MarshalJSON is the custom marshaler for SQLTriggerListResult. 10926func (stlr SQLTriggerListResult) MarshalJSON() ([]byte, error) { 10927 objectMap := make(map[string]interface{}) 10928 return json.Marshal(objectMap) 10929} 10930 10931// SQLTriggerResource cosmos DB SQL trigger resource object 10932type SQLTriggerResource struct { 10933 // ID - Name of the Cosmos DB SQL trigger 10934 ID *string `json:"id,omitempty"` 10935 // Body - Body of the Trigger 10936 Body *string `json:"body,omitempty"` 10937 // TriggerType - Type of the Trigger. Possible values include: 'TriggerTypePre', 'TriggerTypePost' 10938 TriggerType TriggerType `json:"triggerType,omitempty"` 10939 // TriggerOperation - The operation the trigger is associated with. Possible values include: 'TriggerOperationAll', 'TriggerOperationCreate', 'TriggerOperationUpdate', 'TriggerOperationDelete', 'TriggerOperationReplace' 10940 TriggerOperation TriggerOperation `json:"triggerOperation,omitempty"` 10941} 10942 10943// SQLUserDefinedFunctionCreateUpdateParameters parameters to create and update Cosmos DB 10944// userDefinedFunction. 10945type SQLUserDefinedFunctionCreateUpdateParameters struct { 10946 // SQLUserDefinedFunctionCreateUpdateProperties - Properties to create and update Azure Cosmos DB userDefinedFunction. 10947 *SQLUserDefinedFunctionCreateUpdateProperties `json:"properties,omitempty"` 10948 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 10949 ID *string `json:"id,omitempty"` 10950 // Name - READ-ONLY; The name of the ARM resource. 10951 Name *string `json:"name,omitempty"` 10952 // Type - READ-ONLY; The type of Azure resource. 10953 Type *string `json:"type,omitempty"` 10954 // Location - The location of the resource group to which the resource belongs. 10955 Location *string `json:"location,omitempty"` 10956 Tags map[string]*string `json:"tags"` 10957 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 10958} 10959 10960// MarshalJSON is the custom marshaler for SQLUserDefinedFunctionCreateUpdateParameters. 10961func (sudfcup SQLUserDefinedFunctionCreateUpdateParameters) MarshalJSON() ([]byte, error) { 10962 objectMap := make(map[string]interface{}) 10963 if sudfcup.SQLUserDefinedFunctionCreateUpdateProperties != nil { 10964 objectMap["properties"] = sudfcup.SQLUserDefinedFunctionCreateUpdateProperties 10965 } 10966 if sudfcup.Location != nil { 10967 objectMap["location"] = sudfcup.Location 10968 } 10969 if sudfcup.Tags != nil { 10970 objectMap["tags"] = sudfcup.Tags 10971 } 10972 if sudfcup.Identity != nil { 10973 objectMap["identity"] = sudfcup.Identity 10974 } 10975 return json.Marshal(objectMap) 10976} 10977 10978// UnmarshalJSON is the custom unmarshaler for SQLUserDefinedFunctionCreateUpdateParameters struct. 10979func (sudfcup *SQLUserDefinedFunctionCreateUpdateParameters) UnmarshalJSON(body []byte) error { 10980 var m map[string]*json.RawMessage 10981 err := json.Unmarshal(body, &m) 10982 if err != nil { 10983 return err 10984 } 10985 for k, v := range m { 10986 switch k { 10987 case "properties": 10988 if v != nil { 10989 var SQLUserDefinedFunctionCreateUpdateProperties SQLUserDefinedFunctionCreateUpdateProperties 10990 err = json.Unmarshal(*v, &SQLUserDefinedFunctionCreateUpdateProperties) 10991 if err != nil { 10992 return err 10993 } 10994 sudfcup.SQLUserDefinedFunctionCreateUpdateProperties = &SQLUserDefinedFunctionCreateUpdateProperties 10995 } 10996 case "id": 10997 if v != nil { 10998 var ID string 10999 err = json.Unmarshal(*v, &ID) 11000 if err != nil { 11001 return err 11002 } 11003 sudfcup.ID = &ID 11004 } 11005 case "name": 11006 if v != nil { 11007 var name string 11008 err = json.Unmarshal(*v, &name) 11009 if err != nil { 11010 return err 11011 } 11012 sudfcup.Name = &name 11013 } 11014 case "type": 11015 if v != nil { 11016 var typeVar string 11017 err = json.Unmarshal(*v, &typeVar) 11018 if err != nil { 11019 return err 11020 } 11021 sudfcup.Type = &typeVar 11022 } 11023 case "location": 11024 if v != nil { 11025 var location string 11026 err = json.Unmarshal(*v, &location) 11027 if err != nil { 11028 return err 11029 } 11030 sudfcup.Location = &location 11031 } 11032 case "tags": 11033 if v != nil { 11034 var tags map[string]*string 11035 err = json.Unmarshal(*v, &tags) 11036 if err != nil { 11037 return err 11038 } 11039 sudfcup.Tags = tags 11040 } 11041 case "identity": 11042 if v != nil { 11043 var identity ManagedServiceIdentity 11044 err = json.Unmarshal(*v, &identity) 11045 if err != nil { 11046 return err 11047 } 11048 sudfcup.Identity = &identity 11049 } 11050 } 11051 } 11052 11053 return nil 11054} 11055 11056// SQLUserDefinedFunctionCreateUpdateProperties properties to create and update Azure Cosmos DB 11057// userDefinedFunction. 11058type SQLUserDefinedFunctionCreateUpdateProperties struct { 11059 // Resource - The standard JSON format of a userDefinedFunction 11060 Resource *SQLUserDefinedFunctionResource `json:"resource,omitempty"` 11061 // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. 11062 Options *CreateUpdateOptions `json:"options,omitempty"` 11063} 11064 11065// SQLUserDefinedFunctionGetProperties the properties of an Azure Cosmos DB userDefinedFunction 11066type SQLUserDefinedFunctionGetProperties struct { 11067 Resource *SQLUserDefinedFunctionGetPropertiesResource `json:"resource,omitempty"` 11068} 11069 11070// SQLUserDefinedFunctionGetPropertiesResource ... 11071type SQLUserDefinedFunctionGetPropertiesResource struct { 11072 // ID - Name of the Cosmos DB SQL userDefinedFunction 11073 ID *string `json:"id,omitempty"` 11074 // Body - Body of the User Defined Function 11075 Body *string `json:"body,omitempty"` 11076 // Rid - READ-ONLY; A system generated property. A unique identifier. 11077 Rid *string `json:"_rid,omitempty"` 11078 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 11079 Ts *float64 `json:"_ts,omitempty"` 11080 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 11081 Etag *string `json:"_etag,omitempty"` 11082} 11083 11084// MarshalJSON is the custom marshaler for SQLUserDefinedFunctionGetPropertiesResource. 11085func (sudfgp SQLUserDefinedFunctionGetPropertiesResource) MarshalJSON() ([]byte, error) { 11086 objectMap := make(map[string]interface{}) 11087 if sudfgp.ID != nil { 11088 objectMap["id"] = sudfgp.ID 11089 } 11090 if sudfgp.Body != nil { 11091 objectMap["body"] = sudfgp.Body 11092 } 11093 return json.Marshal(objectMap) 11094} 11095 11096// SQLUserDefinedFunctionGetResults an Azure Cosmos DB userDefinedFunction. 11097type SQLUserDefinedFunctionGetResults struct { 11098 autorest.Response `json:"-"` 11099 // SQLUserDefinedFunctionGetProperties - The properties of an Azure Cosmos DB userDefinedFunction 11100 *SQLUserDefinedFunctionGetProperties `json:"properties,omitempty"` 11101 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 11102 ID *string `json:"id,omitempty"` 11103 // Name - READ-ONLY; The name of the ARM resource. 11104 Name *string `json:"name,omitempty"` 11105 // Type - READ-ONLY; The type of Azure resource. 11106 Type *string `json:"type,omitempty"` 11107 // Location - The location of the resource group to which the resource belongs. 11108 Location *string `json:"location,omitempty"` 11109 Tags map[string]*string `json:"tags"` 11110 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 11111} 11112 11113// MarshalJSON is the custom marshaler for SQLUserDefinedFunctionGetResults. 11114func (sudfgr SQLUserDefinedFunctionGetResults) MarshalJSON() ([]byte, error) { 11115 objectMap := make(map[string]interface{}) 11116 if sudfgr.SQLUserDefinedFunctionGetProperties != nil { 11117 objectMap["properties"] = sudfgr.SQLUserDefinedFunctionGetProperties 11118 } 11119 if sudfgr.Location != nil { 11120 objectMap["location"] = sudfgr.Location 11121 } 11122 if sudfgr.Tags != nil { 11123 objectMap["tags"] = sudfgr.Tags 11124 } 11125 if sudfgr.Identity != nil { 11126 objectMap["identity"] = sudfgr.Identity 11127 } 11128 return json.Marshal(objectMap) 11129} 11130 11131// UnmarshalJSON is the custom unmarshaler for SQLUserDefinedFunctionGetResults struct. 11132func (sudfgr *SQLUserDefinedFunctionGetResults) UnmarshalJSON(body []byte) error { 11133 var m map[string]*json.RawMessage 11134 err := json.Unmarshal(body, &m) 11135 if err != nil { 11136 return err 11137 } 11138 for k, v := range m { 11139 switch k { 11140 case "properties": 11141 if v != nil { 11142 var SQLUserDefinedFunctionGetProperties SQLUserDefinedFunctionGetProperties 11143 err = json.Unmarshal(*v, &SQLUserDefinedFunctionGetProperties) 11144 if err != nil { 11145 return err 11146 } 11147 sudfgr.SQLUserDefinedFunctionGetProperties = &SQLUserDefinedFunctionGetProperties 11148 } 11149 case "id": 11150 if v != nil { 11151 var ID string 11152 err = json.Unmarshal(*v, &ID) 11153 if err != nil { 11154 return err 11155 } 11156 sudfgr.ID = &ID 11157 } 11158 case "name": 11159 if v != nil { 11160 var name string 11161 err = json.Unmarshal(*v, &name) 11162 if err != nil { 11163 return err 11164 } 11165 sudfgr.Name = &name 11166 } 11167 case "type": 11168 if v != nil { 11169 var typeVar string 11170 err = json.Unmarshal(*v, &typeVar) 11171 if err != nil { 11172 return err 11173 } 11174 sudfgr.Type = &typeVar 11175 } 11176 case "location": 11177 if v != nil { 11178 var location string 11179 err = json.Unmarshal(*v, &location) 11180 if err != nil { 11181 return err 11182 } 11183 sudfgr.Location = &location 11184 } 11185 case "tags": 11186 if v != nil { 11187 var tags map[string]*string 11188 err = json.Unmarshal(*v, &tags) 11189 if err != nil { 11190 return err 11191 } 11192 sudfgr.Tags = tags 11193 } 11194 case "identity": 11195 if v != nil { 11196 var identity ManagedServiceIdentity 11197 err = json.Unmarshal(*v, &identity) 11198 if err != nil { 11199 return err 11200 } 11201 sudfgr.Identity = &identity 11202 } 11203 } 11204 } 11205 11206 return nil 11207} 11208 11209// SQLUserDefinedFunctionListResult the List operation response, that contains the userDefinedFunctions and 11210// their properties. 11211type SQLUserDefinedFunctionListResult struct { 11212 autorest.Response `json:"-"` 11213 // Value - READ-ONLY; List of userDefinedFunctions and their properties. 11214 Value *[]SQLUserDefinedFunctionGetResults `json:"value,omitempty"` 11215} 11216 11217// MarshalJSON is the custom marshaler for SQLUserDefinedFunctionListResult. 11218func (sudflr SQLUserDefinedFunctionListResult) MarshalJSON() ([]byte, error) { 11219 objectMap := make(map[string]interface{}) 11220 return json.Marshal(objectMap) 11221} 11222 11223// SQLUserDefinedFunctionResource cosmos DB SQL userDefinedFunction resource object 11224type SQLUserDefinedFunctionResource struct { 11225 // ID - Name of the Cosmos DB SQL userDefinedFunction 11226 ID *string `json:"id,omitempty"` 11227 // Body - Body of the User Defined Function 11228 Body *string `json:"body,omitempty"` 11229} 11230 11231// SystemData metadata pertaining to creation and last modification of the resource. 11232type SystemData struct { 11233 // CreatedBy - The identity that created the resource. 11234 CreatedBy *string `json:"createdBy,omitempty"` 11235 // CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' 11236 CreatedByType CreatedByType `json:"createdByType,omitempty"` 11237 // CreatedAt - The timestamp of resource creation (UTC). 11238 CreatedAt *date.Time `json:"createdAt,omitempty"` 11239 // LastModifiedBy - The identity that last modified the resource. 11240 LastModifiedBy *string `json:"lastModifiedBy,omitempty"` 11241 // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' 11242 LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` 11243 // LastModifiedAt - The timestamp of resource last modification (UTC) 11244 LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` 11245} 11246 11247// TableCreateUpdateParameters parameters to create and update Cosmos DB Table. 11248type TableCreateUpdateParameters struct { 11249 // TableCreateUpdateProperties - Properties to create and update Azure Cosmos DB Table. 11250 *TableCreateUpdateProperties `json:"properties,omitempty"` 11251 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 11252 ID *string `json:"id,omitempty"` 11253 // Name - READ-ONLY; The name of the ARM resource. 11254 Name *string `json:"name,omitempty"` 11255 // Type - READ-ONLY; The type of Azure resource. 11256 Type *string `json:"type,omitempty"` 11257 // Location - The location of the resource group to which the resource belongs. 11258 Location *string `json:"location,omitempty"` 11259 Tags map[string]*string `json:"tags"` 11260 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 11261} 11262 11263// MarshalJSON is the custom marshaler for TableCreateUpdateParameters. 11264func (tcup TableCreateUpdateParameters) MarshalJSON() ([]byte, error) { 11265 objectMap := make(map[string]interface{}) 11266 if tcup.TableCreateUpdateProperties != nil { 11267 objectMap["properties"] = tcup.TableCreateUpdateProperties 11268 } 11269 if tcup.Location != nil { 11270 objectMap["location"] = tcup.Location 11271 } 11272 if tcup.Tags != nil { 11273 objectMap["tags"] = tcup.Tags 11274 } 11275 if tcup.Identity != nil { 11276 objectMap["identity"] = tcup.Identity 11277 } 11278 return json.Marshal(objectMap) 11279} 11280 11281// UnmarshalJSON is the custom unmarshaler for TableCreateUpdateParameters struct. 11282func (tcup *TableCreateUpdateParameters) UnmarshalJSON(body []byte) error { 11283 var m map[string]*json.RawMessage 11284 err := json.Unmarshal(body, &m) 11285 if err != nil { 11286 return err 11287 } 11288 for k, v := range m { 11289 switch k { 11290 case "properties": 11291 if v != nil { 11292 var tableCreateUpdateProperties TableCreateUpdateProperties 11293 err = json.Unmarshal(*v, &tableCreateUpdateProperties) 11294 if err != nil { 11295 return err 11296 } 11297 tcup.TableCreateUpdateProperties = &tableCreateUpdateProperties 11298 } 11299 case "id": 11300 if v != nil { 11301 var ID string 11302 err = json.Unmarshal(*v, &ID) 11303 if err != nil { 11304 return err 11305 } 11306 tcup.ID = &ID 11307 } 11308 case "name": 11309 if v != nil { 11310 var name string 11311 err = json.Unmarshal(*v, &name) 11312 if err != nil { 11313 return err 11314 } 11315 tcup.Name = &name 11316 } 11317 case "type": 11318 if v != nil { 11319 var typeVar string 11320 err = json.Unmarshal(*v, &typeVar) 11321 if err != nil { 11322 return err 11323 } 11324 tcup.Type = &typeVar 11325 } 11326 case "location": 11327 if v != nil { 11328 var location string 11329 err = json.Unmarshal(*v, &location) 11330 if err != nil { 11331 return err 11332 } 11333 tcup.Location = &location 11334 } 11335 case "tags": 11336 if v != nil { 11337 var tags map[string]*string 11338 err = json.Unmarshal(*v, &tags) 11339 if err != nil { 11340 return err 11341 } 11342 tcup.Tags = tags 11343 } 11344 case "identity": 11345 if v != nil { 11346 var identity ManagedServiceIdentity 11347 err = json.Unmarshal(*v, &identity) 11348 if err != nil { 11349 return err 11350 } 11351 tcup.Identity = &identity 11352 } 11353 } 11354 } 11355 11356 return nil 11357} 11358 11359// TableCreateUpdateProperties properties to create and update Azure Cosmos DB Table. 11360type TableCreateUpdateProperties struct { 11361 // Resource - The standard JSON format of a Table 11362 Resource *TableResource `json:"resource,omitempty"` 11363 // Options - A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. 11364 Options *CreateUpdateOptions `json:"options,omitempty"` 11365} 11366 11367// TableGetProperties the properties of an Azure Cosmos Table 11368type TableGetProperties struct { 11369 Resource *TableGetPropertiesResource `json:"resource,omitempty"` 11370 Options *TableGetPropertiesOptions `json:"options,omitempty"` 11371} 11372 11373// TableGetPropertiesOptions ... 11374type TableGetPropertiesOptions struct { 11375 // Throughput - Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when retrieving offer details. 11376 Throughput *int32 `json:"throughput,omitempty"` 11377 // AutoscaleSettings - Specifies the Autoscale settings. 11378 AutoscaleSettings *AutoscaleSettings `json:"autoscaleSettings,omitempty"` 11379} 11380 11381// TableGetPropertiesResource ... 11382type TableGetPropertiesResource struct { 11383 // ID - Name of the Cosmos DB table 11384 ID *string `json:"id,omitempty"` 11385 // Rid - READ-ONLY; A system generated property. A unique identifier. 11386 Rid *string `json:"_rid,omitempty"` 11387 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 11388 Ts *float64 `json:"_ts,omitempty"` 11389 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 11390 Etag *string `json:"_etag,omitempty"` 11391} 11392 11393// MarshalJSON is the custom marshaler for TableGetPropertiesResource. 11394func (tgp TableGetPropertiesResource) MarshalJSON() ([]byte, error) { 11395 objectMap := make(map[string]interface{}) 11396 if tgp.ID != nil { 11397 objectMap["id"] = tgp.ID 11398 } 11399 return json.Marshal(objectMap) 11400} 11401 11402// TableGetResults an Azure Cosmos DB Table. 11403type TableGetResults struct { 11404 autorest.Response `json:"-"` 11405 // TableGetProperties - The properties of an Azure Cosmos DB Table 11406 *TableGetProperties `json:"properties,omitempty"` 11407 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 11408 ID *string `json:"id,omitempty"` 11409 // Name - READ-ONLY; The name of the ARM resource. 11410 Name *string `json:"name,omitempty"` 11411 // Type - READ-ONLY; The type of Azure resource. 11412 Type *string `json:"type,omitempty"` 11413 // Location - The location of the resource group to which the resource belongs. 11414 Location *string `json:"location,omitempty"` 11415 Tags map[string]*string `json:"tags"` 11416 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 11417} 11418 11419// MarshalJSON is the custom marshaler for TableGetResults. 11420func (tgr TableGetResults) MarshalJSON() ([]byte, error) { 11421 objectMap := make(map[string]interface{}) 11422 if tgr.TableGetProperties != nil { 11423 objectMap["properties"] = tgr.TableGetProperties 11424 } 11425 if tgr.Location != nil { 11426 objectMap["location"] = tgr.Location 11427 } 11428 if tgr.Tags != nil { 11429 objectMap["tags"] = tgr.Tags 11430 } 11431 if tgr.Identity != nil { 11432 objectMap["identity"] = tgr.Identity 11433 } 11434 return json.Marshal(objectMap) 11435} 11436 11437// UnmarshalJSON is the custom unmarshaler for TableGetResults struct. 11438func (tgr *TableGetResults) UnmarshalJSON(body []byte) error { 11439 var m map[string]*json.RawMessage 11440 err := json.Unmarshal(body, &m) 11441 if err != nil { 11442 return err 11443 } 11444 for k, v := range m { 11445 switch k { 11446 case "properties": 11447 if v != nil { 11448 var tableGetProperties TableGetProperties 11449 err = json.Unmarshal(*v, &tableGetProperties) 11450 if err != nil { 11451 return err 11452 } 11453 tgr.TableGetProperties = &tableGetProperties 11454 } 11455 case "id": 11456 if v != nil { 11457 var ID string 11458 err = json.Unmarshal(*v, &ID) 11459 if err != nil { 11460 return err 11461 } 11462 tgr.ID = &ID 11463 } 11464 case "name": 11465 if v != nil { 11466 var name string 11467 err = json.Unmarshal(*v, &name) 11468 if err != nil { 11469 return err 11470 } 11471 tgr.Name = &name 11472 } 11473 case "type": 11474 if v != nil { 11475 var typeVar string 11476 err = json.Unmarshal(*v, &typeVar) 11477 if err != nil { 11478 return err 11479 } 11480 tgr.Type = &typeVar 11481 } 11482 case "location": 11483 if v != nil { 11484 var location string 11485 err = json.Unmarshal(*v, &location) 11486 if err != nil { 11487 return err 11488 } 11489 tgr.Location = &location 11490 } 11491 case "tags": 11492 if v != nil { 11493 var tags map[string]*string 11494 err = json.Unmarshal(*v, &tags) 11495 if err != nil { 11496 return err 11497 } 11498 tgr.Tags = tags 11499 } 11500 case "identity": 11501 if v != nil { 11502 var identity ManagedServiceIdentity 11503 err = json.Unmarshal(*v, &identity) 11504 if err != nil { 11505 return err 11506 } 11507 tgr.Identity = &identity 11508 } 11509 } 11510 } 11511 11512 return nil 11513} 11514 11515// TableListResult the List operation response, that contains the Table and their properties. 11516type TableListResult struct { 11517 autorest.Response `json:"-"` 11518 // Value - READ-ONLY; List of Table and their properties. 11519 Value *[]TableGetResults `json:"value,omitempty"` 11520} 11521 11522// MarshalJSON is the custom marshaler for TableListResult. 11523func (tlr TableListResult) MarshalJSON() ([]byte, error) { 11524 objectMap := make(map[string]interface{}) 11525 return json.Marshal(objectMap) 11526} 11527 11528// TableResource cosmos DB table resource object 11529type TableResource struct { 11530 // ID - Name of the Cosmos DB table 11531 ID *string `json:"id,omitempty"` 11532} 11533 11534// TableResourcesCreateUpdateTableFuture an abstraction for monitoring and retrieving the results of a 11535// long-running operation. 11536type TableResourcesCreateUpdateTableFuture struct { 11537 azure.FutureAPI 11538 // Result returns the result of the asynchronous operation. 11539 // If the operation has not completed it will return an error. 11540 Result func(TableResourcesClient) (TableGetResults, error) 11541} 11542 11543// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11544func (future *TableResourcesCreateUpdateTableFuture) UnmarshalJSON(body []byte) error { 11545 var azFuture azure.Future 11546 if err := json.Unmarshal(body, &azFuture); err != nil { 11547 return err 11548 } 11549 future.FutureAPI = &azFuture 11550 future.Result = future.result 11551 return nil 11552} 11553 11554// result is the default implementation for TableResourcesCreateUpdateTableFuture.Result. 11555func (future *TableResourcesCreateUpdateTableFuture) result(client TableResourcesClient) (tgr TableGetResults, err error) { 11556 var done bool 11557 done, err = future.DoneWithContext(context.Background(), client) 11558 if err != nil { 11559 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesCreateUpdateTableFuture", "Result", future.Response(), "Polling failure") 11560 return 11561 } 11562 if !done { 11563 tgr.Response.Response = future.Response() 11564 err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesCreateUpdateTableFuture") 11565 return 11566 } 11567 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11568 if tgr.Response.Response, err = future.GetResult(sender); err == nil && tgr.Response.Response.StatusCode != http.StatusNoContent { 11569 tgr, err = client.CreateUpdateTableResponder(tgr.Response.Response) 11570 if err != nil { 11571 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesCreateUpdateTableFuture", "Result", tgr.Response.Response, "Failure responding to request") 11572 } 11573 } 11574 return 11575} 11576 11577// TableResourcesDeleteTableFuture an abstraction for monitoring and retrieving the results of a 11578// long-running operation. 11579type TableResourcesDeleteTableFuture struct { 11580 azure.FutureAPI 11581 // Result returns the result of the asynchronous operation. 11582 // If the operation has not completed it will return an error. 11583 Result func(TableResourcesClient) (autorest.Response, error) 11584} 11585 11586// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11587func (future *TableResourcesDeleteTableFuture) UnmarshalJSON(body []byte) error { 11588 var azFuture azure.Future 11589 if err := json.Unmarshal(body, &azFuture); err != nil { 11590 return err 11591 } 11592 future.FutureAPI = &azFuture 11593 future.Result = future.result 11594 return nil 11595} 11596 11597// result is the default implementation for TableResourcesDeleteTableFuture.Result. 11598func (future *TableResourcesDeleteTableFuture) result(client TableResourcesClient) (ar autorest.Response, err error) { 11599 var done bool 11600 done, err = future.DoneWithContext(context.Background(), client) 11601 if err != nil { 11602 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesDeleteTableFuture", "Result", future.Response(), "Polling failure") 11603 return 11604 } 11605 if !done { 11606 ar.Response = future.Response() 11607 err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesDeleteTableFuture") 11608 return 11609 } 11610 ar.Response = future.Response() 11611 return 11612} 11613 11614// TableResourcesMigrateTableToAutoscaleFuture an abstraction for monitoring and retrieving the results of 11615// a long-running operation. 11616type TableResourcesMigrateTableToAutoscaleFuture struct { 11617 azure.FutureAPI 11618 // Result returns the result of the asynchronous operation. 11619 // If the operation has not completed it will return an error. 11620 Result func(TableResourcesClient) (ThroughputSettingsGetResults, error) 11621} 11622 11623// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11624func (future *TableResourcesMigrateTableToAutoscaleFuture) UnmarshalJSON(body []byte) error { 11625 var azFuture azure.Future 11626 if err := json.Unmarshal(body, &azFuture); err != nil { 11627 return err 11628 } 11629 future.FutureAPI = &azFuture 11630 future.Result = future.result 11631 return nil 11632} 11633 11634// result is the default implementation for TableResourcesMigrateTableToAutoscaleFuture.Result. 11635func (future *TableResourcesMigrateTableToAutoscaleFuture) result(client TableResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 11636 var done bool 11637 done, err = future.DoneWithContext(context.Background(), client) 11638 if err != nil { 11639 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToAutoscaleFuture", "Result", future.Response(), "Polling failure") 11640 return 11641 } 11642 if !done { 11643 tsgr.Response.Response = future.Response() 11644 err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesMigrateTableToAutoscaleFuture") 11645 return 11646 } 11647 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11648 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 11649 tsgr, err = client.MigrateTableToAutoscaleResponder(tsgr.Response.Response) 11650 if err != nil { 11651 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToAutoscaleFuture", "Result", tsgr.Response.Response, "Failure responding to request") 11652 } 11653 } 11654 return 11655} 11656 11657// TableResourcesMigrateTableToManualThroughputFuture an abstraction for monitoring and retrieving the 11658// results of a long-running operation. 11659type TableResourcesMigrateTableToManualThroughputFuture struct { 11660 azure.FutureAPI 11661 // Result returns the result of the asynchronous operation. 11662 // If the operation has not completed it will return an error. 11663 Result func(TableResourcesClient) (ThroughputSettingsGetResults, error) 11664} 11665 11666// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11667func (future *TableResourcesMigrateTableToManualThroughputFuture) UnmarshalJSON(body []byte) error { 11668 var azFuture azure.Future 11669 if err := json.Unmarshal(body, &azFuture); err != nil { 11670 return err 11671 } 11672 future.FutureAPI = &azFuture 11673 future.Result = future.result 11674 return nil 11675} 11676 11677// result is the default implementation for TableResourcesMigrateTableToManualThroughputFuture.Result. 11678func (future *TableResourcesMigrateTableToManualThroughputFuture) result(client TableResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 11679 var done bool 11680 done, err = future.DoneWithContext(context.Background(), client) 11681 if err != nil { 11682 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToManualThroughputFuture", "Result", future.Response(), "Polling failure") 11683 return 11684 } 11685 if !done { 11686 tsgr.Response.Response = future.Response() 11687 err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesMigrateTableToManualThroughputFuture") 11688 return 11689 } 11690 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11691 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 11692 tsgr, err = client.MigrateTableToManualThroughputResponder(tsgr.Response.Response) 11693 if err != nil { 11694 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesMigrateTableToManualThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 11695 } 11696 } 11697 return 11698} 11699 11700// TableResourcesUpdateTableThroughputFuture an abstraction for monitoring and retrieving the results of a 11701// long-running operation. 11702type TableResourcesUpdateTableThroughputFuture struct { 11703 azure.FutureAPI 11704 // Result returns the result of the asynchronous operation. 11705 // If the operation has not completed it will return an error. 11706 Result func(TableResourcesClient) (ThroughputSettingsGetResults, error) 11707} 11708 11709// UnmarshalJSON is the custom unmarshaller for CreateFuture. 11710func (future *TableResourcesUpdateTableThroughputFuture) UnmarshalJSON(body []byte) error { 11711 var azFuture azure.Future 11712 if err := json.Unmarshal(body, &azFuture); err != nil { 11713 return err 11714 } 11715 future.FutureAPI = &azFuture 11716 future.Result = future.result 11717 return nil 11718} 11719 11720// result is the default implementation for TableResourcesUpdateTableThroughputFuture.Result. 11721func (future *TableResourcesUpdateTableThroughputFuture) result(client TableResourcesClient) (tsgr ThroughputSettingsGetResults, err error) { 11722 var done bool 11723 done, err = future.DoneWithContext(context.Background(), client) 11724 if err != nil { 11725 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesUpdateTableThroughputFuture", "Result", future.Response(), "Polling failure") 11726 return 11727 } 11728 if !done { 11729 tsgr.Response.Response = future.Response() 11730 err = azure.NewAsyncOpIncompleteError("documentdb.TableResourcesUpdateTableThroughputFuture") 11731 return 11732 } 11733 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11734 if tsgr.Response.Response, err = future.GetResult(sender); err == nil && tsgr.Response.Response.StatusCode != http.StatusNoContent { 11735 tsgr, err = client.UpdateTableThroughputResponder(tsgr.Response.Response) 11736 if err != nil { 11737 err = autorest.NewErrorWithError(err, "documentdb.TableResourcesUpdateTableThroughputFuture", "Result", tsgr.Response.Response, "Failure responding to request") 11738 } 11739 } 11740 return 11741} 11742 11743// ThroughputPolicyResource cosmos DB resource throughput policy 11744type ThroughputPolicyResource struct { 11745 // IsEnabled - Determines whether the ThroughputPolicy is active or not 11746 IsEnabled *bool `json:"isEnabled,omitempty"` 11747 // IncrementPercent - Represents the percentage by which throughput can increase every time throughput policy kicks in. 11748 IncrementPercent *int32 `json:"incrementPercent,omitempty"` 11749} 11750 11751// ThroughputSettingsGetProperties the properties of an Azure Cosmos DB resource throughput 11752type ThroughputSettingsGetProperties struct { 11753 Resource *ThroughputSettingsGetPropertiesResource `json:"resource,omitempty"` 11754} 11755 11756// ThroughputSettingsGetPropertiesResource ... 11757type ThroughputSettingsGetPropertiesResource struct { 11758 // Throughput - Value of the Cosmos DB resource throughput. Either throughput is required or autoscaleSettings is required, but not both. 11759 Throughput *int32 `json:"throughput,omitempty"` 11760 // AutoscaleSettings - Cosmos DB resource for autoscale settings. Either throughput is required or autoscaleSettings is required, but not both. 11761 AutoscaleSettings *AutoscaleSettingsResource `json:"autoscaleSettings,omitempty"` 11762 // MinimumThroughput - READ-ONLY; The minimum throughput of the resource 11763 MinimumThroughput *string `json:"minimumThroughput,omitempty"` 11764 // OfferReplacePending - READ-ONLY; The throughput replace is pending 11765 OfferReplacePending *string `json:"offerReplacePending,omitempty"` 11766 // Rid - READ-ONLY; A system generated property. A unique identifier. 11767 Rid *string `json:"_rid,omitempty"` 11768 // Ts - READ-ONLY; A system generated property that denotes the last updated timestamp of the resource. 11769 Ts *float64 `json:"_ts,omitempty"` 11770 // Etag - READ-ONLY; A system generated property representing the resource etag required for optimistic concurrency control. 11771 Etag *string `json:"_etag,omitempty"` 11772} 11773 11774// MarshalJSON is the custom marshaler for ThroughputSettingsGetPropertiesResource. 11775func (tsgp ThroughputSettingsGetPropertiesResource) MarshalJSON() ([]byte, error) { 11776 objectMap := make(map[string]interface{}) 11777 if tsgp.Throughput != nil { 11778 objectMap["throughput"] = tsgp.Throughput 11779 } 11780 if tsgp.AutoscaleSettings != nil { 11781 objectMap["autoscaleSettings"] = tsgp.AutoscaleSettings 11782 } 11783 return json.Marshal(objectMap) 11784} 11785 11786// ThroughputSettingsGetResults an Azure Cosmos DB resource throughput. 11787type ThroughputSettingsGetResults struct { 11788 autorest.Response `json:"-"` 11789 // ThroughputSettingsGetProperties - The properties of an Azure Cosmos DB resource throughput 11790 *ThroughputSettingsGetProperties `json:"properties,omitempty"` 11791 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 11792 ID *string `json:"id,omitempty"` 11793 // Name - READ-ONLY; The name of the ARM resource. 11794 Name *string `json:"name,omitempty"` 11795 // Type - READ-ONLY; The type of Azure resource. 11796 Type *string `json:"type,omitempty"` 11797 // Location - The location of the resource group to which the resource belongs. 11798 Location *string `json:"location,omitempty"` 11799 Tags map[string]*string `json:"tags"` 11800 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 11801} 11802 11803// MarshalJSON is the custom marshaler for ThroughputSettingsGetResults. 11804func (tsgr ThroughputSettingsGetResults) MarshalJSON() ([]byte, error) { 11805 objectMap := make(map[string]interface{}) 11806 if tsgr.ThroughputSettingsGetProperties != nil { 11807 objectMap["properties"] = tsgr.ThroughputSettingsGetProperties 11808 } 11809 if tsgr.Location != nil { 11810 objectMap["location"] = tsgr.Location 11811 } 11812 if tsgr.Tags != nil { 11813 objectMap["tags"] = tsgr.Tags 11814 } 11815 if tsgr.Identity != nil { 11816 objectMap["identity"] = tsgr.Identity 11817 } 11818 return json.Marshal(objectMap) 11819} 11820 11821// UnmarshalJSON is the custom unmarshaler for ThroughputSettingsGetResults struct. 11822func (tsgr *ThroughputSettingsGetResults) UnmarshalJSON(body []byte) error { 11823 var m map[string]*json.RawMessage 11824 err := json.Unmarshal(body, &m) 11825 if err != nil { 11826 return err 11827 } 11828 for k, v := range m { 11829 switch k { 11830 case "properties": 11831 if v != nil { 11832 var throughputSettingsGetProperties ThroughputSettingsGetProperties 11833 err = json.Unmarshal(*v, &throughputSettingsGetProperties) 11834 if err != nil { 11835 return err 11836 } 11837 tsgr.ThroughputSettingsGetProperties = &throughputSettingsGetProperties 11838 } 11839 case "id": 11840 if v != nil { 11841 var ID string 11842 err = json.Unmarshal(*v, &ID) 11843 if err != nil { 11844 return err 11845 } 11846 tsgr.ID = &ID 11847 } 11848 case "name": 11849 if v != nil { 11850 var name string 11851 err = json.Unmarshal(*v, &name) 11852 if err != nil { 11853 return err 11854 } 11855 tsgr.Name = &name 11856 } 11857 case "type": 11858 if v != nil { 11859 var typeVar string 11860 err = json.Unmarshal(*v, &typeVar) 11861 if err != nil { 11862 return err 11863 } 11864 tsgr.Type = &typeVar 11865 } 11866 case "location": 11867 if v != nil { 11868 var location string 11869 err = json.Unmarshal(*v, &location) 11870 if err != nil { 11871 return err 11872 } 11873 tsgr.Location = &location 11874 } 11875 case "tags": 11876 if v != nil { 11877 var tags map[string]*string 11878 err = json.Unmarshal(*v, &tags) 11879 if err != nil { 11880 return err 11881 } 11882 tsgr.Tags = tags 11883 } 11884 case "identity": 11885 if v != nil { 11886 var identity ManagedServiceIdentity 11887 err = json.Unmarshal(*v, &identity) 11888 if err != nil { 11889 return err 11890 } 11891 tsgr.Identity = &identity 11892 } 11893 } 11894 } 11895 11896 return nil 11897} 11898 11899// ThroughputSettingsResource cosmos DB resource throughput object. Either throughput is required or 11900// autoscaleSettings is required, but not both. 11901type ThroughputSettingsResource struct { 11902 // Throughput - Value of the Cosmos DB resource throughput. Either throughput is required or autoscaleSettings is required, but not both. 11903 Throughput *int32 `json:"throughput,omitempty"` 11904 // AutoscaleSettings - Cosmos DB resource for autoscale settings. Either throughput is required or autoscaleSettings is required, but not both. 11905 AutoscaleSettings *AutoscaleSettingsResource `json:"autoscaleSettings,omitempty"` 11906 // MinimumThroughput - READ-ONLY; The minimum throughput of the resource 11907 MinimumThroughput *string `json:"minimumThroughput,omitempty"` 11908 // OfferReplacePending - READ-ONLY; The throughput replace is pending 11909 OfferReplacePending *string `json:"offerReplacePending,omitempty"` 11910} 11911 11912// MarshalJSON is the custom marshaler for ThroughputSettingsResource. 11913func (tsr ThroughputSettingsResource) MarshalJSON() ([]byte, error) { 11914 objectMap := make(map[string]interface{}) 11915 if tsr.Throughput != nil { 11916 objectMap["throughput"] = tsr.Throughput 11917 } 11918 if tsr.AutoscaleSettings != nil { 11919 objectMap["autoscaleSettings"] = tsr.AutoscaleSettings 11920 } 11921 return json.Marshal(objectMap) 11922} 11923 11924// ThroughputSettingsUpdateParameters parameters to update Cosmos DB resource throughput. 11925type ThroughputSettingsUpdateParameters struct { 11926 // ThroughputSettingsUpdateProperties - Properties to update Azure Cosmos DB resource throughput. 11927 *ThroughputSettingsUpdateProperties `json:"properties,omitempty"` 11928 // ID - READ-ONLY; The unique resource identifier of the ARM resource. 11929 ID *string `json:"id,omitempty"` 11930 // Name - READ-ONLY; The name of the ARM resource. 11931 Name *string `json:"name,omitempty"` 11932 // Type - READ-ONLY; The type of Azure resource. 11933 Type *string `json:"type,omitempty"` 11934 // Location - The location of the resource group to which the resource belongs. 11935 Location *string `json:"location,omitempty"` 11936 Tags map[string]*string `json:"tags"` 11937 Identity *ManagedServiceIdentity `json:"identity,omitempty"` 11938} 11939 11940// MarshalJSON is the custom marshaler for ThroughputSettingsUpdateParameters. 11941func (tsup ThroughputSettingsUpdateParameters) MarshalJSON() ([]byte, error) { 11942 objectMap := make(map[string]interface{}) 11943 if tsup.ThroughputSettingsUpdateProperties != nil { 11944 objectMap["properties"] = tsup.ThroughputSettingsUpdateProperties 11945 } 11946 if tsup.Location != nil { 11947 objectMap["location"] = tsup.Location 11948 } 11949 if tsup.Tags != nil { 11950 objectMap["tags"] = tsup.Tags 11951 } 11952 if tsup.Identity != nil { 11953 objectMap["identity"] = tsup.Identity 11954 } 11955 return json.Marshal(objectMap) 11956} 11957 11958// UnmarshalJSON is the custom unmarshaler for ThroughputSettingsUpdateParameters struct. 11959func (tsup *ThroughputSettingsUpdateParameters) UnmarshalJSON(body []byte) error { 11960 var m map[string]*json.RawMessage 11961 err := json.Unmarshal(body, &m) 11962 if err != nil { 11963 return err 11964 } 11965 for k, v := range m { 11966 switch k { 11967 case "properties": 11968 if v != nil { 11969 var throughputSettingsUpdateProperties ThroughputSettingsUpdateProperties 11970 err = json.Unmarshal(*v, &throughputSettingsUpdateProperties) 11971 if err != nil { 11972 return err 11973 } 11974 tsup.ThroughputSettingsUpdateProperties = &throughputSettingsUpdateProperties 11975 } 11976 case "id": 11977 if v != nil { 11978 var ID string 11979 err = json.Unmarshal(*v, &ID) 11980 if err != nil { 11981 return err 11982 } 11983 tsup.ID = &ID 11984 } 11985 case "name": 11986 if v != nil { 11987 var name string 11988 err = json.Unmarshal(*v, &name) 11989 if err != nil { 11990 return err 11991 } 11992 tsup.Name = &name 11993 } 11994 case "type": 11995 if v != nil { 11996 var typeVar string 11997 err = json.Unmarshal(*v, &typeVar) 11998 if err != nil { 11999 return err 12000 } 12001 tsup.Type = &typeVar 12002 } 12003 case "location": 12004 if v != nil { 12005 var location string 12006 err = json.Unmarshal(*v, &location) 12007 if err != nil { 12008 return err 12009 } 12010 tsup.Location = &location 12011 } 12012 case "tags": 12013 if v != nil { 12014 var tags map[string]*string 12015 err = json.Unmarshal(*v, &tags) 12016 if err != nil { 12017 return err 12018 } 12019 tsup.Tags = tags 12020 } 12021 case "identity": 12022 if v != nil { 12023 var identity ManagedServiceIdentity 12024 err = json.Unmarshal(*v, &identity) 12025 if err != nil { 12026 return err 12027 } 12028 tsup.Identity = &identity 12029 } 12030 } 12031 } 12032 12033 return nil 12034} 12035 12036// ThroughputSettingsUpdateProperties properties to update Azure Cosmos DB resource throughput. 12037type ThroughputSettingsUpdateProperties struct { 12038 // Resource - The standard JSON format of a resource throughput 12039 Resource *ThroughputSettingsResource `json:"resource,omitempty"` 12040} 12041 12042// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource 12043// which has 'tags' and a 'location' 12044type TrackedResource struct { 12045 // Tags - Resource tags. 12046 Tags map[string]*string `json:"tags"` 12047 // Location - The geo-location where the resource lives 12048 Location *string `json:"location,omitempty"` 12049 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 12050 ID *string `json:"id,omitempty"` 12051 // Name - READ-ONLY; The name of the resource 12052 Name *string `json:"name,omitempty"` 12053 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 12054 Type *string `json:"type,omitempty"` 12055} 12056 12057// MarshalJSON is the custom marshaler for TrackedResource. 12058func (tr TrackedResource) MarshalJSON() ([]byte, error) { 12059 objectMap := make(map[string]interface{}) 12060 if tr.Tags != nil { 12061 objectMap["tags"] = tr.Tags 12062 } 12063 if tr.Location != nil { 12064 objectMap["location"] = tr.Location 12065 } 12066 return json.Marshal(objectMap) 12067} 12068 12069// UniqueKey the unique key on that enforces uniqueness constraint on documents in the collection in the 12070// Azure Cosmos DB service. 12071type UniqueKey struct { 12072 // Paths - List of paths must be unique for each document in the Azure Cosmos DB service 12073 Paths *[]string `json:"paths,omitempty"` 12074} 12075 12076// UniqueKeyPolicy the unique key policy configuration for specifying uniqueness constraints on documents 12077// in the collection in the Azure Cosmos DB service. 12078type UniqueKeyPolicy struct { 12079 // UniqueKeys - List of unique keys on that enforces uniqueness constraint on documents in the collection in the Azure Cosmos DB service. 12080 UniqueKeys *[]UniqueKey `json:"uniqueKeys,omitempty"` 12081} 12082 12083// Usage the usage data for a usage request. 12084type Usage struct { 12085 // Unit - The unit of the metric. Possible values include: 'UnitTypeCount', 'UnitTypeBytes', 'UnitTypeSeconds', 'UnitTypePercent', 'UnitTypeCountPerSecond', 'UnitTypeBytesPerSecond', 'UnitTypeMilliseconds' 12086 Unit UnitType `json:"unit,omitempty"` 12087 // Name - READ-ONLY; The name information for the metric. 12088 Name *MetricName `json:"name,omitempty"` 12089 // QuotaPeriod - READ-ONLY; The quota period used to summarize the usage values. 12090 QuotaPeriod *string `json:"quotaPeriod,omitempty"` 12091 // Limit - READ-ONLY; Maximum value for this metric 12092 Limit *int64 `json:"limit,omitempty"` 12093 // CurrentValue - READ-ONLY; Current value for this metric 12094 CurrentValue *int64 `json:"currentValue,omitempty"` 12095} 12096 12097// MarshalJSON is the custom marshaler for Usage. 12098func (u Usage) MarshalJSON() ([]byte, error) { 12099 objectMap := make(map[string]interface{}) 12100 if u.Unit != "" { 12101 objectMap["unit"] = u.Unit 12102 } 12103 return json.Marshal(objectMap) 12104} 12105 12106// UsagesResult the response to a list usage request. 12107type UsagesResult struct { 12108 autorest.Response `json:"-"` 12109 // Value - READ-ONLY; The list of usages for the database. A usage is a point in time metric 12110 Value *[]Usage `json:"value,omitempty"` 12111} 12112 12113// MarshalJSON is the custom marshaler for UsagesResult. 12114func (ur UsagesResult) MarshalJSON() ([]byte, error) { 12115 objectMap := make(map[string]interface{}) 12116 return json.Marshal(objectMap) 12117} 12118 12119// VirtualNetworkRule virtual Network ACL Rule object 12120type VirtualNetworkRule struct { 12121 // ID - Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. 12122 ID *string `json:"id,omitempty"` 12123 // IgnoreMissingVNetServiceEndpoint - Create firewall rule before the virtual network has vnet service endpoint enabled. 12124 IgnoreMissingVNetServiceEndpoint *bool `json:"ignoreMissingVNetServiceEndpoint,omitempty"` 12125} 12126