1package kusto 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/kusto/mgmt/2021-01-01/kusto" 22 23// AttachedDatabaseConfiguration class representing an attached database configuration. 24type AttachedDatabaseConfiguration struct { 25 autorest.Response `json:"-"` 26 // Location - Resource location. 27 Location *string `json:"location,omitempty"` 28 // AttachedDatabaseConfigurationProperties - The properties of the attached database configuration. 29 *AttachedDatabaseConfigurationProperties `json:"properties,omitempty"` 30 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 31 ID *string `json:"id,omitempty"` 32 // Name - READ-ONLY; The name of the resource 33 Name *string `json:"name,omitempty"` 34 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 35 Type *string `json:"type,omitempty"` 36} 37 38// MarshalJSON is the custom marshaler for AttachedDatabaseConfiguration. 39func (adc AttachedDatabaseConfiguration) MarshalJSON() ([]byte, error) { 40 objectMap := make(map[string]interface{}) 41 if adc.Location != nil { 42 objectMap["location"] = adc.Location 43 } 44 if adc.AttachedDatabaseConfigurationProperties != nil { 45 objectMap["properties"] = adc.AttachedDatabaseConfigurationProperties 46 } 47 return json.Marshal(objectMap) 48} 49 50// UnmarshalJSON is the custom unmarshaler for AttachedDatabaseConfiguration struct. 51func (adc *AttachedDatabaseConfiguration) UnmarshalJSON(body []byte) error { 52 var m map[string]*json.RawMessage 53 err := json.Unmarshal(body, &m) 54 if err != nil { 55 return err 56 } 57 for k, v := range m { 58 switch k { 59 case "location": 60 if v != nil { 61 var location string 62 err = json.Unmarshal(*v, &location) 63 if err != nil { 64 return err 65 } 66 adc.Location = &location 67 } 68 case "properties": 69 if v != nil { 70 var attachedDatabaseConfigurationProperties AttachedDatabaseConfigurationProperties 71 err = json.Unmarshal(*v, &attachedDatabaseConfigurationProperties) 72 if err != nil { 73 return err 74 } 75 adc.AttachedDatabaseConfigurationProperties = &attachedDatabaseConfigurationProperties 76 } 77 case "id": 78 if v != nil { 79 var ID string 80 err = json.Unmarshal(*v, &ID) 81 if err != nil { 82 return err 83 } 84 adc.ID = &ID 85 } 86 case "name": 87 if v != nil { 88 var name string 89 err = json.Unmarshal(*v, &name) 90 if err != nil { 91 return err 92 } 93 adc.Name = &name 94 } 95 case "type": 96 if v != nil { 97 var typeVar string 98 err = json.Unmarshal(*v, &typeVar) 99 if err != nil { 100 return err 101 } 102 adc.Type = &typeVar 103 } 104 } 105 } 106 107 return nil 108} 109 110// AttachedDatabaseConfigurationListResult the list attached database configurations operation response. 111type AttachedDatabaseConfigurationListResult struct { 112 autorest.Response `json:"-"` 113 // Value - The list of attached database configurations. 114 Value *[]AttachedDatabaseConfiguration `json:"value,omitempty"` 115} 116 117// AttachedDatabaseConfigurationProperties class representing the an attached database configuration 118// properties of kind specific. 119type AttachedDatabaseConfigurationProperties struct { 120 // ProvisioningState - The provisioned state of the resource. Possible values include: 'ProvisioningStateRunning', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateMoving' 121 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 122 // DatabaseName - The name of the database which you would like to attach, use * if you want to follow all current and future databases. 123 DatabaseName *string `json:"databaseName,omitempty"` 124 // ClusterResourceID - The resource id of the cluster where the databases you would like to attach reside. 125 ClusterResourceID *string `json:"clusterResourceId,omitempty"` 126 // AttachedDatabaseNames - READ-ONLY; The list of databases from the clusterResourceId which are currently attached to the cluster. 127 AttachedDatabaseNames *[]string `json:"attachedDatabaseNames,omitempty"` 128 // DefaultPrincipalsModificationKind - The default principals modification kind. Possible values include: 'DefaultPrincipalsModificationKindUnion', 'DefaultPrincipalsModificationKindReplace', 'DefaultPrincipalsModificationKindNone' 129 DefaultPrincipalsModificationKind DefaultPrincipalsModificationKind `json:"defaultPrincipalsModificationKind,omitempty"` 130 // TableLevelSharingProperties - Table level sharing specifications 131 TableLevelSharingProperties *TableLevelSharingProperties `json:"tableLevelSharingProperties,omitempty"` 132} 133 134// MarshalJSON is the custom marshaler for AttachedDatabaseConfigurationProperties. 135func (adcp AttachedDatabaseConfigurationProperties) MarshalJSON() ([]byte, error) { 136 objectMap := make(map[string]interface{}) 137 if adcp.ProvisioningState != "" { 138 objectMap["provisioningState"] = adcp.ProvisioningState 139 } 140 if adcp.DatabaseName != nil { 141 objectMap["databaseName"] = adcp.DatabaseName 142 } 143 if adcp.ClusterResourceID != nil { 144 objectMap["clusterResourceId"] = adcp.ClusterResourceID 145 } 146 if adcp.DefaultPrincipalsModificationKind != "" { 147 objectMap["defaultPrincipalsModificationKind"] = adcp.DefaultPrincipalsModificationKind 148 } 149 if adcp.TableLevelSharingProperties != nil { 150 objectMap["tableLevelSharingProperties"] = adcp.TableLevelSharingProperties 151 } 152 return json.Marshal(objectMap) 153} 154 155// AttachedDatabaseConfigurationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 156// results of a long-running operation. 157type AttachedDatabaseConfigurationsCreateOrUpdateFuture struct { 158 azure.FutureAPI 159 // Result returns the result of the asynchronous operation. 160 // If the operation has not completed it will return an error. 161 Result func(AttachedDatabaseConfigurationsClient) (AttachedDatabaseConfiguration, error) 162} 163 164// UnmarshalJSON is the custom unmarshaller for CreateFuture. 165func (future *AttachedDatabaseConfigurationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 166 var azFuture azure.Future 167 if err := json.Unmarshal(body, &azFuture); err != nil { 168 return err 169 } 170 future.FutureAPI = &azFuture 171 future.Result = future.result 172 return nil 173} 174 175// result is the default implementation for AttachedDatabaseConfigurationsCreateOrUpdateFuture.Result. 176func (future *AttachedDatabaseConfigurationsCreateOrUpdateFuture) result(client AttachedDatabaseConfigurationsClient) (adc AttachedDatabaseConfiguration, err error) { 177 var done bool 178 done, err = future.DoneWithContext(context.Background(), client) 179 if err != nil { 180 err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 181 return 182 } 183 if !done { 184 adc.Response.Response = future.Response() 185 err = azure.NewAsyncOpIncompleteError("kusto.AttachedDatabaseConfigurationsCreateOrUpdateFuture") 186 return 187 } 188 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 189 if adc.Response.Response, err = future.GetResult(sender); err == nil && adc.Response.Response.StatusCode != http.StatusNoContent { 190 adc, err = client.CreateOrUpdateResponder(adc.Response.Response) 191 if err != nil { 192 err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsCreateOrUpdateFuture", "Result", adc.Response.Response, "Failure responding to request") 193 } 194 } 195 return 196} 197 198// AttachedDatabaseConfigurationsDeleteFuture an abstraction for monitoring and retrieving the results of a 199// long-running operation. 200type AttachedDatabaseConfigurationsDeleteFuture struct { 201 azure.FutureAPI 202 // Result returns the result of the asynchronous operation. 203 // If the operation has not completed it will return an error. 204 Result func(AttachedDatabaseConfigurationsClient) (autorest.Response, error) 205} 206 207// UnmarshalJSON is the custom unmarshaller for CreateFuture. 208func (future *AttachedDatabaseConfigurationsDeleteFuture) UnmarshalJSON(body []byte) error { 209 var azFuture azure.Future 210 if err := json.Unmarshal(body, &azFuture); err != nil { 211 return err 212 } 213 future.FutureAPI = &azFuture 214 future.Result = future.result 215 return nil 216} 217 218// result is the default implementation for AttachedDatabaseConfigurationsDeleteFuture.Result. 219func (future *AttachedDatabaseConfigurationsDeleteFuture) result(client AttachedDatabaseConfigurationsClient) (ar autorest.Response, err error) { 220 var done bool 221 done, err = future.DoneWithContext(context.Background(), client) 222 if err != nil { 223 err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsDeleteFuture", "Result", future.Response(), "Polling failure") 224 return 225 } 226 if !done { 227 ar.Response = future.Response() 228 err = azure.NewAsyncOpIncompleteError("kusto.AttachedDatabaseConfigurationsDeleteFuture") 229 return 230 } 231 ar.Response = future.Response() 232 return 233} 234 235// AzureCapacity azure capacity definition. 236type AzureCapacity struct { 237 // ScaleType - Scale type. Possible values include: 'AzureScaleTypeAutomatic', 'AzureScaleTypeManual', 'AzureScaleTypeNone' 238 ScaleType AzureScaleType `json:"scaleType,omitempty"` 239 // Minimum - Minimum allowed capacity. 240 Minimum *int32 `json:"minimum,omitempty"` 241 // Maximum - Maximum allowed capacity. 242 Maximum *int32 `json:"maximum,omitempty"` 243 // Default - The default capacity that would be used. 244 Default *int32 `json:"default,omitempty"` 245} 246 247// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. 248type AzureEntityResource struct { 249 // Etag - READ-ONLY; Resource Etag. 250 Etag *string `json:"etag,omitempty"` 251 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 252 ID *string `json:"id,omitempty"` 253 // Name - READ-ONLY; The name of the resource 254 Name *string `json:"name,omitempty"` 255 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 256 Type *string `json:"type,omitempty"` 257} 258 259// MarshalJSON is the custom marshaler for AzureEntityResource. 260func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { 261 objectMap := make(map[string]interface{}) 262 return json.Marshal(objectMap) 263} 264 265// AzureResourceSku azure resource SKU definition. 266type AzureResourceSku struct { 267 // ResourceType - Resource Namespace and Type. 268 ResourceType *string `json:"resourceType,omitempty"` 269 // Sku - The SKU details. 270 Sku *AzureSku `json:"sku,omitempty"` 271 // Capacity - The number of instances of the cluster. 272 Capacity *AzureCapacity `json:"capacity,omitempty"` 273} 274 275// AzureSku azure SKU definition. 276type AzureSku struct { 277 // Name - SKU name. Possible values include: 'AzureSkuNameStandardDS13V21TBPS', 'AzureSkuNameStandardDS13V22TBPS', 'AzureSkuNameStandardDS14V23TBPS', 'AzureSkuNameStandardDS14V24TBPS', 'AzureSkuNameStandardD13V2', 'AzureSkuNameStandardD14V2', 'AzureSkuNameStandardL8s', 'AzureSkuNameStandardL16s', 'AzureSkuNameStandardL8sV2', 'AzureSkuNameStandardL16sV2', 'AzureSkuNameStandardD11V2', 'AzureSkuNameStandardD12V2', 'AzureSkuNameStandardL4s', 'AzureSkuNameDevNoSLAStandardD11V2', 'AzureSkuNameStandardE64iV3', 'AzureSkuNameStandardE80idsV4', 'AzureSkuNameStandardE2aV4', 'AzureSkuNameStandardE4aV4', 'AzureSkuNameStandardE8aV4', 'AzureSkuNameStandardE16aV4', 'AzureSkuNameStandardE8asV41TBPS', 'AzureSkuNameStandardE8asV42TBPS', 'AzureSkuNameStandardE16asV43TBPS', 'AzureSkuNameStandardE16asV44TBPS', 'AzureSkuNameDevNoSLAStandardE2aV4' 278 Name AzureSkuName `json:"name,omitempty"` 279 // Capacity - The number of instances of the cluster. 280 Capacity *int32 `json:"capacity,omitempty"` 281 // Tier - SKU tier. Possible values include: 'AzureSkuTierBasic', 'AzureSkuTierStandard' 282 Tier AzureSkuTier `json:"tier,omitempty"` 283} 284 285// CheckNameRequest the result returned from a database check name availability request. 286type CheckNameRequest struct { 287 // Name - Resource name. 288 Name *string `json:"name,omitempty"` 289 // Type - The type of resource, for instance Microsoft.Kusto/clusters/databases. Possible values include: 'TypeMicrosoftKustoclustersdatabases', 'TypeMicrosoftKustoclustersattachedDatabaseConfigurations' 290 Type Type `json:"type,omitempty"` 291} 292 293// CheckNameResult the result returned from a check name availability request. 294type CheckNameResult struct { 295 autorest.Response `json:"-"` 296 // NameAvailable - Specifies a Boolean value that indicates if the name is available. 297 NameAvailable *bool `json:"nameAvailable,omitempty"` 298 // Name - The name that was checked. 299 Name *string `json:"name,omitempty"` 300 // Message - Message indicating an unavailable name due to a conflict, or a description of the naming rules that are violated. 301 Message *string `json:"message,omitempty"` 302 // Reason - Message providing the reason why the given name is invalid. Possible values include: 'ReasonInvalid', 'ReasonAlreadyExists' 303 Reason Reason `json:"reason,omitempty"` 304} 305 306// CloudError an error response from Kusto. 307type CloudError struct { 308 // Error - An error response from Kusto. 309 Error *CloudErrorBody `json:"error,omitempty"` 310} 311 312// CloudErrorBody an error response from Kusto. 313type CloudErrorBody struct { 314 // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. 315 Code *string `json:"code,omitempty"` 316 // Message - A message describing the error, intended to be suitable for displaying in a user interface. 317 Message *string `json:"message,omitempty"` 318 // Target - The target of the particular error. For example, the name of the property in error. 319 Target *string `json:"target,omitempty"` 320 // Details - A list of additional details about the error. 321 Details *[]CloudErrorBody `json:"details,omitempty"` 322} 323 324// Cluster class representing a Kusto cluster. 325type Cluster struct { 326 autorest.Response `json:"-"` 327 // Sku - The SKU of the cluster. 328 Sku *AzureSku `json:"sku,omitempty"` 329 // Zones - The availability zones of the cluster. 330 Zones *[]string `json:"zones,omitempty"` 331 // Identity - The identity of the cluster, if configured. 332 Identity *Identity `json:"identity,omitempty"` 333 // ClusterProperties - The cluster properties. 334 *ClusterProperties `json:"properties,omitempty"` 335 // Etag - READ-ONLY; A unique read-only string that changes whenever the resource is updated. 336 Etag *string `json:"etag,omitempty"` 337 // Tags - Resource tags. 338 Tags map[string]*string `json:"tags"` 339 // Location - The geo-location where the resource lives 340 Location *string `json:"location,omitempty"` 341 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 342 ID *string `json:"id,omitempty"` 343 // Name - READ-ONLY; The name of the resource 344 Name *string `json:"name,omitempty"` 345 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 346 Type *string `json:"type,omitempty"` 347} 348 349// MarshalJSON is the custom marshaler for Cluster. 350func (c Cluster) MarshalJSON() ([]byte, error) { 351 objectMap := make(map[string]interface{}) 352 if c.Sku != nil { 353 objectMap["sku"] = c.Sku 354 } 355 if c.Zones != nil { 356 objectMap["zones"] = c.Zones 357 } 358 if c.Identity != nil { 359 objectMap["identity"] = c.Identity 360 } 361 if c.ClusterProperties != nil { 362 objectMap["properties"] = c.ClusterProperties 363 } 364 if c.Tags != nil { 365 objectMap["tags"] = c.Tags 366 } 367 if c.Location != nil { 368 objectMap["location"] = c.Location 369 } 370 return json.Marshal(objectMap) 371} 372 373// UnmarshalJSON is the custom unmarshaler for Cluster struct. 374func (c *Cluster) UnmarshalJSON(body []byte) error { 375 var m map[string]*json.RawMessage 376 err := json.Unmarshal(body, &m) 377 if err != nil { 378 return err 379 } 380 for k, v := range m { 381 switch k { 382 case "sku": 383 if v != nil { 384 var sku AzureSku 385 err = json.Unmarshal(*v, &sku) 386 if err != nil { 387 return err 388 } 389 c.Sku = &sku 390 } 391 case "zones": 392 if v != nil { 393 var zones []string 394 err = json.Unmarshal(*v, &zones) 395 if err != nil { 396 return err 397 } 398 c.Zones = &zones 399 } 400 case "identity": 401 if v != nil { 402 var identity Identity 403 err = json.Unmarshal(*v, &identity) 404 if err != nil { 405 return err 406 } 407 c.Identity = &identity 408 } 409 case "properties": 410 if v != nil { 411 var clusterProperties ClusterProperties 412 err = json.Unmarshal(*v, &clusterProperties) 413 if err != nil { 414 return err 415 } 416 c.ClusterProperties = &clusterProperties 417 } 418 case "etag": 419 if v != nil { 420 var etag string 421 err = json.Unmarshal(*v, &etag) 422 if err != nil { 423 return err 424 } 425 c.Etag = &etag 426 } 427 case "tags": 428 if v != nil { 429 var tags map[string]*string 430 err = json.Unmarshal(*v, &tags) 431 if err != nil { 432 return err 433 } 434 c.Tags = tags 435 } 436 case "location": 437 if v != nil { 438 var location string 439 err = json.Unmarshal(*v, &location) 440 if err != nil { 441 return err 442 } 443 c.Location = &location 444 } 445 case "id": 446 if v != nil { 447 var ID string 448 err = json.Unmarshal(*v, &ID) 449 if err != nil { 450 return err 451 } 452 c.ID = &ID 453 } 454 case "name": 455 if v != nil { 456 var name string 457 err = json.Unmarshal(*v, &name) 458 if err != nil { 459 return err 460 } 461 c.Name = &name 462 } 463 case "type": 464 if v != nil { 465 var typeVar string 466 err = json.Unmarshal(*v, &typeVar) 467 if err != nil { 468 return err 469 } 470 c.Type = &typeVar 471 } 472 } 473 } 474 475 return nil 476} 477 478// ClusterCheckNameRequest the result returned from a cluster check name availability request. 479type ClusterCheckNameRequest struct { 480 // Name - Cluster name. 481 Name *string `json:"name,omitempty"` 482 // Type - The type of resource, Microsoft.Kusto/clusters. 483 Type *string `json:"type,omitempty"` 484} 485 486// ClusterListResult the list Kusto clusters operation response. 487type ClusterListResult struct { 488 autorest.Response `json:"-"` 489 // Value - The list of Kusto clusters. 490 Value *[]Cluster `json:"value,omitempty"` 491} 492 493// ClusterPrincipalAssignment class representing a cluster principal assignment. 494type ClusterPrincipalAssignment struct { 495 autorest.Response `json:"-"` 496 // ClusterPrincipalProperties - The cluster principal. 497 *ClusterPrincipalProperties `json:"properties,omitempty"` 498 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 499 ID *string `json:"id,omitempty"` 500 // Name - READ-ONLY; The name of the resource 501 Name *string `json:"name,omitempty"` 502 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 503 Type *string `json:"type,omitempty"` 504} 505 506// MarshalJSON is the custom marshaler for ClusterPrincipalAssignment. 507func (cpa ClusterPrincipalAssignment) MarshalJSON() ([]byte, error) { 508 objectMap := make(map[string]interface{}) 509 if cpa.ClusterPrincipalProperties != nil { 510 objectMap["properties"] = cpa.ClusterPrincipalProperties 511 } 512 return json.Marshal(objectMap) 513} 514 515// UnmarshalJSON is the custom unmarshaler for ClusterPrincipalAssignment struct. 516func (cpa *ClusterPrincipalAssignment) UnmarshalJSON(body []byte) error { 517 var m map[string]*json.RawMessage 518 err := json.Unmarshal(body, &m) 519 if err != nil { 520 return err 521 } 522 for k, v := range m { 523 switch k { 524 case "properties": 525 if v != nil { 526 var clusterPrincipalProperties ClusterPrincipalProperties 527 err = json.Unmarshal(*v, &clusterPrincipalProperties) 528 if err != nil { 529 return err 530 } 531 cpa.ClusterPrincipalProperties = &clusterPrincipalProperties 532 } 533 case "id": 534 if v != nil { 535 var ID string 536 err = json.Unmarshal(*v, &ID) 537 if err != nil { 538 return err 539 } 540 cpa.ID = &ID 541 } 542 case "name": 543 if v != nil { 544 var name string 545 err = json.Unmarshal(*v, &name) 546 if err != nil { 547 return err 548 } 549 cpa.Name = &name 550 } 551 case "type": 552 if v != nil { 553 var typeVar string 554 err = json.Unmarshal(*v, &typeVar) 555 if err != nil { 556 return err 557 } 558 cpa.Type = &typeVar 559 } 560 } 561 } 562 563 return nil 564} 565 566// ClusterPrincipalAssignmentCheckNameRequest a principal assignment check name availability request. 567type ClusterPrincipalAssignmentCheckNameRequest struct { 568 // Name - Principal Assignment resource name. 569 Name *string `json:"name,omitempty"` 570 // Type - The type of resource, Microsoft.Kusto/clusters/principalAssignments. 571 Type *string `json:"type,omitempty"` 572} 573 574// ClusterPrincipalAssignmentListResult the list Kusto cluster principal assignments operation response. 575type ClusterPrincipalAssignmentListResult struct { 576 autorest.Response `json:"-"` 577 // Value - The list of Kusto cluster principal assignments. 578 Value *[]ClusterPrincipalAssignment `json:"value,omitempty"` 579} 580 581// ClusterPrincipalAssignmentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 582// of a long-running operation. 583type ClusterPrincipalAssignmentsCreateOrUpdateFuture struct { 584 azure.FutureAPI 585 // Result returns the result of the asynchronous operation. 586 // If the operation has not completed it will return an error. 587 Result func(ClusterPrincipalAssignmentsClient) (ClusterPrincipalAssignment, error) 588} 589 590// UnmarshalJSON is the custom unmarshaller for CreateFuture. 591func (future *ClusterPrincipalAssignmentsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 592 var azFuture azure.Future 593 if err := json.Unmarshal(body, &azFuture); err != nil { 594 return err 595 } 596 future.FutureAPI = &azFuture 597 future.Result = future.result 598 return nil 599} 600 601// result is the default implementation for ClusterPrincipalAssignmentsCreateOrUpdateFuture.Result. 602func (future *ClusterPrincipalAssignmentsCreateOrUpdateFuture) result(client ClusterPrincipalAssignmentsClient) (cpa ClusterPrincipalAssignment, err error) { 603 var done bool 604 done, err = future.DoneWithContext(context.Background(), client) 605 if err != nil { 606 err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 607 return 608 } 609 if !done { 610 cpa.Response.Response = future.Response() 611 err = azure.NewAsyncOpIncompleteError("kusto.ClusterPrincipalAssignmentsCreateOrUpdateFuture") 612 return 613 } 614 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 615 if cpa.Response.Response, err = future.GetResult(sender); err == nil && cpa.Response.Response.StatusCode != http.StatusNoContent { 616 cpa, err = client.CreateOrUpdateResponder(cpa.Response.Response) 617 if err != nil { 618 err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsCreateOrUpdateFuture", "Result", cpa.Response.Response, "Failure responding to request") 619 } 620 } 621 return 622} 623 624// ClusterPrincipalAssignmentsDeleteFuture an abstraction for monitoring and retrieving the results of a 625// long-running operation. 626type ClusterPrincipalAssignmentsDeleteFuture struct { 627 azure.FutureAPI 628 // Result returns the result of the asynchronous operation. 629 // If the operation has not completed it will return an error. 630 Result func(ClusterPrincipalAssignmentsClient) (autorest.Response, error) 631} 632 633// UnmarshalJSON is the custom unmarshaller for CreateFuture. 634func (future *ClusterPrincipalAssignmentsDeleteFuture) UnmarshalJSON(body []byte) error { 635 var azFuture azure.Future 636 if err := json.Unmarshal(body, &azFuture); err != nil { 637 return err 638 } 639 future.FutureAPI = &azFuture 640 future.Result = future.result 641 return nil 642} 643 644// result is the default implementation for ClusterPrincipalAssignmentsDeleteFuture.Result. 645func (future *ClusterPrincipalAssignmentsDeleteFuture) result(client ClusterPrincipalAssignmentsClient) (ar autorest.Response, err error) { 646 var done bool 647 done, err = future.DoneWithContext(context.Background(), client) 648 if err != nil { 649 err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsDeleteFuture", "Result", future.Response(), "Polling failure") 650 return 651 } 652 if !done { 653 ar.Response = future.Response() 654 err = azure.NewAsyncOpIncompleteError("kusto.ClusterPrincipalAssignmentsDeleteFuture") 655 return 656 } 657 ar.Response = future.Response() 658 return 659} 660 661// ClusterPrincipalProperties a class representing cluster principal property. 662type ClusterPrincipalProperties struct { 663 // PrincipalID - The principal ID assigned to the cluster principal. It can be a user email, application ID, or security group name. 664 PrincipalID *string `json:"principalId,omitempty"` 665 // Role - Cluster principal role. Possible values include: 'ClusterPrincipalRoleAllDatabasesAdmin', 'ClusterPrincipalRoleAllDatabasesViewer' 666 Role ClusterPrincipalRole `json:"role,omitempty"` 667 // TenantID - The tenant id of the principal 668 TenantID *string `json:"tenantId,omitempty"` 669 // PrincipalType - Principal type. Possible values include: 'PrincipalTypeApp', 'PrincipalTypeGroup', 'PrincipalTypeUser' 670 PrincipalType PrincipalType `json:"principalType,omitempty"` 671 // TenantName - READ-ONLY; The tenant name of the principal 672 TenantName *string `json:"tenantName,omitempty"` 673 // PrincipalName - READ-ONLY; The principal name 674 PrincipalName *string `json:"principalName,omitempty"` 675 // ProvisioningState - The provisioned state of the resource. Possible values include: 'ProvisioningStateRunning', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateMoving' 676 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 677} 678 679// MarshalJSON is the custom marshaler for ClusterPrincipalProperties. 680func (cpp ClusterPrincipalProperties) MarshalJSON() ([]byte, error) { 681 objectMap := make(map[string]interface{}) 682 if cpp.PrincipalID != nil { 683 objectMap["principalId"] = cpp.PrincipalID 684 } 685 if cpp.Role != "" { 686 objectMap["role"] = cpp.Role 687 } 688 if cpp.TenantID != nil { 689 objectMap["tenantId"] = cpp.TenantID 690 } 691 if cpp.PrincipalType != "" { 692 objectMap["principalType"] = cpp.PrincipalType 693 } 694 if cpp.ProvisioningState != "" { 695 objectMap["provisioningState"] = cpp.ProvisioningState 696 } 697 return json.Marshal(objectMap) 698} 699 700// ClusterProperties class representing the Kusto cluster properties. 701type ClusterProperties struct { 702 // State - READ-ONLY; The state of the resource. Possible values include: 'StateCreating', 'StateUnavailable', 'StateRunning', 'StateDeleting', 'StateDeleted', 'StateStopping', 'StateStopped', 'StateStarting', 'StateUpdating' 703 State State `json:"state,omitempty"` 704 // ProvisioningState - The provisioned state of the resource. Possible values include: 'ProvisioningStateRunning', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateMoving' 705 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 706 // URI - READ-ONLY; The cluster URI. 707 URI *string `json:"uri,omitempty"` 708 // DataIngestionURI - READ-ONLY; The cluster data ingestion URI. 709 DataIngestionURI *string `json:"dataIngestionUri,omitempty"` 710 // StateReason - READ-ONLY; The reason for the cluster's current state. 711 StateReason *string `json:"stateReason,omitempty"` 712 // TrustedExternalTenants - The cluster's external tenants. 713 TrustedExternalTenants *[]TrustedExternalTenant `json:"trustedExternalTenants,omitempty"` 714 // OptimizedAutoscale - Optimized auto scale definition. 715 OptimizedAutoscale *OptimizedAutoscale `json:"optimizedAutoscale,omitempty"` 716 // EnableDiskEncryption - A boolean value that indicates if the cluster's disks are encrypted. 717 EnableDiskEncryption *bool `json:"enableDiskEncryption,omitempty"` 718 // EnableStreamingIngest - A boolean value that indicates if the streaming ingest is enabled. 719 EnableStreamingIngest *bool `json:"enableStreamingIngest,omitempty"` 720 // VirtualNetworkConfiguration - Virtual network definition. 721 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 722 // KeyVaultProperties - KeyVault properties for the cluster encryption. 723 KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"` 724 // EnablePurge - A boolean value that indicates if the purge operations are enabled. 725 EnablePurge *bool `json:"enablePurge,omitempty"` 726 // LanguageExtensions - READ-ONLY; List of the cluster's language extensions. 727 LanguageExtensions *LanguageExtensionsList `json:"languageExtensions,omitempty"` 728 // EnableDoubleEncryption - A boolean value that indicates if double encryption is enabled. 729 EnableDoubleEncryption *bool `json:"enableDoubleEncryption,omitempty"` 730 // EngineType - The engine type. Possible values include: 'EngineTypeV2', 'EngineTypeV3' 731 EngineType EngineType `json:"engineType,omitempty"` 732} 733 734// MarshalJSON is the custom marshaler for ClusterProperties. 735func (cp ClusterProperties) MarshalJSON() ([]byte, error) { 736 objectMap := make(map[string]interface{}) 737 if cp.ProvisioningState != "" { 738 objectMap["provisioningState"] = cp.ProvisioningState 739 } 740 if cp.TrustedExternalTenants != nil { 741 objectMap["trustedExternalTenants"] = cp.TrustedExternalTenants 742 } 743 if cp.OptimizedAutoscale != nil { 744 objectMap["optimizedAutoscale"] = cp.OptimizedAutoscale 745 } 746 if cp.EnableDiskEncryption != nil { 747 objectMap["enableDiskEncryption"] = cp.EnableDiskEncryption 748 } 749 if cp.EnableStreamingIngest != nil { 750 objectMap["enableStreamingIngest"] = cp.EnableStreamingIngest 751 } 752 if cp.VirtualNetworkConfiguration != nil { 753 objectMap["virtualNetworkConfiguration"] = cp.VirtualNetworkConfiguration 754 } 755 if cp.KeyVaultProperties != nil { 756 objectMap["keyVaultProperties"] = cp.KeyVaultProperties 757 } 758 if cp.EnablePurge != nil { 759 objectMap["enablePurge"] = cp.EnablePurge 760 } 761 if cp.EnableDoubleEncryption != nil { 762 objectMap["enableDoubleEncryption"] = cp.EnableDoubleEncryption 763 } 764 if cp.EngineType != "" { 765 objectMap["engineType"] = cp.EngineType 766 } 767 return json.Marshal(objectMap) 768} 769 770// ClustersAddLanguageExtensionsFuture an abstraction for monitoring and retrieving the results of a 771// long-running operation. 772type ClustersAddLanguageExtensionsFuture struct { 773 azure.FutureAPI 774 // Result returns the result of the asynchronous operation. 775 // If the operation has not completed it will return an error. 776 Result func(ClustersClient) (autorest.Response, error) 777} 778 779// UnmarshalJSON is the custom unmarshaller for CreateFuture. 780func (future *ClustersAddLanguageExtensionsFuture) UnmarshalJSON(body []byte) error { 781 var azFuture azure.Future 782 if err := json.Unmarshal(body, &azFuture); err != nil { 783 return err 784 } 785 future.FutureAPI = &azFuture 786 future.Result = future.result 787 return nil 788} 789 790// result is the default implementation for ClustersAddLanguageExtensionsFuture.Result. 791func (future *ClustersAddLanguageExtensionsFuture) result(client ClustersClient) (ar autorest.Response, err error) { 792 var done bool 793 done, err = future.DoneWithContext(context.Background(), client) 794 if err != nil { 795 err = autorest.NewErrorWithError(err, "kusto.ClustersAddLanguageExtensionsFuture", "Result", future.Response(), "Polling failure") 796 return 797 } 798 if !done { 799 ar.Response = future.Response() 800 err = azure.NewAsyncOpIncompleteError("kusto.ClustersAddLanguageExtensionsFuture") 801 return 802 } 803 ar.Response = future.Response() 804 return 805} 806 807// ClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 808// operation. 809type ClustersCreateOrUpdateFuture struct { 810 azure.FutureAPI 811 // Result returns the result of the asynchronous operation. 812 // If the operation has not completed it will return an error. 813 Result func(ClustersClient) (Cluster, error) 814} 815 816// UnmarshalJSON is the custom unmarshaller for CreateFuture. 817func (future *ClustersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 818 var azFuture azure.Future 819 if err := json.Unmarshal(body, &azFuture); err != nil { 820 return err 821 } 822 future.FutureAPI = &azFuture 823 future.Result = future.result 824 return nil 825} 826 827// result is the default implementation for ClustersCreateOrUpdateFuture.Result. 828func (future *ClustersCreateOrUpdateFuture) result(client ClustersClient) (c Cluster, err error) { 829 var done bool 830 done, err = future.DoneWithContext(context.Background(), client) 831 if err != nil { 832 err = autorest.NewErrorWithError(err, "kusto.ClustersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 833 return 834 } 835 if !done { 836 c.Response.Response = future.Response() 837 err = azure.NewAsyncOpIncompleteError("kusto.ClustersCreateOrUpdateFuture") 838 return 839 } 840 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 841 if c.Response.Response, err = future.GetResult(sender); err == nil && c.Response.Response.StatusCode != http.StatusNoContent { 842 c, err = client.CreateOrUpdateResponder(c.Response.Response) 843 if err != nil { 844 err = autorest.NewErrorWithError(err, "kusto.ClustersCreateOrUpdateFuture", "Result", c.Response.Response, "Failure responding to request") 845 } 846 } 847 return 848} 849 850// ClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 851// operation. 852type ClustersDeleteFuture struct { 853 azure.FutureAPI 854 // Result returns the result of the asynchronous operation. 855 // If the operation has not completed it will return an error. 856 Result func(ClustersClient) (autorest.Response, error) 857} 858 859// UnmarshalJSON is the custom unmarshaller for CreateFuture. 860func (future *ClustersDeleteFuture) UnmarshalJSON(body []byte) error { 861 var azFuture azure.Future 862 if err := json.Unmarshal(body, &azFuture); err != nil { 863 return err 864 } 865 future.FutureAPI = &azFuture 866 future.Result = future.result 867 return nil 868} 869 870// result is the default implementation for ClustersDeleteFuture.Result. 871func (future *ClustersDeleteFuture) result(client ClustersClient) (ar autorest.Response, err error) { 872 var done bool 873 done, err = future.DoneWithContext(context.Background(), client) 874 if err != nil { 875 err = autorest.NewErrorWithError(err, "kusto.ClustersDeleteFuture", "Result", future.Response(), "Polling failure") 876 return 877 } 878 if !done { 879 ar.Response = future.Response() 880 err = azure.NewAsyncOpIncompleteError("kusto.ClustersDeleteFuture") 881 return 882 } 883 ar.Response = future.Response() 884 return 885} 886 887// ClustersDetachFollowerDatabasesFuture an abstraction for monitoring and retrieving the results of a 888// long-running operation. 889type ClustersDetachFollowerDatabasesFuture struct { 890 azure.FutureAPI 891 // Result returns the result of the asynchronous operation. 892 // If the operation has not completed it will return an error. 893 Result func(ClustersClient) (autorest.Response, error) 894} 895 896// UnmarshalJSON is the custom unmarshaller for CreateFuture. 897func (future *ClustersDetachFollowerDatabasesFuture) UnmarshalJSON(body []byte) error { 898 var azFuture azure.Future 899 if err := json.Unmarshal(body, &azFuture); err != nil { 900 return err 901 } 902 future.FutureAPI = &azFuture 903 future.Result = future.result 904 return nil 905} 906 907// result is the default implementation for ClustersDetachFollowerDatabasesFuture.Result. 908func (future *ClustersDetachFollowerDatabasesFuture) result(client ClustersClient) (ar autorest.Response, err error) { 909 var done bool 910 done, err = future.DoneWithContext(context.Background(), client) 911 if err != nil { 912 err = autorest.NewErrorWithError(err, "kusto.ClustersDetachFollowerDatabasesFuture", "Result", future.Response(), "Polling failure") 913 return 914 } 915 if !done { 916 ar.Response = future.Response() 917 err = azure.NewAsyncOpIncompleteError("kusto.ClustersDetachFollowerDatabasesFuture") 918 return 919 } 920 ar.Response = future.Response() 921 return 922} 923 924// ClustersDiagnoseVirtualNetworkFuture an abstraction for monitoring and retrieving the results of a 925// long-running operation. 926type ClustersDiagnoseVirtualNetworkFuture struct { 927 azure.FutureAPI 928 // Result returns the result of the asynchronous operation. 929 // If the operation has not completed it will return an error. 930 Result func(ClustersClient) (DiagnoseVirtualNetworkResult, error) 931} 932 933// UnmarshalJSON is the custom unmarshaller for CreateFuture. 934func (future *ClustersDiagnoseVirtualNetworkFuture) UnmarshalJSON(body []byte) error { 935 var azFuture azure.Future 936 if err := json.Unmarshal(body, &azFuture); err != nil { 937 return err 938 } 939 future.FutureAPI = &azFuture 940 future.Result = future.result 941 return nil 942} 943 944// result is the default implementation for ClustersDiagnoseVirtualNetworkFuture.Result. 945func (future *ClustersDiagnoseVirtualNetworkFuture) result(client ClustersClient) (dvnr DiagnoseVirtualNetworkResult, err error) { 946 var done bool 947 done, err = future.DoneWithContext(context.Background(), client) 948 if err != nil { 949 err = autorest.NewErrorWithError(err, "kusto.ClustersDiagnoseVirtualNetworkFuture", "Result", future.Response(), "Polling failure") 950 return 951 } 952 if !done { 953 dvnr.Response.Response = future.Response() 954 err = azure.NewAsyncOpIncompleteError("kusto.ClustersDiagnoseVirtualNetworkFuture") 955 return 956 } 957 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 958 if dvnr.Response.Response, err = future.GetResult(sender); err == nil && dvnr.Response.Response.StatusCode != http.StatusNoContent { 959 dvnr, err = client.DiagnoseVirtualNetworkResponder(dvnr.Response.Response) 960 if err != nil { 961 err = autorest.NewErrorWithError(err, "kusto.ClustersDiagnoseVirtualNetworkFuture", "Result", dvnr.Response.Response, "Failure responding to request") 962 } 963 } 964 return 965} 966 967// ClustersRemoveLanguageExtensionsFuture an abstraction for monitoring and retrieving the results of a 968// long-running operation. 969type ClustersRemoveLanguageExtensionsFuture struct { 970 azure.FutureAPI 971 // Result returns the result of the asynchronous operation. 972 // If the operation has not completed it will return an error. 973 Result func(ClustersClient) (autorest.Response, error) 974} 975 976// UnmarshalJSON is the custom unmarshaller for CreateFuture. 977func (future *ClustersRemoveLanguageExtensionsFuture) UnmarshalJSON(body []byte) error { 978 var azFuture azure.Future 979 if err := json.Unmarshal(body, &azFuture); err != nil { 980 return err 981 } 982 future.FutureAPI = &azFuture 983 future.Result = future.result 984 return nil 985} 986 987// result is the default implementation for ClustersRemoveLanguageExtensionsFuture.Result. 988func (future *ClustersRemoveLanguageExtensionsFuture) result(client ClustersClient) (ar autorest.Response, err error) { 989 var done bool 990 done, err = future.DoneWithContext(context.Background(), client) 991 if err != nil { 992 err = autorest.NewErrorWithError(err, "kusto.ClustersRemoveLanguageExtensionsFuture", "Result", future.Response(), "Polling failure") 993 return 994 } 995 if !done { 996 ar.Response = future.Response() 997 err = azure.NewAsyncOpIncompleteError("kusto.ClustersRemoveLanguageExtensionsFuture") 998 return 999 } 1000 ar.Response = future.Response() 1001 return 1002} 1003 1004// ClustersStartFuture an abstraction for monitoring and retrieving the results of a long-running 1005// operation. 1006type ClustersStartFuture struct { 1007 azure.FutureAPI 1008 // Result returns the result of the asynchronous operation. 1009 // If the operation has not completed it will return an error. 1010 Result func(ClustersClient) (autorest.Response, error) 1011} 1012 1013// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1014func (future *ClustersStartFuture) UnmarshalJSON(body []byte) error { 1015 var azFuture azure.Future 1016 if err := json.Unmarshal(body, &azFuture); err != nil { 1017 return err 1018 } 1019 future.FutureAPI = &azFuture 1020 future.Result = future.result 1021 return nil 1022} 1023 1024// result is the default implementation for ClustersStartFuture.Result. 1025func (future *ClustersStartFuture) result(client ClustersClient) (ar autorest.Response, err error) { 1026 var done bool 1027 done, err = future.DoneWithContext(context.Background(), client) 1028 if err != nil { 1029 err = autorest.NewErrorWithError(err, "kusto.ClustersStartFuture", "Result", future.Response(), "Polling failure") 1030 return 1031 } 1032 if !done { 1033 ar.Response = future.Response() 1034 err = azure.NewAsyncOpIncompleteError("kusto.ClustersStartFuture") 1035 return 1036 } 1037 ar.Response = future.Response() 1038 return 1039} 1040 1041// ClustersStopFuture an abstraction for monitoring and retrieving the results of a long-running operation. 1042type ClustersStopFuture struct { 1043 azure.FutureAPI 1044 // Result returns the result of the asynchronous operation. 1045 // If the operation has not completed it will return an error. 1046 Result func(ClustersClient) (autorest.Response, error) 1047} 1048 1049// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1050func (future *ClustersStopFuture) UnmarshalJSON(body []byte) error { 1051 var azFuture azure.Future 1052 if err := json.Unmarshal(body, &azFuture); err != nil { 1053 return err 1054 } 1055 future.FutureAPI = &azFuture 1056 future.Result = future.result 1057 return nil 1058} 1059 1060// result is the default implementation for ClustersStopFuture.Result. 1061func (future *ClustersStopFuture) result(client ClustersClient) (ar autorest.Response, err error) { 1062 var done bool 1063 done, err = future.DoneWithContext(context.Background(), client) 1064 if err != nil { 1065 err = autorest.NewErrorWithError(err, "kusto.ClustersStopFuture", "Result", future.Response(), "Polling failure") 1066 return 1067 } 1068 if !done { 1069 ar.Response = future.Response() 1070 err = azure.NewAsyncOpIncompleteError("kusto.ClustersStopFuture") 1071 return 1072 } 1073 ar.Response = future.Response() 1074 return 1075} 1076 1077// ClustersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1078// operation. 1079type ClustersUpdateFuture struct { 1080 azure.FutureAPI 1081 // Result returns the result of the asynchronous operation. 1082 // If the operation has not completed it will return an error. 1083 Result func(ClustersClient) (Cluster, error) 1084} 1085 1086// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1087func (future *ClustersUpdateFuture) UnmarshalJSON(body []byte) error { 1088 var azFuture azure.Future 1089 if err := json.Unmarshal(body, &azFuture); err != nil { 1090 return err 1091 } 1092 future.FutureAPI = &azFuture 1093 future.Result = future.result 1094 return nil 1095} 1096 1097// result is the default implementation for ClustersUpdateFuture.Result. 1098func (future *ClustersUpdateFuture) result(client ClustersClient) (c Cluster, err error) { 1099 var done bool 1100 done, err = future.DoneWithContext(context.Background(), client) 1101 if err != nil { 1102 err = autorest.NewErrorWithError(err, "kusto.ClustersUpdateFuture", "Result", future.Response(), "Polling failure") 1103 return 1104 } 1105 if !done { 1106 c.Response.Response = future.Response() 1107 err = azure.NewAsyncOpIncompleteError("kusto.ClustersUpdateFuture") 1108 return 1109 } 1110 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1111 if c.Response.Response, err = future.GetResult(sender); err == nil && c.Response.Response.StatusCode != http.StatusNoContent { 1112 c, err = client.UpdateResponder(c.Response.Response) 1113 if err != nil { 1114 err = autorest.NewErrorWithError(err, "kusto.ClustersUpdateFuture", "Result", c.Response.Response, "Failure responding to request") 1115 } 1116 } 1117 return 1118} 1119 1120// ClusterUpdate class representing an update to a Kusto cluster. 1121type ClusterUpdate struct { 1122 // Tags - Resource tags. 1123 Tags map[string]*string `json:"tags"` 1124 // Location - Resource location. 1125 Location *string `json:"location,omitempty"` 1126 // Sku - The SKU of the cluster. 1127 Sku *AzureSku `json:"sku,omitempty"` 1128 // Identity - The identity of the cluster, if configured. 1129 Identity *Identity `json:"identity,omitempty"` 1130 // ClusterProperties - The cluster properties. 1131 *ClusterProperties `json:"properties,omitempty"` 1132 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1133 ID *string `json:"id,omitempty"` 1134 // Name - READ-ONLY; The name of the resource 1135 Name *string `json:"name,omitempty"` 1136 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 1137 Type *string `json:"type,omitempty"` 1138} 1139 1140// MarshalJSON is the custom marshaler for ClusterUpdate. 1141func (cu ClusterUpdate) MarshalJSON() ([]byte, error) { 1142 objectMap := make(map[string]interface{}) 1143 if cu.Tags != nil { 1144 objectMap["tags"] = cu.Tags 1145 } 1146 if cu.Location != nil { 1147 objectMap["location"] = cu.Location 1148 } 1149 if cu.Sku != nil { 1150 objectMap["sku"] = cu.Sku 1151 } 1152 if cu.Identity != nil { 1153 objectMap["identity"] = cu.Identity 1154 } 1155 if cu.ClusterProperties != nil { 1156 objectMap["properties"] = cu.ClusterProperties 1157 } 1158 return json.Marshal(objectMap) 1159} 1160 1161// UnmarshalJSON is the custom unmarshaler for ClusterUpdate struct. 1162func (cu *ClusterUpdate) UnmarshalJSON(body []byte) error { 1163 var m map[string]*json.RawMessage 1164 err := json.Unmarshal(body, &m) 1165 if err != nil { 1166 return err 1167 } 1168 for k, v := range m { 1169 switch k { 1170 case "tags": 1171 if v != nil { 1172 var tags map[string]*string 1173 err = json.Unmarshal(*v, &tags) 1174 if err != nil { 1175 return err 1176 } 1177 cu.Tags = tags 1178 } 1179 case "location": 1180 if v != nil { 1181 var location string 1182 err = json.Unmarshal(*v, &location) 1183 if err != nil { 1184 return err 1185 } 1186 cu.Location = &location 1187 } 1188 case "sku": 1189 if v != nil { 1190 var sku AzureSku 1191 err = json.Unmarshal(*v, &sku) 1192 if err != nil { 1193 return err 1194 } 1195 cu.Sku = &sku 1196 } 1197 case "identity": 1198 if v != nil { 1199 var identity Identity 1200 err = json.Unmarshal(*v, &identity) 1201 if err != nil { 1202 return err 1203 } 1204 cu.Identity = &identity 1205 } 1206 case "properties": 1207 if v != nil { 1208 var clusterProperties ClusterProperties 1209 err = json.Unmarshal(*v, &clusterProperties) 1210 if err != nil { 1211 return err 1212 } 1213 cu.ClusterProperties = &clusterProperties 1214 } 1215 case "id": 1216 if v != nil { 1217 var ID string 1218 err = json.Unmarshal(*v, &ID) 1219 if err != nil { 1220 return err 1221 } 1222 cu.ID = &ID 1223 } 1224 case "name": 1225 if v != nil { 1226 var name string 1227 err = json.Unmarshal(*v, &name) 1228 if err != nil { 1229 return err 1230 } 1231 cu.Name = &name 1232 } 1233 case "type": 1234 if v != nil { 1235 var typeVar string 1236 err = json.Unmarshal(*v, &typeVar) 1237 if err != nil { 1238 return err 1239 } 1240 cu.Type = &typeVar 1241 } 1242 } 1243 } 1244 1245 return nil 1246} 1247 1248// BasicDatabase class representing a Kusto database. 1249type BasicDatabase interface { 1250 AsReadWriteDatabase() (*ReadWriteDatabase, bool) 1251 AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) 1252 AsDatabase() (*Database, bool) 1253} 1254 1255// Database class representing a Kusto database. 1256type Database struct { 1257 autorest.Response `json:"-"` 1258 // Location - Resource location. 1259 Location *string `json:"location,omitempty"` 1260 // Kind - Possible values include: 'KindDatabase', 'KindReadWrite', 'KindReadOnlyFollowing' 1261 Kind Kind `json:"kind,omitempty"` 1262 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1263 ID *string `json:"id,omitempty"` 1264 // Name - READ-ONLY; The name of the resource 1265 Name *string `json:"name,omitempty"` 1266 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 1267 Type *string `json:"type,omitempty"` 1268} 1269 1270func unmarshalBasicDatabase(body []byte) (BasicDatabase, error) { 1271 var m map[string]interface{} 1272 err := json.Unmarshal(body, &m) 1273 if err != nil { 1274 return nil, err 1275 } 1276 1277 switch m["kind"] { 1278 case string(KindReadWrite): 1279 var rwd ReadWriteDatabase 1280 err := json.Unmarshal(body, &rwd) 1281 return rwd, err 1282 case string(KindReadOnlyFollowing): 1283 var rofd ReadOnlyFollowingDatabase 1284 err := json.Unmarshal(body, &rofd) 1285 return rofd, err 1286 default: 1287 var d Database 1288 err := json.Unmarshal(body, &d) 1289 return d, err 1290 } 1291} 1292func unmarshalBasicDatabaseArray(body []byte) ([]BasicDatabase, error) { 1293 var rawMessages []*json.RawMessage 1294 err := json.Unmarshal(body, &rawMessages) 1295 if err != nil { 1296 return nil, err 1297 } 1298 1299 dArray := make([]BasicDatabase, len(rawMessages)) 1300 1301 for index, rawMessage := range rawMessages { 1302 d, err := unmarshalBasicDatabase(*rawMessage) 1303 if err != nil { 1304 return nil, err 1305 } 1306 dArray[index] = d 1307 } 1308 return dArray, nil 1309} 1310 1311// MarshalJSON is the custom marshaler for Database. 1312func (d Database) MarshalJSON() ([]byte, error) { 1313 d.Kind = KindDatabase 1314 objectMap := make(map[string]interface{}) 1315 if d.Location != nil { 1316 objectMap["location"] = d.Location 1317 } 1318 if d.Kind != "" { 1319 objectMap["kind"] = d.Kind 1320 } 1321 return json.Marshal(objectMap) 1322} 1323 1324// AsReadWriteDatabase is the BasicDatabase implementation for Database. 1325func (d Database) AsReadWriteDatabase() (*ReadWriteDatabase, bool) { 1326 return nil, false 1327} 1328 1329// AsReadOnlyFollowingDatabase is the BasicDatabase implementation for Database. 1330func (d Database) AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) { 1331 return nil, false 1332} 1333 1334// AsDatabase is the BasicDatabase implementation for Database. 1335func (d Database) AsDatabase() (*Database, bool) { 1336 return &d, true 1337} 1338 1339// AsBasicDatabase is the BasicDatabase implementation for Database. 1340func (d Database) AsBasicDatabase() (BasicDatabase, bool) { 1341 return &d, true 1342} 1343 1344// DatabaseListResult the list Kusto databases operation response. 1345type DatabaseListResult struct { 1346 autorest.Response `json:"-"` 1347 // Value - The list of Kusto databases. 1348 Value *[]BasicDatabase `json:"value,omitempty"` 1349} 1350 1351// UnmarshalJSON is the custom unmarshaler for DatabaseListResult struct. 1352func (dlr *DatabaseListResult) UnmarshalJSON(body []byte) error { 1353 var m map[string]*json.RawMessage 1354 err := json.Unmarshal(body, &m) 1355 if err != nil { 1356 return err 1357 } 1358 for k, v := range m { 1359 switch k { 1360 case "value": 1361 if v != nil { 1362 value, err := unmarshalBasicDatabaseArray(*v) 1363 if err != nil { 1364 return err 1365 } 1366 dlr.Value = &value 1367 } 1368 } 1369 } 1370 1371 return nil 1372} 1373 1374// DatabaseModel ... 1375type DatabaseModel struct { 1376 autorest.Response `json:"-"` 1377 Value BasicDatabase `json:"value,omitempty"` 1378} 1379 1380// UnmarshalJSON is the custom unmarshaler for DatabaseModel struct. 1381func (dm *DatabaseModel) UnmarshalJSON(body []byte) error { 1382 d, err := unmarshalBasicDatabase(body) 1383 if err != nil { 1384 return err 1385 } 1386 dm.Value = d 1387 1388 return nil 1389} 1390 1391// DatabasePrincipal a class representing database principal entity. 1392type DatabasePrincipal struct { 1393 // Role - Database principal role. Possible values include: 'DatabasePrincipalRoleAdmin', 'DatabasePrincipalRoleIngestor', 'DatabasePrincipalRoleMonitor', 'DatabasePrincipalRoleUser', 'DatabasePrincipalRoleUnrestrictedViewer', 'DatabasePrincipalRoleViewer' 1394 Role DatabasePrincipalRole `json:"role,omitempty"` 1395 // Name - Database principal name. 1396 Name *string `json:"name,omitempty"` 1397 // Type - Database principal type. Possible values include: 'DatabasePrincipalTypeApp', 'DatabasePrincipalTypeGroup', 'DatabasePrincipalTypeUser' 1398 Type DatabasePrincipalType `json:"type,omitempty"` 1399 // Fqn - Database principal fully qualified name. 1400 Fqn *string `json:"fqn,omitempty"` 1401 // Email - Database principal email if exists. 1402 Email *string `json:"email,omitempty"` 1403 // AppID - Application id - relevant only for application principal type. 1404 AppID *string `json:"appId,omitempty"` 1405 // TenantName - READ-ONLY; The tenant name of the principal 1406 TenantName *string `json:"tenantName,omitempty"` 1407} 1408 1409// MarshalJSON is the custom marshaler for DatabasePrincipal. 1410func (dp DatabasePrincipal) MarshalJSON() ([]byte, error) { 1411 objectMap := make(map[string]interface{}) 1412 if dp.Role != "" { 1413 objectMap["role"] = dp.Role 1414 } 1415 if dp.Name != nil { 1416 objectMap["name"] = dp.Name 1417 } 1418 if dp.Type != "" { 1419 objectMap["type"] = dp.Type 1420 } 1421 if dp.Fqn != nil { 1422 objectMap["fqn"] = dp.Fqn 1423 } 1424 if dp.Email != nil { 1425 objectMap["email"] = dp.Email 1426 } 1427 if dp.AppID != nil { 1428 objectMap["appId"] = dp.AppID 1429 } 1430 return json.Marshal(objectMap) 1431} 1432 1433// DatabasePrincipalAssignment class representing a database principal assignment. 1434type DatabasePrincipalAssignment struct { 1435 autorest.Response `json:"-"` 1436 // DatabasePrincipalProperties - The database principal. 1437 *DatabasePrincipalProperties `json:"properties,omitempty"` 1438 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1439 ID *string `json:"id,omitempty"` 1440 // Name - READ-ONLY; The name of the resource 1441 Name *string `json:"name,omitempty"` 1442 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 1443 Type *string `json:"type,omitempty"` 1444} 1445 1446// MarshalJSON is the custom marshaler for DatabasePrincipalAssignment. 1447func (dpa DatabasePrincipalAssignment) MarshalJSON() ([]byte, error) { 1448 objectMap := make(map[string]interface{}) 1449 if dpa.DatabasePrincipalProperties != nil { 1450 objectMap["properties"] = dpa.DatabasePrincipalProperties 1451 } 1452 return json.Marshal(objectMap) 1453} 1454 1455// UnmarshalJSON is the custom unmarshaler for DatabasePrincipalAssignment struct. 1456func (dpa *DatabasePrincipalAssignment) UnmarshalJSON(body []byte) error { 1457 var m map[string]*json.RawMessage 1458 err := json.Unmarshal(body, &m) 1459 if err != nil { 1460 return err 1461 } 1462 for k, v := range m { 1463 switch k { 1464 case "properties": 1465 if v != nil { 1466 var databasePrincipalProperties DatabasePrincipalProperties 1467 err = json.Unmarshal(*v, &databasePrincipalProperties) 1468 if err != nil { 1469 return err 1470 } 1471 dpa.DatabasePrincipalProperties = &databasePrincipalProperties 1472 } 1473 case "id": 1474 if v != nil { 1475 var ID string 1476 err = json.Unmarshal(*v, &ID) 1477 if err != nil { 1478 return err 1479 } 1480 dpa.ID = &ID 1481 } 1482 case "name": 1483 if v != nil { 1484 var name string 1485 err = json.Unmarshal(*v, &name) 1486 if err != nil { 1487 return err 1488 } 1489 dpa.Name = &name 1490 } 1491 case "type": 1492 if v != nil { 1493 var typeVar string 1494 err = json.Unmarshal(*v, &typeVar) 1495 if err != nil { 1496 return err 1497 } 1498 dpa.Type = &typeVar 1499 } 1500 } 1501 } 1502 1503 return nil 1504} 1505 1506// DatabasePrincipalAssignmentCheckNameRequest a principal assignment check name availability request. 1507type DatabasePrincipalAssignmentCheckNameRequest struct { 1508 // Name - Principal Assignment resource name. 1509 Name *string `json:"name,omitempty"` 1510 // Type - The type of resource, Microsoft.Kusto/clusters/databases/principalAssignments. 1511 Type *string `json:"type,omitempty"` 1512} 1513 1514// DatabasePrincipalAssignmentListResult the list Kusto database principal assignments operation response. 1515type DatabasePrincipalAssignmentListResult struct { 1516 autorest.Response `json:"-"` 1517 // Value - The list of Kusto database principal assignments. 1518 Value *[]DatabasePrincipalAssignment `json:"value,omitempty"` 1519} 1520 1521// DatabasePrincipalAssignmentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 1522// results of a long-running operation. 1523type DatabasePrincipalAssignmentsCreateOrUpdateFuture struct { 1524 azure.FutureAPI 1525 // Result returns the result of the asynchronous operation. 1526 // If the operation has not completed it will return an error. 1527 Result func(DatabasePrincipalAssignmentsClient) (DatabasePrincipalAssignment, error) 1528} 1529 1530// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1531func (future *DatabasePrincipalAssignmentsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1532 var azFuture azure.Future 1533 if err := json.Unmarshal(body, &azFuture); err != nil { 1534 return err 1535 } 1536 future.FutureAPI = &azFuture 1537 future.Result = future.result 1538 return nil 1539} 1540 1541// result is the default implementation for DatabasePrincipalAssignmentsCreateOrUpdateFuture.Result. 1542func (future *DatabasePrincipalAssignmentsCreateOrUpdateFuture) result(client DatabasePrincipalAssignmentsClient) (dpa DatabasePrincipalAssignment, err error) { 1543 var done bool 1544 done, err = future.DoneWithContext(context.Background(), client) 1545 if err != nil { 1546 err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1547 return 1548 } 1549 if !done { 1550 dpa.Response.Response = future.Response() 1551 err = azure.NewAsyncOpIncompleteError("kusto.DatabasePrincipalAssignmentsCreateOrUpdateFuture") 1552 return 1553 } 1554 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1555 if dpa.Response.Response, err = future.GetResult(sender); err == nil && dpa.Response.Response.StatusCode != http.StatusNoContent { 1556 dpa, err = client.CreateOrUpdateResponder(dpa.Response.Response) 1557 if err != nil { 1558 err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsCreateOrUpdateFuture", "Result", dpa.Response.Response, "Failure responding to request") 1559 } 1560 } 1561 return 1562} 1563 1564// DatabasePrincipalAssignmentsDeleteFuture an abstraction for monitoring and retrieving the results of a 1565// long-running operation. 1566type DatabasePrincipalAssignmentsDeleteFuture struct { 1567 azure.FutureAPI 1568 // Result returns the result of the asynchronous operation. 1569 // If the operation has not completed it will return an error. 1570 Result func(DatabasePrincipalAssignmentsClient) (autorest.Response, error) 1571} 1572 1573// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1574func (future *DatabasePrincipalAssignmentsDeleteFuture) UnmarshalJSON(body []byte) error { 1575 var azFuture azure.Future 1576 if err := json.Unmarshal(body, &azFuture); err != nil { 1577 return err 1578 } 1579 future.FutureAPI = &azFuture 1580 future.Result = future.result 1581 return nil 1582} 1583 1584// result is the default implementation for DatabasePrincipalAssignmentsDeleteFuture.Result. 1585func (future *DatabasePrincipalAssignmentsDeleteFuture) result(client DatabasePrincipalAssignmentsClient) (ar autorest.Response, err error) { 1586 var done bool 1587 done, err = future.DoneWithContext(context.Background(), client) 1588 if err != nil { 1589 err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsDeleteFuture", "Result", future.Response(), "Polling failure") 1590 return 1591 } 1592 if !done { 1593 ar.Response = future.Response() 1594 err = azure.NewAsyncOpIncompleteError("kusto.DatabasePrincipalAssignmentsDeleteFuture") 1595 return 1596 } 1597 ar.Response = future.Response() 1598 return 1599} 1600 1601// DatabasePrincipalListRequest the list Kusto database principals operation request. 1602type DatabasePrincipalListRequest struct { 1603 // Value - The list of Kusto database principals. 1604 Value *[]DatabasePrincipal `json:"value,omitempty"` 1605} 1606 1607// DatabasePrincipalListResult the list Kusto database principals operation response. 1608type DatabasePrincipalListResult struct { 1609 autorest.Response `json:"-"` 1610 // Value - The list of Kusto database principals. 1611 Value *[]DatabasePrincipal `json:"value,omitempty"` 1612} 1613 1614// DatabasePrincipalProperties a class representing database principal property. 1615type DatabasePrincipalProperties struct { 1616 // PrincipalID - The principal ID assigned to the database principal. It can be a user email, application ID, or security group name. 1617 PrincipalID *string `json:"principalId,omitempty"` 1618 // Role - Database principal role. Possible values include: 'DatabasePrincipalRoleAdmin', 'DatabasePrincipalRoleIngestor', 'DatabasePrincipalRoleMonitor', 'DatabasePrincipalRoleUser', 'DatabasePrincipalRoleUnrestrictedViewer', 'DatabasePrincipalRoleViewer' 1619 Role DatabasePrincipalRole `json:"role,omitempty"` 1620 // TenantID - The tenant id of the principal 1621 TenantID *string `json:"tenantId,omitempty"` 1622 // PrincipalType - Principal type. Possible values include: 'PrincipalTypeApp', 'PrincipalTypeGroup', 'PrincipalTypeUser' 1623 PrincipalType PrincipalType `json:"principalType,omitempty"` 1624 // TenantName - READ-ONLY; The tenant name of the principal 1625 TenantName *string `json:"tenantName,omitempty"` 1626 // PrincipalName - READ-ONLY; The principal name 1627 PrincipalName *string `json:"principalName,omitempty"` 1628 // ProvisioningState - The provisioned state of the resource. Possible values include: 'ProvisioningStateRunning', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateMoving' 1629 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 1630} 1631 1632// MarshalJSON is the custom marshaler for DatabasePrincipalProperties. 1633func (dpp DatabasePrincipalProperties) MarshalJSON() ([]byte, error) { 1634 objectMap := make(map[string]interface{}) 1635 if dpp.PrincipalID != nil { 1636 objectMap["principalId"] = dpp.PrincipalID 1637 } 1638 if dpp.Role != "" { 1639 objectMap["role"] = dpp.Role 1640 } 1641 if dpp.TenantID != nil { 1642 objectMap["tenantId"] = dpp.TenantID 1643 } 1644 if dpp.PrincipalType != "" { 1645 objectMap["principalType"] = dpp.PrincipalType 1646 } 1647 if dpp.ProvisioningState != "" { 1648 objectMap["provisioningState"] = dpp.ProvisioningState 1649 } 1650 return json.Marshal(objectMap) 1651} 1652 1653// DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1654// operation. 1655type DatabasesCreateOrUpdateFuture struct { 1656 azure.FutureAPI 1657 // Result returns the result of the asynchronous operation. 1658 // If the operation has not completed it will return an error. 1659 Result func(DatabasesClient) (DatabaseModel, error) 1660} 1661 1662// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1663func (future *DatabasesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1664 var azFuture azure.Future 1665 if err := json.Unmarshal(body, &azFuture); err != nil { 1666 return err 1667 } 1668 future.FutureAPI = &azFuture 1669 future.Result = future.result 1670 return nil 1671} 1672 1673// result is the default implementation for DatabasesCreateOrUpdateFuture.Result. 1674func (future *DatabasesCreateOrUpdateFuture) result(client DatabasesClient) (dm DatabaseModel, err error) { 1675 var done bool 1676 done, err = future.DoneWithContext(context.Background(), client) 1677 if err != nil { 1678 err = autorest.NewErrorWithError(err, "kusto.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1679 return 1680 } 1681 if !done { 1682 dm.Response.Response = future.Response() 1683 err = azure.NewAsyncOpIncompleteError("kusto.DatabasesCreateOrUpdateFuture") 1684 return 1685 } 1686 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1687 if dm.Response.Response, err = future.GetResult(sender); err == nil && dm.Response.Response.StatusCode != http.StatusNoContent { 1688 dm, err = client.CreateOrUpdateResponder(dm.Response.Response) 1689 if err != nil { 1690 err = autorest.NewErrorWithError(err, "kusto.DatabasesCreateOrUpdateFuture", "Result", dm.Response.Response, "Failure responding to request") 1691 } 1692 } 1693 return 1694} 1695 1696// DatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1697// operation. 1698type DatabasesDeleteFuture struct { 1699 azure.FutureAPI 1700 // Result returns the result of the asynchronous operation. 1701 // If the operation has not completed it will return an error. 1702 Result func(DatabasesClient) (autorest.Response, error) 1703} 1704 1705// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1706func (future *DatabasesDeleteFuture) UnmarshalJSON(body []byte) error { 1707 var azFuture azure.Future 1708 if err := json.Unmarshal(body, &azFuture); err != nil { 1709 return err 1710 } 1711 future.FutureAPI = &azFuture 1712 future.Result = future.result 1713 return nil 1714} 1715 1716// result is the default implementation for DatabasesDeleteFuture.Result. 1717func (future *DatabasesDeleteFuture) result(client DatabasesClient) (ar autorest.Response, err error) { 1718 var done bool 1719 done, err = future.DoneWithContext(context.Background(), client) 1720 if err != nil { 1721 err = autorest.NewErrorWithError(err, "kusto.DatabasesDeleteFuture", "Result", future.Response(), "Polling failure") 1722 return 1723 } 1724 if !done { 1725 ar.Response = future.Response() 1726 err = azure.NewAsyncOpIncompleteError("kusto.DatabasesDeleteFuture") 1727 return 1728 } 1729 ar.Response = future.Response() 1730 return 1731} 1732 1733// DatabaseStatistics a class that contains database statistics information. 1734type DatabaseStatistics struct { 1735 // Size - The database size - the total size of compressed data and index in bytes. 1736 Size *float64 `json:"size,omitempty"` 1737} 1738 1739// DatabasesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1740// operation. 1741type DatabasesUpdateFuture struct { 1742 azure.FutureAPI 1743 // Result returns the result of the asynchronous operation. 1744 // If the operation has not completed it will return an error. 1745 Result func(DatabasesClient) (DatabaseModel, error) 1746} 1747 1748// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1749func (future *DatabasesUpdateFuture) UnmarshalJSON(body []byte) error { 1750 var azFuture azure.Future 1751 if err := json.Unmarshal(body, &azFuture); err != nil { 1752 return err 1753 } 1754 future.FutureAPI = &azFuture 1755 future.Result = future.result 1756 return nil 1757} 1758 1759// result is the default implementation for DatabasesUpdateFuture.Result. 1760func (future *DatabasesUpdateFuture) result(client DatabasesClient) (dm DatabaseModel, err error) { 1761 var done bool 1762 done, err = future.DoneWithContext(context.Background(), client) 1763 if err != nil { 1764 err = autorest.NewErrorWithError(err, "kusto.DatabasesUpdateFuture", "Result", future.Response(), "Polling failure") 1765 return 1766 } 1767 if !done { 1768 dm.Response.Response = future.Response() 1769 err = azure.NewAsyncOpIncompleteError("kusto.DatabasesUpdateFuture") 1770 return 1771 } 1772 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1773 if dm.Response.Response, err = future.GetResult(sender); err == nil && dm.Response.Response.StatusCode != http.StatusNoContent { 1774 dm, err = client.UpdateResponder(dm.Response.Response) 1775 if err != nil { 1776 err = autorest.NewErrorWithError(err, "kusto.DatabasesUpdateFuture", "Result", dm.Response.Response, "Failure responding to request") 1777 } 1778 } 1779 return 1780} 1781 1782// BasicDataConnection class representing an data connection. 1783type BasicDataConnection interface { 1784 AsEventHubDataConnection() (*EventHubDataConnection, bool) 1785 AsIotHubDataConnection() (*IotHubDataConnection, bool) 1786 AsEventGridDataConnection() (*EventGridDataConnection, bool) 1787 AsDataConnection() (*DataConnection, bool) 1788} 1789 1790// DataConnection class representing an data connection. 1791type DataConnection struct { 1792 autorest.Response `json:"-"` 1793 // Location - Resource location. 1794 Location *string `json:"location,omitempty"` 1795 // Kind - Possible values include: 'KindBasicDataConnectionKindDataConnection', 'KindBasicDataConnectionKindEventHub', 'KindBasicDataConnectionKindIotHub', 'KindBasicDataConnectionKindEventGrid' 1796 Kind KindBasicDataConnection `json:"kind,omitempty"` 1797 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1798 ID *string `json:"id,omitempty"` 1799 // Name - READ-ONLY; The name of the resource 1800 Name *string `json:"name,omitempty"` 1801 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 1802 Type *string `json:"type,omitempty"` 1803} 1804 1805func unmarshalBasicDataConnection(body []byte) (BasicDataConnection, error) { 1806 var m map[string]interface{} 1807 err := json.Unmarshal(body, &m) 1808 if err != nil { 1809 return nil, err 1810 } 1811 1812 switch m["kind"] { 1813 case string(KindBasicDataConnectionKindEventHub): 1814 var ehdc EventHubDataConnection 1815 err := json.Unmarshal(body, &ehdc) 1816 return ehdc, err 1817 case string(KindBasicDataConnectionKindIotHub): 1818 var ihdc IotHubDataConnection 1819 err := json.Unmarshal(body, &ihdc) 1820 return ihdc, err 1821 case string(KindBasicDataConnectionKindEventGrid): 1822 var egdc EventGridDataConnection 1823 err := json.Unmarshal(body, &egdc) 1824 return egdc, err 1825 default: 1826 var dc DataConnection 1827 err := json.Unmarshal(body, &dc) 1828 return dc, err 1829 } 1830} 1831func unmarshalBasicDataConnectionArray(body []byte) ([]BasicDataConnection, error) { 1832 var rawMessages []*json.RawMessage 1833 err := json.Unmarshal(body, &rawMessages) 1834 if err != nil { 1835 return nil, err 1836 } 1837 1838 dcArray := make([]BasicDataConnection, len(rawMessages)) 1839 1840 for index, rawMessage := range rawMessages { 1841 dc, err := unmarshalBasicDataConnection(*rawMessage) 1842 if err != nil { 1843 return nil, err 1844 } 1845 dcArray[index] = dc 1846 } 1847 return dcArray, nil 1848} 1849 1850// MarshalJSON is the custom marshaler for DataConnection. 1851func (dc DataConnection) MarshalJSON() ([]byte, error) { 1852 dc.Kind = KindBasicDataConnectionKindDataConnection 1853 objectMap := make(map[string]interface{}) 1854 if dc.Location != nil { 1855 objectMap["location"] = dc.Location 1856 } 1857 if dc.Kind != "" { 1858 objectMap["kind"] = dc.Kind 1859 } 1860 return json.Marshal(objectMap) 1861} 1862 1863// AsEventHubDataConnection is the BasicDataConnection implementation for DataConnection. 1864func (dc DataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) { 1865 return nil, false 1866} 1867 1868// AsIotHubDataConnection is the BasicDataConnection implementation for DataConnection. 1869func (dc DataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) { 1870 return nil, false 1871} 1872 1873// AsEventGridDataConnection is the BasicDataConnection implementation for DataConnection. 1874func (dc DataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) { 1875 return nil, false 1876} 1877 1878// AsDataConnection is the BasicDataConnection implementation for DataConnection. 1879func (dc DataConnection) AsDataConnection() (*DataConnection, bool) { 1880 return &dc, true 1881} 1882 1883// AsBasicDataConnection is the BasicDataConnection implementation for DataConnection. 1884func (dc DataConnection) AsBasicDataConnection() (BasicDataConnection, bool) { 1885 return &dc, true 1886} 1887 1888// DataConnectionCheckNameRequest a data connection check name availability request. 1889type DataConnectionCheckNameRequest struct { 1890 // Name - Data Connection name. 1891 Name *string `json:"name,omitempty"` 1892 // Type - The type of resource, Microsoft.Kusto/clusters/databases/dataConnections. 1893 Type *string `json:"type,omitempty"` 1894} 1895 1896// DataConnectionListResult the list Kusto data connections operation response. 1897type DataConnectionListResult struct { 1898 autorest.Response `json:"-"` 1899 // Value - The list of Kusto data connections. 1900 Value *[]BasicDataConnection `json:"value,omitempty"` 1901} 1902 1903// UnmarshalJSON is the custom unmarshaler for DataConnectionListResult struct. 1904func (dclr *DataConnectionListResult) UnmarshalJSON(body []byte) error { 1905 var m map[string]*json.RawMessage 1906 err := json.Unmarshal(body, &m) 1907 if err != nil { 1908 return err 1909 } 1910 for k, v := range m { 1911 switch k { 1912 case "value": 1913 if v != nil { 1914 value, err := unmarshalBasicDataConnectionArray(*v) 1915 if err != nil { 1916 return err 1917 } 1918 dclr.Value = &value 1919 } 1920 } 1921 } 1922 1923 return nil 1924} 1925 1926// DataConnectionModel ... 1927type DataConnectionModel struct { 1928 autorest.Response `json:"-"` 1929 Value BasicDataConnection `json:"value,omitempty"` 1930} 1931 1932// UnmarshalJSON is the custom unmarshaler for DataConnectionModel struct. 1933func (dcm *DataConnectionModel) UnmarshalJSON(body []byte) error { 1934 dc, err := unmarshalBasicDataConnection(body) 1935 if err != nil { 1936 return err 1937 } 1938 dcm.Value = dc 1939 1940 return nil 1941} 1942 1943// DataConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 1944// long-running operation. 1945type DataConnectionsCreateOrUpdateFuture struct { 1946 azure.FutureAPI 1947 // Result returns the result of the asynchronous operation. 1948 // If the operation has not completed it will return an error. 1949 Result func(DataConnectionsClient) (DataConnectionModel, error) 1950} 1951 1952// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1953func (future *DataConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 1954 var azFuture azure.Future 1955 if err := json.Unmarshal(body, &azFuture); err != nil { 1956 return err 1957 } 1958 future.FutureAPI = &azFuture 1959 future.Result = future.result 1960 return nil 1961} 1962 1963// result is the default implementation for DataConnectionsCreateOrUpdateFuture.Result. 1964func (future *DataConnectionsCreateOrUpdateFuture) result(client DataConnectionsClient) (dcm DataConnectionModel, err error) { 1965 var done bool 1966 done, err = future.DoneWithContext(context.Background(), client) 1967 if err != nil { 1968 err = autorest.NewErrorWithError(err, "kusto.DataConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1969 return 1970 } 1971 if !done { 1972 dcm.Response.Response = future.Response() 1973 err = azure.NewAsyncOpIncompleteError("kusto.DataConnectionsCreateOrUpdateFuture") 1974 return 1975 } 1976 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1977 if dcm.Response.Response, err = future.GetResult(sender); err == nil && dcm.Response.Response.StatusCode != http.StatusNoContent { 1978 dcm, err = client.CreateOrUpdateResponder(dcm.Response.Response) 1979 if err != nil { 1980 err = autorest.NewErrorWithError(err, "kusto.DataConnectionsCreateOrUpdateFuture", "Result", dcm.Response.Response, "Failure responding to request") 1981 } 1982 } 1983 return 1984} 1985 1986// DataConnectionsDataConnectionValidationMethodFuture an abstraction for monitoring and retrieving the 1987// results of a long-running operation. 1988type DataConnectionsDataConnectionValidationMethodFuture struct { 1989 azure.FutureAPI 1990 // Result returns the result of the asynchronous operation. 1991 // If the operation has not completed it will return an error. 1992 Result func(DataConnectionsClient) (DataConnectionValidationListResult, error) 1993} 1994 1995// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1996func (future *DataConnectionsDataConnectionValidationMethodFuture) UnmarshalJSON(body []byte) error { 1997 var azFuture azure.Future 1998 if err := json.Unmarshal(body, &azFuture); err != nil { 1999 return err 2000 } 2001 future.FutureAPI = &azFuture 2002 future.Result = future.result 2003 return nil 2004} 2005 2006// result is the default implementation for DataConnectionsDataConnectionValidationMethodFuture.Result. 2007func (future *DataConnectionsDataConnectionValidationMethodFuture) result(client DataConnectionsClient) (dcvlr DataConnectionValidationListResult, err error) { 2008 var done bool 2009 done, err = future.DoneWithContext(context.Background(), client) 2010 if err != nil { 2011 err = autorest.NewErrorWithError(err, "kusto.DataConnectionsDataConnectionValidationMethodFuture", "Result", future.Response(), "Polling failure") 2012 return 2013 } 2014 if !done { 2015 dcvlr.Response.Response = future.Response() 2016 err = azure.NewAsyncOpIncompleteError("kusto.DataConnectionsDataConnectionValidationMethodFuture") 2017 return 2018 } 2019 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2020 if dcvlr.Response.Response, err = future.GetResult(sender); err == nil && dcvlr.Response.Response.StatusCode != http.StatusNoContent { 2021 dcvlr, err = client.DataConnectionValidationMethodResponder(dcvlr.Response.Response) 2022 if err != nil { 2023 err = autorest.NewErrorWithError(err, "kusto.DataConnectionsDataConnectionValidationMethodFuture", "Result", dcvlr.Response.Response, "Failure responding to request") 2024 } 2025 } 2026 return 2027} 2028 2029// DataConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 2030// operation. 2031type DataConnectionsDeleteFuture struct { 2032 azure.FutureAPI 2033 // Result returns the result of the asynchronous operation. 2034 // If the operation has not completed it will return an error. 2035 Result func(DataConnectionsClient) (autorest.Response, error) 2036} 2037 2038// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2039func (future *DataConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { 2040 var azFuture azure.Future 2041 if err := json.Unmarshal(body, &azFuture); err != nil { 2042 return err 2043 } 2044 future.FutureAPI = &azFuture 2045 future.Result = future.result 2046 return nil 2047} 2048 2049// result is the default implementation for DataConnectionsDeleteFuture.Result. 2050func (future *DataConnectionsDeleteFuture) result(client DataConnectionsClient) (ar autorest.Response, err error) { 2051 var done bool 2052 done, err = future.DoneWithContext(context.Background(), client) 2053 if err != nil { 2054 err = autorest.NewErrorWithError(err, "kusto.DataConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") 2055 return 2056 } 2057 if !done { 2058 ar.Response = future.Response() 2059 err = azure.NewAsyncOpIncompleteError("kusto.DataConnectionsDeleteFuture") 2060 return 2061 } 2062 ar.Response = future.Response() 2063 return 2064} 2065 2066// DataConnectionsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 2067// operation. 2068type DataConnectionsUpdateFuture struct { 2069 azure.FutureAPI 2070 // Result returns the result of the asynchronous operation. 2071 // If the operation has not completed it will return an error. 2072 Result func(DataConnectionsClient) (DataConnectionModel, error) 2073} 2074 2075// UnmarshalJSON is the custom unmarshaller for CreateFuture. 2076func (future *DataConnectionsUpdateFuture) UnmarshalJSON(body []byte) error { 2077 var azFuture azure.Future 2078 if err := json.Unmarshal(body, &azFuture); err != nil { 2079 return err 2080 } 2081 future.FutureAPI = &azFuture 2082 future.Result = future.result 2083 return nil 2084} 2085 2086// result is the default implementation for DataConnectionsUpdateFuture.Result. 2087func (future *DataConnectionsUpdateFuture) result(client DataConnectionsClient) (dcm DataConnectionModel, err error) { 2088 var done bool 2089 done, err = future.DoneWithContext(context.Background(), client) 2090 if err != nil { 2091 err = autorest.NewErrorWithError(err, "kusto.DataConnectionsUpdateFuture", "Result", future.Response(), "Polling failure") 2092 return 2093 } 2094 if !done { 2095 dcm.Response.Response = future.Response() 2096 err = azure.NewAsyncOpIncompleteError("kusto.DataConnectionsUpdateFuture") 2097 return 2098 } 2099 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2100 if dcm.Response.Response, err = future.GetResult(sender); err == nil && dcm.Response.Response.StatusCode != http.StatusNoContent { 2101 dcm, err = client.UpdateResponder(dcm.Response.Response) 2102 if err != nil { 2103 err = autorest.NewErrorWithError(err, "kusto.DataConnectionsUpdateFuture", "Result", dcm.Response.Response, "Failure responding to request") 2104 } 2105 } 2106 return 2107} 2108 2109// DataConnectionValidation class representing an data connection validation. 2110type DataConnectionValidation struct { 2111 // DataConnectionName - The name of the data connection. 2112 DataConnectionName *string `json:"dataConnectionName,omitempty"` 2113 // Properties - The data connection properties to validate. 2114 Properties BasicDataConnection `json:"properties,omitempty"` 2115} 2116 2117// UnmarshalJSON is the custom unmarshaler for DataConnectionValidation struct. 2118func (dcv *DataConnectionValidation) UnmarshalJSON(body []byte) error { 2119 var m map[string]*json.RawMessage 2120 err := json.Unmarshal(body, &m) 2121 if err != nil { 2122 return err 2123 } 2124 for k, v := range m { 2125 switch k { 2126 case "dataConnectionName": 2127 if v != nil { 2128 var dataConnectionName string 2129 err = json.Unmarshal(*v, &dataConnectionName) 2130 if err != nil { 2131 return err 2132 } 2133 dcv.DataConnectionName = &dataConnectionName 2134 } 2135 case "properties": 2136 if v != nil { 2137 properties, err := unmarshalBasicDataConnection(*v) 2138 if err != nil { 2139 return err 2140 } 2141 dcv.Properties = properties 2142 } 2143 } 2144 } 2145 2146 return nil 2147} 2148 2149// DataConnectionValidationListResult the list Kusto data connection validation result. 2150type DataConnectionValidationListResult struct { 2151 autorest.Response `json:"-"` 2152 // Value - The list of Kusto data connection validation errors. 2153 Value *[]DataConnectionValidationResult `json:"value,omitempty"` 2154} 2155 2156// DataConnectionValidationResult the result returned from a data connection validation request. 2157type DataConnectionValidationResult struct { 2158 // ErrorMessage - A message which indicates a problem in data connection validation. 2159 ErrorMessage *string `json:"errorMessage,omitempty"` 2160} 2161 2162// DiagnoseVirtualNetworkResult ... 2163type DiagnoseVirtualNetworkResult struct { 2164 autorest.Response `json:"-"` 2165 // Findings - The list of network connectivity diagnostic finding 2166 Findings *[]string `json:"findings,omitempty"` 2167} 2168 2169// EventGridConnectionProperties class representing the Kusto event grid connection properties. 2170type EventGridConnectionProperties struct { 2171 // StorageAccountResourceID - The resource ID of the storage account where the data resides. 2172 StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"` 2173 // EventHubResourceID - The resource ID where the event grid is configured to send events. 2174 EventHubResourceID *string `json:"eventHubResourceId,omitempty"` 2175 // ConsumerGroup - The event hub consumer group. 2176 ConsumerGroup *string `json:"consumerGroup,omitempty"` 2177 // TableName - The table where the data should be ingested. Optionally the table information can be added to each message. 2178 TableName *string `json:"tableName,omitempty"` 2179 // MappingRuleName - The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. 2180 MappingRuleName *string `json:"mappingRuleName,omitempty"` 2181 // DataFormat - The data format of the message. Optionally the data format can be added to each message. Possible values include: 'EventGridDataFormatMULTIJSON', 'EventGridDataFormatJSON', 'EventGridDataFormatCSV', 'EventGridDataFormatTSV', 'EventGridDataFormatSCSV', 'EventGridDataFormatSOHSV', 'EventGridDataFormatPSV', 'EventGridDataFormatTXT', 'EventGridDataFormatRAW', 'EventGridDataFormatSINGLEJSON', 'EventGridDataFormatAVRO', 'EventGridDataFormatTSVE', 'EventGridDataFormatPARQUET', 'EventGridDataFormatORC', 'EventGridDataFormatAPACHEAVRO', 'EventGridDataFormatW3CLOGFILE' 2182 DataFormat EventGridDataFormat `json:"dataFormat,omitempty"` 2183 // IgnoreFirstRecord - A Boolean value that, if set to true, indicates that ingestion should ignore the first record of every file 2184 IgnoreFirstRecord *bool `json:"ignoreFirstRecord,omitempty"` 2185 // BlobStorageEventType - The name of blob storage event type to process. Possible values include: 'BlobStorageEventTypeMicrosoftStorageBlobCreated', 'BlobStorageEventTypeMicrosoftStorageBlobRenamed' 2186 BlobStorageEventType BlobStorageEventType `json:"blobStorageEventType,omitempty"` 2187 // ProvisioningState - The provisioned state of the resource. Possible values include: 'ProvisioningStateRunning', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateMoving' 2188 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 2189} 2190 2191// EventGridDataConnection class representing an Event Grid data connection. 2192type EventGridDataConnection struct { 2193 // EventGridConnectionProperties - The properties of the Event Grid data connection. 2194 *EventGridConnectionProperties `json:"properties,omitempty"` 2195 // Location - Resource location. 2196 Location *string `json:"location,omitempty"` 2197 // Kind - Possible values include: 'KindBasicDataConnectionKindDataConnection', 'KindBasicDataConnectionKindEventHub', 'KindBasicDataConnectionKindIotHub', 'KindBasicDataConnectionKindEventGrid' 2198 Kind KindBasicDataConnection `json:"kind,omitempty"` 2199 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 2200 ID *string `json:"id,omitempty"` 2201 // Name - READ-ONLY; The name of the resource 2202 Name *string `json:"name,omitempty"` 2203 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 2204 Type *string `json:"type,omitempty"` 2205} 2206 2207// MarshalJSON is the custom marshaler for EventGridDataConnection. 2208func (egdc EventGridDataConnection) MarshalJSON() ([]byte, error) { 2209 egdc.Kind = KindBasicDataConnectionKindEventGrid 2210 objectMap := make(map[string]interface{}) 2211 if egdc.EventGridConnectionProperties != nil { 2212 objectMap["properties"] = egdc.EventGridConnectionProperties 2213 } 2214 if egdc.Location != nil { 2215 objectMap["location"] = egdc.Location 2216 } 2217 if egdc.Kind != "" { 2218 objectMap["kind"] = egdc.Kind 2219 } 2220 return json.Marshal(objectMap) 2221} 2222 2223// AsEventHubDataConnection is the BasicDataConnection implementation for EventGridDataConnection. 2224func (egdc EventGridDataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) { 2225 return nil, false 2226} 2227 2228// AsIotHubDataConnection is the BasicDataConnection implementation for EventGridDataConnection. 2229func (egdc EventGridDataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) { 2230 return nil, false 2231} 2232 2233// AsEventGridDataConnection is the BasicDataConnection implementation for EventGridDataConnection. 2234func (egdc EventGridDataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) { 2235 return &egdc, true 2236} 2237 2238// AsDataConnection is the BasicDataConnection implementation for EventGridDataConnection. 2239func (egdc EventGridDataConnection) AsDataConnection() (*DataConnection, bool) { 2240 return nil, false 2241} 2242 2243// AsBasicDataConnection is the BasicDataConnection implementation for EventGridDataConnection. 2244func (egdc EventGridDataConnection) AsBasicDataConnection() (BasicDataConnection, bool) { 2245 return &egdc, true 2246} 2247 2248// UnmarshalJSON is the custom unmarshaler for EventGridDataConnection struct. 2249func (egdc *EventGridDataConnection) UnmarshalJSON(body []byte) error { 2250 var m map[string]*json.RawMessage 2251 err := json.Unmarshal(body, &m) 2252 if err != nil { 2253 return err 2254 } 2255 for k, v := range m { 2256 switch k { 2257 case "properties": 2258 if v != nil { 2259 var eventGridConnectionProperties EventGridConnectionProperties 2260 err = json.Unmarshal(*v, &eventGridConnectionProperties) 2261 if err != nil { 2262 return err 2263 } 2264 egdc.EventGridConnectionProperties = &eventGridConnectionProperties 2265 } 2266 case "location": 2267 if v != nil { 2268 var location string 2269 err = json.Unmarshal(*v, &location) 2270 if err != nil { 2271 return err 2272 } 2273 egdc.Location = &location 2274 } 2275 case "kind": 2276 if v != nil { 2277 var kind KindBasicDataConnection 2278 err = json.Unmarshal(*v, &kind) 2279 if err != nil { 2280 return err 2281 } 2282 egdc.Kind = kind 2283 } 2284 case "id": 2285 if v != nil { 2286 var ID string 2287 err = json.Unmarshal(*v, &ID) 2288 if err != nil { 2289 return err 2290 } 2291 egdc.ID = &ID 2292 } 2293 case "name": 2294 if v != nil { 2295 var name string 2296 err = json.Unmarshal(*v, &name) 2297 if err != nil { 2298 return err 2299 } 2300 egdc.Name = &name 2301 } 2302 case "type": 2303 if v != nil { 2304 var typeVar string 2305 err = json.Unmarshal(*v, &typeVar) 2306 if err != nil { 2307 return err 2308 } 2309 egdc.Type = &typeVar 2310 } 2311 } 2312 } 2313 2314 return nil 2315} 2316 2317// EventHubConnectionProperties class representing the Kusto event hub connection properties. 2318type EventHubConnectionProperties struct { 2319 // EventHubResourceID - The resource ID of the event hub to be used to create a data connection. 2320 EventHubResourceID *string `json:"eventHubResourceId,omitempty"` 2321 // ConsumerGroup - The event hub consumer group. 2322 ConsumerGroup *string `json:"consumerGroup,omitempty"` 2323 // TableName - The table where the data should be ingested. Optionally the table information can be added to each message. 2324 TableName *string `json:"tableName,omitempty"` 2325 // MappingRuleName - The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. 2326 MappingRuleName *string `json:"mappingRuleName,omitempty"` 2327 // DataFormat - The data format of the message. Optionally the data format can be added to each message. Possible values include: 'EventHubDataFormatMULTIJSON', 'EventHubDataFormatJSON', 'EventHubDataFormatCSV', 'EventHubDataFormatTSV', 'EventHubDataFormatSCSV', 'EventHubDataFormatSOHSV', 'EventHubDataFormatPSV', 'EventHubDataFormatTXT', 'EventHubDataFormatRAW', 'EventHubDataFormatSINGLEJSON', 'EventHubDataFormatAVRO', 'EventHubDataFormatTSVE', 'EventHubDataFormatPARQUET', 'EventHubDataFormatORC', 'EventHubDataFormatAPACHEAVRO', 'EventHubDataFormatW3CLOGFILE' 2328 DataFormat EventHubDataFormat `json:"dataFormat,omitempty"` 2329 // EventSystemProperties - System properties of the event hub 2330 EventSystemProperties *[]string `json:"eventSystemProperties,omitempty"` 2331 // Compression - The event hub messages compression type. Possible values include: 'CompressionNone', 'CompressionGZip' 2332 Compression Compression `json:"compression,omitempty"` 2333 // ProvisioningState - The provisioned state of the resource. Possible values include: 'ProvisioningStateRunning', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateMoving' 2334 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 2335 // ManagedIdentityResourceID - The resource ID of a managed identity (system or user assigned) to be used to authenticate with event hub. 2336 ManagedIdentityResourceID *string `json:"managedIdentityResourceId,omitempty"` 2337} 2338 2339// EventHubDataConnection class representing an event hub data connection. 2340type EventHubDataConnection struct { 2341 // EventHubConnectionProperties - The Event Hub data connection properties to validate. 2342 *EventHubConnectionProperties `json:"properties,omitempty"` 2343 // Location - Resource location. 2344 Location *string `json:"location,omitempty"` 2345 // Kind - Possible values include: 'KindBasicDataConnectionKindDataConnection', 'KindBasicDataConnectionKindEventHub', 'KindBasicDataConnectionKindIotHub', 'KindBasicDataConnectionKindEventGrid' 2346 Kind KindBasicDataConnection `json:"kind,omitempty"` 2347 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 2348 ID *string `json:"id,omitempty"` 2349 // Name - READ-ONLY; The name of the resource 2350 Name *string `json:"name,omitempty"` 2351 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 2352 Type *string `json:"type,omitempty"` 2353} 2354 2355// MarshalJSON is the custom marshaler for EventHubDataConnection. 2356func (ehdc EventHubDataConnection) MarshalJSON() ([]byte, error) { 2357 ehdc.Kind = KindBasicDataConnectionKindEventHub 2358 objectMap := make(map[string]interface{}) 2359 if ehdc.EventHubConnectionProperties != nil { 2360 objectMap["properties"] = ehdc.EventHubConnectionProperties 2361 } 2362 if ehdc.Location != nil { 2363 objectMap["location"] = ehdc.Location 2364 } 2365 if ehdc.Kind != "" { 2366 objectMap["kind"] = ehdc.Kind 2367 } 2368 return json.Marshal(objectMap) 2369} 2370 2371// AsEventHubDataConnection is the BasicDataConnection implementation for EventHubDataConnection. 2372func (ehdc EventHubDataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) { 2373 return &ehdc, true 2374} 2375 2376// AsIotHubDataConnection is the BasicDataConnection implementation for EventHubDataConnection. 2377func (ehdc EventHubDataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) { 2378 return nil, false 2379} 2380 2381// AsEventGridDataConnection is the BasicDataConnection implementation for EventHubDataConnection. 2382func (ehdc EventHubDataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) { 2383 return nil, false 2384} 2385 2386// AsDataConnection is the BasicDataConnection implementation for EventHubDataConnection. 2387func (ehdc EventHubDataConnection) AsDataConnection() (*DataConnection, bool) { 2388 return nil, false 2389} 2390 2391// AsBasicDataConnection is the BasicDataConnection implementation for EventHubDataConnection. 2392func (ehdc EventHubDataConnection) AsBasicDataConnection() (BasicDataConnection, bool) { 2393 return &ehdc, true 2394} 2395 2396// UnmarshalJSON is the custom unmarshaler for EventHubDataConnection struct. 2397func (ehdc *EventHubDataConnection) UnmarshalJSON(body []byte) error { 2398 var m map[string]*json.RawMessage 2399 err := json.Unmarshal(body, &m) 2400 if err != nil { 2401 return err 2402 } 2403 for k, v := range m { 2404 switch k { 2405 case "properties": 2406 if v != nil { 2407 var eventHubConnectionProperties EventHubConnectionProperties 2408 err = json.Unmarshal(*v, &eventHubConnectionProperties) 2409 if err != nil { 2410 return err 2411 } 2412 ehdc.EventHubConnectionProperties = &eventHubConnectionProperties 2413 } 2414 case "location": 2415 if v != nil { 2416 var location string 2417 err = json.Unmarshal(*v, &location) 2418 if err != nil { 2419 return err 2420 } 2421 ehdc.Location = &location 2422 } 2423 case "kind": 2424 if v != nil { 2425 var kind KindBasicDataConnection 2426 err = json.Unmarshal(*v, &kind) 2427 if err != nil { 2428 return err 2429 } 2430 ehdc.Kind = kind 2431 } 2432 case "id": 2433 if v != nil { 2434 var ID string 2435 err = json.Unmarshal(*v, &ID) 2436 if err != nil { 2437 return err 2438 } 2439 ehdc.ID = &ID 2440 } 2441 case "name": 2442 if v != nil { 2443 var name string 2444 err = json.Unmarshal(*v, &name) 2445 if err != nil { 2446 return err 2447 } 2448 ehdc.Name = &name 2449 } 2450 case "type": 2451 if v != nil { 2452 var typeVar string 2453 err = json.Unmarshal(*v, &typeVar) 2454 if err != nil { 2455 return err 2456 } 2457 ehdc.Type = &typeVar 2458 } 2459 } 2460 } 2461 2462 return nil 2463} 2464 2465// FollowerDatabaseDefinition a class representing follower database request. 2466type FollowerDatabaseDefinition struct { 2467 // ClusterResourceID - Resource id of the cluster that follows a database owned by this cluster. 2468 ClusterResourceID *string `json:"clusterResourceId,omitempty"` 2469 // AttachedDatabaseConfigurationName - Resource name of the attached database configuration in the follower cluster. 2470 AttachedDatabaseConfigurationName *string `json:"attachedDatabaseConfigurationName,omitempty"` 2471 // DatabaseName - READ-ONLY; The database name owned by this cluster that was followed. * in case following all databases. 2472 DatabaseName *string `json:"databaseName,omitempty"` 2473} 2474 2475// MarshalJSON is the custom marshaler for FollowerDatabaseDefinition. 2476func (fdd FollowerDatabaseDefinition) MarshalJSON() ([]byte, error) { 2477 objectMap := make(map[string]interface{}) 2478 if fdd.ClusterResourceID != nil { 2479 objectMap["clusterResourceId"] = fdd.ClusterResourceID 2480 } 2481 if fdd.AttachedDatabaseConfigurationName != nil { 2482 objectMap["attachedDatabaseConfigurationName"] = fdd.AttachedDatabaseConfigurationName 2483 } 2484 return json.Marshal(objectMap) 2485} 2486 2487// FollowerDatabaseListResult the list Kusto database principals operation response. 2488type FollowerDatabaseListResult struct { 2489 autorest.Response `json:"-"` 2490 // Value - The list of follower database result. 2491 Value *[]FollowerDatabaseDefinition `json:"value,omitempty"` 2492} 2493 2494// Identity identity for the resource. 2495type Identity struct { 2496 // PrincipalID - READ-ONLY; The principal ID of resource identity. 2497 PrincipalID *string `json:"principalId,omitempty"` 2498 // TenantID - READ-ONLY; The tenant ID of resource. 2499 TenantID *string `json:"tenantId,omitempty"` 2500 // Type - The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove all identities. Possible values include: 'IdentityTypeNone', 'IdentityTypeSystemAssigned', 'IdentityTypeUserAssigned', 'IdentityTypeSystemAssignedUserAssigned' 2501 Type IdentityType `json:"type,omitempty"` 2502 // UserAssignedIdentities - The list of user identities associated with the Kusto cluster. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. 2503 UserAssignedIdentities map[string]*IdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 2504} 2505 2506// MarshalJSON is the custom marshaler for Identity. 2507func (i Identity) MarshalJSON() ([]byte, error) { 2508 objectMap := make(map[string]interface{}) 2509 if i.Type != "" { 2510 objectMap["type"] = i.Type 2511 } 2512 if i.UserAssignedIdentities != nil { 2513 objectMap["userAssignedIdentities"] = i.UserAssignedIdentities 2514 } 2515 return json.Marshal(objectMap) 2516} 2517 2518// IdentityUserAssignedIdentitiesValue ... 2519type IdentityUserAssignedIdentitiesValue struct { 2520 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 2521 PrincipalID *string `json:"principalId,omitempty"` 2522 // ClientID - READ-ONLY; The client id of user assigned identity. 2523 ClientID *string `json:"clientId,omitempty"` 2524} 2525 2526// MarshalJSON is the custom marshaler for IdentityUserAssignedIdentitiesValue. 2527func (iAiv IdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) { 2528 objectMap := make(map[string]interface{}) 2529 return json.Marshal(objectMap) 2530} 2531 2532// IotHubConnectionProperties class representing the Kusto Iot hub connection properties. 2533type IotHubConnectionProperties struct { 2534 // IotHubResourceID - The resource ID of the Iot hub to be used to create a data connection. 2535 IotHubResourceID *string `json:"iotHubResourceId,omitempty"` 2536 // ConsumerGroup - The iot hub consumer group. 2537 ConsumerGroup *string `json:"consumerGroup,omitempty"` 2538 // TableName - The table where the data should be ingested. Optionally the table information can be added to each message. 2539 TableName *string `json:"tableName,omitempty"` 2540 // MappingRuleName - The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. 2541 MappingRuleName *string `json:"mappingRuleName,omitempty"` 2542 // DataFormat - The data format of the message. Optionally the data format can be added to each message. Possible values include: 'IotHubDataFormatMULTIJSON', 'IotHubDataFormatJSON', 'IotHubDataFormatCSV', 'IotHubDataFormatTSV', 'IotHubDataFormatSCSV', 'IotHubDataFormatSOHSV', 'IotHubDataFormatPSV', 'IotHubDataFormatTXT', 'IotHubDataFormatRAW', 'IotHubDataFormatSINGLEJSON', 'IotHubDataFormatAVRO', 'IotHubDataFormatTSVE', 'IotHubDataFormatPARQUET', 'IotHubDataFormatORC', 'IotHubDataFormatAPACHEAVRO', 'IotHubDataFormatW3CLOGFILE' 2543 DataFormat IotHubDataFormat `json:"dataFormat,omitempty"` 2544 // EventSystemProperties - System properties of the iot hub 2545 EventSystemProperties *[]string `json:"eventSystemProperties,omitempty"` 2546 // SharedAccessPolicyName - The name of the share access policy 2547 SharedAccessPolicyName *string `json:"sharedAccessPolicyName,omitempty"` 2548 // ProvisioningState - The provisioned state of the resource. Possible values include: 'ProvisioningStateRunning', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateMoving' 2549 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 2550} 2551 2552// IotHubDataConnection class representing an iot hub data connection. 2553type IotHubDataConnection struct { 2554 // IotHubConnectionProperties - The Iot Hub data connection properties. 2555 *IotHubConnectionProperties `json:"properties,omitempty"` 2556 // Location - Resource location. 2557 Location *string `json:"location,omitempty"` 2558 // Kind - Possible values include: 'KindBasicDataConnectionKindDataConnection', 'KindBasicDataConnectionKindEventHub', 'KindBasicDataConnectionKindIotHub', 'KindBasicDataConnectionKindEventGrid' 2559 Kind KindBasicDataConnection `json:"kind,omitempty"` 2560 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 2561 ID *string `json:"id,omitempty"` 2562 // Name - READ-ONLY; The name of the resource 2563 Name *string `json:"name,omitempty"` 2564 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 2565 Type *string `json:"type,omitempty"` 2566} 2567 2568// MarshalJSON is the custom marshaler for IotHubDataConnection. 2569func (ihdc IotHubDataConnection) MarshalJSON() ([]byte, error) { 2570 ihdc.Kind = KindBasicDataConnectionKindIotHub 2571 objectMap := make(map[string]interface{}) 2572 if ihdc.IotHubConnectionProperties != nil { 2573 objectMap["properties"] = ihdc.IotHubConnectionProperties 2574 } 2575 if ihdc.Location != nil { 2576 objectMap["location"] = ihdc.Location 2577 } 2578 if ihdc.Kind != "" { 2579 objectMap["kind"] = ihdc.Kind 2580 } 2581 return json.Marshal(objectMap) 2582} 2583 2584// AsEventHubDataConnection is the BasicDataConnection implementation for IotHubDataConnection. 2585func (ihdc IotHubDataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) { 2586 return nil, false 2587} 2588 2589// AsIotHubDataConnection is the BasicDataConnection implementation for IotHubDataConnection. 2590func (ihdc IotHubDataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) { 2591 return &ihdc, true 2592} 2593 2594// AsEventGridDataConnection is the BasicDataConnection implementation for IotHubDataConnection. 2595func (ihdc IotHubDataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) { 2596 return nil, false 2597} 2598 2599// AsDataConnection is the BasicDataConnection implementation for IotHubDataConnection. 2600func (ihdc IotHubDataConnection) AsDataConnection() (*DataConnection, bool) { 2601 return nil, false 2602} 2603 2604// AsBasicDataConnection is the BasicDataConnection implementation for IotHubDataConnection. 2605func (ihdc IotHubDataConnection) AsBasicDataConnection() (BasicDataConnection, bool) { 2606 return &ihdc, true 2607} 2608 2609// UnmarshalJSON is the custom unmarshaler for IotHubDataConnection struct. 2610func (ihdc *IotHubDataConnection) UnmarshalJSON(body []byte) error { 2611 var m map[string]*json.RawMessage 2612 err := json.Unmarshal(body, &m) 2613 if err != nil { 2614 return err 2615 } 2616 for k, v := range m { 2617 switch k { 2618 case "properties": 2619 if v != nil { 2620 var iotHubConnectionProperties IotHubConnectionProperties 2621 err = json.Unmarshal(*v, &iotHubConnectionProperties) 2622 if err != nil { 2623 return err 2624 } 2625 ihdc.IotHubConnectionProperties = &iotHubConnectionProperties 2626 } 2627 case "location": 2628 if v != nil { 2629 var location string 2630 err = json.Unmarshal(*v, &location) 2631 if err != nil { 2632 return err 2633 } 2634 ihdc.Location = &location 2635 } 2636 case "kind": 2637 if v != nil { 2638 var kind KindBasicDataConnection 2639 err = json.Unmarshal(*v, &kind) 2640 if err != nil { 2641 return err 2642 } 2643 ihdc.Kind = kind 2644 } 2645 case "id": 2646 if v != nil { 2647 var ID string 2648 err = json.Unmarshal(*v, &ID) 2649 if err != nil { 2650 return err 2651 } 2652 ihdc.ID = &ID 2653 } 2654 case "name": 2655 if v != nil { 2656 var name string 2657 err = json.Unmarshal(*v, &name) 2658 if err != nil { 2659 return err 2660 } 2661 ihdc.Name = &name 2662 } 2663 case "type": 2664 if v != nil { 2665 var typeVar string 2666 err = json.Unmarshal(*v, &typeVar) 2667 if err != nil { 2668 return err 2669 } 2670 ihdc.Type = &typeVar 2671 } 2672 } 2673 } 2674 2675 return nil 2676} 2677 2678// KeyVaultProperties properties of the key vault. 2679type KeyVaultProperties struct { 2680 // KeyName - The name of the key vault key. 2681 KeyName *string `json:"keyName,omitempty"` 2682 // KeyVersion - The version of the key vault key. 2683 KeyVersion *string `json:"keyVersion,omitempty"` 2684 // KeyVaultURI - The Uri of the key vault. 2685 KeyVaultURI *string `json:"keyVaultUri,omitempty"` 2686 // UserIdentity - The user assigned identity (ARM resource id) that has access to the key. 2687 UserIdentity *string `json:"userIdentity,omitempty"` 2688} 2689 2690// LanguageExtension the language extension object. 2691type LanguageExtension struct { 2692 // LanguageExtensionName - The language extension name. Possible values include: 'LanguageExtensionNamePYTHON', 'LanguageExtensionNameR' 2693 LanguageExtensionName LanguageExtensionName `json:"languageExtensionName,omitempty"` 2694} 2695 2696// LanguageExtensionsList the list of language extension objects. 2697type LanguageExtensionsList struct { 2698 autorest.Response `json:"-"` 2699 // Value - The list of language extensions. 2700 Value *[]LanguageExtension `json:"value,omitempty"` 2701} 2702 2703// ListResourceSkusResult list of available SKUs for a Kusto Cluster. 2704type ListResourceSkusResult struct { 2705 autorest.Response `json:"-"` 2706 // Value - The collection of available SKUs for an existing resource. 2707 Value *[]AzureResourceSku `json:"value,omitempty"` 2708} 2709 2710// Operation ... 2711type Operation struct { 2712 // Name - This is of the format {provider}/{resource}/{operation}. 2713 Name *string `json:"name,omitempty"` 2714 Display *OperationDisplay `json:"display,omitempty"` 2715 Origin *string `json:"origin,omitempty"` 2716 Properties interface{} `json:"properties,omitempty"` 2717} 2718 2719// OperationDisplay ... 2720type OperationDisplay struct { 2721 Provider *string `json:"provider,omitempty"` 2722 // Operation - For example: read, write, delete. 2723 Operation *string `json:"operation,omitempty"` 2724 Resource *string `json:"resource,omitempty"` 2725 Description *string `json:"description,omitempty"` 2726} 2727 2728// OperationListResult ... 2729type OperationListResult struct { 2730 autorest.Response `json:"-"` 2731 Value *[]Operation `json:"value,omitempty"` 2732 NextLink *string `json:"nextLink,omitempty"` 2733} 2734 2735// OperationListResultIterator provides access to a complete listing of Operation values. 2736type OperationListResultIterator struct { 2737 i int 2738 page OperationListResultPage 2739} 2740 2741// NextWithContext advances to the next value. If there was an error making 2742// the request the iterator does not advance and the error is returned. 2743func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { 2744 if tracing.IsEnabled() { 2745 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") 2746 defer func() { 2747 sc := -1 2748 if iter.Response().Response.Response != nil { 2749 sc = iter.Response().Response.Response.StatusCode 2750 } 2751 tracing.EndSpan(ctx, sc, err) 2752 }() 2753 } 2754 iter.i++ 2755 if iter.i < len(iter.page.Values()) { 2756 return nil 2757 } 2758 err = iter.page.NextWithContext(ctx) 2759 if err != nil { 2760 iter.i-- 2761 return err 2762 } 2763 iter.i = 0 2764 return nil 2765} 2766 2767// Next advances to the next value. If there was an error making 2768// the request the iterator does not advance and the error is returned. 2769// Deprecated: Use NextWithContext() instead. 2770func (iter *OperationListResultIterator) Next() error { 2771 return iter.NextWithContext(context.Background()) 2772} 2773 2774// NotDone returns true if the enumeration should be started or is not yet complete. 2775func (iter OperationListResultIterator) NotDone() bool { 2776 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2777} 2778 2779// Response returns the raw server response from the last page request. 2780func (iter OperationListResultIterator) Response() OperationListResult { 2781 return iter.page.Response() 2782} 2783 2784// Value returns the current value or a zero-initialized value if the 2785// iterator has advanced beyond the end of the collection. 2786func (iter OperationListResultIterator) Value() Operation { 2787 if !iter.page.NotDone() { 2788 return Operation{} 2789 } 2790 return iter.page.Values()[iter.i] 2791} 2792 2793// Creates a new instance of the OperationListResultIterator type. 2794func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { 2795 return OperationListResultIterator{page: page} 2796} 2797 2798// IsEmpty returns true if the ListResult contains no values. 2799func (olr OperationListResult) IsEmpty() bool { 2800 return olr.Value == nil || len(*olr.Value) == 0 2801} 2802 2803// hasNextLink returns true if the NextLink is not empty. 2804func (olr OperationListResult) hasNextLink() bool { 2805 return olr.NextLink != nil && len(*olr.NextLink) != 0 2806} 2807 2808// operationListResultPreparer prepares a request to retrieve the next set of results. 2809// It returns nil if no more results exist. 2810func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { 2811 if !olr.hasNextLink() { 2812 return nil, nil 2813 } 2814 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2815 autorest.AsJSON(), 2816 autorest.AsGet(), 2817 autorest.WithBaseURL(to.String(olr.NextLink))) 2818} 2819 2820// OperationListResultPage contains a page of Operation values. 2821type OperationListResultPage struct { 2822 fn func(context.Context, OperationListResult) (OperationListResult, error) 2823 olr OperationListResult 2824} 2825 2826// NextWithContext advances to the next page of values. If there was an error making 2827// the request the page does not advance and the error is returned. 2828func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { 2829 if tracing.IsEnabled() { 2830 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") 2831 defer func() { 2832 sc := -1 2833 if page.Response().Response.Response != nil { 2834 sc = page.Response().Response.Response.StatusCode 2835 } 2836 tracing.EndSpan(ctx, sc, err) 2837 }() 2838 } 2839 for { 2840 next, err := page.fn(ctx, page.olr) 2841 if err != nil { 2842 return err 2843 } 2844 page.olr = next 2845 if !next.hasNextLink() || !next.IsEmpty() { 2846 break 2847 } 2848 } 2849 return nil 2850} 2851 2852// Next advances to the next page of values. If there was an error making 2853// the request the page does not advance and the error is returned. 2854// Deprecated: Use NextWithContext() instead. 2855func (page *OperationListResultPage) Next() error { 2856 return page.NextWithContext(context.Background()) 2857} 2858 2859// NotDone returns true if the page enumeration should be started or is not yet complete. 2860func (page OperationListResultPage) NotDone() bool { 2861 return !page.olr.IsEmpty() 2862} 2863 2864// Response returns the raw server response from the last page request. 2865func (page OperationListResultPage) Response() OperationListResult { 2866 return page.olr 2867} 2868 2869// Values returns the slice of values for the current page or nil if there are no values. 2870func (page OperationListResultPage) Values() []Operation { 2871 if page.olr.IsEmpty() { 2872 return nil 2873 } 2874 return *page.olr.Value 2875} 2876 2877// Creates a new instance of the OperationListResultPage type. 2878func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { 2879 return OperationListResultPage{ 2880 fn: getNextPage, 2881 olr: cur, 2882 } 2883} 2884 2885// OperationResult operation Result Entity. 2886type OperationResult struct { 2887 autorest.Response `json:"-"` 2888 // ID - READ-ONLY; ID of the resource. 2889 ID *string `json:"id,omitempty"` 2890 // Name - READ-ONLY; Name of the resource. 2891 Name *string `json:"name,omitempty"` 2892 // Status - status of the Operation result. Possible values include: 'StatusSucceeded', 'StatusCanceled', 'StatusFailed', 'StatusRunning' 2893 Status Status `json:"status,omitempty"` 2894 // StartTime - The operation start time 2895 StartTime *date.Time `json:"startTime,omitempty"` 2896 // EndTime - The operation end time 2897 EndTime *date.Time `json:"endTime,omitempty"` 2898 // PercentComplete - Percentage completed. 2899 PercentComplete *float64 `json:"percentComplete,omitempty"` 2900 // OperationResultProperties - Properties of the operation results 2901 *OperationResultProperties `json:"properties,omitempty"` 2902 // OperationResultErrorProperties - Object that contains the error code and message if the operation failed. 2903 *OperationResultErrorProperties `json:"error,omitempty"` 2904} 2905 2906// MarshalJSON is the custom marshaler for OperationResult. 2907func (or OperationResult) MarshalJSON() ([]byte, error) { 2908 objectMap := make(map[string]interface{}) 2909 if or.Status != "" { 2910 objectMap["status"] = or.Status 2911 } 2912 if or.StartTime != nil { 2913 objectMap["startTime"] = or.StartTime 2914 } 2915 if or.EndTime != nil { 2916 objectMap["endTime"] = or.EndTime 2917 } 2918 if or.PercentComplete != nil { 2919 objectMap["percentComplete"] = or.PercentComplete 2920 } 2921 if or.OperationResultProperties != nil { 2922 objectMap["properties"] = or.OperationResultProperties 2923 } 2924 if or.OperationResultErrorProperties != nil { 2925 objectMap["error"] = or.OperationResultErrorProperties 2926 } 2927 return json.Marshal(objectMap) 2928} 2929 2930// UnmarshalJSON is the custom unmarshaler for OperationResult struct. 2931func (or *OperationResult) UnmarshalJSON(body []byte) error { 2932 var m map[string]*json.RawMessage 2933 err := json.Unmarshal(body, &m) 2934 if err != nil { 2935 return err 2936 } 2937 for k, v := range m { 2938 switch k { 2939 case "id": 2940 if v != nil { 2941 var ID string 2942 err = json.Unmarshal(*v, &ID) 2943 if err != nil { 2944 return err 2945 } 2946 or.ID = &ID 2947 } 2948 case "name": 2949 if v != nil { 2950 var name string 2951 err = json.Unmarshal(*v, &name) 2952 if err != nil { 2953 return err 2954 } 2955 or.Name = &name 2956 } 2957 case "status": 2958 if v != nil { 2959 var status Status 2960 err = json.Unmarshal(*v, &status) 2961 if err != nil { 2962 return err 2963 } 2964 or.Status = status 2965 } 2966 case "startTime": 2967 if v != nil { 2968 var startTime date.Time 2969 err = json.Unmarshal(*v, &startTime) 2970 if err != nil { 2971 return err 2972 } 2973 or.StartTime = &startTime 2974 } 2975 case "endTime": 2976 if v != nil { 2977 var endTime date.Time 2978 err = json.Unmarshal(*v, &endTime) 2979 if err != nil { 2980 return err 2981 } 2982 or.EndTime = &endTime 2983 } 2984 case "percentComplete": 2985 if v != nil { 2986 var percentComplete float64 2987 err = json.Unmarshal(*v, &percentComplete) 2988 if err != nil { 2989 return err 2990 } 2991 or.PercentComplete = &percentComplete 2992 } 2993 case "properties": 2994 if v != nil { 2995 var operationResultProperties OperationResultProperties 2996 err = json.Unmarshal(*v, &operationResultProperties) 2997 if err != nil { 2998 return err 2999 } 3000 or.OperationResultProperties = &operationResultProperties 3001 } 3002 case "error": 3003 if v != nil { 3004 var operationResultErrorProperties OperationResultErrorProperties 3005 err = json.Unmarshal(*v, &operationResultErrorProperties) 3006 if err != nil { 3007 return err 3008 } 3009 or.OperationResultErrorProperties = &operationResultErrorProperties 3010 } 3011 } 3012 } 3013 3014 return nil 3015} 3016 3017// OperationResultErrorProperties operation result error properties 3018type OperationResultErrorProperties struct { 3019 // Code - The code of the error. 3020 Code *string `json:"code,omitempty"` 3021 // Message - The error message. 3022 Message *string `json:"message,omitempty"` 3023} 3024 3025// OperationResultProperties operation result properties 3026type OperationResultProperties struct { 3027 // OperationKind - The kind of the operation. 3028 OperationKind *string `json:"operationKind,omitempty"` 3029 // OperationState - The state of the operation. 3030 OperationState *string `json:"operationState,omitempty"` 3031} 3032 3033// OptimizedAutoscale a class that contains the optimized auto scale definition. 3034type OptimizedAutoscale struct { 3035 // Version - The version of the template defined, for instance 1. 3036 Version *int32 `json:"version,omitempty"` 3037 // IsEnabled - A boolean value that indicate if the optimized autoscale feature is enabled or not. 3038 IsEnabled *bool `json:"isEnabled,omitempty"` 3039 // Minimum - Minimum allowed instances count. 3040 Minimum *int32 `json:"minimum,omitempty"` 3041 // Maximum - Maximum allowed instances count. 3042 Maximum *int32 `json:"maximum,omitempty"` 3043} 3044 3045// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not 3046// have tags and a location 3047type ProxyResource struct { 3048 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 3049 ID *string `json:"id,omitempty"` 3050 // Name - READ-ONLY; The name of the resource 3051 Name *string `json:"name,omitempty"` 3052 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 3053 Type *string `json:"type,omitempty"` 3054} 3055 3056// MarshalJSON is the custom marshaler for ProxyResource. 3057func (pr ProxyResource) MarshalJSON() ([]byte, error) { 3058 objectMap := make(map[string]interface{}) 3059 return json.Marshal(objectMap) 3060} 3061 3062// ReadOnlyFollowingDatabase class representing a read only following database. 3063type ReadOnlyFollowingDatabase struct { 3064 // ReadOnlyFollowingDatabaseProperties - The database properties. 3065 *ReadOnlyFollowingDatabaseProperties `json:"properties,omitempty"` 3066 // Location - Resource location. 3067 Location *string `json:"location,omitempty"` 3068 // Kind - Possible values include: 'KindDatabase', 'KindReadWrite', 'KindReadOnlyFollowing' 3069 Kind Kind `json:"kind,omitempty"` 3070 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 3071 ID *string `json:"id,omitempty"` 3072 // Name - READ-ONLY; The name of the resource 3073 Name *string `json:"name,omitempty"` 3074 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 3075 Type *string `json:"type,omitempty"` 3076} 3077 3078// MarshalJSON is the custom marshaler for ReadOnlyFollowingDatabase. 3079func (rofd ReadOnlyFollowingDatabase) MarshalJSON() ([]byte, error) { 3080 rofd.Kind = KindReadOnlyFollowing 3081 objectMap := make(map[string]interface{}) 3082 if rofd.ReadOnlyFollowingDatabaseProperties != nil { 3083 objectMap["properties"] = rofd.ReadOnlyFollowingDatabaseProperties 3084 } 3085 if rofd.Location != nil { 3086 objectMap["location"] = rofd.Location 3087 } 3088 if rofd.Kind != "" { 3089 objectMap["kind"] = rofd.Kind 3090 } 3091 return json.Marshal(objectMap) 3092} 3093 3094// AsReadWriteDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase. 3095func (rofd ReadOnlyFollowingDatabase) AsReadWriteDatabase() (*ReadWriteDatabase, bool) { 3096 return nil, false 3097} 3098 3099// AsReadOnlyFollowingDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase. 3100func (rofd ReadOnlyFollowingDatabase) AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) { 3101 return &rofd, true 3102} 3103 3104// AsDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase. 3105func (rofd ReadOnlyFollowingDatabase) AsDatabase() (*Database, bool) { 3106 return nil, false 3107} 3108 3109// AsBasicDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase. 3110func (rofd ReadOnlyFollowingDatabase) AsBasicDatabase() (BasicDatabase, bool) { 3111 return &rofd, true 3112} 3113 3114// UnmarshalJSON is the custom unmarshaler for ReadOnlyFollowingDatabase struct. 3115func (rofd *ReadOnlyFollowingDatabase) UnmarshalJSON(body []byte) error { 3116 var m map[string]*json.RawMessage 3117 err := json.Unmarshal(body, &m) 3118 if err != nil { 3119 return err 3120 } 3121 for k, v := range m { 3122 switch k { 3123 case "properties": 3124 if v != nil { 3125 var readOnlyFollowingDatabaseProperties ReadOnlyFollowingDatabaseProperties 3126 err = json.Unmarshal(*v, &readOnlyFollowingDatabaseProperties) 3127 if err != nil { 3128 return err 3129 } 3130 rofd.ReadOnlyFollowingDatabaseProperties = &readOnlyFollowingDatabaseProperties 3131 } 3132 case "location": 3133 if v != nil { 3134 var location string 3135 err = json.Unmarshal(*v, &location) 3136 if err != nil { 3137 return err 3138 } 3139 rofd.Location = &location 3140 } 3141 case "kind": 3142 if v != nil { 3143 var kind Kind 3144 err = json.Unmarshal(*v, &kind) 3145 if err != nil { 3146 return err 3147 } 3148 rofd.Kind = kind 3149 } 3150 case "id": 3151 if v != nil { 3152 var ID string 3153 err = json.Unmarshal(*v, &ID) 3154 if err != nil { 3155 return err 3156 } 3157 rofd.ID = &ID 3158 } 3159 case "name": 3160 if v != nil { 3161 var name string 3162 err = json.Unmarshal(*v, &name) 3163 if err != nil { 3164 return err 3165 } 3166 rofd.Name = &name 3167 } 3168 case "type": 3169 if v != nil { 3170 var typeVar string 3171 err = json.Unmarshal(*v, &typeVar) 3172 if err != nil { 3173 return err 3174 } 3175 rofd.Type = &typeVar 3176 } 3177 } 3178 } 3179 3180 return nil 3181} 3182 3183// ReadOnlyFollowingDatabaseProperties class representing the Kusto database properties. 3184type ReadOnlyFollowingDatabaseProperties struct { 3185 // ProvisioningState - The provisioned state of the resource. Possible values include: 'ProvisioningStateRunning', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateMoving' 3186 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 3187 // SoftDeletePeriod - READ-ONLY; The time the data should be kept before it stops being accessible to queries in TimeSpan. 3188 SoftDeletePeriod *string `json:"softDeletePeriod,omitempty"` 3189 // HotCachePeriod - The time the data should be kept in cache for fast queries in TimeSpan. 3190 HotCachePeriod *string `json:"hotCachePeriod,omitempty"` 3191 // Statistics - The statistics of the database. 3192 Statistics *DatabaseStatistics `json:"statistics,omitempty"` 3193 // LeaderClusterResourceID - READ-ONLY; The name of the leader cluster 3194 LeaderClusterResourceID *string `json:"leaderClusterResourceId,omitempty"` 3195 // AttachedDatabaseConfigurationName - READ-ONLY; The name of the attached database configuration cluster 3196 AttachedDatabaseConfigurationName *string `json:"attachedDatabaseConfigurationName,omitempty"` 3197 // PrincipalsModificationKind - READ-ONLY; The principals modification kind of the database. Possible values include: 'PrincipalsModificationKindUnion', 'PrincipalsModificationKindReplace', 'PrincipalsModificationKindNone' 3198 PrincipalsModificationKind PrincipalsModificationKind `json:"principalsModificationKind,omitempty"` 3199} 3200 3201// MarshalJSON is the custom marshaler for ReadOnlyFollowingDatabaseProperties. 3202func (rofdp ReadOnlyFollowingDatabaseProperties) MarshalJSON() ([]byte, error) { 3203 objectMap := make(map[string]interface{}) 3204 if rofdp.ProvisioningState != "" { 3205 objectMap["provisioningState"] = rofdp.ProvisioningState 3206 } 3207 if rofdp.HotCachePeriod != nil { 3208 objectMap["hotCachePeriod"] = rofdp.HotCachePeriod 3209 } 3210 if rofdp.Statistics != nil { 3211 objectMap["statistics"] = rofdp.Statistics 3212 } 3213 return json.Marshal(objectMap) 3214} 3215 3216// ReadWriteDatabase class representing a read write database. 3217type ReadWriteDatabase struct { 3218 // ReadWriteDatabaseProperties - The database properties. 3219 *ReadWriteDatabaseProperties `json:"properties,omitempty"` 3220 // Location - Resource location. 3221 Location *string `json:"location,omitempty"` 3222 // Kind - Possible values include: 'KindDatabase', 'KindReadWrite', 'KindReadOnlyFollowing' 3223 Kind Kind `json:"kind,omitempty"` 3224 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 3225 ID *string `json:"id,omitempty"` 3226 // Name - READ-ONLY; The name of the resource 3227 Name *string `json:"name,omitempty"` 3228 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 3229 Type *string `json:"type,omitempty"` 3230} 3231 3232// MarshalJSON is the custom marshaler for ReadWriteDatabase. 3233func (rwd ReadWriteDatabase) MarshalJSON() ([]byte, error) { 3234 rwd.Kind = KindReadWrite 3235 objectMap := make(map[string]interface{}) 3236 if rwd.ReadWriteDatabaseProperties != nil { 3237 objectMap["properties"] = rwd.ReadWriteDatabaseProperties 3238 } 3239 if rwd.Location != nil { 3240 objectMap["location"] = rwd.Location 3241 } 3242 if rwd.Kind != "" { 3243 objectMap["kind"] = rwd.Kind 3244 } 3245 return json.Marshal(objectMap) 3246} 3247 3248// AsReadWriteDatabase is the BasicDatabase implementation for ReadWriteDatabase. 3249func (rwd ReadWriteDatabase) AsReadWriteDatabase() (*ReadWriteDatabase, bool) { 3250 return &rwd, true 3251} 3252 3253// AsReadOnlyFollowingDatabase is the BasicDatabase implementation for ReadWriteDatabase. 3254func (rwd ReadWriteDatabase) AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) { 3255 return nil, false 3256} 3257 3258// AsDatabase is the BasicDatabase implementation for ReadWriteDatabase. 3259func (rwd ReadWriteDatabase) AsDatabase() (*Database, bool) { 3260 return nil, false 3261} 3262 3263// AsBasicDatabase is the BasicDatabase implementation for ReadWriteDatabase. 3264func (rwd ReadWriteDatabase) AsBasicDatabase() (BasicDatabase, bool) { 3265 return &rwd, true 3266} 3267 3268// UnmarshalJSON is the custom unmarshaler for ReadWriteDatabase struct. 3269func (rwd *ReadWriteDatabase) UnmarshalJSON(body []byte) error { 3270 var m map[string]*json.RawMessage 3271 err := json.Unmarshal(body, &m) 3272 if err != nil { 3273 return err 3274 } 3275 for k, v := range m { 3276 switch k { 3277 case "properties": 3278 if v != nil { 3279 var readWriteDatabaseProperties ReadWriteDatabaseProperties 3280 err = json.Unmarshal(*v, &readWriteDatabaseProperties) 3281 if err != nil { 3282 return err 3283 } 3284 rwd.ReadWriteDatabaseProperties = &readWriteDatabaseProperties 3285 } 3286 case "location": 3287 if v != nil { 3288 var location string 3289 err = json.Unmarshal(*v, &location) 3290 if err != nil { 3291 return err 3292 } 3293 rwd.Location = &location 3294 } 3295 case "kind": 3296 if v != nil { 3297 var kind Kind 3298 err = json.Unmarshal(*v, &kind) 3299 if err != nil { 3300 return err 3301 } 3302 rwd.Kind = kind 3303 } 3304 case "id": 3305 if v != nil { 3306 var ID string 3307 err = json.Unmarshal(*v, &ID) 3308 if err != nil { 3309 return err 3310 } 3311 rwd.ID = &ID 3312 } 3313 case "name": 3314 if v != nil { 3315 var name string 3316 err = json.Unmarshal(*v, &name) 3317 if err != nil { 3318 return err 3319 } 3320 rwd.Name = &name 3321 } 3322 case "type": 3323 if v != nil { 3324 var typeVar string 3325 err = json.Unmarshal(*v, &typeVar) 3326 if err != nil { 3327 return err 3328 } 3329 rwd.Type = &typeVar 3330 } 3331 } 3332 } 3333 3334 return nil 3335} 3336 3337// ReadWriteDatabaseProperties class representing the Kusto database properties. 3338type ReadWriteDatabaseProperties struct { 3339 // ProvisioningState - The provisioned state of the resource. Possible values include: 'ProvisioningStateRunning', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateMoving' 3340 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 3341 // SoftDeletePeriod - The time the data should be kept before it stops being accessible to queries in TimeSpan. 3342 SoftDeletePeriod *string `json:"softDeletePeriod,omitempty"` 3343 // HotCachePeriod - The time the data should be kept in cache for fast queries in TimeSpan. 3344 HotCachePeriod *string `json:"hotCachePeriod,omitempty"` 3345 // Statistics - The statistics of the database. 3346 Statistics *DatabaseStatistics `json:"statistics,omitempty"` 3347 // IsFollowed - READ-ONLY; Indicates whether the database is followed. 3348 IsFollowed *bool `json:"isFollowed,omitempty"` 3349} 3350 3351// MarshalJSON is the custom marshaler for ReadWriteDatabaseProperties. 3352func (rwdp ReadWriteDatabaseProperties) MarshalJSON() ([]byte, error) { 3353 objectMap := make(map[string]interface{}) 3354 if rwdp.ProvisioningState != "" { 3355 objectMap["provisioningState"] = rwdp.ProvisioningState 3356 } 3357 if rwdp.SoftDeletePeriod != nil { 3358 objectMap["softDeletePeriod"] = rwdp.SoftDeletePeriod 3359 } 3360 if rwdp.HotCachePeriod != nil { 3361 objectMap["hotCachePeriod"] = rwdp.HotCachePeriod 3362 } 3363 if rwdp.Statistics != nil { 3364 objectMap["statistics"] = rwdp.Statistics 3365 } 3366 return json.Marshal(objectMap) 3367} 3368 3369// Resource common fields that are returned in the response for all Azure Resource Manager resources 3370type Resource struct { 3371 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 3372 ID *string `json:"id,omitempty"` 3373 // Name - READ-ONLY; The name of the resource 3374 Name *string `json:"name,omitempty"` 3375 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 3376 Type *string `json:"type,omitempty"` 3377} 3378 3379// MarshalJSON is the custom marshaler for Resource. 3380func (r Resource) MarshalJSON() ([]byte, error) { 3381 objectMap := make(map[string]interface{}) 3382 return json.Marshal(objectMap) 3383} 3384 3385// Script class representing a database script. 3386type Script struct { 3387 autorest.Response `json:"-"` 3388 // ScriptProperties - The database script. 3389 *ScriptProperties `json:"properties,omitempty"` 3390 // SystemData - READ-ONLY 3391 SystemData *SystemData `json:"systemData,omitempty"` 3392 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 3393 ID *string `json:"id,omitempty"` 3394 // Name - READ-ONLY; The name of the resource 3395 Name *string `json:"name,omitempty"` 3396 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 3397 Type *string `json:"type,omitempty"` 3398} 3399 3400// MarshalJSON is the custom marshaler for Script. 3401func (s Script) MarshalJSON() ([]byte, error) { 3402 objectMap := make(map[string]interface{}) 3403 if s.ScriptProperties != nil { 3404 objectMap["properties"] = s.ScriptProperties 3405 } 3406 return json.Marshal(objectMap) 3407} 3408 3409// UnmarshalJSON is the custom unmarshaler for Script struct. 3410func (s *Script) UnmarshalJSON(body []byte) error { 3411 var m map[string]*json.RawMessage 3412 err := json.Unmarshal(body, &m) 3413 if err != nil { 3414 return err 3415 } 3416 for k, v := range m { 3417 switch k { 3418 case "properties": 3419 if v != nil { 3420 var scriptProperties ScriptProperties 3421 err = json.Unmarshal(*v, &scriptProperties) 3422 if err != nil { 3423 return err 3424 } 3425 s.ScriptProperties = &scriptProperties 3426 } 3427 case "systemData": 3428 if v != nil { 3429 var systemData SystemData 3430 err = json.Unmarshal(*v, &systemData) 3431 if err != nil { 3432 return err 3433 } 3434 s.SystemData = &systemData 3435 } 3436 case "id": 3437 if v != nil { 3438 var ID string 3439 err = json.Unmarshal(*v, &ID) 3440 if err != nil { 3441 return err 3442 } 3443 s.ID = &ID 3444 } 3445 case "name": 3446 if v != nil { 3447 var name string 3448 err = json.Unmarshal(*v, &name) 3449 if err != nil { 3450 return err 3451 } 3452 s.Name = &name 3453 } 3454 case "type": 3455 if v != nil { 3456 var typeVar string 3457 err = json.Unmarshal(*v, &typeVar) 3458 if err != nil { 3459 return err 3460 } 3461 s.Type = &typeVar 3462 } 3463 } 3464 } 3465 3466 return nil 3467} 3468 3469// ScriptCheckNameRequest a script name availability request. 3470type ScriptCheckNameRequest struct { 3471 // Name - Script name. 3472 Name *string `json:"name,omitempty"` 3473 // Type - The type of resource, Microsoft.Kusto/clusters/databases/scripts. 3474 Type *string `json:"type,omitempty"` 3475} 3476 3477// ScriptListResult the list Kusto database script operation response. 3478type ScriptListResult struct { 3479 autorest.Response `json:"-"` 3480 // Value - The list of Kusto scripts. 3481 Value *[]Script `json:"value,omitempty"` 3482} 3483 3484// ScriptProperties a class representing database script property. 3485type ScriptProperties struct { 3486 // ScriptURL - The url to the KQL script blob file. 3487 ScriptURL *string `json:"scriptUrl,omitempty"` 3488 // ScriptURLSasToken - The SaS token. 3489 ScriptURLSasToken *string `json:"scriptUrlSasToken,omitempty"` 3490 // ForceUpdateTag - A unique string. If changed the script will be applied again. 3491 ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` 3492 // ContinueOnErrors - Flag that indicates whether to continue if one of the command fails. 3493 ContinueOnErrors *bool `json:"continueOnErrors,omitempty"` 3494 // ProvisioningState - The provisioned state of the resource. Possible values include: 'ProvisioningStateRunning', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateMoving' 3495 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 3496} 3497 3498// ScriptsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 3499// operation. 3500type ScriptsCreateOrUpdateFuture struct { 3501 azure.FutureAPI 3502 // Result returns the result of the asynchronous operation. 3503 // If the operation has not completed it will return an error. 3504 Result func(ScriptsClient) (Script, error) 3505} 3506 3507// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3508func (future *ScriptsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 3509 var azFuture azure.Future 3510 if err := json.Unmarshal(body, &azFuture); err != nil { 3511 return err 3512 } 3513 future.FutureAPI = &azFuture 3514 future.Result = future.result 3515 return nil 3516} 3517 3518// result is the default implementation for ScriptsCreateOrUpdateFuture.Result. 3519func (future *ScriptsCreateOrUpdateFuture) result(client ScriptsClient) (s Script, err error) { 3520 var done bool 3521 done, err = future.DoneWithContext(context.Background(), client) 3522 if err != nil { 3523 err = autorest.NewErrorWithError(err, "kusto.ScriptsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 3524 return 3525 } 3526 if !done { 3527 s.Response.Response = future.Response() 3528 err = azure.NewAsyncOpIncompleteError("kusto.ScriptsCreateOrUpdateFuture") 3529 return 3530 } 3531 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3532 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 3533 s, err = client.CreateOrUpdateResponder(s.Response.Response) 3534 if err != nil { 3535 err = autorest.NewErrorWithError(err, "kusto.ScriptsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") 3536 } 3537 } 3538 return 3539} 3540 3541// ScriptsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 3542// operation. 3543type ScriptsDeleteFuture struct { 3544 azure.FutureAPI 3545 // Result returns the result of the asynchronous operation. 3546 // If the operation has not completed it will return an error. 3547 Result func(ScriptsClient) (autorest.Response, error) 3548} 3549 3550// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3551func (future *ScriptsDeleteFuture) UnmarshalJSON(body []byte) error { 3552 var azFuture azure.Future 3553 if err := json.Unmarshal(body, &azFuture); err != nil { 3554 return err 3555 } 3556 future.FutureAPI = &azFuture 3557 future.Result = future.result 3558 return nil 3559} 3560 3561// result is the default implementation for ScriptsDeleteFuture.Result. 3562func (future *ScriptsDeleteFuture) result(client ScriptsClient) (ar autorest.Response, err error) { 3563 var done bool 3564 done, err = future.DoneWithContext(context.Background(), client) 3565 if err != nil { 3566 err = autorest.NewErrorWithError(err, "kusto.ScriptsDeleteFuture", "Result", future.Response(), "Polling failure") 3567 return 3568 } 3569 if !done { 3570 ar.Response = future.Response() 3571 err = azure.NewAsyncOpIncompleteError("kusto.ScriptsDeleteFuture") 3572 return 3573 } 3574 ar.Response = future.Response() 3575 return 3576} 3577 3578// ScriptsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 3579// operation. 3580type ScriptsUpdateFuture struct { 3581 azure.FutureAPI 3582 // Result returns the result of the asynchronous operation. 3583 // If the operation has not completed it will return an error. 3584 Result func(ScriptsClient) (Script, error) 3585} 3586 3587// UnmarshalJSON is the custom unmarshaller for CreateFuture. 3588func (future *ScriptsUpdateFuture) UnmarshalJSON(body []byte) error { 3589 var azFuture azure.Future 3590 if err := json.Unmarshal(body, &azFuture); err != nil { 3591 return err 3592 } 3593 future.FutureAPI = &azFuture 3594 future.Result = future.result 3595 return nil 3596} 3597 3598// result is the default implementation for ScriptsUpdateFuture.Result. 3599func (future *ScriptsUpdateFuture) result(client ScriptsClient) (s Script, err error) { 3600 var done bool 3601 done, err = future.DoneWithContext(context.Background(), client) 3602 if err != nil { 3603 err = autorest.NewErrorWithError(err, "kusto.ScriptsUpdateFuture", "Result", future.Response(), "Polling failure") 3604 return 3605 } 3606 if !done { 3607 s.Response.Response = future.Response() 3608 err = azure.NewAsyncOpIncompleteError("kusto.ScriptsUpdateFuture") 3609 return 3610 } 3611 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3612 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 3613 s, err = client.UpdateResponder(s.Response.Response) 3614 if err != nil { 3615 err = autorest.NewErrorWithError(err, "kusto.ScriptsUpdateFuture", "Result", s.Response.Response, "Failure responding to request") 3616 } 3617 } 3618 return 3619} 3620 3621// SkuDescription the Kusto SKU description of given resource type 3622type SkuDescription struct { 3623 // ResourceType - READ-ONLY; The resource type 3624 ResourceType *string `json:"resourceType,omitempty"` 3625 // Name - READ-ONLY; The name of the SKU 3626 Name *string `json:"name,omitempty"` 3627 // Tier - READ-ONLY; The tier of the SKU 3628 Tier *string `json:"tier,omitempty"` 3629 // Locations - READ-ONLY; The set of locations that the SKU is available 3630 Locations *[]string `json:"locations,omitempty"` 3631 // LocationInfo - READ-ONLY; Locations and zones 3632 LocationInfo *[]SkuLocationInfoItem `json:"locationInfo,omitempty"` 3633 // Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used 3634 Restrictions *[]interface{} `json:"restrictions,omitempty"` 3635} 3636 3637// MarshalJSON is the custom marshaler for SkuDescription. 3638func (sd SkuDescription) MarshalJSON() ([]byte, error) { 3639 objectMap := make(map[string]interface{}) 3640 return json.Marshal(objectMap) 3641} 3642 3643// SkuDescriptionList the list of the EngagementFabric SKU descriptions 3644type SkuDescriptionList struct { 3645 autorest.Response `json:"-"` 3646 // Value - READ-ONLY; SKU descriptions 3647 Value *[]SkuDescription `json:"value,omitempty"` 3648} 3649 3650// MarshalJSON is the custom marshaler for SkuDescriptionList. 3651func (sdl SkuDescriptionList) MarshalJSON() ([]byte, error) { 3652 objectMap := make(map[string]interface{}) 3653 return json.Marshal(objectMap) 3654} 3655 3656// SkuLocationInfoItem the locations and zones info for SKU. 3657type SkuLocationInfoItem struct { 3658 // Location - The available location of the SKU. 3659 Location *string `json:"location,omitempty"` 3660 // Zones - The available zone of the SKU. 3661 Zones *[]string `json:"zones,omitempty"` 3662} 3663 3664// SystemData metadata pertaining to creation and last modification of the resource. 3665type SystemData struct { 3666 // CreatedBy - The identity that created the resource. 3667 CreatedBy *string `json:"createdBy,omitempty"` 3668 // CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' 3669 CreatedByType CreatedByType `json:"createdByType,omitempty"` 3670 // CreatedAt - The timestamp of resource creation (UTC). 3671 CreatedAt *date.Time `json:"createdAt,omitempty"` 3672 // LastModifiedBy - The identity that last modified the resource. 3673 LastModifiedBy *string `json:"lastModifiedBy,omitempty"` 3674 // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' 3675 LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` 3676 // LastModifiedAt - The timestamp of resource last modification (UTC) 3677 LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` 3678} 3679 3680// TableLevelSharingProperties tables that will be included and excluded in the follower database 3681type TableLevelSharingProperties struct { 3682 // TablesToInclude - List of tables to include in the follower database 3683 TablesToInclude *[]string `json:"tablesToInclude,omitempty"` 3684 // TablesToExclude - List of tables to exclude from the follower database 3685 TablesToExclude *[]string `json:"tablesToExclude,omitempty"` 3686 // ExternalTablesToInclude - List of external tables to include in the follower database 3687 ExternalTablesToInclude *[]string `json:"externalTablesToInclude,omitempty"` 3688 // ExternalTablesToExclude - List of external tables exclude from the follower database 3689 ExternalTablesToExclude *[]string `json:"externalTablesToExclude,omitempty"` 3690 // MaterializedViewsToInclude - List of materialized views to include in the follower database 3691 MaterializedViewsToInclude *[]string `json:"materializedViewsToInclude,omitempty"` 3692 // MaterializedViewsToExclude - List of materialized views exclude from the follower database 3693 MaterializedViewsToExclude *[]string `json:"materializedViewsToExclude,omitempty"` 3694} 3695 3696// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource 3697// which has 'tags' and a 'location' 3698type TrackedResource struct { 3699 // Tags - Resource tags. 3700 Tags map[string]*string `json:"tags"` 3701 // Location - The geo-location where the resource lives 3702 Location *string `json:"location,omitempty"` 3703 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 3704 ID *string `json:"id,omitempty"` 3705 // Name - READ-ONLY; The name of the resource 3706 Name *string `json:"name,omitempty"` 3707 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 3708 Type *string `json:"type,omitempty"` 3709} 3710 3711// MarshalJSON is the custom marshaler for TrackedResource. 3712func (tr TrackedResource) MarshalJSON() ([]byte, error) { 3713 objectMap := make(map[string]interface{}) 3714 if tr.Tags != nil { 3715 objectMap["tags"] = tr.Tags 3716 } 3717 if tr.Location != nil { 3718 objectMap["location"] = tr.Location 3719 } 3720 return json.Marshal(objectMap) 3721} 3722 3723// TrustedExternalTenant represents a tenant ID that is trusted by the cluster. 3724type TrustedExternalTenant struct { 3725 // Value - GUID representing an external tenant. 3726 Value *string `json:"value,omitempty"` 3727} 3728 3729// VirtualNetworkConfiguration a class that contains virtual network definition. 3730type VirtualNetworkConfiguration struct { 3731 // SubnetID - The subnet resource id. 3732 SubnetID *string `json:"subnetId,omitempty"` 3733 // EnginePublicIPID - Engine service's public IP address resource id. 3734 EnginePublicIPID *string `json:"enginePublicIpId,omitempty"` 3735 // DataManagementPublicIPID - Data management's service public IP address resource id. 3736 DataManagementPublicIPID *string `json:"dataManagementPublicIpId,omitempty"` 3737} 3738