1package kusto 2 3// Copyright (c) Microsoft and contributors. All rights reserved. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Code generated by Microsoft (R) AutoRest Code Generator. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "context" 22 "encoding/json" 23 "github.com/Azure/go-autorest/autorest" 24 "github.com/Azure/go-autorest/autorest/azure" 25 "github.com/Azure/go-autorest/autorest/to" 26 "github.com/Azure/go-autorest/tracing" 27 "net/http" 28) 29 30// The package's fully qualified name. 31const fqdn = "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2020-06-14/kusto" 32 33// AttachedDatabaseConfiguration class representing an attached database configuration. 34type AttachedDatabaseConfiguration struct { 35 autorest.Response `json:"-"` 36 // Location - Resource location. 37 Location *string `json:"location,omitempty"` 38 // AttachedDatabaseConfigurationProperties - The properties of the attached database configuration. 39 *AttachedDatabaseConfigurationProperties `json:"properties,omitempty"` 40 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 41 ID *string `json:"id,omitempty"` 42 // Name - READ-ONLY; The name of the resource 43 Name *string `json:"name,omitempty"` 44 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 45 Type *string `json:"type,omitempty"` 46} 47 48// MarshalJSON is the custom marshaler for AttachedDatabaseConfiguration. 49func (adc AttachedDatabaseConfiguration) MarshalJSON() ([]byte, error) { 50 objectMap := make(map[string]interface{}) 51 if adc.Location != nil { 52 objectMap["location"] = adc.Location 53 } 54 if adc.AttachedDatabaseConfigurationProperties != nil { 55 objectMap["properties"] = adc.AttachedDatabaseConfigurationProperties 56 } 57 return json.Marshal(objectMap) 58} 59 60// UnmarshalJSON is the custom unmarshaler for AttachedDatabaseConfiguration struct. 61func (adc *AttachedDatabaseConfiguration) UnmarshalJSON(body []byte) error { 62 var m map[string]*json.RawMessage 63 err := json.Unmarshal(body, &m) 64 if err != nil { 65 return err 66 } 67 for k, v := range m { 68 switch k { 69 case "location": 70 if v != nil { 71 var location string 72 err = json.Unmarshal(*v, &location) 73 if err != nil { 74 return err 75 } 76 adc.Location = &location 77 } 78 case "properties": 79 if v != nil { 80 var attachedDatabaseConfigurationProperties AttachedDatabaseConfigurationProperties 81 err = json.Unmarshal(*v, &attachedDatabaseConfigurationProperties) 82 if err != nil { 83 return err 84 } 85 adc.AttachedDatabaseConfigurationProperties = &attachedDatabaseConfigurationProperties 86 } 87 case "id": 88 if v != nil { 89 var ID string 90 err = json.Unmarshal(*v, &ID) 91 if err != nil { 92 return err 93 } 94 adc.ID = &ID 95 } 96 case "name": 97 if v != nil { 98 var name string 99 err = json.Unmarshal(*v, &name) 100 if err != nil { 101 return err 102 } 103 adc.Name = &name 104 } 105 case "type": 106 if v != nil { 107 var typeVar string 108 err = json.Unmarshal(*v, &typeVar) 109 if err != nil { 110 return err 111 } 112 adc.Type = &typeVar 113 } 114 } 115 } 116 117 return nil 118} 119 120// AttachedDatabaseConfigurationListResult the list attached database configurations operation response. 121type AttachedDatabaseConfigurationListResult struct { 122 autorest.Response `json:"-"` 123 // Value - The list of attached database configurations. 124 Value *[]AttachedDatabaseConfiguration `json:"value,omitempty"` 125} 126 127// AttachedDatabaseConfigurationProperties class representing the an attached database configuration 128// properties of kind specific. 129type AttachedDatabaseConfigurationProperties struct { 130 // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' 131 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 132 // DatabaseName - The name of the database which you would like to attach, use * if you want to follow all current and future databases. 133 DatabaseName *string `json:"databaseName,omitempty"` 134 // ClusterResourceID - The resource id of the cluster where the databases you would like to attach reside. 135 ClusterResourceID *string `json:"clusterResourceId,omitempty"` 136 // AttachedDatabaseNames - READ-ONLY; The list of databases from the clusterResourceId which are currently attached to the cluster. 137 AttachedDatabaseNames *[]string `json:"attachedDatabaseNames,omitempty"` 138 // DefaultPrincipalsModificationKind - The default principals modification kind. Possible values include: 'DefaultPrincipalsModificationKindUnion', 'DefaultPrincipalsModificationKindReplace', 'DefaultPrincipalsModificationKindNone' 139 DefaultPrincipalsModificationKind DefaultPrincipalsModificationKind `json:"defaultPrincipalsModificationKind,omitempty"` 140} 141 142// MarshalJSON is the custom marshaler for AttachedDatabaseConfigurationProperties. 143func (adcp AttachedDatabaseConfigurationProperties) MarshalJSON() ([]byte, error) { 144 objectMap := make(map[string]interface{}) 145 if adcp.DatabaseName != nil { 146 objectMap["databaseName"] = adcp.DatabaseName 147 } 148 if adcp.ClusterResourceID != nil { 149 objectMap["clusterResourceId"] = adcp.ClusterResourceID 150 } 151 if adcp.DefaultPrincipalsModificationKind != "" { 152 objectMap["defaultPrincipalsModificationKind"] = adcp.DefaultPrincipalsModificationKind 153 } 154 return json.Marshal(objectMap) 155} 156 157// AttachedDatabaseConfigurationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 158// results of a long-running operation. 159type AttachedDatabaseConfigurationsCreateOrUpdateFuture struct { 160 azure.FutureAPI 161 // Result returns the result of the asynchronous operation. 162 // If the operation has not completed it will return an error. 163 Result func(AttachedDatabaseConfigurationsClient) (AttachedDatabaseConfiguration, error) 164} 165 166// AttachedDatabaseConfigurationsDeleteFuture an abstraction for monitoring and retrieving the results of a 167// long-running operation. 168type AttachedDatabaseConfigurationsDeleteFuture struct { 169 azure.FutureAPI 170 // Result returns the result of the asynchronous operation. 171 // If the operation has not completed it will return an error. 172 Result func(AttachedDatabaseConfigurationsClient) (autorest.Response, error) 173} 174 175// AzureCapacity azure capacity definition. 176type AzureCapacity struct { 177 // ScaleType - Scale type. Possible values include: 'Automatic', 'Manual', 'None' 178 ScaleType AzureScaleType `json:"scaleType,omitempty"` 179 // Minimum - Minimum allowed capacity. 180 Minimum *int32 `json:"minimum,omitempty"` 181 // Maximum - Maximum allowed capacity. 182 Maximum *int32 `json:"maximum,omitempty"` 183 // Default - The default capacity that would be used. 184 Default *int32 `json:"default,omitempty"` 185} 186 187// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. 188type AzureEntityResource struct { 189 // Etag - READ-ONLY; Resource Etag. 190 Etag *string `json:"etag,omitempty"` 191 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 192 ID *string `json:"id,omitempty"` 193 // Name - READ-ONLY; The name of the resource 194 Name *string `json:"name,omitempty"` 195 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 196 Type *string `json:"type,omitempty"` 197} 198 199// AzureResourceSku azure resource SKU definition. 200type AzureResourceSku struct { 201 // ResourceType - Resource Namespace and Type. 202 ResourceType *string `json:"resourceType,omitempty"` 203 // Sku - The SKU details. 204 Sku *AzureSku `json:"sku,omitempty"` 205 // Capacity - The number of instances of the cluster. 206 Capacity *AzureCapacity `json:"capacity,omitempty"` 207} 208 209// AzureSku azure SKU definition. 210type AzureSku struct { 211 // Name - SKU name. Possible values include: 'StandardDS13V21TBPS', 'StandardDS13V22TBPS', 'StandardDS14V23TBPS', 'StandardDS14V24TBPS', 'StandardD13V2', 'StandardD14V2', 'StandardL8s', 'StandardL16s', 'StandardD11V2', 'StandardD12V2', 'StandardL4s', 'DevNoSLAStandardD11V2', 'StandardE2aV4', 'StandardE4aV4', 'StandardE8aV4', 'StandardE16aV4', 'StandardE8asV41TBPS', 'StandardE8asV42TBPS', 'StandardE16asV43TBPS', 'StandardE16asV44TBPS', 'DevNoSLAStandardE2aV4' 212 Name AzureSkuName `json:"name,omitempty"` 213 // Capacity - The number of instances of the cluster. 214 Capacity *int32 `json:"capacity,omitempty"` 215 // Tier - SKU tier. Possible values include: 'Basic', 'Standard' 216 Tier AzureSkuTier `json:"tier,omitempty"` 217} 218 219// CheckNameRequest the result returned from a database check name availability request. 220type CheckNameRequest struct { 221 // Name - Resource name. 222 Name *string `json:"name,omitempty"` 223 // Type - The type of resource, for instance Microsoft.Kusto/clusters/databases. Possible values include: 'MicrosoftKustoclustersdatabases', 'MicrosoftKustoclustersattachedDatabaseConfigurations' 224 Type Type `json:"type,omitempty"` 225} 226 227// CheckNameResult the result returned from a check name availability request. 228type CheckNameResult struct { 229 autorest.Response `json:"-"` 230 // NameAvailable - Specifies a Boolean value that indicates if the name is available. 231 NameAvailable *bool `json:"nameAvailable,omitempty"` 232 // Name - The name that was checked. 233 Name *string `json:"name,omitempty"` 234 // Message - Message indicating an unavailable name due to a conflict, or a description of the naming rules that are violated. 235 Message *string `json:"message,omitempty"` 236 // Reason - Message providing the reason why the given name is invalid. Possible values include: 'Invalid', 'AlreadyExists' 237 Reason Reason `json:"reason,omitempty"` 238} 239 240// CloudError an error response from Kusto. 241type CloudError struct { 242 // Error - An error response from Kusto. 243 Error *CloudErrorBody `json:"error,omitempty"` 244} 245 246// CloudErrorBody an error response from Kusto. 247type CloudErrorBody struct { 248 // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. 249 Code *string `json:"code,omitempty"` 250 // Message - A message describing the error, intended to be suitable for displaying in a user interface. 251 Message *string `json:"message,omitempty"` 252 // Target - The target of the particular error. For example, the name of the property in error. 253 Target *string `json:"target,omitempty"` 254 // Details - A list of additional details about the error. 255 Details *[]CloudErrorBody `json:"details,omitempty"` 256} 257 258// Cluster class representing a Kusto cluster. 259type Cluster struct { 260 autorest.Response `json:"-"` 261 // Sku - The SKU of the cluster. 262 Sku *AzureSku `json:"sku,omitempty"` 263 // Zones - The availability zones of the cluster. 264 Zones *[]string `json:"zones,omitempty"` 265 // Identity - The identity of the cluster, if configured. 266 Identity *Identity `json:"identity,omitempty"` 267 // ClusterProperties - The cluster properties. 268 *ClusterProperties `json:"properties,omitempty"` 269 // Tags - Resource tags. 270 Tags map[string]*string `json:"tags"` 271 // Location - The geo-location where the resource lives 272 Location *string `json:"location,omitempty"` 273 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 274 ID *string `json:"id,omitempty"` 275 // Name - READ-ONLY; The name of the resource 276 Name *string `json:"name,omitempty"` 277 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 278 Type *string `json:"type,omitempty"` 279} 280 281// MarshalJSON is the custom marshaler for Cluster. 282func (c Cluster) MarshalJSON() ([]byte, error) { 283 objectMap := make(map[string]interface{}) 284 if c.Sku != nil { 285 objectMap["sku"] = c.Sku 286 } 287 if c.Zones != nil { 288 objectMap["zones"] = c.Zones 289 } 290 if c.Identity != nil { 291 objectMap["identity"] = c.Identity 292 } 293 if c.ClusterProperties != nil { 294 objectMap["properties"] = c.ClusterProperties 295 } 296 if c.Tags != nil { 297 objectMap["tags"] = c.Tags 298 } 299 if c.Location != nil { 300 objectMap["location"] = c.Location 301 } 302 return json.Marshal(objectMap) 303} 304 305// UnmarshalJSON is the custom unmarshaler for Cluster struct. 306func (c *Cluster) UnmarshalJSON(body []byte) error { 307 var m map[string]*json.RawMessage 308 err := json.Unmarshal(body, &m) 309 if err != nil { 310 return err 311 } 312 for k, v := range m { 313 switch k { 314 case "sku": 315 if v != nil { 316 var sku AzureSku 317 err = json.Unmarshal(*v, &sku) 318 if err != nil { 319 return err 320 } 321 c.Sku = &sku 322 } 323 case "zones": 324 if v != nil { 325 var zones []string 326 err = json.Unmarshal(*v, &zones) 327 if err != nil { 328 return err 329 } 330 c.Zones = &zones 331 } 332 case "identity": 333 if v != nil { 334 var identity Identity 335 err = json.Unmarshal(*v, &identity) 336 if err != nil { 337 return err 338 } 339 c.Identity = &identity 340 } 341 case "properties": 342 if v != nil { 343 var clusterProperties ClusterProperties 344 err = json.Unmarshal(*v, &clusterProperties) 345 if err != nil { 346 return err 347 } 348 c.ClusterProperties = &clusterProperties 349 } 350 case "tags": 351 if v != nil { 352 var tags map[string]*string 353 err = json.Unmarshal(*v, &tags) 354 if err != nil { 355 return err 356 } 357 c.Tags = tags 358 } 359 case "location": 360 if v != nil { 361 var location string 362 err = json.Unmarshal(*v, &location) 363 if err != nil { 364 return err 365 } 366 c.Location = &location 367 } 368 case "id": 369 if v != nil { 370 var ID string 371 err = json.Unmarshal(*v, &ID) 372 if err != nil { 373 return err 374 } 375 c.ID = &ID 376 } 377 case "name": 378 if v != nil { 379 var name string 380 err = json.Unmarshal(*v, &name) 381 if err != nil { 382 return err 383 } 384 c.Name = &name 385 } 386 case "type": 387 if v != nil { 388 var typeVar string 389 err = json.Unmarshal(*v, &typeVar) 390 if err != nil { 391 return err 392 } 393 c.Type = &typeVar 394 } 395 } 396 } 397 398 return nil 399} 400 401// ClusterCheckNameRequest the result returned from a cluster check name availability request. 402type ClusterCheckNameRequest struct { 403 // Name - Cluster name. 404 Name *string `json:"name,omitempty"` 405 // Type - The type of resource, Microsoft.Kusto/clusters. 406 Type *string `json:"type,omitempty"` 407} 408 409// ClusterListResult the list Kusto clusters operation response. 410type ClusterListResult struct { 411 autorest.Response `json:"-"` 412 // Value - The list of Kusto clusters. 413 Value *[]Cluster `json:"value,omitempty"` 414} 415 416// ClusterPrincipalAssignment class representing a cluster principal assignment. 417type ClusterPrincipalAssignment struct { 418 autorest.Response `json:"-"` 419 // ClusterPrincipalProperties - The cluster principal. 420 *ClusterPrincipalProperties `json:"properties,omitempty"` 421 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 422 ID *string `json:"id,omitempty"` 423 // Name - READ-ONLY; The name of the resource 424 Name *string `json:"name,omitempty"` 425 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 426 Type *string `json:"type,omitempty"` 427} 428 429// MarshalJSON is the custom marshaler for ClusterPrincipalAssignment. 430func (cpa ClusterPrincipalAssignment) MarshalJSON() ([]byte, error) { 431 objectMap := make(map[string]interface{}) 432 if cpa.ClusterPrincipalProperties != nil { 433 objectMap["properties"] = cpa.ClusterPrincipalProperties 434 } 435 return json.Marshal(objectMap) 436} 437 438// UnmarshalJSON is the custom unmarshaler for ClusterPrincipalAssignment struct. 439func (cpa *ClusterPrincipalAssignment) UnmarshalJSON(body []byte) error { 440 var m map[string]*json.RawMessage 441 err := json.Unmarshal(body, &m) 442 if err != nil { 443 return err 444 } 445 for k, v := range m { 446 switch k { 447 case "properties": 448 if v != nil { 449 var clusterPrincipalProperties ClusterPrincipalProperties 450 err = json.Unmarshal(*v, &clusterPrincipalProperties) 451 if err != nil { 452 return err 453 } 454 cpa.ClusterPrincipalProperties = &clusterPrincipalProperties 455 } 456 case "id": 457 if v != nil { 458 var ID string 459 err = json.Unmarshal(*v, &ID) 460 if err != nil { 461 return err 462 } 463 cpa.ID = &ID 464 } 465 case "name": 466 if v != nil { 467 var name string 468 err = json.Unmarshal(*v, &name) 469 if err != nil { 470 return err 471 } 472 cpa.Name = &name 473 } 474 case "type": 475 if v != nil { 476 var typeVar string 477 err = json.Unmarshal(*v, &typeVar) 478 if err != nil { 479 return err 480 } 481 cpa.Type = &typeVar 482 } 483 } 484 } 485 486 return nil 487} 488 489// ClusterPrincipalAssignmentCheckNameRequest a principal assignment check name availability request. 490type ClusterPrincipalAssignmentCheckNameRequest struct { 491 // Name - Principal Assignment resource name. 492 Name *string `json:"name,omitempty"` 493 // Type - The type of resource, Microsoft.Kusto/clusters/principalAssignments. 494 Type *string `json:"type,omitempty"` 495} 496 497// ClusterPrincipalAssignmentListResult the list Kusto cluster principal assignments operation response. 498type ClusterPrincipalAssignmentListResult struct { 499 autorest.Response `json:"-"` 500 // Value - The list of Kusto cluster principal assignments. 501 Value *[]ClusterPrincipalAssignment `json:"value,omitempty"` 502} 503 504// ClusterPrincipalAssignmentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 505// of a long-running operation. 506type ClusterPrincipalAssignmentsCreateOrUpdateFuture struct { 507 azure.FutureAPI 508 // Result returns the result of the asynchronous operation. 509 // If the operation has not completed it will return an error. 510 Result func(ClusterPrincipalAssignmentsClient) (ClusterPrincipalAssignment, error) 511} 512 513// ClusterPrincipalAssignmentsDeleteFuture an abstraction for monitoring and retrieving the results of a 514// long-running operation. 515type ClusterPrincipalAssignmentsDeleteFuture struct { 516 azure.FutureAPI 517 // Result returns the result of the asynchronous operation. 518 // If the operation has not completed it will return an error. 519 Result func(ClusterPrincipalAssignmentsClient) (autorest.Response, error) 520} 521 522// ClusterPrincipalProperties a class representing cluster principal property. 523type ClusterPrincipalProperties struct { 524 // PrincipalID - The principal ID assigned to the cluster principal. It can be a user email, application ID, or security group name. 525 PrincipalID *string `json:"principalId,omitempty"` 526 // Role - Cluster principal role. Possible values include: 'AllDatabasesAdmin', 'AllDatabasesViewer' 527 Role ClusterPrincipalRole `json:"role,omitempty"` 528 // TenantID - The tenant id of the principal 529 TenantID *string `json:"tenantId,omitempty"` 530 // PrincipalType - Principal type. Possible values include: 'PrincipalTypeApp', 'PrincipalTypeGroup', 'PrincipalTypeUser' 531 PrincipalType PrincipalType `json:"principalType,omitempty"` 532 // TenantName - READ-ONLY; The tenant name of the principal 533 TenantName *string `json:"tenantName,omitempty"` 534 // PrincipalName - READ-ONLY; The principal name 535 PrincipalName *string `json:"principalName,omitempty"` 536 // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' 537 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 538} 539 540// MarshalJSON is the custom marshaler for ClusterPrincipalProperties. 541func (cpp ClusterPrincipalProperties) MarshalJSON() ([]byte, error) { 542 objectMap := make(map[string]interface{}) 543 if cpp.PrincipalID != nil { 544 objectMap["principalId"] = cpp.PrincipalID 545 } 546 if cpp.Role != "" { 547 objectMap["role"] = cpp.Role 548 } 549 if cpp.TenantID != nil { 550 objectMap["tenantId"] = cpp.TenantID 551 } 552 if cpp.PrincipalType != "" { 553 objectMap["principalType"] = cpp.PrincipalType 554 } 555 return json.Marshal(objectMap) 556} 557 558// ClusterProperties class representing the Kusto cluster properties. 559type ClusterProperties struct { 560 // State - READ-ONLY; The state of the resource. Possible values include: 'StateCreating', 'StateUnavailable', 'StateRunning', 'StateDeleting', 'StateDeleted', 'StateStopping', 'StateStopped', 'StateStarting', 'StateUpdating' 561 State State `json:"state,omitempty"` 562 // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' 563 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 564 // URI - READ-ONLY; The cluster URI. 565 URI *string `json:"uri,omitempty"` 566 // DataIngestionURI - READ-ONLY; The cluster data ingestion URI. 567 DataIngestionURI *string `json:"dataIngestionUri,omitempty"` 568 // StateReason - READ-ONLY; The reason for the cluster's current state. 569 StateReason *string `json:"stateReason,omitempty"` 570 // TrustedExternalTenants - The cluster's external tenants. 571 TrustedExternalTenants *[]TrustedExternalTenant `json:"trustedExternalTenants,omitempty"` 572 // OptimizedAutoscale - Optimized auto scale definition. 573 OptimizedAutoscale *OptimizedAutoscale `json:"optimizedAutoscale,omitempty"` 574 // EnableDiskEncryption - A boolean value that indicates if the cluster's disks are encrypted. 575 EnableDiskEncryption *bool `json:"enableDiskEncryption,omitempty"` 576 // EnableStreamingIngest - A boolean value that indicates if the streaming ingest is enabled. 577 EnableStreamingIngest *bool `json:"enableStreamingIngest,omitempty"` 578 // VirtualNetworkConfiguration - Virtual network definition. 579 VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` 580 // KeyVaultProperties - KeyVault properties for the cluster encryption. 581 KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"` 582 // EnablePurge - A boolean value that indicates if the purge operations are enabled. 583 EnablePurge *bool `json:"enablePurge,omitempty"` 584 // LanguageExtensions - READ-ONLY; List of the cluster's language extensions. 585 LanguageExtensions *LanguageExtensionsList `json:"languageExtensions,omitempty"` 586 // EnableDoubleEncryption - A boolean value that indicates if double encryption is enabled. 587 EnableDoubleEncryption *bool `json:"enableDoubleEncryption,omitempty"` 588} 589 590// MarshalJSON is the custom marshaler for ClusterProperties. 591func (cp ClusterProperties) MarshalJSON() ([]byte, error) { 592 objectMap := make(map[string]interface{}) 593 if cp.TrustedExternalTenants != nil { 594 objectMap["trustedExternalTenants"] = cp.TrustedExternalTenants 595 } 596 if cp.OptimizedAutoscale != nil { 597 objectMap["optimizedAutoscale"] = cp.OptimizedAutoscale 598 } 599 if cp.EnableDiskEncryption != nil { 600 objectMap["enableDiskEncryption"] = cp.EnableDiskEncryption 601 } 602 if cp.EnableStreamingIngest != nil { 603 objectMap["enableStreamingIngest"] = cp.EnableStreamingIngest 604 } 605 if cp.VirtualNetworkConfiguration != nil { 606 objectMap["virtualNetworkConfiguration"] = cp.VirtualNetworkConfiguration 607 } 608 if cp.KeyVaultProperties != nil { 609 objectMap["keyVaultProperties"] = cp.KeyVaultProperties 610 } 611 if cp.EnablePurge != nil { 612 objectMap["enablePurge"] = cp.EnablePurge 613 } 614 if cp.EnableDoubleEncryption != nil { 615 objectMap["enableDoubleEncryption"] = cp.EnableDoubleEncryption 616 } 617 return json.Marshal(objectMap) 618} 619 620// ClustersAddLanguageExtensionsFuture an abstraction for monitoring and retrieving the results of a 621// long-running operation. 622type ClustersAddLanguageExtensionsFuture struct { 623 azure.FutureAPI 624 // Result returns the result of the asynchronous operation. 625 // If the operation has not completed it will return an error. 626 Result func(ClustersClient) (autorest.Response, error) 627} 628 629// ClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 630// operation. 631type ClustersCreateOrUpdateFuture struct { 632 azure.FutureAPI 633 // Result returns the result of the asynchronous operation. 634 // If the operation has not completed it will return an error. 635 Result func(ClustersClient) (Cluster, error) 636} 637 638// ClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 639// operation. 640type ClustersDeleteFuture struct { 641 azure.FutureAPI 642 // Result returns the result of the asynchronous operation. 643 // If the operation has not completed it will return an error. 644 Result func(ClustersClient) (autorest.Response, error) 645} 646 647// ClustersDetachFollowerDatabasesFuture an abstraction for monitoring and retrieving the results of a 648// long-running operation. 649type ClustersDetachFollowerDatabasesFuture struct { 650 azure.FutureAPI 651 // Result returns the result of the asynchronous operation. 652 // If the operation has not completed it will return an error. 653 Result func(ClustersClient) (autorest.Response, error) 654} 655 656// ClustersDiagnoseVirtualNetworkFuture an abstraction for monitoring and retrieving the results of a 657// long-running operation. 658type ClustersDiagnoseVirtualNetworkFuture struct { 659 azure.FutureAPI 660 // Result returns the result of the asynchronous operation. 661 // If the operation has not completed it will return an error. 662 Result func(ClustersClient) (DiagnoseVirtualNetworkResult, error) 663} 664 665// ClustersRemoveLanguageExtensionsFuture an abstraction for monitoring and retrieving the results of a 666// long-running operation. 667type ClustersRemoveLanguageExtensionsFuture struct { 668 azure.FutureAPI 669 // Result returns the result of the asynchronous operation. 670 // If the operation has not completed it will return an error. 671 Result func(ClustersClient) (autorest.Response, error) 672} 673 674// ClustersStartFuture an abstraction for monitoring and retrieving the results of a long-running 675// operation. 676type ClustersStartFuture struct { 677 azure.FutureAPI 678 // Result returns the result of the asynchronous operation. 679 // If the operation has not completed it will return an error. 680 Result func(ClustersClient) (autorest.Response, error) 681} 682 683// ClustersStopFuture an abstraction for monitoring and retrieving the results of a long-running operation. 684type ClustersStopFuture struct { 685 azure.FutureAPI 686 // Result returns the result of the asynchronous operation. 687 // If the operation has not completed it will return an error. 688 Result func(ClustersClient) (autorest.Response, error) 689} 690 691// ClustersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 692// operation. 693type ClustersUpdateFuture struct { 694 azure.FutureAPI 695 // Result returns the result of the asynchronous operation. 696 // If the operation has not completed it will return an error. 697 Result func(ClustersClient) (Cluster, error) 698} 699 700// ClusterUpdate class representing an update to a Kusto cluster. 701type ClusterUpdate struct { 702 // Tags - Resource tags. 703 Tags map[string]*string `json:"tags"` 704 // Location - Resource location. 705 Location *string `json:"location,omitempty"` 706 // Sku - The SKU of the cluster. 707 Sku *AzureSku `json:"sku,omitempty"` 708 // Identity - The identity of the cluster, if configured. 709 Identity *Identity `json:"identity,omitempty"` 710 // ClusterProperties - The cluster properties. 711 *ClusterProperties `json:"properties,omitempty"` 712 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 713 ID *string `json:"id,omitempty"` 714 // Name - READ-ONLY; The name of the resource 715 Name *string `json:"name,omitempty"` 716 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 717 Type *string `json:"type,omitempty"` 718} 719 720// MarshalJSON is the custom marshaler for ClusterUpdate. 721func (cu ClusterUpdate) MarshalJSON() ([]byte, error) { 722 objectMap := make(map[string]interface{}) 723 if cu.Tags != nil { 724 objectMap["tags"] = cu.Tags 725 } 726 if cu.Location != nil { 727 objectMap["location"] = cu.Location 728 } 729 if cu.Sku != nil { 730 objectMap["sku"] = cu.Sku 731 } 732 if cu.Identity != nil { 733 objectMap["identity"] = cu.Identity 734 } 735 if cu.ClusterProperties != nil { 736 objectMap["properties"] = cu.ClusterProperties 737 } 738 return json.Marshal(objectMap) 739} 740 741// UnmarshalJSON is the custom unmarshaler for ClusterUpdate struct. 742func (cu *ClusterUpdate) UnmarshalJSON(body []byte) error { 743 var m map[string]*json.RawMessage 744 err := json.Unmarshal(body, &m) 745 if err != nil { 746 return err 747 } 748 for k, v := range m { 749 switch k { 750 case "tags": 751 if v != nil { 752 var tags map[string]*string 753 err = json.Unmarshal(*v, &tags) 754 if err != nil { 755 return err 756 } 757 cu.Tags = tags 758 } 759 case "location": 760 if v != nil { 761 var location string 762 err = json.Unmarshal(*v, &location) 763 if err != nil { 764 return err 765 } 766 cu.Location = &location 767 } 768 case "sku": 769 if v != nil { 770 var sku AzureSku 771 err = json.Unmarshal(*v, &sku) 772 if err != nil { 773 return err 774 } 775 cu.Sku = &sku 776 } 777 case "identity": 778 if v != nil { 779 var identity Identity 780 err = json.Unmarshal(*v, &identity) 781 if err != nil { 782 return err 783 } 784 cu.Identity = &identity 785 } 786 case "properties": 787 if v != nil { 788 var clusterProperties ClusterProperties 789 err = json.Unmarshal(*v, &clusterProperties) 790 if err != nil { 791 return err 792 } 793 cu.ClusterProperties = &clusterProperties 794 } 795 case "id": 796 if v != nil { 797 var ID string 798 err = json.Unmarshal(*v, &ID) 799 if err != nil { 800 return err 801 } 802 cu.ID = &ID 803 } 804 case "name": 805 if v != nil { 806 var name string 807 err = json.Unmarshal(*v, &name) 808 if err != nil { 809 return err 810 } 811 cu.Name = &name 812 } 813 case "type": 814 if v != nil { 815 var typeVar string 816 err = json.Unmarshal(*v, &typeVar) 817 if err != nil { 818 return err 819 } 820 cu.Type = &typeVar 821 } 822 } 823 } 824 825 return nil 826} 827 828// BasicDatabase class representing a Kusto database. 829type BasicDatabase interface { 830 AsReadWriteDatabase() (*ReadWriteDatabase, bool) 831 AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) 832 AsDatabase() (*Database, bool) 833} 834 835// Database class representing a Kusto database. 836type Database struct { 837 autorest.Response `json:"-"` 838 // Location - Resource location. 839 Location *string `json:"location,omitempty"` 840 // Kind - Possible values include: 'KindDatabase', 'KindReadWrite', 'KindReadOnlyFollowing' 841 Kind Kind `json:"kind,omitempty"` 842 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 843 ID *string `json:"id,omitempty"` 844 // Name - READ-ONLY; The name of the resource 845 Name *string `json:"name,omitempty"` 846 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 847 Type *string `json:"type,omitempty"` 848} 849 850func unmarshalBasicDatabase(body []byte) (BasicDatabase, error) { 851 var m map[string]interface{} 852 err := json.Unmarshal(body, &m) 853 if err != nil { 854 return nil, err 855 } 856 857 switch m["kind"] { 858 case string(KindReadWrite): 859 var rwd ReadWriteDatabase 860 err := json.Unmarshal(body, &rwd) 861 return rwd, err 862 case string(KindReadOnlyFollowing): 863 var rofd ReadOnlyFollowingDatabase 864 err := json.Unmarshal(body, &rofd) 865 return rofd, err 866 default: 867 var d Database 868 err := json.Unmarshal(body, &d) 869 return d, err 870 } 871} 872func unmarshalBasicDatabaseArray(body []byte) ([]BasicDatabase, error) { 873 var rawMessages []*json.RawMessage 874 err := json.Unmarshal(body, &rawMessages) 875 if err != nil { 876 return nil, err 877 } 878 879 dArray := make([]BasicDatabase, len(rawMessages)) 880 881 for index, rawMessage := range rawMessages { 882 d, err := unmarshalBasicDatabase(*rawMessage) 883 if err != nil { 884 return nil, err 885 } 886 dArray[index] = d 887 } 888 return dArray, nil 889} 890 891// MarshalJSON is the custom marshaler for Database. 892func (d Database) MarshalJSON() ([]byte, error) { 893 d.Kind = KindDatabase 894 objectMap := make(map[string]interface{}) 895 if d.Location != nil { 896 objectMap["location"] = d.Location 897 } 898 if d.Kind != "" { 899 objectMap["kind"] = d.Kind 900 } 901 return json.Marshal(objectMap) 902} 903 904// AsReadWriteDatabase is the BasicDatabase implementation for Database. 905func (d Database) AsReadWriteDatabase() (*ReadWriteDatabase, bool) { 906 return nil, false 907} 908 909// AsReadOnlyFollowingDatabase is the BasicDatabase implementation for Database. 910func (d Database) AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) { 911 return nil, false 912} 913 914// AsDatabase is the BasicDatabase implementation for Database. 915func (d Database) AsDatabase() (*Database, bool) { 916 return &d, true 917} 918 919// AsBasicDatabase is the BasicDatabase implementation for Database. 920func (d Database) AsBasicDatabase() (BasicDatabase, bool) { 921 return &d, true 922} 923 924// DatabaseListResult the list Kusto databases operation response. 925type DatabaseListResult struct { 926 autorest.Response `json:"-"` 927 // Value - The list of Kusto databases. 928 Value *[]BasicDatabase `json:"value,omitempty"` 929} 930 931// UnmarshalJSON is the custom unmarshaler for DatabaseListResult struct. 932func (dlr *DatabaseListResult) UnmarshalJSON(body []byte) error { 933 var m map[string]*json.RawMessage 934 err := json.Unmarshal(body, &m) 935 if err != nil { 936 return err 937 } 938 for k, v := range m { 939 switch k { 940 case "value": 941 if v != nil { 942 value, err := unmarshalBasicDatabaseArray(*v) 943 if err != nil { 944 return err 945 } 946 dlr.Value = &value 947 } 948 } 949 } 950 951 return nil 952} 953 954// DatabaseModel ... 955type DatabaseModel struct { 956 autorest.Response `json:"-"` 957 Value BasicDatabase `json:"value,omitempty"` 958} 959 960// UnmarshalJSON is the custom unmarshaler for DatabaseModel struct. 961func (dm *DatabaseModel) UnmarshalJSON(body []byte) error { 962 d, err := unmarshalBasicDatabase(body) 963 if err != nil { 964 return err 965 } 966 dm.Value = d 967 968 return nil 969} 970 971// DatabasePrincipal a class representing database principal entity. 972type DatabasePrincipal struct { 973 // Role - Database principal role. Possible values include: 'Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer' 974 Role DatabasePrincipalRole `json:"role,omitempty"` 975 // Name - Database principal name. 976 Name *string `json:"name,omitempty"` 977 // Type - Database principal type. Possible values include: 'DatabasePrincipalTypeApp', 'DatabasePrincipalTypeGroup', 'DatabasePrincipalTypeUser' 978 Type DatabasePrincipalType `json:"type,omitempty"` 979 // Fqn - Database principal fully qualified name. 980 Fqn *string `json:"fqn,omitempty"` 981 // Email - Database principal email if exists. 982 Email *string `json:"email,omitempty"` 983 // AppID - Application id - relevant only for application principal type. 984 AppID *string `json:"appId,omitempty"` 985 // TenantName - READ-ONLY; The tenant name of the principal 986 TenantName *string `json:"tenantName,omitempty"` 987} 988 989// MarshalJSON is the custom marshaler for DatabasePrincipal. 990func (dp DatabasePrincipal) MarshalJSON() ([]byte, error) { 991 objectMap := make(map[string]interface{}) 992 if dp.Role != "" { 993 objectMap["role"] = dp.Role 994 } 995 if dp.Name != nil { 996 objectMap["name"] = dp.Name 997 } 998 if dp.Type != "" { 999 objectMap["type"] = dp.Type 1000 } 1001 if dp.Fqn != nil { 1002 objectMap["fqn"] = dp.Fqn 1003 } 1004 if dp.Email != nil { 1005 objectMap["email"] = dp.Email 1006 } 1007 if dp.AppID != nil { 1008 objectMap["appId"] = dp.AppID 1009 } 1010 return json.Marshal(objectMap) 1011} 1012 1013// DatabasePrincipalAssignment class representing a database principal assignment. 1014type DatabasePrincipalAssignment struct { 1015 autorest.Response `json:"-"` 1016 // DatabasePrincipalProperties - The database principal. 1017 *DatabasePrincipalProperties `json:"properties,omitempty"` 1018 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1019 ID *string `json:"id,omitempty"` 1020 // Name - READ-ONLY; The name of the resource 1021 Name *string `json:"name,omitempty"` 1022 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 1023 Type *string `json:"type,omitempty"` 1024} 1025 1026// MarshalJSON is the custom marshaler for DatabasePrincipalAssignment. 1027func (dpa DatabasePrincipalAssignment) MarshalJSON() ([]byte, error) { 1028 objectMap := make(map[string]interface{}) 1029 if dpa.DatabasePrincipalProperties != nil { 1030 objectMap["properties"] = dpa.DatabasePrincipalProperties 1031 } 1032 return json.Marshal(objectMap) 1033} 1034 1035// UnmarshalJSON is the custom unmarshaler for DatabasePrincipalAssignment struct. 1036func (dpa *DatabasePrincipalAssignment) UnmarshalJSON(body []byte) error { 1037 var m map[string]*json.RawMessage 1038 err := json.Unmarshal(body, &m) 1039 if err != nil { 1040 return err 1041 } 1042 for k, v := range m { 1043 switch k { 1044 case "properties": 1045 if v != nil { 1046 var databasePrincipalProperties DatabasePrincipalProperties 1047 err = json.Unmarshal(*v, &databasePrincipalProperties) 1048 if err != nil { 1049 return err 1050 } 1051 dpa.DatabasePrincipalProperties = &databasePrincipalProperties 1052 } 1053 case "id": 1054 if v != nil { 1055 var ID string 1056 err = json.Unmarshal(*v, &ID) 1057 if err != nil { 1058 return err 1059 } 1060 dpa.ID = &ID 1061 } 1062 case "name": 1063 if v != nil { 1064 var name string 1065 err = json.Unmarshal(*v, &name) 1066 if err != nil { 1067 return err 1068 } 1069 dpa.Name = &name 1070 } 1071 case "type": 1072 if v != nil { 1073 var typeVar string 1074 err = json.Unmarshal(*v, &typeVar) 1075 if err != nil { 1076 return err 1077 } 1078 dpa.Type = &typeVar 1079 } 1080 } 1081 } 1082 1083 return nil 1084} 1085 1086// DatabasePrincipalAssignmentCheckNameRequest a principal assignment check name availability request. 1087type DatabasePrincipalAssignmentCheckNameRequest struct { 1088 // Name - Principal Assignment resource name. 1089 Name *string `json:"name,omitempty"` 1090 // Type - The type of resource, Microsoft.Kusto/clusters/databases/principalAssignments. 1091 Type *string `json:"type,omitempty"` 1092} 1093 1094// DatabasePrincipalAssignmentListResult the list Kusto database principal assignments operation response. 1095type DatabasePrincipalAssignmentListResult struct { 1096 autorest.Response `json:"-"` 1097 // Value - The list of Kusto database principal assignments. 1098 Value *[]DatabasePrincipalAssignment `json:"value,omitempty"` 1099} 1100 1101// DatabasePrincipalAssignmentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 1102// results of a long-running operation. 1103type DatabasePrincipalAssignmentsCreateOrUpdateFuture struct { 1104 azure.FutureAPI 1105 // Result returns the result of the asynchronous operation. 1106 // If the operation has not completed it will return an error. 1107 Result func(DatabasePrincipalAssignmentsClient) (DatabasePrincipalAssignment, error) 1108} 1109 1110// DatabasePrincipalAssignmentsDeleteFuture an abstraction for monitoring and retrieving the results of a 1111// long-running operation. 1112type DatabasePrincipalAssignmentsDeleteFuture struct { 1113 azure.FutureAPI 1114 // Result returns the result of the asynchronous operation. 1115 // If the operation has not completed it will return an error. 1116 Result func(DatabasePrincipalAssignmentsClient) (autorest.Response, error) 1117} 1118 1119// DatabasePrincipalListRequest the list Kusto database principals operation request. 1120type DatabasePrincipalListRequest struct { 1121 // Value - The list of Kusto database principals. 1122 Value *[]DatabasePrincipal `json:"value,omitempty"` 1123} 1124 1125// DatabasePrincipalListResult the list Kusto database principals operation response. 1126type DatabasePrincipalListResult struct { 1127 autorest.Response `json:"-"` 1128 // Value - The list of Kusto database principals. 1129 Value *[]DatabasePrincipal `json:"value,omitempty"` 1130} 1131 1132// DatabasePrincipalProperties a class representing database principal property. 1133type DatabasePrincipalProperties struct { 1134 // PrincipalID - The principal ID assigned to the database principal. It can be a user email, application ID, or security group name. 1135 PrincipalID *string `json:"principalId,omitempty"` 1136 // Role - Database principal role. Possible values include: 'Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer' 1137 Role DatabasePrincipalRole `json:"role,omitempty"` 1138 // TenantID - The tenant id of the principal 1139 TenantID *string `json:"tenantId,omitempty"` 1140 // PrincipalType - Principal type. Possible values include: 'PrincipalTypeApp', 'PrincipalTypeGroup', 'PrincipalTypeUser' 1141 PrincipalType PrincipalType `json:"principalType,omitempty"` 1142 // TenantName - READ-ONLY; The tenant name of the principal 1143 TenantName *string `json:"tenantName,omitempty"` 1144 // PrincipalName - READ-ONLY; The principal name 1145 PrincipalName *string `json:"principalName,omitempty"` 1146 // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' 1147 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 1148} 1149 1150// MarshalJSON is the custom marshaler for DatabasePrincipalProperties. 1151func (dpp DatabasePrincipalProperties) MarshalJSON() ([]byte, error) { 1152 objectMap := make(map[string]interface{}) 1153 if dpp.PrincipalID != nil { 1154 objectMap["principalId"] = dpp.PrincipalID 1155 } 1156 if dpp.Role != "" { 1157 objectMap["role"] = dpp.Role 1158 } 1159 if dpp.TenantID != nil { 1160 objectMap["tenantId"] = dpp.TenantID 1161 } 1162 if dpp.PrincipalType != "" { 1163 objectMap["principalType"] = dpp.PrincipalType 1164 } 1165 return json.Marshal(objectMap) 1166} 1167 1168// DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1169// operation. 1170type DatabasesCreateOrUpdateFuture struct { 1171 azure.FutureAPI 1172 // Result returns the result of the asynchronous operation. 1173 // If the operation has not completed it will return an error. 1174 Result func(DatabasesClient) (DatabaseModel, error) 1175} 1176 1177// DatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1178// operation. 1179type DatabasesDeleteFuture struct { 1180 azure.FutureAPI 1181 // Result returns the result of the asynchronous operation. 1182 // If the operation has not completed it will return an error. 1183 Result func(DatabasesClient) (autorest.Response, error) 1184} 1185 1186// DatabaseStatistics a class that contains database statistics information. 1187type DatabaseStatistics struct { 1188 // Size - The database size - the total size of compressed data and index in bytes. 1189 Size *float64 `json:"size,omitempty"` 1190} 1191 1192// DatabasesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1193// operation. 1194type DatabasesUpdateFuture struct { 1195 azure.FutureAPI 1196 // Result returns the result of the asynchronous operation. 1197 // If the operation has not completed it will return an error. 1198 Result func(DatabasesClient) (DatabaseModel, error) 1199} 1200 1201// BasicDataConnection class representing an data connection. 1202type BasicDataConnection interface { 1203 AsEventHubDataConnection() (*EventHubDataConnection, bool) 1204 AsIotHubDataConnection() (*IotHubDataConnection, bool) 1205 AsEventGridDataConnection() (*EventGridDataConnection, bool) 1206 AsDataConnection() (*DataConnection, bool) 1207} 1208 1209// DataConnection class representing an data connection. 1210type DataConnection struct { 1211 autorest.Response `json:"-"` 1212 // Location - Resource location. 1213 Location *string `json:"location,omitempty"` 1214 // Kind - Possible values include: 'KindDataConnection', 'KindEventHub', 'KindIotHub', 'KindEventGrid' 1215 Kind KindBasicDataConnection `json:"kind,omitempty"` 1216 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1217 ID *string `json:"id,omitempty"` 1218 // Name - READ-ONLY; The name of the resource 1219 Name *string `json:"name,omitempty"` 1220 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 1221 Type *string `json:"type,omitempty"` 1222} 1223 1224func unmarshalBasicDataConnection(body []byte) (BasicDataConnection, error) { 1225 var m map[string]interface{} 1226 err := json.Unmarshal(body, &m) 1227 if err != nil { 1228 return nil, err 1229 } 1230 1231 switch m["kind"] { 1232 case string(KindEventHub): 1233 var ehdc EventHubDataConnection 1234 err := json.Unmarshal(body, &ehdc) 1235 return ehdc, err 1236 case string(KindIotHub): 1237 var ihdc IotHubDataConnection 1238 err := json.Unmarshal(body, &ihdc) 1239 return ihdc, err 1240 case string(KindEventGrid): 1241 var egdc EventGridDataConnection 1242 err := json.Unmarshal(body, &egdc) 1243 return egdc, err 1244 default: 1245 var dc DataConnection 1246 err := json.Unmarshal(body, &dc) 1247 return dc, err 1248 } 1249} 1250func unmarshalBasicDataConnectionArray(body []byte) ([]BasicDataConnection, error) { 1251 var rawMessages []*json.RawMessage 1252 err := json.Unmarshal(body, &rawMessages) 1253 if err != nil { 1254 return nil, err 1255 } 1256 1257 dcArray := make([]BasicDataConnection, len(rawMessages)) 1258 1259 for index, rawMessage := range rawMessages { 1260 dc, err := unmarshalBasicDataConnection(*rawMessage) 1261 if err != nil { 1262 return nil, err 1263 } 1264 dcArray[index] = dc 1265 } 1266 return dcArray, nil 1267} 1268 1269// MarshalJSON is the custom marshaler for DataConnection. 1270func (dc DataConnection) MarshalJSON() ([]byte, error) { 1271 dc.Kind = KindDataConnection 1272 objectMap := make(map[string]interface{}) 1273 if dc.Location != nil { 1274 objectMap["location"] = dc.Location 1275 } 1276 if dc.Kind != "" { 1277 objectMap["kind"] = dc.Kind 1278 } 1279 return json.Marshal(objectMap) 1280} 1281 1282// AsEventHubDataConnection is the BasicDataConnection implementation for DataConnection. 1283func (dc DataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) { 1284 return nil, false 1285} 1286 1287// AsIotHubDataConnection is the BasicDataConnection implementation for DataConnection. 1288func (dc DataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) { 1289 return nil, false 1290} 1291 1292// AsEventGridDataConnection is the BasicDataConnection implementation for DataConnection. 1293func (dc DataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) { 1294 return nil, false 1295} 1296 1297// AsDataConnection is the BasicDataConnection implementation for DataConnection. 1298func (dc DataConnection) AsDataConnection() (*DataConnection, bool) { 1299 return &dc, true 1300} 1301 1302// AsBasicDataConnection is the BasicDataConnection implementation for DataConnection. 1303func (dc DataConnection) AsBasicDataConnection() (BasicDataConnection, bool) { 1304 return &dc, true 1305} 1306 1307// DataConnectionCheckNameRequest a data connection check name availability request. 1308type DataConnectionCheckNameRequest struct { 1309 // Name - Data Connection name. 1310 Name *string `json:"name,omitempty"` 1311 // Type - The type of resource, Microsoft.Kusto/clusters/databases/dataConnections. 1312 Type *string `json:"type,omitempty"` 1313} 1314 1315// DataConnectionListResult the list Kusto data connections operation response. 1316type DataConnectionListResult struct { 1317 autorest.Response `json:"-"` 1318 // Value - The list of Kusto data connections. 1319 Value *[]BasicDataConnection `json:"value,omitempty"` 1320} 1321 1322// UnmarshalJSON is the custom unmarshaler for DataConnectionListResult struct. 1323func (dclr *DataConnectionListResult) UnmarshalJSON(body []byte) error { 1324 var m map[string]*json.RawMessage 1325 err := json.Unmarshal(body, &m) 1326 if err != nil { 1327 return err 1328 } 1329 for k, v := range m { 1330 switch k { 1331 case "value": 1332 if v != nil { 1333 value, err := unmarshalBasicDataConnectionArray(*v) 1334 if err != nil { 1335 return err 1336 } 1337 dclr.Value = &value 1338 } 1339 } 1340 } 1341 1342 return nil 1343} 1344 1345// DataConnectionModel ... 1346type DataConnectionModel struct { 1347 autorest.Response `json:"-"` 1348 Value BasicDataConnection `json:"value,omitempty"` 1349} 1350 1351// UnmarshalJSON is the custom unmarshaler for DataConnectionModel struct. 1352func (dcm *DataConnectionModel) UnmarshalJSON(body []byte) error { 1353 dc, err := unmarshalBasicDataConnection(body) 1354 if err != nil { 1355 return err 1356 } 1357 dcm.Value = dc 1358 1359 return nil 1360} 1361 1362// DataConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 1363// long-running operation. 1364type DataConnectionsCreateOrUpdateFuture struct { 1365 azure.FutureAPI 1366 // Result returns the result of the asynchronous operation. 1367 // If the operation has not completed it will return an error. 1368 Result func(DataConnectionsClient) (DataConnectionModel, error) 1369} 1370 1371// DataConnectionsDataConnectionValidationMethodFuture an abstraction for monitoring and retrieving the 1372// results of a long-running operation. 1373type DataConnectionsDataConnectionValidationMethodFuture struct { 1374 azure.FutureAPI 1375 // Result returns the result of the asynchronous operation. 1376 // If the operation has not completed it will return an error. 1377 Result func(DataConnectionsClient) (DataConnectionValidationListResult, error) 1378} 1379 1380// DataConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1381// operation. 1382type DataConnectionsDeleteFuture struct { 1383 azure.FutureAPI 1384 // Result returns the result of the asynchronous operation. 1385 // If the operation has not completed it will return an error. 1386 Result func(DataConnectionsClient) (autorest.Response, error) 1387} 1388 1389// DataConnectionsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1390// operation. 1391type DataConnectionsUpdateFuture struct { 1392 azure.FutureAPI 1393 // Result returns the result of the asynchronous operation. 1394 // If the operation has not completed it will return an error. 1395 Result func(DataConnectionsClient) (DataConnectionModel, error) 1396} 1397 1398// DataConnectionValidation class representing an data connection validation. 1399type DataConnectionValidation struct { 1400 // DataConnectionName - The name of the data connection. 1401 DataConnectionName *string `json:"dataConnectionName,omitempty"` 1402 // Properties - The data connection properties to validate. 1403 Properties BasicDataConnection `json:"properties,omitempty"` 1404} 1405 1406// UnmarshalJSON is the custom unmarshaler for DataConnectionValidation struct. 1407func (dcv *DataConnectionValidation) UnmarshalJSON(body []byte) error { 1408 var m map[string]*json.RawMessage 1409 err := json.Unmarshal(body, &m) 1410 if err != nil { 1411 return err 1412 } 1413 for k, v := range m { 1414 switch k { 1415 case "dataConnectionName": 1416 if v != nil { 1417 var dataConnectionName string 1418 err = json.Unmarshal(*v, &dataConnectionName) 1419 if err != nil { 1420 return err 1421 } 1422 dcv.DataConnectionName = &dataConnectionName 1423 } 1424 case "properties": 1425 if v != nil { 1426 properties, err := unmarshalBasicDataConnection(*v) 1427 if err != nil { 1428 return err 1429 } 1430 dcv.Properties = properties 1431 } 1432 } 1433 } 1434 1435 return nil 1436} 1437 1438// DataConnectionValidationListResult the list Kusto data connection validation result. 1439type DataConnectionValidationListResult struct { 1440 autorest.Response `json:"-"` 1441 // Value - The list of Kusto data connection validation errors. 1442 Value *[]DataConnectionValidationResult `json:"value,omitempty"` 1443} 1444 1445// DataConnectionValidationResult the result returned from a data connection validation request. 1446type DataConnectionValidationResult struct { 1447 // ErrorMessage - A message which indicates a problem in data connection validation. 1448 ErrorMessage *string `json:"errorMessage,omitempty"` 1449} 1450 1451// DiagnoseVirtualNetworkResult ... 1452type DiagnoseVirtualNetworkResult struct { 1453 autorest.Response `json:"-"` 1454 // Findings - The list of network connectivity diagnostic finding 1455 Findings *[]string `json:"findings,omitempty"` 1456} 1457 1458// EventGridConnectionProperties class representing the Kusto event grid connection properties. 1459type EventGridConnectionProperties struct { 1460 // StorageAccountResourceID - The resource ID of the storage account where the data resides. 1461 StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"` 1462 // EventHubResourceID - The resource ID where the event grid is configured to send events. 1463 EventHubResourceID *string `json:"eventHubResourceId,omitempty"` 1464 // ConsumerGroup - The event hub consumer group. 1465 ConsumerGroup *string `json:"consumerGroup,omitempty"` 1466 // TableName - The table where the data should be ingested. Optionally the table information can be added to each message. 1467 TableName *string `json:"tableName,omitempty"` 1468 // MappingRuleName - The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. 1469 MappingRuleName *string `json:"mappingRuleName,omitempty"` 1470 // DataFormat - The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE' 1471 DataFormat EventGridDataFormat `json:"dataFormat,omitempty"` 1472 // IgnoreFirstRecord - A Boolean value that, if set to true, indicates that ingestion should ignore the first record of every file 1473 IgnoreFirstRecord *bool `json:"ignoreFirstRecord,omitempty"` 1474 // BlobStorageEventType - The name of blob storage event type to process. Possible values include: 'MicrosoftStorageBlobCreated', 'MicrosoftStorageBlobRenamed' 1475 BlobStorageEventType BlobStorageEventType `json:"blobStorageEventType,omitempty"` 1476} 1477 1478// EventGridDataConnection class representing an Event Grid data connection. 1479type EventGridDataConnection struct { 1480 // EventGridConnectionProperties - The properties of the Event Grid data connection. 1481 *EventGridConnectionProperties `json:"properties,omitempty"` 1482 // Location - Resource location. 1483 Location *string `json:"location,omitempty"` 1484 // Kind - Possible values include: 'KindDataConnection', 'KindEventHub', 'KindIotHub', 'KindEventGrid' 1485 Kind KindBasicDataConnection `json:"kind,omitempty"` 1486 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1487 ID *string `json:"id,omitempty"` 1488 // Name - READ-ONLY; The name of the resource 1489 Name *string `json:"name,omitempty"` 1490 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 1491 Type *string `json:"type,omitempty"` 1492} 1493 1494// MarshalJSON is the custom marshaler for EventGridDataConnection. 1495func (egdc EventGridDataConnection) MarshalJSON() ([]byte, error) { 1496 egdc.Kind = KindEventGrid 1497 objectMap := make(map[string]interface{}) 1498 if egdc.EventGridConnectionProperties != nil { 1499 objectMap["properties"] = egdc.EventGridConnectionProperties 1500 } 1501 if egdc.Location != nil { 1502 objectMap["location"] = egdc.Location 1503 } 1504 if egdc.Kind != "" { 1505 objectMap["kind"] = egdc.Kind 1506 } 1507 return json.Marshal(objectMap) 1508} 1509 1510// AsEventHubDataConnection is the BasicDataConnection implementation for EventGridDataConnection. 1511func (egdc EventGridDataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) { 1512 return nil, false 1513} 1514 1515// AsIotHubDataConnection is the BasicDataConnection implementation for EventGridDataConnection. 1516func (egdc EventGridDataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) { 1517 return nil, false 1518} 1519 1520// AsEventGridDataConnection is the BasicDataConnection implementation for EventGridDataConnection. 1521func (egdc EventGridDataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) { 1522 return &egdc, true 1523} 1524 1525// AsDataConnection is the BasicDataConnection implementation for EventGridDataConnection. 1526func (egdc EventGridDataConnection) AsDataConnection() (*DataConnection, bool) { 1527 return nil, false 1528} 1529 1530// AsBasicDataConnection is the BasicDataConnection implementation for EventGridDataConnection. 1531func (egdc EventGridDataConnection) AsBasicDataConnection() (BasicDataConnection, bool) { 1532 return &egdc, true 1533} 1534 1535// UnmarshalJSON is the custom unmarshaler for EventGridDataConnection struct. 1536func (egdc *EventGridDataConnection) UnmarshalJSON(body []byte) error { 1537 var m map[string]*json.RawMessage 1538 err := json.Unmarshal(body, &m) 1539 if err != nil { 1540 return err 1541 } 1542 for k, v := range m { 1543 switch k { 1544 case "properties": 1545 if v != nil { 1546 var eventGridConnectionProperties EventGridConnectionProperties 1547 err = json.Unmarshal(*v, &eventGridConnectionProperties) 1548 if err != nil { 1549 return err 1550 } 1551 egdc.EventGridConnectionProperties = &eventGridConnectionProperties 1552 } 1553 case "location": 1554 if v != nil { 1555 var location string 1556 err = json.Unmarshal(*v, &location) 1557 if err != nil { 1558 return err 1559 } 1560 egdc.Location = &location 1561 } 1562 case "kind": 1563 if v != nil { 1564 var kind KindBasicDataConnection 1565 err = json.Unmarshal(*v, &kind) 1566 if err != nil { 1567 return err 1568 } 1569 egdc.Kind = kind 1570 } 1571 case "id": 1572 if v != nil { 1573 var ID string 1574 err = json.Unmarshal(*v, &ID) 1575 if err != nil { 1576 return err 1577 } 1578 egdc.ID = &ID 1579 } 1580 case "name": 1581 if v != nil { 1582 var name string 1583 err = json.Unmarshal(*v, &name) 1584 if err != nil { 1585 return err 1586 } 1587 egdc.Name = &name 1588 } 1589 case "type": 1590 if v != nil { 1591 var typeVar string 1592 err = json.Unmarshal(*v, &typeVar) 1593 if err != nil { 1594 return err 1595 } 1596 egdc.Type = &typeVar 1597 } 1598 } 1599 } 1600 1601 return nil 1602} 1603 1604// EventHubConnectionProperties class representing the Kusto event hub connection properties. 1605type EventHubConnectionProperties struct { 1606 // EventHubResourceID - The resource ID of the event hub to be used to create a data connection. 1607 EventHubResourceID *string `json:"eventHubResourceId,omitempty"` 1608 // ConsumerGroup - The event hub consumer group. 1609 ConsumerGroup *string `json:"consumerGroup,omitempty"` 1610 // TableName - The table where the data should be ingested. Optionally the table information can be added to each message. 1611 TableName *string `json:"tableName,omitempty"` 1612 // MappingRuleName - The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. 1613 MappingRuleName *string `json:"mappingRuleName,omitempty"` 1614 // 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' 1615 DataFormat EventHubDataFormat `json:"dataFormat,omitempty"` 1616 // EventSystemProperties - System properties of the event hub 1617 EventSystemProperties *[]string `json:"eventSystemProperties,omitempty"` 1618 // Compression - The event hub messages compression type. Possible values include: 'CompressionNone', 'CompressionGZip' 1619 Compression Compression `json:"compression,omitempty"` 1620} 1621 1622// EventHubDataConnection class representing an event hub data connection. 1623type EventHubDataConnection struct { 1624 // EventHubConnectionProperties - The Event Hub data connection properties to validate. 1625 *EventHubConnectionProperties `json:"properties,omitempty"` 1626 // Location - Resource location. 1627 Location *string `json:"location,omitempty"` 1628 // Kind - Possible values include: 'KindDataConnection', 'KindEventHub', 'KindIotHub', 'KindEventGrid' 1629 Kind KindBasicDataConnection `json:"kind,omitempty"` 1630 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1631 ID *string `json:"id,omitempty"` 1632 // Name - READ-ONLY; The name of the resource 1633 Name *string `json:"name,omitempty"` 1634 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 1635 Type *string `json:"type,omitempty"` 1636} 1637 1638// MarshalJSON is the custom marshaler for EventHubDataConnection. 1639func (ehdc EventHubDataConnection) MarshalJSON() ([]byte, error) { 1640 ehdc.Kind = KindEventHub 1641 objectMap := make(map[string]interface{}) 1642 if ehdc.EventHubConnectionProperties != nil { 1643 objectMap["properties"] = ehdc.EventHubConnectionProperties 1644 } 1645 if ehdc.Location != nil { 1646 objectMap["location"] = ehdc.Location 1647 } 1648 if ehdc.Kind != "" { 1649 objectMap["kind"] = ehdc.Kind 1650 } 1651 return json.Marshal(objectMap) 1652} 1653 1654// AsEventHubDataConnection is the BasicDataConnection implementation for EventHubDataConnection. 1655func (ehdc EventHubDataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) { 1656 return &ehdc, true 1657} 1658 1659// AsIotHubDataConnection is the BasicDataConnection implementation for EventHubDataConnection. 1660func (ehdc EventHubDataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) { 1661 return nil, false 1662} 1663 1664// AsEventGridDataConnection is the BasicDataConnection implementation for EventHubDataConnection. 1665func (ehdc EventHubDataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) { 1666 return nil, false 1667} 1668 1669// AsDataConnection is the BasicDataConnection implementation for EventHubDataConnection. 1670func (ehdc EventHubDataConnection) AsDataConnection() (*DataConnection, bool) { 1671 return nil, false 1672} 1673 1674// AsBasicDataConnection is the BasicDataConnection implementation for EventHubDataConnection. 1675func (ehdc EventHubDataConnection) AsBasicDataConnection() (BasicDataConnection, bool) { 1676 return &ehdc, true 1677} 1678 1679// UnmarshalJSON is the custom unmarshaler for EventHubDataConnection struct. 1680func (ehdc *EventHubDataConnection) UnmarshalJSON(body []byte) error { 1681 var m map[string]*json.RawMessage 1682 err := json.Unmarshal(body, &m) 1683 if err != nil { 1684 return err 1685 } 1686 for k, v := range m { 1687 switch k { 1688 case "properties": 1689 if v != nil { 1690 var eventHubConnectionProperties EventHubConnectionProperties 1691 err = json.Unmarshal(*v, &eventHubConnectionProperties) 1692 if err != nil { 1693 return err 1694 } 1695 ehdc.EventHubConnectionProperties = &eventHubConnectionProperties 1696 } 1697 case "location": 1698 if v != nil { 1699 var location string 1700 err = json.Unmarshal(*v, &location) 1701 if err != nil { 1702 return err 1703 } 1704 ehdc.Location = &location 1705 } 1706 case "kind": 1707 if v != nil { 1708 var kind KindBasicDataConnection 1709 err = json.Unmarshal(*v, &kind) 1710 if err != nil { 1711 return err 1712 } 1713 ehdc.Kind = kind 1714 } 1715 case "id": 1716 if v != nil { 1717 var ID string 1718 err = json.Unmarshal(*v, &ID) 1719 if err != nil { 1720 return err 1721 } 1722 ehdc.ID = &ID 1723 } 1724 case "name": 1725 if v != nil { 1726 var name string 1727 err = json.Unmarshal(*v, &name) 1728 if err != nil { 1729 return err 1730 } 1731 ehdc.Name = &name 1732 } 1733 case "type": 1734 if v != nil { 1735 var typeVar string 1736 err = json.Unmarshal(*v, &typeVar) 1737 if err != nil { 1738 return err 1739 } 1740 ehdc.Type = &typeVar 1741 } 1742 } 1743 } 1744 1745 return nil 1746} 1747 1748// FollowerDatabaseDefinition a class representing follower database request. 1749type FollowerDatabaseDefinition struct { 1750 // ClusterResourceID - Resource id of the cluster that follows a database owned by this cluster. 1751 ClusterResourceID *string `json:"clusterResourceId,omitempty"` 1752 // AttachedDatabaseConfigurationName - Resource name of the attached database configuration in the follower cluster. 1753 AttachedDatabaseConfigurationName *string `json:"attachedDatabaseConfigurationName,omitempty"` 1754 // DatabaseName - READ-ONLY; The database name owned by this cluster that was followed. * in case following all databases. 1755 DatabaseName *string `json:"databaseName,omitempty"` 1756} 1757 1758// MarshalJSON is the custom marshaler for FollowerDatabaseDefinition. 1759func (fdd FollowerDatabaseDefinition) MarshalJSON() ([]byte, error) { 1760 objectMap := make(map[string]interface{}) 1761 if fdd.ClusterResourceID != nil { 1762 objectMap["clusterResourceId"] = fdd.ClusterResourceID 1763 } 1764 if fdd.AttachedDatabaseConfigurationName != nil { 1765 objectMap["attachedDatabaseConfigurationName"] = fdd.AttachedDatabaseConfigurationName 1766 } 1767 return json.Marshal(objectMap) 1768} 1769 1770// FollowerDatabaseListResult the list Kusto database principals operation response. 1771type FollowerDatabaseListResult struct { 1772 autorest.Response `json:"-"` 1773 // Value - The list of follower database result. 1774 Value *[]FollowerDatabaseDefinition `json:"value,omitempty"` 1775} 1776 1777// Identity identity for the resource. 1778type Identity struct { 1779 // PrincipalID - READ-ONLY; The principal ID of resource identity. 1780 PrincipalID *string `json:"principalId,omitempty"` 1781 // TenantID - READ-ONLY; The tenant ID of resource. 1782 TenantID *string `json:"tenantId,omitempty"` 1783 // Type - The identity type. Possible values include: 'IdentityTypeNone', 'IdentityTypeSystemAssigned' 1784 Type IdentityType `json:"type,omitempty"` 1785 // 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}'. 1786 UserAssignedIdentities map[string]*IdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 1787} 1788 1789// MarshalJSON is the custom marshaler for Identity. 1790func (i Identity) MarshalJSON() ([]byte, error) { 1791 objectMap := make(map[string]interface{}) 1792 if i.Type != "" { 1793 objectMap["type"] = i.Type 1794 } 1795 if i.UserAssignedIdentities != nil { 1796 objectMap["userAssignedIdentities"] = i.UserAssignedIdentities 1797 } 1798 return json.Marshal(objectMap) 1799} 1800 1801// IdentityUserAssignedIdentitiesValue ... 1802type IdentityUserAssignedIdentitiesValue struct { 1803 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 1804 PrincipalID *string `json:"principalId,omitempty"` 1805 // ClientID - READ-ONLY; The client id of user assigned identity. 1806 ClientID *string `json:"clientId,omitempty"` 1807} 1808 1809// IotHubConnectionProperties class representing the Kusto Iot hub connection properties. 1810type IotHubConnectionProperties struct { 1811 // IotHubResourceID - The resource ID of the Iot hub to be used to create a data connection. 1812 IotHubResourceID *string `json:"iotHubResourceId,omitempty"` 1813 // ConsumerGroup - The iot hub consumer group. 1814 ConsumerGroup *string `json:"consumerGroup,omitempty"` 1815 // TableName - The table where the data should be ingested. Optionally the table information can be added to each message. 1816 TableName *string `json:"tableName,omitempty"` 1817 // MappingRuleName - The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. 1818 MappingRuleName *string `json:"mappingRuleName,omitempty"` 1819 // 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' 1820 DataFormat IotHubDataFormat `json:"dataFormat,omitempty"` 1821 // EventSystemProperties - System properties of the iot hub 1822 EventSystemProperties *[]string `json:"eventSystemProperties,omitempty"` 1823 // SharedAccessPolicyName - The name of the share access policy 1824 SharedAccessPolicyName *string `json:"sharedAccessPolicyName,omitempty"` 1825} 1826 1827// IotHubDataConnection class representing an iot hub data connection. 1828type IotHubDataConnection struct { 1829 // IotHubConnectionProperties - The Iot Hub data connection properties. 1830 *IotHubConnectionProperties `json:"properties,omitempty"` 1831 // Location - Resource location. 1832 Location *string `json:"location,omitempty"` 1833 // Kind - Possible values include: 'KindDataConnection', 'KindEventHub', 'KindIotHub', 'KindEventGrid' 1834 Kind KindBasicDataConnection `json:"kind,omitempty"` 1835 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1836 ID *string `json:"id,omitempty"` 1837 // Name - READ-ONLY; The name of the resource 1838 Name *string `json:"name,omitempty"` 1839 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 1840 Type *string `json:"type,omitempty"` 1841} 1842 1843// MarshalJSON is the custom marshaler for IotHubDataConnection. 1844func (ihdc IotHubDataConnection) MarshalJSON() ([]byte, error) { 1845 ihdc.Kind = KindIotHub 1846 objectMap := make(map[string]interface{}) 1847 if ihdc.IotHubConnectionProperties != nil { 1848 objectMap["properties"] = ihdc.IotHubConnectionProperties 1849 } 1850 if ihdc.Location != nil { 1851 objectMap["location"] = ihdc.Location 1852 } 1853 if ihdc.Kind != "" { 1854 objectMap["kind"] = ihdc.Kind 1855 } 1856 return json.Marshal(objectMap) 1857} 1858 1859// AsEventHubDataConnection is the BasicDataConnection implementation for IotHubDataConnection. 1860func (ihdc IotHubDataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) { 1861 return nil, false 1862} 1863 1864// AsIotHubDataConnection is the BasicDataConnection implementation for IotHubDataConnection. 1865func (ihdc IotHubDataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) { 1866 return &ihdc, true 1867} 1868 1869// AsEventGridDataConnection is the BasicDataConnection implementation for IotHubDataConnection. 1870func (ihdc IotHubDataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) { 1871 return nil, false 1872} 1873 1874// AsDataConnection is the BasicDataConnection implementation for IotHubDataConnection. 1875func (ihdc IotHubDataConnection) AsDataConnection() (*DataConnection, bool) { 1876 return nil, false 1877} 1878 1879// AsBasicDataConnection is the BasicDataConnection implementation for IotHubDataConnection. 1880func (ihdc IotHubDataConnection) AsBasicDataConnection() (BasicDataConnection, bool) { 1881 return &ihdc, true 1882} 1883 1884// UnmarshalJSON is the custom unmarshaler for IotHubDataConnection struct. 1885func (ihdc *IotHubDataConnection) UnmarshalJSON(body []byte) error { 1886 var m map[string]*json.RawMessage 1887 err := json.Unmarshal(body, &m) 1888 if err != nil { 1889 return err 1890 } 1891 for k, v := range m { 1892 switch k { 1893 case "properties": 1894 if v != nil { 1895 var iotHubConnectionProperties IotHubConnectionProperties 1896 err = json.Unmarshal(*v, &iotHubConnectionProperties) 1897 if err != nil { 1898 return err 1899 } 1900 ihdc.IotHubConnectionProperties = &iotHubConnectionProperties 1901 } 1902 case "location": 1903 if v != nil { 1904 var location string 1905 err = json.Unmarshal(*v, &location) 1906 if err != nil { 1907 return err 1908 } 1909 ihdc.Location = &location 1910 } 1911 case "kind": 1912 if v != nil { 1913 var kind KindBasicDataConnection 1914 err = json.Unmarshal(*v, &kind) 1915 if err != nil { 1916 return err 1917 } 1918 ihdc.Kind = kind 1919 } 1920 case "id": 1921 if v != nil { 1922 var ID string 1923 err = json.Unmarshal(*v, &ID) 1924 if err != nil { 1925 return err 1926 } 1927 ihdc.ID = &ID 1928 } 1929 case "name": 1930 if v != nil { 1931 var name string 1932 err = json.Unmarshal(*v, &name) 1933 if err != nil { 1934 return err 1935 } 1936 ihdc.Name = &name 1937 } 1938 case "type": 1939 if v != nil { 1940 var typeVar string 1941 err = json.Unmarshal(*v, &typeVar) 1942 if err != nil { 1943 return err 1944 } 1945 ihdc.Type = &typeVar 1946 } 1947 } 1948 } 1949 1950 return nil 1951} 1952 1953// KeyVaultProperties properties of the key vault. 1954type KeyVaultProperties struct { 1955 // KeyName - The name of the key vault key. 1956 KeyName *string `json:"keyName,omitempty"` 1957 // KeyVersion - The version of the key vault key. 1958 KeyVersion *string `json:"keyVersion,omitempty"` 1959 // KeyVaultURI - The Uri of the key vault. 1960 KeyVaultURI *string `json:"keyVaultUri,omitempty"` 1961} 1962 1963// LanguageExtension the language extension object. 1964type LanguageExtension struct { 1965 // LanguageExtensionName - The language extension name. Possible values include: 'PYTHON', 'R' 1966 LanguageExtensionName LanguageExtensionName `json:"languageExtensionName,omitempty"` 1967} 1968 1969// LanguageExtensionsList the list of language extension objects. 1970type LanguageExtensionsList struct { 1971 autorest.Response `json:"-"` 1972 // Value - The list of language extensions. 1973 Value *[]LanguageExtension `json:"value,omitempty"` 1974} 1975 1976// ListResourceSkusResult list of available SKUs for a Kusto Cluster. 1977type ListResourceSkusResult struct { 1978 autorest.Response `json:"-"` 1979 // Value - The collection of available SKUs for an existing resource. 1980 Value *[]AzureResourceSku `json:"value,omitempty"` 1981} 1982 1983// Operation ... 1984type Operation struct { 1985 // Name - This is of the format {provider}/{resource}/{operation}. 1986 Name *string `json:"name,omitempty"` 1987 Display *OperationDisplay `json:"display,omitempty"` 1988 Origin *string `json:"origin,omitempty"` 1989 Properties interface{} `json:"properties,omitempty"` 1990} 1991 1992// OperationDisplay ... 1993type OperationDisplay struct { 1994 Provider *string `json:"provider,omitempty"` 1995 // Operation - For example: read, write, delete. 1996 Operation *string `json:"operation,omitempty"` 1997 Resource *string `json:"resource,omitempty"` 1998 Description *string `json:"description,omitempty"` 1999} 2000 2001// OperationListResult ... 2002type OperationListResult struct { 2003 autorest.Response `json:"-"` 2004 Value *[]Operation `json:"value,omitempty"` 2005 NextLink *string `json:"nextLink,omitempty"` 2006} 2007 2008// OperationListResultIterator provides access to a complete listing of Operation values. 2009type OperationListResultIterator struct { 2010 i int 2011 page OperationListResultPage 2012} 2013 2014// NextWithContext advances to the next value. If there was an error making 2015// the request the iterator does not advance and the error is returned. 2016func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { 2017 if tracing.IsEnabled() { 2018 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") 2019 defer func() { 2020 sc := -1 2021 if iter.Response().Response.Response != nil { 2022 sc = iter.Response().Response.Response.StatusCode 2023 } 2024 tracing.EndSpan(ctx, sc, err) 2025 }() 2026 } 2027 iter.i++ 2028 if iter.i < len(iter.page.Values()) { 2029 return nil 2030 } 2031 err = iter.page.NextWithContext(ctx) 2032 if err != nil { 2033 iter.i-- 2034 return err 2035 } 2036 iter.i = 0 2037 return nil 2038} 2039 2040// Next advances to the next value. If there was an error making 2041// the request the iterator does not advance and the error is returned. 2042// Deprecated: Use NextWithContext() instead. 2043func (iter *OperationListResultIterator) Next() error { 2044 return iter.NextWithContext(context.Background()) 2045} 2046 2047// NotDone returns true if the enumeration should be started or is not yet complete. 2048func (iter OperationListResultIterator) NotDone() bool { 2049 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2050} 2051 2052// Response returns the raw server response from the last page request. 2053func (iter OperationListResultIterator) Response() OperationListResult { 2054 return iter.page.Response() 2055} 2056 2057// Value returns the current value or a zero-initialized value if the 2058// iterator has advanced beyond the end of the collection. 2059func (iter OperationListResultIterator) Value() Operation { 2060 if !iter.page.NotDone() { 2061 return Operation{} 2062 } 2063 return iter.page.Values()[iter.i] 2064} 2065 2066// Creates a new instance of the OperationListResultIterator type. 2067func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { 2068 return OperationListResultIterator{page: page} 2069} 2070 2071// IsEmpty returns true if the ListResult contains no values. 2072func (olr OperationListResult) IsEmpty() bool { 2073 return olr.Value == nil || len(*olr.Value) == 0 2074} 2075 2076// hasNextLink returns true if the NextLink is not empty. 2077func (olr OperationListResult) hasNextLink() bool { 2078 return olr.NextLink != nil && len(*olr.NextLink) != 0 2079} 2080 2081// operationListResultPreparer prepares a request to retrieve the next set of results. 2082// It returns nil if no more results exist. 2083func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { 2084 if !olr.hasNextLink() { 2085 return nil, nil 2086 } 2087 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2088 autorest.AsJSON(), 2089 autorest.AsGet(), 2090 autorest.WithBaseURL(to.String(olr.NextLink))) 2091} 2092 2093// OperationListResultPage contains a page of Operation values. 2094type OperationListResultPage struct { 2095 fn func(context.Context, OperationListResult) (OperationListResult, error) 2096 olr OperationListResult 2097} 2098 2099// NextWithContext advances to the next page of values. If there was an error making 2100// the request the page does not advance and the error is returned. 2101func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { 2102 if tracing.IsEnabled() { 2103 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") 2104 defer func() { 2105 sc := -1 2106 if page.Response().Response.Response != nil { 2107 sc = page.Response().Response.Response.StatusCode 2108 } 2109 tracing.EndSpan(ctx, sc, err) 2110 }() 2111 } 2112 for { 2113 next, err := page.fn(ctx, page.olr) 2114 if err != nil { 2115 return err 2116 } 2117 page.olr = next 2118 if !next.hasNextLink() || !next.IsEmpty() { 2119 break 2120 } 2121 } 2122 return nil 2123} 2124 2125// Next advances to the next page of values. If there was an error making 2126// the request the page does not advance and the error is returned. 2127// Deprecated: Use NextWithContext() instead. 2128func (page *OperationListResultPage) Next() error { 2129 return page.NextWithContext(context.Background()) 2130} 2131 2132// NotDone returns true if the page enumeration should be started or is not yet complete. 2133func (page OperationListResultPage) NotDone() bool { 2134 return !page.olr.IsEmpty() 2135} 2136 2137// Response returns the raw server response from the last page request. 2138func (page OperationListResultPage) Response() OperationListResult { 2139 return page.olr 2140} 2141 2142// Values returns the slice of values for the current page or nil if there are no values. 2143func (page OperationListResultPage) Values() []Operation { 2144 if page.olr.IsEmpty() { 2145 return nil 2146 } 2147 return *page.olr.Value 2148} 2149 2150// Creates a new instance of the OperationListResultPage type. 2151func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { 2152 return OperationListResultPage{ 2153 fn: getNextPage, 2154 olr: cur, 2155 } 2156} 2157 2158// OptimizedAutoscale a class that contains the optimized auto scale definition. 2159type OptimizedAutoscale struct { 2160 // Version - The version of the template defined, for instance 1. 2161 Version *int32 `json:"version,omitempty"` 2162 // IsEnabled - A boolean value that indicate if the optimized autoscale feature is enabled or not. 2163 IsEnabled *bool `json:"isEnabled,omitempty"` 2164 // Minimum - Minimum allowed instances count. 2165 Minimum *int32 `json:"minimum,omitempty"` 2166 // Maximum - Maximum allowed instances count. 2167 Maximum *int32 `json:"maximum,omitempty"` 2168} 2169 2170// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not 2171// have tags and a location 2172type ProxyResource struct { 2173 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 2174 ID *string `json:"id,omitempty"` 2175 // Name - READ-ONLY; The name of the resource 2176 Name *string `json:"name,omitempty"` 2177 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 2178 Type *string `json:"type,omitempty"` 2179} 2180 2181// ReadOnlyFollowingDatabase class representing a read only following database. 2182type ReadOnlyFollowingDatabase struct { 2183 // ReadOnlyFollowingDatabaseProperties - The database properties. 2184 *ReadOnlyFollowingDatabaseProperties `json:"properties,omitempty"` 2185 // Location - Resource location. 2186 Location *string `json:"location,omitempty"` 2187 // Kind - Possible values include: 'KindDatabase', 'KindReadWrite', 'KindReadOnlyFollowing' 2188 Kind Kind `json:"kind,omitempty"` 2189 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 2190 ID *string `json:"id,omitempty"` 2191 // Name - READ-ONLY; The name of the resource 2192 Name *string `json:"name,omitempty"` 2193 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 2194 Type *string `json:"type,omitempty"` 2195} 2196 2197// MarshalJSON is the custom marshaler for ReadOnlyFollowingDatabase. 2198func (rofd ReadOnlyFollowingDatabase) MarshalJSON() ([]byte, error) { 2199 rofd.Kind = KindReadOnlyFollowing 2200 objectMap := make(map[string]interface{}) 2201 if rofd.ReadOnlyFollowingDatabaseProperties != nil { 2202 objectMap["properties"] = rofd.ReadOnlyFollowingDatabaseProperties 2203 } 2204 if rofd.Location != nil { 2205 objectMap["location"] = rofd.Location 2206 } 2207 if rofd.Kind != "" { 2208 objectMap["kind"] = rofd.Kind 2209 } 2210 return json.Marshal(objectMap) 2211} 2212 2213// AsReadWriteDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase. 2214func (rofd ReadOnlyFollowingDatabase) AsReadWriteDatabase() (*ReadWriteDatabase, bool) { 2215 return nil, false 2216} 2217 2218// AsReadOnlyFollowingDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase. 2219func (rofd ReadOnlyFollowingDatabase) AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) { 2220 return &rofd, true 2221} 2222 2223// AsDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase. 2224func (rofd ReadOnlyFollowingDatabase) AsDatabase() (*Database, bool) { 2225 return nil, false 2226} 2227 2228// AsBasicDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase. 2229func (rofd ReadOnlyFollowingDatabase) AsBasicDatabase() (BasicDatabase, bool) { 2230 return &rofd, true 2231} 2232 2233// UnmarshalJSON is the custom unmarshaler for ReadOnlyFollowingDatabase struct. 2234func (rofd *ReadOnlyFollowingDatabase) UnmarshalJSON(body []byte) error { 2235 var m map[string]*json.RawMessage 2236 err := json.Unmarshal(body, &m) 2237 if err != nil { 2238 return err 2239 } 2240 for k, v := range m { 2241 switch k { 2242 case "properties": 2243 if v != nil { 2244 var readOnlyFollowingDatabaseProperties ReadOnlyFollowingDatabaseProperties 2245 err = json.Unmarshal(*v, &readOnlyFollowingDatabaseProperties) 2246 if err != nil { 2247 return err 2248 } 2249 rofd.ReadOnlyFollowingDatabaseProperties = &readOnlyFollowingDatabaseProperties 2250 } 2251 case "location": 2252 if v != nil { 2253 var location string 2254 err = json.Unmarshal(*v, &location) 2255 if err != nil { 2256 return err 2257 } 2258 rofd.Location = &location 2259 } 2260 case "kind": 2261 if v != nil { 2262 var kind Kind 2263 err = json.Unmarshal(*v, &kind) 2264 if err != nil { 2265 return err 2266 } 2267 rofd.Kind = kind 2268 } 2269 case "id": 2270 if v != nil { 2271 var ID string 2272 err = json.Unmarshal(*v, &ID) 2273 if err != nil { 2274 return err 2275 } 2276 rofd.ID = &ID 2277 } 2278 case "name": 2279 if v != nil { 2280 var name string 2281 err = json.Unmarshal(*v, &name) 2282 if err != nil { 2283 return err 2284 } 2285 rofd.Name = &name 2286 } 2287 case "type": 2288 if v != nil { 2289 var typeVar string 2290 err = json.Unmarshal(*v, &typeVar) 2291 if err != nil { 2292 return err 2293 } 2294 rofd.Type = &typeVar 2295 } 2296 } 2297 } 2298 2299 return nil 2300} 2301 2302// ReadOnlyFollowingDatabaseProperties class representing the Kusto database properties. 2303type ReadOnlyFollowingDatabaseProperties struct { 2304 // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' 2305 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 2306 // SoftDeletePeriod - READ-ONLY; The time the data should be kept before it stops being accessible to queries in TimeSpan. 2307 SoftDeletePeriod *string `json:"softDeletePeriod,omitempty"` 2308 // HotCachePeriod - The time the data should be kept in cache for fast queries in TimeSpan. 2309 HotCachePeriod *string `json:"hotCachePeriod,omitempty"` 2310 // Statistics - The statistics of the database. 2311 Statistics *DatabaseStatistics `json:"statistics,omitempty"` 2312 // LeaderClusterResourceID - READ-ONLY; The name of the leader cluster 2313 LeaderClusterResourceID *string `json:"leaderClusterResourceId,omitempty"` 2314 // AttachedDatabaseConfigurationName - READ-ONLY; The name of the attached database configuration cluster 2315 AttachedDatabaseConfigurationName *string `json:"attachedDatabaseConfigurationName,omitempty"` 2316 // PrincipalsModificationKind - READ-ONLY; The principals modification kind of the database. Possible values include: 'PrincipalsModificationKindUnion', 'PrincipalsModificationKindReplace', 'PrincipalsModificationKindNone' 2317 PrincipalsModificationKind PrincipalsModificationKind `json:"principalsModificationKind,omitempty"` 2318} 2319 2320// MarshalJSON is the custom marshaler for ReadOnlyFollowingDatabaseProperties. 2321func (rofdp ReadOnlyFollowingDatabaseProperties) MarshalJSON() ([]byte, error) { 2322 objectMap := make(map[string]interface{}) 2323 if rofdp.HotCachePeriod != nil { 2324 objectMap["hotCachePeriod"] = rofdp.HotCachePeriod 2325 } 2326 if rofdp.Statistics != nil { 2327 objectMap["statistics"] = rofdp.Statistics 2328 } 2329 return json.Marshal(objectMap) 2330} 2331 2332// ReadWriteDatabase class representing a read write database. 2333type ReadWriteDatabase struct { 2334 // ReadWriteDatabaseProperties - The database properties. 2335 *ReadWriteDatabaseProperties `json:"properties,omitempty"` 2336 // Location - Resource location. 2337 Location *string `json:"location,omitempty"` 2338 // Kind - Possible values include: 'KindDatabase', 'KindReadWrite', 'KindReadOnlyFollowing' 2339 Kind Kind `json:"kind,omitempty"` 2340 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 2341 ID *string `json:"id,omitempty"` 2342 // Name - READ-ONLY; The name of the resource 2343 Name *string `json:"name,omitempty"` 2344 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 2345 Type *string `json:"type,omitempty"` 2346} 2347 2348// MarshalJSON is the custom marshaler for ReadWriteDatabase. 2349func (rwd ReadWriteDatabase) MarshalJSON() ([]byte, error) { 2350 rwd.Kind = KindReadWrite 2351 objectMap := make(map[string]interface{}) 2352 if rwd.ReadWriteDatabaseProperties != nil { 2353 objectMap["properties"] = rwd.ReadWriteDatabaseProperties 2354 } 2355 if rwd.Location != nil { 2356 objectMap["location"] = rwd.Location 2357 } 2358 if rwd.Kind != "" { 2359 objectMap["kind"] = rwd.Kind 2360 } 2361 return json.Marshal(objectMap) 2362} 2363 2364// AsReadWriteDatabase is the BasicDatabase implementation for ReadWriteDatabase. 2365func (rwd ReadWriteDatabase) AsReadWriteDatabase() (*ReadWriteDatabase, bool) { 2366 return &rwd, true 2367} 2368 2369// AsReadOnlyFollowingDatabase is the BasicDatabase implementation for ReadWriteDatabase. 2370func (rwd ReadWriteDatabase) AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) { 2371 return nil, false 2372} 2373 2374// AsDatabase is the BasicDatabase implementation for ReadWriteDatabase. 2375func (rwd ReadWriteDatabase) AsDatabase() (*Database, bool) { 2376 return nil, false 2377} 2378 2379// AsBasicDatabase is the BasicDatabase implementation for ReadWriteDatabase. 2380func (rwd ReadWriteDatabase) AsBasicDatabase() (BasicDatabase, bool) { 2381 return &rwd, true 2382} 2383 2384// UnmarshalJSON is the custom unmarshaler for ReadWriteDatabase struct. 2385func (rwd *ReadWriteDatabase) UnmarshalJSON(body []byte) error { 2386 var m map[string]*json.RawMessage 2387 err := json.Unmarshal(body, &m) 2388 if err != nil { 2389 return err 2390 } 2391 for k, v := range m { 2392 switch k { 2393 case "properties": 2394 if v != nil { 2395 var readWriteDatabaseProperties ReadWriteDatabaseProperties 2396 err = json.Unmarshal(*v, &readWriteDatabaseProperties) 2397 if err != nil { 2398 return err 2399 } 2400 rwd.ReadWriteDatabaseProperties = &readWriteDatabaseProperties 2401 } 2402 case "location": 2403 if v != nil { 2404 var location string 2405 err = json.Unmarshal(*v, &location) 2406 if err != nil { 2407 return err 2408 } 2409 rwd.Location = &location 2410 } 2411 case "kind": 2412 if v != nil { 2413 var kind Kind 2414 err = json.Unmarshal(*v, &kind) 2415 if err != nil { 2416 return err 2417 } 2418 rwd.Kind = kind 2419 } 2420 case "id": 2421 if v != nil { 2422 var ID string 2423 err = json.Unmarshal(*v, &ID) 2424 if err != nil { 2425 return err 2426 } 2427 rwd.ID = &ID 2428 } 2429 case "name": 2430 if v != nil { 2431 var name string 2432 err = json.Unmarshal(*v, &name) 2433 if err != nil { 2434 return err 2435 } 2436 rwd.Name = &name 2437 } 2438 case "type": 2439 if v != nil { 2440 var typeVar string 2441 err = json.Unmarshal(*v, &typeVar) 2442 if err != nil { 2443 return err 2444 } 2445 rwd.Type = &typeVar 2446 } 2447 } 2448 } 2449 2450 return nil 2451} 2452 2453// ReadWriteDatabaseProperties class representing the Kusto database properties. 2454type ReadWriteDatabaseProperties struct { 2455 // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' 2456 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 2457 // SoftDeletePeriod - The time the data should be kept before it stops being accessible to queries in TimeSpan. 2458 SoftDeletePeriod *string `json:"softDeletePeriod,omitempty"` 2459 // HotCachePeriod - The time the data should be kept in cache for fast queries in TimeSpan. 2460 HotCachePeriod *string `json:"hotCachePeriod,omitempty"` 2461 // Statistics - The statistics of the database. 2462 Statistics *DatabaseStatistics `json:"statistics,omitempty"` 2463 // IsFollowed - READ-ONLY; Indicates whether the database is followed. 2464 IsFollowed *bool `json:"isFollowed,omitempty"` 2465} 2466 2467// MarshalJSON is the custom marshaler for ReadWriteDatabaseProperties. 2468func (rwdp ReadWriteDatabaseProperties) MarshalJSON() ([]byte, error) { 2469 objectMap := make(map[string]interface{}) 2470 if rwdp.SoftDeletePeriod != nil { 2471 objectMap["softDeletePeriod"] = rwdp.SoftDeletePeriod 2472 } 2473 if rwdp.HotCachePeriod != nil { 2474 objectMap["hotCachePeriod"] = rwdp.HotCachePeriod 2475 } 2476 if rwdp.Statistics != nil { 2477 objectMap["statistics"] = rwdp.Statistics 2478 } 2479 return json.Marshal(objectMap) 2480} 2481 2482// Resource common fields that are returned in the response for all Azure Resource Manager resources 2483type Resource struct { 2484 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 2485 ID *string `json:"id,omitempty"` 2486 // Name - READ-ONLY; The name of the resource 2487 Name *string `json:"name,omitempty"` 2488 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 2489 Type *string `json:"type,omitempty"` 2490} 2491 2492// SkuDescription the Kusto SKU description of given resource type 2493type SkuDescription struct { 2494 // ResourceType - READ-ONLY; The resource type 2495 ResourceType *string `json:"resourceType,omitempty"` 2496 // Name - READ-ONLY; The name of the SKU 2497 Name *string `json:"name,omitempty"` 2498 // Tier - READ-ONLY; The tier of the SKU 2499 Tier *string `json:"tier,omitempty"` 2500 // Locations - READ-ONLY; The set of locations that the SKU is available 2501 Locations *[]string `json:"locations,omitempty"` 2502 // LocationInfo - READ-ONLY; Locations and zones 2503 LocationInfo *[]SkuLocationInfoItem `json:"locationInfo,omitempty"` 2504 // Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used 2505 Restrictions *[]interface{} `json:"restrictions,omitempty"` 2506} 2507 2508// SkuDescriptionList the list of the EngagementFabric SKU descriptions 2509type SkuDescriptionList struct { 2510 autorest.Response `json:"-"` 2511 // Value - READ-ONLY; SKU descriptions 2512 Value *[]SkuDescription `json:"value,omitempty"` 2513} 2514 2515// SkuLocationInfoItem the locations and zones info for SKU. 2516type SkuLocationInfoItem struct { 2517 // Location - The available location of the SKU. 2518 Location *string `json:"location,omitempty"` 2519 // Zones - The available zone of the SKU. 2520 Zones *[]string `json:"zones,omitempty"` 2521} 2522 2523// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource 2524// which has 'tags' and a 'location' 2525type TrackedResource struct { 2526 // Tags - Resource tags. 2527 Tags map[string]*string `json:"tags"` 2528 // Location - The geo-location where the resource lives 2529 Location *string `json:"location,omitempty"` 2530 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 2531 ID *string `json:"id,omitempty"` 2532 // Name - READ-ONLY; The name of the resource 2533 Name *string `json:"name,omitempty"` 2534 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 2535 Type *string `json:"type,omitempty"` 2536} 2537 2538// MarshalJSON is the custom marshaler for TrackedResource. 2539func (tr TrackedResource) MarshalJSON() ([]byte, error) { 2540 objectMap := make(map[string]interface{}) 2541 if tr.Tags != nil { 2542 objectMap["tags"] = tr.Tags 2543 } 2544 if tr.Location != nil { 2545 objectMap["location"] = tr.Location 2546 } 2547 return json.Marshal(objectMap) 2548} 2549 2550// TrustedExternalTenant represents a tenant ID that is trusted by the cluster. 2551type TrustedExternalTenant struct { 2552 // Value - GUID representing an external tenant. 2553 Value *string `json:"value,omitempty"` 2554} 2555 2556// VirtualNetworkConfiguration a class that contains virtual network definition. 2557type VirtualNetworkConfiguration struct { 2558 // SubnetID - The subnet resource id. 2559 SubnetID *string `json:"subnetId,omitempty"` 2560 // EnginePublicIPID - Engine service's public IP address resource id. 2561 EnginePublicIPID *string `json:"enginePublicIpId,omitempty"` 2562 // DataManagementPublicIPID - Data management's service public IP address resource id. 2563 DataManagementPublicIPID *string `json:"dataManagementPublicIpId,omitempty"` 2564} 2565