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/2019-11-09/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' 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} 583 584// MarshalJSON is the custom marshaler for ClusterProperties. 585func (cp ClusterProperties) MarshalJSON() ([]byte, error) { 586 objectMap := make(map[string]interface{}) 587 if cp.TrustedExternalTenants != nil { 588 objectMap["trustedExternalTenants"] = cp.TrustedExternalTenants 589 } 590 if cp.OptimizedAutoscale != nil { 591 objectMap["optimizedAutoscale"] = cp.OptimizedAutoscale 592 } 593 if cp.EnableDiskEncryption != nil { 594 objectMap["enableDiskEncryption"] = cp.EnableDiskEncryption 595 } 596 if cp.EnableStreamingIngest != nil { 597 objectMap["enableStreamingIngest"] = cp.EnableStreamingIngest 598 } 599 if cp.VirtualNetworkConfiguration != nil { 600 objectMap["virtualNetworkConfiguration"] = cp.VirtualNetworkConfiguration 601 } 602 if cp.KeyVaultProperties != nil { 603 objectMap["keyVaultProperties"] = cp.KeyVaultProperties 604 } 605 return json.Marshal(objectMap) 606} 607 608// ClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 609// operation. 610type ClustersCreateOrUpdateFuture struct { 611 azure.FutureAPI 612 // Result returns the result of the asynchronous operation. 613 // If the operation has not completed it will return an error. 614 Result func(ClustersClient) (Cluster, error) 615} 616 617// ClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 618// operation. 619type ClustersDeleteFuture struct { 620 azure.FutureAPI 621 // Result returns the result of the asynchronous operation. 622 // If the operation has not completed it will return an error. 623 Result func(ClustersClient) (autorest.Response, error) 624} 625 626// ClustersDetachFollowerDatabasesFuture an abstraction for monitoring and retrieving the results of a 627// long-running operation. 628type ClustersDetachFollowerDatabasesFuture struct { 629 azure.FutureAPI 630 // Result returns the result of the asynchronous operation. 631 // If the operation has not completed it will return an error. 632 Result func(ClustersClient) (autorest.Response, error) 633} 634 635// ClustersDiagnoseVirtualNetworkFuture an abstraction for monitoring and retrieving the results of a 636// long-running operation. 637type ClustersDiagnoseVirtualNetworkFuture struct { 638 azure.FutureAPI 639 // Result returns the result of the asynchronous operation. 640 // If the operation has not completed it will return an error. 641 Result func(ClustersClient) (DiagnoseVirtualNetworkResult, error) 642} 643 644// ClustersStartFuture an abstraction for monitoring and retrieving the results of a long-running 645// operation. 646type ClustersStartFuture struct { 647 azure.FutureAPI 648 // Result returns the result of the asynchronous operation. 649 // If the operation has not completed it will return an error. 650 Result func(ClustersClient) (autorest.Response, error) 651} 652 653// ClustersStopFuture an abstraction for monitoring and retrieving the results of a long-running operation. 654type ClustersStopFuture struct { 655 azure.FutureAPI 656 // Result returns the result of the asynchronous operation. 657 // If the operation has not completed it will return an error. 658 Result func(ClustersClient) (autorest.Response, error) 659} 660 661// ClustersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 662// operation. 663type ClustersUpdateFuture struct { 664 azure.FutureAPI 665 // Result returns the result of the asynchronous operation. 666 // If the operation has not completed it will return an error. 667 Result func(ClustersClient) (Cluster, error) 668} 669 670// ClusterUpdate class representing an update to a Kusto cluster. 671type ClusterUpdate struct { 672 // Tags - Resource tags. 673 Tags map[string]*string `json:"tags"` 674 // Location - Resource location. 675 Location *string `json:"location,omitempty"` 676 // Sku - The SKU of the cluster. 677 Sku *AzureSku `json:"sku,omitempty"` 678 // Identity - The identity of the cluster, if configured. 679 Identity *Identity `json:"identity,omitempty"` 680 // ClusterProperties - The cluster properties. 681 *ClusterProperties `json:"properties,omitempty"` 682 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 683 ID *string `json:"id,omitempty"` 684 // Name - READ-ONLY; The name of the resource 685 Name *string `json:"name,omitempty"` 686 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 687 Type *string `json:"type,omitempty"` 688} 689 690// MarshalJSON is the custom marshaler for ClusterUpdate. 691func (cu ClusterUpdate) MarshalJSON() ([]byte, error) { 692 objectMap := make(map[string]interface{}) 693 if cu.Tags != nil { 694 objectMap["tags"] = cu.Tags 695 } 696 if cu.Location != nil { 697 objectMap["location"] = cu.Location 698 } 699 if cu.Sku != nil { 700 objectMap["sku"] = cu.Sku 701 } 702 if cu.Identity != nil { 703 objectMap["identity"] = cu.Identity 704 } 705 if cu.ClusterProperties != nil { 706 objectMap["properties"] = cu.ClusterProperties 707 } 708 return json.Marshal(objectMap) 709} 710 711// UnmarshalJSON is the custom unmarshaler for ClusterUpdate struct. 712func (cu *ClusterUpdate) UnmarshalJSON(body []byte) error { 713 var m map[string]*json.RawMessage 714 err := json.Unmarshal(body, &m) 715 if err != nil { 716 return err 717 } 718 for k, v := range m { 719 switch k { 720 case "tags": 721 if v != nil { 722 var tags map[string]*string 723 err = json.Unmarshal(*v, &tags) 724 if err != nil { 725 return err 726 } 727 cu.Tags = tags 728 } 729 case "location": 730 if v != nil { 731 var location string 732 err = json.Unmarshal(*v, &location) 733 if err != nil { 734 return err 735 } 736 cu.Location = &location 737 } 738 case "sku": 739 if v != nil { 740 var sku AzureSku 741 err = json.Unmarshal(*v, &sku) 742 if err != nil { 743 return err 744 } 745 cu.Sku = &sku 746 } 747 case "identity": 748 if v != nil { 749 var identity Identity 750 err = json.Unmarshal(*v, &identity) 751 if err != nil { 752 return err 753 } 754 cu.Identity = &identity 755 } 756 case "properties": 757 if v != nil { 758 var clusterProperties ClusterProperties 759 err = json.Unmarshal(*v, &clusterProperties) 760 if err != nil { 761 return err 762 } 763 cu.ClusterProperties = &clusterProperties 764 } 765 case "id": 766 if v != nil { 767 var ID string 768 err = json.Unmarshal(*v, &ID) 769 if err != nil { 770 return err 771 } 772 cu.ID = &ID 773 } 774 case "name": 775 if v != nil { 776 var name string 777 err = json.Unmarshal(*v, &name) 778 if err != nil { 779 return err 780 } 781 cu.Name = &name 782 } 783 case "type": 784 if v != nil { 785 var typeVar string 786 err = json.Unmarshal(*v, &typeVar) 787 if err != nil { 788 return err 789 } 790 cu.Type = &typeVar 791 } 792 } 793 } 794 795 return nil 796} 797 798// BasicDatabase class representing a Kusto database. 799type BasicDatabase interface { 800 AsReadWriteDatabase() (*ReadWriteDatabase, bool) 801 AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) 802 AsDatabase() (*Database, bool) 803} 804 805// Database class representing a Kusto database. 806type Database struct { 807 autorest.Response `json:"-"` 808 // Location - Resource location. 809 Location *string `json:"location,omitempty"` 810 // Kind - Possible values include: 'KindDatabase', 'KindReadWrite', 'KindReadOnlyFollowing' 811 Kind Kind `json:"kind,omitempty"` 812 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 813 ID *string `json:"id,omitempty"` 814 // Name - READ-ONLY; The name of the resource 815 Name *string `json:"name,omitempty"` 816 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 817 Type *string `json:"type,omitempty"` 818} 819 820func unmarshalBasicDatabase(body []byte) (BasicDatabase, error) { 821 var m map[string]interface{} 822 err := json.Unmarshal(body, &m) 823 if err != nil { 824 return nil, err 825 } 826 827 switch m["kind"] { 828 case string(KindReadWrite): 829 var rwd ReadWriteDatabase 830 err := json.Unmarshal(body, &rwd) 831 return rwd, err 832 case string(KindReadOnlyFollowing): 833 var rofd ReadOnlyFollowingDatabase 834 err := json.Unmarshal(body, &rofd) 835 return rofd, err 836 default: 837 var d Database 838 err := json.Unmarshal(body, &d) 839 return d, err 840 } 841} 842func unmarshalBasicDatabaseArray(body []byte) ([]BasicDatabase, error) { 843 var rawMessages []*json.RawMessage 844 err := json.Unmarshal(body, &rawMessages) 845 if err != nil { 846 return nil, err 847 } 848 849 dArray := make([]BasicDatabase, len(rawMessages)) 850 851 for index, rawMessage := range rawMessages { 852 d, err := unmarshalBasicDatabase(*rawMessage) 853 if err != nil { 854 return nil, err 855 } 856 dArray[index] = d 857 } 858 return dArray, nil 859} 860 861// MarshalJSON is the custom marshaler for Database. 862func (d Database) MarshalJSON() ([]byte, error) { 863 d.Kind = KindDatabase 864 objectMap := make(map[string]interface{}) 865 if d.Location != nil { 866 objectMap["location"] = d.Location 867 } 868 if d.Kind != "" { 869 objectMap["kind"] = d.Kind 870 } 871 return json.Marshal(objectMap) 872} 873 874// AsReadWriteDatabase is the BasicDatabase implementation for Database. 875func (d Database) AsReadWriteDatabase() (*ReadWriteDatabase, bool) { 876 return nil, false 877} 878 879// AsReadOnlyFollowingDatabase is the BasicDatabase implementation for Database. 880func (d Database) AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) { 881 return nil, false 882} 883 884// AsDatabase is the BasicDatabase implementation for Database. 885func (d Database) AsDatabase() (*Database, bool) { 886 return &d, true 887} 888 889// AsBasicDatabase is the BasicDatabase implementation for Database. 890func (d Database) AsBasicDatabase() (BasicDatabase, bool) { 891 return &d, true 892} 893 894// DatabaseListResult the list Kusto databases operation response. 895type DatabaseListResult struct { 896 autorest.Response `json:"-"` 897 // Value - The list of Kusto databases. 898 Value *[]BasicDatabase `json:"value,omitempty"` 899} 900 901// UnmarshalJSON is the custom unmarshaler for DatabaseListResult struct. 902func (dlr *DatabaseListResult) UnmarshalJSON(body []byte) error { 903 var m map[string]*json.RawMessage 904 err := json.Unmarshal(body, &m) 905 if err != nil { 906 return err 907 } 908 for k, v := range m { 909 switch k { 910 case "value": 911 if v != nil { 912 value, err := unmarshalBasicDatabaseArray(*v) 913 if err != nil { 914 return err 915 } 916 dlr.Value = &value 917 } 918 } 919 } 920 921 return nil 922} 923 924// DatabaseModel ... 925type DatabaseModel struct { 926 autorest.Response `json:"-"` 927 Value BasicDatabase `json:"value,omitempty"` 928} 929 930// UnmarshalJSON is the custom unmarshaler for DatabaseModel struct. 931func (dm *DatabaseModel) UnmarshalJSON(body []byte) error { 932 d, err := unmarshalBasicDatabase(body) 933 if err != nil { 934 return err 935 } 936 dm.Value = d 937 938 return nil 939} 940 941// DatabasePrincipal a class representing database principal entity. 942type DatabasePrincipal struct { 943 // Role - Database principal role. Possible values include: 'Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer' 944 Role DatabasePrincipalRole `json:"role,omitempty"` 945 // Name - Database principal name. 946 Name *string `json:"name,omitempty"` 947 // Type - Database principal type. Possible values include: 'DatabasePrincipalTypeApp', 'DatabasePrincipalTypeGroup', 'DatabasePrincipalTypeUser' 948 Type DatabasePrincipalType `json:"type,omitempty"` 949 // Fqn - Database principal fully qualified name. 950 Fqn *string `json:"fqn,omitempty"` 951 // Email - Database principal email if exists. 952 Email *string `json:"email,omitempty"` 953 // AppID - Application id - relevant only for application principal type. 954 AppID *string `json:"appId,omitempty"` 955 // TenantName - READ-ONLY; The tenant name of the principal 956 TenantName *string `json:"tenantName,omitempty"` 957} 958 959// MarshalJSON is the custom marshaler for DatabasePrincipal. 960func (dp DatabasePrincipal) MarshalJSON() ([]byte, error) { 961 objectMap := make(map[string]interface{}) 962 if dp.Role != "" { 963 objectMap["role"] = dp.Role 964 } 965 if dp.Name != nil { 966 objectMap["name"] = dp.Name 967 } 968 if dp.Type != "" { 969 objectMap["type"] = dp.Type 970 } 971 if dp.Fqn != nil { 972 objectMap["fqn"] = dp.Fqn 973 } 974 if dp.Email != nil { 975 objectMap["email"] = dp.Email 976 } 977 if dp.AppID != nil { 978 objectMap["appId"] = dp.AppID 979 } 980 return json.Marshal(objectMap) 981} 982 983// DatabasePrincipalAssignment class representing a database principal assignment. 984type DatabasePrincipalAssignment struct { 985 autorest.Response `json:"-"` 986 // DatabasePrincipalProperties - The database principal. 987 *DatabasePrincipalProperties `json:"properties,omitempty"` 988 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 989 ID *string `json:"id,omitempty"` 990 // Name - READ-ONLY; The name of the resource 991 Name *string `json:"name,omitempty"` 992 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 993 Type *string `json:"type,omitempty"` 994} 995 996// MarshalJSON is the custom marshaler for DatabasePrincipalAssignment. 997func (dpa DatabasePrincipalAssignment) MarshalJSON() ([]byte, error) { 998 objectMap := make(map[string]interface{}) 999 if dpa.DatabasePrincipalProperties != nil { 1000 objectMap["properties"] = dpa.DatabasePrincipalProperties 1001 } 1002 return json.Marshal(objectMap) 1003} 1004 1005// UnmarshalJSON is the custom unmarshaler for DatabasePrincipalAssignment struct. 1006func (dpa *DatabasePrincipalAssignment) UnmarshalJSON(body []byte) error { 1007 var m map[string]*json.RawMessage 1008 err := json.Unmarshal(body, &m) 1009 if err != nil { 1010 return err 1011 } 1012 for k, v := range m { 1013 switch k { 1014 case "properties": 1015 if v != nil { 1016 var databasePrincipalProperties DatabasePrincipalProperties 1017 err = json.Unmarshal(*v, &databasePrincipalProperties) 1018 if err != nil { 1019 return err 1020 } 1021 dpa.DatabasePrincipalProperties = &databasePrincipalProperties 1022 } 1023 case "id": 1024 if v != nil { 1025 var ID string 1026 err = json.Unmarshal(*v, &ID) 1027 if err != nil { 1028 return err 1029 } 1030 dpa.ID = &ID 1031 } 1032 case "name": 1033 if v != nil { 1034 var name string 1035 err = json.Unmarshal(*v, &name) 1036 if err != nil { 1037 return err 1038 } 1039 dpa.Name = &name 1040 } 1041 case "type": 1042 if v != nil { 1043 var typeVar string 1044 err = json.Unmarshal(*v, &typeVar) 1045 if err != nil { 1046 return err 1047 } 1048 dpa.Type = &typeVar 1049 } 1050 } 1051 } 1052 1053 return nil 1054} 1055 1056// DatabasePrincipalAssignmentCheckNameRequest a principal assignment check name availability request. 1057type DatabasePrincipalAssignmentCheckNameRequest struct { 1058 // Name - Principal Assignment resource name. 1059 Name *string `json:"name,omitempty"` 1060 // Type - The type of resource, Microsoft.Kusto/clusters/databases/principalAssignments. 1061 Type *string `json:"type,omitempty"` 1062} 1063 1064// DatabasePrincipalAssignmentListResult the list Kusto database principal assignments operation response. 1065type DatabasePrincipalAssignmentListResult struct { 1066 autorest.Response `json:"-"` 1067 // Value - The list of Kusto database principal assignments. 1068 Value *[]DatabasePrincipalAssignment `json:"value,omitempty"` 1069} 1070 1071// DatabasePrincipalAssignmentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the 1072// results of a long-running operation. 1073type DatabasePrincipalAssignmentsCreateOrUpdateFuture struct { 1074 azure.FutureAPI 1075 // Result returns the result of the asynchronous operation. 1076 // If the operation has not completed it will return an error. 1077 Result func(DatabasePrincipalAssignmentsClient) (DatabasePrincipalAssignment, error) 1078} 1079 1080// DatabasePrincipalAssignmentsDeleteFuture an abstraction for monitoring and retrieving the results of a 1081// long-running operation. 1082type DatabasePrincipalAssignmentsDeleteFuture struct { 1083 azure.FutureAPI 1084 // Result returns the result of the asynchronous operation. 1085 // If the operation has not completed it will return an error. 1086 Result func(DatabasePrincipalAssignmentsClient) (autorest.Response, error) 1087} 1088 1089// DatabasePrincipalListRequest the list Kusto database principals operation request. 1090type DatabasePrincipalListRequest struct { 1091 // Value - The list of Kusto database principals. 1092 Value *[]DatabasePrincipal `json:"value,omitempty"` 1093} 1094 1095// DatabasePrincipalListResult the list Kusto database principals operation response. 1096type DatabasePrincipalListResult struct { 1097 autorest.Response `json:"-"` 1098 // Value - The list of Kusto database principals. 1099 Value *[]DatabasePrincipal `json:"value,omitempty"` 1100} 1101 1102// DatabasePrincipalProperties a class representing database principal property. 1103type DatabasePrincipalProperties struct { 1104 // PrincipalID - The principal ID assigned to the database principal. It can be a user email, application ID, or security group name. 1105 PrincipalID *string `json:"principalId,omitempty"` 1106 // Role - Database principal role. Possible values include: 'Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer' 1107 Role DatabasePrincipalRole `json:"role,omitempty"` 1108 // TenantID - The tenant id of the principal 1109 TenantID *string `json:"tenantId,omitempty"` 1110 // PrincipalType - Principal type. Possible values include: 'PrincipalTypeApp', 'PrincipalTypeGroup', 'PrincipalTypeUser' 1111 PrincipalType PrincipalType `json:"principalType,omitempty"` 1112 // TenantName - READ-ONLY; The tenant name of the principal 1113 TenantName *string `json:"tenantName,omitempty"` 1114 // PrincipalName - READ-ONLY; The principal name 1115 PrincipalName *string `json:"principalName,omitempty"` 1116 // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' 1117 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 1118} 1119 1120// MarshalJSON is the custom marshaler for DatabasePrincipalProperties. 1121func (dpp DatabasePrincipalProperties) MarshalJSON() ([]byte, error) { 1122 objectMap := make(map[string]interface{}) 1123 if dpp.PrincipalID != nil { 1124 objectMap["principalId"] = dpp.PrincipalID 1125 } 1126 if dpp.Role != "" { 1127 objectMap["role"] = dpp.Role 1128 } 1129 if dpp.TenantID != nil { 1130 objectMap["tenantId"] = dpp.TenantID 1131 } 1132 if dpp.PrincipalType != "" { 1133 objectMap["principalType"] = dpp.PrincipalType 1134 } 1135 return json.Marshal(objectMap) 1136} 1137 1138// DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1139// operation. 1140type DatabasesCreateOrUpdateFuture struct { 1141 azure.FutureAPI 1142 // Result returns the result of the asynchronous operation. 1143 // If the operation has not completed it will return an error. 1144 Result func(DatabasesClient) (DatabaseModel, error) 1145} 1146 1147// DatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1148// operation. 1149type DatabasesDeleteFuture struct { 1150 azure.FutureAPI 1151 // Result returns the result of the asynchronous operation. 1152 // If the operation has not completed it will return an error. 1153 Result func(DatabasesClient) (autorest.Response, error) 1154} 1155 1156// DatabaseStatistics a class that contains database statistics information. 1157type DatabaseStatistics struct { 1158 // Size - The database size - the total size of compressed data and index in bytes. 1159 Size *float64 `json:"size,omitempty"` 1160} 1161 1162// DatabasesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1163// operation. 1164type DatabasesUpdateFuture struct { 1165 azure.FutureAPI 1166 // Result returns the result of the asynchronous operation. 1167 // If the operation has not completed it will return an error. 1168 Result func(DatabasesClient) (DatabaseModel, error) 1169} 1170 1171// BasicDataConnection class representing an data connection. 1172type BasicDataConnection interface { 1173 AsEventHubDataConnection() (*EventHubDataConnection, bool) 1174 AsIotHubDataConnection() (*IotHubDataConnection, bool) 1175 AsEventGridDataConnection() (*EventGridDataConnection, bool) 1176 AsDataConnection() (*DataConnection, bool) 1177} 1178 1179// DataConnection class representing an data connection. 1180type DataConnection struct { 1181 autorest.Response `json:"-"` 1182 // Location - Resource location. 1183 Location *string `json:"location,omitempty"` 1184 // Kind - Possible values include: 'KindDataConnection', 'KindEventHub', 'KindIotHub', 'KindEventGrid' 1185 Kind KindBasicDataConnection `json:"kind,omitempty"` 1186 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1187 ID *string `json:"id,omitempty"` 1188 // Name - READ-ONLY; The name of the resource 1189 Name *string `json:"name,omitempty"` 1190 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 1191 Type *string `json:"type,omitempty"` 1192} 1193 1194func unmarshalBasicDataConnection(body []byte) (BasicDataConnection, error) { 1195 var m map[string]interface{} 1196 err := json.Unmarshal(body, &m) 1197 if err != nil { 1198 return nil, err 1199 } 1200 1201 switch m["kind"] { 1202 case string(KindEventHub): 1203 var ehdc EventHubDataConnection 1204 err := json.Unmarshal(body, &ehdc) 1205 return ehdc, err 1206 case string(KindIotHub): 1207 var ihdc IotHubDataConnection 1208 err := json.Unmarshal(body, &ihdc) 1209 return ihdc, err 1210 case string(KindEventGrid): 1211 var egdc EventGridDataConnection 1212 err := json.Unmarshal(body, &egdc) 1213 return egdc, err 1214 default: 1215 var dc DataConnection 1216 err := json.Unmarshal(body, &dc) 1217 return dc, err 1218 } 1219} 1220func unmarshalBasicDataConnectionArray(body []byte) ([]BasicDataConnection, error) { 1221 var rawMessages []*json.RawMessage 1222 err := json.Unmarshal(body, &rawMessages) 1223 if err != nil { 1224 return nil, err 1225 } 1226 1227 dcArray := make([]BasicDataConnection, len(rawMessages)) 1228 1229 for index, rawMessage := range rawMessages { 1230 dc, err := unmarshalBasicDataConnection(*rawMessage) 1231 if err != nil { 1232 return nil, err 1233 } 1234 dcArray[index] = dc 1235 } 1236 return dcArray, nil 1237} 1238 1239// MarshalJSON is the custom marshaler for DataConnection. 1240func (dc DataConnection) MarshalJSON() ([]byte, error) { 1241 dc.Kind = KindDataConnection 1242 objectMap := make(map[string]interface{}) 1243 if dc.Location != nil { 1244 objectMap["location"] = dc.Location 1245 } 1246 if dc.Kind != "" { 1247 objectMap["kind"] = dc.Kind 1248 } 1249 return json.Marshal(objectMap) 1250} 1251 1252// AsEventHubDataConnection is the BasicDataConnection implementation for DataConnection. 1253func (dc DataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) { 1254 return nil, false 1255} 1256 1257// AsIotHubDataConnection is the BasicDataConnection implementation for DataConnection. 1258func (dc DataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) { 1259 return nil, false 1260} 1261 1262// AsEventGridDataConnection is the BasicDataConnection implementation for DataConnection. 1263func (dc DataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) { 1264 return nil, false 1265} 1266 1267// AsDataConnection is the BasicDataConnection implementation for DataConnection. 1268func (dc DataConnection) AsDataConnection() (*DataConnection, bool) { 1269 return &dc, true 1270} 1271 1272// AsBasicDataConnection is the BasicDataConnection implementation for DataConnection. 1273func (dc DataConnection) AsBasicDataConnection() (BasicDataConnection, bool) { 1274 return &dc, true 1275} 1276 1277// DataConnectionCheckNameRequest a data connection check name availability request. 1278type DataConnectionCheckNameRequest struct { 1279 // Name - Data Connection name. 1280 Name *string `json:"name,omitempty"` 1281 // Type - The type of resource, Microsoft.Kusto/clusters/databases/dataConnections. 1282 Type *string `json:"type,omitempty"` 1283} 1284 1285// DataConnectionListResult the list Kusto data connections operation response. 1286type DataConnectionListResult struct { 1287 autorest.Response `json:"-"` 1288 // Value - The list of Kusto data connections. 1289 Value *[]BasicDataConnection `json:"value,omitempty"` 1290} 1291 1292// UnmarshalJSON is the custom unmarshaler for DataConnectionListResult struct. 1293func (dclr *DataConnectionListResult) UnmarshalJSON(body []byte) error { 1294 var m map[string]*json.RawMessage 1295 err := json.Unmarshal(body, &m) 1296 if err != nil { 1297 return err 1298 } 1299 for k, v := range m { 1300 switch k { 1301 case "value": 1302 if v != nil { 1303 value, err := unmarshalBasicDataConnectionArray(*v) 1304 if err != nil { 1305 return err 1306 } 1307 dclr.Value = &value 1308 } 1309 } 1310 } 1311 1312 return nil 1313} 1314 1315// DataConnectionModel ... 1316type DataConnectionModel struct { 1317 autorest.Response `json:"-"` 1318 Value BasicDataConnection `json:"value,omitempty"` 1319} 1320 1321// UnmarshalJSON is the custom unmarshaler for DataConnectionModel struct. 1322func (dcm *DataConnectionModel) UnmarshalJSON(body []byte) error { 1323 dc, err := unmarshalBasicDataConnection(body) 1324 if err != nil { 1325 return err 1326 } 1327 dcm.Value = dc 1328 1329 return nil 1330} 1331 1332// DataConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 1333// long-running operation. 1334type DataConnectionsCreateOrUpdateFuture struct { 1335 azure.FutureAPI 1336 // Result returns the result of the asynchronous operation. 1337 // If the operation has not completed it will return an error. 1338 Result func(DataConnectionsClient) (DataConnectionModel, error) 1339} 1340 1341// DataConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1342// operation. 1343type DataConnectionsDeleteFuture struct { 1344 azure.FutureAPI 1345 // Result returns the result of the asynchronous operation. 1346 // If the operation has not completed it will return an error. 1347 Result func(DataConnectionsClient) (autorest.Response, error) 1348} 1349 1350// DataConnectionsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1351// operation. 1352type DataConnectionsUpdateFuture struct { 1353 azure.FutureAPI 1354 // Result returns the result of the asynchronous operation. 1355 // If the operation has not completed it will return an error. 1356 Result func(DataConnectionsClient) (DataConnectionModel, error) 1357} 1358 1359// DataConnectionValidation class representing an data connection validation. 1360type DataConnectionValidation struct { 1361 // DataConnectionName - The name of the data connection. 1362 DataConnectionName *string `json:"dataConnectionName,omitempty"` 1363 // Properties - The data connection properties to validate. 1364 Properties BasicDataConnection `json:"properties,omitempty"` 1365} 1366 1367// UnmarshalJSON is the custom unmarshaler for DataConnectionValidation struct. 1368func (dcv *DataConnectionValidation) UnmarshalJSON(body []byte) error { 1369 var m map[string]*json.RawMessage 1370 err := json.Unmarshal(body, &m) 1371 if err != nil { 1372 return err 1373 } 1374 for k, v := range m { 1375 switch k { 1376 case "dataConnectionName": 1377 if v != nil { 1378 var dataConnectionName string 1379 err = json.Unmarshal(*v, &dataConnectionName) 1380 if err != nil { 1381 return err 1382 } 1383 dcv.DataConnectionName = &dataConnectionName 1384 } 1385 case "properties": 1386 if v != nil { 1387 properties, err := unmarshalBasicDataConnection(*v) 1388 if err != nil { 1389 return err 1390 } 1391 dcv.Properties = properties 1392 } 1393 } 1394 } 1395 1396 return nil 1397} 1398 1399// DataConnectionValidationListResult the list Kusto data connection validation result. 1400type DataConnectionValidationListResult struct { 1401 autorest.Response `json:"-"` 1402 // Value - The list of Kusto data connection validation errors. 1403 Value *[]DataConnectionValidationResult `json:"value,omitempty"` 1404} 1405 1406// DataConnectionValidationResult the result returned from a data connection validation request. 1407type DataConnectionValidationResult struct { 1408 // ErrorMessage - A message which indicates a problem in data connection validation. 1409 ErrorMessage *string `json:"errorMessage,omitempty"` 1410} 1411 1412// DiagnoseVirtualNetworkResult ... 1413type DiagnoseVirtualNetworkResult struct { 1414 autorest.Response `json:"-"` 1415 // Findings - The list of network connectivity diagnostic finding 1416 Findings *[]string `json:"findings,omitempty"` 1417} 1418 1419// EventGridConnectionProperties class representing the Kusto event grid connection properties. 1420type EventGridConnectionProperties struct { 1421 // StorageAccountResourceID - The resource ID of the storage account where the data resides. 1422 StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"` 1423 // EventHubResourceID - The resource ID where the event grid is configured to send events. 1424 EventHubResourceID *string `json:"eventHubResourceId,omitempty"` 1425 // ConsumerGroup - The event hub consumer group. 1426 ConsumerGroup *string `json:"consumerGroup,omitempty"` 1427 // TableName - The table where the data should be ingested. Optionally the table information can be added to each message. 1428 TableName *string `json:"tableName,omitempty"` 1429 // MappingRuleName - The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. 1430 MappingRuleName *string `json:"mappingRuleName,omitempty"` 1431 // 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' 1432 DataFormat EventGridDataFormat `json:"dataFormat,omitempty"` 1433} 1434 1435// EventGridDataConnection class representing an Event Grid data connection. 1436type EventGridDataConnection struct { 1437 // EventGridConnectionProperties - The properties of the Event Grid data connection. 1438 *EventGridConnectionProperties `json:"properties,omitempty"` 1439 // Location - Resource location. 1440 Location *string `json:"location,omitempty"` 1441 // Kind - Possible values include: 'KindDataConnection', 'KindEventHub', 'KindIotHub', 'KindEventGrid' 1442 Kind KindBasicDataConnection `json:"kind,omitempty"` 1443 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1444 ID *string `json:"id,omitempty"` 1445 // Name - READ-ONLY; The name of the resource 1446 Name *string `json:"name,omitempty"` 1447 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 1448 Type *string `json:"type,omitempty"` 1449} 1450 1451// MarshalJSON is the custom marshaler for EventGridDataConnection. 1452func (egdc EventGridDataConnection) MarshalJSON() ([]byte, error) { 1453 egdc.Kind = KindEventGrid 1454 objectMap := make(map[string]interface{}) 1455 if egdc.EventGridConnectionProperties != nil { 1456 objectMap["properties"] = egdc.EventGridConnectionProperties 1457 } 1458 if egdc.Location != nil { 1459 objectMap["location"] = egdc.Location 1460 } 1461 if egdc.Kind != "" { 1462 objectMap["kind"] = egdc.Kind 1463 } 1464 return json.Marshal(objectMap) 1465} 1466 1467// AsEventHubDataConnection is the BasicDataConnection implementation for EventGridDataConnection. 1468func (egdc EventGridDataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) { 1469 return nil, false 1470} 1471 1472// AsIotHubDataConnection is the BasicDataConnection implementation for EventGridDataConnection. 1473func (egdc EventGridDataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) { 1474 return nil, false 1475} 1476 1477// AsEventGridDataConnection is the BasicDataConnection implementation for EventGridDataConnection. 1478func (egdc EventGridDataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) { 1479 return &egdc, true 1480} 1481 1482// AsDataConnection is the BasicDataConnection implementation for EventGridDataConnection. 1483func (egdc EventGridDataConnection) AsDataConnection() (*DataConnection, bool) { 1484 return nil, false 1485} 1486 1487// AsBasicDataConnection is the BasicDataConnection implementation for EventGridDataConnection. 1488func (egdc EventGridDataConnection) AsBasicDataConnection() (BasicDataConnection, bool) { 1489 return &egdc, true 1490} 1491 1492// UnmarshalJSON is the custom unmarshaler for EventGridDataConnection struct. 1493func (egdc *EventGridDataConnection) UnmarshalJSON(body []byte) error { 1494 var m map[string]*json.RawMessage 1495 err := json.Unmarshal(body, &m) 1496 if err != nil { 1497 return err 1498 } 1499 for k, v := range m { 1500 switch k { 1501 case "properties": 1502 if v != nil { 1503 var eventGridConnectionProperties EventGridConnectionProperties 1504 err = json.Unmarshal(*v, &eventGridConnectionProperties) 1505 if err != nil { 1506 return err 1507 } 1508 egdc.EventGridConnectionProperties = &eventGridConnectionProperties 1509 } 1510 case "location": 1511 if v != nil { 1512 var location string 1513 err = json.Unmarshal(*v, &location) 1514 if err != nil { 1515 return err 1516 } 1517 egdc.Location = &location 1518 } 1519 case "kind": 1520 if v != nil { 1521 var kind KindBasicDataConnection 1522 err = json.Unmarshal(*v, &kind) 1523 if err != nil { 1524 return err 1525 } 1526 egdc.Kind = kind 1527 } 1528 case "id": 1529 if v != nil { 1530 var ID string 1531 err = json.Unmarshal(*v, &ID) 1532 if err != nil { 1533 return err 1534 } 1535 egdc.ID = &ID 1536 } 1537 case "name": 1538 if v != nil { 1539 var name string 1540 err = json.Unmarshal(*v, &name) 1541 if err != nil { 1542 return err 1543 } 1544 egdc.Name = &name 1545 } 1546 case "type": 1547 if v != nil { 1548 var typeVar string 1549 err = json.Unmarshal(*v, &typeVar) 1550 if err != nil { 1551 return err 1552 } 1553 egdc.Type = &typeVar 1554 } 1555 } 1556 } 1557 1558 return nil 1559} 1560 1561// EventHubConnectionProperties class representing the Kusto event hub connection properties. 1562type EventHubConnectionProperties struct { 1563 // EventHubResourceID - The resource ID of the event hub to be used to create a data connection. 1564 EventHubResourceID *string `json:"eventHubResourceId,omitempty"` 1565 // ConsumerGroup - The event hub consumer group. 1566 ConsumerGroup *string `json:"consumerGroup,omitempty"` 1567 // TableName - The table where the data should be ingested. Optionally the table information can be added to each message. 1568 TableName *string `json:"tableName,omitempty"` 1569 // MappingRuleName - The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. 1570 MappingRuleName *string `json:"mappingRuleName,omitempty"` 1571 // 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' 1572 DataFormat EventHubDataFormat `json:"dataFormat,omitempty"` 1573 // EventSystemProperties - System properties of the event hub 1574 EventSystemProperties *[]string `json:"eventSystemProperties,omitempty"` 1575 // Compression - The event hub messages compression type. Possible values include: 'CompressionNone', 'CompressionGZip' 1576 Compression Compression `json:"compression,omitempty"` 1577} 1578 1579// EventHubDataConnection class representing an event hub data connection. 1580type EventHubDataConnection struct { 1581 // EventHubConnectionProperties - The Event Hub data connection properties to validate. 1582 *EventHubConnectionProperties `json:"properties,omitempty"` 1583 // Location - Resource location. 1584 Location *string `json:"location,omitempty"` 1585 // Kind - Possible values include: 'KindDataConnection', 'KindEventHub', 'KindIotHub', 'KindEventGrid' 1586 Kind KindBasicDataConnection `json:"kind,omitempty"` 1587 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1588 ID *string `json:"id,omitempty"` 1589 // Name - READ-ONLY; The name of the resource 1590 Name *string `json:"name,omitempty"` 1591 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 1592 Type *string `json:"type,omitempty"` 1593} 1594 1595// MarshalJSON is the custom marshaler for EventHubDataConnection. 1596func (ehdc EventHubDataConnection) MarshalJSON() ([]byte, error) { 1597 ehdc.Kind = KindEventHub 1598 objectMap := make(map[string]interface{}) 1599 if ehdc.EventHubConnectionProperties != nil { 1600 objectMap["properties"] = ehdc.EventHubConnectionProperties 1601 } 1602 if ehdc.Location != nil { 1603 objectMap["location"] = ehdc.Location 1604 } 1605 if ehdc.Kind != "" { 1606 objectMap["kind"] = ehdc.Kind 1607 } 1608 return json.Marshal(objectMap) 1609} 1610 1611// AsEventHubDataConnection is the BasicDataConnection implementation for EventHubDataConnection. 1612func (ehdc EventHubDataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) { 1613 return &ehdc, true 1614} 1615 1616// AsIotHubDataConnection is the BasicDataConnection implementation for EventHubDataConnection. 1617func (ehdc EventHubDataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) { 1618 return nil, false 1619} 1620 1621// AsEventGridDataConnection is the BasicDataConnection implementation for EventHubDataConnection. 1622func (ehdc EventHubDataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) { 1623 return nil, false 1624} 1625 1626// AsDataConnection is the BasicDataConnection implementation for EventHubDataConnection. 1627func (ehdc EventHubDataConnection) AsDataConnection() (*DataConnection, bool) { 1628 return nil, false 1629} 1630 1631// AsBasicDataConnection is the BasicDataConnection implementation for EventHubDataConnection. 1632func (ehdc EventHubDataConnection) AsBasicDataConnection() (BasicDataConnection, bool) { 1633 return &ehdc, true 1634} 1635 1636// UnmarshalJSON is the custom unmarshaler for EventHubDataConnection struct. 1637func (ehdc *EventHubDataConnection) UnmarshalJSON(body []byte) error { 1638 var m map[string]*json.RawMessage 1639 err := json.Unmarshal(body, &m) 1640 if err != nil { 1641 return err 1642 } 1643 for k, v := range m { 1644 switch k { 1645 case "properties": 1646 if v != nil { 1647 var eventHubConnectionProperties EventHubConnectionProperties 1648 err = json.Unmarshal(*v, &eventHubConnectionProperties) 1649 if err != nil { 1650 return err 1651 } 1652 ehdc.EventHubConnectionProperties = &eventHubConnectionProperties 1653 } 1654 case "location": 1655 if v != nil { 1656 var location string 1657 err = json.Unmarshal(*v, &location) 1658 if err != nil { 1659 return err 1660 } 1661 ehdc.Location = &location 1662 } 1663 case "kind": 1664 if v != nil { 1665 var kind KindBasicDataConnection 1666 err = json.Unmarshal(*v, &kind) 1667 if err != nil { 1668 return err 1669 } 1670 ehdc.Kind = kind 1671 } 1672 case "id": 1673 if v != nil { 1674 var ID string 1675 err = json.Unmarshal(*v, &ID) 1676 if err != nil { 1677 return err 1678 } 1679 ehdc.ID = &ID 1680 } 1681 case "name": 1682 if v != nil { 1683 var name string 1684 err = json.Unmarshal(*v, &name) 1685 if err != nil { 1686 return err 1687 } 1688 ehdc.Name = &name 1689 } 1690 case "type": 1691 if v != nil { 1692 var typeVar string 1693 err = json.Unmarshal(*v, &typeVar) 1694 if err != nil { 1695 return err 1696 } 1697 ehdc.Type = &typeVar 1698 } 1699 } 1700 } 1701 1702 return nil 1703} 1704 1705// FollowerDatabaseDefinition a class representing follower database request. 1706type FollowerDatabaseDefinition struct { 1707 // ClusterResourceID - Resource id of the cluster that follows a database owned by this cluster. 1708 ClusterResourceID *string `json:"clusterResourceId,omitempty"` 1709 // AttachedDatabaseConfigurationName - Resource name of the attached database configuration in the follower cluster. 1710 AttachedDatabaseConfigurationName *string `json:"attachedDatabaseConfigurationName,omitempty"` 1711 // DatabaseName - READ-ONLY; The database name owned by this cluster that was followed. * in case following all databases. 1712 DatabaseName *string `json:"databaseName,omitempty"` 1713} 1714 1715// MarshalJSON is the custom marshaler for FollowerDatabaseDefinition. 1716func (fdd FollowerDatabaseDefinition) MarshalJSON() ([]byte, error) { 1717 objectMap := make(map[string]interface{}) 1718 if fdd.ClusterResourceID != nil { 1719 objectMap["clusterResourceId"] = fdd.ClusterResourceID 1720 } 1721 if fdd.AttachedDatabaseConfigurationName != nil { 1722 objectMap["attachedDatabaseConfigurationName"] = fdd.AttachedDatabaseConfigurationName 1723 } 1724 return json.Marshal(objectMap) 1725} 1726 1727// FollowerDatabaseListResult the list Kusto database principals operation response. 1728type FollowerDatabaseListResult struct { 1729 autorest.Response `json:"-"` 1730 // Value - The list of follower database result. 1731 Value *[]FollowerDatabaseDefinition `json:"value,omitempty"` 1732} 1733 1734// Identity identity for the resource. 1735type Identity struct { 1736 // PrincipalID - READ-ONLY; The principal ID of resource identity. 1737 PrincipalID *string `json:"principalId,omitempty"` 1738 // TenantID - READ-ONLY; The tenant ID of resource. 1739 TenantID *string `json:"tenantId,omitempty"` 1740 // Type - The identity type. Possible values include: 'IdentityTypeNone', 'IdentityTypeSystemAssigned' 1741 Type IdentityType `json:"type,omitempty"` 1742 // 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}'. 1743 UserAssignedIdentities map[string]*IdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` 1744} 1745 1746// MarshalJSON is the custom marshaler for Identity. 1747func (i Identity) MarshalJSON() ([]byte, error) { 1748 objectMap := make(map[string]interface{}) 1749 if i.Type != "" { 1750 objectMap["type"] = i.Type 1751 } 1752 if i.UserAssignedIdentities != nil { 1753 objectMap["userAssignedIdentities"] = i.UserAssignedIdentities 1754 } 1755 return json.Marshal(objectMap) 1756} 1757 1758// IdentityUserAssignedIdentitiesValue ... 1759type IdentityUserAssignedIdentitiesValue struct { 1760 // PrincipalID - READ-ONLY; The principal id of user assigned identity. 1761 PrincipalID *string `json:"principalId,omitempty"` 1762 // ClientID - READ-ONLY; The client id of user assigned identity. 1763 ClientID *string `json:"clientId,omitempty"` 1764} 1765 1766// IotHubConnectionProperties class representing the Kusto Iot hub connection properties. 1767type IotHubConnectionProperties struct { 1768 // IotHubResourceID - The resource ID of the Iot hub to be used to create a data connection. 1769 IotHubResourceID *string `json:"iotHubResourceId,omitempty"` 1770 // ConsumerGroup - The iot hub consumer group. 1771 ConsumerGroup *string `json:"consumerGroup,omitempty"` 1772 // TableName - The table where the data should be ingested. Optionally the table information can be added to each message. 1773 TableName *string `json:"tableName,omitempty"` 1774 // MappingRuleName - The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message. 1775 MappingRuleName *string `json:"mappingRuleName,omitempty"` 1776 // 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' 1777 DataFormat IotHubDataFormat `json:"dataFormat,omitempty"` 1778 // EventSystemProperties - System properties of the iot hub 1779 EventSystemProperties *[]string `json:"eventSystemProperties,omitempty"` 1780 // SharedAccessPolicyName - The name of the share access policy 1781 SharedAccessPolicyName *string `json:"sharedAccessPolicyName,omitempty"` 1782} 1783 1784// IotHubDataConnection class representing an iot hub data connection. 1785type IotHubDataConnection struct { 1786 // IotHubConnectionProperties - The Iot Hub data connection properties. 1787 *IotHubConnectionProperties `json:"properties,omitempty"` 1788 // Location - Resource location. 1789 Location *string `json:"location,omitempty"` 1790 // Kind - Possible values include: 'KindDataConnection', 'KindEventHub', 'KindIotHub', 'KindEventGrid' 1791 Kind KindBasicDataConnection `json:"kind,omitempty"` 1792 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 1793 ID *string `json:"id,omitempty"` 1794 // Name - READ-ONLY; The name of the resource 1795 Name *string `json:"name,omitempty"` 1796 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 1797 Type *string `json:"type,omitempty"` 1798} 1799 1800// MarshalJSON is the custom marshaler for IotHubDataConnection. 1801func (ihdc IotHubDataConnection) MarshalJSON() ([]byte, error) { 1802 ihdc.Kind = KindIotHub 1803 objectMap := make(map[string]interface{}) 1804 if ihdc.IotHubConnectionProperties != nil { 1805 objectMap["properties"] = ihdc.IotHubConnectionProperties 1806 } 1807 if ihdc.Location != nil { 1808 objectMap["location"] = ihdc.Location 1809 } 1810 if ihdc.Kind != "" { 1811 objectMap["kind"] = ihdc.Kind 1812 } 1813 return json.Marshal(objectMap) 1814} 1815 1816// AsEventHubDataConnection is the BasicDataConnection implementation for IotHubDataConnection. 1817func (ihdc IotHubDataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) { 1818 return nil, false 1819} 1820 1821// AsIotHubDataConnection is the BasicDataConnection implementation for IotHubDataConnection. 1822func (ihdc IotHubDataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) { 1823 return &ihdc, true 1824} 1825 1826// AsEventGridDataConnection is the BasicDataConnection implementation for IotHubDataConnection. 1827func (ihdc IotHubDataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) { 1828 return nil, false 1829} 1830 1831// AsDataConnection is the BasicDataConnection implementation for IotHubDataConnection. 1832func (ihdc IotHubDataConnection) AsDataConnection() (*DataConnection, bool) { 1833 return nil, false 1834} 1835 1836// AsBasicDataConnection is the BasicDataConnection implementation for IotHubDataConnection. 1837func (ihdc IotHubDataConnection) AsBasicDataConnection() (BasicDataConnection, bool) { 1838 return &ihdc, true 1839} 1840 1841// UnmarshalJSON is the custom unmarshaler for IotHubDataConnection struct. 1842func (ihdc *IotHubDataConnection) UnmarshalJSON(body []byte) error { 1843 var m map[string]*json.RawMessage 1844 err := json.Unmarshal(body, &m) 1845 if err != nil { 1846 return err 1847 } 1848 for k, v := range m { 1849 switch k { 1850 case "properties": 1851 if v != nil { 1852 var iotHubConnectionProperties IotHubConnectionProperties 1853 err = json.Unmarshal(*v, &iotHubConnectionProperties) 1854 if err != nil { 1855 return err 1856 } 1857 ihdc.IotHubConnectionProperties = &iotHubConnectionProperties 1858 } 1859 case "location": 1860 if v != nil { 1861 var location string 1862 err = json.Unmarshal(*v, &location) 1863 if err != nil { 1864 return err 1865 } 1866 ihdc.Location = &location 1867 } 1868 case "kind": 1869 if v != nil { 1870 var kind KindBasicDataConnection 1871 err = json.Unmarshal(*v, &kind) 1872 if err != nil { 1873 return err 1874 } 1875 ihdc.Kind = kind 1876 } 1877 case "id": 1878 if v != nil { 1879 var ID string 1880 err = json.Unmarshal(*v, &ID) 1881 if err != nil { 1882 return err 1883 } 1884 ihdc.ID = &ID 1885 } 1886 case "name": 1887 if v != nil { 1888 var name string 1889 err = json.Unmarshal(*v, &name) 1890 if err != nil { 1891 return err 1892 } 1893 ihdc.Name = &name 1894 } 1895 case "type": 1896 if v != nil { 1897 var typeVar string 1898 err = json.Unmarshal(*v, &typeVar) 1899 if err != nil { 1900 return err 1901 } 1902 ihdc.Type = &typeVar 1903 } 1904 } 1905 } 1906 1907 return nil 1908} 1909 1910// KeyVaultProperties properties of the key vault. 1911type KeyVaultProperties struct { 1912 // KeyName - The name of the key vault key. 1913 KeyName *string `json:"keyName,omitempty"` 1914 // KeyVersion - The version of the key vault key. 1915 KeyVersion *string `json:"keyVersion,omitempty"` 1916 // KeyVaultURI - The Uri of the key vault. 1917 KeyVaultURI *string `json:"keyVaultUri,omitempty"` 1918} 1919 1920// ListResourceSkusResult list of available SKUs for a Kusto Cluster. 1921type ListResourceSkusResult struct { 1922 autorest.Response `json:"-"` 1923 // Value - The collection of available SKUs for an existing resource. 1924 Value *[]AzureResourceSku `json:"value,omitempty"` 1925} 1926 1927// Operation ... 1928type Operation struct { 1929 // Name - This is of the format {provider}/{resource}/{operation}. 1930 Name *string `json:"name,omitempty"` 1931 Display *OperationDisplay `json:"display,omitempty"` 1932 Origin *string `json:"origin,omitempty"` 1933 Properties interface{} `json:"properties,omitempty"` 1934} 1935 1936// OperationDisplay ... 1937type OperationDisplay struct { 1938 Provider *string `json:"provider,omitempty"` 1939 // Operation - For example: read, write, delete. 1940 Operation *string `json:"operation,omitempty"` 1941 Resource *string `json:"resource,omitempty"` 1942 Description *string `json:"description,omitempty"` 1943} 1944 1945// OperationListResult ... 1946type OperationListResult struct { 1947 autorest.Response `json:"-"` 1948 Value *[]Operation `json:"value,omitempty"` 1949 NextLink *string `json:"nextLink,omitempty"` 1950} 1951 1952// OperationListResultIterator provides access to a complete listing of Operation values. 1953type OperationListResultIterator struct { 1954 i int 1955 page OperationListResultPage 1956} 1957 1958// NextWithContext advances to the next value. If there was an error making 1959// the request the iterator does not advance and the error is returned. 1960func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { 1961 if tracing.IsEnabled() { 1962 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") 1963 defer func() { 1964 sc := -1 1965 if iter.Response().Response.Response != nil { 1966 sc = iter.Response().Response.Response.StatusCode 1967 } 1968 tracing.EndSpan(ctx, sc, err) 1969 }() 1970 } 1971 iter.i++ 1972 if iter.i < len(iter.page.Values()) { 1973 return nil 1974 } 1975 err = iter.page.NextWithContext(ctx) 1976 if err != nil { 1977 iter.i-- 1978 return err 1979 } 1980 iter.i = 0 1981 return nil 1982} 1983 1984// Next advances to the next value. If there was an error making 1985// the request the iterator does not advance and the error is returned. 1986// Deprecated: Use NextWithContext() instead. 1987func (iter *OperationListResultIterator) Next() error { 1988 return iter.NextWithContext(context.Background()) 1989} 1990 1991// NotDone returns true if the enumeration should be started or is not yet complete. 1992func (iter OperationListResultIterator) NotDone() bool { 1993 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1994} 1995 1996// Response returns the raw server response from the last page request. 1997func (iter OperationListResultIterator) Response() OperationListResult { 1998 return iter.page.Response() 1999} 2000 2001// Value returns the current value or a zero-initialized value if the 2002// iterator has advanced beyond the end of the collection. 2003func (iter OperationListResultIterator) Value() Operation { 2004 if !iter.page.NotDone() { 2005 return Operation{} 2006 } 2007 return iter.page.Values()[iter.i] 2008} 2009 2010// Creates a new instance of the OperationListResultIterator type. 2011func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { 2012 return OperationListResultIterator{page: page} 2013} 2014 2015// IsEmpty returns true if the ListResult contains no values. 2016func (olr OperationListResult) IsEmpty() bool { 2017 return olr.Value == nil || len(*olr.Value) == 0 2018} 2019 2020// hasNextLink returns true if the NextLink is not empty. 2021func (olr OperationListResult) hasNextLink() bool { 2022 return olr.NextLink != nil && len(*olr.NextLink) != 0 2023} 2024 2025// operationListResultPreparer prepares a request to retrieve the next set of results. 2026// It returns nil if no more results exist. 2027func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { 2028 if !olr.hasNextLink() { 2029 return nil, nil 2030 } 2031 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2032 autorest.AsJSON(), 2033 autorest.AsGet(), 2034 autorest.WithBaseURL(to.String(olr.NextLink))) 2035} 2036 2037// OperationListResultPage contains a page of Operation values. 2038type OperationListResultPage struct { 2039 fn func(context.Context, OperationListResult) (OperationListResult, error) 2040 olr OperationListResult 2041} 2042 2043// NextWithContext advances to the next page of values. If there was an error making 2044// the request the page does not advance and the error is returned. 2045func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { 2046 if tracing.IsEnabled() { 2047 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") 2048 defer func() { 2049 sc := -1 2050 if page.Response().Response.Response != nil { 2051 sc = page.Response().Response.Response.StatusCode 2052 } 2053 tracing.EndSpan(ctx, sc, err) 2054 }() 2055 } 2056 for { 2057 next, err := page.fn(ctx, page.olr) 2058 if err != nil { 2059 return err 2060 } 2061 page.olr = next 2062 if !next.hasNextLink() || !next.IsEmpty() { 2063 break 2064 } 2065 } 2066 return nil 2067} 2068 2069// Next advances to the next page of values. If there was an error making 2070// the request the page does not advance and the error is returned. 2071// Deprecated: Use NextWithContext() instead. 2072func (page *OperationListResultPage) Next() error { 2073 return page.NextWithContext(context.Background()) 2074} 2075 2076// NotDone returns true if the page enumeration should be started or is not yet complete. 2077func (page OperationListResultPage) NotDone() bool { 2078 return !page.olr.IsEmpty() 2079} 2080 2081// Response returns the raw server response from the last page request. 2082func (page OperationListResultPage) Response() OperationListResult { 2083 return page.olr 2084} 2085 2086// Values returns the slice of values for the current page or nil if there are no values. 2087func (page OperationListResultPage) Values() []Operation { 2088 if page.olr.IsEmpty() { 2089 return nil 2090 } 2091 return *page.olr.Value 2092} 2093 2094// Creates a new instance of the OperationListResultPage type. 2095func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { 2096 return OperationListResultPage{ 2097 fn: getNextPage, 2098 olr: cur, 2099 } 2100} 2101 2102// OptimizedAutoscale a class that contains the optimized auto scale definition. 2103type OptimizedAutoscale struct { 2104 // Version - The version of the template defined, for instance 1. 2105 Version *int32 `json:"version,omitempty"` 2106 // IsEnabled - A boolean value that indicate if the optimized autoscale feature is enabled or not. 2107 IsEnabled *bool `json:"isEnabled,omitempty"` 2108 // Minimum - Minimum allowed instances count. 2109 Minimum *int32 `json:"minimum,omitempty"` 2110 // Maximum - Maximum allowed instances count. 2111 Maximum *int32 `json:"maximum,omitempty"` 2112} 2113 2114// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not 2115// have tags and a location 2116type ProxyResource struct { 2117 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 2118 ID *string `json:"id,omitempty"` 2119 // Name - READ-ONLY; The name of the resource 2120 Name *string `json:"name,omitempty"` 2121 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 2122 Type *string `json:"type,omitempty"` 2123} 2124 2125// ReadOnlyFollowingDatabase class representing a read only following database. 2126type ReadOnlyFollowingDatabase struct { 2127 // ReadOnlyFollowingDatabaseProperties - The database properties. 2128 *ReadOnlyFollowingDatabaseProperties `json:"properties,omitempty"` 2129 // Location - Resource location. 2130 Location *string `json:"location,omitempty"` 2131 // Kind - Possible values include: 'KindDatabase', 'KindReadWrite', 'KindReadOnlyFollowing' 2132 Kind Kind `json:"kind,omitempty"` 2133 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 2134 ID *string `json:"id,omitempty"` 2135 // Name - READ-ONLY; The name of the resource 2136 Name *string `json:"name,omitempty"` 2137 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 2138 Type *string `json:"type,omitempty"` 2139} 2140 2141// MarshalJSON is the custom marshaler for ReadOnlyFollowingDatabase. 2142func (rofd ReadOnlyFollowingDatabase) MarshalJSON() ([]byte, error) { 2143 rofd.Kind = KindReadOnlyFollowing 2144 objectMap := make(map[string]interface{}) 2145 if rofd.ReadOnlyFollowingDatabaseProperties != nil { 2146 objectMap["properties"] = rofd.ReadOnlyFollowingDatabaseProperties 2147 } 2148 if rofd.Location != nil { 2149 objectMap["location"] = rofd.Location 2150 } 2151 if rofd.Kind != "" { 2152 objectMap["kind"] = rofd.Kind 2153 } 2154 return json.Marshal(objectMap) 2155} 2156 2157// AsReadWriteDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase. 2158func (rofd ReadOnlyFollowingDatabase) AsReadWriteDatabase() (*ReadWriteDatabase, bool) { 2159 return nil, false 2160} 2161 2162// AsReadOnlyFollowingDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase. 2163func (rofd ReadOnlyFollowingDatabase) AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) { 2164 return &rofd, true 2165} 2166 2167// AsDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase. 2168func (rofd ReadOnlyFollowingDatabase) AsDatabase() (*Database, bool) { 2169 return nil, false 2170} 2171 2172// AsBasicDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase. 2173func (rofd ReadOnlyFollowingDatabase) AsBasicDatabase() (BasicDatabase, bool) { 2174 return &rofd, true 2175} 2176 2177// UnmarshalJSON is the custom unmarshaler for ReadOnlyFollowingDatabase struct. 2178func (rofd *ReadOnlyFollowingDatabase) UnmarshalJSON(body []byte) error { 2179 var m map[string]*json.RawMessage 2180 err := json.Unmarshal(body, &m) 2181 if err != nil { 2182 return err 2183 } 2184 for k, v := range m { 2185 switch k { 2186 case "properties": 2187 if v != nil { 2188 var readOnlyFollowingDatabaseProperties ReadOnlyFollowingDatabaseProperties 2189 err = json.Unmarshal(*v, &readOnlyFollowingDatabaseProperties) 2190 if err != nil { 2191 return err 2192 } 2193 rofd.ReadOnlyFollowingDatabaseProperties = &readOnlyFollowingDatabaseProperties 2194 } 2195 case "location": 2196 if v != nil { 2197 var location string 2198 err = json.Unmarshal(*v, &location) 2199 if err != nil { 2200 return err 2201 } 2202 rofd.Location = &location 2203 } 2204 case "kind": 2205 if v != nil { 2206 var kind Kind 2207 err = json.Unmarshal(*v, &kind) 2208 if err != nil { 2209 return err 2210 } 2211 rofd.Kind = kind 2212 } 2213 case "id": 2214 if v != nil { 2215 var ID string 2216 err = json.Unmarshal(*v, &ID) 2217 if err != nil { 2218 return err 2219 } 2220 rofd.ID = &ID 2221 } 2222 case "name": 2223 if v != nil { 2224 var name string 2225 err = json.Unmarshal(*v, &name) 2226 if err != nil { 2227 return err 2228 } 2229 rofd.Name = &name 2230 } 2231 case "type": 2232 if v != nil { 2233 var typeVar string 2234 err = json.Unmarshal(*v, &typeVar) 2235 if err != nil { 2236 return err 2237 } 2238 rofd.Type = &typeVar 2239 } 2240 } 2241 } 2242 2243 return nil 2244} 2245 2246// ReadOnlyFollowingDatabaseProperties class representing the Kusto database properties. 2247type ReadOnlyFollowingDatabaseProperties struct { 2248 // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' 2249 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 2250 // SoftDeletePeriod - READ-ONLY; The time the data should be kept before it stops being accessible to queries in TimeSpan. 2251 SoftDeletePeriod *string `json:"softDeletePeriod,omitempty"` 2252 // HotCachePeriod - The time the data should be kept in cache for fast queries in TimeSpan. 2253 HotCachePeriod *string `json:"hotCachePeriod,omitempty"` 2254 // Statistics - The statistics of the database. 2255 Statistics *DatabaseStatistics `json:"statistics,omitempty"` 2256 // LeaderClusterResourceID - READ-ONLY; The name of the leader cluster 2257 LeaderClusterResourceID *string `json:"leaderClusterResourceId,omitempty"` 2258 // AttachedDatabaseConfigurationName - READ-ONLY; The name of the attached database configuration cluster 2259 AttachedDatabaseConfigurationName *string `json:"attachedDatabaseConfigurationName,omitempty"` 2260 // PrincipalsModificationKind - READ-ONLY; The principals modification kind of the database. Possible values include: 'PrincipalsModificationKindUnion', 'PrincipalsModificationKindReplace', 'PrincipalsModificationKindNone' 2261 PrincipalsModificationKind PrincipalsModificationKind `json:"principalsModificationKind,omitempty"` 2262} 2263 2264// MarshalJSON is the custom marshaler for ReadOnlyFollowingDatabaseProperties. 2265func (rofdp ReadOnlyFollowingDatabaseProperties) MarshalJSON() ([]byte, error) { 2266 objectMap := make(map[string]interface{}) 2267 if rofdp.HotCachePeriod != nil { 2268 objectMap["hotCachePeriod"] = rofdp.HotCachePeriod 2269 } 2270 if rofdp.Statistics != nil { 2271 objectMap["statistics"] = rofdp.Statistics 2272 } 2273 return json.Marshal(objectMap) 2274} 2275 2276// ReadWriteDatabase class representing a read write database. 2277type ReadWriteDatabase struct { 2278 // ReadWriteDatabaseProperties - The database properties. 2279 *ReadWriteDatabaseProperties `json:"properties,omitempty"` 2280 // Location - Resource location. 2281 Location *string `json:"location,omitempty"` 2282 // Kind - Possible values include: 'KindDatabase', 'KindReadWrite', 'KindReadOnlyFollowing' 2283 Kind Kind `json:"kind,omitempty"` 2284 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 2285 ID *string `json:"id,omitempty"` 2286 // Name - READ-ONLY; The name of the resource 2287 Name *string `json:"name,omitempty"` 2288 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 2289 Type *string `json:"type,omitempty"` 2290} 2291 2292// MarshalJSON is the custom marshaler for ReadWriteDatabase. 2293func (rwd ReadWriteDatabase) MarshalJSON() ([]byte, error) { 2294 rwd.Kind = KindReadWrite 2295 objectMap := make(map[string]interface{}) 2296 if rwd.ReadWriteDatabaseProperties != nil { 2297 objectMap["properties"] = rwd.ReadWriteDatabaseProperties 2298 } 2299 if rwd.Location != nil { 2300 objectMap["location"] = rwd.Location 2301 } 2302 if rwd.Kind != "" { 2303 objectMap["kind"] = rwd.Kind 2304 } 2305 return json.Marshal(objectMap) 2306} 2307 2308// AsReadWriteDatabase is the BasicDatabase implementation for ReadWriteDatabase. 2309func (rwd ReadWriteDatabase) AsReadWriteDatabase() (*ReadWriteDatabase, bool) { 2310 return &rwd, true 2311} 2312 2313// AsReadOnlyFollowingDatabase is the BasicDatabase implementation for ReadWriteDatabase. 2314func (rwd ReadWriteDatabase) AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) { 2315 return nil, false 2316} 2317 2318// AsDatabase is the BasicDatabase implementation for ReadWriteDatabase. 2319func (rwd ReadWriteDatabase) AsDatabase() (*Database, bool) { 2320 return nil, false 2321} 2322 2323// AsBasicDatabase is the BasicDatabase implementation for ReadWriteDatabase. 2324func (rwd ReadWriteDatabase) AsBasicDatabase() (BasicDatabase, bool) { 2325 return &rwd, true 2326} 2327 2328// UnmarshalJSON is the custom unmarshaler for ReadWriteDatabase struct. 2329func (rwd *ReadWriteDatabase) UnmarshalJSON(body []byte) error { 2330 var m map[string]*json.RawMessage 2331 err := json.Unmarshal(body, &m) 2332 if err != nil { 2333 return err 2334 } 2335 for k, v := range m { 2336 switch k { 2337 case "properties": 2338 if v != nil { 2339 var readWriteDatabaseProperties ReadWriteDatabaseProperties 2340 err = json.Unmarshal(*v, &readWriteDatabaseProperties) 2341 if err != nil { 2342 return err 2343 } 2344 rwd.ReadWriteDatabaseProperties = &readWriteDatabaseProperties 2345 } 2346 case "location": 2347 if v != nil { 2348 var location string 2349 err = json.Unmarshal(*v, &location) 2350 if err != nil { 2351 return err 2352 } 2353 rwd.Location = &location 2354 } 2355 case "kind": 2356 if v != nil { 2357 var kind Kind 2358 err = json.Unmarshal(*v, &kind) 2359 if err != nil { 2360 return err 2361 } 2362 rwd.Kind = kind 2363 } 2364 case "id": 2365 if v != nil { 2366 var ID string 2367 err = json.Unmarshal(*v, &ID) 2368 if err != nil { 2369 return err 2370 } 2371 rwd.ID = &ID 2372 } 2373 case "name": 2374 if v != nil { 2375 var name string 2376 err = json.Unmarshal(*v, &name) 2377 if err != nil { 2378 return err 2379 } 2380 rwd.Name = &name 2381 } 2382 case "type": 2383 if v != nil { 2384 var typeVar string 2385 err = json.Unmarshal(*v, &typeVar) 2386 if err != nil { 2387 return err 2388 } 2389 rwd.Type = &typeVar 2390 } 2391 } 2392 } 2393 2394 return nil 2395} 2396 2397// ReadWriteDatabaseProperties class representing the Kusto database properties. 2398type ReadWriteDatabaseProperties struct { 2399 // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving' 2400 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 2401 // SoftDeletePeriod - The time the data should be kept before it stops being accessible to queries in TimeSpan. 2402 SoftDeletePeriod *string `json:"softDeletePeriod,omitempty"` 2403 // HotCachePeriod - The time the data should be kept in cache for fast queries in TimeSpan. 2404 HotCachePeriod *string `json:"hotCachePeriod,omitempty"` 2405 // Statistics - The statistics of the database. 2406 Statistics *DatabaseStatistics `json:"statistics,omitempty"` 2407 // IsFollowed - READ-ONLY; Indicates whether the database is followed. 2408 IsFollowed *string `json:"isFollowed,omitempty"` 2409} 2410 2411// MarshalJSON is the custom marshaler for ReadWriteDatabaseProperties. 2412func (rwdp ReadWriteDatabaseProperties) MarshalJSON() ([]byte, error) { 2413 objectMap := make(map[string]interface{}) 2414 if rwdp.SoftDeletePeriod != nil { 2415 objectMap["softDeletePeriod"] = rwdp.SoftDeletePeriod 2416 } 2417 if rwdp.HotCachePeriod != nil { 2418 objectMap["hotCachePeriod"] = rwdp.HotCachePeriod 2419 } 2420 if rwdp.Statistics != nil { 2421 objectMap["statistics"] = rwdp.Statistics 2422 } 2423 return json.Marshal(objectMap) 2424} 2425 2426// Resource common fields that are returned in the response for all Azure Resource Manager resources 2427type Resource struct { 2428 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 2429 ID *string `json:"id,omitempty"` 2430 // Name - READ-ONLY; The name of the resource 2431 Name *string `json:"name,omitempty"` 2432 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 2433 Type *string `json:"type,omitempty"` 2434} 2435 2436// SkuDescription the Kusto SKU description of given resource type 2437type SkuDescription struct { 2438 // ResourceType - READ-ONLY; The resource type 2439 ResourceType *string `json:"resourceType,omitempty"` 2440 // Name - READ-ONLY; The name of the SKU 2441 Name *string `json:"name,omitempty"` 2442 // Tier - READ-ONLY; The tier of the SKU 2443 Tier *string `json:"tier,omitempty"` 2444 // Locations - READ-ONLY; The set of locations that the SKU is available 2445 Locations *[]string `json:"locations,omitempty"` 2446 // LocationInfo - READ-ONLY; Locations and zones 2447 LocationInfo *[]SkuLocationInfoItem `json:"locationInfo,omitempty"` 2448 // Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used 2449 Restrictions *[]interface{} `json:"restrictions,omitempty"` 2450} 2451 2452// SkuDescriptionList the list of the EngagementFabric SKU descriptions 2453type SkuDescriptionList struct { 2454 autorest.Response `json:"-"` 2455 // Value - READ-ONLY; SKU descriptions 2456 Value *[]SkuDescription `json:"value,omitempty"` 2457} 2458 2459// SkuLocationInfoItem the locations and zones info for SKU. 2460type SkuLocationInfoItem struct { 2461 // Location - The available location of the SKU. 2462 Location *string `json:"location,omitempty"` 2463 // Zones - The available zone of the SKU. 2464 Zones *[]string `json:"zones,omitempty"` 2465} 2466 2467// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource 2468// which has 'tags' and a 'location' 2469type TrackedResource struct { 2470 // Tags - Resource tags. 2471 Tags map[string]*string `json:"tags"` 2472 // Location - The geo-location where the resource lives 2473 Location *string `json:"location,omitempty"` 2474 // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} 2475 ID *string `json:"id,omitempty"` 2476 // Name - READ-ONLY; The name of the resource 2477 Name *string `json:"name,omitempty"` 2478 // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" 2479 Type *string `json:"type,omitempty"` 2480} 2481 2482// MarshalJSON is the custom marshaler for TrackedResource. 2483func (tr TrackedResource) MarshalJSON() ([]byte, error) { 2484 objectMap := make(map[string]interface{}) 2485 if tr.Tags != nil { 2486 objectMap["tags"] = tr.Tags 2487 } 2488 if tr.Location != nil { 2489 objectMap["location"] = tr.Location 2490 } 2491 return json.Marshal(objectMap) 2492} 2493 2494// TrustedExternalTenant represents a tenant ID that is trusted by the cluster. 2495type TrustedExternalTenant struct { 2496 // Value - GUID representing an external tenant. 2497 Value *string `json:"value,omitempty"` 2498} 2499 2500// VirtualNetworkConfiguration a class that contains virtual network definition. 2501type VirtualNetworkConfiguration struct { 2502 // SubnetID - The subnet resource id. 2503 SubnetID *string `json:"subnetId,omitempty"` 2504 // EnginePublicIPID - Engine service's public IP address resource id. 2505 EnginePublicIPID *string `json:"enginePublicIpId,omitempty"` 2506 // DataManagementPublicIPID - Data management's service public IP address resource id. 2507 DataManagementPublicIPID *string `json:"dataManagementPublicIpId,omitempty"` 2508} 2509