1package insights 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/date" 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/preview/monitor/mgmt/2018-11-01-preview/insights" 32 33// AggregationType enumerates the values for aggregation type. 34type AggregationType string 35 36const ( 37 // Average ... 38 Average AggregationType = "Average" 39 // Count ... 40 Count AggregationType = "Count" 41 // Maximum ... 42 Maximum AggregationType = "Maximum" 43 // Minimum ... 44 Minimum AggregationType = "Minimum" 45 // None ... 46 None AggregationType = "None" 47 // Total ... 48 Total AggregationType = "Total" 49) 50 51// PossibleAggregationTypeValues returns an array of possible values for the AggregationType const type. 52func PossibleAggregationTypeValues() []AggregationType { 53 return []AggregationType{Average, Count, Maximum, Minimum, None, Total} 54} 55 56// AlertSeverity enumerates the values for alert severity. 57type AlertSeverity string 58 59const ( 60 // Four ... 61 Four AlertSeverity = "4" 62 // One ... 63 One AlertSeverity = "1" 64 // Three ... 65 Three AlertSeverity = "3" 66 // Two ... 67 Two AlertSeverity = "2" 68 // Zero ... 69 Zero AlertSeverity = "0" 70) 71 72// PossibleAlertSeverityValues returns an array of possible values for the AlertSeverity const type. 73func PossibleAlertSeverityValues() []AlertSeverity { 74 return []AlertSeverity{Four, One, Three, Two, Zero} 75} 76 77// CategoryType enumerates the values for category type. 78type CategoryType string 79 80const ( 81 // Logs ... 82 Logs CategoryType = "Logs" 83 // Metrics ... 84 Metrics CategoryType = "Metrics" 85) 86 87// PossibleCategoryTypeValues returns an array of possible values for the CategoryType const type. 88func PossibleCategoryTypeValues() []CategoryType { 89 return []CategoryType{Logs, Metrics} 90} 91 92// ComparisonOperationType enumerates the values for comparison operation type. 93type ComparisonOperationType string 94 95const ( 96 // Equals ... 97 Equals ComparisonOperationType = "Equals" 98 // GreaterThan ... 99 GreaterThan ComparisonOperationType = "GreaterThan" 100 // GreaterThanOrEqual ... 101 GreaterThanOrEqual ComparisonOperationType = "GreaterThanOrEqual" 102 // LessThan ... 103 LessThan ComparisonOperationType = "LessThan" 104 // LessThanOrEqual ... 105 LessThanOrEqual ComparisonOperationType = "LessThanOrEqual" 106 // NotEquals ... 107 NotEquals ComparisonOperationType = "NotEquals" 108) 109 110// PossibleComparisonOperationTypeValues returns an array of possible values for the ComparisonOperationType const type. 111func PossibleComparisonOperationTypeValues() []ComparisonOperationType { 112 return []ComparisonOperationType{Equals, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual, NotEquals} 113} 114 115// ConditionalOperator enumerates the values for conditional operator. 116type ConditionalOperator string 117 118const ( 119 // ConditionalOperatorEqual ... 120 ConditionalOperatorEqual ConditionalOperator = "Equal" 121 // ConditionalOperatorGreaterThan ... 122 ConditionalOperatorGreaterThan ConditionalOperator = "GreaterThan" 123 // ConditionalOperatorLessThan ... 124 ConditionalOperatorLessThan ConditionalOperator = "LessThan" 125) 126 127// PossibleConditionalOperatorValues returns an array of possible values for the ConditionalOperator const type. 128func PossibleConditionalOperatorValues() []ConditionalOperator { 129 return []ConditionalOperator{ConditionalOperatorEqual, ConditionalOperatorGreaterThan, ConditionalOperatorLessThan} 130} 131 132// ConditionOperator enumerates the values for condition operator. 133type ConditionOperator string 134 135const ( 136 // ConditionOperatorGreaterThan ... 137 ConditionOperatorGreaterThan ConditionOperator = "GreaterThan" 138 // ConditionOperatorGreaterThanOrEqual ... 139 ConditionOperatorGreaterThanOrEqual ConditionOperator = "GreaterThanOrEqual" 140 // ConditionOperatorLessThan ... 141 ConditionOperatorLessThan ConditionOperator = "LessThan" 142 // ConditionOperatorLessThanOrEqual ... 143 ConditionOperatorLessThanOrEqual ConditionOperator = "LessThanOrEqual" 144) 145 146// PossibleConditionOperatorValues returns an array of possible values for the ConditionOperator const type. 147func PossibleConditionOperatorValues() []ConditionOperator { 148 return []ConditionOperator{ConditionOperatorGreaterThan, ConditionOperatorGreaterThanOrEqual, ConditionOperatorLessThan, ConditionOperatorLessThanOrEqual} 149} 150 151// CriterionType enumerates the values for criterion type. 152type CriterionType string 153 154const ( 155 // CriterionTypeDynamicThresholdCriterion ... 156 CriterionTypeDynamicThresholdCriterion CriterionType = "DynamicThresholdCriterion" 157 // CriterionTypeMultiMetricCriteria ... 158 CriterionTypeMultiMetricCriteria CriterionType = "MultiMetricCriteria" 159 // CriterionTypeStaticThresholdCriterion ... 160 CriterionTypeStaticThresholdCriterion CriterionType = "StaticThresholdCriterion" 161) 162 163// PossibleCriterionTypeValues returns an array of possible values for the CriterionType const type. 164func PossibleCriterionTypeValues() []CriterionType { 165 return []CriterionType{CriterionTypeDynamicThresholdCriterion, CriterionTypeMultiMetricCriteria, CriterionTypeStaticThresholdCriterion} 166} 167 168// DataStatus enumerates the values for data status. 169type DataStatus string 170 171const ( 172 // NotPresent ... 173 NotPresent DataStatus = "notPresent" 174 // Present ... 175 Present DataStatus = "present" 176) 177 178// PossibleDataStatusValues returns an array of possible values for the DataStatus const type. 179func PossibleDataStatusValues() []DataStatus { 180 return []DataStatus{NotPresent, Present} 181} 182 183// Enabled enumerates the values for enabled. 184type Enabled string 185 186const ( 187 // False ... 188 False Enabled = "false" 189 // True ... 190 True Enabled = "true" 191) 192 193// PossibleEnabledValues returns an array of possible values for the Enabled const type. 194func PossibleEnabledValues() []Enabled { 195 return []Enabled{False, True} 196} 197 198// EventLevel enumerates the values for event level. 199type EventLevel string 200 201const ( 202 // EventLevelCritical ... 203 EventLevelCritical EventLevel = "Critical" 204 // EventLevelError ... 205 EventLevelError EventLevel = "Error" 206 // EventLevelInformational ... 207 EventLevelInformational EventLevel = "Informational" 208 // EventLevelVerbose ... 209 EventLevelVerbose EventLevel = "Verbose" 210 // EventLevelWarning ... 211 EventLevelWarning EventLevel = "Warning" 212) 213 214// PossibleEventLevelValues returns an array of possible values for the EventLevel const type. 215func PossibleEventLevelValues() []EventLevel { 216 return []EventLevel{EventLevelCritical, EventLevelError, EventLevelInformational, EventLevelVerbose, EventLevelWarning} 217} 218 219// MetricStatisticType enumerates the values for metric statistic type. 220type MetricStatisticType string 221 222const ( 223 // MetricStatisticTypeAverage ... 224 MetricStatisticTypeAverage MetricStatisticType = "Average" 225 // MetricStatisticTypeMax ... 226 MetricStatisticTypeMax MetricStatisticType = "Max" 227 // MetricStatisticTypeMin ... 228 MetricStatisticTypeMin MetricStatisticType = "Min" 229 // MetricStatisticTypeSum ... 230 MetricStatisticTypeSum MetricStatisticType = "Sum" 231) 232 233// PossibleMetricStatisticTypeValues returns an array of possible values for the MetricStatisticType const type. 234func PossibleMetricStatisticTypeValues() []MetricStatisticType { 235 return []MetricStatisticType{MetricStatisticTypeAverage, MetricStatisticTypeMax, MetricStatisticTypeMin, MetricStatisticTypeSum} 236} 237 238// MetricTriggerType enumerates the values for metric trigger type. 239type MetricTriggerType string 240 241const ( 242 // MetricTriggerTypeConsecutive ... 243 MetricTriggerTypeConsecutive MetricTriggerType = "Consecutive" 244 // MetricTriggerTypeTotal ... 245 MetricTriggerTypeTotal MetricTriggerType = "Total" 246) 247 248// PossibleMetricTriggerTypeValues returns an array of possible values for the MetricTriggerType const type. 249func PossibleMetricTriggerTypeValues() []MetricTriggerType { 250 return []MetricTriggerType{MetricTriggerTypeConsecutive, MetricTriggerTypeTotal} 251} 252 253// OdataType enumerates the values for odata type. 254type OdataType string 255 256const ( 257 // OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource ... 258 OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource OdataType = "Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource" 259 // OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource ... 260 OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource OdataType = "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource" 261 // OdataTypeRuleDataSource ... 262 OdataTypeRuleDataSource OdataType = "RuleDataSource" 263) 264 265// PossibleOdataTypeValues returns an array of possible values for the OdataType const type. 266func PossibleOdataTypeValues() []OdataType { 267 return []OdataType{OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource, OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource, OdataTypeRuleDataSource} 268} 269 270// OdataTypeBasicAction enumerates the values for odata type basic action. 271type OdataTypeBasicAction string 272 273const ( 274 // OdataTypeAction ... 275 OdataTypeAction OdataTypeBasicAction = "Action" 276 // OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction ... 277 OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction OdataTypeBasicAction = "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction" 278 // OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction ... 279 OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction OdataTypeBasicAction = "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction" 280) 281 282// PossibleOdataTypeBasicActionValues returns an array of possible values for the OdataTypeBasicAction const type. 283func PossibleOdataTypeBasicActionValues() []OdataTypeBasicAction { 284 return []OdataTypeBasicAction{OdataTypeAction, OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction, OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction} 285} 286 287// OdataTypeBasicMetricAlertCriteria enumerates the values for odata type basic metric alert criteria. 288type OdataTypeBasicMetricAlertCriteria string 289 290const ( 291 // OdataTypeMetricAlertCriteria ... 292 OdataTypeMetricAlertCriteria OdataTypeBasicMetricAlertCriteria = "MetricAlertCriteria" 293 // OdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria ... 294 OdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria OdataTypeBasicMetricAlertCriteria = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria" 295 // OdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria ... 296 OdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria OdataTypeBasicMetricAlertCriteria = "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria" 297) 298 299// PossibleOdataTypeBasicMetricAlertCriteriaValues returns an array of possible values for the OdataTypeBasicMetricAlertCriteria const type. 300func PossibleOdataTypeBasicMetricAlertCriteriaValues() []OdataTypeBasicMetricAlertCriteria { 301 return []OdataTypeBasicMetricAlertCriteria{OdataTypeMetricAlertCriteria, OdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria, OdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria} 302} 303 304// OdataTypeBasicRuleAction enumerates the values for odata type basic rule action. 305type OdataTypeBasicRuleAction string 306 307const ( 308 // OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction ... 309 OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction OdataTypeBasicRuleAction = "Microsoft.Azure.Management.Insights.Models.RuleEmailAction" 310 // OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction ... 311 OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction OdataTypeBasicRuleAction = "Microsoft.Azure.Management.Insights.Models.RuleWebhookAction" 312 // OdataTypeRuleAction ... 313 OdataTypeRuleAction OdataTypeBasicRuleAction = "RuleAction" 314) 315 316// PossibleOdataTypeBasicRuleActionValues returns an array of possible values for the OdataTypeBasicRuleAction const type. 317func PossibleOdataTypeBasicRuleActionValues() []OdataTypeBasicRuleAction { 318 return []OdataTypeBasicRuleAction{OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction, OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction, OdataTypeRuleAction} 319} 320 321// OdataTypeBasicRuleCondition enumerates the values for odata type basic rule condition. 322type OdataTypeBasicRuleCondition string 323 324const ( 325 // OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition ... 326 OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition OdataTypeBasicRuleCondition = "Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition" 327 // OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition ... 328 OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition OdataTypeBasicRuleCondition = "Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition" 329 // OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition ... 330 OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition OdataTypeBasicRuleCondition = "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition" 331 // OdataTypeRuleCondition ... 332 OdataTypeRuleCondition OdataTypeBasicRuleCondition = "RuleCondition" 333) 334 335// PossibleOdataTypeBasicRuleConditionValues returns an array of possible values for the OdataTypeBasicRuleCondition const type. 336func PossibleOdataTypeBasicRuleConditionValues() []OdataTypeBasicRuleCondition { 337 return []OdataTypeBasicRuleCondition{OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition, OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition, OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition, OdataTypeRuleCondition} 338} 339 340// OnboardingStatus enumerates the values for onboarding status. 341type OnboardingStatus string 342 343const ( 344 // NotOnboarded ... 345 NotOnboarded OnboardingStatus = "notOnboarded" 346 // Onboarded ... 347 Onboarded OnboardingStatus = "onboarded" 348 // Unknown ... 349 Unknown OnboardingStatus = "unknown" 350) 351 352// PossibleOnboardingStatusValues returns an array of possible values for the OnboardingStatus const type. 353func PossibleOnboardingStatusValues() []OnboardingStatus { 354 return []OnboardingStatus{NotOnboarded, Onboarded, Unknown} 355} 356 357// ProvisioningState enumerates the values for provisioning state. 358type ProvisioningState string 359 360const ( 361 // Canceled ... 362 Canceled ProvisioningState = "Canceled" 363 // Deploying ... 364 Deploying ProvisioningState = "Deploying" 365 // Failed ... 366 Failed ProvisioningState = "Failed" 367 // Succeeded ... 368 Succeeded ProvisioningState = "Succeeded" 369) 370 371// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. 372func PossibleProvisioningStateValues() []ProvisioningState { 373 return []ProvisioningState{Canceled, Deploying, Failed, Succeeded} 374} 375 376// QueryType enumerates the values for query type. 377type QueryType string 378 379const ( 380 // ResultCount ... 381 ResultCount QueryType = "ResultCount" 382) 383 384// PossibleQueryTypeValues returns an array of possible values for the QueryType const type. 385func PossibleQueryTypeValues() []QueryType { 386 return []QueryType{ResultCount} 387} 388 389// ReceiverStatus enumerates the values for receiver status. 390type ReceiverStatus string 391 392const ( 393 // ReceiverStatusDisabled ... 394 ReceiverStatusDisabled ReceiverStatus = "Disabled" 395 // ReceiverStatusEnabled ... 396 ReceiverStatusEnabled ReceiverStatus = "Enabled" 397 // ReceiverStatusNotSpecified ... 398 ReceiverStatusNotSpecified ReceiverStatus = "NotSpecified" 399) 400 401// PossibleReceiverStatusValues returns an array of possible values for the ReceiverStatus const type. 402func PossibleReceiverStatusValues() []ReceiverStatus { 403 return []ReceiverStatus{ReceiverStatusDisabled, ReceiverStatusEnabled, ReceiverStatusNotSpecified} 404} 405 406// RecurrenceFrequency enumerates the values for recurrence frequency. 407type RecurrenceFrequency string 408 409const ( 410 // RecurrenceFrequencyDay ... 411 RecurrenceFrequencyDay RecurrenceFrequency = "Day" 412 // RecurrenceFrequencyHour ... 413 RecurrenceFrequencyHour RecurrenceFrequency = "Hour" 414 // RecurrenceFrequencyMinute ... 415 RecurrenceFrequencyMinute RecurrenceFrequency = "Minute" 416 // RecurrenceFrequencyMonth ... 417 RecurrenceFrequencyMonth RecurrenceFrequency = "Month" 418 // RecurrenceFrequencyNone ... 419 RecurrenceFrequencyNone RecurrenceFrequency = "None" 420 // RecurrenceFrequencySecond ... 421 RecurrenceFrequencySecond RecurrenceFrequency = "Second" 422 // RecurrenceFrequencyWeek ... 423 RecurrenceFrequencyWeek RecurrenceFrequency = "Week" 424 // RecurrenceFrequencyYear ... 425 RecurrenceFrequencyYear RecurrenceFrequency = "Year" 426) 427 428// PossibleRecurrenceFrequencyValues returns an array of possible values for the RecurrenceFrequency const type. 429func PossibleRecurrenceFrequencyValues() []RecurrenceFrequency { 430 return []RecurrenceFrequency{RecurrenceFrequencyDay, RecurrenceFrequencyHour, RecurrenceFrequencyMinute, RecurrenceFrequencyMonth, RecurrenceFrequencyNone, RecurrenceFrequencySecond, RecurrenceFrequencyWeek, RecurrenceFrequencyYear} 431} 432 433// ResultType enumerates the values for result type. 434type ResultType string 435 436const ( 437 // Data ... 438 Data ResultType = "Data" 439 // Metadata ... 440 Metadata ResultType = "Metadata" 441) 442 443// PossibleResultTypeValues returns an array of possible values for the ResultType const type. 444func PossibleResultTypeValues() []ResultType { 445 return []ResultType{Data, Metadata} 446} 447 448// ScaleDirection enumerates the values for scale direction. 449type ScaleDirection string 450 451const ( 452 // ScaleDirectionDecrease ... 453 ScaleDirectionDecrease ScaleDirection = "Decrease" 454 // ScaleDirectionIncrease ... 455 ScaleDirectionIncrease ScaleDirection = "Increase" 456 // ScaleDirectionNone ... 457 ScaleDirectionNone ScaleDirection = "None" 458) 459 460// PossibleScaleDirectionValues returns an array of possible values for the ScaleDirection const type. 461func PossibleScaleDirectionValues() []ScaleDirection { 462 return []ScaleDirection{ScaleDirectionDecrease, ScaleDirectionIncrease, ScaleDirectionNone} 463} 464 465// ScaleType enumerates the values for scale type. 466type ScaleType string 467 468const ( 469 // ChangeCount ... 470 ChangeCount ScaleType = "ChangeCount" 471 // ExactCount ... 472 ExactCount ScaleType = "ExactCount" 473 // PercentChangeCount ... 474 PercentChangeCount ScaleType = "PercentChangeCount" 475) 476 477// PossibleScaleTypeValues returns an array of possible values for the ScaleType const type. 478func PossibleScaleTypeValues() []ScaleType { 479 return []ScaleType{ChangeCount, ExactCount, PercentChangeCount} 480} 481 482// Sensitivity enumerates the values for sensitivity. 483type Sensitivity string 484 485const ( 486 // High ... 487 High Sensitivity = "High" 488 // Low ... 489 Low Sensitivity = "Low" 490 // Medium ... 491 Medium Sensitivity = "Medium" 492) 493 494// PossibleSensitivityValues returns an array of possible values for the Sensitivity const type. 495func PossibleSensitivityValues() []Sensitivity { 496 return []Sensitivity{High, Low, Medium} 497} 498 499// TimeAggregationOperator enumerates the values for time aggregation operator. 500type TimeAggregationOperator string 501 502const ( 503 // TimeAggregationOperatorAverage ... 504 TimeAggregationOperatorAverage TimeAggregationOperator = "Average" 505 // TimeAggregationOperatorLast ... 506 TimeAggregationOperatorLast TimeAggregationOperator = "Last" 507 // TimeAggregationOperatorMaximum ... 508 TimeAggregationOperatorMaximum TimeAggregationOperator = "Maximum" 509 // TimeAggregationOperatorMinimum ... 510 TimeAggregationOperatorMinimum TimeAggregationOperator = "Minimum" 511 // TimeAggregationOperatorTotal ... 512 TimeAggregationOperatorTotal TimeAggregationOperator = "Total" 513) 514 515// PossibleTimeAggregationOperatorValues returns an array of possible values for the TimeAggregationOperator const type. 516func PossibleTimeAggregationOperatorValues() []TimeAggregationOperator { 517 return []TimeAggregationOperator{TimeAggregationOperatorAverage, TimeAggregationOperatorLast, TimeAggregationOperatorMaximum, TimeAggregationOperatorMinimum, TimeAggregationOperatorTotal} 518} 519 520// TimeAggregationType enumerates the values for time aggregation type. 521type TimeAggregationType string 522 523const ( 524 // TimeAggregationTypeAverage ... 525 TimeAggregationTypeAverage TimeAggregationType = "Average" 526 // TimeAggregationTypeCount ... 527 TimeAggregationTypeCount TimeAggregationType = "Count" 528 // TimeAggregationTypeLast ... 529 TimeAggregationTypeLast TimeAggregationType = "Last" 530 // TimeAggregationTypeMaximum ... 531 TimeAggregationTypeMaximum TimeAggregationType = "Maximum" 532 // TimeAggregationTypeMinimum ... 533 TimeAggregationTypeMinimum TimeAggregationType = "Minimum" 534 // TimeAggregationTypeTotal ... 535 TimeAggregationTypeTotal TimeAggregationType = "Total" 536) 537 538// PossibleTimeAggregationTypeValues returns an array of possible values for the TimeAggregationType const type. 539func PossibleTimeAggregationTypeValues() []TimeAggregationType { 540 return []TimeAggregationType{TimeAggregationTypeAverage, TimeAggregationTypeCount, TimeAggregationTypeLast, TimeAggregationTypeMaximum, TimeAggregationTypeMinimum, TimeAggregationTypeTotal} 541} 542 543// Unit enumerates the values for unit. 544type Unit string 545 546const ( 547 // UnitBitsPerSecond ... 548 UnitBitsPerSecond Unit = "BitsPerSecond" 549 // UnitBytes ... 550 UnitBytes Unit = "Bytes" 551 // UnitByteSeconds ... 552 UnitByteSeconds Unit = "ByteSeconds" 553 // UnitBytesPerSecond ... 554 UnitBytesPerSecond Unit = "BytesPerSecond" 555 // UnitCores ... 556 UnitCores Unit = "Cores" 557 // UnitCount ... 558 UnitCount Unit = "Count" 559 // UnitCountPerSecond ... 560 UnitCountPerSecond Unit = "CountPerSecond" 561 // UnitMilliCores ... 562 UnitMilliCores Unit = "MilliCores" 563 // UnitMilliSeconds ... 564 UnitMilliSeconds Unit = "MilliSeconds" 565 // UnitNanoCores ... 566 UnitNanoCores Unit = "NanoCores" 567 // UnitPercent ... 568 UnitPercent Unit = "Percent" 569 // UnitSeconds ... 570 UnitSeconds Unit = "Seconds" 571 // UnitUnspecified ... 572 UnitUnspecified Unit = "Unspecified" 573) 574 575// PossibleUnitValues returns an array of possible values for the Unit const type. 576func PossibleUnitValues() []Unit { 577 return []Unit{UnitBitsPerSecond, UnitBytes, UnitByteSeconds, UnitBytesPerSecond, UnitCores, UnitCount, UnitCountPerSecond, UnitMilliCores, UnitMilliSeconds, UnitNanoCores, UnitPercent, UnitSeconds, UnitUnspecified} 578} 579 580// BasicAction action descriptor. 581type BasicAction interface { 582 AsAlertingAction() (*AlertingAction, bool) 583 AsLogToMetricAction() (*LogToMetricAction, bool) 584 AsAction() (*Action, bool) 585} 586 587// Action action descriptor. 588type Action struct { 589 // OdataType - Possible values include: 'OdataTypeAction', 'OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction', 'OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction' 590 OdataType OdataTypeBasicAction `json:"odata.type,omitempty"` 591} 592 593func unmarshalBasicAction(body []byte) (BasicAction, error) { 594 var m map[string]interface{} 595 err := json.Unmarshal(body, &m) 596 if err != nil { 597 return nil, err 598 } 599 600 switch m["odata.type"] { 601 case string(OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction): 602 var aa AlertingAction 603 err := json.Unmarshal(body, &aa) 604 return aa, err 605 case string(OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction): 606 var ltma LogToMetricAction 607 err := json.Unmarshal(body, <ma) 608 return ltma, err 609 default: 610 var a Action 611 err := json.Unmarshal(body, &a) 612 return a, err 613 } 614} 615func unmarshalBasicActionArray(body []byte) ([]BasicAction, error) { 616 var rawMessages []*json.RawMessage 617 err := json.Unmarshal(body, &rawMessages) 618 if err != nil { 619 return nil, err 620 } 621 622 aArray := make([]BasicAction, len(rawMessages)) 623 624 for index, rawMessage := range rawMessages { 625 a, err := unmarshalBasicAction(*rawMessage) 626 if err != nil { 627 return nil, err 628 } 629 aArray[index] = a 630 } 631 return aArray, nil 632} 633 634// MarshalJSON is the custom marshaler for Action. 635func (a Action) MarshalJSON() ([]byte, error) { 636 a.OdataType = OdataTypeAction 637 objectMap := make(map[string]interface{}) 638 if a.OdataType != "" { 639 objectMap["odata.type"] = a.OdataType 640 } 641 return json.Marshal(objectMap) 642} 643 644// AsAlertingAction is the BasicAction implementation for Action. 645func (a Action) AsAlertingAction() (*AlertingAction, bool) { 646 return nil, false 647} 648 649// AsLogToMetricAction is the BasicAction implementation for Action. 650func (a Action) AsLogToMetricAction() (*LogToMetricAction, bool) { 651 return nil, false 652} 653 654// AsAction is the BasicAction implementation for Action. 655func (a Action) AsAction() (*Action, bool) { 656 return &a, true 657} 658 659// AsBasicAction is the BasicAction implementation for Action. 660func (a Action) AsBasicAction() (BasicAction, bool) { 661 return &a, true 662} 663 664// ActionGroup an Azure action group. 665type ActionGroup struct { 666 // GroupShortName - The short name of the action group. This will be used in SMS messages. 667 GroupShortName *string `json:"groupShortName,omitempty"` 668 // Enabled - Indicates whether this action group is enabled. If an action group is not enabled, then none of its receivers will receive communications. 669 Enabled *bool `json:"enabled,omitempty"` 670 // EmailReceivers - The list of email receivers that are part of this action group. 671 EmailReceivers *[]EmailReceiver `json:"emailReceivers,omitempty"` 672 // SmsReceivers - The list of SMS receivers that are part of this action group. 673 SmsReceivers *[]SmsReceiver `json:"smsReceivers,omitempty"` 674 // WebhookReceivers - The list of webhook receivers that are part of this action group. 675 WebhookReceivers *[]WebhookReceiver `json:"webhookReceivers,omitempty"` 676 // ItsmReceivers - The list of ITSM receivers that are part of this action group. 677 ItsmReceivers *[]ItsmReceiver `json:"itsmReceivers,omitempty"` 678 // AzureAppPushReceivers - The list of AzureAppPush receivers that are part of this action group. 679 AzureAppPushReceivers *[]AzureAppPushReceiver `json:"azureAppPushReceivers,omitempty"` 680 // AutomationRunbookReceivers - The list of AutomationRunbook receivers that are part of this action group. 681 AutomationRunbookReceivers *[]AutomationRunbookReceiver `json:"automationRunbookReceivers,omitempty"` 682 // VoiceReceivers - The list of voice receivers that are part of this action group. 683 VoiceReceivers *[]VoiceReceiver `json:"voiceReceivers,omitempty"` 684 // LogicAppReceivers - The list of logic app receivers that are part of this action group. 685 LogicAppReceivers *[]LogicAppReceiver `json:"logicAppReceivers,omitempty"` 686 // AzureFunctionReceivers - The list of azure function receivers that are part of this action group. 687 AzureFunctionReceivers *[]AzureFunctionReceiver `json:"azureFunctionReceivers,omitempty"` 688 // ArmRoleReceivers - The list of ARM role receivers that are part of this action group. Roles are Azure RBAC roles and only built-in roles are supported. 689 ArmRoleReceivers *[]ArmRoleReceiver `json:"armRoleReceivers,omitempty"` 690} 691 692// ActionGroupList a list of action groups. 693type ActionGroupList struct { 694 autorest.Response `json:"-"` 695 // Value - The list of action groups. 696 Value *[]ActionGroupResource `json:"value,omitempty"` 697 // NextLink - Provides the link to retrieve the next set of elements. 698 NextLink *string `json:"nextLink,omitempty"` 699} 700 701// ActionGroupPatch an Azure action group for patch operations. 702type ActionGroupPatch struct { 703 // Enabled - Indicates whether this action group is enabled. If an action group is not enabled, then none of its actions will be activated. 704 Enabled *bool `json:"enabled,omitempty"` 705} 706 707// ActionGroupPatchBody an action group object for the body of patch operations. 708type ActionGroupPatchBody struct { 709 // Tags - Resource tags 710 Tags map[string]*string `json:"tags"` 711 // ActionGroupPatch - The action group settings for an update operation. 712 *ActionGroupPatch `json:"properties,omitempty"` 713} 714 715// MarshalJSON is the custom marshaler for ActionGroupPatchBody. 716func (agpb ActionGroupPatchBody) MarshalJSON() ([]byte, error) { 717 objectMap := make(map[string]interface{}) 718 if agpb.Tags != nil { 719 objectMap["tags"] = agpb.Tags 720 } 721 if agpb.ActionGroupPatch != nil { 722 objectMap["properties"] = agpb.ActionGroupPatch 723 } 724 return json.Marshal(objectMap) 725} 726 727// UnmarshalJSON is the custom unmarshaler for ActionGroupPatchBody struct. 728func (agpb *ActionGroupPatchBody) UnmarshalJSON(body []byte) error { 729 var m map[string]*json.RawMessage 730 err := json.Unmarshal(body, &m) 731 if err != nil { 732 return err 733 } 734 for k, v := range m { 735 switch k { 736 case "tags": 737 if v != nil { 738 var tags map[string]*string 739 err = json.Unmarshal(*v, &tags) 740 if err != nil { 741 return err 742 } 743 agpb.Tags = tags 744 } 745 case "properties": 746 if v != nil { 747 var actionGroupPatch ActionGroupPatch 748 err = json.Unmarshal(*v, &actionGroupPatch) 749 if err != nil { 750 return err 751 } 752 agpb.ActionGroupPatch = &actionGroupPatch 753 } 754 } 755 } 756 757 return nil 758} 759 760// ActionGroupResource an action group resource. 761type ActionGroupResource struct { 762 autorest.Response `json:"-"` 763 // ActionGroup - The action groups properties of the resource. 764 *ActionGroup `json:"properties,omitempty"` 765 // ID - READ-ONLY; Azure resource Id 766 ID *string `json:"id,omitempty"` 767 // Name - READ-ONLY; Azure resource name 768 Name *string `json:"name,omitempty"` 769 // Type - READ-ONLY; Azure resource type 770 Type *string `json:"type,omitempty"` 771 // Location - Resource location 772 Location *string `json:"location,omitempty"` 773 // Tags - Resource tags 774 Tags map[string]*string `json:"tags"` 775} 776 777// MarshalJSON is the custom marshaler for ActionGroupResource. 778func (agr ActionGroupResource) MarshalJSON() ([]byte, error) { 779 objectMap := make(map[string]interface{}) 780 if agr.ActionGroup != nil { 781 objectMap["properties"] = agr.ActionGroup 782 } 783 if agr.Location != nil { 784 objectMap["location"] = agr.Location 785 } 786 if agr.Tags != nil { 787 objectMap["tags"] = agr.Tags 788 } 789 return json.Marshal(objectMap) 790} 791 792// UnmarshalJSON is the custom unmarshaler for ActionGroupResource struct. 793func (agr *ActionGroupResource) UnmarshalJSON(body []byte) error { 794 var m map[string]*json.RawMessage 795 err := json.Unmarshal(body, &m) 796 if err != nil { 797 return err 798 } 799 for k, v := range m { 800 switch k { 801 case "properties": 802 if v != nil { 803 var actionGroup ActionGroup 804 err = json.Unmarshal(*v, &actionGroup) 805 if err != nil { 806 return err 807 } 808 agr.ActionGroup = &actionGroup 809 } 810 case "id": 811 if v != nil { 812 var ID string 813 err = json.Unmarshal(*v, &ID) 814 if err != nil { 815 return err 816 } 817 agr.ID = &ID 818 } 819 case "name": 820 if v != nil { 821 var name string 822 err = json.Unmarshal(*v, &name) 823 if err != nil { 824 return err 825 } 826 agr.Name = &name 827 } 828 case "type": 829 if v != nil { 830 var typeVar string 831 err = json.Unmarshal(*v, &typeVar) 832 if err != nil { 833 return err 834 } 835 agr.Type = &typeVar 836 } 837 case "location": 838 if v != nil { 839 var location string 840 err = json.Unmarshal(*v, &location) 841 if err != nil { 842 return err 843 } 844 agr.Location = &location 845 } 846 case "tags": 847 if v != nil { 848 var tags map[string]*string 849 err = json.Unmarshal(*v, &tags) 850 if err != nil { 851 return err 852 } 853 agr.Tags = tags 854 } 855 } 856 } 857 858 return nil 859} 860 861// ActivityLogAlert an Azure activity log alert. 862type ActivityLogAlert struct { 863 // Scopes - A list of resourceIds that will be used as prefixes. The alert will only apply to activityLogs with resourceIds that fall under one of these prefixes. This list must include at least one item. 864 Scopes *[]string `json:"scopes,omitempty"` 865 // Enabled - Indicates whether this activity log alert is enabled. If an activity log alert is not enabled, then none of its actions will be activated. 866 Enabled *bool `json:"enabled,omitempty"` 867 // Condition - The condition that will cause this alert to activate. 868 Condition *ActivityLogAlertAllOfCondition `json:"condition,omitempty"` 869 // Actions - The actions that will activate when the condition is met. 870 Actions *ActivityLogAlertActionList `json:"actions,omitempty"` 871 // Description - A description of this activity log alert. 872 Description *string `json:"description,omitempty"` 873} 874 875// ActivityLogAlertActionGroup a pointer to an Azure Action Group. 876type ActivityLogAlertActionGroup struct { 877 // ActionGroupID - The resourceId of the action group. This cannot be null or empty. 878 ActionGroupID *string `json:"actionGroupId,omitempty"` 879 // WebhookProperties - the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. 880 WebhookProperties map[string]*string `json:"webhookProperties"` 881} 882 883// MarshalJSON is the custom marshaler for ActivityLogAlertActionGroup. 884func (alaag ActivityLogAlertActionGroup) MarshalJSON() ([]byte, error) { 885 objectMap := make(map[string]interface{}) 886 if alaag.ActionGroupID != nil { 887 objectMap["actionGroupId"] = alaag.ActionGroupID 888 } 889 if alaag.WebhookProperties != nil { 890 objectMap["webhookProperties"] = alaag.WebhookProperties 891 } 892 return json.Marshal(objectMap) 893} 894 895// ActivityLogAlertActionList a list of activity log alert actions. 896type ActivityLogAlertActionList struct { 897 // ActionGroups - The list of activity log alerts. 898 ActionGroups *[]ActivityLogAlertActionGroup `json:"actionGroups,omitempty"` 899} 900 901// ActivityLogAlertAllOfCondition an Activity Log alert condition that is met when all its member 902// conditions are met. 903type ActivityLogAlertAllOfCondition struct { 904 // AllOf - The list of activity log alert conditions. 905 AllOf *[]ActivityLogAlertLeafCondition `json:"allOf,omitempty"` 906} 907 908// ActivityLogAlertLeafCondition an Activity Log alert condition that is met by comparing an activity log 909// field and value. 910type ActivityLogAlertLeafCondition struct { 911 // Field - The name of the field that this condition will examine. The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties.'. 912 Field *string `json:"field,omitempty"` 913 // Equals - The field value will be compared to this value (case-insensitive) to determine if the condition is met. 914 Equals *string `json:"equals,omitempty"` 915} 916 917// ActivityLogAlertList a list of activity log alerts. 918type ActivityLogAlertList struct { 919 autorest.Response `json:"-"` 920 // Value - The list of activity log alerts. 921 Value *[]ActivityLogAlertResource `json:"value,omitempty"` 922 // NextLink - Provides the link to retrieve the next set of elements. 923 NextLink *string `json:"nextLink,omitempty"` 924} 925 926// ActivityLogAlertPatch an Azure activity log alert for patch operations. 927type ActivityLogAlertPatch struct { 928 // Enabled - Indicates whether this activity log alert is enabled. If an activity log alert is not enabled, then none of its actions will be activated. 929 Enabled *bool `json:"enabled,omitempty"` 930} 931 932// ActivityLogAlertPatchBody an activity log alert object for the body of patch operations. 933type ActivityLogAlertPatchBody struct { 934 // Tags - Resource tags 935 Tags map[string]*string `json:"tags"` 936 // ActivityLogAlertPatch - The activity log alert settings for an update operation. 937 *ActivityLogAlertPatch `json:"properties,omitempty"` 938} 939 940// MarshalJSON is the custom marshaler for ActivityLogAlertPatchBody. 941func (alapb ActivityLogAlertPatchBody) MarshalJSON() ([]byte, error) { 942 objectMap := make(map[string]interface{}) 943 if alapb.Tags != nil { 944 objectMap["tags"] = alapb.Tags 945 } 946 if alapb.ActivityLogAlertPatch != nil { 947 objectMap["properties"] = alapb.ActivityLogAlertPatch 948 } 949 return json.Marshal(objectMap) 950} 951 952// UnmarshalJSON is the custom unmarshaler for ActivityLogAlertPatchBody struct. 953func (alapb *ActivityLogAlertPatchBody) UnmarshalJSON(body []byte) error { 954 var m map[string]*json.RawMessage 955 err := json.Unmarshal(body, &m) 956 if err != nil { 957 return err 958 } 959 for k, v := range m { 960 switch k { 961 case "tags": 962 if v != nil { 963 var tags map[string]*string 964 err = json.Unmarshal(*v, &tags) 965 if err != nil { 966 return err 967 } 968 alapb.Tags = tags 969 } 970 case "properties": 971 if v != nil { 972 var activityLogAlertPatch ActivityLogAlertPatch 973 err = json.Unmarshal(*v, &activityLogAlertPatch) 974 if err != nil { 975 return err 976 } 977 alapb.ActivityLogAlertPatch = &activityLogAlertPatch 978 } 979 } 980 } 981 982 return nil 983} 984 985// ActivityLogAlertResource an activity log alert resource. 986type ActivityLogAlertResource struct { 987 autorest.Response `json:"-"` 988 // ActivityLogAlert - The activity log alert properties of the resource. 989 *ActivityLogAlert `json:"properties,omitempty"` 990 // ID - READ-ONLY; Azure resource Id 991 ID *string `json:"id,omitempty"` 992 // Name - READ-ONLY; Azure resource name 993 Name *string `json:"name,omitempty"` 994 // Type - READ-ONLY; Azure resource type 995 Type *string `json:"type,omitempty"` 996 // Location - Resource location 997 Location *string `json:"location,omitempty"` 998 // Tags - Resource tags 999 Tags map[string]*string `json:"tags"` 1000} 1001 1002// MarshalJSON is the custom marshaler for ActivityLogAlertResource. 1003func (alar ActivityLogAlertResource) MarshalJSON() ([]byte, error) { 1004 objectMap := make(map[string]interface{}) 1005 if alar.ActivityLogAlert != nil { 1006 objectMap["properties"] = alar.ActivityLogAlert 1007 } 1008 if alar.Location != nil { 1009 objectMap["location"] = alar.Location 1010 } 1011 if alar.Tags != nil { 1012 objectMap["tags"] = alar.Tags 1013 } 1014 return json.Marshal(objectMap) 1015} 1016 1017// UnmarshalJSON is the custom unmarshaler for ActivityLogAlertResource struct. 1018func (alar *ActivityLogAlertResource) UnmarshalJSON(body []byte) error { 1019 var m map[string]*json.RawMessage 1020 err := json.Unmarshal(body, &m) 1021 if err != nil { 1022 return err 1023 } 1024 for k, v := range m { 1025 switch k { 1026 case "properties": 1027 if v != nil { 1028 var activityLogAlert ActivityLogAlert 1029 err = json.Unmarshal(*v, &activityLogAlert) 1030 if err != nil { 1031 return err 1032 } 1033 alar.ActivityLogAlert = &activityLogAlert 1034 } 1035 case "id": 1036 if v != nil { 1037 var ID string 1038 err = json.Unmarshal(*v, &ID) 1039 if err != nil { 1040 return err 1041 } 1042 alar.ID = &ID 1043 } 1044 case "name": 1045 if v != nil { 1046 var name string 1047 err = json.Unmarshal(*v, &name) 1048 if err != nil { 1049 return err 1050 } 1051 alar.Name = &name 1052 } 1053 case "type": 1054 if v != nil { 1055 var typeVar string 1056 err = json.Unmarshal(*v, &typeVar) 1057 if err != nil { 1058 return err 1059 } 1060 alar.Type = &typeVar 1061 } 1062 case "location": 1063 if v != nil { 1064 var location string 1065 err = json.Unmarshal(*v, &location) 1066 if err != nil { 1067 return err 1068 } 1069 alar.Location = &location 1070 } 1071 case "tags": 1072 if v != nil { 1073 var tags map[string]*string 1074 err = json.Unmarshal(*v, &tags) 1075 if err != nil { 1076 return err 1077 } 1078 alar.Tags = tags 1079 } 1080 } 1081 } 1082 1083 return nil 1084} 1085 1086// AlertingAction specify action need to be taken when rule type is Alert 1087type AlertingAction struct { 1088 // Severity - Severity of the alert. Possible values include: 'Zero', 'One', 'Two', 'Three', 'Four' 1089 Severity AlertSeverity `json:"severity,omitempty"` 1090 // AznsAction - Azure action group reference. 1091 AznsAction *AzNsActionGroup `json:"aznsAction,omitempty"` 1092 // ThrottlingInMin - time (in minutes) for which Alerts should be throttled or suppressed. 1093 ThrottlingInMin *int32 `json:"throttlingInMin,omitempty"` 1094 // Trigger - The trigger condition that results in the alert rule being. 1095 Trigger *TriggerCondition `json:"trigger,omitempty"` 1096 // OdataType - Possible values include: 'OdataTypeAction', 'OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction', 'OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction' 1097 OdataType OdataTypeBasicAction `json:"odata.type,omitempty"` 1098} 1099 1100// MarshalJSON is the custom marshaler for AlertingAction. 1101func (aa AlertingAction) MarshalJSON() ([]byte, error) { 1102 aa.OdataType = OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction 1103 objectMap := make(map[string]interface{}) 1104 if aa.Severity != "" { 1105 objectMap["severity"] = aa.Severity 1106 } 1107 if aa.AznsAction != nil { 1108 objectMap["aznsAction"] = aa.AznsAction 1109 } 1110 if aa.ThrottlingInMin != nil { 1111 objectMap["throttlingInMin"] = aa.ThrottlingInMin 1112 } 1113 if aa.Trigger != nil { 1114 objectMap["trigger"] = aa.Trigger 1115 } 1116 if aa.OdataType != "" { 1117 objectMap["odata.type"] = aa.OdataType 1118 } 1119 return json.Marshal(objectMap) 1120} 1121 1122// AsAlertingAction is the BasicAction implementation for AlertingAction. 1123func (aa AlertingAction) AsAlertingAction() (*AlertingAction, bool) { 1124 return &aa, true 1125} 1126 1127// AsLogToMetricAction is the BasicAction implementation for AlertingAction. 1128func (aa AlertingAction) AsLogToMetricAction() (*LogToMetricAction, bool) { 1129 return nil, false 1130} 1131 1132// AsAction is the BasicAction implementation for AlertingAction. 1133func (aa AlertingAction) AsAction() (*Action, bool) { 1134 return nil, false 1135} 1136 1137// AsBasicAction is the BasicAction implementation for AlertingAction. 1138func (aa AlertingAction) AsBasicAction() (BasicAction, bool) { 1139 return &aa, true 1140} 1141 1142// AlertRule an alert rule. 1143type AlertRule struct { 1144 // Name - the name of the alert rule. 1145 Name *string `json:"name,omitempty"` 1146 // Description - the description of the alert rule that will be included in the alert email. 1147 Description *string `json:"description,omitempty"` 1148 // IsEnabled - the flag that indicates whether the alert rule is enabled. 1149 IsEnabled *bool `json:"isEnabled,omitempty"` 1150 // Condition - the condition that results in the alert rule being activated. 1151 Condition BasicRuleCondition `json:"condition,omitempty"` 1152 // Actions - the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. 1153 Actions *[]BasicRuleAction `json:"actions,omitempty"` 1154 // LastUpdatedTime - READ-ONLY; Last time the rule was updated in ISO8601 format. 1155 LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` 1156} 1157 1158// UnmarshalJSON is the custom unmarshaler for AlertRule struct. 1159func (ar *AlertRule) UnmarshalJSON(body []byte) error { 1160 var m map[string]*json.RawMessage 1161 err := json.Unmarshal(body, &m) 1162 if err != nil { 1163 return err 1164 } 1165 for k, v := range m { 1166 switch k { 1167 case "name": 1168 if v != nil { 1169 var name string 1170 err = json.Unmarshal(*v, &name) 1171 if err != nil { 1172 return err 1173 } 1174 ar.Name = &name 1175 } 1176 case "description": 1177 if v != nil { 1178 var description string 1179 err = json.Unmarshal(*v, &description) 1180 if err != nil { 1181 return err 1182 } 1183 ar.Description = &description 1184 } 1185 case "isEnabled": 1186 if v != nil { 1187 var isEnabled bool 1188 err = json.Unmarshal(*v, &isEnabled) 1189 if err != nil { 1190 return err 1191 } 1192 ar.IsEnabled = &isEnabled 1193 } 1194 case "condition": 1195 if v != nil { 1196 condition, err := unmarshalBasicRuleCondition(*v) 1197 if err != nil { 1198 return err 1199 } 1200 ar.Condition = condition 1201 } 1202 case "actions": 1203 if v != nil { 1204 actions, err := unmarshalBasicRuleActionArray(*v) 1205 if err != nil { 1206 return err 1207 } 1208 ar.Actions = &actions 1209 } 1210 case "lastUpdatedTime": 1211 if v != nil { 1212 var lastUpdatedTime date.Time 1213 err = json.Unmarshal(*v, &lastUpdatedTime) 1214 if err != nil { 1215 return err 1216 } 1217 ar.LastUpdatedTime = &lastUpdatedTime 1218 } 1219 } 1220 } 1221 1222 return nil 1223} 1224 1225// AlertRuleResource the alert rule resource. 1226type AlertRuleResource struct { 1227 autorest.Response `json:"-"` 1228 // AlertRule - The alert rule properties of the resource. 1229 *AlertRule `json:"properties,omitempty"` 1230 // ID - READ-ONLY; Azure resource Id 1231 ID *string `json:"id,omitempty"` 1232 // Name - READ-ONLY; Azure resource name 1233 Name *string `json:"name,omitempty"` 1234 // Type - READ-ONLY; Azure resource type 1235 Type *string `json:"type,omitempty"` 1236 // Location - Resource location 1237 Location *string `json:"location,omitempty"` 1238 // Tags - Resource tags 1239 Tags map[string]*string `json:"tags"` 1240} 1241 1242// MarshalJSON is the custom marshaler for AlertRuleResource. 1243func (arr AlertRuleResource) MarshalJSON() ([]byte, error) { 1244 objectMap := make(map[string]interface{}) 1245 if arr.AlertRule != nil { 1246 objectMap["properties"] = arr.AlertRule 1247 } 1248 if arr.Location != nil { 1249 objectMap["location"] = arr.Location 1250 } 1251 if arr.Tags != nil { 1252 objectMap["tags"] = arr.Tags 1253 } 1254 return json.Marshal(objectMap) 1255} 1256 1257// UnmarshalJSON is the custom unmarshaler for AlertRuleResource struct. 1258func (arr *AlertRuleResource) UnmarshalJSON(body []byte) error { 1259 var m map[string]*json.RawMessage 1260 err := json.Unmarshal(body, &m) 1261 if err != nil { 1262 return err 1263 } 1264 for k, v := range m { 1265 switch k { 1266 case "properties": 1267 if v != nil { 1268 var alertRule AlertRule 1269 err = json.Unmarshal(*v, &alertRule) 1270 if err != nil { 1271 return err 1272 } 1273 arr.AlertRule = &alertRule 1274 } 1275 case "id": 1276 if v != nil { 1277 var ID string 1278 err = json.Unmarshal(*v, &ID) 1279 if err != nil { 1280 return err 1281 } 1282 arr.ID = &ID 1283 } 1284 case "name": 1285 if v != nil { 1286 var name string 1287 err = json.Unmarshal(*v, &name) 1288 if err != nil { 1289 return err 1290 } 1291 arr.Name = &name 1292 } 1293 case "type": 1294 if v != nil { 1295 var typeVar string 1296 err = json.Unmarshal(*v, &typeVar) 1297 if err != nil { 1298 return err 1299 } 1300 arr.Type = &typeVar 1301 } 1302 case "location": 1303 if v != nil { 1304 var location string 1305 err = json.Unmarshal(*v, &location) 1306 if err != nil { 1307 return err 1308 } 1309 arr.Location = &location 1310 } 1311 case "tags": 1312 if v != nil { 1313 var tags map[string]*string 1314 err = json.Unmarshal(*v, &tags) 1315 if err != nil { 1316 return err 1317 } 1318 arr.Tags = tags 1319 } 1320 } 1321 } 1322 1323 return nil 1324} 1325 1326// AlertRuleResourceCollection represents a collection of alert rule resources. 1327type AlertRuleResourceCollection struct { 1328 autorest.Response `json:"-"` 1329 // Value - the values for the alert rule resources. 1330 Value *[]AlertRuleResource `json:"value,omitempty"` 1331} 1332 1333// AlertRuleResourcePatch the alert rule object for patch operations. 1334type AlertRuleResourcePatch struct { 1335 // Tags - Resource tags 1336 Tags map[string]*string `json:"tags"` 1337 // AlertRule - The properties of an alert rule. 1338 *AlertRule `json:"properties,omitempty"` 1339} 1340 1341// MarshalJSON is the custom marshaler for AlertRuleResourcePatch. 1342func (arrp AlertRuleResourcePatch) MarshalJSON() ([]byte, error) { 1343 objectMap := make(map[string]interface{}) 1344 if arrp.Tags != nil { 1345 objectMap["tags"] = arrp.Tags 1346 } 1347 if arrp.AlertRule != nil { 1348 objectMap["properties"] = arrp.AlertRule 1349 } 1350 return json.Marshal(objectMap) 1351} 1352 1353// UnmarshalJSON is the custom unmarshaler for AlertRuleResourcePatch struct. 1354func (arrp *AlertRuleResourcePatch) UnmarshalJSON(body []byte) error { 1355 var m map[string]*json.RawMessage 1356 err := json.Unmarshal(body, &m) 1357 if err != nil { 1358 return err 1359 } 1360 for k, v := range m { 1361 switch k { 1362 case "tags": 1363 if v != nil { 1364 var tags map[string]*string 1365 err = json.Unmarshal(*v, &tags) 1366 if err != nil { 1367 return err 1368 } 1369 arrp.Tags = tags 1370 } 1371 case "properties": 1372 if v != nil { 1373 var alertRule AlertRule 1374 err = json.Unmarshal(*v, &alertRule) 1375 if err != nil { 1376 return err 1377 } 1378 arrp.AlertRule = &alertRule 1379 } 1380 } 1381 } 1382 1383 return nil 1384} 1385 1386// ArmRoleReceiver an arm role receiver. 1387type ArmRoleReceiver struct { 1388 // Name - The name of the arm role receiver. Names must be unique across all receivers within an action group. 1389 Name *string `json:"name,omitempty"` 1390 // RoleID - The arm role id. 1391 RoleID *string `json:"roleId,omitempty"` 1392} 1393 1394// AutomationRunbookReceiver the Azure Automation Runbook notification receiver. 1395type AutomationRunbookReceiver struct { 1396 // AutomationAccountID - The Azure automation account Id which holds this runbook and authenticate to Azure resource. 1397 AutomationAccountID *string `json:"automationAccountId,omitempty"` 1398 // RunbookName - The name for this runbook. 1399 RunbookName *string `json:"runbookName,omitempty"` 1400 // WebhookResourceID - The resource id for webhook linked to this runbook. 1401 WebhookResourceID *string `json:"webhookResourceId,omitempty"` 1402 // IsGlobalRunbook - Indicates whether this instance is global runbook. 1403 IsGlobalRunbook *bool `json:"isGlobalRunbook,omitempty"` 1404 // Name - Indicates name of the webhook. 1405 Name *string `json:"name,omitempty"` 1406 // ServiceURI - The URI where webhooks should be sent. 1407 ServiceURI *string `json:"serviceUri,omitempty"` 1408} 1409 1410// AutoscaleNotification autoscale notification. 1411type AutoscaleNotification struct { 1412 // Operation - the operation associated with the notification and its value must be "scale" 1413 Operation *string `json:"operation,omitempty"` 1414 // Email - the email notification. 1415 Email *EmailNotification `json:"email,omitempty"` 1416 // Webhooks - the collection of webhook notifications. 1417 Webhooks *[]WebhookNotification `json:"webhooks,omitempty"` 1418} 1419 1420// AutoscaleProfile autoscale profile. 1421type AutoscaleProfile struct { 1422 // Name - the name of the profile. 1423 Name *string `json:"name,omitempty"` 1424 // Capacity - the number of instances that can be used during this profile. 1425 Capacity *ScaleCapacity `json:"capacity,omitempty"` 1426 // Rules - the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. 1427 Rules *[]ScaleRule `json:"rules,omitempty"` 1428 // FixedDate - the specific date-time for the profile. This element is not used if the Recurrence element is used. 1429 FixedDate *TimeWindow `json:"fixedDate,omitempty"` 1430 // Recurrence - the repeating times at which this profile begins. This element is not used if the FixedDate element is used. 1431 Recurrence *Recurrence `json:"recurrence,omitempty"` 1432} 1433 1434// AutoscaleSetting a setting that contains all of the configuration for the automatic scaling of a 1435// resource. 1436type AutoscaleSetting struct { 1437 // Profiles - the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified. 1438 Profiles *[]AutoscaleProfile `json:"profiles,omitempty"` 1439 // Notifications - the collection of notifications. 1440 Notifications *[]AutoscaleNotification `json:"notifications,omitempty"` 1441 // Enabled - the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'true'. 1442 Enabled *bool `json:"enabled,omitempty"` 1443 // Name - the name of the autoscale setting. 1444 Name *string `json:"name,omitempty"` 1445 // TargetResourceURI - the resource identifier of the resource that the autoscale setting should be added to. 1446 TargetResourceURI *string `json:"targetResourceUri,omitempty"` 1447} 1448 1449// AutoscaleSettingResource the autoscale setting resource. 1450type AutoscaleSettingResource struct { 1451 autorest.Response `json:"-"` 1452 // AutoscaleSetting - The autoscale setting of the resource. 1453 *AutoscaleSetting `json:"properties,omitempty"` 1454 // ID - READ-ONLY; Azure resource Id 1455 ID *string `json:"id,omitempty"` 1456 // Name - READ-ONLY; Azure resource name 1457 Name *string `json:"name,omitempty"` 1458 // Type - READ-ONLY; Azure resource type 1459 Type *string `json:"type,omitempty"` 1460 // Location - Resource location 1461 Location *string `json:"location,omitempty"` 1462 // Tags - Resource tags 1463 Tags map[string]*string `json:"tags"` 1464} 1465 1466// MarshalJSON is the custom marshaler for AutoscaleSettingResource. 1467func (asr AutoscaleSettingResource) MarshalJSON() ([]byte, error) { 1468 objectMap := make(map[string]interface{}) 1469 if asr.AutoscaleSetting != nil { 1470 objectMap["properties"] = asr.AutoscaleSetting 1471 } 1472 if asr.Location != nil { 1473 objectMap["location"] = asr.Location 1474 } 1475 if asr.Tags != nil { 1476 objectMap["tags"] = asr.Tags 1477 } 1478 return json.Marshal(objectMap) 1479} 1480 1481// UnmarshalJSON is the custom unmarshaler for AutoscaleSettingResource struct. 1482func (asr *AutoscaleSettingResource) UnmarshalJSON(body []byte) error { 1483 var m map[string]*json.RawMessage 1484 err := json.Unmarshal(body, &m) 1485 if err != nil { 1486 return err 1487 } 1488 for k, v := range m { 1489 switch k { 1490 case "properties": 1491 if v != nil { 1492 var autoscaleSetting AutoscaleSetting 1493 err = json.Unmarshal(*v, &autoscaleSetting) 1494 if err != nil { 1495 return err 1496 } 1497 asr.AutoscaleSetting = &autoscaleSetting 1498 } 1499 case "id": 1500 if v != nil { 1501 var ID string 1502 err = json.Unmarshal(*v, &ID) 1503 if err != nil { 1504 return err 1505 } 1506 asr.ID = &ID 1507 } 1508 case "name": 1509 if v != nil { 1510 var name string 1511 err = json.Unmarshal(*v, &name) 1512 if err != nil { 1513 return err 1514 } 1515 asr.Name = &name 1516 } 1517 case "type": 1518 if v != nil { 1519 var typeVar string 1520 err = json.Unmarshal(*v, &typeVar) 1521 if err != nil { 1522 return err 1523 } 1524 asr.Type = &typeVar 1525 } 1526 case "location": 1527 if v != nil { 1528 var location string 1529 err = json.Unmarshal(*v, &location) 1530 if err != nil { 1531 return err 1532 } 1533 asr.Location = &location 1534 } 1535 case "tags": 1536 if v != nil { 1537 var tags map[string]*string 1538 err = json.Unmarshal(*v, &tags) 1539 if err != nil { 1540 return err 1541 } 1542 asr.Tags = tags 1543 } 1544 } 1545 } 1546 1547 return nil 1548} 1549 1550// AutoscaleSettingResourceCollection represents a collection of autoscale setting resources. 1551type AutoscaleSettingResourceCollection struct { 1552 autorest.Response `json:"-"` 1553 // Value - the values for the autoscale setting resources. 1554 Value *[]AutoscaleSettingResource `json:"value,omitempty"` 1555 // NextLink - URL to get the next set of results. 1556 NextLink *string `json:"nextLink,omitempty"` 1557} 1558 1559// AutoscaleSettingResourceCollectionIterator provides access to a complete listing of 1560// AutoscaleSettingResource values. 1561type AutoscaleSettingResourceCollectionIterator struct { 1562 i int 1563 page AutoscaleSettingResourceCollectionPage 1564} 1565 1566// NextWithContext advances to the next value. If there was an error making 1567// the request the iterator does not advance and the error is returned. 1568func (iter *AutoscaleSettingResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1569 if tracing.IsEnabled() { 1570 ctx = tracing.StartSpan(ctx, fqdn+"/AutoscaleSettingResourceCollectionIterator.NextWithContext") 1571 defer func() { 1572 sc := -1 1573 if iter.Response().Response.Response != nil { 1574 sc = iter.Response().Response.Response.StatusCode 1575 } 1576 tracing.EndSpan(ctx, sc, err) 1577 }() 1578 } 1579 iter.i++ 1580 if iter.i < len(iter.page.Values()) { 1581 return nil 1582 } 1583 err = iter.page.NextWithContext(ctx) 1584 if err != nil { 1585 iter.i-- 1586 return err 1587 } 1588 iter.i = 0 1589 return nil 1590} 1591 1592// Next advances to the next value. If there was an error making 1593// the request the iterator does not advance and the error is returned. 1594// Deprecated: Use NextWithContext() instead. 1595func (iter *AutoscaleSettingResourceCollectionIterator) Next() error { 1596 return iter.NextWithContext(context.Background()) 1597} 1598 1599// NotDone returns true if the enumeration should be started or is not yet complete. 1600func (iter AutoscaleSettingResourceCollectionIterator) NotDone() bool { 1601 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1602} 1603 1604// Response returns the raw server response from the last page request. 1605func (iter AutoscaleSettingResourceCollectionIterator) Response() AutoscaleSettingResourceCollection { 1606 return iter.page.Response() 1607} 1608 1609// Value returns the current value or a zero-initialized value if the 1610// iterator has advanced beyond the end of the collection. 1611func (iter AutoscaleSettingResourceCollectionIterator) Value() AutoscaleSettingResource { 1612 if !iter.page.NotDone() { 1613 return AutoscaleSettingResource{} 1614 } 1615 return iter.page.Values()[iter.i] 1616} 1617 1618// Creates a new instance of the AutoscaleSettingResourceCollectionIterator type. 1619func NewAutoscaleSettingResourceCollectionIterator(page AutoscaleSettingResourceCollectionPage) AutoscaleSettingResourceCollectionIterator { 1620 return AutoscaleSettingResourceCollectionIterator{page: page} 1621} 1622 1623// IsEmpty returns true if the ListResult contains no values. 1624func (asrc AutoscaleSettingResourceCollection) IsEmpty() bool { 1625 return asrc.Value == nil || len(*asrc.Value) == 0 1626} 1627 1628// autoscaleSettingResourceCollectionPreparer prepares a request to retrieve the next set of results. 1629// It returns nil if no more results exist. 1630func (asrc AutoscaleSettingResourceCollection) autoscaleSettingResourceCollectionPreparer(ctx context.Context) (*http.Request, error) { 1631 if asrc.NextLink == nil || len(to.String(asrc.NextLink)) < 1 { 1632 return nil, nil 1633 } 1634 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1635 autorest.AsJSON(), 1636 autorest.AsGet(), 1637 autorest.WithBaseURL(to.String(asrc.NextLink))) 1638} 1639 1640// AutoscaleSettingResourceCollectionPage contains a page of AutoscaleSettingResource values. 1641type AutoscaleSettingResourceCollectionPage struct { 1642 fn func(context.Context, AutoscaleSettingResourceCollection) (AutoscaleSettingResourceCollection, error) 1643 asrc AutoscaleSettingResourceCollection 1644} 1645 1646// NextWithContext advances to the next page of values. If there was an error making 1647// the request the page does not advance and the error is returned. 1648func (page *AutoscaleSettingResourceCollectionPage) NextWithContext(ctx context.Context) (err error) { 1649 if tracing.IsEnabled() { 1650 ctx = tracing.StartSpan(ctx, fqdn+"/AutoscaleSettingResourceCollectionPage.NextWithContext") 1651 defer func() { 1652 sc := -1 1653 if page.Response().Response.Response != nil { 1654 sc = page.Response().Response.Response.StatusCode 1655 } 1656 tracing.EndSpan(ctx, sc, err) 1657 }() 1658 } 1659 next, err := page.fn(ctx, page.asrc) 1660 if err != nil { 1661 return err 1662 } 1663 page.asrc = next 1664 return nil 1665} 1666 1667// Next advances to the next page of values. If there was an error making 1668// the request the page does not advance and the error is returned. 1669// Deprecated: Use NextWithContext() instead. 1670func (page *AutoscaleSettingResourceCollectionPage) Next() error { 1671 return page.NextWithContext(context.Background()) 1672} 1673 1674// NotDone returns true if the page enumeration should be started or is not yet complete. 1675func (page AutoscaleSettingResourceCollectionPage) NotDone() bool { 1676 return !page.asrc.IsEmpty() 1677} 1678 1679// Response returns the raw server response from the last page request. 1680func (page AutoscaleSettingResourceCollectionPage) Response() AutoscaleSettingResourceCollection { 1681 return page.asrc 1682} 1683 1684// Values returns the slice of values for the current page or nil if there are no values. 1685func (page AutoscaleSettingResourceCollectionPage) Values() []AutoscaleSettingResource { 1686 if page.asrc.IsEmpty() { 1687 return nil 1688 } 1689 return *page.asrc.Value 1690} 1691 1692// Creates a new instance of the AutoscaleSettingResourceCollectionPage type. 1693func NewAutoscaleSettingResourceCollectionPage(getNextPage func(context.Context, AutoscaleSettingResourceCollection) (AutoscaleSettingResourceCollection, error)) AutoscaleSettingResourceCollectionPage { 1694 return AutoscaleSettingResourceCollectionPage{fn: getNextPage} 1695} 1696 1697// AutoscaleSettingResourcePatch the autoscale setting object for patch operations. 1698type AutoscaleSettingResourcePatch struct { 1699 // Tags - Resource tags 1700 Tags map[string]*string `json:"tags"` 1701 // AutoscaleSetting - The autoscale setting properties of the update operation. 1702 *AutoscaleSetting `json:"properties,omitempty"` 1703} 1704 1705// MarshalJSON is the custom marshaler for AutoscaleSettingResourcePatch. 1706func (asrp AutoscaleSettingResourcePatch) MarshalJSON() ([]byte, error) { 1707 objectMap := make(map[string]interface{}) 1708 if asrp.Tags != nil { 1709 objectMap["tags"] = asrp.Tags 1710 } 1711 if asrp.AutoscaleSetting != nil { 1712 objectMap["properties"] = asrp.AutoscaleSetting 1713 } 1714 return json.Marshal(objectMap) 1715} 1716 1717// UnmarshalJSON is the custom unmarshaler for AutoscaleSettingResourcePatch struct. 1718func (asrp *AutoscaleSettingResourcePatch) UnmarshalJSON(body []byte) error { 1719 var m map[string]*json.RawMessage 1720 err := json.Unmarshal(body, &m) 1721 if err != nil { 1722 return err 1723 } 1724 for k, v := range m { 1725 switch k { 1726 case "tags": 1727 if v != nil { 1728 var tags map[string]*string 1729 err = json.Unmarshal(*v, &tags) 1730 if err != nil { 1731 return err 1732 } 1733 asrp.Tags = tags 1734 } 1735 case "properties": 1736 if v != nil { 1737 var autoscaleSetting AutoscaleSetting 1738 err = json.Unmarshal(*v, &autoscaleSetting) 1739 if err != nil { 1740 return err 1741 } 1742 asrp.AutoscaleSetting = &autoscaleSetting 1743 } 1744 } 1745 } 1746 1747 return nil 1748} 1749 1750// AzNsActionGroup azure action group 1751type AzNsActionGroup struct { 1752 // ActionGroup - Azure Action Group reference. 1753 ActionGroup *[]string `json:"actionGroup,omitempty"` 1754 // EmailSubject - Custom subject override for all email ids in Azure action group 1755 EmailSubject *string `json:"emailSubject,omitempty"` 1756 // CustomWebhookPayload - Custom payload to be sent for all webhook URI in Azure action group 1757 CustomWebhookPayload *string `json:"customWebhookPayload,omitempty"` 1758} 1759 1760// AzureAppPushReceiver the Azure mobile App push notification receiver. 1761type AzureAppPushReceiver struct { 1762 // Name - The name of the Azure mobile app push receiver. Names must be unique across all receivers within an action group. 1763 Name *string `json:"name,omitempty"` 1764 // EmailAddress - The email address registered for the Azure mobile app. 1765 EmailAddress *string `json:"emailAddress,omitempty"` 1766} 1767 1768// AzureFunctionReceiver an azure function receiver. 1769type AzureFunctionReceiver struct { 1770 // Name - The name of the azure function receiver. Names must be unique across all receivers within an action group. 1771 Name *string `json:"name,omitempty"` 1772 // FunctionAppResourceID - The azure resource id of the function app. 1773 FunctionAppResourceID *string `json:"functionAppResourceId,omitempty"` 1774 // FunctionName - The function name in the function app. 1775 FunctionName *string `json:"functionName,omitempty"` 1776 // HTTPTriggerURL - The http trigger url where http request sent to. 1777 HTTPTriggerURL *string `json:"httpTriggerUrl,omitempty"` 1778} 1779 1780// Baseline the baseline values for a single sensitivity value. 1781type Baseline struct { 1782 // Sensitivity - the sensitivity of the baseline. Possible values include: 'Low', 'Medium', 'High' 1783 Sensitivity Sensitivity `json:"sensitivity,omitempty"` 1784 // LowThresholds - The low thresholds of the baseline. 1785 LowThresholds *[]float64 `json:"lowThresholds,omitempty"` 1786 // HighThresholds - The high thresholds of the baseline. 1787 HighThresholds *[]float64 `json:"highThresholds,omitempty"` 1788} 1789 1790// BaselineMetadataValue represents a baseline metadata value. 1791type BaselineMetadataValue struct { 1792 // Name - the name of the metadata. 1793 Name *LocalizableString `json:"name,omitempty"` 1794 // Value - the value of the metadata. 1795 Value *string `json:"value,omitempty"` 1796} 1797 1798// BaselineProperties the baseline properties class. 1799type BaselineProperties struct { 1800 // Timespan - The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally requested. 1801 Timespan *string `json:"timespan,omitempty"` 1802 // Interval - The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned back from what was originally requested. This is not present if a metadata request was made. 1803 Interval *string `json:"interval,omitempty"` 1804 // Aggregation - The aggregation type of the metric. 1805 Aggregation *string `json:"aggregation,omitempty"` 1806 // Timestamps - the array of timestamps of the baselines. 1807 Timestamps *[]date.Time `json:"timestamps,omitempty"` 1808 // Baseline - the baseline values for each sensitivity. 1809 Baseline *[]Baseline `json:"baseline,omitempty"` 1810 // Metadata - the baseline metadata values. 1811 Metadata *[]BaselineMetadataValue `json:"metadata,omitempty"` 1812} 1813 1814// BaselineResponse the response to a baseline query. 1815type BaselineResponse struct { 1816 autorest.Response `json:"-"` 1817 // ID - READ-ONLY; the metric baseline Id. 1818 ID *string `json:"id,omitempty"` 1819 // Type - READ-ONLY; the resource type of the baseline resource. 1820 Type *string `json:"type,omitempty"` 1821 // Name - READ-ONLY; the name and the display name of the metric, i.e. it is localizable string. 1822 Name *LocalizableString `json:"name,omitempty"` 1823 // BaselineProperties - the properties of the baseline. 1824 *BaselineProperties `json:"properties,omitempty"` 1825} 1826 1827// MarshalJSON is the custom marshaler for BaselineResponse. 1828func (br BaselineResponse) MarshalJSON() ([]byte, error) { 1829 objectMap := make(map[string]interface{}) 1830 if br.BaselineProperties != nil { 1831 objectMap["properties"] = br.BaselineProperties 1832 } 1833 return json.Marshal(objectMap) 1834} 1835 1836// UnmarshalJSON is the custom unmarshaler for BaselineResponse struct. 1837func (br *BaselineResponse) UnmarshalJSON(body []byte) error { 1838 var m map[string]*json.RawMessage 1839 err := json.Unmarshal(body, &m) 1840 if err != nil { 1841 return err 1842 } 1843 for k, v := range m { 1844 switch k { 1845 case "id": 1846 if v != nil { 1847 var ID string 1848 err = json.Unmarshal(*v, &ID) 1849 if err != nil { 1850 return err 1851 } 1852 br.ID = &ID 1853 } 1854 case "type": 1855 if v != nil { 1856 var typeVar string 1857 err = json.Unmarshal(*v, &typeVar) 1858 if err != nil { 1859 return err 1860 } 1861 br.Type = &typeVar 1862 } 1863 case "name": 1864 if v != nil { 1865 var name LocalizableString 1866 err = json.Unmarshal(*v, &name) 1867 if err != nil { 1868 return err 1869 } 1870 br.Name = &name 1871 } 1872 case "properties": 1873 if v != nil { 1874 var baselineProperties BaselineProperties 1875 err = json.Unmarshal(*v, &baselineProperties) 1876 if err != nil { 1877 return err 1878 } 1879 br.BaselineProperties = &baselineProperties 1880 } 1881 } 1882 } 1883 1884 return nil 1885} 1886 1887// CalculateBaselineResponse the response to a calculate baseline call. 1888type CalculateBaselineResponse struct { 1889 autorest.Response `json:"-"` 1890 // Type - the resource type of the baseline resource. 1891 Type *string `json:"type,omitempty"` 1892 // Timestamps - the array of timestamps of the baselines. 1893 Timestamps *[]date.Time `json:"timestamps,omitempty"` 1894 // Baseline - the baseline values for each sensitivity. 1895 Baseline *[]Baseline `json:"baseline,omitempty"` 1896} 1897 1898// Criteria specifies the criteria for converting log to metric. 1899type Criteria struct { 1900 // MetricName - Name of the metric 1901 MetricName *string `json:"metricName,omitempty"` 1902 // Dimensions - List of Dimensions for creating metric 1903 Dimensions *[]Dimension `json:"dimensions,omitempty"` 1904} 1905 1906// DataContainer information about a container with data for a given resource. 1907type DataContainer struct { 1908 // Workspace - Log Analytics workspace information. 1909 Workspace *WorkspaceInfo `json:"workspace,omitempty"` 1910} 1911 1912// DiagnosticSettings the diagnostic settings. 1913type DiagnosticSettings struct { 1914 // StorageAccountID - The resource ID of the storage account to which you would like to send Diagnostic Logs. 1915 StorageAccountID *string `json:"storageAccountId,omitempty"` 1916 // ServiceBusRuleID - The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility. 1917 ServiceBusRuleID *string `json:"serviceBusRuleId,omitempty"` 1918 // EventHubAuthorizationRuleID - The resource Id for the event hub authorization rule. 1919 EventHubAuthorizationRuleID *string `json:"eventHubAuthorizationRuleId,omitempty"` 1920 // EventHubName - The name of the event hub. If none is specified, the default event hub will be selected. 1921 EventHubName *string `json:"eventHubName,omitempty"` 1922 // Metrics - The list of metric settings. 1923 Metrics *[]MetricSettings `json:"metrics,omitempty"` 1924 // Logs - The list of logs settings. 1925 Logs *[]LogSettings `json:"logs,omitempty"` 1926 // WorkspaceID - The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 1927 WorkspaceID *string `json:"workspaceId,omitempty"` 1928 // LogAnalyticsDestinationType - A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type constructed as follows: <normalized service identity>_<normalized category name>. Possible values are: Dedicated and null (null is default.) 1929 LogAnalyticsDestinationType *string `json:"logAnalyticsDestinationType,omitempty"` 1930} 1931 1932// DiagnosticSettingsCategory the diagnostic settings Category. 1933type DiagnosticSettingsCategory struct { 1934 // CategoryType - The type of the diagnostic settings category. Possible values include: 'Metrics', 'Logs' 1935 CategoryType CategoryType `json:"categoryType,omitempty"` 1936} 1937 1938// DiagnosticSettingsCategoryResource the diagnostic settings category resource. 1939type DiagnosticSettingsCategoryResource struct { 1940 autorest.Response `json:"-"` 1941 // DiagnosticSettingsCategory - The properties of a Diagnostic Settings Category. 1942 *DiagnosticSettingsCategory `json:"properties,omitempty"` 1943 // ID - READ-ONLY; Azure resource Id 1944 ID *string `json:"id,omitempty"` 1945 // Name - READ-ONLY; Azure resource name 1946 Name *string `json:"name,omitempty"` 1947 // Type - READ-ONLY; Azure resource type 1948 Type *string `json:"type,omitempty"` 1949} 1950 1951// MarshalJSON is the custom marshaler for DiagnosticSettingsCategoryResource. 1952func (dscr DiagnosticSettingsCategoryResource) MarshalJSON() ([]byte, error) { 1953 objectMap := make(map[string]interface{}) 1954 if dscr.DiagnosticSettingsCategory != nil { 1955 objectMap["properties"] = dscr.DiagnosticSettingsCategory 1956 } 1957 return json.Marshal(objectMap) 1958} 1959 1960// UnmarshalJSON is the custom unmarshaler for DiagnosticSettingsCategoryResource struct. 1961func (dscr *DiagnosticSettingsCategoryResource) UnmarshalJSON(body []byte) error { 1962 var m map[string]*json.RawMessage 1963 err := json.Unmarshal(body, &m) 1964 if err != nil { 1965 return err 1966 } 1967 for k, v := range m { 1968 switch k { 1969 case "properties": 1970 if v != nil { 1971 var diagnosticSettingsCategory DiagnosticSettingsCategory 1972 err = json.Unmarshal(*v, &diagnosticSettingsCategory) 1973 if err != nil { 1974 return err 1975 } 1976 dscr.DiagnosticSettingsCategory = &diagnosticSettingsCategory 1977 } 1978 case "id": 1979 if v != nil { 1980 var ID string 1981 err = json.Unmarshal(*v, &ID) 1982 if err != nil { 1983 return err 1984 } 1985 dscr.ID = &ID 1986 } 1987 case "name": 1988 if v != nil { 1989 var name string 1990 err = json.Unmarshal(*v, &name) 1991 if err != nil { 1992 return err 1993 } 1994 dscr.Name = &name 1995 } 1996 case "type": 1997 if v != nil { 1998 var typeVar string 1999 err = json.Unmarshal(*v, &typeVar) 2000 if err != nil { 2001 return err 2002 } 2003 dscr.Type = &typeVar 2004 } 2005 } 2006 } 2007 2008 return nil 2009} 2010 2011// DiagnosticSettingsCategoryResourceCollection represents a collection of diagnostic setting category 2012// resources. 2013type DiagnosticSettingsCategoryResourceCollection struct { 2014 autorest.Response `json:"-"` 2015 // Value - The collection of diagnostic settings category resources. 2016 Value *[]DiagnosticSettingsCategoryResource `json:"value,omitempty"` 2017} 2018 2019// DiagnosticSettingsResource the diagnostic setting resource. 2020type DiagnosticSettingsResource struct { 2021 autorest.Response `json:"-"` 2022 // DiagnosticSettings - Properties of a Diagnostic Settings Resource. 2023 *DiagnosticSettings `json:"properties,omitempty"` 2024 // ID - READ-ONLY; Azure resource Id 2025 ID *string `json:"id,omitempty"` 2026 // Name - READ-ONLY; Azure resource name 2027 Name *string `json:"name,omitempty"` 2028 // Type - READ-ONLY; Azure resource type 2029 Type *string `json:"type,omitempty"` 2030} 2031 2032// MarshalJSON is the custom marshaler for DiagnosticSettingsResource. 2033func (dsr DiagnosticSettingsResource) MarshalJSON() ([]byte, error) { 2034 objectMap := make(map[string]interface{}) 2035 if dsr.DiagnosticSettings != nil { 2036 objectMap["properties"] = dsr.DiagnosticSettings 2037 } 2038 return json.Marshal(objectMap) 2039} 2040 2041// UnmarshalJSON is the custom unmarshaler for DiagnosticSettingsResource struct. 2042func (dsr *DiagnosticSettingsResource) UnmarshalJSON(body []byte) error { 2043 var m map[string]*json.RawMessage 2044 err := json.Unmarshal(body, &m) 2045 if err != nil { 2046 return err 2047 } 2048 for k, v := range m { 2049 switch k { 2050 case "properties": 2051 if v != nil { 2052 var diagnosticSettings DiagnosticSettings 2053 err = json.Unmarshal(*v, &diagnosticSettings) 2054 if err != nil { 2055 return err 2056 } 2057 dsr.DiagnosticSettings = &diagnosticSettings 2058 } 2059 case "id": 2060 if v != nil { 2061 var ID string 2062 err = json.Unmarshal(*v, &ID) 2063 if err != nil { 2064 return err 2065 } 2066 dsr.ID = &ID 2067 } 2068 case "name": 2069 if v != nil { 2070 var name string 2071 err = json.Unmarshal(*v, &name) 2072 if err != nil { 2073 return err 2074 } 2075 dsr.Name = &name 2076 } 2077 case "type": 2078 if v != nil { 2079 var typeVar string 2080 err = json.Unmarshal(*v, &typeVar) 2081 if err != nil { 2082 return err 2083 } 2084 dsr.Type = &typeVar 2085 } 2086 } 2087 } 2088 2089 return nil 2090} 2091 2092// DiagnosticSettingsResourceCollection represents a collection of alert rule resources. 2093type DiagnosticSettingsResourceCollection struct { 2094 autorest.Response `json:"-"` 2095 // Value - The collection of diagnostic settings resources;. 2096 Value *[]DiagnosticSettingsResource `json:"value,omitempty"` 2097} 2098 2099// Dimension specifies the criteria for converting log to metric. 2100type Dimension struct { 2101 // Name - Name of the dimension 2102 Name *string `json:"name,omitempty"` 2103 // Operator - Operator for dimension values 2104 Operator *string `json:"operator,omitempty"` 2105 // Values - List of dimension values 2106 Values *[]string `json:"values,omitempty"` 2107} 2108 2109// DynamicMetricCriteria criterion for dynamic threshold. 2110type DynamicMetricCriteria struct { 2111 // Operator - The operator used to compare the metric value against the threshold. 2112 Operator interface{} `json:"operator,omitempty"` 2113 // AlertSensitivity - The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern. 2114 AlertSensitivity interface{} `json:"alertSensitivity,omitempty"` 2115 // FailingPeriods - The minimum number of violations required within the selected lookback time window required to raise an alert. 2116 FailingPeriods *DynamicThresholdFailingPeriods `json:"failingPeriods,omitempty"` 2117 // IgnoreDataBefore - Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format) 2118 IgnoreDataBefore *date.Time `json:"ignoreDataBefore,omitempty"` 2119 // AdditionalProperties - Unmatched properties from the message are deserialized this collection 2120 AdditionalProperties map[string]interface{} `json:""` 2121 // Name - Name of the criteria. 2122 Name *string `json:"name,omitempty"` 2123 // MetricName - Name of the metric. 2124 MetricName *string `json:"metricName,omitempty"` 2125 // MetricNamespace - Namespace of the metric. 2126 MetricNamespace *string `json:"metricNamespace,omitempty"` 2127 // TimeAggregation - the criteria time aggregation types. 2128 TimeAggregation interface{} `json:"timeAggregation,omitempty"` 2129 // Dimensions - List of dimension conditions. 2130 Dimensions *[]MetricDimension `json:"dimensions,omitempty"` 2131 // CriterionType - Possible values include: 'CriterionTypeMultiMetricCriteria', 'CriterionTypeStaticThresholdCriterion', 'CriterionTypeDynamicThresholdCriterion' 2132 CriterionType CriterionType `json:"criterionType,omitempty"` 2133} 2134 2135// MarshalJSON is the custom marshaler for DynamicMetricCriteria. 2136func (dmc DynamicMetricCriteria) MarshalJSON() ([]byte, error) { 2137 dmc.CriterionType = CriterionTypeDynamicThresholdCriterion 2138 objectMap := make(map[string]interface{}) 2139 if dmc.Operator != nil { 2140 objectMap["operator"] = dmc.Operator 2141 } 2142 if dmc.AlertSensitivity != nil { 2143 objectMap["alertSensitivity"] = dmc.AlertSensitivity 2144 } 2145 if dmc.FailingPeriods != nil { 2146 objectMap["failingPeriods"] = dmc.FailingPeriods 2147 } 2148 if dmc.IgnoreDataBefore != nil { 2149 objectMap["ignoreDataBefore"] = dmc.IgnoreDataBefore 2150 } 2151 if dmc.Name != nil { 2152 objectMap["name"] = dmc.Name 2153 } 2154 if dmc.MetricName != nil { 2155 objectMap["metricName"] = dmc.MetricName 2156 } 2157 if dmc.MetricNamespace != nil { 2158 objectMap["metricNamespace"] = dmc.MetricNamespace 2159 } 2160 if dmc.TimeAggregation != nil { 2161 objectMap["timeAggregation"] = dmc.TimeAggregation 2162 } 2163 if dmc.Dimensions != nil { 2164 objectMap["dimensions"] = dmc.Dimensions 2165 } 2166 if dmc.CriterionType != "" { 2167 objectMap["criterionType"] = dmc.CriterionType 2168 } 2169 for k, v := range dmc.AdditionalProperties { 2170 objectMap[k] = v 2171 } 2172 return json.Marshal(objectMap) 2173} 2174 2175// AsMetricCriteria is the BasicMultiMetricCriteria implementation for DynamicMetricCriteria. 2176func (dmc DynamicMetricCriteria) AsMetricCriteria() (*MetricCriteria, bool) { 2177 return nil, false 2178} 2179 2180// AsDynamicMetricCriteria is the BasicMultiMetricCriteria implementation for DynamicMetricCriteria. 2181func (dmc DynamicMetricCriteria) AsDynamicMetricCriteria() (*DynamicMetricCriteria, bool) { 2182 return &dmc, true 2183} 2184 2185// AsMultiMetricCriteria is the BasicMultiMetricCriteria implementation for DynamicMetricCriteria. 2186func (dmc DynamicMetricCriteria) AsMultiMetricCriteria() (*MultiMetricCriteria, bool) { 2187 return nil, false 2188} 2189 2190// AsBasicMultiMetricCriteria is the BasicMultiMetricCriteria implementation for DynamicMetricCriteria. 2191func (dmc DynamicMetricCriteria) AsBasicMultiMetricCriteria() (BasicMultiMetricCriteria, bool) { 2192 return &dmc, true 2193} 2194 2195// UnmarshalJSON is the custom unmarshaler for DynamicMetricCriteria struct. 2196func (dmc *DynamicMetricCriteria) UnmarshalJSON(body []byte) error { 2197 var m map[string]*json.RawMessage 2198 err := json.Unmarshal(body, &m) 2199 if err != nil { 2200 return err 2201 } 2202 for k, v := range m { 2203 switch k { 2204 case "operator": 2205 if v != nil { 2206 var operator interface{} 2207 err = json.Unmarshal(*v, &operator) 2208 if err != nil { 2209 return err 2210 } 2211 dmc.Operator = operator 2212 } 2213 case "alertSensitivity": 2214 if v != nil { 2215 var alertSensitivity interface{} 2216 err = json.Unmarshal(*v, &alertSensitivity) 2217 if err != nil { 2218 return err 2219 } 2220 dmc.AlertSensitivity = alertSensitivity 2221 } 2222 case "failingPeriods": 2223 if v != nil { 2224 var failingPeriods DynamicThresholdFailingPeriods 2225 err = json.Unmarshal(*v, &failingPeriods) 2226 if err != nil { 2227 return err 2228 } 2229 dmc.FailingPeriods = &failingPeriods 2230 } 2231 case "ignoreDataBefore": 2232 if v != nil { 2233 var ignoreDataBefore date.Time 2234 err = json.Unmarshal(*v, &ignoreDataBefore) 2235 if err != nil { 2236 return err 2237 } 2238 dmc.IgnoreDataBefore = &ignoreDataBefore 2239 } 2240 default: 2241 if v != nil { 2242 var additionalProperties interface{} 2243 err = json.Unmarshal(*v, &additionalProperties) 2244 if err != nil { 2245 return err 2246 } 2247 if dmc.AdditionalProperties == nil { 2248 dmc.AdditionalProperties = make(map[string]interface{}) 2249 } 2250 dmc.AdditionalProperties[k] = additionalProperties 2251 } 2252 case "name": 2253 if v != nil { 2254 var name string 2255 err = json.Unmarshal(*v, &name) 2256 if err != nil { 2257 return err 2258 } 2259 dmc.Name = &name 2260 } 2261 case "metricName": 2262 if v != nil { 2263 var metricName string 2264 err = json.Unmarshal(*v, &metricName) 2265 if err != nil { 2266 return err 2267 } 2268 dmc.MetricName = &metricName 2269 } 2270 case "metricNamespace": 2271 if v != nil { 2272 var metricNamespace string 2273 err = json.Unmarshal(*v, &metricNamespace) 2274 if err != nil { 2275 return err 2276 } 2277 dmc.MetricNamespace = &metricNamespace 2278 } 2279 case "timeAggregation": 2280 if v != nil { 2281 var timeAggregation interface{} 2282 err = json.Unmarshal(*v, &timeAggregation) 2283 if err != nil { 2284 return err 2285 } 2286 dmc.TimeAggregation = timeAggregation 2287 } 2288 case "dimensions": 2289 if v != nil { 2290 var dimensions []MetricDimension 2291 err = json.Unmarshal(*v, &dimensions) 2292 if err != nil { 2293 return err 2294 } 2295 dmc.Dimensions = &dimensions 2296 } 2297 case "criterionType": 2298 if v != nil { 2299 var criterionType CriterionType 2300 err = json.Unmarshal(*v, &criterionType) 2301 if err != nil { 2302 return err 2303 } 2304 dmc.CriterionType = criterionType 2305 } 2306 } 2307 } 2308 2309 return nil 2310} 2311 2312// DynamicThresholdFailingPeriods the minimum number of violations required within the selected lookback 2313// time window required to raise an alert. 2314type DynamicThresholdFailingPeriods struct { 2315 // NumberOfEvaluationPeriods - The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points. 2316 NumberOfEvaluationPeriods *float64 `json:"numberOfEvaluationPeriods,omitempty"` 2317 // MinFailingPeriodsToAlert - The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. 2318 MinFailingPeriodsToAlert *float64 `json:"minFailingPeriodsToAlert,omitempty"` 2319} 2320 2321// EmailNotification email notification of an autoscale event. 2322type EmailNotification struct { 2323 // SendToSubscriptionAdministrator - a value indicating whether to send email to subscription administrator. 2324 SendToSubscriptionAdministrator *bool `json:"sendToSubscriptionAdministrator,omitempty"` 2325 // SendToSubscriptionCoAdministrators - a value indicating whether to send email to subscription co-administrators. 2326 SendToSubscriptionCoAdministrators *bool `json:"sendToSubscriptionCoAdministrators,omitempty"` 2327 // CustomEmails - the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. 2328 CustomEmails *[]string `json:"customEmails,omitempty"` 2329} 2330 2331// EmailReceiver an email receiver. 2332type EmailReceiver struct { 2333 // Name - The name of the email receiver. Names must be unique across all receivers within an action group. 2334 Name *string `json:"name,omitempty"` 2335 // EmailAddress - The email address of this receiver. 2336 EmailAddress *string `json:"emailAddress,omitempty"` 2337 // Status - READ-ONLY; The receiver status of the e-mail. Possible values include: 'ReceiverStatusNotSpecified', 'ReceiverStatusEnabled', 'ReceiverStatusDisabled' 2338 Status ReceiverStatus `json:"status,omitempty"` 2339} 2340 2341// EnableRequest describes a receiver that should be resubscribed. 2342type EnableRequest struct { 2343 // ReceiverName - The name of the receiver to resubscribe. 2344 ReceiverName *string `json:"receiverName,omitempty"` 2345} 2346 2347// Error error details. 2348type Error struct { 2349 // Code - Error code identifying the specific error. 2350 Code *string `json:"code,omitempty"` 2351 // Message - Error message in the caller's locale. 2352 Message *string `json:"message,omitempty"` 2353} 2354 2355// ErrorResponse describes the format of Error response. 2356type ErrorResponse struct { 2357 // Code - Error code 2358 Code *string `json:"code,omitempty"` 2359 // Message - Error message indicating why the operation failed. 2360 Message *string `json:"message,omitempty"` 2361} 2362 2363// EventCategoryCollection a collection of event categories. Currently possible values are: Administrative, 2364// Security, ServiceHealth, Alert, Recommendation, Policy. 2365type EventCategoryCollection struct { 2366 autorest.Response `json:"-"` 2367 // Value - the list that includes the Azure event categories. 2368 Value *[]LocalizableString `json:"value,omitempty"` 2369} 2370 2371// EventData the Azure event log entries are of type EventData 2372type EventData struct { 2373 // Authorization - READ-ONLY; The sender authorization information. 2374 Authorization *SenderAuthorization `json:"authorization,omitempty"` 2375 // Claims - READ-ONLY; key value pairs to identify ARM permissions. 2376 Claims map[string]*string `json:"claims"` 2377 // Caller - READ-ONLY; the email address of the user who has performed the operation, the UPN claim or SPN claim based on availability. 2378 Caller *string `json:"caller,omitempty"` 2379 // Description - READ-ONLY; the description of the event. 2380 Description *string `json:"description,omitempty"` 2381 // ID - READ-ONLY; the Id of this event as required by ARM for RBAC. It contains the EventDataID and a timestamp information. 2382 ID *string `json:"id,omitempty"` 2383 // EventDataID - READ-ONLY; the event data Id. This is a unique identifier for an event. 2384 EventDataID *string `json:"eventDataId,omitempty"` 2385 // CorrelationID - READ-ONLY; the correlation Id, usually a GUID in the string format. The correlation Id is shared among the events that belong to the same uber operation. 2386 CorrelationID *string `json:"correlationId,omitempty"` 2387 // EventName - READ-ONLY; the event name. This value should not be confused with OperationName. For practical purposes, OperationName might be more appealing to end users. 2388 EventName *LocalizableString `json:"eventName,omitempty"` 2389 // Category - READ-ONLY; the event category. 2390 Category *LocalizableString `json:"category,omitempty"` 2391 // HTTPRequest - READ-ONLY; the HTTP request info. Usually includes the 'clientRequestId', 'clientIpAddress' (IP address of the user who initiated the event) and 'method' (HTTP method e.g. PUT). 2392 HTTPRequest *HTTPRequestInfo `json:"httpRequest,omitempty"` 2393 // Level - READ-ONLY; the event level. Possible values include: 'EventLevelCritical', 'EventLevelError', 'EventLevelWarning', 'EventLevelInformational', 'EventLevelVerbose' 2394 Level EventLevel `json:"level,omitempty"` 2395 // ResourceGroupName - READ-ONLY; the resource group name of the impacted resource. 2396 ResourceGroupName *string `json:"resourceGroupName,omitempty"` 2397 // ResourceProviderName - READ-ONLY; the resource provider name of the impacted resource. 2398 ResourceProviderName *LocalizableString `json:"resourceProviderName,omitempty"` 2399 // ResourceID - READ-ONLY; the resource uri that uniquely identifies the resource that caused this event. 2400 ResourceID *string `json:"resourceId,omitempty"` 2401 // ResourceType - READ-ONLY; the resource type 2402 ResourceType *LocalizableString `json:"resourceType,omitempty"` 2403 // OperationID - READ-ONLY; It is usually a GUID shared among the events corresponding to single operation. This value should not be confused with EventName. 2404 OperationID *string `json:"operationId,omitempty"` 2405 // OperationName - READ-ONLY; the operation name. 2406 OperationName *LocalizableString `json:"operationName,omitempty"` 2407 // Properties - READ-ONLY; the set of <Key, Value> pairs (usually a Dictionary<String, String>) that includes details about the event. 2408 Properties map[string]*string `json:"properties"` 2409 // Status - READ-ONLY; a string describing the status of the operation. Some typical values are: Started, In progress, Succeeded, Failed, Resolved. 2410 Status *LocalizableString `json:"status,omitempty"` 2411 // SubStatus - READ-ONLY; the event sub status. Most of the time, when included, this captures the HTTP status code of the REST call. Common values are: OK (HTTP Status Code: 200), Created (HTTP Status Code: 201), Accepted (HTTP Status Code: 202), No Content (HTTP Status Code: 204), Bad Request(HTTP Status Code: 400), Not Found (HTTP Status Code: 404), Conflict (HTTP Status Code: 409), Internal Server Error (HTTP Status Code: 500), Service Unavailable (HTTP Status Code:503), Gateway Timeout (HTTP Status Code: 504) 2412 SubStatus *LocalizableString `json:"subStatus,omitempty"` 2413 // EventTimestamp - READ-ONLY; the timestamp of when the event was generated by the Azure service processing the request corresponding the event. It in ISO 8601 format. 2414 EventTimestamp *date.Time `json:"eventTimestamp,omitempty"` 2415 // SubmissionTimestamp - READ-ONLY; the timestamp of when the event became available for querying via this API. It is in ISO 8601 format. This value should not be confused eventTimestamp. As there might be a delay between the occurrence time of the event, and the time that the event is submitted to the Azure logging infrastructure. 2416 SubmissionTimestamp *date.Time `json:"submissionTimestamp,omitempty"` 2417 // SubscriptionID - READ-ONLY; the Azure subscription Id usually a GUID. 2418 SubscriptionID *string `json:"subscriptionId,omitempty"` 2419 // TenantID - READ-ONLY; the Azure tenant Id 2420 TenantID *string `json:"tenantId,omitempty"` 2421} 2422 2423// MarshalJSON is the custom marshaler for EventData. 2424func (ed EventData) MarshalJSON() ([]byte, error) { 2425 objectMap := make(map[string]interface{}) 2426 return json.Marshal(objectMap) 2427} 2428 2429// EventDataCollection represents collection of events. 2430type EventDataCollection struct { 2431 autorest.Response `json:"-"` 2432 // Value - this list that includes the Azure audit logs. 2433 Value *[]EventData `json:"value,omitempty"` 2434 // NextLink - Provides the link to retrieve the next set of events. 2435 NextLink *string `json:"nextLink,omitempty"` 2436} 2437 2438// EventDataCollectionIterator provides access to a complete listing of EventData values. 2439type EventDataCollectionIterator struct { 2440 i int 2441 page EventDataCollectionPage 2442} 2443 2444// NextWithContext advances to the next value. If there was an error making 2445// the request the iterator does not advance and the error is returned. 2446func (iter *EventDataCollectionIterator) NextWithContext(ctx context.Context) (err error) { 2447 if tracing.IsEnabled() { 2448 ctx = tracing.StartSpan(ctx, fqdn+"/EventDataCollectionIterator.NextWithContext") 2449 defer func() { 2450 sc := -1 2451 if iter.Response().Response.Response != nil { 2452 sc = iter.Response().Response.Response.StatusCode 2453 } 2454 tracing.EndSpan(ctx, sc, err) 2455 }() 2456 } 2457 iter.i++ 2458 if iter.i < len(iter.page.Values()) { 2459 return nil 2460 } 2461 err = iter.page.NextWithContext(ctx) 2462 if err != nil { 2463 iter.i-- 2464 return err 2465 } 2466 iter.i = 0 2467 return nil 2468} 2469 2470// Next advances to the next value. If there was an error making 2471// the request the iterator does not advance and the error is returned. 2472// Deprecated: Use NextWithContext() instead. 2473func (iter *EventDataCollectionIterator) Next() error { 2474 return iter.NextWithContext(context.Background()) 2475} 2476 2477// NotDone returns true if the enumeration should be started or is not yet complete. 2478func (iter EventDataCollectionIterator) NotDone() bool { 2479 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2480} 2481 2482// Response returns the raw server response from the last page request. 2483func (iter EventDataCollectionIterator) Response() EventDataCollection { 2484 return iter.page.Response() 2485} 2486 2487// Value returns the current value or a zero-initialized value if the 2488// iterator has advanced beyond the end of the collection. 2489func (iter EventDataCollectionIterator) Value() EventData { 2490 if !iter.page.NotDone() { 2491 return EventData{} 2492 } 2493 return iter.page.Values()[iter.i] 2494} 2495 2496// Creates a new instance of the EventDataCollectionIterator type. 2497func NewEventDataCollectionIterator(page EventDataCollectionPage) EventDataCollectionIterator { 2498 return EventDataCollectionIterator{page: page} 2499} 2500 2501// IsEmpty returns true if the ListResult contains no values. 2502func (edc EventDataCollection) IsEmpty() bool { 2503 return edc.Value == nil || len(*edc.Value) == 0 2504} 2505 2506// eventDataCollectionPreparer prepares a request to retrieve the next set of results. 2507// It returns nil if no more results exist. 2508func (edc EventDataCollection) eventDataCollectionPreparer(ctx context.Context) (*http.Request, error) { 2509 if edc.NextLink == nil || len(to.String(edc.NextLink)) < 1 { 2510 return nil, nil 2511 } 2512 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2513 autorest.AsJSON(), 2514 autorest.AsGet(), 2515 autorest.WithBaseURL(to.String(edc.NextLink))) 2516} 2517 2518// EventDataCollectionPage contains a page of EventData values. 2519type EventDataCollectionPage struct { 2520 fn func(context.Context, EventDataCollection) (EventDataCollection, error) 2521 edc EventDataCollection 2522} 2523 2524// NextWithContext advances to the next page of values. If there was an error making 2525// the request the page does not advance and the error is returned. 2526func (page *EventDataCollectionPage) NextWithContext(ctx context.Context) (err error) { 2527 if tracing.IsEnabled() { 2528 ctx = tracing.StartSpan(ctx, fqdn+"/EventDataCollectionPage.NextWithContext") 2529 defer func() { 2530 sc := -1 2531 if page.Response().Response.Response != nil { 2532 sc = page.Response().Response.Response.StatusCode 2533 } 2534 tracing.EndSpan(ctx, sc, err) 2535 }() 2536 } 2537 next, err := page.fn(ctx, page.edc) 2538 if err != nil { 2539 return err 2540 } 2541 page.edc = next 2542 return nil 2543} 2544 2545// Next advances to the next page of values. If there was an error making 2546// the request the page does not advance and the error is returned. 2547// Deprecated: Use NextWithContext() instead. 2548func (page *EventDataCollectionPage) Next() error { 2549 return page.NextWithContext(context.Background()) 2550} 2551 2552// NotDone returns true if the page enumeration should be started or is not yet complete. 2553func (page EventDataCollectionPage) NotDone() bool { 2554 return !page.edc.IsEmpty() 2555} 2556 2557// Response returns the raw server response from the last page request. 2558func (page EventDataCollectionPage) Response() EventDataCollection { 2559 return page.edc 2560} 2561 2562// Values returns the slice of values for the current page or nil if there are no values. 2563func (page EventDataCollectionPage) Values() []EventData { 2564 if page.edc.IsEmpty() { 2565 return nil 2566 } 2567 return *page.edc.Value 2568} 2569 2570// Creates a new instance of the EventDataCollectionPage type. 2571func NewEventDataCollectionPage(getNextPage func(context.Context, EventDataCollection) (EventDataCollection, error)) EventDataCollectionPage { 2572 return EventDataCollectionPage{fn: getNextPage} 2573} 2574 2575// HTTPRequestInfo the Http request info. 2576type HTTPRequestInfo struct { 2577 // ClientRequestID - the client request id. 2578 ClientRequestID *string `json:"clientRequestId,omitempty"` 2579 // ClientIPAddress - the client Ip Address 2580 ClientIPAddress *string `json:"clientIpAddress,omitempty"` 2581 // Method - the Http request method. 2582 Method *string `json:"method,omitempty"` 2583 // URI - the Uri. 2584 URI *string `json:"uri,omitempty"` 2585} 2586 2587// Incident an alert incident indicates the activation status of an alert rule. 2588type Incident struct { 2589 autorest.Response `json:"-"` 2590 // Name - READ-ONLY; Incident name. 2591 Name *string `json:"name,omitempty"` 2592 // RuleName - READ-ONLY; Rule name that is associated with the incident. 2593 RuleName *string `json:"ruleName,omitempty"` 2594 // IsActive - READ-ONLY; A boolean to indicate whether the incident is active or resolved. 2595 IsActive *bool `json:"isActive,omitempty"` 2596 // ActivatedTime - READ-ONLY; The time at which the incident was activated in ISO8601 format. 2597 ActivatedTime *date.Time `json:"activatedTime,omitempty"` 2598 // ResolvedTime - READ-ONLY; The time at which the incident was resolved in ISO8601 format. If null, it means the incident is still active. 2599 ResolvedTime *date.Time `json:"resolvedTime,omitempty"` 2600} 2601 2602// IncidentListResult the List incidents operation response. 2603type IncidentListResult struct { 2604 autorest.Response `json:"-"` 2605 // Value - the incident collection. 2606 Value *[]Incident `json:"value,omitempty"` 2607} 2608 2609// ItsmReceiver an Itsm receiver. 2610type ItsmReceiver struct { 2611 // Name - The name of the Itsm receiver. Names must be unique across all receivers within an action group. 2612 Name *string `json:"name,omitempty"` 2613 // WorkspaceID - OMS LA instance identifier. 2614 WorkspaceID *string `json:"workspaceId,omitempty"` 2615 // ConnectionID - Unique identification of ITSM connection among multiple defined in above workspace. 2616 ConnectionID *string `json:"connectionId,omitempty"` 2617 // TicketConfiguration - JSON blob for the configurations of the ITSM action. CreateMultipleWorkItems option will be part of this blob as well. 2618 TicketConfiguration *string `json:"ticketConfiguration,omitempty"` 2619 // Region - Region in which workspace resides. Supported values:'centralindia','japaneast','southeastasia','australiasoutheast','uksouth','westcentralus','canadacentral','eastus','westeurope' 2620 Region *string `json:"region,omitempty"` 2621} 2622 2623// LocalizableString the localizable string class. 2624type LocalizableString struct { 2625 // Value - the invariant value. 2626 Value *string `json:"value,omitempty"` 2627 // LocalizedValue - the locale specific value. 2628 LocalizedValue *string `json:"localizedValue,omitempty"` 2629} 2630 2631// LocationThresholdRuleCondition a rule condition based on a certain number of locations failing. 2632type LocationThresholdRuleCondition struct { 2633 // WindowSize - the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified then it must be between 5 minutes and 1 day. 2634 WindowSize *string `json:"windowSize,omitempty"` 2635 // FailedLocationCount - the number of locations that must fail to activate the alert. 2636 FailedLocationCount *int32 `json:"failedLocationCount,omitempty"` 2637 // DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource. 2638 DataSource BasicRuleDataSource `json:"dataSource,omitempty"` 2639 // OdataType - Possible values include: 'OdataTypeRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition' 2640 OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"` 2641} 2642 2643// MarshalJSON is the custom marshaler for LocationThresholdRuleCondition. 2644func (ltrc LocationThresholdRuleCondition) MarshalJSON() ([]byte, error) { 2645 ltrc.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition 2646 objectMap := make(map[string]interface{}) 2647 if ltrc.WindowSize != nil { 2648 objectMap["windowSize"] = ltrc.WindowSize 2649 } 2650 if ltrc.FailedLocationCount != nil { 2651 objectMap["failedLocationCount"] = ltrc.FailedLocationCount 2652 } 2653 objectMap["dataSource"] = ltrc.DataSource 2654 if ltrc.OdataType != "" { 2655 objectMap["odata.type"] = ltrc.OdataType 2656 } 2657 return json.Marshal(objectMap) 2658} 2659 2660// AsThresholdRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition. 2661func (ltrc LocationThresholdRuleCondition) AsThresholdRuleCondition() (*ThresholdRuleCondition, bool) { 2662 return nil, false 2663} 2664 2665// AsLocationThresholdRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition. 2666func (ltrc LocationThresholdRuleCondition) AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool) { 2667 return <rc, true 2668} 2669 2670// AsManagementEventRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition. 2671func (ltrc LocationThresholdRuleCondition) AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool) { 2672 return nil, false 2673} 2674 2675// AsRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition. 2676func (ltrc LocationThresholdRuleCondition) AsRuleCondition() (*RuleCondition, bool) { 2677 return nil, false 2678} 2679 2680// AsBasicRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition. 2681func (ltrc LocationThresholdRuleCondition) AsBasicRuleCondition() (BasicRuleCondition, bool) { 2682 return <rc, true 2683} 2684 2685// UnmarshalJSON is the custom unmarshaler for LocationThresholdRuleCondition struct. 2686func (ltrc *LocationThresholdRuleCondition) UnmarshalJSON(body []byte) error { 2687 var m map[string]*json.RawMessage 2688 err := json.Unmarshal(body, &m) 2689 if err != nil { 2690 return err 2691 } 2692 for k, v := range m { 2693 switch k { 2694 case "windowSize": 2695 if v != nil { 2696 var windowSize string 2697 err = json.Unmarshal(*v, &windowSize) 2698 if err != nil { 2699 return err 2700 } 2701 ltrc.WindowSize = &windowSize 2702 } 2703 case "failedLocationCount": 2704 if v != nil { 2705 var failedLocationCount int32 2706 err = json.Unmarshal(*v, &failedLocationCount) 2707 if err != nil { 2708 return err 2709 } 2710 ltrc.FailedLocationCount = &failedLocationCount 2711 } 2712 case "dataSource": 2713 if v != nil { 2714 dataSource, err := unmarshalBasicRuleDataSource(*v) 2715 if err != nil { 2716 return err 2717 } 2718 ltrc.DataSource = dataSource 2719 } 2720 case "odata.type": 2721 if v != nil { 2722 var odataType OdataTypeBasicRuleCondition 2723 err = json.Unmarshal(*v, &odataType) 2724 if err != nil { 2725 return err 2726 } 2727 ltrc.OdataType = odataType 2728 } 2729 } 2730 } 2731 2732 return nil 2733} 2734 2735// LogicAppReceiver a logic app receiver. 2736type LogicAppReceiver struct { 2737 // Name - The name of the logic app receiver. Names must be unique across all receivers within an action group. 2738 Name *string `json:"name,omitempty"` 2739 // ResourceID - The azure resource id of the logic app receiver. 2740 ResourceID *string `json:"resourceId,omitempty"` 2741 // CallbackURL - The callback url where http request sent to. 2742 CallbackURL *string `json:"callbackUrl,omitempty"` 2743} 2744 2745// LogMetricTrigger a log metrics trigger descriptor. 2746type LogMetricTrigger struct { 2747 // ThresholdOperator - Evaluation operation for Metric -'GreaterThan' or 'LessThan' or 'Equal'. Possible values include: 'ConditionalOperatorGreaterThan', 'ConditionalOperatorLessThan', 'ConditionalOperatorEqual' 2748 ThresholdOperator ConditionalOperator `json:"thresholdOperator,omitempty"` 2749 // Threshold - The threshold of the metric trigger. 2750 Threshold *float64 `json:"threshold,omitempty"` 2751 // MetricTriggerType - Metric Trigger Type - 'Consecutive' or 'Total'. Possible values include: 'MetricTriggerTypeConsecutive', 'MetricTriggerTypeTotal' 2752 MetricTriggerType MetricTriggerType `json:"metricTriggerType,omitempty"` 2753 // MetricColumn - Evaluation of metric on a particular column 2754 MetricColumn *string `json:"metricColumn,omitempty"` 2755} 2756 2757// LogProfileCollection represents a collection of log profiles. 2758type LogProfileCollection struct { 2759 autorest.Response `json:"-"` 2760 // Value - the values of the log profiles. 2761 Value *[]LogProfileResource `json:"value,omitempty"` 2762} 2763 2764// LogProfileProperties the log profile properties. 2765type LogProfileProperties struct { 2766 // StorageAccountID - the resource id of the storage account to which you would like to send the Activity Log. 2767 StorageAccountID *string `json:"storageAccountId,omitempty"` 2768 // ServiceBusRuleID - The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource ID}/authorizationrules/{key name}'. 2769 ServiceBusRuleID *string `json:"serviceBusRuleId,omitempty"` 2770 // Locations - List of regions for which Activity Log events should be stored or streamed. It is a comma separated list of valid ARM locations including the 'global' location. 2771 Locations *[]string `json:"locations,omitempty"` 2772 // Categories - the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.' 2773 Categories *[]string `json:"categories,omitempty"` 2774 // RetentionPolicy - the retention policy for the events in the log. 2775 RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"` 2776} 2777 2778// LogProfileResource the log profile resource. 2779type LogProfileResource struct { 2780 autorest.Response `json:"-"` 2781 // LogProfileProperties - The log profile properties of the resource. 2782 *LogProfileProperties `json:"properties,omitempty"` 2783 // ID - READ-ONLY; Azure resource Id 2784 ID *string `json:"id,omitempty"` 2785 // Name - READ-ONLY; Azure resource name 2786 Name *string `json:"name,omitempty"` 2787 // Type - READ-ONLY; Azure resource type 2788 Type *string `json:"type,omitempty"` 2789 // Location - Resource location 2790 Location *string `json:"location,omitempty"` 2791 // Tags - Resource tags 2792 Tags map[string]*string `json:"tags"` 2793} 2794 2795// MarshalJSON is the custom marshaler for LogProfileResource. 2796func (lpr LogProfileResource) MarshalJSON() ([]byte, error) { 2797 objectMap := make(map[string]interface{}) 2798 if lpr.LogProfileProperties != nil { 2799 objectMap["properties"] = lpr.LogProfileProperties 2800 } 2801 if lpr.Location != nil { 2802 objectMap["location"] = lpr.Location 2803 } 2804 if lpr.Tags != nil { 2805 objectMap["tags"] = lpr.Tags 2806 } 2807 return json.Marshal(objectMap) 2808} 2809 2810// UnmarshalJSON is the custom unmarshaler for LogProfileResource struct. 2811func (lpr *LogProfileResource) UnmarshalJSON(body []byte) error { 2812 var m map[string]*json.RawMessage 2813 err := json.Unmarshal(body, &m) 2814 if err != nil { 2815 return err 2816 } 2817 for k, v := range m { 2818 switch k { 2819 case "properties": 2820 if v != nil { 2821 var logProfileProperties LogProfileProperties 2822 err = json.Unmarshal(*v, &logProfileProperties) 2823 if err != nil { 2824 return err 2825 } 2826 lpr.LogProfileProperties = &logProfileProperties 2827 } 2828 case "id": 2829 if v != nil { 2830 var ID string 2831 err = json.Unmarshal(*v, &ID) 2832 if err != nil { 2833 return err 2834 } 2835 lpr.ID = &ID 2836 } 2837 case "name": 2838 if v != nil { 2839 var name string 2840 err = json.Unmarshal(*v, &name) 2841 if err != nil { 2842 return err 2843 } 2844 lpr.Name = &name 2845 } 2846 case "type": 2847 if v != nil { 2848 var typeVar string 2849 err = json.Unmarshal(*v, &typeVar) 2850 if err != nil { 2851 return err 2852 } 2853 lpr.Type = &typeVar 2854 } 2855 case "location": 2856 if v != nil { 2857 var location string 2858 err = json.Unmarshal(*v, &location) 2859 if err != nil { 2860 return err 2861 } 2862 lpr.Location = &location 2863 } 2864 case "tags": 2865 if v != nil { 2866 var tags map[string]*string 2867 err = json.Unmarshal(*v, &tags) 2868 if err != nil { 2869 return err 2870 } 2871 lpr.Tags = tags 2872 } 2873 } 2874 } 2875 2876 return nil 2877} 2878 2879// LogProfileResourcePatch the log profile resource for patch operations. 2880type LogProfileResourcePatch struct { 2881 // Tags - Resource tags 2882 Tags map[string]*string `json:"tags"` 2883 // LogProfileProperties - The log profile properties for an update operation. 2884 *LogProfileProperties `json:"properties,omitempty"` 2885} 2886 2887// MarshalJSON is the custom marshaler for LogProfileResourcePatch. 2888func (lprp LogProfileResourcePatch) MarshalJSON() ([]byte, error) { 2889 objectMap := make(map[string]interface{}) 2890 if lprp.Tags != nil { 2891 objectMap["tags"] = lprp.Tags 2892 } 2893 if lprp.LogProfileProperties != nil { 2894 objectMap["properties"] = lprp.LogProfileProperties 2895 } 2896 return json.Marshal(objectMap) 2897} 2898 2899// UnmarshalJSON is the custom unmarshaler for LogProfileResourcePatch struct. 2900func (lprp *LogProfileResourcePatch) UnmarshalJSON(body []byte) error { 2901 var m map[string]*json.RawMessage 2902 err := json.Unmarshal(body, &m) 2903 if err != nil { 2904 return err 2905 } 2906 for k, v := range m { 2907 switch k { 2908 case "tags": 2909 if v != nil { 2910 var tags map[string]*string 2911 err = json.Unmarshal(*v, &tags) 2912 if err != nil { 2913 return err 2914 } 2915 lprp.Tags = tags 2916 } 2917 case "properties": 2918 if v != nil { 2919 var logProfileProperties LogProfileProperties 2920 err = json.Unmarshal(*v, &logProfileProperties) 2921 if err != nil { 2922 return err 2923 } 2924 lprp.LogProfileProperties = &logProfileProperties 2925 } 2926 } 2927 } 2928 2929 return nil 2930} 2931 2932// LogSearchRule log Search Rule Definition 2933type LogSearchRule struct { 2934 // Description - The description of the Log Search rule. 2935 Description *string `json:"description,omitempty"` 2936 // Enabled - The flag which indicates whether the Log Search rule is enabled. Value should be true or false. Possible values include: 'True', 'False' 2937 Enabled Enabled `json:"enabled,omitempty"` 2938 // LastUpdatedTime - READ-ONLY; Last time the rule was updated in IS08601 format. 2939 LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` 2940 // ProvisioningState - READ-ONLY; Provisioning state of the scheduled query rule. Possible values include: 'Succeeded', 'Deploying', 'Canceled', 'Failed' 2941 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 2942 // Source - Data Source against which rule will Query Data 2943 Source *Source `json:"source,omitempty"` 2944 // Schedule - Schedule (Frequency, Time Window) for rule. Required for action type - AlertingAction 2945 Schedule *Schedule `json:"schedule,omitempty"` 2946 // Action - Action needs to be taken on rule execution. 2947 Action BasicAction `json:"action,omitempty"` 2948} 2949 2950// UnmarshalJSON is the custom unmarshaler for LogSearchRule struct. 2951func (lsr *LogSearchRule) UnmarshalJSON(body []byte) error { 2952 var m map[string]*json.RawMessage 2953 err := json.Unmarshal(body, &m) 2954 if err != nil { 2955 return err 2956 } 2957 for k, v := range m { 2958 switch k { 2959 case "description": 2960 if v != nil { 2961 var description string 2962 err = json.Unmarshal(*v, &description) 2963 if err != nil { 2964 return err 2965 } 2966 lsr.Description = &description 2967 } 2968 case "enabled": 2969 if v != nil { 2970 var enabled Enabled 2971 err = json.Unmarshal(*v, &enabled) 2972 if err != nil { 2973 return err 2974 } 2975 lsr.Enabled = enabled 2976 } 2977 case "lastUpdatedTime": 2978 if v != nil { 2979 var lastUpdatedTime date.Time 2980 err = json.Unmarshal(*v, &lastUpdatedTime) 2981 if err != nil { 2982 return err 2983 } 2984 lsr.LastUpdatedTime = &lastUpdatedTime 2985 } 2986 case "provisioningState": 2987 if v != nil { 2988 var provisioningState ProvisioningState 2989 err = json.Unmarshal(*v, &provisioningState) 2990 if err != nil { 2991 return err 2992 } 2993 lsr.ProvisioningState = provisioningState 2994 } 2995 case "source": 2996 if v != nil { 2997 var source Source 2998 err = json.Unmarshal(*v, &source) 2999 if err != nil { 3000 return err 3001 } 3002 lsr.Source = &source 3003 } 3004 case "schedule": 3005 if v != nil { 3006 var schedule Schedule 3007 err = json.Unmarshal(*v, &schedule) 3008 if err != nil { 3009 return err 3010 } 3011 lsr.Schedule = &schedule 3012 } 3013 case "action": 3014 if v != nil { 3015 action, err := unmarshalBasicAction(*v) 3016 if err != nil { 3017 return err 3018 } 3019 lsr.Action = action 3020 } 3021 } 3022 } 3023 3024 return nil 3025} 3026 3027// LogSearchRulePatch log Search Rule Definition for Patching 3028type LogSearchRulePatch struct { 3029 // Enabled - The flag which indicates whether the Log Search rule is enabled. Value should be true or false. Possible values include: 'True', 'False' 3030 Enabled Enabled `json:"enabled,omitempty"` 3031} 3032 3033// LogSearchRuleResource the Log Search Rule resource. 3034type LogSearchRuleResource struct { 3035 autorest.Response `json:"-"` 3036 // LogSearchRule - The rule properties of the resource. 3037 *LogSearchRule `json:"properties,omitempty"` 3038 // ID - READ-ONLY; Azure resource Id 3039 ID *string `json:"id,omitempty"` 3040 // Name - READ-ONLY; Azure resource name 3041 Name *string `json:"name,omitempty"` 3042 // Type - READ-ONLY; Azure resource type 3043 Type *string `json:"type,omitempty"` 3044 // Location - Resource location 3045 Location *string `json:"location,omitempty"` 3046 // Tags - Resource tags 3047 Tags map[string]*string `json:"tags"` 3048} 3049 3050// MarshalJSON is the custom marshaler for LogSearchRuleResource. 3051func (lsrr LogSearchRuleResource) MarshalJSON() ([]byte, error) { 3052 objectMap := make(map[string]interface{}) 3053 if lsrr.LogSearchRule != nil { 3054 objectMap["properties"] = lsrr.LogSearchRule 3055 } 3056 if lsrr.Location != nil { 3057 objectMap["location"] = lsrr.Location 3058 } 3059 if lsrr.Tags != nil { 3060 objectMap["tags"] = lsrr.Tags 3061 } 3062 return json.Marshal(objectMap) 3063} 3064 3065// UnmarshalJSON is the custom unmarshaler for LogSearchRuleResource struct. 3066func (lsrr *LogSearchRuleResource) UnmarshalJSON(body []byte) error { 3067 var m map[string]*json.RawMessage 3068 err := json.Unmarshal(body, &m) 3069 if err != nil { 3070 return err 3071 } 3072 for k, v := range m { 3073 switch k { 3074 case "properties": 3075 if v != nil { 3076 var logSearchRule LogSearchRule 3077 err = json.Unmarshal(*v, &logSearchRule) 3078 if err != nil { 3079 return err 3080 } 3081 lsrr.LogSearchRule = &logSearchRule 3082 } 3083 case "id": 3084 if v != nil { 3085 var ID string 3086 err = json.Unmarshal(*v, &ID) 3087 if err != nil { 3088 return err 3089 } 3090 lsrr.ID = &ID 3091 } 3092 case "name": 3093 if v != nil { 3094 var name string 3095 err = json.Unmarshal(*v, &name) 3096 if err != nil { 3097 return err 3098 } 3099 lsrr.Name = &name 3100 } 3101 case "type": 3102 if v != nil { 3103 var typeVar string 3104 err = json.Unmarshal(*v, &typeVar) 3105 if err != nil { 3106 return err 3107 } 3108 lsrr.Type = &typeVar 3109 } 3110 case "location": 3111 if v != nil { 3112 var location string 3113 err = json.Unmarshal(*v, &location) 3114 if err != nil { 3115 return err 3116 } 3117 lsrr.Location = &location 3118 } 3119 case "tags": 3120 if v != nil { 3121 var tags map[string]*string 3122 err = json.Unmarshal(*v, &tags) 3123 if err != nil { 3124 return err 3125 } 3126 lsrr.Tags = tags 3127 } 3128 } 3129 } 3130 3131 return nil 3132} 3133 3134// LogSearchRuleResourceCollection represents a collection of Log Search rule resources. 3135type LogSearchRuleResourceCollection struct { 3136 autorest.Response `json:"-"` 3137 // Value - The values for the Log Search Rule resources. 3138 Value *[]LogSearchRuleResource `json:"value,omitempty"` 3139} 3140 3141// LogSearchRuleResourcePatch the log search rule resource for patch operations. 3142type LogSearchRuleResourcePatch struct { 3143 // Tags - Resource tags 3144 Tags map[string]*string `json:"tags"` 3145 // LogSearchRulePatch - The log search rule properties of the resource. 3146 *LogSearchRulePatch `json:"properties,omitempty"` 3147} 3148 3149// MarshalJSON is the custom marshaler for LogSearchRuleResourcePatch. 3150func (lsrrp LogSearchRuleResourcePatch) MarshalJSON() ([]byte, error) { 3151 objectMap := make(map[string]interface{}) 3152 if lsrrp.Tags != nil { 3153 objectMap["tags"] = lsrrp.Tags 3154 } 3155 if lsrrp.LogSearchRulePatch != nil { 3156 objectMap["properties"] = lsrrp.LogSearchRulePatch 3157 } 3158 return json.Marshal(objectMap) 3159} 3160 3161// UnmarshalJSON is the custom unmarshaler for LogSearchRuleResourcePatch struct. 3162func (lsrrp *LogSearchRuleResourcePatch) UnmarshalJSON(body []byte) error { 3163 var m map[string]*json.RawMessage 3164 err := json.Unmarshal(body, &m) 3165 if err != nil { 3166 return err 3167 } 3168 for k, v := range m { 3169 switch k { 3170 case "tags": 3171 if v != nil { 3172 var tags map[string]*string 3173 err = json.Unmarshal(*v, &tags) 3174 if err != nil { 3175 return err 3176 } 3177 lsrrp.Tags = tags 3178 } 3179 case "properties": 3180 if v != nil { 3181 var logSearchRulePatch LogSearchRulePatch 3182 err = json.Unmarshal(*v, &logSearchRulePatch) 3183 if err != nil { 3184 return err 3185 } 3186 lsrrp.LogSearchRulePatch = &logSearchRulePatch 3187 } 3188 } 3189 } 3190 3191 return nil 3192} 3193 3194// LogSettings part of MultiTenantDiagnosticSettings. Specifies the settings for a particular log. 3195type LogSettings struct { 3196 // Category - Name of a Diagnostic Log category for a resource type this setting is applied to. To obtain the list of Diagnostic Log categories for a resource, first perform a GET diagnostic settings operation. 3197 Category *string `json:"category,omitempty"` 3198 // Enabled - a value indicating whether this log is enabled. 3199 Enabled *bool `json:"enabled,omitempty"` 3200 // RetentionPolicy - the retention policy for this log. 3201 RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"` 3202} 3203 3204// LogToMetricAction specify action need to be taken when rule type is converting log to metric 3205type LogToMetricAction struct { 3206 // Criteria - Criteria of Metric 3207 Criteria *[]Criteria `json:"criteria,omitempty"` 3208 // OdataType - Possible values include: 'OdataTypeAction', 'OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction', 'OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction' 3209 OdataType OdataTypeBasicAction `json:"odata.type,omitempty"` 3210} 3211 3212// MarshalJSON is the custom marshaler for LogToMetricAction. 3213func (ltma LogToMetricAction) MarshalJSON() ([]byte, error) { 3214 ltma.OdataType = OdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction 3215 objectMap := make(map[string]interface{}) 3216 if ltma.Criteria != nil { 3217 objectMap["criteria"] = ltma.Criteria 3218 } 3219 if ltma.OdataType != "" { 3220 objectMap["odata.type"] = ltma.OdataType 3221 } 3222 return json.Marshal(objectMap) 3223} 3224 3225// AsAlertingAction is the BasicAction implementation for LogToMetricAction. 3226func (ltma LogToMetricAction) AsAlertingAction() (*AlertingAction, bool) { 3227 return nil, false 3228} 3229 3230// AsLogToMetricAction is the BasicAction implementation for LogToMetricAction. 3231func (ltma LogToMetricAction) AsLogToMetricAction() (*LogToMetricAction, bool) { 3232 return <ma, true 3233} 3234 3235// AsAction is the BasicAction implementation for LogToMetricAction. 3236func (ltma LogToMetricAction) AsAction() (*Action, bool) { 3237 return nil, false 3238} 3239 3240// AsBasicAction is the BasicAction implementation for LogToMetricAction. 3241func (ltma LogToMetricAction) AsBasicAction() (BasicAction, bool) { 3242 return <ma, true 3243} 3244 3245// ManagementEventAggregationCondition how the data that is collected should be combined over time. 3246type ManagementEventAggregationCondition struct { 3247 // Operator - the condition operator. Possible values include: 'ConditionOperatorGreaterThan', 'ConditionOperatorGreaterThanOrEqual', 'ConditionOperatorLessThan', 'ConditionOperatorLessThanOrEqual' 3248 Operator ConditionOperator `json:"operator,omitempty"` 3249 // Threshold - The threshold value that activates the alert. 3250 Threshold *float64 `json:"threshold,omitempty"` 3251 // WindowSize - the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified then it must be between 5 minutes and 1 day. 3252 WindowSize *string `json:"windowSize,omitempty"` 3253} 3254 3255// ManagementEventRuleCondition a management event rule condition. 3256type ManagementEventRuleCondition struct { 3257 // Aggregation - How the data that is collected should be combined over time and when the alert is activated. Note that for management event alerts aggregation is optional – if it is not provided then any event will cause the alert to activate. 3258 Aggregation *ManagementEventAggregationCondition `json:"aggregation,omitempty"` 3259 // DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource. 3260 DataSource BasicRuleDataSource `json:"dataSource,omitempty"` 3261 // OdataType - Possible values include: 'OdataTypeRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition' 3262 OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"` 3263} 3264 3265// MarshalJSON is the custom marshaler for ManagementEventRuleCondition. 3266func (merc ManagementEventRuleCondition) MarshalJSON() ([]byte, error) { 3267 merc.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition 3268 objectMap := make(map[string]interface{}) 3269 if merc.Aggregation != nil { 3270 objectMap["aggregation"] = merc.Aggregation 3271 } 3272 objectMap["dataSource"] = merc.DataSource 3273 if merc.OdataType != "" { 3274 objectMap["odata.type"] = merc.OdataType 3275 } 3276 return json.Marshal(objectMap) 3277} 3278 3279// AsThresholdRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition. 3280func (merc ManagementEventRuleCondition) AsThresholdRuleCondition() (*ThresholdRuleCondition, bool) { 3281 return nil, false 3282} 3283 3284// AsLocationThresholdRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition. 3285func (merc ManagementEventRuleCondition) AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool) { 3286 return nil, false 3287} 3288 3289// AsManagementEventRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition. 3290func (merc ManagementEventRuleCondition) AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool) { 3291 return &merc, true 3292} 3293 3294// AsRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition. 3295func (merc ManagementEventRuleCondition) AsRuleCondition() (*RuleCondition, bool) { 3296 return nil, false 3297} 3298 3299// AsBasicRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition. 3300func (merc ManagementEventRuleCondition) AsBasicRuleCondition() (BasicRuleCondition, bool) { 3301 return &merc, true 3302} 3303 3304// UnmarshalJSON is the custom unmarshaler for ManagementEventRuleCondition struct. 3305func (merc *ManagementEventRuleCondition) UnmarshalJSON(body []byte) error { 3306 var m map[string]*json.RawMessage 3307 err := json.Unmarshal(body, &m) 3308 if err != nil { 3309 return err 3310 } 3311 for k, v := range m { 3312 switch k { 3313 case "aggregation": 3314 if v != nil { 3315 var aggregation ManagementEventAggregationCondition 3316 err = json.Unmarshal(*v, &aggregation) 3317 if err != nil { 3318 return err 3319 } 3320 merc.Aggregation = &aggregation 3321 } 3322 case "dataSource": 3323 if v != nil { 3324 dataSource, err := unmarshalBasicRuleDataSource(*v) 3325 if err != nil { 3326 return err 3327 } 3328 merc.DataSource = dataSource 3329 } 3330 case "odata.type": 3331 if v != nil { 3332 var odataType OdataTypeBasicRuleCondition 3333 err = json.Unmarshal(*v, &odataType) 3334 if err != nil { 3335 return err 3336 } 3337 merc.OdataType = odataType 3338 } 3339 } 3340 } 3341 3342 return nil 3343} 3344 3345// MetadataValue represents a metric metadata value. 3346type MetadataValue struct { 3347 // Name - the name of the metadata. 3348 Name *LocalizableString `json:"name,omitempty"` 3349 // Value - the value of the metadata. 3350 Value *string `json:"value,omitempty"` 3351} 3352 3353// Metric the result data of a query. 3354type Metric struct { 3355 // ID - the metric Id. 3356 ID *string `json:"id,omitempty"` 3357 // Type - the resource type of the metric resource. 3358 Type *string `json:"type,omitempty"` 3359 // Name - the name and the display name of the metric, i.e. it is localizable string. 3360 Name *LocalizableString `json:"name,omitempty"` 3361 // Unit - the unit of the metric. Possible values include: 'UnitCount', 'UnitBytes', 'UnitSeconds', 'UnitCountPerSecond', 'UnitBytesPerSecond', 'UnitPercent', 'UnitMilliSeconds', 'UnitByteSeconds', 'UnitUnspecified', 'UnitCores', 'UnitMilliCores', 'UnitNanoCores', 'UnitBitsPerSecond' 3362 Unit Unit `json:"unit,omitempty"` 3363 // Timeseries - the time series returned when a data query is performed. 3364 Timeseries *[]TimeSeriesElement `json:"timeseries,omitempty"` 3365} 3366 3367// MetricAlertAction an alert action. 3368type MetricAlertAction struct { 3369 // ActionGroupID - the id of the action group to use. 3370 ActionGroupID *string `json:"actionGroupId,omitempty"` 3371 // WebhookProperties - The properties of a webhook object. 3372 WebhookProperties map[string]*string `json:"webhookProperties"` 3373} 3374 3375// MarshalJSON is the custom marshaler for MetricAlertAction. 3376func (maa MetricAlertAction) MarshalJSON() ([]byte, error) { 3377 objectMap := make(map[string]interface{}) 3378 if maa.ActionGroupID != nil { 3379 objectMap["actionGroupId"] = maa.ActionGroupID 3380 } 3381 if maa.WebhookProperties != nil { 3382 objectMap["webhookProperties"] = maa.WebhookProperties 3383 } 3384 return json.Marshal(objectMap) 3385} 3386 3387// BasicMetricAlertCriteria the rule criteria that defines the conditions of the alert rule. 3388type BasicMetricAlertCriteria interface { 3389 AsMetricAlertSingleResourceMultipleMetricCriteria() (*MetricAlertSingleResourceMultipleMetricCriteria, bool) 3390 AsMetricAlertMultipleResourceMultipleMetricCriteria() (*MetricAlertMultipleResourceMultipleMetricCriteria, bool) 3391 AsMetricAlertCriteria() (*MetricAlertCriteria, bool) 3392} 3393 3394// MetricAlertCriteria the rule criteria that defines the conditions of the alert rule. 3395type MetricAlertCriteria struct { 3396 // AdditionalProperties - Unmatched properties from the message are deserialized this collection 3397 AdditionalProperties map[string]interface{} `json:""` 3398 // OdataType - Possible values include: 'OdataTypeMetricAlertCriteria', 'OdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria', 'OdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria' 3399 OdataType OdataTypeBasicMetricAlertCriteria `json:"odata.type,omitempty"` 3400} 3401 3402func unmarshalBasicMetricAlertCriteria(body []byte) (BasicMetricAlertCriteria, error) { 3403 var m map[string]interface{} 3404 err := json.Unmarshal(body, &m) 3405 if err != nil { 3406 return nil, err 3407 } 3408 3409 switch m["odata.type"] { 3410 case string(OdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria): 3411 var masrmmc MetricAlertSingleResourceMultipleMetricCriteria 3412 err := json.Unmarshal(body, &masrmmc) 3413 return masrmmc, err 3414 case string(OdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria): 3415 var mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria 3416 err := json.Unmarshal(body, &mamrmmc) 3417 return mamrmmc, err 3418 default: 3419 var mac MetricAlertCriteria 3420 err := json.Unmarshal(body, &mac) 3421 return mac, err 3422 } 3423} 3424func unmarshalBasicMetricAlertCriteriaArray(body []byte) ([]BasicMetricAlertCriteria, error) { 3425 var rawMessages []*json.RawMessage 3426 err := json.Unmarshal(body, &rawMessages) 3427 if err != nil { 3428 return nil, err 3429 } 3430 3431 macArray := make([]BasicMetricAlertCriteria, len(rawMessages)) 3432 3433 for index, rawMessage := range rawMessages { 3434 mac, err := unmarshalBasicMetricAlertCriteria(*rawMessage) 3435 if err != nil { 3436 return nil, err 3437 } 3438 macArray[index] = mac 3439 } 3440 return macArray, nil 3441} 3442 3443// MarshalJSON is the custom marshaler for MetricAlertCriteria. 3444func (mac MetricAlertCriteria) MarshalJSON() ([]byte, error) { 3445 mac.OdataType = OdataTypeMetricAlertCriteria 3446 objectMap := make(map[string]interface{}) 3447 if mac.OdataType != "" { 3448 objectMap["odata.type"] = mac.OdataType 3449 } 3450 for k, v := range mac.AdditionalProperties { 3451 objectMap[k] = v 3452 } 3453 return json.Marshal(objectMap) 3454} 3455 3456// AsMetricAlertSingleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertCriteria. 3457func (mac MetricAlertCriteria) AsMetricAlertSingleResourceMultipleMetricCriteria() (*MetricAlertSingleResourceMultipleMetricCriteria, bool) { 3458 return nil, false 3459} 3460 3461// AsMetricAlertMultipleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertCriteria. 3462func (mac MetricAlertCriteria) AsMetricAlertMultipleResourceMultipleMetricCriteria() (*MetricAlertMultipleResourceMultipleMetricCriteria, bool) { 3463 return nil, false 3464} 3465 3466// AsMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertCriteria. 3467func (mac MetricAlertCriteria) AsMetricAlertCriteria() (*MetricAlertCriteria, bool) { 3468 return &mac, true 3469} 3470 3471// AsBasicMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertCriteria. 3472func (mac MetricAlertCriteria) AsBasicMetricAlertCriteria() (BasicMetricAlertCriteria, bool) { 3473 return &mac, true 3474} 3475 3476// UnmarshalJSON is the custom unmarshaler for MetricAlertCriteria struct. 3477func (mac *MetricAlertCriteria) UnmarshalJSON(body []byte) error { 3478 var m map[string]*json.RawMessage 3479 err := json.Unmarshal(body, &m) 3480 if err != nil { 3481 return err 3482 } 3483 for k, v := range m { 3484 switch k { 3485 default: 3486 if v != nil { 3487 var additionalProperties interface{} 3488 err = json.Unmarshal(*v, &additionalProperties) 3489 if err != nil { 3490 return err 3491 } 3492 if mac.AdditionalProperties == nil { 3493 mac.AdditionalProperties = make(map[string]interface{}) 3494 } 3495 mac.AdditionalProperties[k] = additionalProperties 3496 } 3497 case "odata.type": 3498 if v != nil { 3499 var odataType OdataTypeBasicMetricAlertCriteria 3500 err = json.Unmarshal(*v, &odataType) 3501 if err != nil { 3502 return err 3503 } 3504 mac.OdataType = odataType 3505 } 3506 } 3507 } 3508 3509 return nil 3510} 3511 3512// MetricAlertMultipleResourceMultipleMetricCriteria specifies the metric alert criteria for multiple 3513// resource that has multiple metric criteria. 3514type MetricAlertMultipleResourceMultipleMetricCriteria struct { 3515 // AllOf - the list of multiple metric criteria for this 'all of' operation. 3516 AllOf *[]BasicMultiMetricCriteria `json:"allOf,omitempty"` 3517 // AdditionalProperties - Unmatched properties from the message are deserialized this collection 3518 AdditionalProperties map[string]interface{} `json:""` 3519 // OdataType - Possible values include: 'OdataTypeMetricAlertCriteria', 'OdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria', 'OdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria' 3520 OdataType OdataTypeBasicMetricAlertCriteria `json:"odata.type,omitempty"` 3521} 3522 3523// MarshalJSON is the custom marshaler for MetricAlertMultipleResourceMultipleMetricCriteria. 3524func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) MarshalJSON() ([]byte, error) { 3525 mamrmmc.OdataType = OdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria 3526 objectMap := make(map[string]interface{}) 3527 if mamrmmc.AllOf != nil { 3528 objectMap["allOf"] = mamrmmc.AllOf 3529 } 3530 if mamrmmc.OdataType != "" { 3531 objectMap["odata.type"] = mamrmmc.OdataType 3532 } 3533 for k, v := range mamrmmc.AdditionalProperties { 3534 objectMap[k] = v 3535 } 3536 return json.Marshal(objectMap) 3537} 3538 3539// AsMetricAlertSingleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertMultipleResourceMultipleMetricCriteria. 3540func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) AsMetricAlertSingleResourceMultipleMetricCriteria() (*MetricAlertSingleResourceMultipleMetricCriteria, bool) { 3541 return nil, false 3542} 3543 3544// AsMetricAlertMultipleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertMultipleResourceMultipleMetricCriteria. 3545func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) AsMetricAlertMultipleResourceMultipleMetricCriteria() (*MetricAlertMultipleResourceMultipleMetricCriteria, bool) { 3546 return &mamrmmc, true 3547} 3548 3549// AsMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertMultipleResourceMultipleMetricCriteria. 3550func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) AsMetricAlertCriteria() (*MetricAlertCriteria, bool) { 3551 return nil, false 3552} 3553 3554// AsBasicMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertMultipleResourceMultipleMetricCriteria. 3555func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) AsBasicMetricAlertCriteria() (BasicMetricAlertCriteria, bool) { 3556 return &mamrmmc, true 3557} 3558 3559// UnmarshalJSON is the custom unmarshaler for MetricAlertMultipleResourceMultipleMetricCriteria struct. 3560func (mamrmmc *MetricAlertMultipleResourceMultipleMetricCriteria) UnmarshalJSON(body []byte) error { 3561 var m map[string]*json.RawMessage 3562 err := json.Unmarshal(body, &m) 3563 if err != nil { 3564 return err 3565 } 3566 for k, v := range m { 3567 switch k { 3568 case "allOf": 3569 if v != nil { 3570 allOf, err := unmarshalBasicMultiMetricCriteriaArray(*v) 3571 if err != nil { 3572 return err 3573 } 3574 mamrmmc.AllOf = &allOf 3575 } 3576 default: 3577 if v != nil { 3578 var additionalProperties interface{} 3579 err = json.Unmarshal(*v, &additionalProperties) 3580 if err != nil { 3581 return err 3582 } 3583 if mamrmmc.AdditionalProperties == nil { 3584 mamrmmc.AdditionalProperties = make(map[string]interface{}) 3585 } 3586 mamrmmc.AdditionalProperties[k] = additionalProperties 3587 } 3588 case "odata.type": 3589 if v != nil { 3590 var odataType OdataTypeBasicMetricAlertCriteria 3591 err = json.Unmarshal(*v, &odataType) 3592 if err != nil { 3593 return err 3594 } 3595 mamrmmc.OdataType = odataType 3596 } 3597 } 3598 } 3599 3600 return nil 3601} 3602 3603// MetricAlertProperties an alert rule. 3604type MetricAlertProperties struct { 3605 // Description - the description of the metric alert that will be included in the alert email. 3606 Description *string `json:"description,omitempty"` 3607 // Severity - Alert severity {0, 1, 2, 3, 4} 3608 Severity *int32 `json:"severity,omitempty"` 3609 // Enabled - the flag that indicates whether the metric alert is enabled. 3610 Enabled *bool `json:"enabled,omitempty"` 3611 // Scopes - the list of resource id's that this metric alert is scoped to. 3612 Scopes *[]string `json:"scopes,omitempty"` 3613 // EvaluationFrequency - how often the metric alert is evaluated represented in ISO 8601 duration format. 3614 EvaluationFrequency *string `json:"evaluationFrequency,omitempty"` 3615 // WindowSize - the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. 3616 WindowSize *string `json:"windowSize,omitempty"` 3617 // TargetResourceType - the resource type of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. 3618 TargetResourceType *string `json:"targetResourceType,omitempty"` 3619 // TargetResourceRegion - the region of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. 3620 TargetResourceRegion *string `json:"targetResourceRegion,omitempty"` 3621 // Criteria - defines the specific alert criteria information. 3622 Criteria BasicMetricAlertCriteria `json:"criteria,omitempty"` 3623 // AutoMitigate - the flag that indicates whether the alert should be auto resolved or not. 3624 AutoMitigate *bool `json:"autoMitigate,omitempty"` 3625 // Actions - the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. 3626 Actions *[]MetricAlertAction `json:"actions,omitempty"` 3627 // LastUpdatedTime - READ-ONLY; Last time the rule was updated in ISO8601 format. 3628 LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` 3629} 3630 3631// UnmarshalJSON is the custom unmarshaler for MetricAlertProperties struct. 3632func (mapVar *MetricAlertProperties) UnmarshalJSON(body []byte) error { 3633 var m map[string]*json.RawMessage 3634 err := json.Unmarshal(body, &m) 3635 if err != nil { 3636 return err 3637 } 3638 for k, v := range m { 3639 switch k { 3640 case "description": 3641 if v != nil { 3642 var description string 3643 err = json.Unmarshal(*v, &description) 3644 if err != nil { 3645 return err 3646 } 3647 mapVar.Description = &description 3648 } 3649 case "severity": 3650 if v != nil { 3651 var severity int32 3652 err = json.Unmarshal(*v, &severity) 3653 if err != nil { 3654 return err 3655 } 3656 mapVar.Severity = &severity 3657 } 3658 case "enabled": 3659 if v != nil { 3660 var enabled bool 3661 err = json.Unmarshal(*v, &enabled) 3662 if err != nil { 3663 return err 3664 } 3665 mapVar.Enabled = &enabled 3666 } 3667 case "scopes": 3668 if v != nil { 3669 var scopes []string 3670 err = json.Unmarshal(*v, &scopes) 3671 if err != nil { 3672 return err 3673 } 3674 mapVar.Scopes = &scopes 3675 } 3676 case "evaluationFrequency": 3677 if v != nil { 3678 var evaluationFrequency string 3679 err = json.Unmarshal(*v, &evaluationFrequency) 3680 if err != nil { 3681 return err 3682 } 3683 mapVar.EvaluationFrequency = &evaluationFrequency 3684 } 3685 case "windowSize": 3686 if v != nil { 3687 var windowSize string 3688 err = json.Unmarshal(*v, &windowSize) 3689 if err != nil { 3690 return err 3691 } 3692 mapVar.WindowSize = &windowSize 3693 } 3694 case "targetResourceType": 3695 if v != nil { 3696 var targetResourceType string 3697 err = json.Unmarshal(*v, &targetResourceType) 3698 if err != nil { 3699 return err 3700 } 3701 mapVar.TargetResourceType = &targetResourceType 3702 } 3703 case "targetResourceRegion": 3704 if v != nil { 3705 var targetResourceRegion string 3706 err = json.Unmarshal(*v, &targetResourceRegion) 3707 if err != nil { 3708 return err 3709 } 3710 mapVar.TargetResourceRegion = &targetResourceRegion 3711 } 3712 case "criteria": 3713 if v != nil { 3714 criteria, err := unmarshalBasicMetricAlertCriteria(*v) 3715 if err != nil { 3716 return err 3717 } 3718 mapVar.Criteria = criteria 3719 } 3720 case "autoMitigate": 3721 if v != nil { 3722 var autoMitigate bool 3723 err = json.Unmarshal(*v, &autoMitigate) 3724 if err != nil { 3725 return err 3726 } 3727 mapVar.AutoMitigate = &autoMitigate 3728 } 3729 case "actions": 3730 if v != nil { 3731 var actions []MetricAlertAction 3732 err = json.Unmarshal(*v, &actions) 3733 if err != nil { 3734 return err 3735 } 3736 mapVar.Actions = &actions 3737 } 3738 case "lastUpdatedTime": 3739 if v != nil { 3740 var lastUpdatedTime date.Time 3741 err = json.Unmarshal(*v, &lastUpdatedTime) 3742 if err != nil { 3743 return err 3744 } 3745 mapVar.LastUpdatedTime = &lastUpdatedTime 3746 } 3747 } 3748 } 3749 3750 return nil 3751} 3752 3753// MetricAlertResource the metric alert resource. 3754type MetricAlertResource struct { 3755 autorest.Response `json:"-"` 3756 // MetricAlertProperties - The alert rule properties of the resource. 3757 *MetricAlertProperties `json:"properties,omitempty"` 3758 // ID - READ-ONLY; Azure resource Id 3759 ID *string `json:"id,omitempty"` 3760 // Name - READ-ONLY; Azure resource name 3761 Name *string `json:"name,omitempty"` 3762 // Type - READ-ONLY; Azure resource type 3763 Type *string `json:"type,omitempty"` 3764 // Location - Resource location 3765 Location *string `json:"location,omitempty"` 3766 // Tags - Resource tags 3767 Tags map[string]*string `json:"tags"` 3768} 3769 3770// MarshalJSON is the custom marshaler for MetricAlertResource. 3771func (mar MetricAlertResource) MarshalJSON() ([]byte, error) { 3772 objectMap := make(map[string]interface{}) 3773 if mar.MetricAlertProperties != nil { 3774 objectMap["properties"] = mar.MetricAlertProperties 3775 } 3776 if mar.Location != nil { 3777 objectMap["location"] = mar.Location 3778 } 3779 if mar.Tags != nil { 3780 objectMap["tags"] = mar.Tags 3781 } 3782 return json.Marshal(objectMap) 3783} 3784 3785// UnmarshalJSON is the custom unmarshaler for MetricAlertResource struct. 3786func (mar *MetricAlertResource) UnmarshalJSON(body []byte) error { 3787 var m map[string]*json.RawMessage 3788 err := json.Unmarshal(body, &m) 3789 if err != nil { 3790 return err 3791 } 3792 for k, v := range m { 3793 switch k { 3794 case "properties": 3795 if v != nil { 3796 var metricAlertProperties MetricAlertProperties 3797 err = json.Unmarshal(*v, &metricAlertProperties) 3798 if err != nil { 3799 return err 3800 } 3801 mar.MetricAlertProperties = &metricAlertProperties 3802 } 3803 case "id": 3804 if v != nil { 3805 var ID string 3806 err = json.Unmarshal(*v, &ID) 3807 if err != nil { 3808 return err 3809 } 3810 mar.ID = &ID 3811 } 3812 case "name": 3813 if v != nil { 3814 var name string 3815 err = json.Unmarshal(*v, &name) 3816 if err != nil { 3817 return err 3818 } 3819 mar.Name = &name 3820 } 3821 case "type": 3822 if v != nil { 3823 var typeVar string 3824 err = json.Unmarshal(*v, &typeVar) 3825 if err != nil { 3826 return err 3827 } 3828 mar.Type = &typeVar 3829 } 3830 case "location": 3831 if v != nil { 3832 var location string 3833 err = json.Unmarshal(*v, &location) 3834 if err != nil { 3835 return err 3836 } 3837 mar.Location = &location 3838 } 3839 case "tags": 3840 if v != nil { 3841 var tags map[string]*string 3842 err = json.Unmarshal(*v, &tags) 3843 if err != nil { 3844 return err 3845 } 3846 mar.Tags = tags 3847 } 3848 } 3849 } 3850 3851 return nil 3852} 3853 3854// MetricAlertResourceCollection represents a collection of alert rule resources. 3855type MetricAlertResourceCollection struct { 3856 autorest.Response `json:"-"` 3857 // Value - the values for the alert rule resources. 3858 Value *[]MetricAlertResource `json:"value,omitempty"` 3859} 3860 3861// MetricAlertResourcePatch the metric alert resource for patch operations. 3862type MetricAlertResourcePatch struct { 3863 // Tags - Resource tags 3864 Tags map[string]*string `json:"tags"` 3865 // MetricAlertProperties - The alert rule properties of the resource. 3866 *MetricAlertProperties `json:"properties,omitempty"` 3867} 3868 3869// MarshalJSON is the custom marshaler for MetricAlertResourcePatch. 3870func (marp MetricAlertResourcePatch) MarshalJSON() ([]byte, error) { 3871 objectMap := make(map[string]interface{}) 3872 if marp.Tags != nil { 3873 objectMap["tags"] = marp.Tags 3874 } 3875 if marp.MetricAlertProperties != nil { 3876 objectMap["properties"] = marp.MetricAlertProperties 3877 } 3878 return json.Marshal(objectMap) 3879} 3880 3881// UnmarshalJSON is the custom unmarshaler for MetricAlertResourcePatch struct. 3882func (marp *MetricAlertResourcePatch) UnmarshalJSON(body []byte) error { 3883 var m map[string]*json.RawMessage 3884 err := json.Unmarshal(body, &m) 3885 if err != nil { 3886 return err 3887 } 3888 for k, v := range m { 3889 switch k { 3890 case "tags": 3891 if v != nil { 3892 var tags map[string]*string 3893 err = json.Unmarshal(*v, &tags) 3894 if err != nil { 3895 return err 3896 } 3897 marp.Tags = tags 3898 } 3899 case "properties": 3900 if v != nil { 3901 var metricAlertProperties MetricAlertProperties 3902 err = json.Unmarshal(*v, &metricAlertProperties) 3903 if err != nil { 3904 return err 3905 } 3906 marp.MetricAlertProperties = &metricAlertProperties 3907 } 3908 } 3909 } 3910 3911 return nil 3912} 3913 3914// MetricAlertSingleResourceMultipleMetricCriteria specifies the metric alert criteria for a single 3915// resource that has multiple metric criteria. 3916type MetricAlertSingleResourceMultipleMetricCriteria struct { 3917 // AllOf - The list of metric criteria for this 'all of' operation. 3918 AllOf *[]MetricCriteria `json:"allOf,omitempty"` 3919 // AdditionalProperties - Unmatched properties from the message are deserialized this collection 3920 AdditionalProperties map[string]interface{} `json:""` 3921 // OdataType - Possible values include: 'OdataTypeMetricAlertCriteria', 'OdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria', 'OdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria' 3922 OdataType OdataTypeBasicMetricAlertCriteria `json:"odata.type,omitempty"` 3923} 3924 3925// MarshalJSON is the custom marshaler for MetricAlertSingleResourceMultipleMetricCriteria. 3926func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) MarshalJSON() ([]byte, error) { 3927 masrmmc.OdataType = OdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria 3928 objectMap := make(map[string]interface{}) 3929 if masrmmc.AllOf != nil { 3930 objectMap["allOf"] = masrmmc.AllOf 3931 } 3932 if masrmmc.OdataType != "" { 3933 objectMap["odata.type"] = masrmmc.OdataType 3934 } 3935 for k, v := range masrmmc.AdditionalProperties { 3936 objectMap[k] = v 3937 } 3938 return json.Marshal(objectMap) 3939} 3940 3941// AsMetricAlertSingleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertSingleResourceMultipleMetricCriteria. 3942func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) AsMetricAlertSingleResourceMultipleMetricCriteria() (*MetricAlertSingleResourceMultipleMetricCriteria, bool) { 3943 return &masrmmc, true 3944} 3945 3946// AsMetricAlertMultipleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertSingleResourceMultipleMetricCriteria. 3947func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) AsMetricAlertMultipleResourceMultipleMetricCriteria() (*MetricAlertMultipleResourceMultipleMetricCriteria, bool) { 3948 return nil, false 3949} 3950 3951// AsMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertSingleResourceMultipleMetricCriteria. 3952func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) AsMetricAlertCriteria() (*MetricAlertCriteria, bool) { 3953 return nil, false 3954} 3955 3956// AsBasicMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertSingleResourceMultipleMetricCriteria. 3957func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) AsBasicMetricAlertCriteria() (BasicMetricAlertCriteria, bool) { 3958 return &masrmmc, true 3959} 3960 3961// UnmarshalJSON is the custom unmarshaler for MetricAlertSingleResourceMultipleMetricCriteria struct. 3962func (masrmmc *MetricAlertSingleResourceMultipleMetricCriteria) UnmarshalJSON(body []byte) error { 3963 var m map[string]*json.RawMessage 3964 err := json.Unmarshal(body, &m) 3965 if err != nil { 3966 return err 3967 } 3968 for k, v := range m { 3969 switch k { 3970 case "allOf": 3971 if v != nil { 3972 var allOf []MetricCriteria 3973 err = json.Unmarshal(*v, &allOf) 3974 if err != nil { 3975 return err 3976 } 3977 masrmmc.AllOf = &allOf 3978 } 3979 default: 3980 if v != nil { 3981 var additionalProperties interface{} 3982 err = json.Unmarshal(*v, &additionalProperties) 3983 if err != nil { 3984 return err 3985 } 3986 if masrmmc.AdditionalProperties == nil { 3987 masrmmc.AdditionalProperties = make(map[string]interface{}) 3988 } 3989 masrmmc.AdditionalProperties[k] = additionalProperties 3990 } 3991 case "odata.type": 3992 if v != nil { 3993 var odataType OdataTypeBasicMetricAlertCriteria 3994 err = json.Unmarshal(*v, &odataType) 3995 if err != nil { 3996 return err 3997 } 3998 masrmmc.OdataType = odataType 3999 } 4000 } 4001 } 4002 4003 return nil 4004} 4005 4006// MetricAlertStatus an alert status. 4007type MetricAlertStatus struct { 4008 // Name - The status name. 4009 Name *string `json:"name,omitempty"` 4010 // ID - The alert rule arm id. 4011 ID *string `json:"id,omitempty"` 4012 // Type - The extended resource type name. 4013 Type *string `json:"type,omitempty"` 4014 // Properties - The alert status properties of the metric alert status. 4015 Properties *MetricAlertStatusProperties `json:"properties,omitempty"` 4016} 4017 4018// MetricAlertStatusCollection represents a collection of alert rule resources. 4019type MetricAlertStatusCollection struct { 4020 autorest.Response `json:"-"` 4021 // Value - the values for the alert rule resources. 4022 Value *[]MetricAlertStatus `json:"value,omitempty"` 4023} 4024 4025// MetricAlertStatusProperties an alert status properties. 4026type MetricAlertStatusProperties struct { 4027 // Dimensions - An object describing the type of the dimensions. 4028 Dimensions map[string]*string `json:"dimensions"` 4029 // Status - status value 4030 Status *string `json:"status,omitempty"` 4031 // Timestamp - UTC time when the status was checked. 4032 Timestamp *date.Time `json:"timestamp,omitempty"` 4033} 4034 4035// MarshalJSON is the custom marshaler for MetricAlertStatusProperties. 4036func (masp MetricAlertStatusProperties) MarshalJSON() ([]byte, error) { 4037 objectMap := make(map[string]interface{}) 4038 if masp.Dimensions != nil { 4039 objectMap["dimensions"] = masp.Dimensions 4040 } 4041 if masp.Status != nil { 4042 objectMap["status"] = masp.Status 4043 } 4044 if masp.Timestamp != nil { 4045 objectMap["timestamp"] = masp.Timestamp 4046 } 4047 return json.Marshal(objectMap) 4048} 4049 4050// MetricAvailability metric availability specifies the time grain (aggregation interval or frequency) and 4051// the retention period for that time grain. 4052type MetricAvailability struct { 4053 // TimeGrain - the time grain specifies the aggregation interval for the metric. Expressed as a duration 'PT1M', 'P1D', etc. 4054 TimeGrain *string `json:"timeGrain,omitempty"` 4055 // Retention - the retention period for the metric at the specified timegrain. Expressed as a duration 'PT1M', 'P1D', etc. 4056 Retention *string `json:"retention,omitempty"` 4057} 4058 4059// MetricCriteria criterion to filter metrics. 4060type MetricCriteria struct { 4061 // Operator - the criteria operator. 4062 Operator interface{} `json:"operator,omitempty"` 4063 // Threshold - the criteria threshold value that activates the alert. 4064 Threshold *float64 `json:"threshold,omitempty"` 4065 // AdditionalProperties - Unmatched properties from the message are deserialized this collection 4066 AdditionalProperties map[string]interface{} `json:""` 4067 // Name - Name of the criteria. 4068 Name *string `json:"name,omitempty"` 4069 // MetricName - Name of the metric. 4070 MetricName *string `json:"metricName,omitempty"` 4071 // MetricNamespace - Namespace of the metric. 4072 MetricNamespace *string `json:"metricNamespace,omitempty"` 4073 // TimeAggregation - the criteria time aggregation types. 4074 TimeAggregation interface{} `json:"timeAggregation,omitempty"` 4075 // Dimensions - List of dimension conditions. 4076 Dimensions *[]MetricDimension `json:"dimensions,omitempty"` 4077 // CriterionType - Possible values include: 'CriterionTypeMultiMetricCriteria', 'CriterionTypeStaticThresholdCriterion', 'CriterionTypeDynamicThresholdCriterion' 4078 CriterionType CriterionType `json:"criterionType,omitempty"` 4079} 4080 4081// MarshalJSON is the custom marshaler for MetricCriteria. 4082func (mc MetricCriteria) MarshalJSON() ([]byte, error) { 4083 mc.CriterionType = CriterionTypeStaticThresholdCriterion 4084 objectMap := make(map[string]interface{}) 4085 if mc.Operator != nil { 4086 objectMap["operator"] = mc.Operator 4087 } 4088 if mc.Threshold != nil { 4089 objectMap["threshold"] = mc.Threshold 4090 } 4091 if mc.Name != nil { 4092 objectMap["name"] = mc.Name 4093 } 4094 if mc.MetricName != nil { 4095 objectMap["metricName"] = mc.MetricName 4096 } 4097 if mc.MetricNamespace != nil { 4098 objectMap["metricNamespace"] = mc.MetricNamespace 4099 } 4100 if mc.TimeAggregation != nil { 4101 objectMap["timeAggregation"] = mc.TimeAggregation 4102 } 4103 if mc.Dimensions != nil { 4104 objectMap["dimensions"] = mc.Dimensions 4105 } 4106 if mc.CriterionType != "" { 4107 objectMap["criterionType"] = mc.CriterionType 4108 } 4109 for k, v := range mc.AdditionalProperties { 4110 objectMap[k] = v 4111 } 4112 return json.Marshal(objectMap) 4113} 4114 4115// AsMetricCriteria is the BasicMultiMetricCriteria implementation for MetricCriteria. 4116func (mc MetricCriteria) AsMetricCriteria() (*MetricCriteria, bool) { 4117 return &mc, true 4118} 4119 4120// AsDynamicMetricCriteria is the BasicMultiMetricCriteria implementation for MetricCriteria. 4121func (mc MetricCriteria) AsDynamicMetricCriteria() (*DynamicMetricCriteria, bool) { 4122 return nil, false 4123} 4124 4125// AsMultiMetricCriteria is the BasicMultiMetricCriteria implementation for MetricCriteria. 4126func (mc MetricCriteria) AsMultiMetricCriteria() (*MultiMetricCriteria, bool) { 4127 return nil, false 4128} 4129 4130// AsBasicMultiMetricCriteria is the BasicMultiMetricCriteria implementation for MetricCriteria. 4131func (mc MetricCriteria) AsBasicMultiMetricCriteria() (BasicMultiMetricCriteria, bool) { 4132 return &mc, true 4133} 4134 4135// UnmarshalJSON is the custom unmarshaler for MetricCriteria struct. 4136func (mc *MetricCriteria) UnmarshalJSON(body []byte) error { 4137 var m map[string]*json.RawMessage 4138 err := json.Unmarshal(body, &m) 4139 if err != nil { 4140 return err 4141 } 4142 for k, v := range m { 4143 switch k { 4144 case "operator": 4145 if v != nil { 4146 var operator interface{} 4147 err = json.Unmarshal(*v, &operator) 4148 if err != nil { 4149 return err 4150 } 4151 mc.Operator = operator 4152 } 4153 case "threshold": 4154 if v != nil { 4155 var threshold float64 4156 err = json.Unmarshal(*v, &threshold) 4157 if err != nil { 4158 return err 4159 } 4160 mc.Threshold = &threshold 4161 } 4162 default: 4163 if v != nil { 4164 var additionalProperties interface{} 4165 err = json.Unmarshal(*v, &additionalProperties) 4166 if err != nil { 4167 return err 4168 } 4169 if mc.AdditionalProperties == nil { 4170 mc.AdditionalProperties = make(map[string]interface{}) 4171 } 4172 mc.AdditionalProperties[k] = additionalProperties 4173 } 4174 case "name": 4175 if v != nil { 4176 var name string 4177 err = json.Unmarshal(*v, &name) 4178 if err != nil { 4179 return err 4180 } 4181 mc.Name = &name 4182 } 4183 case "metricName": 4184 if v != nil { 4185 var metricName string 4186 err = json.Unmarshal(*v, &metricName) 4187 if err != nil { 4188 return err 4189 } 4190 mc.MetricName = &metricName 4191 } 4192 case "metricNamespace": 4193 if v != nil { 4194 var metricNamespace string 4195 err = json.Unmarshal(*v, &metricNamespace) 4196 if err != nil { 4197 return err 4198 } 4199 mc.MetricNamespace = &metricNamespace 4200 } 4201 case "timeAggregation": 4202 if v != nil { 4203 var timeAggregation interface{} 4204 err = json.Unmarshal(*v, &timeAggregation) 4205 if err != nil { 4206 return err 4207 } 4208 mc.TimeAggregation = timeAggregation 4209 } 4210 case "dimensions": 4211 if v != nil { 4212 var dimensions []MetricDimension 4213 err = json.Unmarshal(*v, &dimensions) 4214 if err != nil { 4215 return err 4216 } 4217 mc.Dimensions = &dimensions 4218 } 4219 case "criterionType": 4220 if v != nil { 4221 var criterionType CriterionType 4222 err = json.Unmarshal(*v, &criterionType) 4223 if err != nil { 4224 return err 4225 } 4226 mc.CriterionType = criterionType 4227 } 4228 } 4229 } 4230 4231 return nil 4232} 4233 4234// MetricDefinition metric definition class specifies the metadata for a metric. 4235type MetricDefinition struct { 4236 // IsDimensionRequired - Flag to indicate whether the dimension is required. 4237 IsDimensionRequired *bool `json:"isDimensionRequired,omitempty"` 4238 // ResourceID - the resource identifier of the resource that emitted the metric. 4239 ResourceID *string `json:"resourceId,omitempty"` 4240 // Namespace - the namespace the metric belongs to. 4241 Namespace *string `json:"namespace,omitempty"` 4242 // Name - the name and the display name of the metric, i.e. it is a localizable string. 4243 Name *LocalizableString `json:"name,omitempty"` 4244 // Unit - the unit of the metric. Possible values include: 'UnitCount', 'UnitBytes', 'UnitSeconds', 'UnitCountPerSecond', 'UnitBytesPerSecond', 'UnitPercent', 'UnitMilliSeconds', 'UnitByteSeconds', 'UnitUnspecified', 'UnitCores', 'UnitMilliCores', 'UnitNanoCores', 'UnitBitsPerSecond' 4245 Unit Unit `json:"unit,omitempty"` 4246 // PrimaryAggregationType - the primary aggregation type value defining how to use the values for display. Possible values include: 'None', 'Average', 'Count', 'Minimum', 'Maximum', 'Total' 4247 PrimaryAggregationType AggregationType `json:"primaryAggregationType,omitempty"` 4248 // SupportedAggregationTypes - the collection of what aggregation types are supported. 4249 SupportedAggregationTypes *[]AggregationType `json:"supportedAggregationTypes,omitempty"` 4250 // MetricAvailabilities - the collection of what aggregation intervals are available to be queried. 4251 MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"` 4252 // ID - the resource identifier of the metric definition. 4253 ID *string `json:"id,omitempty"` 4254 // Dimensions - the name and the display name of the dimension, i.e. it is a localizable string. 4255 Dimensions *[]LocalizableString `json:"dimensions,omitempty"` 4256} 4257 4258// MetricDefinitionCollection represents collection of metric definitions. 4259type MetricDefinitionCollection struct { 4260 autorest.Response `json:"-"` 4261 // Value - the values for the metric definitions. 4262 Value *[]MetricDefinition `json:"value,omitempty"` 4263} 4264 4265// MetricDimension specifies a metric dimension. 4266type MetricDimension struct { 4267 // Name - Name of the dimension. 4268 Name *string `json:"name,omitempty"` 4269 // Operator - the dimension operator. Only 'Include' and 'Exclude' are supported 4270 Operator *string `json:"operator,omitempty"` 4271 // Values - list of dimension values. 4272 Values *[]string `json:"values,omitempty"` 4273} 4274 4275// MetricNamespace metric namespace class specifies the metadata for a metric namespace. 4276type MetricNamespace struct { 4277 // ID - The ID of the metricNamespace. 4278 ID *string `json:"id,omitempty"` 4279 // Type - The type of the namespace. 4280 Type *string `json:"type,omitempty"` 4281 // Name - The name of the namespace. 4282 Name *string `json:"name,omitempty"` 4283 // Properties - Properties which include the fully qualified namespace name. 4284 Properties *MetricNamespaceName `json:"properties,omitempty"` 4285} 4286 4287// MetricNamespaceCollection represents collection of metric namespaces. 4288type MetricNamespaceCollection struct { 4289 autorest.Response `json:"-"` 4290 // Value - The values for the metric namespaces. 4291 Value *[]MetricNamespace `json:"value,omitempty"` 4292} 4293 4294// MetricNamespaceName the fully qualified metric namespace name. 4295type MetricNamespaceName struct { 4296 // MetricNamespaceName - The metric namespace name. 4297 MetricNamespaceName *string `json:"metricNamespaceName,omitempty"` 4298} 4299 4300// MetricSettings part of MultiTenantDiagnosticSettings. Specifies the settings for a particular metric. 4301type MetricSettings struct { 4302 // TimeGrain - the timegrain of the metric in ISO8601 format. 4303 TimeGrain *string `json:"timeGrain,omitempty"` 4304 // Category - Name of a Diagnostic Metric category for a resource type this setting is applied to. To obtain the list of Diagnostic metric categories for a resource, first perform a GET diagnostic settings operation. 4305 Category *string `json:"category,omitempty"` 4306 // Enabled - a value indicating whether this category is enabled. 4307 Enabled *bool `json:"enabled,omitempty"` 4308 // RetentionPolicy - the retention policy for this category. 4309 RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"` 4310} 4311 4312// MetricTrigger the trigger that results in a scaling action. 4313type MetricTrigger struct { 4314 // MetricName - the name of the metric that defines what the rule monitors. 4315 MetricName *string `json:"metricName,omitempty"` 4316 // MetricResourceURI - the resource identifier of the resource the rule monitors. 4317 MetricResourceURI *string `json:"metricResourceUri,omitempty"` 4318 // TimeGrain - the granularity of metrics the rule monitors. Must be one of the predefined values returned from metric definitions for the metric. Must be between 12 hours and 1 minute. 4319 TimeGrain *string `json:"timeGrain,omitempty"` 4320 // Statistic - the metric statistic type. How the metrics from multiple instances are combined. Possible values include: 'MetricStatisticTypeAverage', 'MetricStatisticTypeMin', 'MetricStatisticTypeMax', 'MetricStatisticTypeSum' 4321 Statistic MetricStatisticType `json:"statistic,omitempty"` 4322 // TimeWindow - the range of time in which instance data is collected. This value must be greater than the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours and 5 minutes. 4323 TimeWindow *string `json:"timeWindow,omitempty"` 4324 // TimeAggregation - time aggregation type. How the data that is collected should be combined over time. The default value is Average. Possible values include: 'TimeAggregationTypeAverage', 'TimeAggregationTypeMinimum', 'TimeAggregationTypeMaximum', 'TimeAggregationTypeTotal', 'TimeAggregationTypeCount', 'TimeAggregationTypeLast' 4325 TimeAggregation TimeAggregationType `json:"timeAggregation,omitempty"` 4326 // Operator - the operator that is used to compare the metric data and the threshold. Possible values include: 'Equals', 'NotEquals', 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual' 4327 Operator ComparisonOperationType `json:"operator,omitempty"` 4328 // Threshold - the threshold of the metric that triggers the scale action. 4329 Threshold *float64 `json:"threshold,omitempty"` 4330} 4331 4332// MetricValue represents a metric value. 4333type MetricValue struct { 4334 // TimeStamp - the timestamp for the metric value in ISO 8601 format. 4335 TimeStamp *date.Time `json:"timeStamp,omitempty"` 4336 // Average - the average value in the time range. 4337 Average *float64 `json:"average,omitempty"` 4338 // Minimum - the least value in the time range. 4339 Minimum *float64 `json:"minimum,omitempty"` 4340 // Maximum - the greatest value in the time range. 4341 Maximum *float64 `json:"maximum,omitempty"` 4342 // Total - the sum of all of the values in the time range. 4343 Total *float64 `json:"total,omitempty"` 4344 // Count - the number of samples in the time range. Can be used to determine the number of values that contributed to the average value. 4345 Count *float64 `json:"count,omitempty"` 4346} 4347 4348// BasicMultiMetricCriteria the types of conditions for a multi resource alert. 4349type BasicMultiMetricCriteria interface { 4350 AsMetricCriteria() (*MetricCriteria, bool) 4351 AsDynamicMetricCriteria() (*DynamicMetricCriteria, bool) 4352 AsMultiMetricCriteria() (*MultiMetricCriteria, bool) 4353} 4354 4355// MultiMetricCriteria the types of conditions for a multi resource alert. 4356type MultiMetricCriteria struct { 4357 // AdditionalProperties - Unmatched properties from the message are deserialized this collection 4358 AdditionalProperties map[string]interface{} `json:""` 4359 // Name - Name of the criteria. 4360 Name *string `json:"name,omitempty"` 4361 // MetricName - Name of the metric. 4362 MetricName *string `json:"metricName,omitempty"` 4363 // MetricNamespace - Namespace of the metric. 4364 MetricNamespace *string `json:"metricNamespace,omitempty"` 4365 // TimeAggregation - the criteria time aggregation types. 4366 TimeAggregation interface{} `json:"timeAggregation,omitempty"` 4367 // Dimensions - List of dimension conditions. 4368 Dimensions *[]MetricDimension `json:"dimensions,omitempty"` 4369 // CriterionType - Possible values include: 'CriterionTypeMultiMetricCriteria', 'CriterionTypeStaticThresholdCriterion', 'CriterionTypeDynamicThresholdCriterion' 4370 CriterionType CriterionType `json:"criterionType,omitempty"` 4371} 4372 4373func unmarshalBasicMultiMetricCriteria(body []byte) (BasicMultiMetricCriteria, error) { 4374 var m map[string]interface{} 4375 err := json.Unmarshal(body, &m) 4376 if err != nil { 4377 return nil, err 4378 } 4379 4380 switch m["criterionType"] { 4381 case string(CriterionTypeStaticThresholdCriterion): 4382 var mc MetricCriteria 4383 err := json.Unmarshal(body, &mc) 4384 return mc, err 4385 case string(CriterionTypeDynamicThresholdCriterion): 4386 var dmc DynamicMetricCriteria 4387 err := json.Unmarshal(body, &dmc) 4388 return dmc, err 4389 default: 4390 var mmc MultiMetricCriteria 4391 err := json.Unmarshal(body, &mmc) 4392 return mmc, err 4393 } 4394} 4395func unmarshalBasicMultiMetricCriteriaArray(body []byte) ([]BasicMultiMetricCriteria, error) { 4396 var rawMessages []*json.RawMessage 4397 err := json.Unmarshal(body, &rawMessages) 4398 if err != nil { 4399 return nil, err 4400 } 4401 4402 mmcArray := make([]BasicMultiMetricCriteria, len(rawMessages)) 4403 4404 for index, rawMessage := range rawMessages { 4405 mmc, err := unmarshalBasicMultiMetricCriteria(*rawMessage) 4406 if err != nil { 4407 return nil, err 4408 } 4409 mmcArray[index] = mmc 4410 } 4411 return mmcArray, nil 4412} 4413 4414// MarshalJSON is the custom marshaler for MultiMetricCriteria. 4415func (mmc MultiMetricCriteria) MarshalJSON() ([]byte, error) { 4416 mmc.CriterionType = CriterionTypeMultiMetricCriteria 4417 objectMap := make(map[string]interface{}) 4418 if mmc.Name != nil { 4419 objectMap["name"] = mmc.Name 4420 } 4421 if mmc.MetricName != nil { 4422 objectMap["metricName"] = mmc.MetricName 4423 } 4424 if mmc.MetricNamespace != nil { 4425 objectMap["metricNamespace"] = mmc.MetricNamespace 4426 } 4427 if mmc.TimeAggregation != nil { 4428 objectMap["timeAggregation"] = mmc.TimeAggregation 4429 } 4430 if mmc.Dimensions != nil { 4431 objectMap["dimensions"] = mmc.Dimensions 4432 } 4433 if mmc.CriterionType != "" { 4434 objectMap["criterionType"] = mmc.CriterionType 4435 } 4436 for k, v := range mmc.AdditionalProperties { 4437 objectMap[k] = v 4438 } 4439 return json.Marshal(objectMap) 4440} 4441 4442// AsMetricCriteria is the BasicMultiMetricCriteria implementation for MultiMetricCriteria. 4443func (mmc MultiMetricCriteria) AsMetricCriteria() (*MetricCriteria, bool) { 4444 return nil, false 4445} 4446 4447// AsDynamicMetricCriteria is the BasicMultiMetricCriteria implementation for MultiMetricCriteria. 4448func (mmc MultiMetricCriteria) AsDynamicMetricCriteria() (*DynamicMetricCriteria, bool) { 4449 return nil, false 4450} 4451 4452// AsMultiMetricCriteria is the BasicMultiMetricCriteria implementation for MultiMetricCriteria. 4453func (mmc MultiMetricCriteria) AsMultiMetricCriteria() (*MultiMetricCriteria, bool) { 4454 return &mmc, true 4455} 4456 4457// AsBasicMultiMetricCriteria is the BasicMultiMetricCriteria implementation for MultiMetricCriteria. 4458func (mmc MultiMetricCriteria) AsBasicMultiMetricCriteria() (BasicMultiMetricCriteria, bool) { 4459 return &mmc, true 4460} 4461 4462// UnmarshalJSON is the custom unmarshaler for MultiMetricCriteria struct. 4463func (mmc *MultiMetricCriteria) UnmarshalJSON(body []byte) error { 4464 var m map[string]*json.RawMessage 4465 err := json.Unmarshal(body, &m) 4466 if err != nil { 4467 return err 4468 } 4469 for k, v := range m { 4470 switch k { 4471 default: 4472 if v != nil { 4473 var additionalProperties interface{} 4474 err = json.Unmarshal(*v, &additionalProperties) 4475 if err != nil { 4476 return err 4477 } 4478 if mmc.AdditionalProperties == nil { 4479 mmc.AdditionalProperties = make(map[string]interface{}) 4480 } 4481 mmc.AdditionalProperties[k] = additionalProperties 4482 } 4483 case "name": 4484 if v != nil { 4485 var name string 4486 err = json.Unmarshal(*v, &name) 4487 if err != nil { 4488 return err 4489 } 4490 mmc.Name = &name 4491 } 4492 case "metricName": 4493 if v != nil { 4494 var metricName string 4495 err = json.Unmarshal(*v, &metricName) 4496 if err != nil { 4497 return err 4498 } 4499 mmc.MetricName = &metricName 4500 } 4501 case "metricNamespace": 4502 if v != nil { 4503 var metricNamespace string 4504 err = json.Unmarshal(*v, &metricNamespace) 4505 if err != nil { 4506 return err 4507 } 4508 mmc.MetricNamespace = &metricNamespace 4509 } 4510 case "timeAggregation": 4511 if v != nil { 4512 var timeAggregation interface{} 4513 err = json.Unmarshal(*v, &timeAggregation) 4514 if err != nil { 4515 return err 4516 } 4517 mmc.TimeAggregation = timeAggregation 4518 } 4519 case "dimensions": 4520 if v != nil { 4521 var dimensions []MetricDimension 4522 err = json.Unmarshal(*v, &dimensions) 4523 if err != nil { 4524 return err 4525 } 4526 mmc.Dimensions = &dimensions 4527 } 4528 case "criterionType": 4529 if v != nil { 4530 var criterionType CriterionType 4531 err = json.Unmarshal(*v, &criterionType) 4532 if err != nil { 4533 return err 4534 } 4535 mmc.CriterionType = criterionType 4536 } 4537 } 4538 } 4539 4540 return nil 4541} 4542 4543// Operation microsoft Insights API operation definition. 4544type Operation struct { 4545 // Name - Operation name: {provider}/{resource}/{operation} 4546 Name *string `json:"name,omitempty"` 4547 // Display - Display metadata associated with the operation. 4548 Display *OperationDisplay `json:"display,omitempty"` 4549} 4550 4551// OperationDisplay display metadata associated with the operation. 4552type OperationDisplay struct { 4553 // Provider - Service provider: Microsoft.Insights 4554 Provider *string `json:"provider,omitempty"` 4555 // Resource - Resource on which the operation is performed: AlertRules, Autoscale, etc. 4556 Resource *string `json:"resource,omitempty"` 4557 // Operation - Operation type: Read, write, delete, etc. 4558 Operation *string `json:"operation,omitempty"` 4559} 4560 4561// OperationListResult result of the request to list Microsoft.Insights operations. It contains a list of 4562// operations and a URL link to get the next set of results. 4563type OperationListResult struct { 4564 autorest.Response `json:"-"` 4565 // Value - List of operations supported by the Microsoft.Insights provider. 4566 Value *[]Operation `json:"value,omitempty"` 4567 // NextLink - URL to get the next set of operation list results if there are any. 4568 NextLink *string `json:"nextLink,omitempty"` 4569} 4570 4571// ProxyOnlyResource a proxy only azure resource object 4572type ProxyOnlyResource struct { 4573 // ID - READ-ONLY; Azure resource Id 4574 ID *string `json:"id,omitempty"` 4575 // Name - READ-ONLY; Azure resource name 4576 Name *string `json:"name,omitempty"` 4577 // Type - READ-ONLY; Azure resource type 4578 Type *string `json:"type,omitempty"` 4579} 4580 4581// ProxyResource an azure resource object 4582type ProxyResource struct { 4583 // ID - READ-ONLY; Azure resource Id 4584 ID *string `json:"id,omitempty"` 4585 // Name - READ-ONLY; Azure resource name 4586 Name *string `json:"name,omitempty"` 4587 // Type - READ-ONLY; Azure resource type 4588 Type *string `json:"type,omitempty"` 4589} 4590 4591// Recurrence the repeating times at which this profile begins. This element is not used if the FixedDate 4592// element is used. 4593type Recurrence struct { 4594 // Frequency - the recurrence frequency. How often the schedule profile should take effect. This value must be Week, meaning each week will have the same set of profiles. For example, to set a daily schedule, set **schedule** to every day of the week. The frequency property specifies that the schedule is repeated weekly. Possible values include: 'RecurrenceFrequencyNone', 'RecurrenceFrequencySecond', 'RecurrenceFrequencyMinute', 'RecurrenceFrequencyHour', 'RecurrenceFrequencyDay', 'RecurrenceFrequencyWeek', 'RecurrenceFrequencyMonth', 'RecurrenceFrequencyYear' 4595 Frequency RecurrenceFrequency `json:"frequency,omitempty"` 4596 // Schedule - the scheduling constraints for when the profile begins. 4597 Schedule *RecurrentSchedule `json:"schedule,omitempty"` 4598} 4599 4600// RecurrentSchedule the scheduling constraints for when the profile begins. 4601type RecurrentSchedule struct { 4602 // TimeZone - the timezone for the hours of the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time 4603 TimeZone *string `json:"timeZone,omitempty"` 4604 // Days - the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. 4605 Days *[]string `json:"days,omitempty"` 4606 // Hours - A collection of hours that the profile takes effect on. Values supported are 0 to 23 on the 24-hour clock (AM/PM times are not supported). 4607 Hours *[]int32 `json:"hours,omitempty"` 4608 // Minutes - A collection of minutes at which the profile takes effect at. 4609 Minutes *[]int32 `json:"minutes,omitempty"` 4610} 4611 4612// Resource an azure resource object 4613type Resource struct { 4614 // ID - READ-ONLY; Azure resource Id 4615 ID *string `json:"id,omitempty"` 4616 // Name - READ-ONLY; Azure resource name 4617 Name *string `json:"name,omitempty"` 4618 // Type - READ-ONLY; Azure resource type 4619 Type *string `json:"type,omitempty"` 4620 // Location - Resource location 4621 Location *string `json:"location,omitempty"` 4622 // Tags - Resource tags 4623 Tags map[string]*string `json:"tags"` 4624} 4625 4626// MarshalJSON is the custom marshaler for Resource. 4627func (r Resource) MarshalJSON() ([]byte, error) { 4628 objectMap := make(map[string]interface{}) 4629 if r.Location != nil { 4630 objectMap["location"] = r.Location 4631 } 4632 if r.Tags != nil { 4633 objectMap["tags"] = r.Tags 4634 } 4635 return json.Marshal(objectMap) 4636} 4637 4638// Response the response to a metrics query. 4639type Response struct { 4640 autorest.Response `json:"-"` 4641 // Cost - The integer value representing the cost of the query, for data case. 4642 Cost *float64 `json:"cost,omitempty"` 4643 // Timespan - The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally requested. 4644 Timespan *string `json:"timespan,omitempty"` 4645 // Interval - The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned back from what was originally requested. This is not present if a metadata request was made. 4646 Interval *string `json:"interval,omitempty"` 4647 // Namespace - The namespace of the metrics been queried 4648 Namespace *string `json:"namespace,omitempty"` 4649 // Resourceregion - The region of the resource been queried for metrics. 4650 Resourceregion *string `json:"resourceregion,omitempty"` 4651 // Value - the value of the collection. 4652 Value *[]Metric `json:"value,omitempty"` 4653} 4654 4655// ResponseWithError an error response from the API. 4656type ResponseWithError struct { 4657 // Error - Error information. 4658 Error *Error `json:"error,omitempty"` 4659} 4660 4661// RetentionPolicy specifies the retention policy for the log. 4662type RetentionPolicy struct { 4663 // Enabled - a value indicating whether the retention policy is enabled. 4664 Enabled *bool `json:"enabled,omitempty"` 4665 // Days - the number of days for the retention in days. A value of 0 will retain the events indefinitely. 4666 Days *int32 `json:"days,omitempty"` 4667} 4668 4669// BasicRuleAction the action that is performed when the alert rule becomes active, and when an alert condition is 4670// resolved. 4671type BasicRuleAction interface { 4672 AsRuleEmailAction() (*RuleEmailAction, bool) 4673 AsRuleWebhookAction() (*RuleWebhookAction, bool) 4674 AsRuleAction() (*RuleAction, bool) 4675} 4676 4677// RuleAction the action that is performed when the alert rule becomes active, and when an alert condition is 4678// resolved. 4679type RuleAction struct { 4680 // OdataType - Possible values include: 'OdataTypeRuleAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction' 4681 OdataType OdataTypeBasicRuleAction `json:"odata.type,omitempty"` 4682} 4683 4684func unmarshalBasicRuleAction(body []byte) (BasicRuleAction, error) { 4685 var m map[string]interface{} 4686 err := json.Unmarshal(body, &m) 4687 if err != nil { 4688 return nil, err 4689 } 4690 4691 switch m["odata.type"] { 4692 case string(OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction): 4693 var rea RuleEmailAction 4694 err := json.Unmarshal(body, &rea) 4695 return rea, err 4696 case string(OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction): 4697 var rwa RuleWebhookAction 4698 err := json.Unmarshal(body, &rwa) 4699 return rwa, err 4700 default: 4701 var ra RuleAction 4702 err := json.Unmarshal(body, &ra) 4703 return ra, err 4704 } 4705} 4706func unmarshalBasicRuleActionArray(body []byte) ([]BasicRuleAction, error) { 4707 var rawMessages []*json.RawMessage 4708 err := json.Unmarshal(body, &rawMessages) 4709 if err != nil { 4710 return nil, err 4711 } 4712 4713 raArray := make([]BasicRuleAction, len(rawMessages)) 4714 4715 for index, rawMessage := range rawMessages { 4716 ra, err := unmarshalBasicRuleAction(*rawMessage) 4717 if err != nil { 4718 return nil, err 4719 } 4720 raArray[index] = ra 4721 } 4722 return raArray, nil 4723} 4724 4725// MarshalJSON is the custom marshaler for RuleAction. 4726func (ra RuleAction) MarshalJSON() ([]byte, error) { 4727 ra.OdataType = OdataTypeRuleAction 4728 objectMap := make(map[string]interface{}) 4729 if ra.OdataType != "" { 4730 objectMap["odata.type"] = ra.OdataType 4731 } 4732 return json.Marshal(objectMap) 4733} 4734 4735// AsRuleEmailAction is the BasicRuleAction implementation for RuleAction. 4736func (ra RuleAction) AsRuleEmailAction() (*RuleEmailAction, bool) { 4737 return nil, false 4738} 4739 4740// AsRuleWebhookAction is the BasicRuleAction implementation for RuleAction. 4741func (ra RuleAction) AsRuleWebhookAction() (*RuleWebhookAction, bool) { 4742 return nil, false 4743} 4744 4745// AsRuleAction is the BasicRuleAction implementation for RuleAction. 4746func (ra RuleAction) AsRuleAction() (*RuleAction, bool) { 4747 return &ra, true 4748} 4749 4750// AsBasicRuleAction is the BasicRuleAction implementation for RuleAction. 4751func (ra RuleAction) AsBasicRuleAction() (BasicRuleAction, bool) { 4752 return &ra, true 4753} 4754 4755// BasicRuleCondition the condition that results in the alert rule being activated. 4756type BasicRuleCondition interface { 4757 AsThresholdRuleCondition() (*ThresholdRuleCondition, bool) 4758 AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool) 4759 AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool) 4760 AsRuleCondition() (*RuleCondition, bool) 4761} 4762 4763// RuleCondition the condition that results in the alert rule being activated. 4764type RuleCondition struct { 4765 // DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource. 4766 DataSource BasicRuleDataSource `json:"dataSource,omitempty"` 4767 // OdataType - Possible values include: 'OdataTypeRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition' 4768 OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"` 4769} 4770 4771func unmarshalBasicRuleCondition(body []byte) (BasicRuleCondition, error) { 4772 var m map[string]interface{} 4773 err := json.Unmarshal(body, &m) 4774 if err != nil { 4775 return nil, err 4776 } 4777 4778 switch m["odata.type"] { 4779 case string(OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition): 4780 var trc ThresholdRuleCondition 4781 err := json.Unmarshal(body, &trc) 4782 return trc, err 4783 case string(OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition): 4784 var ltrc LocationThresholdRuleCondition 4785 err := json.Unmarshal(body, <rc) 4786 return ltrc, err 4787 case string(OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition): 4788 var merc ManagementEventRuleCondition 4789 err := json.Unmarshal(body, &merc) 4790 return merc, err 4791 default: 4792 var rc RuleCondition 4793 err := json.Unmarshal(body, &rc) 4794 return rc, err 4795 } 4796} 4797func unmarshalBasicRuleConditionArray(body []byte) ([]BasicRuleCondition, error) { 4798 var rawMessages []*json.RawMessage 4799 err := json.Unmarshal(body, &rawMessages) 4800 if err != nil { 4801 return nil, err 4802 } 4803 4804 rcArray := make([]BasicRuleCondition, len(rawMessages)) 4805 4806 for index, rawMessage := range rawMessages { 4807 rc, err := unmarshalBasicRuleCondition(*rawMessage) 4808 if err != nil { 4809 return nil, err 4810 } 4811 rcArray[index] = rc 4812 } 4813 return rcArray, nil 4814} 4815 4816// MarshalJSON is the custom marshaler for RuleCondition. 4817func (rc RuleCondition) MarshalJSON() ([]byte, error) { 4818 rc.OdataType = OdataTypeRuleCondition 4819 objectMap := make(map[string]interface{}) 4820 objectMap["dataSource"] = rc.DataSource 4821 if rc.OdataType != "" { 4822 objectMap["odata.type"] = rc.OdataType 4823 } 4824 return json.Marshal(objectMap) 4825} 4826 4827// AsThresholdRuleCondition is the BasicRuleCondition implementation for RuleCondition. 4828func (rc RuleCondition) AsThresholdRuleCondition() (*ThresholdRuleCondition, bool) { 4829 return nil, false 4830} 4831 4832// AsLocationThresholdRuleCondition is the BasicRuleCondition implementation for RuleCondition. 4833func (rc RuleCondition) AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool) { 4834 return nil, false 4835} 4836 4837// AsManagementEventRuleCondition is the BasicRuleCondition implementation for RuleCondition. 4838func (rc RuleCondition) AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool) { 4839 return nil, false 4840} 4841 4842// AsRuleCondition is the BasicRuleCondition implementation for RuleCondition. 4843func (rc RuleCondition) AsRuleCondition() (*RuleCondition, bool) { 4844 return &rc, true 4845} 4846 4847// AsBasicRuleCondition is the BasicRuleCondition implementation for RuleCondition. 4848func (rc RuleCondition) AsBasicRuleCondition() (BasicRuleCondition, bool) { 4849 return &rc, true 4850} 4851 4852// UnmarshalJSON is the custom unmarshaler for RuleCondition struct. 4853func (rc *RuleCondition) UnmarshalJSON(body []byte) error { 4854 var m map[string]*json.RawMessage 4855 err := json.Unmarshal(body, &m) 4856 if err != nil { 4857 return err 4858 } 4859 for k, v := range m { 4860 switch k { 4861 case "dataSource": 4862 if v != nil { 4863 dataSource, err := unmarshalBasicRuleDataSource(*v) 4864 if err != nil { 4865 return err 4866 } 4867 rc.DataSource = dataSource 4868 } 4869 case "odata.type": 4870 if v != nil { 4871 var odataType OdataTypeBasicRuleCondition 4872 err = json.Unmarshal(*v, &odataType) 4873 if err != nil { 4874 return err 4875 } 4876 rc.OdataType = odataType 4877 } 4878 } 4879 } 4880 4881 return nil 4882} 4883 4884// BasicRuleDataSource the resource from which the rule collects its data. 4885type BasicRuleDataSource interface { 4886 AsRuleMetricDataSource() (*RuleMetricDataSource, bool) 4887 AsRuleManagementEventDataSource() (*RuleManagementEventDataSource, bool) 4888 AsRuleDataSource() (*RuleDataSource, bool) 4889} 4890 4891// RuleDataSource the resource from which the rule collects its data. 4892type RuleDataSource struct { 4893 // ResourceURI - the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule. 4894 ResourceURI *string `json:"resourceUri,omitempty"` 4895 // OdataType - Possible values include: 'OdataTypeRuleDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource' 4896 OdataType OdataType `json:"odata.type,omitempty"` 4897} 4898 4899func unmarshalBasicRuleDataSource(body []byte) (BasicRuleDataSource, error) { 4900 var m map[string]interface{} 4901 err := json.Unmarshal(body, &m) 4902 if err != nil { 4903 return nil, err 4904 } 4905 4906 switch m["odata.type"] { 4907 case string(OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource): 4908 var rmds RuleMetricDataSource 4909 err := json.Unmarshal(body, &rmds) 4910 return rmds, err 4911 case string(OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource): 4912 var rmeds RuleManagementEventDataSource 4913 err := json.Unmarshal(body, &rmeds) 4914 return rmeds, err 4915 default: 4916 var rds RuleDataSource 4917 err := json.Unmarshal(body, &rds) 4918 return rds, err 4919 } 4920} 4921func unmarshalBasicRuleDataSourceArray(body []byte) ([]BasicRuleDataSource, error) { 4922 var rawMessages []*json.RawMessage 4923 err := json.Unmarshal(body, &rawMessages) 4924 if err != nil { 4925 return nil, err 4926 } 4927 4928 rdsArray := make([]BasicRuleDataSource, len(rawMessages)) 4929 4930 for index, rawMessage := range rawMessages { 4931 rds, err := unmarshalBasicRuleDataSource(*rawMessage) 4932 if err != nil { 4933 return nil, err 4934 } 4935 rdsArray[index] = rds 4936 } 4937 return rdsArray, nil 4938} 4939 4940// MarshalJSON is the custom marshaler for RuleDataSource. 4941func (rds RuleDataSource) MarshalJSON() ([]byte, error) { 4942 rds.OdataType = OdataTypeRuleDataSource 4943 objectMap := make(map[string]interface{}) 4944 if rds.ResourceURI != nil { 4945 objectMap["resourceUri"] = rds.ResourceURI 4946 } 4947 if rds.OdataType != "" { 4948 objectMap["odata.type"] = rds.OdataType 4949 } 4950 return json.Marshal(objectMap) 4951} 4952 4953// AsRuleMetricDataSource is the BasicRuleDataSource implementation for RuleDataSource. 4954func (rds RuleDataSource) AsRuleMetricDataSource() (*RuleMetricDataSource, bool) { 4955 return nil, false 4956} 4957 4958// AsRuleManagementEventDataSource is the BasicRuleDataSource implementation for RuleDataSource. 4959func (rds RuleDataSource) AsRuleManagementEventDataSource() (*RuleManagementEventDataSource, bool) { 4960 return nil, false 4961} 4962 4963// AsRuleDataSource is the BasicRuleDataSource implementation for RuleDataSource. 4964func (rds RuleDataSource) AsRuleDataSource() (*RuleDataSource, bool) { 4965 return &rds, true 4966} 4967 4968// AsBasicRuleDataSource is the BasicRuleDataSource implementation for RuleDataSource. 4969func (rds RuleDataSource) AsBasicRuleDataSource() (BasicRuleDataSource, bool) { 4970 return &rds, true 4971} 4972 4973// RuleEmailAction specifies the action to send email when the rule condition is evaluated. The 4974// discriminator is always RuleEmailAction in this case. 4975type RuleEmailAction struct { 4976 // SendToServiceOwners - Whether the administrators (service and co-administrators) of the service should be notified when the alert is activated. 4977 SendToServiceOwners *bool `json:"sendToServiceOwners,omitempty"` 4978 // CustomEmails - the list of administrator's custom email addresses to notify of the activation of the alert. 4979 CustomEmails *[]string `json:"customEmails,omitempty"` 4980 // OdataType - Possible values include: 'OdataTypeRuleAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction' 4981 OdataType OdataTypeBasicRuleAction `json:"odata.type,omitempty"` 4982} 4983 4984// MarshalJSON is the custom marshaler for RuleEmailAction. 4985func (rea RuleEmailAction) MarshalJSON() ([]byte, error) { 4986 rea.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction 4987 objectMap := make(map[string]interface{}) 4988 if rea.SendToServiceOwners != nil { 4989 objectMap["sendToServiceOwners"] = rea.SendToServiceOwners 4990 } 4991 if rea.CustomEmails != nil { 4992 objectMap["customEmails"] = rea.CustomEmails 4993 } 4994 if rea.OdataType != "" { 4995 objectMap["odata.type"] = rea.OdataType 4996 } 4997 return json.Marshal(objectMap) 4998} 4999 5000// AsRuleEmailAction is the BasicRuleAction implementation for RuleEmailAction. 5001func (rea RuleEmailAction) AsRuleEmailAction() (*RuleEmailAction, bool) { 5002 return &rea, true 5003} 5004 5005// AsRuleWebhookAction is the BasicRuleAction implementation for RuleEmailAction. 5006func (rea RuleEmailAction) AsRuleWebhookAction() (*RuleWebhookAction, bool) { 5007 return nil, false 5008} 5009 5010// AsRuleAction is the BasicRuleAction implementation for RuleEmailAction. 5011func (rea RuleEmailAction) AsRuleAction() (*RuleAction, bool) { 5012 return nil, false 5013} 5014 5015// AsBasicRuleAction is the BasicRuleAction implementation for RuleEmailAction. 5016func (rea RuleEmailAction) AsBasicRuleAction() (BasicRuleAction, bool) { 5017 return &rea, true 5018} 5019 5020// RuleManagementEventClaimsDataSource the claims for a rule management event data source. 5021type RuleManagementEventClaimsDataSource struct { 5022 // EmailAddress - the email address. 5023 EmailAddress *string `json:"emailAddress,omitempty"` 5024} 5025 5026// RuleManagementEventDataSource a rule management event data source. The discriminator fields is always 5027// RuleManagementEventDataSource in this case. 5028type RuleManagementEventDataSource struct { 5029 // EventName - the event name. 5030 EventName *string `json:"eventName,omitempty"` 5031 // EventSource - the event source. 5032 EventSource *string `json:"eventSource,omitempty"` 5033 // Level - the level. 5034 Level *string `json:"level,omitempty"` 5035 // OperationName - The name of the operation that should be checked for. If no name is provided, any operation will match. 5036 OperationName *string `json:"operationName,omitempty"` 5037 // ResourceGroupName - the resource group name. 5038 ResourceGroupName *string `json:"resourceGroupName,omitempty"` 5039 // ResourceProviderName - the resource provider name. 5040 ResourceProviderName *string `json:"resourceProviderName,omitempty"` 5041 // Status - The status of the operation that should be checked for. If no status is provided, any status will match. 5042 Status *string `json:"status,omitempty"` 5043 // SubStatus - the substatus. 5044 SubStatus *string `json:"subStatus,omitempty"` 5045 // Claims - the claims. 5046 Claims *RuleManagementEventClaimsDataSource `json:"claims,omitempty"` 5047 // ResourceURI - the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule. 5048 ResourceURI *string `json:"resourceUri,omitempty"` 5049 // OdataType - Possible values include: 'OdataTypeRuleDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource' 5050 OdataType OdataType `json:"odata.type,omitempty"` 5051} 5052 5053// MarshalJSON is the custom marshaler for RuleManagementEventDataSource. 5054func (rmeds RuleManagementEventDataSource) MarshalJSON() ([]byte, error) { 5055 rmeds.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource 5056 objectMap := make(map[string]interface{}) 5057 if rmeds.EventName != nil { 5058 objectMap["eventName"] = rmeds.EventName 5059 } 5060 if rmeds.EventSource != nil { 5061 objectMap["eventSource"] = rmeds.EventSource 5062 } 5063 if rmeds.Level != nil { 5064 objectMap["level"] = rmeds.Level 5065 } 5066 if rmeds.OperationName != nil { 5067 objectMap["operationName"] = rmeds.OperationName 5068 } 5069 if rmeds.ResourceGroupName != nil { 5070 objectMap["resourceGroupName"] = rmeds.ResourceGroupName 5071 } 5072 if rmeds.ResourceProviderName != nil { 5073 objectMap["resourceProviderName"] = rmeds.ResourceProviderName 5074 } 5075 if rmeds.Status != nil { 5076 objectMap["status"] = rmeds.Status 5077 } 5078 if rmeds.SubStatus != nil { 5079 objectMap["subStatus"] = rmeds.SubStatus 5080 } 5081 if rmeds.Claims != nil { 5082 objectMap["claims"] = rmeds.Claims 5083 } 5084 if rmeds.ResourceURI != nil { 5085 objectMap["resourceUri"] = rmeds.ResourceURI 5086 } 5087 if rmeds.OdataType != "" { 5088 objectMap["odata.type"] = rmeds.OdataType 5089 } 5090 return json.Marshal(objectMap) 5091} 5092 5093// AsRuleMetricDataSource is the BasicRuleDataSource implementation for RuleManagementEventDataSource. 5094func (rmeds RuleManagementEventDataSource) AsRuleMetricDataSource() (*RuleMetricDataSource, bool) { 5095 return nil, false 5096} 5097 5098// AsRuleManagementEventDataSource is the BasicRuleDataSource implementation for RuleManagementEventDataSource. 5099func (rmeds RuleManagementEventDataSource) AsRuleManagementEventDataSource() (*RuleManagementEventDataSource, bool) { 5100 return &rmeds, true 5101} 5102 5103// AsRuleDataSource is the BasicRuleDataSource implementation for RuleManagementEventDataSource. 5104func (rmeds RuleManagementEventDataSource) AsRuleDataSource() (*RuleDataSource, bool) { 5105 return nil, false 5106} 5107 5108// AsBasicRuleDataSource is the BasicRuleDataSource implementation for RuleManagementEventDataSource. 5109func (rmeds RuleManagementEventDataSource) AsBasicRuleDataSource() (BasicRuleDataSource, bool) { 5110 return &rmeds, true 5111} 5112 5113// RuleMetricDataSource a rule metric data source. The discriminator value is always RuleMetricDataSource 5114// in this case. 5115type RuleMetricDataSource struct { 5116 // MetricName - the name of the metric that defines what the rule monitors. 5117 MetricName *string `json:"metricName,omitempty"` 5118 // ResourceURI - the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule. 5119 ResourceURI *string `json:"resourceUri,omitempty"` 5120 // OdataType - Possible values include: 'OdataTypeRuleDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource' 5121 OdataType OdataType `json:"odata.type,omitempty"` 5122} 5123 5124// MarshalJSON is the custom marshaler for RuleMetricDataSource. 5125func (rmds RuleMetricDataSource) MarshalJSON() ([]byte, error) { 5126 rmds.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource 5127 objectMap := make(map[string]interface{}) 5128 if rmds.MetricName != nil { 5129 objectMap["metricName"] = rmds.MetricName 5130 } 5131 if rmds.ResourceURI != nil { 5132 objectMap["resourceUri"] = rmds.ResourceURI 5133 } 5134 if rmds.OdataType != "" { 5135 objectMap["odata.type"] = rmds.OdataType 5136 } 5137 return json.Marshal(objectMap) 5138} 5139 5140// AsRuleMetricDataSource is the BasicRuleDataSource implementation for RuleMetricDataSource. 5141func (rmds RuleMetricDataSource) AsRuleMetricDataSource() (*RuleMetricDataSource, bool) { 5142 return &rmds, true 5143} 5144 5145// AsRuleManagementEventDataSource is the BasicRuleDataSource implementation for RuleMetricDataSource. 5146func (rmds RuleMetricDataSource) AsRuleManagementEventDataSource() (*RuleManagementEventDataSource, bool) { 5147 return nil, false 5148} 5149 5150// AsRuleDataSource is the BasicRuleDataSource implementation for RuleMetricDataSource. 5151func (rmds RuleMetricDataSource) AsRuleDataSource() (*RuleDataSource, bool) { 5152 return nil, false 5153} 5154 5155// AsBasicRuleDataSource is the BasicRuleDataSource implementation for RuleMetricDataSource. 5156func (rmds RuleMetricDataSource) AsBasicRuleDataSource() (BasicRuleDataSource, bool) { 5157 return &rmds, true 5158} 5159 5160// RuleWebhookAction specifies the action to post to service when the rule condition is evaluated. The 5161// discriminator is always RuleWebhookAction in this case. 5162type RuleWebhookAction struct { 5163 // ServiceURI - the service uri to Post the notification when the alert activates or resolves. 5164 ServiceURI *string `json:"serviceUri,omitempty"` 5165 // Properties - the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. 5166 Properties map[string]*string `json:"properties"` 5167 // OdataType - Possible values include: 'OdataTypeRuleAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction' 5168 OdataType OdataTypeBasicRuleAction `json:"odata.type,omitempty"` 5169} 5170 5171// MarshalJSON is the custom marshaler for RuleWebhookAction. 5172func (rwa RuleWebhookAction) MarshalJSON() ([]byte, error) { 5173 rwa.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction 5174 objectMap := make(map[string]interface{}) 5175 if rwa.ServiceURI != nil { 5176 objectMap["serviceUri"] = rwa.ServiceURI 5177 } 5178 if rwa.Properties != nil { 5179 objectMap["properties"] = rwa.Properties 5180 } 5181 if rwa.OdataType != "" { 5182 objectMap["odata.type"] = rwa.OdataType 5183 } 5184 return json.Marshal(objectMap) 5185} 5186 5187// AsRuleEmailAction is the BasicRuleAction implementation for RuleWebhookAction. 5188func (rwa RuleWebhookAction) AsRuleEmailAction() (*RuleEmailAction, bool) { 5189 return nil, false 5190} 5191 5192// AsRuleWebhookAction is the BasicRuleAction implementation for RuleWebhookAction. 5193func (rwa RuleWebhookAction) AsRuleWebhookAction() (*RuleWebhookAction, bool) { 5194 return &rwa, true 5195} 5196 5197// AsRuleAction is the BasicRuleAction implementation for RuleWebhookAction. 5198func (rwa RuleWebhookAction) AsRuleAction() (*RuleAction, bool) { 5199 return nil, false 5200} 5201 5202// AsBasicRuleAction is the BasicRuleAction implementation for RuleWebhookAction. 5203func (rwa RuleWebhookAction) AsBasicRuleAction() (BasicRuleAction, bool) { 5204 return &rwa, true 5205} 5206 5207// ScaleAction the parameters for the scaling action. 5208type ScaleAction struct { 5209 // Direction - the scale direction. Whether the scaling action increases or decreases the number of instances. Possible values include: 'ScaleDirectionNone', 'ScaleDirectionIncrease', 'ScaleDirectionDecrease' 5210 Direction ScaleDirection `json:"direction,omitempty"` 5211 // Type - the type of action that should occur when the scale rule fires. Possible values include: 'ChangeCount', 'PercentChangeCount', 'ExactCount' 5212 Type ScaleType `json:"type,omitempty"` 5213 // Value - the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1. 5214 Value *string `json:"value,omitempty"` 5215 // Cooldown - the amount of time to wait since the last scaling action before this action occurs. It must be between 1 week and 1 minute in ISO 8601 format. 5216 Cooldown *string `json:"cooldown,omitempty"` 5217} 5218 5219// ScaleCapacity the number of instances that can be used during this profile. 5220type ScaleCapacity struct { 5221 // Minimum - the minimum number of instances for the resource. 5222 Minimum *string `json:"minimum,omitempty"` 5223 // Maximum - the maximum number of instances for the resource. The actual maximum number of instances is limited by the cores that are available in the subscription. 5224 Maximum *string `json:"maximum,omitempty"` 5225 // Default - the number of instances that will be set if metrics are not available for evaluation. The default is only used if the current instance count is lower than the default. 5226 Default *string `json:"default,omitempty"` 5227} 5228 5229// ScaleRule a rule that provide the triggers and parameters for the scaling action. 5230type ScaleRule struct { 5231 // MetricTrigger - the trigger that results in a scaling action. 5232 MetricTrigger *MetricTrigger `json:"metricTrigger,omitempty"` 5233 // ScaleAction - the parameters for the scaling action. 5234 ScaleAction *ScaleAction `json:"scaleAction,omitempty"` 5235} 5236 5237// Schedule defines how often to run the search and the time interval. 5238type Schedule struct { 5239 // FrequencyInMinutes - frequency (in minutes) at which rule condition should be evaluated. 5240 FrequencyInMinutes *int32 `json:"frequencyInMinutes,omitempty"` 5241 // TimeWindowInMinutes - Time window for which data needs to be fetched for query (should be greater than or equal to frequencyInMinutes). 5242 TimeWindowInMinutes *int32 `json:"timeWindowInMinutes,omitempty"` 5243} 5244 5245// SenderAuthorization the authorization used by the user who has performed the operation that led to this 5246// event. This captures the RBAC properties of the event. These usually include the 'action', 'role' and 5247// the 'scope' 5248type SenderAuthorization struct { 5249 // Action - the permissible actions. For instance: microsoft.support/supporttickets/write 5250 Action *string `json:"action,omitempty"` 5251 // Role - the role of the user. For instance: Subscription Admin 5252 Role *string `json:"role,omitempty"` 5253 // Scope - the scope. 5254 Scope *string `json:"scope,omitempty"` 5255} 5256 5257// SmsReceiver an SMS receiver. 5258type SmsReceiver struct { 5259 // Name - The name of the SMS receiver. Names must be unique across all receivers within an action group. 5260 Name *string `json:"name,omitempty"` 5261 // CountryCode - The country code of the SMS receiver. 5262 CountryCode *string `json:"countryCode,omitempty"` 5263 // PhoneNumber - The phone number of the SMS receiver. 5264 PhoneNumber *string `json:"phoneNumber,omitempty"` 5265 // Status - READ-ONLY; The status of the receiver. Possible values include: 'ReceiverStatusNotSpecified', 'ReceiverStatusEnabled', 'ReceiverStatusDisabled' 5266 Status ReceiverStatus `json:"status,omitempty"` 5267} 5268 5269// Source specifies the log search query. 5270type Source struct { 5271 // Query - Log search query. Required for action type - AlertingAction 5272 Query *string `json:"query,omitempty"` 5273 // AuthorizedResources - List of Resource referred into query 5274 AuthorizedResources *[]string `json:"authorizedResources,omitempty"` 5275 // DataSourceID - The resource uri over which log search query is to be run. 5276 DataSourceID *string `json:"dataSourceId,omitempty"` 5277 // QueryType - Set value to 'ResultCount'. Possible values include: 'ResultCount' 5278 QueryType QueryType `json:"queryType,omitempty"` 5279} 5280 5281// ThresholdRuleCondition a rule condition based on a metric crossing a threshold. 5282type ThresholdRuleCondition struct { 5283 // Operator - the operator used to compare the data and the threshold. Possible values include: 'ConditionOperatorGreaterThan', 'ConditionOperatorGreaterThanOrEqual', 'ConditionOperatorLessThan', 'ConditionOperatorLessThanOrEqual' 5284 Operator ConditionOperator `json:"operator,omitempty"` 5285 // Threshold - the threshold value that activates the alert. 5286 Threshold *float64 `json:"threshold,omitempty"` 5287 // WindowSize - the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. If specified then it must be between 5 minutes and 1 day. 5288 WindowSize *string `json:"windowSize,omitempty"` 5289 // TimeAggregation - the time aggregation operator. How the data that are collected should be combined over time. The default value is the PrimaryAggregationType of the Metric. Possible values include: 'TimeAggregationOperatorAverage', 'TimeAggregationOperatorMinimum', 'TimeAggregationOperatorMaximum', 'TimeAggregationOperatorTotal', 'TimeAggregationOperatorLast' 5290 TimeAggregation TimeAggregationOperator `json:"timeAggregation,omitempty"` 5291 // DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource. 5292 DataSource BasicRuleDataSource `json:"dataSource,omitempty"` 5293 // OdataType - Possible values include: 'OdataTypeRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition' 5294 OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"` 5295} 5296 5297// MarshalJSON is the custom marshaler for ThresholdRuleCondition. 5298func (trc ThresholdRuleCondition) MarshalJSON() ([]byte, error) { 5299 trc.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition 5300 objectMap := make(map[string]interface{}) 5301 if trc.Operator != "" { 5302 objectMap["operator"] = trc.Operator 5303 } 5304 if trc.Threshold != nil { 5305 objectMap["threshold"] = trc.Threshold 5306 } 5307 if trc.WindowSize != nil { 5308 objectMap["windowSize"] = trc.WindowSize 5309 } 5310 if trc.TimeAggregation != "" { 5311 objectMap["timeAggregation"] = trc.TimeAggregation 5312 } 5313 objectMap["dataSource"] = trc.DataSource 5314 if trc.OdataType != "" { 5315 objectMap["odata.type"] = trc.OdataType 5316 } 5317 return json.Marshal(objectMap) 5318} 5319 5320// AsThresholdRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition. 5321func (trc ThresholdRuleCondition) AsThresholdRuleCondition() (*ThresholdRuleCondition, bool) { 5322 return &trc, true 5323} 5324 5325// AsLocationThresholdRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition. 5326func (trc ThresholdRuleCondition) AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool) { 5327 return nil, false 5328} 5329 5330// AsManagementEventRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition. 5331func (trc ThresholdRuleCondition) AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool) { 5332 return nil, false 5333} 5334 5335// AsRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition. 5336func (trc ThresholdRuleCondition) AsRuleCondition() (*RuleCondition, bool) { 5337 return nil, false 5338} 5339 5340// AsBasicRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition. 5341func (trc ThresholdRuleCondition) AsBasicRuleCondition() (BasicRuleCondition, bool) { 5342 return &trc, true 5343} 5344 5345// UnmarshalJSON is the custom unmarshaler for ThresholdRuleCondition struct. 5346func (trc *ThresholdRuleCondition) UnmarshalJSON(body []byte) error { 5347 var m map[string]*json.RawMessage 5348 err := json.Unmarshal(body, &m) 5349 if err != nil { 5350 return err 5351 } 5352 for k, v := range m { 5353 switch k { 5354 case "operator": 5355 if v != nil { 5356 var operator ConditionOperator 5357 err = json.Unmarshal(*v, &operator) 5358 if err != nil { 5359 return err 5360 } 5361 trc.Operator = operator 5362 } 5363 case "threshold": 5364 if v != nil { 5365 var threshold float64 5366 err = json.Unmarshal(*v, &threshold) 5367 if err != nil { 5368 return err 5369 } 5370 trc.Threshold = &threshold 5371 } 5372 case "windowSize": 5373 if v != nil { 5374 var windowSize string 5375 err = json.Unmarshal(*v, &windowSize) 5376 if err != nil { 5377 return err 5378 } 5379 trc.WindowSize = &windowSize 5380 } 5381 case "timeAggregation": 5382 if v != nil { 5383 var timeAggregation TimeAggregationOperator 5384 err = json.Unmarshal(*v, &timeAggregation) 5385 if err != nil { 5386 return err 5387 } 5388 trc.TimeAggregation = timeAggregation 5389 } 5390 case "dataSource": 5391 if v != nil { 5392 dataSource, err := unmarshalBasicRuleDataSource(*v) 5393 if err != nil { 5394 return err 5395 } 5396 trc.DataSource = dataSource 5397 } 5398 case "odata.type": 5399 if v != nil { 5400 var odataType OdataTypeBasicRuleCondition 5401 err = json.Unmarshal(*v, &odataType) 5402 if err != nil { 5403 return err 5404 } 5405 trc.OdataType = odataType 5406 } 5407 } 5408 } 5409 5410 return nil 5411} 5412 5413// TimeSeriesElement a time series result type. The discriminator value is always TimeSeries in this case. 5414type TimeSeriesElement struct { 5415 // Metadatavalues - the metadata values returned if $filter was specified in the call. 5416 Metadatavalues *[]MetadataValue `json:"metadatavalues,omitempty"` 5417 // Data - An array of data points representing the metric values. This is only returned if a result type of data is specified. 5418 Data *[]MetricValue `json:"data,omitempty"` 5419} 5420 5421// TimeSeriesInformation the time series info needed for calculating the baseline. 5422type TimeSeriesInformation struct { 5423 // Sensitivities - the list of sensitivities for calculating the baseline. 5424 Sensitivities *[]string `json:"sensitivities,omitempty"` 5425 // Values - The metric values to calculate the baseline. 5426 Values *[]float64 `json:"values,omitempty"` 5427 // Timestamps - the array of timestamps of the baselines. 5428 Timestamps *[]date.Time `json:"timestamps,omitempty"` 5429} 5430 5431// TimeWindow a specific date-time for the profile. 5432type TimeWindow struct { 5433 // TimeZone - the timezone of the start and end times for the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time 5434 TimeZone *string `json:"timeZone,omitempty"` 5435 // Start - the start time for the profile in ISO 8601 format. 5436 Start *date.Time `json:"start,omitempty"` 5437 // End - the end time for the profile in ISO 8601 format. 5438 End *date.Time `json:"end,omitempty"` 5439} 5440 5441// TriggerCondition the condition that results in the Log Search rule. 5442type TriggerCondition struct { 5443 // ThresholdOperator - Evaluation operation for rule - 'GreaterThan' or 'LessThan. Possible values include: 'ConditionalOperatorGreaterThan', 'ConditionalOperatorLessThan', 'ConditionalOperatorEqual' 5444 ThresholdOperator ConditionalOperator `json:"thresholdOperator,omitempty"` 5445 // Threshold - Result or count threshold based on which rule should be triggered. 5446 Threshold *float64 `json:"threshold,omitempty"` 5447 // MetricTrigger - Trigger condition for metric query rule 5448 MetricTrigger *LogMetricTrigger `json:"metricTrigger,omitempty"` 5449} 5450 5451// VMInsightsOnboardingStatus VM Insights onboarding status for a resource. 5452type VMInsightsOnboardingStatus struct { 5453 autorest.Response `json:"-"` 5454 // VMInsightsOnboardingStatusProperties - Resource properties. 5455 *VMInsightsOnboardingStatusProperties `json:"properties,omitempty"` 5456 // ID - READ-ONLY; Azure resource Id 5457 ID *string `json:"id,omitempty"` 5458 // Name - READ-ONLY; Azure resource name 5459 Name *string `json:"name,omitempty"` 5460 // Type - READ-ONLY; Azure resource type 5461 Type *string `json:"type,omitempty"` 5462} 5463 5464// MarshalJSON is the custom marshaler for VMInsightsOnboardingStatus. 5465func (vios VMInsightsOnboardingStatus) MarshalJSON() ([]byte, error) { 5466 objectMap := make(map[string]interface{}) 5467 if vios.VMInsightsOnboardingStatusProperties != nil { 5468 objectMap["properties"] = vios.VMInsightsOnboardingStatusProperties 5469 } 5470 return json.Marshal(objectMap) 5471} 5472 5473// UnmarshalJSON is the custom unmarshaler for VMInsightsOnboardingStatus struct. 5474func (vios *VMInsightsOnboardingStatus) UnmarshalJSON(body []byte) error { 5475 var m map[string]*json.RawMessage 5476 err := json.Unmarshal(body, &m) 5477 if err != nil { 5478 return err 5479 } 5480 for k, v := range m { 5481 switch k { 5482 case "properties": 5483 if v != nil { 5484 var VMInsightsOnboardingStatusProperties VMInsightsOnboardingStatusProperties 5485 err = json.Unmarshal(*v, &VMInsightsOnboardingStatusProperties) 5486 if err != nil { 5487 return err 5488 } 5489 vios.VMInsightsOnboardingStatusProperties = &VMInsightsOnboardingStatusProperties 5490 } 5491 case "id": 5492 if v != nil { 5493 var ID string 5494 err = json.Unmarshal(*v, &ID) 5495 if err != nil { 5496 return err 5497 } 5498 vios.ID = &ID 5499 } 5500 case "name": 5501 if v != nil { 5502 var name string 5503 err = json.Unmarshal(*v, &name) 5504 if err != nil { 5505 return err 5506 } 5507 vios.Name = &name 5508 } 5509 case "type": 5510 if v != nil { 5511 var typeVar string 5512 err = json.Unmarshal(*v, &typeVar) 5513 if err != nil { 5514 return err 5515 } 5516 vios.Type = &typeVar 5517 } 5518 } 5519 } 5520 5521 return nil 5522} 5523 5524// VMInsightsOnboardingStatusProperties resource properties. 5525type VMInsightsOnboardingStatusProperties struct { 5526 // ResourceID - Azure Resource Manager identifier of the resource whose onboarding status is being represented. 5527 ResourceID *string `json:"resourceId,omitempty"` 5528 // OnboardingStatus - The onboarding status for the resource. Note that, a higher level scope, e.g., resource group or subscription, is considered onboarded if at least one resource under it is onboarded. Possible values include: 'Onboarded', 'NotOnboarded', 'Unknown' 5529 OnboardingStatus OnboardingStatus `json:"onboardingStatus,omitempty"` 5530 // DataStatus - The status of VM Insights data from the resource. When reported as `present` the data array will contain information about the data containers to which data for the specified resource is being routed. Possible values include: 'Present', 'NotPresent' 5531 DataStatus DataStatus `json:"dataStatus,omitempty"` 5532 // Data - Containers that currently store VM Insights data for the specified resource. 5533 Data *[]DataContainer `json:"data,omitempty"` 5534} 5535 5536// VoiceReceiver a voice receiver. 5537type VoiceReceiver struct { 5538 // Name - The name of the voice receiver. Names must be unique across all receivers within an action group. 5539 Name *string `json:"name,omitempty"` 5540 // CountryCode - The country code of the voice receiver. 5541 CountryCode *string `json:"countryCode,omitempty"` 5542 // PhoneNumber - The phone number of the voice receiver. 5543 PhoneNumber *string `json:"phoneNumber,omitempty"` 5544} 5545 5546// WebhookNotification webhook notification of an autoscale event. 5547type WebhookNotification struct { 5548 // ServiceURI - the service address to receive the notification. 5549 ServiceURI *string `json:"serviceUri,omitempty"` 5550 // Properties - a property bag of settings. This value can be empty. 5551 Properties map[string]*string `json:"properties"` 5552} 5553 5554// MarshalJSON is the custom marshaler for WebhookNotification. 5555func (wn WebhookNotification) MarshalJSON() ([]byte, error) { 5556 objectMap := make(map[string]interface{}) 5557 if wn.ServiceURI != nil { 5558 objectMap["serviceUri"] = wn.ServiceURI 5559 } 5560 if wn.Properties != nil { 5561 objectMap["properties"] = wn.Properties 5562 } 5563 return json.Marshal(objectMap) 5564} 5565 5566// WebhookReceiver a webhook receiver. 5567type WebhookReceiver struct { 5568 // Name - The name of the webhook receiver. Names must be unique across all receivers within an action group. 5569 Name *string `json:"name,omitempty"` 5570 // ServiceURI - The URI where webhooks should be sent. 5571 ServiceURI *string `json:"serviceUri,omitempty"` 5572} 5573 5574// WorkspaceInfo information about a Log Analytics Workspace. 5575type WorkspaceInfo struct { 5576 // ID - Azure Resource Manager identifier of the Log Analytics Workspace. 5577 ID *string `json:"id,omitempty"` 5578 // Location - Location of the Log Analytics workspace. 5579 Location *string `json:"location,omitempty"` 5580 // WorkspaceInfoProperties - Resource properties. 5581 *WorkspaceInfoProperties `json:"properties,omitempty"` 5582} 5583 5584// MarshalJSON is the custom marshaler for WorkspaceInfo. 5585func (wi WorkspaceInfo) MarshalJSON() ([]byte, error) { 5586 objectMap := make(map[string]interface{}) 5587 if wi.ID != nil { 5588 objectMap["id"] = wi.ID 5589 } 5590 if wi.Location != nil { 5591 objectMap["location"] = wi.Location 5592 } 5593 if wi.WorkspaceInfoProperties != nil { 5594 objectMap["properties"] = wi.WorkspaceInfoProperties 5595 } 5596 return json.Marshal(objectMap) 5597} 5598 5599// UnmarshalJSON is the custom unmarshaler for WorkspaceInfo struct. 5600func (wi *WorkspaceInfo) UnmarshalJSON(body []byte) error { 5601 var m map[string]*json.RawMessage 5602 err := json.Unmarshal(body, &m) 5603 if err != nil { 5604 return err 5605 } 5606 for k, v := range m { 5607 switch k { 5608 case "id": 5609 if v != nil { 5610 var ID string 5611 err = json.Unmarshal(*v, &ID) 5612 if err != nil { 5613 return err 5614 } 5615 wi.ID = &ID 5616 } 5617 case "location": 5618 if v != nil { 5619 var location string 5620 err = json.Unmarshal(*v, &location) 5621 if err != nil { 5622 return err 5623 } 5624 wi.Location = &location 5625 } 5626 case "properties": 5627 if v != nil { 5628 var workspaceInfoProperties WorkspaceInfoProperties 5629 err = json.Unmarshal(*v, &workspaceInfoProperties) 5630 if err != nil { 5631 return err 5632 } 5633 wi.WorkspaceInfoProperties = &workspaceInfoProperties 5634 } 5635 } 5636 } 5637 5638 return nil 5639} 5640 5641// WorkspaceInfoProperties resource properties. 5642type WorkspaceInfoProperties struct { 5643 // CustomerID - Log Analytics workspace identifier. 5644 CustomerID *string `json:"customerId,omitempty"` 5645} 5646