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 "encoding/json" 22 "github.com/Azure/go-autorest/autorest" 23 "github.com/Azure/go-autorest/autorest/date" 24 "github.com/Azure/go-autorest/autorest/to" 25 "net/http" 26) 27 28// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 29// CategoryType enumerates the values for category type. 30type CategoryType string 31 32const ( 33 // Logs ... 34 Logs CategoryType = "Logs" 35 // Metrics ... 36 Metrics CategoryType = "Metrics" 37) 38 39// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 40// PossibleCategoryTypeValues returns an array of possible values for the CategoryType const type. 41func PossibleCategoryTypeValues() []CategoryType { 42 return []CategoryType{Logs, Metrics} 43} 44 45// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 46// ComparisonOperationType enumerates the values for comparison operation type. 47type ComparisonOperationType string 48 49const ( 50 // Equals ... 51 Equals ComparisonOperationType = "Equals" 52 // GreaterThan ... 53 GreaterThan ComparisonOperationType = "GreaterThan" 54 // GreaterThanOrEqual ... 55 GreaterThanOrEqual ComparisonOperationType = "GreaterThanOrEqual" 56 // LessThan ... 57 LessThan ComparisonOperationType = "LessThan" 58 // LessThanOrEqual ... 59 LessThanOrEqual ComparisonOperationType = "LessThanOrEqual" 60 // NotEquals ... 61 NotEquals ComparisonOperationType = "NotEquals" 62) 63 64// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 65// PossibleComparisonOperationTypeValues returns an array of possible values for the ComparisonOperationType const type. 66func PossibleComparisonOperationTypeValues() []ComparisonOperationType { 67 return []ComparisonOperationType{Equals, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual, NotEquals} 68} 69 70// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 71// ConditionOperator enumerates the values for condition operator. 72type ConditionOperator string 73 74const ( 75 // ConditionOperatorGreaterThan ... 76 ConditionOperatorGreaterThan ConditionOperator = "GreaterThan" 77 // ConditionOperatorGreaterThanOrEqual ... 78 ConditionOperatorGreaterThanOrEqual ConditionOperator = "GreaterThanOrEqual" 79 // ConditionOperatorLessThan ... 80 ConditionOperatorLessThan ConditionOperator = "LessThan" 81 // ConditionOperatorLessThanOrEqual ... 82 ConditionOperatorLessThanOrEqual ConditionOperator = "LessThanOrEqual" 83) 84 85// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 86// PossibleConditionOperatorValues returns an array of possible values for the ConditionOperator const type. 87func PossibleConditionOperatorValues() []ConditionOperator { 88 return []ConditionOperator{ConditionOperatorGreaterThan, ConditionOperatorGreaterThanOrEqual, ConditionOperatorLessThan, ConditionOperatorLessThanOrEqual} 89} 90 91// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 92// MetricStatisticType enumerates the values for metric statistic type. 93type MetricStatisticType string 94 95const ( 96 // Average ... 97 Average MetricStatisticType = "Average" 98 // Max ... 99 Max MetricStatisticType = "Max" 100 // Min ... 101 Min MetricStatisticType = "Min" 102 // Sum ... 103 Sum MetricStatisticType = "Sum" 104) 105 106// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 107// PossibleMetricStatisticTypeValues returns an array of possible values for the MetricStatisticType const type. 108func PossibleMetricStatisticTypeValues() []MetricStatisticType { 109 return []MetricStatisticType{Average, Max, Min, Sum} 110} 111 112// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 113// OdataType enumerates the values for odata type. 114type OdataType string 115 116const ( 117 // OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource ... 118 OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource OdataType = "Microsoft.Azure.Management.Insights.Models.RuleManagementEventDataSource" 119 // OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource ... 120 OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource OdataType = "Microsoft.Azure.Management.Insights.Models.RuleMetricDataSource" 121 // OdataTypeRuleDataSource ... 122 OdataTypeRuleDataSource OdataType = "RuleDataSource" 123) 124 125// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 126// PossibleOdataTypeValues returns an array of possible values for the OdataType const type. 127func PossibleOdataTypeValues() []OdataType { 128 return []OdataType{OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource, OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource, OdataTypeRuleDataSource} 129} 130 131// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 132// OdataTypeBasicRuleAction enumerates the values for odata type basic rule action. 133type OdataTypeBasicRuleAction string 134 135const ( 136 // OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction ... 137 OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction OdataTypeBasicRuleAction = "Microsoft.Azure.Management.Insights.Models.RuleEmailAction" 138 // OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction ... 139 OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction OdataTypeBasicRuleAction = "Microsoft.Azure.Management.Insights.Models.RuleWebhookAction" 140 // OdataTypeRuleAction ... 141 OdataTypeRuleAction OdataTypeBasicRuleAction = "RuleAction" 142) 143 144// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 145// PossibleOdataTypeBasicRuleActionValues returns an array of possible values for the OdataTypeBasicRuleAction const type. 146func PossibleOdataTypeBasicRuleActionValues() []OdataTypeBasicRuleAction { 147 return []OdataTypeBasicRuleAction{OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction, OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction, OdataTypeRuleAction} 148} 149 150// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 151// OdataTypeBasicRuleCondition enumerates the values for odata type basic rule condition. 152type OdataTypeBasicRuleCondition string 153 154const ( 155 // OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition ... 156 OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition OdataTypeBasicRuleCondition = "Microsoft.Azure.Management.Insights.Models.LocationThresholdRuleCondition" 157 // OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition ... 158 OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition OdataTypeBasicRuleCondition = "Microsoft.Azure.Management.Insights.Models.ManagementEventRuleCondition" 159 // OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition ... 160 OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition OdataTypeBasicRuleCondition = "Microsoft.Azure.Management.Insights.Models.ThresholdRuleCondition" 161 // OdataTypeRuleCondition ... 162 OdataTypeRuleCondition OdataTypeBasicRuleCondition = "RuleCondition" 163) 164 165// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 166// PossibleOdataTypeBasicRuleConditionValues returns an array of possible values for the OdataTypeBasicRuleCondition const type. 167func PossibleOdataTypeBasicRuleConditionValues() []OdataTypeBasicRuleCondition { 168 return []OdataTypeBasicRuleCondition{OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition, OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition, OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition, OdataTypeRuleCondition} 169} 170 171// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 172// ReceiverStatus enumerates the values for receiver status. 173type ReceiverStatus string 174 175const ( 176 // Disabled ... 177 Disabled ReceiverStatus = "Disabled" 178 // Enabled ... 179 Enabled ReceiverStatus = "Enabled" 180 // NotSpecified ... 181 NotSpecified ReceiverStatus = "NotSpecified" 182) 183 184// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 185// PossibleReceiverStatusValues returns an array of possible values for the ReceiverStatus const type. 186func PossibleReceiverStatusValues() []ReceiverStatus { 187 return []ReceiverStatus{Disabled, Enabled, NotSpecified} 188} 189 190// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 191// RecurrenceFrequency enumerates the values for recurrence frequency. 192type RecurrenceFrequency string 193 194const ( 195 // Day ... 196 Day RecurrenceFrequency = "Day" 197 // Hour ... 198 Hour RecurrenceFrequency = "Hour" 199 // Minute ... 200 Minute RecurrenceFrequency = "Minute" 201 // Month ... 202 Month RecurrenceFrequency = "Month" 203 // None ... 204 None RecurrenceFrequency = "None" 205 // Second ... 206 Second RecurrenceFrequency = "Second" 207 // Week ... 208 Week RecurrenceFrequency = "Week" 209 // Year ... 210 Year RecurrenceFrequency = "Year" 211) 212 213// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 214// PossibleRecurrenceFrequencyValues returns an array of possible values for the RecurrenceFrequency const type. 215func PossibleRecurrenceFrequencyValues() []RecurrenceFrequency { 216 return []RecurrenceFrequency{Day, Hour, Minute, Month, None, Second, Week, Year} 217} 218 219// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 220// ScaleDirection enumerates the values for scale direction. 221type ScaleDirection string 222 223const ( 224 // ScaleDirectionDecrease ... 225 ScaleDirectionDecrease ScaleDirection = "Decrease" 226 // ScaleDirectionIncrease ... 227 ScaleDirectionIncrease ScaleDirection = "Increase" 228 // ScaleDirectionNone ... 229 ScaleDirectionNone ScaleDirection = "None" 230) 231 232// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 233// PossibleScaleDirectionValues returns an array of possible values for the ScaleDirection const type. 234func PossibleScaleDirectionValues() []ScaleDirection { 235 return []ScaleDirection{ScaleDirectionDecrease, ScaleDirectionIncrease, ScaleDirectionNone} 236} 237 238// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 239// ScaleType enumerates the values for scale type. 240type ScaleType string 241 242const ( 243 // ChangeCount ... 244 ChangeCount ScaleType = "ChangeCount" 245 // ExactCount ... 246 ExactCount ScaleType = "ExactCount" 247 // PercentChangeCount ... 248 PercentChangeCount ScaleType = "PercentChangeCount" 249) 250 251// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 252// PossibleScaleTypeValues returns an array of possible values for the ScaleType const type. 253func PossibleScaleTypeValues() []ScaleType { 254 return []ScaleType{ChangeCount, ExactCount, PercentChangeCount} 255} 256 257// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 258// TimeAggregationOperator enumerates the values for time aggregation operator. 259type TimeAggregationOperator string 260 261const ( 262 // TimeAggregationOperatorAverage ... 263 TimeAggregationOperatorAverage TimeAggregationOperator = "Average" 264 // TimeAggregationOperatorLast ... 265 TimeAggregationOperatorLast TimeAggregationOperator = "Last" 266 // TimeAggregationOperatorMaximum ... 267 TimeAggregationOperatorMaximum TimeAggregationOperator = "Maximum" 268 // TimeAggregationOperatorMinimum ... 269 TimeAggregationOperatorMinimum TimeAggregationOperator = "Minimum" 270 // TimeAggregationOperatorTotal ... 271 TimeAggregationOperatorTotal TimeAggregationOperator = "Total" 272) 273 274// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 275// PossibleTimeAggregationOperatorValues returns an array of possible values for the TimeAggregationOperator const type. 276func PossibleTimeAggregationOperatorValues() []TimeAggregationOperator { 277 return []TimeAggregationOperator{TimeAggregationOperatorAverage, TimeAggregationOperatorLast, TimeAggregationOperatorMaximum, TimeAggregationOperatorMinimum, TimeAggregationOperatorTotal} 278} 279 280// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 281// TimeAggregationType enumerates the values for time aggregation type. 282type TimeAggregationType string 283 284const ( 285 // TimeAggregationTypeAverage ... 286 TimeAggregationTypeAverage TimeAggregationType = "Average" 287 // TimeAggregationTypeCount ... 288 TimeAggregationTypeCount TimeAggregationType = "Count" 289 // TimeAggregationTypeMaximum ... 290 TimeAggregationTypeMaximum TimeAggregationType = "Maximum" 291 // TimeAggregationTypeMinimum ... 292 TimeAggregationTypeMinimum TimeAggregationType = "Minimum" 293 // TimeAggregationTypeTotal ... 294 TimeAggregationTypeTotal TimeAggregationType = "Total" 295) 296 297// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 298// PossibleTimeAggregationTypeValues returns an array of possible values for the TimeAggregationType const type. 299func PossibleTimeAggregationTypeValues() []TimeAggregationType { 300 return []TimeAggregationType{TimeAggregationTypeAverage, TimeAggregationTypeCount, TimeAggregationTypeMaximum, TimeAggregationTypeMinimum, TimeAggregationTypeTotal} 301} 302 303// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 304// ActionGroup an Azure action group. 305type ActionGroup struct { 306 // GroupShortName - The short name of the action group. This will be used in SMS messages. 307 GroupShortName *string `json:"groupShortName,omitempty"` 308 // Enabled - Indicates whether this action group is enabled. If an action group is not enabled, then none of its receivers will receive communications. 309 Enabled *bool `json:"enabled,omitempty"` 310 // EmailReceivers - The list of email receivers that are part of this action group. 311 EmailReceivers *[]EmailReceiver `json:"emailReceivers,omitempty"` 312 // SmsReceivers - The list of SMS receivers that are part of this action group. 313 SmsReceivers *[]SmsReceiver `json:"smsReceivers,omitempty"` 314 // WebhookReceivers - The list of webhook receivers that are part of this action group. 315 WebhookReceivers *[]WebhookReceiver `json:"webhookReceivers,omitempty"` 316 // ItsmReceivers - The list of ITSM receivers that are part of this action group. 317 ItsmReceivers *[]ItsmReceiver `json:"itsmReceivers,omitempty"` 318 // AzureAppPushReceivers - The list of AzureAppPush receivers that are part of this action group. 319 AzureAppPushReceivers *[]AzureAppPushReceiver `json:"azureAppPushReceivers,omitempty"` 320 // AutomationRunbookReceivers - The list of AutomationRunbook receivers that are part of this action group. 321 AutomationRunbookReceivers *[]AutomationRunbookReceiver `json:"automationRunbookReceivers,omitempty"` 322} 323 324// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 325// ActionGroupList a list of action groups. 326type ActionGroupList struct { 327 autorest.Response `json:"-"` 328 // Value - The list of action groups. 329 Value *[]ActionGroupResource `json:"value,omitempty"` 330 // NextLink - Provides the link to retrieve the next set of elements. 331 NextLink *string `json:"nextLink,omitempty"` 332} 333 334// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 335// ActionGroupPatch an Azure action group for patch operations. 336type ActionGroupPatch struct { 337 // Enabled - Indicates whether this action group is enabled. If an action group is not enabled, then none of its actions will be activated. 338 Enabled *bool `json:"enabled,omitempty"` 339} 340 341// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 342// ActionGroupPatchBody an action group object for the body of patch operations. 343type ActionGroupPatchBody struct { 344 // Tags - Resource tags 345 Tags map[string]*string `json:"tags"` 346 // ActionGroupPatch - The action group settings for an update operation. 347 *ActionGroupPatch `json:"properties,omitempty"` 348} 349 350// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 351// MarshalJSON is the custom marshaler for ActionGroupPatchBody. 352func (agpb ActionGroupPatchBody) MarshalJSON() ([]byte, error) { 353 objectMap := make(map[string]interface{}) 354 if agpb.Tags != nil { 355 objectMap["tags"] = agpb.Tags 356 } 357 if agpb.ActionGroupPatch != nil { 358 objectMap["properties"] = agpb.ActionGroupPatch 359 } 360 return json.Marshal(objectMap) 361} 362 363// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 364// UnmarshalJSON is the custom unmarshaler for ActionGroupPatchBody struct. 365func (agpb *ActionGroupPatchBody) UnmarshalJSON(body []byte) error { 366 var m map[string]*json.RawMessage 367 err := json.Unmarshal(body, &m) 368 if err != nil { 369 return err 370 } 371 for k, v := range m { 372 switch k { 373 case "tags": 374 if v != nil { 375 var tags map[string]*string 376 err = json.Unmarshal(*v, &tags) 377 if err != nil { 378 return err 379 } 380 agpb.Tags = tags 381 } 382 case "properties": 383 if v != nil { 384 var actionGroupPatch ActionGroupPatch 385 err = json.Unmarshal(*v, &actionGroupPatch) 386 if err != nil { 387 return err 388 } 389 agpb.ActionGroupPatch = &actionGroupPatch 390 } 391 } 392 } 393 394 return nil 395} 396 397// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 398// ActionGroupResource an action group resource. 399type ActionGroupResource struct { 400 autorest.Response `json:"-"` 401 // ActionGroup - The action groups properties of the resource. 402 *ActionGroup `json:"properties,omitempty"` 403 // ID - Azure resource Id 404 ID *string `json:"id,omitempty"` 405 // Name - Azure resource name 406 Name *string `json:"name,omitempty"` 407 // Type - Azure resource type 408 Type *string `json:"type,omitempty"` 409 // Location - Resource location 410 Location *string `json:"location,omitempty"` 411 // Tags - Resource tags 412 Tags map[string]*string `json:"tags"` 413} 414 415// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 416// MarshalJSON is the custom marshaler for ActionGroupResource. 417func (agr ActionGroupResource) MarshalJSON() ([]byte, error) { 418 objectMap := make(map[string]interface{}) 419 if agr.ActionGroup != nil { 420 objectMap["properties"] = agr.ActionGroup 421 } 422 if agr.ID != nil { 423 objectMap["id"] = agr.ID 424 } 425 if agr.Name != nil { 426 objectMap["name"] = agr.Name 427 } 428 if agr.Type != nil { 429 objectMap["type"] = agr.Type 430 } 431 if agr.Location != nil { 432 objectMap["location"] = agr.Location 433 } 434 if agr.Tags != nil { 435 objectMap["tags"] = agr.Tags 436 } 437 return json.Marshal(objectMap) 438} 439 440// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 441// UnmarshalJSON is the custom unmarshaler for ActionGroupResource struct. 442func (agr *ActionGroupResource) UnmarshalJSON(body []byte) error { 443 var m map[string]*json.RawMessage 444 err := json.Unmarshal(body, &m) 445 if err != nil { 446 return err 447 } 448 for k, v := range m { 449 switch k { 450 case "properties": 451 if v != nil { 452 var actionGroup ActionGroup 453 err = json.Unmarshal(*v, &actionGroup) 454 if err != nil { 455 return err 456 } 457 agr.ActionGroup = &actionGroup 458 } 459 case "id": 460 if v != nil { 461 var ID string 462 err = json.Unmarshal(*v, &ID) 463 if err != nil { 464 return err 465 } 466 agr.ID = &ID 467 } 468 case "name": 469 if v != nil { 470 var name string 471 err = json.Unmarshal(*v, &name) 472 if err != nil { 473 return err 474 } 475 agr.Name = &name 476 } 477 case "type": 478 if v != nil { 479 var typeVar string 480 err = json.Unmarshal(*v, &typeVar) 481 if err != nil { 482 return err 483 } 484 agr.Type = &typeVar 485 } 486 case "location": 487 if v != nil { 488 var location string 489 err = json.Unmarshal(*v, &location) 490 if err != nil { 491 return err 492 } 493 agr.Location = &location 494 } 495 case "tags": 496 if v != nil { 497 var tags map[string]*string 498 err = json.Unmarshal(*v, &tags) 499 if err != nil { 500 return err 501 } 502 agr.Tags = tags 503 } 504 } 505 } 506 507 return nil 508} 509 510// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 511// ActivityLogAlert an Azure activity log alert. 512type ActivityLogAlert struct { 513 // 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. 514 Scopes *[]string `json:"scopes,omitempty"` 515 // 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. 516 Enabled *bool `json:"enabled,omitempty"` 517 // Condition - The condition that will cause this alert to activate. 518 Condition *ActivityLogAlertAllOfCondition `json:"condition,omitempty"` 519 // Actions - The actions that will activate when the condition is met. 520 Actions *ActivityLogAlertActionList `json:"actions,omitempty"` 521 // Description - A description of this activity log alert. 522 Description *string `json:"description,omitempty"` 523} 524 525// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 526// ActivityLogAlertActionGroup a pointer to an Azure Action Group. 527type ActivityLogAlertActionGroup struct { 528 // ActionGroupID - The resourceId of the action group. This cannot be null or empty. 529 ActionGroupID *string `json:"actionGroupId,omitempty"` 530 // WebhookProperties - the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. 531 WebhookProperties map[string]*string `json:"webhookProperties"` 532} 533 534// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 535// MarshalJSON is the custom marshaler for ActivityLogAlertActionGroup. 536func (alaag ActivityLogAlertActionGroup) MarshalJSON() ([]byte, error) { 537 objectMap := make(map[string]interface{}) 538 if alaag.ActionGroupID != nil { 539 objectMap["actionGroupId"] = alaag.ActionGroupID 540 } 541 if alaag.WebhookProperties != nil { 542 objectMap["webhookProperties"] = alaag.WebhookProperties 543 } 544 return json.Marshal(objectMap) 545} 546 547// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 548// ActivityLogAlertActionList a list of activity log alert actions. 549type ActivityLogAlertActionList struct { 550 // ActionGroups - The list of activity log alerts. 551 ActionGroups *[]ActivityLogAlertActionGroup `json:"actionGroups,omitempty"` 552} 553 554// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 555// ActivityLogAlertAllOfCondition an Activity Log alert condition that is met when all its member conditions are 556// met. 557type ActivityLogAlertAllOfCondition struct { 558 // AllOf - The list of activity log alert conditions. 559 AllOf *[]ActivityLogAlertLeafCondition `json:"allOf,omitempty"` 560} 561 562// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 563// ActivityLogAlertLeafCondition an Activity Log alert condition that is met by comparing an activity log field and 564// value. 565type ActivityLogAlertLeafCondition struct { 566 // 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.'. 567 Field *string `json:"field,omitempty"` 568 // Equals - The field value will be compared to this value (case-insensitive) to determine if the condition is met. 569 Equals *string `json:"equals,omitempty"` 570} 571 572// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 573// ActivityLogAlertList a list of activity log alerts. 574type ActivityLogAlertList struct { 575 autorest.Response `json:"-"` 576 // Value - The list of activity log alerts. 577 Value *[]ActivityLogAlertResource `json:"value,omitempty"` 578 // NextLink - Provides the link to retrieve the next set of elements. 579 NextLink *string `json:"nextLink,omitempty"` 580} 581 582// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 583// ActivityLogAlertPatch an Azure activity log alert for patch operations. 584type ActivityLogAlertPatch struct { 585 // 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. 586 Enabled *bool `json:"enabled,omitempty"` 587} 588 589// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 590// ActivityLogAlertPatchBody an activity log alert object for the body of patch operations. 591type ActivityLogAlertPatchBody struct { 592 // Tags - Resource tags 593 Tags map[string]*string `json:"tags"` 594 // ActivityLogAlertPatch - The activity log alert settings for an update operation. 595 *ActivityLogAlertPatch `json:"properties,omitempty"` 596} 597 598// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 599// MarshalJSON is the custom marshaler for ActivityLogAlertPatchBody. 600func (alapb ActivityLogAlertPatchBody) MarshalJSON() ([]byte, error) { 601 objectMap := make(map[string]interface{}) 602 if alapb.Tags != nil { 603 objectMap["tags"] = alapb.Tags 604 } 605 if alapb.ActivityLogAlertPatch != nil { 606 objectMap["properties"] = alapb.ActivityLogAlertPatch 607 } 608 return json.Marshal(objectMap) 609} 610 611// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 612// UnmarshalJSON is the custom unmarshaler for ActivityLogAlertPatchBody struct. 613func (alapb *ActivityLogAlertPatchBody) UnmarshalJSON(body []byte) error { 614 var m map[string]*json.RawMessage 615 err := json.Unmarshal(body, &m) 616 if err != nil { 617 return err 618 } 619 for k, v := range m { 620 switch k { 621 case "tags": 622 if v != nil { 623 var tags map[string]*string 624 err = json.Unmarshal(*v, &tags) 625 if err != nil { 626 return err 627 } 628 alapb.Tags = tags 629 } 630 case "properties": 631 if v != nil { 632 var activityLogAlertPatch ActivityLogAlertPatch 633 err = json.Unmarshal(*v, &activityLogAlertPatch) 634 if err != nil { 635 return err 636 } 637 alapb.ActivityLogAlertPatch = &activityLogAlertPatch 638 } 639 } 640 } 641 642 return nil 643} 644 645// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 646// ActivityLogAlertResource an activity log alert resource. 647type ActivityLogAlertResource struct { 648 autorest.Response `json:"-"` 649 // ActivityLogAlert - The activity log alert properties of the resource. 650 *ActivityLogAlert `json:"properties,omitempty"` 651 // ID - Azure resource Id 652 ID *string `json:"id,omitempty"` 653 // Name - Azure resource name 654 Name *string `json:"name,omitempty"` 655 // Type - Azure resource type 656 Type *string `json:"type,omitempty"` 657 // Location - Resource location 658 Location *string `json:"location,omitempty"` 659 // Tags - Resource tags 660 Tags map[string]*string `json:"tags"` 661} 662 663// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 664// MarshalJSON is the custom marshaler for ActivityLogAlertResource. 665func (alar ActivityLogAlertResource) MarshalJSON() ([]byte, error) { 666 objectMap := make(map[string]interface{}) 667 if alar.ActivityLogAlert != nil { 668 objectMap["properties"] = alar.ActivityLogAlert 669 } 670 if alar.ID != nil { 671 objectMap["id"] = alar.ID 672 } 673 if alar.Name != nil { 674 objectMap["name"] = alar.Name 675 } 676 if alar.Type != nil { 677 objectMap["type"] = alar.Type 678 } 679 if alar.Location != nil { 680 objectMap["location"] = alar.Location 681 } 682 if alar.Tags != nil { 683 objectMap["tags"] = alar.Tags 684 } 685 return json.Marshal(objectMap) 686} 687 688// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 689// UnmarshalJSON is the custom unmarshaler for ActivityLogAlertResource struct. 690func (alar *ActivityLogAlertResource) UnmarshalJSON(body []byte) error { 691 var m map[string]*json.RawMessage 692 err := json.Unmarshal(body, &m) 693 if err != nil { 694 return err 695 } 696 for k, v := range m { 697 switch k { 698 case "properties": 699 if v != nil { 700 var activityLogAlert ActivityLogAlert 701 err = json.Unmarshal(*v, &activityLogAlert) 702 if err != nil { 703 return err 704 } 705 alar.ActivityLogAlert = &activityLogAlert 706 } 707 case "id": 708 if v != nil { 709 var ID string 710 err = json.Unmarshal(*v, &ID) 711 if err != nil { 712 return err 713 } 714 alar.ID = &ID 715 } 716 case "name": 717 if v != nil { 718 var name string 719 err = json.Unmarshal(*v, &name) 720 if err != nil { 721 return err 722 } 723 alar.Name = &name 724 } 725 case "type": 726 if v != nil { 727 var typeVar string 728 err = json.Unmarshal(*v, &typeVar) 729 if err != nil { 730 return err 731 } 732 alar.Type = &typeVar 733 } 734 case "location": 735 if v != nil { 736 var location string 737 err = json.Unmarshal(*v, &location) 738 if err != nil { 739 return err 740 } 741 alar.Location = &location 742 } 743 case "tags": 744 if v != nil { 745 var tags map[string]*string 746 err = json.Unmarshal(*v, &tags) 747 if err != nil { 748 return err 749 } 750 alar.Tags = tags 751 } 752 } 753 } 754 755 return nil 756} 757 758// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 759// AlertRule an alert rule. 760type AlertRule struct { 761 // Name - the name of the alert rule. 762 Name *string `json:"name,omitempty"` 763 // Description - the description of the alert rule that will be included in the alert email. 764 Description *string `json:"description,omitempty"` 765 // IsEnabled - the flag that indicates whether the alert rule is enabled. 766 IsEnabled *bool `json:"isEnabled,omitempty"` 767 // Condition - the condition that results in the alert rule being activated. 768 Condition BasicRuleCondition `json:"condition,omitempty"` 769 // Actions - the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. 770 Actions *[]BasicRuleAction `json:"actions,omitempty"` 771 // LastUpdatedTime - Last time the rule was updated in ISO8601 format. 772 LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` 773} 774 775// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 776// UnmarshalJSON is the custom unmarshaler for AlertRule struct. 777func (ar *AlertRule) UnmarshalJSON(body []byte) error { 778 var m map[string]*json.RawMessage 779 err := json.Unmarshal(body, &m) 780 if err != nil { 781 return err 782 } 783 for k, v := range m { 784 switch k { 785 case "name": 786 if v != nil { 787 var name string 788 err = json.Unmarshal(*v, &name) 789 if err != nil { 790 return err 791 } 792 ar.Name = &name 793 } 794 case "description": 795 if v != nil { 796 var description string 797 err = json.Unmarshal(*v, &description) 798 if err != nil { 799 return err 800 } 801 ar.Description = &description 802 } 803 case "isEnabled": 804 if v != nil { 805 var isEnabled bool 806 err = json.Unmarshal(*v, &isEnabled) 807 if err != nil { 808 return err 809 } 810 ar.IsEnabled = &isEnabled 811 } 812 case "condition": 813 if v != nil { 814 condition, err := unmarshalBasicRuleCondition(*v) 815 if err != nil { 816 return err 817 } 818 ar.Condition = condition 819 } 820 case "actions": 821 if v != nil { 822 actions, err := unmarshalBasicRuleActionArray(*v) 823 if err != nil { 824 return err 825 } 826 ar.Actions = &actions 827 } 828 case "lastUpdatedTime": 829 if v != nil { 830 var lastUpdatedTime date.Time 831 err = json.Unmarshal(*v, &lastUpdatedTime) 832 if err != nil { 833 return err 834 } 835 ar.LastUpdatedTime = &lastUpdatedTime 836 } 837 } 838 } 839 840 return nil 841} 842 843// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 844// AlertRuleResource the alert rule resource. 845type AlertRuleResource struct { 846 autorest.Response `json:"-"` 847 // AlertRule - The alert rule properties of the resource. 848 *AlertRule `json:"properties,omitempty"` 849 // ID - Azure resource Id 850 ID *string `json:"id,omitempty"` 851 // Name - Azure resource name 852 Name *string `json:"name,omitempty"` 853 // Type - Azure resource type 854 Type *string `json:"type,omitempty"` 855 // Location - Resource location 856 Location *string `json:"location,omitempty"` 857 // Tags - Resource tags 858 Tags map[string]*string `json:"tags"` 859} 860 861// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 862// MarshalJSON is the custom marshaler for AlertRuleResource. 863func (arr AlertRuleResource) MarshalJSON() ([]byte, error) { 864 objectMap := make(map[string]interface{}) 865 if arr.AlertRule != nil { 866 objectMap["properties"] = arr.AlertRule 867 } 868 if arr.ID != nil { 869 objectMap["id"] = arr.ID 870 } 871 if arr.Name != nil { 872 objectMap["name"] = arr.Name 873 } 874 if arr.Type != nil { 875 objectMap["type"] = arr.Type 876 } 877 if arr.Location != nil { 878 objectMap["location"] = arr.Location 879 } 880 if arr.Tags != nil { 881 objectMap["tags"] = arr.Tags 882 } 883 return json.Marshal(objectMap) 884} 885 886// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 887// UnmarshalJSON is the custom unmarshaler for AlertRuleResource struct. 888func (arr *AlertRuleResource) UnmarshalJSON(body []byte) error { 889 var m map[string]*json.RawMessage 890 err := json.Unmarshal(body, &m) 891 if err != nil { 892 return err 893 } 894 for k, v := range m { 895 switch k { 896 case "properties": 897 if v != nil { 898 var alertRule AlertRule 899 err = json.Unmarshal(*v, &alertRule) 900 if err != nil { 901 return err 902 } 903 arr.AlertRule = &alertRule 904 } 905 case "id": 906 if v != nil { 907 var ID string 908 err = json.Unmarshal(*v, &ID) 909 if err != nil { 910 return err 911 } 912 arr.ID = &ID 913 } 914 case "name": 915 if v != nil { 916 var name string 917 err = json.Unmarshal(*v, &name) 918 if err != nil { 919 return err 920 } 921 arr.Name = &name 922 } 923 case "type": 924 if v != nil { 925 var typeVar string 926 err = json.Unmarshal(*v, &typeVar) 927 if err != nil { 928 return err 929 } 930 arr.Type = &typeVar 931 } 932 case "location": 933 if v != nil { 934 var location string 935 err = json.Unmarshal(*v, &location) 936 if err != nil { 937 return err 938 } 939 arr.Location = &location 940 } 941 case "tags": 942 if v != nil { 943 var tags map[string]*string 944 err = json.Unmarshal(*v, &tags) 945 if err != nil { 946 return err 947 } 948 arr.Tags = tags 949 } 950 } 951 } 952 953 return nil 954} 955 956// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 957// AlertRuleResourceCollection represents a collection of alert rule resources. 958type AlertRuleResourceCollection struct { 959 autorest.Response `json:"-"` 960 // Value - the values for the alert rule resources. 961 Value *[]AlertRuleResource `json:"value,omitempty"` 962} 963 964// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 965// AlertRuleResourcePatch the alert rule object for patch operations. 966type AlertRuleResourcePatch struct { 967 // Tags - Resource tags 968 Tags map[string]*string `json:"tags"` 969 // AlertRule - The properties of an alert rule. 970 *AlertRule `json:"properties,omitempty"` 971} 972 973// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 974// MarshalJSON is the custom marshaler for AlertRuleResourcePatch. 975func (arrp AlertRuleResourcePatch) MarshalJSON() ([]byte, error) { 976 objectMap := make(map[string]interface{}) 977 if arrp.Tags != nil { 978 objectMap["tags"] = arrp.Tags 979 } 980 if arrp.AlertRule != nil { 981 objectMap["properties"] = arrp.AlertRule 982 } 983 return json.Marshal(objectMap) 984} 985 986// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 987// UnmarshalJSON is the custom unmarshaler for AlertRuleResourcePatch struct. 988func (arrp *AlertRuleResourcePatch) UnmarshalJSON(body []byte) error { 989 var m map[string]*json.RawMessage 990 err := json.Unmarshal(body, &m) 991 if err != nil { 992 return err 993 } 994 for k, v := range m { 995 switch k { 996 case "tags": 997 if v != nil { 998 var tags map[string]*string 999 err = json.Unmarshal(*v, &tags) 1000 if err != nil { 1001 return err 1002 } 1003 arrp.Tags = tags 1004 } 1005 case "properties": 1006 if v != nil { 1007 var alertRule AlertRule 1008 err = json.Unmarshal(*v, &alertRule) 1009 if err != nil { 1010 return err 1011 } 1012 arrp.AlertRule = &alertRule 1013 } 1014 } 1015 } 1016 1017 return nil 1018} 1019 1020// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1021// AutomationRunbookReceiver the Azure Automation Runbook notification receiver. 1022type AutomationRunbookReceiver struct { 1023 // AutomationAccountID - The Azure automation account Id which holds this runbook and authenticate to Azure resource. 1024 AutomationAccountID *string `json:"automationAccountId,omitempty"` 1025 // RunbookName - The name for this runbook. 1026 RunbookName *string `json:"runbookName,omitempty"` 1027 // WebhookResourceID - The resource id for webhook linked to this runbook. 1028 WebhookResourceID *string `json:"webhookResourceId,omitempty"` 1029 // IsGlobalRunbook - Indicates whether this instance is global runbook. 1030 IsGlobalRunbook *bool `json:"isGlobalRunbook,omitempty"` 1031 // Name - Indicates name of the webhook. 1032 Name *string `json:"name,omitempty"` 1033 // ServiceURI - The URI where webhooks should be sent. 1034 ServiceURI *string `json:"serviceUri,omitempty"` 1035} 1036 1037// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1038// AutoscaleNotification autoscale notification. 1039type AutoscaleNotification struct { 1040 // Operation - the operation associated with the notification and its value must be "scale" 1041 Operation *string `json:"operation,omitempty"` 1042 // Email - the email notification. 1043 Email *EmailNotification `json:"email,omitempty"` 1044 // Webhooks - the collection of webhook notifications. 1045 Webhooks *[]WebhookNotification `json:"webhooks,omitempty"` 1046} 1047 1048// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1049// AutoscaleProfile autoscale profile. 1050type AutoscaleProfile struct { 1051 // Name - the name of the profile. 1052 Name *string `json:"name,omitempty"` 1053 // Capacity - the number of instances that can be used during this profile. 1054 Capacity *ScaleCapacity `json:"capacity,omitempty"` 1055 // Rules - the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. 1056 Rules *[]ScaleRule `json:"rules,omitempty"` 1057 // FixedDate - the specific date-time for the profile. This element is not used if the Recurrence element is used. 1058 FixedDate *TimeWindow `json:"fixedDate,omitempty"` 1059 // Recurrence - the repeating times at which this profile begins. This element is not used if the FixedDate element is used. 1060 Recurrence *Recurrence `json:"recurrence,omitempty"` 1061} 1062 1063// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1064// AutoscaleSetting a setting that contains all of the configuration for the automatic scaling of a resource. 1065type AutoscaleSetting struct { 1066 // Profiles - the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified. 1067 Profiles *[]AutoscaleProfile `json:"profiles,omitempty"` 1068 // Notifications - the collection of notifications. 1069 Notifications *[]AutoscaleNotification `json:"notifications,omitempty"` 1070 // Enabled - the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'true'. 1071 Enabled *bool `json:"enabled,omitempty"` 1072 // Name - the name of the autoscale setting. 1073 Name *string `json:"name,omitempty"` 1074 // TargetResourceURI - the resource identifier of the resource that the autoscale setting should be added to. 1075 TargetResourceURI *string `json:"targetResourceUri,omitempty"` 1076} 1077 1078// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1079// AutoscaleSettingResource the autoscale setting resource. 1080type AutoscaleSettingResource struct { 1081 autorest.Response `json:"-"` 1082 // AutoscaleSetting - The autoscale setting of the resource. 1083 *AutoscaleSetting `json:"properties,omitempty"` 1084 // ID - Azure resource Id 1085 ID *string `json:"id,omitempty"` 1086 // Name - Azure resource name 1087 Name *string `json:"name,omitempty"` 1088 // Type - Azure resource type 1089 Type *string `json:"type,omitempty"` 1090 // Location - Resource location 1091 Location *string `json:"location,omitempty"` 1092 // Tags - Resource tags 1093 Tags map[string]*string `json:"tags"` 1094} 1095 1096// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1097// MarshalJSON is the custom marshaler for AutoscaleSettingResource. 1098func (asr AutoscaleSettingResource) MarshalJSON() ([]byte, error) { 1099 objectMap := make(map[string]interface{}) 1100 if asr.AutoscaleSetting != nil { 1101 objectMap["properties"] = asr.AutoscaleSetting 1102 } 1103 if asr.ID != nil { 1104 objectMap["id"] = asr.ID 1105 } 1106 if asr.Name != nil { 1107 objectMap["name"] = asr.Name 1108 } 1109 if asr.Type != nil { 1110 objectMap["type"] = asr.Type 1111 } 1112 if asr.Location != nil { 1113 objectMap["location"] = asr.Location 1114 } 1115 if asr.Tags != nil { 1116 objectMap["tags"] = asr.Tags 1117 } 1118 return json.Marshal(objectMap) 1119} 1120 1121// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1122// UnmarshalJSON is the custom unmarshaler for AutoscaleSettingResource struct. 1123func (asr *AutoscaleSettingResource) UnmarshalJSON(body []byte) error { 1124 var m map[string]*json.RawMessage 1125 err := json.Unmarshal(body, &m) 1126 if err != nil { 1127 return err 1128 } 1129 for k, v := range m { 1130 switch k { 1131 case "properties": 1132 if v != nil { 1133 var autoscaleSetting AutoscaleSetting 1134 err = json.Unmarshal(*v, &autoscaleSetting) 1135 if err != nil { 1136 return err 1137 } 1138 asr.AutoscaleSetting = &autoscaleSetting 1139 } 1140 case "id": 1141 if v != nil { 1142 var ID string 1143 err = json.Unmarshal(*v, &ID) 1144 if err != nil { 1145 return err 1146 } 1147 asr.ID = &ID 1148 } 1149 case "name": 1150 if v != nil { 1151 var name string 1152 err = json.Unmarshal(*v, &name) 1153 if err != nil { 1154 return err 1155 } 1156 asr.Name = &name 1157 } 1158 case "type": 1159 if v != nil { 1160 var typeVar string 1161 err = json.Unmarshal(*v, &typeVar) 1162 if err != nil { 1163 return err 1164 } 1165 asr.Type = &typeVar 1166 } 1167 case "location": 1168 if v != nil { 1169 var location string 1170 err = json.Unmarshal(*v, &location) 1171 if err != nil { 1172 return err 1173 } 1174 asr.Location = &location 1175 } 1176 case "tags": 1177 if v != nil { 1178 var tags map[string]*string 1179 err = json.Unmarshal(*v, &tags) 1180 if err != nil { 1181 return err 1182 } 1183 asr.Tags = tags 1184 } 1185 } 1186 } 1187 1188 return nil 1189} 1190 1191// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1192// AutoscaleSettingResourceCollection represents a collection of autoscale setting resources. 1193type AutoscaleSettingResourceCollection struct { 1194 autorest.Response `json:"-"` 1195 // Value - the values for the autoscale setting resources. 1196 Value *[]AutoscaleSettingResource `json:"value,omitempty"` 1197 // NextLink - URL to get the next set of results. 1198 NextLink *string `json:"nextLink,omitempty"` 1199} 1200 1201// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1202// AutoscaleSettingResourceCollectionIterator provides access to a complete listing of AutoscaleSettingResource 1203// values. 1204type AutoscaleSettingResourceCollectionIterator struct { 1205 i int 1206 page AutoscaleSettingResourceCollectionPage 1207} 1208 1209// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1210// Next advances to the next value. If there was an error making 1211// the request the iterator does not advance and the error is returned. 1212func (iter *AutoscaleSettingResourceCollectionIterator) Next() error { 1213 iter.i++ 1214 if iter.i < len(iter.page.Values()) { 1215 return nil 1216 } 1217 err := iter.page.Next() 1218 if err != nil { 1219 iter.i-- 1220 return err 1221 } 1222 iter.i = 0 1223 return nil 1224} 1225 1226// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1227// NotDone returns true if the enumeration should be started or is not yet complete. 1228func (iter AutoscaleSettingResourceCollectionIterator) NotDone() bool { 1229 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1230} 1231 1232// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1233// Response returns the raw server response from the last page request. 1234func (iter AutoscaleSettingResourceCollectionIterator) Response() AutoscaleSettingResourceCollection { 1235 return iter.page.Response() 1236} 1237 1238// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1239// Value returns the current value or a zero-initialized value if the 1240// iterator has advanced beyond the end of the collection. 1241func (iter AutoscaleSettingResourceCollectionIterator) Value() AutoscaleSettingResource { 1242 if !iter.page.NotDone() { 1243 return AutoscaleSettingResource{} 1244 } 1245 return iter.page.Values()[iter.i] 1246} 1247 1248// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1249// IsEmpty returns true if the ListResult contains no values. 1250func (asrc AutoscaleSettingResourceCollection) IsEmpty() bool { 1251 return asrc.Value == nil || len(*asrc.Value) == 0 1252} 1253 1254// autoscaleSettingResourceCollectionPreparer prepares a request to retrieve the next set of results. 1255// It returns nil if no more results exist. 1256func (asrc AutoscaleSettingResourceCollection) autoscaleSettingResourceCollectionPreparer() (*http.Request, error) { 1257 if asrc.NextLink == nil || len(to.String(asrc.NextLink)) < 1 { 1258 return nil, nil 1259 } 1260 return autorest.Prepare(&http.Request{}, 1261 autorest.AsJSON(), 1262 autorest.AsGet(), 1263 autorest.WithBaseURL(to.String(asrc.NextLink))) 1264} 1265 1266// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1267// AutoscaleSettingResourceCollectionPage contains a page of AutoscaleSettingResource values. 1268type AutoscaleSettingResourceCollectionPage struct { 1269 fn func(AutoscaleSettingResourceCollection) (AutoscaleSettingResourceCollection, error) 1270 asrc AutoscaleSettingResourceCollection 1271} 1272 1273// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1274// Next advances to the next page of values. If there was an error making 1275// the request the page does not advance and the error is returned. 1276func (page *AutoscaleSettingResourceCollectionPage) Next() error { 1277 next, err := page.fn(page.asrc) 1278 if err != nil { 1279 return err 1280 } 1281 page.asrc = next 1282 return nil 1283} 1284 1285// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1286// NotDone returns true if the page enumeration should be started or is not yet complete. 1287func (page AutoscaleSettingResourceCollectionPage) NotDone() bool { 1288 return !page.asrc.IsEmpty() 1289} 1290 1291// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1292// Response returns the raw server response from the last page request. 1293func (page AutoscaleSettingResourceCollectionPage) Response() AutoscaleSettingResourceCollection { 1294 return page.asrc 1295} 1296 1297// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1298// Values returns the slice of values for the current page or nil if there are no values. 1299func (page AutoscaleSettingResourceCollectionPage) Values() []AutoscaleSettingResource { 1300 if page.asrc.IsEmpty() { 1301 return nil 1302 } 1303 return *page.asrc.Value 1304} 1305 1306// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1307// AutoscaleSettingResourcePatch the autoscale setting object for patch operations. 1308type AutoscaleSettingResourcePatch struct { 1309 // Tags - Resource tags 1310 Tags map[string]*string `json:"tags"` 1311 // AutoscaleSetting - The autoscale setting properties of the update operation. 1312 *AutoscaleSetting `json:"properties,omitempty"` 1313} 1314 1315// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1316// MarshalJSON is the custom marshaler for AutoscaleSettingResourcePatch. 1317func (asrp AutoscaleSettingResourcePatch) MarshalJSON() ([]byte, error) { 1318 objectMap := make(map[string]interface{}) 1319 if asrp.Tags != nil { 1320 objectMap["tags"] = asrp.Tags 1321 } 1322 if asrp.AutoscaleSetting != nil { 1323 objectMap["properties"] = asrp.AutoscaleSetting 1324 } 1325 return json.Marshal(objectMap) 1326} 1327 1328// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1329// UnmarshalJSON is the custom unmarshaler for AutoscaleSettingResourcePatch struct. 1330func (asrp *AutoscaleSettingResourcePatch) UnmarshalJSON(body []byte) error { 1331 var m map[string]*json.RawMessage 1332 err := json.Unmarshal(body, &m) 1333 if err != nil { 1334 return err 1335 } 1336 for k, v := range m { 1337 switch k { 1338 case "tags": 1339 if v != nil { 1340 var tags map[string]*string 1341 err = json.Unmarshal(*v, &tags) 1342 if err != nil { 1343 return err 1344 } 1345 asrp.Tags = tags 1346 } 1347 case "properties": 1348 if v != nil { 1349 var autoscaleSetting AutoscaleSetting 1350 err = json.Unmarshal(*v, &autoscaleSetting) 1351 if err != nil { 1352 return err 1353 } 1354 asrp.AutoscaleSetting = &autoscaleSetting 1355 } 1356 } 1357 } 1358 1359 return nil 1360} 1361 1362// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1363// AzureAppPushReceiver the Azure mobile App push notification receiver. 1364type AzureAppPushReceiver struct { 1365 // Name - The name of the Azure mobile app push receiver. Names must be unique across all receivers within an action group. 1366 Name *string `json:"name,omitempty"` 1367 // EmailAddress - The email address registered for the Azure mobile app. 1368 EmailAddress *string `json:"emailAddress,omitempty"` 1369} 1370 1371// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1372// DiagnosticSettings the diagnostic settings. 1373type DiagnosticSettings struct { 1374 // StorageAccountID - The resource ID of the storage account to which you would like to send Diagnostic Logs. 1375 StorageAccountID *string `json:"storageAccountId,omitempty"` 1376 // EventHubAuthorizationRuleID - The resource Id for the event hub authorization rule. 1377 EventHubAuthorizationRuleID *string `json:"eventHubAuthorizationRuleId,omitempty"` 1378 // EventHubName - The name of the event hub. If none is specified, the default event hub will be selected. 1379 EventHubName *string `json:"eventHubName,omitempty"` 1380 // Metrics - the list of metric settings. 1381 Metrics *[]MetricSettings `json:"metrics,omitempty"` 1382 // Logs - the list of logs settings. 1383 Logs *[]LogSettings `json:"logs,omitempty"` 1384 // WorkspaceID - The workspace ID (resource ID of a Log Analytics workspace) for a 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 1385 WorkspaceID *string `json:"workspaceId,omitempty"` 1386} 1387 1388// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1389// DiagnosticSettingsCategory the diagnostic settings Category. 1390type DiagnosticSettingsCategory struct { 1391 // CategoryType - The type of the diagnostic settings category. Possible values include: 'Metrics', 'Logs' 1392 CategoryType CategoryType `json:"categoryType,omitempty"` 1393} 1394 1395// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1396// DiagnosticSettingsCategoryResource the diagnostic settings category resource. 1397type DiagnosticSettingsCategoryResource struct { 1398 autorest.Response `json:"-"` 1399 *DiagnosticSettingsCategory `json:"properties,omitempty"` 1400 // ID - Azure resource Id 1401 ID *string `json:"id,omitempty"` 1402 // Name - Azure resource name 1403 Name *string `json:"name,omitempty"` 1404 // Type - Azure resource type 1405 Type *string `json:"type,omitempty"` 1406} 1407 1408// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1409// MarshalJSON is the custom marshaler for DiagnosticSettingsCategoryResource. 1410func (dscr DiagnosticSettingsCategoryResource) MarshalJSON() ([]byte, error) { 1411 objectMap := make(map[string]interface{}) 1412 if dscr.DiagnosticSettingsCategory != nil { 1413 objectMap["properties"] = dscr.DiagnosticSettingsCategory 1414 } 1415 if dscr.ID != nil { 1416 objectMap["id"] = dscr.ID 1417 } 1418 if dscr.Name != nil { 1419 objectMap["name"] = dscr.Name 1420 } 1421 if dscr.Type != nil { 1422 objectMap["type"] = dscr.Type 1423 } 1424 return json.Marshal(objectMap) 1425} 1426 1427// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1428// UnmarshalJSON is the custom unmarshaler for DiagnosticSettingsCategoryResource struct. 1429func (dscr *DiagnosticSettingsCategoryResource) UnmarshalJSON(body []byte) error { 1430 var m map[string]*json.RawMessage 1431 err := json.Unmarshal(body, &m) 1432 if err != nil { 1433 return err 1434 } 1435 for k, v := range m { 1436 switch k { 1437 case "properties": 1438 if v != nil { 1439 var diagnosticSettingsCategory DiagnosticSettingsCategory 1440 err = json.Unmarshal(*v, &diagnosticSettingsCategory) 1441 if err != nil { 1442 return err 1443 } 1444 dscr.DiagnosticSettingsCategory = &diagnosticSettingsCategory 1445 } 1446 case "id": 1447 if v != nil { 1448 var ID string 1449 err = json.Unmarshal(*v, &ID) 1450 if err != nil { 1451 return err 1452 } 1453 dscr.ID = &ID 1454 } 1455 case "name": 1456 if v != nil { 1457 var name string 1458 err = json.Unmarshal(*v, &name) 1459 if err != nil { 1460 return err 1461 } 1462 dscr.Name = &name 1463 } 1464 case "type": 1465 if v != nil { 1466 var typeVar string 1467 err = json.Unmarshal(*v, &typeVar) 1468 if err != nil { 1469 return err 1470 } 1471 dscr.Type = &typeVar 1472 } 1473 } 1474 } 1475 1476 return nil 1477} 1478 1479// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1480// DiagnosticSettingsCategoryResourceCollection represents a collection of diagnostic setting category resources. 1481type DiagnosticSettingsCategoryResourceCollection struct { 1482 autorest.Response `json:"-"` 1483 // Value - The collection of diagnostic settings category resources. 1484 Value *[]DiagnosticSettingsCategoryResource `json:"value,omitempty"` 1485} 1486 1487// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1488// DiagnosticSettingsResource the diagnostic setting resource. 1489type DiagnosticSettingsResource struct { 1490 autorest.Response `json:"-"` 1491 *DiagnosticSettings `json:"properties,omitempty"` 1492 // ID - Azure resource Id 1493 ID *string `json:"id,omitempty"` 1494 // Name - Azure resource name 1495 Name *string `json:"name,omitempty"` 1496 // Type - Azure resource type 1497 Type *string `json:"type,omitempty"` 1498} 1499 1500// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1501// MarshalJSON is the custom marshaler for DiagnosticSettingsResource. 1502func (dsr DiagnosticSettingsResource) MarshalJSON() ([]byte, error) { 1503 objectMap := make(map[string]interface{}) 1504 if dsr.DiagnosticSettings != nil { 1505 objectMap["properties"] = dsr.DiagnosticSettings 1506 } 1507 if dsr.ID != nil { 1508 objectMap["id"] = dsr.ID 1509 } 1510 if dsr.Name != nil { 1511 objectMap["name"] = dsr.Name 1512 } 1513 if dsr.Type != nil { 1514 objectMap["type"] = dsr.Type 1515 } 1516 return json.Marshal(objectMap) 1517} 1518 1519// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1520// UnmarshalJSON is the custom unmarshaler for DiagnosticSettingsResource struct. 1521func (dsr *DiagnosticSettingsResource) UnmarshalJSON(body []byte) error { 1522 var m map[string]*json.RawMessage 1523 err := json.Unmarshal(body, &m) 1524 if err != nil { 1525 return err 1526 } 1527 for k, v := range m { 1528 switch k { 1529 case "properties": 1530 if v != nil { 1531 var diagnosticSettings DiagnosticSettings 1532 err = json.Unmarshal(*v, &diagnosticSettings) 1533 if err != nil { 1534 return err 1535 } 1536 dsr.DiagnosticSettings = &diagnosticSettings 1537 } 1538 case "id": 1539 if v != nil { 1540 var ID string 1541 err = json.Unmarshal(*v, &ID) 1542 if err != nil { 1543 return err 1544 } 1545 dsr.ID = &ID 1546 } 1547 case "name": 1548 if v != nil { 1549 var name string 1550 err = json.Unmarshal(*v, &name) 1551 if err != nil { 1552 return err 1553 } 1554 dsr.Name = &name 1555 } 1556 case "type": 1557 if v != nil { 1558 var typeVar string 1559 err = json.Unmarshal(*v, &typeVar) 1560 if err != nil { 1561 return err 1562 } 1563 dsr.Type = &typeVar 1564 } 1565 } 1566 } 1567 1568 return nil 1569} 1570 1571// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1572// DiagnosticSettingsResourceCollection represents a collection of alert rule resources. 1573type DiagnosticSettingsResourceCollection struct { 1574 autorest.Response `json:"-"` 1575 // Value - The collection of diagnostic settings resources;. 1576 Value *[]DiagnosticSettingsResource `json:"value,omitempty"` 1577} 1578 1579// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1580// EmailNotification email notification of an autoscale event. 1581type EmailNotification struct { 1582 // SendToSubscriptionAdministrator - a value indicating whether to send email to subscription administrator. 1583 SendToSubscriptionAdministrator *bool `json:"sendToSubscriptionAdministrator,omitempty"` 1584 // SendToSubscriptionCoAdministrators - a value indicating whether to send email to subscription co-administrators. 1585 SendToSubscriptionCoAdministrators *bool `json:"sendToSubscriptionCoAdministrators,omitempty"` 1586 // CustomEmails - the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. 1587 CustomEmails *[]string `json:"customEmails,omitempty"` 1588} 1589 1590// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1591// EmailReceiver an email receiver. 1592type EmailReceiver struct { 1593 // Name - The name of the email receiver. Names must be unique across all receivers within an action group. 1594 Name *string `json:"name,omitempty"` 1595 // EmailAddress - The email address of this receiver. 1596 EmailAddress *string `json:"emailAddress,omitempty"` 1597 // Status - The receiver status of the e-mail. Possible values include: 'NotSpecified', 'Enabled', 'Disabled' 1598 Status ReceiverStatus `json:"status,omitempty"` 1599} 1600 1601// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1602// EnableRequest describes a receiver that should be resubscribed. 1603type EnableRequest struct { 1604 // ReceiverName - The name of the receiver to resubscribe. 1605 ReceiverName *string `json:"receiverName,omitempty"` 1606} 1607 1608// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1609// ErrorResponse describes the format of Error response. 1610type ErrorResponse struct { 1611 // Code - Error code 1612 Code *string `json:"code,omitempty"` 1613 // Message - Error message indicating why the operation failed. 1614 Message *string `json:"message,omitempty"` 1615} 1616 1617// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1618// Incident an alert incident indicates the activation status of an alert rule. 1619type Incident struct { 1620 autorest.Response `json:"-"` 1621 // Name - Incident name. 1622 Name *string `json:"name,omitempty"` 1623 // RuleName - Rule name that is associated with the incident. 1624 RuleName *string `json:"ruleName,omitempty"` 1625 // IsActive - A boolean to indicate whether the incident is active or resolved. 1626 IsActive *bool `json:"isActive,omitempty"` 1627 // ActivatedTime - The time at which the incident was activated in ISO8601 format. 1628 ActivatedTime *date.Time `json:"activatedTime,omitempty"` 1629 // ResolvedTime - The time at which the incident was resolved in ISO8601 format. If null, it means the incident is still active. 1630 ResolvedTime *date.Time `json:"resolvedTime,omitempty"` 1631} 1632 1633// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1634// IncidentListResult the List incidents operation response. 1635type IncidentListResult struct { 1636 autorest.Response `json:"-"` 1637 // Value - the incident collection. 1638 Value *[]Incident `json:"value,omitempty"` 1639} 1640 1641// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1642// ItsmReceiver an Itsm receiver. 1643type ItsmReceiver struct { 1644 // Name - The name of the Itsm receiver. Names must be unique across all receivers within an action group. 1645 Name *string `json:"name,omitempty"` 1646 // WorkspaceID - OMS LA instance identifier. 1647 WorkspaceID *string `json:"workspaceId,omitempty"` 1648 // ConnectionID - Unique identification of ITSM connection among multiple defined in above workspace. 1649 ConnectionID *string `json:"connectionId,omitempty"` 1650 // TicketConfiguration - JSON blob for the configurations of the ITSM action. CreateMultipleWorkItems option will be part of this blob as well. 1651 TicketConfiguration *string `json:"ticketConfiguration,omitempty"` 1652 // Region - Region in which workspace resides. Supported values:'centralindia','japaneast','southeastasia','australiasoutheast','uksouth','westcentralus','canadacentral','eastus','westeurope' 1653 Region *string `json:"region,omitempty"` 1654} 1655 1656// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1657// LocationThresholdRuleCondition a rule condition based on a certain number of locations failing. 1658type LocationThresholdRuleCondition struct { 1659 // 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. 1660 WindowSize *string `json:"windowSize,omitempty"` 1661 // FailedLocationCount - the number of locations that must fail to activate the alert. 1662 FailedLocationCount *int32 `json:"failedLocationCount,omitempty"` 1663 // DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource. 1664 DataSource BasicRuleDataSource `json:"dataSource,omitempty"` 1665 // OdataType - Possible values include: 'OdataTypeRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition' 1666 OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"` 1667} 1668 1669// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1670// MarshalJSON is the custom marshaler for LocationThresholdRuleCondition. 1671func (ltrc LocationThresholdRuleCondition) MarshalJSON() ([]byte, error) { 1672 ltrc.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition 1673 objectMap := make(map[string]interface{}) 1674 if ltrc.WindowSize != nil { 1675 objectMap["windowSize"] = ltrc.WindowSize 1676 } 1677 if ltrc.FailedLocationCount != nil { 1678 objectMap["failedLocationCount"] = ltrc.FailedLocationCount 1679 } 1680 objectMap["dataSource"] = ltrc.DataSource 1681 if ltrc.OdataType != "" { 1682 objectMap["odata.type"] = ltrc.OdataType 1683 } 1684 return json.Marshal(objectMap) 1685} 1686 1687// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1688// AsThresholdRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition. 1689func (ltrc LocationThresholdRuleCondition) AsThresholdRuleCondition() (*ThresholdRuleCondition, bool) { 1690 return nil, false 1691} 1692 1693// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1694// AsLocationThresholdRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition. 1695func (ltrc LocationThresholdRuleCondition) AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool) { 1696 return <rc, true 1697} 1698 1699// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1700// AsManagementEventRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition. 1701func (ltrc LocationThresholdRuleCondition) AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool) { 1702 return nil, false 1703} 1704 1705// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1706// AsRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition. 1707func (ltrc LocationThresholdRuleCondition) AsRuleCondition() (*RuleCondition, bool) { 1708 return nil, false 1709} 1710 1711// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1712// AsBasicRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition. 1713func (ltrc LocationThresholdRuleCondition) AsBasicRuleCondition() (BasicRuleCondition, bool) { 1714 return <rc, true 1715} 1716 1717// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1718// UnmarshalJSON is the custom unmarshaler for LocationThresholdRuleCondition struct. 1719func (ltrc *LocationThresholdRuleCondition) UnmarshalJSON(body []byte) error { 1720 var m map[string]*json.RawMessage 1721 err := json.Unmarshal(body, &m) 1722 if err != nil { 1723 return err 1724 } 1725 for k, v := range m { 1726 switch k { 1727 case "windowSize": 1728 if v != nil { 1729 var windowSize string 1730 err = json.Unmarshal(*v, &windowSize) 1731 if err != nil { 1732 return err 1733 } 1734 ltrc.WindowSize = &windowSize 1735 } 1736 case "failedLocationCount": 1737 if v != nil { 1738 var failedLocationCount int32 1739 err = json.Unmarshal(*v, &failedLocationCount) 1740 if err != nil { 1741 return err 1742 } 1743 ltrc.FailedLocationCount = &failedLocationCount 1744 } 1745 case "dataSource": 1746 if v != nil { 1747 dataSource, err := unmarshalBasicRuleDataSource(*v) 1748 if err != nil { 1749 return err 1750 } 1751 ltrc.DataSource = dataSource 1752 } 1753 case "odata.type": 1754 if v != nil { 1755 var odataType OdataTypeBasicRuleCondition 1756 err = json.Unmarshal(*v, &odataType) 1757 if err != nil { 1758 return err 1759 } 1760 ltrc.OdataType = odataType 1761 } 1762 } 1763 } 1764 1765 return nil 1766} 1767 1768// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1769// LogProfileCollection represents a collection of log profiles. 1770type LogProfileCollection struct { 1771 autorest.Response `json:"-"` 1772 // Value - the values of the log profiles. 1773 Value *[]LogProfileResource `json:"value,omitempty"` 1774} 1775 1776// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1777// LogProfileProperties the log profile properties. 1778type LogProfileProperties struct { 1779 // StorageAccountID - the resource id of the storage account to which you would like to send the Activity Log. 1780 StorageAccountID *string `json:"storageAccountId,omitempty"` 1781 // 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}'. 1782 ServiceBusRuleID *string `json:"serviceBusRuleId,omitempty"` 1783 // 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. 1784 Locations *[]string `json:"locations,omitempty"` 1785 // Categories - the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.' 1786 Categories *[]string `json:"categories,omitempty"` 1787 // RetentionPolicy - the retention policy for the events in the log. 1788 RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"` 1789} 1790 1791// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1792// LogProfileResource the log profile resource. 1793type LogProfileResource struct { 1794 autorest.Response `json:"-"` 1795 // LogProfileProperties - The log profile properties of the resource. 1796 *LogProfileProperties `json:"properties,omitempty"` 1797 // ID - Azure resource Id 1798 ID *string `json:"id,omitempty"` 1799 // Name - Azure resource name 1800 Name *string `json:"name,omitempty"` 1801 // Type - Azure resource type 1802 Type *string `json:"type,omitempty"` 1803 // Location - Resource location 1804 Location *string `json:"location,omitempty"` 1805 // Tags - Resource tags 1806 Tags map[string]*string `json:"tags"` 1807} 1808 1809// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1810// MarshalJSON is the custom marshaler for LogProfileResource. 1811func (lpr LogProfileResource) MarshalJSON() ([]byte, error) { 1812 objectMap := make(map[string]interface{}) 1813 if lpr.LogProfileProperties != nil { 1814 objectMap["properties"] = lpr.LogProfileProperties 1815 } 1816 if lpr.ID != nil { 1817 objectMap["id"] = lpr.ID 1818 } 1819 if lpr.Name != nil { 1820 objectMap["name"] = lpr.Name 1821 } 1822 if lpr.Type != nil { 1823 objectMap["type"] = lpr.Type 1824 } 1825 if lpr.Location != nil { 1826 objectMap["location"] = lpr.Location 1827 } 1828 if lpr.Tags != nil { 1829 objectMap["tags"] = lpr.Tags 1830 } 1831 return json.Marshal(objectMap) 1832} 1833 1834// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1835// UnmarshalJSON is the custom unmarshaler for LogProfileResource struct. 1836func (lpr *LogProfileResource) UnmarshalJSON(body []byte) error { 1837 var m map[string]*json.RawMessage 1838 err := json.Unmarshal(body, &m) 1839 if err != nil { 1840 return err 1841 } 1842 for k, v := range m { 1843 switch k { 1844 case "properties": 1845 if v != nil { 1846 var logProfileProperties LogProfileProperties 1847 err = json.Unmarshal(*v, &logProfileProperties) 1848 if err != nil { 1849 return err 1850 } 1851 lpr.LogProfileProperties = &logProfileProperties 1852 } 1853 case "id": 1854 if v != nil { 1855 var ID string 1856 err = json.Unmarshal(*v, &ID) 1857 if err != nil { 1858 return err 1859 } 1860 lpr.ID = &ID 1861 } 1862 case "name": 1863 if v != nil { 1864 var name string 1865 err = json.Unmarshal(*v, &name) 1866 if err != nil { 1867 return err 1868 } 1869 lpr.Name = &name 1870 } 1871 case "type": 1872 if v != nil { 1873 var typeVar string 1874 err = json.Unmarshal(*v, &typeVar) 1875 if err != nil { 1876 return err 1877 } 1878 lpr.Type = &typeVar 1879 } 1880 case "location": 1881 if v != nil { 1882 var location string 1883 err = json.Unmarshal(*v, &location) 1884 if err != nil { 1885 return err 1886 } 1887 lpr.Location = &location 1888 } 1889 case "tags": 1890 if v != nil { 1891 var tags map[string]*string 1892 err = json.Unmarshal(*v, &tags) 1893 if err != nil { 1894 return err 1895 } 1896 lpr.Tags = tags 1897 } 1898 } 1899 } 1900 1901 return nil 1902} 1903 1904// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1905// LogProfileResourcePatch the log profile resource for patch operations. 1906type LogProfileResourcePatch struct { 1907 // Tags - Resource tags 1908 Tags map[string]*string `json:"tags"` 1909 // LogProfileProperties - The log profile properties for an update operation. 1910 *LogProfileProperties `json:"properties,omitempty"` 1911} 1912 1913// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1914// MarshalJSON is the custom marshaler for LogProfileResourcePatch. 1915func (lprp LogProfileResourcePatch) MarshalJSON() ([]byte, error) { 1916 objectMap := make(map[string]interface{}) 1917 if lprp.Tags != nil { 1918 objectMap["tags"] = lprp.Tags 1919 } 1920 if lprp.LogProfileProperties != nil { 1921 objectMap["properties"] = lprp.LogProfileProperties 1922 } 1923 return json.Marshal(objectMap) 1924} 1925 1926// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1927// UnmarshalJSON is the custom unmarshaler for LogProfileResourcePatch struct. 1928func (lprp *LogProfileResourcePatch) UnmarshalJSON(body []byte) error { 1929 var m map[string]*json.RawMessage 1930 err := json.Unmarshal(body, &m) 1931 if err != nil { 1932 return err 1933 } 1934 for k, v := range m { 1935 switch k { 1936 case "tags": 1937 if v != nil { 1938 var tags map[string]*string 1939 err = json.Unmarshal(*v, &tags) 1940 if err != nil { 1941 return err 1942 } 1943 lprp.Tags = tags 1944 } 1945 case "properties": 1946 if v != nil { 1947 var logProfileProperties LogProfileProperties 1948 err = json.Unmarshal(*v, &logProfileProperties) 1949 if err != nil { 1950 return err 1951 } 1952 lprp.LogProfileProperties = &logProfileProperties 1953 } 1954 } 1955 } 1956 1957 return nil 1958} 1959 1960// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1961// LogSettings part of MultiTenantDiagnosticSettings. Specifies the settings for a particular log. 1962type LogSettings struct { 1963 // 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. 1964 Category *string `json:"category,omitempty"` 1965 // Enabled - a value indicating whether this log is enabled. 1966 Enabled *bool `json:"enabled,omitempty"` 1967 // RetentionPolicy - the retention policy for this log. 1968 RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"` 1969} 1970 1971// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1972// ManagementEventAggregationCondition how the data that is collected should be combined over time. 1973type ManagementEventAggregationCondition struct { 1974 // Operator - the condition operator. Possible values include: 'ConditionOperatorGreaterThan', 'ConditionOperatorGreaterThanOrEqual', 'ConditionOperatorLessThan', 'ConditionOperatorLessThanOrEqual' 1975 Operator ConditionOperator `json:"operator,omitempty"` 1976 // Threshold - The threshold value that activates the alert. 1977 Threshold *float64 `json:"threshold,omitempty"` 1978 // 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. 1979 WindowSize *string `json:"windowSize,omitempty"` 1980} 1981 1982// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1983// ManagementEventRuleCondition a management event rule condition. 1984type ManagementEventRuleCondition struct { 1985 // 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. 1986 Aggregation *ManagementEventAggregationCondition `json:"aggregation,omitempty"` 1987 // DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource. 1988 DataSource BasicRuleDataSource `json:"dataSource,omitempty"` 1989 // OdataType - Possible values include: 'OdataTypeRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition' 1990 OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"` 1991} 1992 1993// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 1994// MarshalJSON is the custom marshaler for ManagementEventRuleCondition. 1995func (merc ManagementEventRuleCondition) MarshalJSON() ([]byte, error) { 1996 merc.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition 1997 objectMap := make(map[string]interface{}) 1998 if merc.Aggregation != nil { 1999 objectMap["aggregation"] = merc.Aggregation 2000 } 2001 objectMap["dataSource"] = merc.DataSource 2002 if merc.OdataType != "" { 2003 objectMap["odata.type"] = merc.OdataType 2004 } 2005 return json.Marshal(objectMap) 2006} 2007 2008// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2009// AsThresholdRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition. 2010func (merc ManagementEventRuleCondition) AsThresholdRuleCondition() (*ThresholdRuleCondition, bool) { 2011 return nil, false 2012} 2013 2014// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2015// AsLocationThresholdRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition. 2016func (merc ManagementEventRuleCondition) AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool) { 2017 return nil, false 2018} 2019 2020// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2021// AsManagementEventRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition. 2022func (merc ManagementEventRuleCondition) AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool) { 2023 return &merc, true 2024} 2025 2026// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2027// AsRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition. 2028func (merc ManagementEventRuleCondition) AsRuleCondition() (*RuleCondition, bool) { 2029 return nil, false 2030} 2031 2032// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2033// AsBasicRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition. 2034func (merc ManagementEventRuleCondition) AsBasicRuleCondition() (BasicRuleCondition, bool) { 2035 return &merc, true 2036} 2037 2038// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2039// UnmarshalJSON is the custom unmarshaler for ManagementEventRuleCondition struct. 2040func (merc *ManagementEventRuleCondition) UnmarshalJSON(body []byte) error { 2041 var m map[string]*json.RawMessage 2042 err := json.Unmarshal(body, &m) 2043 if err != nil { 2044 return err 2045 } 2046 for k, v := range m { 2047 switch k { 2048 case "aggregation": 2049 if v != nil { 2050 var aggregation ManagementEventAggregationCondition 2051 err = json.Unmarshal(*v, &aggregation) 2052 if err != nil { 2053 return err 2054 } 2055 merc.Aggregation = &aggregation 2056 } 2057 case "dataSource": 2058 if v != nil { 2059 dataSource, err := unmarshalBasicRuleDataSource(*v) 2060 if err != nil { 2061 return err 2062 } 2063 merc.DataSource = dataSource 2064 } 2065 case "odata.type": 2066 if v != nil { 2067 var odataType OdataTypeBasicRuleCondition 2068 err = json.Unmarshal(*v, &odataType) 2069 if err != nil { 2070 return err 2071 } 2072 merc.OdataType = odataType 2073 } 2074 } 2075 } 2076 2077 return nil 2078} 2079 2080// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2081// MetricSettings part of MultiTenantDiagnosticSettings. Specifies the settings for a particular metric. 2082type MetricSettings struct { 2083 // TimeGrain - the timegrain of the metric in ISO8601 format. 2084 TimeGrain *string `json:"timeGrain,omitempty"` 2085 // 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. 2086 Category *string `json:"category,omitempty"` 2087 // Enabled - a value indicating whether this category is enabled. 2088 Enabled *bool `json:"enabled,omitempty"` 2089 // RetentionPolicy - the retention policy for this category. 2090 RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"` 2091} 2092 2093// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2094// MetricTrigger the trigger that results in a scaling action. 2095type MetricTrigger struct { 2096 // MetricName - the name of the metric that defines what the rule monitors. 2097 MetricName *string `json:"metricName,omitempty"` 2098 // MetricResourceURI - the resource identifier of the resource the rule monitors. 2099 MetricResourceURI *string `json:"metricResourceUri,omitempty"` 2100 // 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. 2101 TimeGrain *string `json:"timeGrain,omitempty"` 2102 // Statistic - the metric statistic type. How the metrics from multiple instances are combined. Possible values include: 'Average', 'Min', 'Max', 'Sum' 2103 Statistic MetricStatisticType `json:"statistic,omitempty"` 2104 // 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. 2105 TimeWindow *string `json:"timeWindow,omitempty"` 2106 // 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' 2107 TimeAggregation TimeAggregationType `json:"timeAggregation,omitempty"` 2108 // Operator - the operator that is used to compare the metric data and the threshold. Possible values include: 'Equals', 'NotEquals', 'GreaterThan', 'GreaterThanOrEqual', 'LessThan', 'LessThanOrEqual' 2109 Operator ComparisonOperationType `json:"operator,omitempty"` 2110 // Threshold - the threshold of the metric that triggers the scale action. 2111 Threshold *float64 `json:"threshold,omitempty"` 2112} 2113 2114// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2115// Operation microsoft Insights API operation definition. 2116type Operation struct { 2117 // Name - Operation name: {provider}/{resource}/{operation} 2118 Name *string `json:"name,omitempty"` 2119 // Display - Display metadata associated with the operation. 2120 Display *OperationDisplay `json:"display,omitempty"` 2121} 2122 2123// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2124// OperationDisplay display metadata associated with the operation. 2125type OperationDisplay struct { 2126 // Provider - Service provider: Microsoft.Insights 2127 Provider *string `json:"provider,omitempty"` 2128 // Resource - Resource on which the operation is performed: AlertRules, Autoscale, etc. 2129 Resource *string `json:"resource,omitempty"` 2130 // Operation - Operation type: Read, write, delete, etc. 2131 Operation *string `json:"operation,omitempty"` 2132} 2133 2134// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2135// OperationListResult result of the request to list Microsoft.Insights operations. It contains a list of 2136// operations and a URL link to get the next set of results. 2137type OperationListResult struct { 2138 autorest.Response `json:"-"` 2139 // Value - List of operations supported by the Microsoft.Insights provider. 2140 Value *[]Operation `json:"value,omitempty"` 2141 // NextLink - URL to get the next set of operation list results if there are any. 2142 NextLink *string `json:"nextLink,omitempty"` 2143} 2144 2145// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2146// ProxyOnlyResource a proxy only azure resource object 2147type ProxyOnlyResource struct { 2148 // ID - Azure resource Id 2149 ID *string `json:"id,omitempty"` 2150 // Name - Azure resource name 2151 Name *string `json:"name,omitempty"` 2152 // Type - Azure resource type 2153 Type *string `json:"type,omitempty"` 2154} 2155 2156// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2157// Recurrence the repeating times at which this profile begins. This element is not used if the FixedDate element 2158// is used. 2159type Recurrence struct { 2160 // 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. Possible values include: 'None', 'Second', 'Minute', 'Hour', 'Day', 'Week', 'Month', 'Year' 2161 Frequency RecurrenceFrequency `json:"frequency,omitempty"` 2162 // Schedule - the scheduling constraints for when the profile begins. 2163 Schedule *RecurrentSchedule `json:"schedule,omitempty"` 2164} 2165 2166// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2167// RecurrentSchedule the scheduling constraints for when the profile begins. 2168type RecurrentSchedule struct { 2169 // TimeZone - the timezone for the hours of the profile. Some examples of valid timezones 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 2170 TimeZone *string `json:"timeZone,omitempty"` 2171 // Days - the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. 2172 Days *[]string `json:"days,omitempty"` 2173 // 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). 2174 Hours *[]int32 `json:"hours,omitempty"` 2175 // Minutes - A collection of minutes at which the profile takes effect at. 2176 Minutes *[]int32 `json:"minutes,omitempty"` 2177} 2178 2179// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2180// Resource an azure resource object 2181type Resource struct { 2182 // ID - Azure resource Id 2183 ID *string `json:"id,omitempty"` 2184 // Name - Azure resource name 2185 Name *string `json:"name,omitempty"` 2186 // Type - Azure resource type 2187 Type *string `json:"type,omitempty"` 2188 // Location - Resource location 2189 Location *string `json:"location,omitempty"` 2190 // Tags - Resource tags 2191 Tags map[string]*string `json:"tags"` 2192} 2193 2194// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2195// MarshalJSON is the custom marshaler for Resource. 2196func (r Resource) MarshalJSON() ([]byte, error) { 2197 objectMap := make(map[string]interface{}) 2198 if r.ID != nil { 2199 objectMap["id"] = r.ID 2200 } 2201 if r.Name != nil { 2202 objectMap["name"] = r.Name 2203 } 2204 if r.Type != nil { 2205 objectMap["type"] = r.Type 2206 } 2207 if r.Location != nil { 2208 objectMap["location"] = r.Location 2209 } 2210 if r.Tags != nil { 2211 objectMap["tags"] = r.Tags 2212 } 2213 return json.Marshal(objectMap) 2214} 2215 2216// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2217// RetentionPolicy specifies the retention policy for the log. 2218type RetentionPolicy struct { 2219 // Enabled - a value indicating whether the retention policy is enabled. 2220 Enabled *bool `json:"enabled,omitempty"` 2221 // Days - the number of days for the retention in days. A value of 0 will retain the events indefinitely. 2222 Days *int32 `json:"days,omitempty"` 2223} 2224 2225// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2226// BasicRuleAction the action that is performed when the alert rule becomes active, and when an alert condition is 2227// resolved. 2228type BasicRuleAction interface { 2229 AsRuleEmailAction() (*RuleEmailAction, bool) 2230 AsRuleWebhookAction() (*RuleWebhookAction, bool) 2231 AsRuleAction() (*RuleAction, bool) 2232} 2233 2234// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2235// RuleAction the action that is performed when the alert rule becomes active, and when an alert condition is 2236// resolved. 2237type RuleAction struct { 2238 // OdataType - Possible values include: 'OdataTypeRuleAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction' 2239 OdataType OdataTypeBasicRuleAction `json:"odata.type,omitempty"` 2240} 2241 2242func unmarshalBasicRuleAction(body []byte) (BasicRuleAction, error) { 2243 var m map[string]interface{} 2244 err := json.Unmarshal(body, &m) 2245 if err != nil { 2246 return nil, err 2247 } 2248 2249 switch m["odata.type"] { 2250 case string(OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction): 2251 var rea RuleEmailAction 2252 err := json.Unmarshal(body, &rea) 2253 return rea, err 2254 case string(OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction): 2255 var rwa RuleWebhookAction 2256 err := json.Unmarshal(body, &rwa) 2257 return rwa, err 2258 default: 2259 var ra RuleAction 2260 err := json.Unmarshal(body, &ra) 2261 return ra, err 2262 } 2263} 2264func unmarshalBasicRuleActionArray(body []byte) ([]BasicRuleAction, error) { 2265 var rawMessages []*json.RawMessage 2266 err := json.Unmarshal(body, &rawMessages) 2267 if err != nil { 2268 return nil, err 2269 } 2270 2271 raArray := make([]BasicRuleAction, len(rawMessages)) 2272 2273 for index, rawMessage := range rawMessages { 2274 ra, err := unmarshalBasicRuleAction(*rawMessage) 2275 if err != nil { 2276 return nil, err 2277 } 2278 raArray[index] = ra 2279 } 2280 return raArray, nil 2281} 2282 2283// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2284// MarshalJSON is the custom marshaler for RuleAction. 2285func (ra RuleAction) MarshalJSON() ([]byte, error) { 2286 ra.OdataType = OdataTypeRuleAction 2287 objectMap := make(map[string]interface{}) 2288 if ra.OdataType != "" { 2289 objectMap["odata.type"] = ra.OdataType 2290 } 2291 return json.Marshal(objectMap) 2292} 2293 2294// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2295// AsRuleEmailAction is the BasicRuleAction implementation for RuleAction. 2296func (ra RuleAction) AsRuleEmailAction() (*RuleEmailAction, bool) { 2297 return nil, false 2298} 2299 2300// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2301// AsRuleWebhookAction is the BasicRuleAction implementation for RuleAction. 2302func (ra RuleAction) AsRuleWebhookAction() (*RuleWebhookAction, bool) { 2303 return nil, false 2304} 2305 2306// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2307// AsRuleAction is the BasicRuleAction implementation for RuleAction. 2308func (ra RuleAction) AsRuleAction() (*RuleAction, bool) { 2309 return &ra, true 2310} 2311 2312// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2313// AsBasicRuleAction is the BasicRuleAction implementation for RuleAction. 2314func (ra RuleAction) AsBasicRuleAction() (BasicRuleAction, bool) { 2315 return &ra, true 2316} 2317 2318// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2319// BasicRuleCondition the condition that results in the alert rule being activated. 2320type BasicRuleCondition interface { 2321 AsThresholdRuleCondition() (*ThresholdRuleCondition, bool) 2322 AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool) 2323 AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool) 2324 AsRuleCondition() (*RuleCondition, bool) 2325} 2326 2327// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2328// RuleCondition the condition that results in the alert rule being activated. 2329type RuleCondition struct { 2330 // DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource. 2331 DataSource BasicRuleDataSource `json:"dataSource,omitempty"` 2332 // OdataType - Possible values include: 'OdataTypeRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition' 2333 OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"` 2334} 2335 2336func unmarshalBasicRuleCondition(body []byte) (BasicRuleCondition, error) { 2337 var m map[string]interface{} 2338 err := json.Unmarshal(body, &m) 2339 if err != nil { 2340 return nil, err 2341 } 2342 2343 switch m["odata.type"] { 2344 case string(OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition): 2345 var trc ThresholdRuleCondition 2346 err := json.Unmarshal(body, &trc) 2347 return trc, err 2348 case string(OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition): 2349 var ltrc LocationThresholdRuleCondition 2350 err := json.Unmarshal(body, <rc) 2351 return ltrc, err 2352 case string(OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition): 2353 var merc ManagementEventRuleCondition 2354 err := json.Unmarshal(body, &merc) 2355 return merc, err 2356 default: 2357 var rc RuleCondition 2358 err := json.Unmarshal(body, &rc) 2359 return rc, err 2360 } 2361} 2362func unmarshalBasicRuleConditionArray(body []byte) ([]BasicRuleCondition, error) { 2363 var rawMessages []*json.RawMessage 2364 err := json.Unmarshal(body, &rawMessages) 2365 if err != nil { 2366 return nil, err 2367 } 2368 2369 rcArray := make([]BasicRuleCondition, len(rawMessages)) 2370 2371 for index, rawMessage := range rawMessages { 2372 rc, err := unmarshalBasicRuleCondition(*rawMessage) 2373 if err != nil { 2374 return nil, err 2375 } 2376 rcArray[index] = rc 2377 } 2378 return rcArray, nil 2379} 2380 2381// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2382// MarshalJSON is the custom marshaler for RuleCondition. 2383func (rc RuleCondition) MarshalJSON() ([]byte, error) { 2384 rc.OdataType = OdataTypeRuleCondition 2385 objectMap := make(map[string]interface{}) 2386 objectMap["dataSource"] = rc.DataSource 2387 if rc.OdataType != "" { 2388 objectMap["odata.type"] = rc.OdataType 2389 } 2390 return json.Marshal(objectMap) 2391} 2392 2393// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2394// AsThresholdRuleCondition is the BasicRuleCondition implementation for RuleCondition. 2395func (rc RuleCondition) AsThresholdRuleCondition() (*ThresholdRuleCondition, bool) { 2396 return nil, false 2397} 2398 2399// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2400// AsLocationThresholdRuleCondition is the BasicRuleCondition implementation for RuleCondition. 2401func (rc RuleCondition) AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool) { 2402 return nil, false 2403} 2404 2405// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2406// AsManagementEventRuleCondition is the BasicRuleCondition implementation for RuleCondition. 2407func (rc RuleCondition) AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool) { 2408 return nil, false 2409} 2410 2411// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2412// AsRuleCondition is the BasicRuleCondition implementation for RuleCondition. 2413func (rc RuleCondition) AsRuleCondition() (*RuleCondition, bool) { 2414 return &rc, true 2415} 2416 2417// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2418// AsBasicRuleCondition is the BasicRuleCondition implementation for RuleCondition. 2419func (rc RuleCondition) AsBasicRuleCondition() (BasicRuleCondition, bool) { 2420 return &rc, true 2421} 2422 2423// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2424// UnmarshalJSON is the custom unmarshaler for RuleCondition struct. 2425func (rc *RuleCondition) UnmarshalJSON(body []byte) error { 2426 var m map[string]*json.RawMessage 2427 err := json.Unmarshal(body, &m) 2428 if err != nil { 2429 return err 2430 } 2431 for k, v := range m { 2432 switch k { 2433 case "dataSource": 2434 if v != nil { 2435 dataSource, err := unmarshalBasicRuleDataSource(*v) 2436 if err != nil { 2437 return err 2438 } 2439 rc.DataSource = dataSource 2440 } 2441 case "odata.type": 2442 if v != nil { 2443 var odataType OdataTypeBasicRuleCondition 2444 err = json.Unmarshal(*v, &odataType) 2445 if err != nil { 2446 return err 2447 } 2448 rc.OdataType = odataType 2449 } 2450 } 2451 } 2452 2453 return nil 2454} 2455 2456// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2457// BasicRuleDataSource the resource from which the rule collects its data. 2458type BasicRuleDataSource interface { 2459 AsRuleMetricDataSource() (*RuleMetricDataSource, bool) 2460 AsRuleManagementEventDataSource() (*RuleManagementEventDataSource, bool) 2461 AsRuleDataSource() (*RuleDataSource, bool) 2462} 2463 2464// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2465// RuleDataSource the resource from which the rule collects its data. 2466type RuleDataSource struct { 2467 // ResourceURI - the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule. 2468 ResourceURI *string `json:"resourceUri,omitempty"` 2469 // OdataType - Possible values include: 'OdataTypeRuleDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource' 2470 OdataType OdataType `json:"odata.type,omitempty"` 2471} 2472 2473func unmarshalBasicRuleDataSource(body []byte) (BasicRuleDataSource, error) { 2474 var m map[string]interface{} 2475 err := json.Unmarshal(body, &m) 2476 if err != nil { 2477 return nil, err 2478 } 2479 2480 switch m["odata.type"] { 2481 case string(OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource): 2482 var rmds RuleMetricDataSource 2483 err := json.Unmarshal(body, &rmds) 2484 return rmds, err 2485 case string(OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource): 2486 var rmeds RuleManagementEventDataSource 2487 err := json.Unmarshal(body, &rmeds) 2488 return rmeds, err 2489 default: 2490 var rds RuleDataSource 2491 err := json.Unmarshal(body, &rds) 2492 return rds, err 2493 } 2494} 2495func unmarshalBasicRuleDataSourceArray(body []byte) ([]BasicRuleDataSource, error) { 2496 var rawMessages []*json.RawMessage 2497 err := json.Unmarshal(body, &rawMessages) 2498 if err != nil { 2499 return nil, err 2500 } 2501 2502 rdsArray := make([]BasicRuleDataSource, len(rawMessages)) 2503 2504 for index, rawMessage := range rawMessages { 2505 rds, err := unmarshalBasicRuleDataSource(*rawMessage) 2506 if err != nil { 2507 return nil, err 2508 } 2509 rdsArray[index] = rds 2510 } 2511 return rdsArray, nil 2512} 2513 2514// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2515// MarshalJSON is the custom marshaler for RuleDataSource. 2516func (rds RuleDataSource) MarshalJSON() ([]byte, error) { 2517 rds.OdataType = OdataTypeRuleDataSource 2518 objectMap := make(map[string]interface{}) 2519 if rds.ResourceURI != nil { 2520 objectMap["resourceUri"] = rds.ResourceURI 2521 } 2522 if rds.OdataType != "" { 2523 objectMap["odata.type"] = rds.OdataType 2524 } 2525 return json.Marshal(objectMap) 2526} 2527 2528// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2529// AsRuleMetricDataSource is the BasicRuleDataSource implementation for RuleDataSource. 2530func (rds RuleDataSource) AsRuleMetricDataSource() (*RuleMetricDataSource, bool) { 2531 return nil, false 2532} 2533 2534// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2535// AsRuleManagementEventDataSource is the BasicRuleDataSource implementation for RuleDataSource. 2536func (rds RuleDataSource) AsRuleManagementEventDataSource() (*RuleManagementEventDataSource, bool) { 2537 return nil, false 2538} 2539 2540// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2541// AsRuleDataSource is the BasicRuleDataSource implementation for RuleDataSource. 2542func (rds RuleDataSource) AsRuleDataSource() (*RuleDataSource, bool) { 2543 return &rds, true 2544} 2545 2546// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2547// AsBasicRuleDataSource is the BasicRuleDataSource implementation for RuleDataSource. 2548func (rds RuleDataSource) AsBasicRuleDataSource() (BasicRuleDataSource, bool) { 2549 return &rds, true 2550} 2551 2552// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2553// RuleEmailAction specifies the action to send email when the rule condition is evaluated. The discriminator is 2554// always RuleEmailAction in this case. 2555type RuleEmailAction struct { 2556 // SendToServiceOwners - Whether the administrators (service and co-administrators) of the service should be notified when the alert is activated. 2557 SendToServiceOwners *bool `json:"sendToServiceOwners,omitempty"` 2558 // CustomEmails - the list of administrator's custom email addresses to notify of the activation of the alert. 2559 CustomEmails *[]string `json:"customEmails,omitempty"` 2560 // OdataType - Possible values include: 'OdataTypeRuleAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction' 2561 OdataType OdataTypeBasicRuleAction `json:"odata.type,omitempty"` 2562} 2563 2564// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2565// MarshalJSON is the custom marshaler for RuleEmailAction. 2566func (rea RuleEmailAction) MarshalJSON() ([]byte, error) { 2567 rea.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction 2568 objectMap := make(map[string]interface{}) 2569 if rea.SendToServiceOwners != nil { 2570 objectMap["sendToServiceOwners"] = rea.SendToServiceOwners 2571 } 2572 if rea.CustomEmails != nil { 2573 objectMap["customEmails"] = rea.CustomEmails 2574 } 2575 if rea.OdataType != "" { 2576 objectMap["odata.type"] = rea.OdataType 2577 } 2578 return json.Marshal(objectMap) 2579} 2580 2581// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2582// AsRuleEmailAction is the BasicRuleAction implementation for RuleEmailAction. 2583func (rea RuleEmailAction) AsRuleEmailAction() (*RuleEmailAction, bool) { 2584 return &rea, true 2585} 2586 2587// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2588// AsRuleWebhookAction is the BasicRuleAction implementation for RuleEmailAction. 2589func (rea RuleEmailAction) AsRuleWebhookAction() (*RuleWebhookAction, bool) { 2590 return nil, false 2591} 2592 2593// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2594// AsRuleAction is the BasicRuleAction implementation for RuleEmailAction. 2595func (rea RuleEmailAction) AsRuleAction() (*RuleAction, bool) { 2596 return nil, false 2597} 2598 2599// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2600// AsBasicRuleAction is the BasicRuleAction implementation for RuleEmailAction. 2601func (rea RuleEmailAction) AsBasicRuleAction() (BasicRuleAction, bool) { 2602 return &rea, true 2603} 2604 2605// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2606// RuleManagementEventClaimsDataSource the claims for a rule management event data source. 2607type RuleManagementEventClaimsDataSource struct { 2608 // EmailAddress - the email address. 2609 EmailAddress *string `json:"emailAddress,omitempty"` 2610} 2611 2612// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2613// RuleManagementEventDataSource a rule management event data source. The discriminator fields is always 2614// RuleManagementEventDataSource in this case. 2615type RuleManagementEventDataSource struct { 2616 // EventName - the event name. 2617 EventName *string `json:"eventName,omitempty"` 2618 // EventSource - the event source. 2619 EventSource *string `json:"eventSource,omitempty"` 2620 // Level - the level. 2621 Level *string `json:"level,omitempty"` 2622 // OperationName - The name of the operation that should be checked for. If no name is provided, any operation will match. 2623 OperationName *string `json:"operationName,omitempty"` 2624 // ResourceGroupName - the resource group name. 2625 ResourceGroupName *string `json:"resourceGroupName,omitempty"` 2626 // ResourceProviderName - the resource provider name. 2627 ResourceProviderName *string `json:"resourceProviderName,omitempty"` 2628 // Status - The status of the operation that should be checked for. If no status is provided, any status will match. 2629 Status *string `json:"status,omitempty"` 2630 // SubStatus - the substatus. 2631 SubStatus *string `json:"subStatus,omitempty"` 2632 // Claims - the claims. 2633 Claims *RuleManagementEventClaimsDataSource `json:"claims,omitempty"` 2634 // ResourceURI - the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule. 2635 ResourceURI *string `json:"resourceUri,omitempty"` 2636 // OdataType - Possible values include: 'OdataTypeRuleDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource' 2637 OdataType OdataType `json:"odata.type,omitempty"` 2638} 2639 2640// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2641// MarshalJSON is the custom marshaler for RuleManagementEventDataSource. 2642func (rmeds RuleManagementEventDataSource) MarshalJSON() ([]byte, error) { 2643 rmeds.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource 2644 objectMap := make(map[string]interface{}) 2645 if rmeds.EventName != nil { 2646 objectMap["eventName"] = rmeds.EventName 2647 } 2648 if rmeds.EventSource != nil { 2649 objectMap["eventSource"] = rmeds.EventSource 2650 } 2651 if rmeds.Level != nil { 2652 objectMap["level"] = rmeds.Level 2653 } 2654 if rmeds.OperationName != nil { 2655 objectMap["operationName"] = rmeds.OperationName 2656 } 2657 if rmeds.ResourceGroupName != nil { 2658 objectMap["resourceGroupName"] = rmeds.ResourceGroupName 2659 } 2660 if rmeds.ResourceProviderName != nil { 2661 objectMap["resourceProviderName"] = rmeds.ResourceProviderName 2662 } 2663 if rmeds.Status != nil { 2664 objectMap["status"] = rmeds.Status 2665 } 2666 if rmeds.SubStatus != nil { 2667 objectMap["subStatus"] = rmeds.SubStatus 2668 } 2669 if rmeds.Claims != nil { 2670 objectMap["claims"] = rmeds.Claims 2671 } 2672 if rmeds.ResourceURI != nil { 2673 objectMap["resourceUri"] = rmeds.ResourceURI 2674 } 2675 if rmeds.OdataType != "" { 2676 objectMap["odata.type"] = rmeds.OdataType 2677 } 2678 return json.Marshal(objectMap) 2679} 2680 2681// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2682// AsRuleMetricDataSource is the BasicRuleDataSource implementation for RuleManagementEventDataSource. 2683func (rmeds RuleManagementEventDataSource) AsRuleMetricDataSource() (*RuleMetricDataSource, bool) { 2684 return nil, false 2685} 2686 2687// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2688// AsRuleManagementEventDataSource is the BasicRuleDataSource implementation for RuleManagementEventDataSource. 2689func (rmeds RuleManagementEventDataSource) AsRuleManagementEventDataSource() (*RuleManagementEventDataSource, bool) { 2690 return &rmeds, true 2691} 2692 2693// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2694// AsRuleDataSource is the BasicRuleDataSource implementation for RuleManagementEventDataSource. 2695func (rmeds RuleManagementEventDataSource) AsRuleDataSource() (*RuleDataSource, bool) { 2696 return nil, false 2697} 2698 2699// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2700// AsBasicRuleDataSource is the BasicRuleDataSource implementation for RuleManagementEventDataSource. 2701func (rmeds RuleManagementEventDataSource) AsBasicRuleDataSource() (BasicRuleDataSource, bool) { 2702 return &rmeds, true 2703} 2704 2705// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2706// RuleMetricDataSource a rule metric data source. The discriminator value is always RuleMetricDataSource in this 2707// case. 2708type RuleMetricDataSource struct { 2709 // MetricName - the name of the metric that defines what the rule monitors. 2710 MetricName *string `json:"metricName,omitempty"` 2711 // ResourceURI - the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule. 2712 ResourceURI *string `json:"resourceUri,omitempty"` 2713 // OdataType - Possible values include: 'OdataTypeRuleDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource' 2714 OdataType OdataType `json:"odata.type,omitempty"` 2715} 2716 2717// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2718// MarshalJSON is the custom marshaler for RuleMetricDataSource. 2719func (rmds RuleMetricDataSource) MarshalJSON() ([]byte, error) { 2720 rmds.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource 2721 objectMap := make(map[string]interface{}) 2722 if rmds.MetricName != nil { 2723 objectMap["metricName"] = rmds.MetricName 2724 } 2725 if rmds.ResourceURI != nil { 2726 objectMap["resourceUri"] = rmds.ResourceURI 2727 } 2728 if rmds.OdataType != "" { 2729 objectMap["odata.type"] = rmds.OdataType 2730 } 2731 return json.Marshal(objectMap) 2732} 2733 2734// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2735// AsRuleMetricDataSource is the BasicRuleDataSource implementation for RuleMetricDataSource. 2736func (rmds RuleMetricDataSource) AsRuleMetricDataSource() (*RuleMetricDataSource, bool) { 2737 return &rmds, true 2738} 2739 2740// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2741// AsRuleManagementEventDataSource is the BasicRuleDataSource implementation for RuleMetricDataSource. 2742func (rmds RuleMetricDataSource) AsRuleManagementEventDataSource() (*RuleManagementEventDataSource, bool) { 2743 return nil, false 2744} 2745 2746// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2747// AsRuleDataSource is the BasicRuleDataSource implementation for RuleMetricDataSource. 2748func (rmds RuleMetricDataSource) AsRuleDataSource() (*RuleDataSource, bool) { 2749 return nil, false 2750} 2751 2752// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2753// AsBasicRuleDataSource is the BasicRuleDataSource implementation for RuleMetricDataSource. 2754func (rmds RuleMetricDataSource) AsBasicRuleDataSource() (BasicRuleDataSource, bool) { 2755 return &rmds, true 2756} 2757 2758// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2759// RuleWebhookAction specifies the action to post to service when the rule condition is evaluated. The 2760// discriminator is always RuleWebhookAction in this case. 2761type RuleWebhookAction struct { 2762 // ServiceURI - the service uri to Post the notification when the alert activates or resolves. 2763 ServiceURI *string `json:"serviceUri,omitempty"` 2764 // Properties - the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. 2765 Properties map[string]*string `json:"properties"` 2766 // OdataType - Possible values include: 'OdataTypeRuleAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction' 2767 OdataType OdataTypeBasicRuleAction `json:"odata.type,omitempty"` 2768} 2769 2770// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2771// MarshalJSON is the custom marshaler for RuleWebhookAction. 2772func (rwa RuleWebhookAction) MarshalJSON() ([]byte, error) { 2773 rwa.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction 2774 objectMap := make(map[string]interface{}) 2775 if rwa.ServiceURI != nil { 2776 objectMap["serviceUri"] = rwa.ServiceURI 2777 } 2778 if rwa.Properties != nil { 2779 objectMap["properties"] = rwa.Properties 2780 } 2781 if rwa.OdataType != "" { 2782 objectMap["odata.type"] = rwa.OdataType 2783 } 2784 return json.Marshal(objectMap) 2785} 2786 2787// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2788// AsRuleEmailAction is the BasicRuleAction implementation for RuleWebhookAction. 2789func (rwa RuleWebhookAction) AsRuleEmailAction() (*RuleEmailAction, bool) { 2790 return nil, false 2791} 2792 2793// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2794// AsRuleWebhookAction is the BasicRuleAction implementation for RuleWebhookAction. 2795func (rwa RuleWebhookAction) AsRuleWebhookAction() (*RuleWebhookAction, bool) { 2796 return &rwa, true 2797} 2798 2799// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2800// AsRuleAction is the BasicRuleAction implementation for RuleWebhookAction. 2801func (rwa RuleWebhookAction) AsRuleAction() (*RuleAction, bool) { 2802 return nil, false 2803} 2804 2805// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2806// AsBasicRuleAction is the BasicRuleAction implementation for RuleWebhookAction. 2807func (rwa RuleWebhookAction) AsBasicRuleAction() (BasicRuleAction, bool) { 2808 return &rwa, true 2809} 2810 2811// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2812// ScaleAction the parameters for the scaling action. 2813type ScaleAction struct { 2814 // Direction - the scale direction. Whether the scaling action increases or decreases the number of instances. Possible values include: 'ScaleDirectionNone', 'ScaleDirectionIncrease', 'ScaleDirectionDecrease' 2815 Direction ScaleDirection `json:"direction,omitempty"` 2816 // Type - the type of action that should occur when the scale rule fires. Possible values include: 'ChangeCount', 'PercentChangeCount', 'ExactCount' 2817 Type ScaleType `json:"type,omitempty"` 2818 // Value - the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1. 2819 Value *string `json:"value,omitempty"` 2820 // 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. 2821 Cooldown *string `json:"cooldown,omitempty"` 2822} 2823 2824// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2825// ScaleCapacity the number of instances that can be used during this profile. 2826type ScaleCapacity struct { 2827 // Minimum - the minimum number of instances for the resource. 2828 Minimum *string `json:"minimum,omitempty"` 2829 // 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. 2830 Maximum *string `json:"maximum,omitempty"` 2831 // 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. 2832 Default *string `json:"default,omitempty"` 2833} 2834 2835// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2836// ScaleRule a rule that provide the triggers and parameters for the scaling action. 2837type ScaleRule struct { 2838 // MetricTrigger - the trigger that results in a scaling action. 2839 MetricTrigger *MetricTrigger `json:"metricTrigger,omitempty"` 2840 // ScaleAction - the parameters for the scaling action. 2841 ScaleAction *ScaleAction `json:"scaleAction,omitempty"` 2842} 2843 2844// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2845// SmsReceiver an SMS receiver. 2846type SmsReceiver struct { 2847 // Name - The name of the SMS receiver. Names must be unique across all receivers within an action group. 2848 Name *string `json:"name,omitempty"` 2849 // CountryCode - The country code of the SMS receiver. 2850 CountryCode *string `json:"countryCode,omitempty"` 2851 // PhoneNumber - The phone number of the SMS receiver. 2852 PhoneNumber *string `json:"phoneNumber,omitempty"` 2853 // Status - The status of the receiver. Possible values include: 'NotSpecified', 'Enabled', 'Disabled' 2854 Status ReceiverStatus `json:"status,omitempty"` 2855} 2856 2857// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2858// ThresholdRuleCondition a rule condition based on a metric crossing a threshold. 2859type ThresholdRuleCondition struct { 2860 // Operator - the operator used to compare the data and the threshold. Possible values include: 'ConditionOperatorGreaterThan', 'ConditionOperatorGreaterThanOrEqual', 'ConditionOperatorLessThan', 'ConditionOperatorLessThanOrEqual' 2861 Operator ConditionOperator `json:"operator,omitempty"` 2862 // Threshold - the threshold value that activates the alert. 2863 Threshold *float64 `json:"threshold,omitempty"` 2864 // 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. 2865 WindowSize *string `json:"windowSize,omitempty"` 2866 // 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' 2867 TimeAggregation TimeAggregationOperator `json:"timeAggregation,omitempty"` 2868 // DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource. 2869 DataSource BasicRuleDataSource `json:"dataSource,omitempty"` 2870 // OdataType - Possible values include: 'OdataTypeRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition' 2871 OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"` 2872} 2873 2874// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2875// MarshalJSON is the custom marshaler for ThresholdRuleCondition. 2876func (trc ThresholdRuleCondition) MarshalJSON() ([]byte, error) { 2877 trc.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition 2878 objectMap := make(map[string]interface{}) 2879 if trc.Operator != "" { 2880 objectMap["operator"] = trc.Operator 2881 } 2882 if trc.Threshold != nil { 2883 objectMap["threshold"] = trc.Threshold 2884 } 2885 if trc.WindowSize != nil { 2886 objectMap["windowSize"] = trc.WindowSize 2887 } 2888 if trc.TimeAggregation != "" { 2889 objectMap["timeAggregation"] = trc.TimeAggregation 2890 } 2891 objectMap["dataSource"] = trc.DataSource 2892 if trc.OdataType != "" { 2893 objectMap["odata.type"] = trc.OdataType 2894 } 2895 return json.Marshal(objectMap) 2896} 2897 2898// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2899// AsThresholdRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition. 2900func (trc ThresholdRuleCondition) AsThresholdRuleCondition() (*ThresholdRuleCondition, bool) { 2901 return &trc, true 2902} 2903 2904// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2905// AsLocationThresholdRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition. 2906func (trc ThresholdRuleCondition) AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool) { 2907 return nil, false 2908} 2909 2910// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2911// AsManagementEventRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition. 2912func (trc ThresholdRuleCondition) AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool) { 2913 return nil, false 2914} 2915 2916// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2917// AsRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition. 2918func (trc ThresholdRuleCondition) AsRuleCondition() (*RuleCondition, bool) { 2919 return nil, false 2920} 2921 2922// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2923// AsBasicRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition. 2924func (trc ThresholdRuleCondition) AsBasicRuleCondition() (BasicRuleCondition, bool) { 2925 return &trc, true 2926} 2927 2928// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2929// UnmarshalJSON is the custom unmarshaler for ThresholdRuleCondition struct. 2930func (trc *ThresholdRuleCondition) UnmarshalJSON(body []byte) error { 2931 var m map[string]*json.RawMessage 2932 err := json.Unmarshal(body, &m) 2933 if err != nil { 2934 return err 2935 } 2936 for k, v := range m { 2937 switch k { 2938 case "operator": 2939 if v != nil { 2940 var operator ConditionOperator 2941 err = json.Unmarshal(*v, &operator) 2942 if err != nil { 2943 return err 2944 } 2945 trc.Operator = operator 2946 } 2947 case "threshold": 2948 if v != nil { 2949 var threshold float64 2950 err = json.Unmarshal(*v, &threshold) 2951 if err != nil { 2952 return err 2953 } 2954 trc.Threshold = &threshold 2955 } 2956 case "windowSize": 2957 if v != nil { 2958 var windowSize string 2959 err = json.Unmarshal(*v, &windowSize) 2960 if err != nil { 2961 return err 2962 } 2963 trc.WindowSize = &windowSize 2964 } 2965 case "timeAggregation": 2966 if v != nil { 2967 var timeAggregation TimeAggregationOperator 2968 err = json.Unmarshal(*v, &timeAggregation) 2969 if err != nil { 2970 return err 2971 } 2972 trc.TimeAggregation = timeAggregation 2973 } 2974 case "dataSource": 2975 if v != nil { 2976 dataSource, err := unmarshalBasicRuleDataSource(*v) 2977 if err != nil { 2978 return err 2979 } 2980 trc.DataSource = dataSource 2981 } 2982 case "odata.type": 2983 if v != nil { 2984 var odataType OdataTypeBasicRuleCondition 2985 err = json.Unmarshal(*v, &odataType) 2986 if err != nil { 2987 return err 2988 } 2989 trc.OdataType = odataType 2990 } 2991 } 2992 } 2993 2994 return nil 2995} 2996 2997// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 2998// TimeWindow a specific date-time for the profile. 2999type TimeWindow struct { 3000 // TimeZone - the timezone of the start and end times for the profile. Some examples of valid timezones 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 3001 TimeZone *string `json:"timeZone,omitempty"` 3002 // Start - the start time for the profile in ISO 8601 format. 3003 Start *date.Time `json:"start,omitempty"` 3004 // End - the end time for the profile in ISO 8601 format. 3005 End *date.Time `json:"end,omitempty"` 3006} 3007 3008// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 3009// WebhookNotification webhook notification of an autoscale event. 3010type WebhookNotification struct { 3011 // ServiceURI - the service address to receive the notification. 3012 ServiceURI *string `json:"serviceUri,omitempty"` 3013 // Properties - a property bag of settings. This value can be empty. 3014 Properties map[string]*string `json:"properties"` 3015} 3016 3017// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 3018// MarshalJSON is the custom marshaler for WebhookNotification. 3019func (wn WebhookNotification) MarshalJSON() ([]byte, error) { 3020 objectMap := make(map[string]interface{}) 3021 if wn.ServiceURI != nil { 3022 objectMap["serviceUri"] = wn.ServiceURI 3023 } 3024 if wn.Properties != nil { 3025 objectMap["properties"] = wn.Properties 3026 } 3027 return json.Marshal(objectMap) 3028} 3029 3030// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2017-05-01-preview/insights instead. 3031// WebhookReceiver a webhook receiver. 3032type WebhookReceiver struct { 3033 // Name - The name of the webhook receiver. Names must be unique across all receivers within an action group. 3034 Name *string `json:"name,omitempty"` 3035 // ServiceURI - The URI where webhooks should be sent. 3036 ServiceURI *string `json:"serviceUri,omitempty"` 3037} 3038