1package insights 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 10 "context" 11 "encoding/json" 12 "github.com/Azure/go-autorest/autorest" 13 "github.com/Azure/go-autorest/autorest/azure" 14 "github.com/Azure/go-autorest/autorest/date" 15 "github.com/Azure/go-autorest/autorest/to" 16 "github.com/Azure/go-autorest/tracing" 17 "net/http" 18) 19 20// The package's fully qualified name. 21const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/monitor/mgmt/2021-07-01-preview/insights" 22 23// BasicAction action descriptor. 24type BasicAction interface { 25 AsAlertingAction() (*AlertingAction, bool) 26 AsLogToMetricAction() (*LogToMetricAction, bool) 27 AsAction() (*Action, bool) 28} 29 30// Action action descriptor. 31type Action struct { 32 // OdataType - Possible values include: 'OdataTypeBasicActionOdataTypeAction', 'OdataTypeBasicActionOdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction', 'OdataTypeBasicActionOdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction' 33 OdataType OdataTypeBasicAction `json:"odata.type,omitempty"` 34} 35 36func unmarshalBasicAction(body []byte) (BasicAction, error) { 37 var m map[string]interface{} 38 err := json.Unmarshal(body, &m) 39 if err != nil { 40 return nil, err 41 } 42 43 switch m["odata.type"] { 44 case string(OdataTypeBasicActionOdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction): 45 var aa AlertingAction 46 err := json.Unmarshal(body, &aa) 47 return aa, err 48 case string(OdataTypeBasicActionOdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction): 49 var ltma LogToMetricAction 50 err := json.Unmarshal(body, <ma) 51 return ltma, err 52 default: 53 var a Action 54 err := json.Unmarshal(body, &a) 55 return a, err 56 } 57} 58func unmarshalBasicActionArray(body []byte) ([]BasicAction, error) { 59 var rawMessages []*json.RawMessage 60 err := json.Unmarshal(body, &rawMessages) 61 if err != nil { 62 return nil, err 63 } 64 65 aArray := make([]BasicAction, len(rawMessages)) 66 67 for index, rawMessage := range rawMessages { 68 a, err := unmarshalBasicAction(*rawMessage) 69 if err != nil { 70 return nil, err 71 } 72 aArray[index] = a 73 } 74 return aArray, nil 75} 76 77// MarshalJSON is the custom marshaler for Action. 78func (a Action) MarshalJSON() ([]byte, error) { 79 a.OdataType = OdataTypeBasicActionOdataTypeAction 80 objectMap := make(map[string]interface{}) 81 if a.OdataType != "" { 82 objectMap["odata.type"] = a.OdataType 83 } 84 return json.Marshal(objectMap) 85} 86 87// AsAlertingAction is the BasicAction implementation for Action. 88func (a Action) AsAlertingAction() (*AlertingAction, bool) { 89 return nil, false 90} 91 92// AsLogToMetricAction is the BasicAction implementation for Action. 93func (a Action) AsLogToMetricAction() (*LogToMetricAction, bool) { 94 return nil, false 95} 96 97// AsAction is the BasicAction implementation for Action. 98func (a Action) AsAction() (*Action, bool) { 99 return &a, true 100} 101 102// AsBasicAction is the BasicAction implementation for Action. 103func (a Action) AsBasicAction() (BasicAction, bool) { 104 return &a, true 105} 106 107// ActionGroup an Azure action group. 108type ActionGroup struct { 109 // GroupShortName - The short name of the action group. This will be used in SMS messages. 110 GroupShortName *string `json:"groupShortName,omitempty"` 111 // Enabled - Indicates whether this action group is enabled. If an action group is not enabled, then none of its receivers will receive communications. 112 Enabled *bool `json:"enabled,omitempty"` 113 // EmailReceivers - The list of email receivers that are part of this action group. 114 EmailReceivers *[]EmailReceiver `json:"emailReceivers,omitempty"` 115 // SmsReceivers - The list of SMS receivers that are part of this action group. 116 SmsReceivers *[]SmsReceiver `json:"smsReceivers,omitempty"` 117 // WebhookReceivers - The list of webhook receivers that are part of this action group. 118 WebhookReceivers *[]WebhookReceiver `json:"webhookReceivers,omitempty"` 119 // ItsmReceivers - The list of ITSM receivers that are part of this action group. 120 ItsmReceivers *[]ItsmReceiver `json:"itsmReceivers,omitempty"` 121 // AzureAppPushReceivers - The list of AzureAppPush receivers that are part of this action group. 122 AzureAppPushReceivers *[]AzureAppPushReceiver `json:"azureAppPushReceivers,omitempty"` 123 // AutomationRunbookReceivers - The list of AutomationRunbook receivers that are part of this action group. 124 AutomationRunbookReceivers *[]AutomationRunbookReceiver `json:"automationRunbookReceivers,omitempty"` 125 // VoiceReceivers - The list of voice receivers that are part of this action group. 126 VoiceReceivers *[]VoiceReceiver `json:"voiceReceivers,omitempty"` 127 // LogicAppReceivers - The list of logic app receivers that are part of this action group. 128 LogicAppReceivers *[]LogicAppReceiver `json:"logicAppReceivers,omitempty"` 129 // AzureFunctionReceivers - The list of azure function receivers that are part of this action group. 130 AzureFunctionReceivers *[]AzureFunctionReceiver `json:"azureFunctionReceivers,omitempty"` 131 // ArmRoleReceivers - The list of ARM role receivers that are part of this action group. Roles are Azure RBAC roles and only built-in roles are supported. 132 ArmRoleReceivers *[]ArmRoleReceiver `json:"armRoleReceivers,omitempty"` 133} 134 135// ActionGroupList a list of action groups. 136type ActionGroupList struct { 137 autorest.Response `json:"-"` 138 // Value - The list of action groups. 139 Value *[]ActionGroupResource `json:"value,omitempty"` 140 // NextLink - Provides the link to retrieve the next set of elements. 141 NextLink *string `json:"nextLink,omitempty"` 142} 143 144// ActionGroupPatch an Azure action group for patch operations. 145type ActionGroupPatch struct { 146 // Enabled - Indicates whether this action group is enabled. If an action group is not enabled, then none of its actions will be activated. 147 Enabled *bool `json:"enabled,omitempty"` 148} 149 150// ActionGroupPatchBody an action group object for the body of patch operations. 151type ActionGroupPatchBody struct { 152 // Tags - Resource tags 153 Tags map[string]*string `json:"tags"` 154 // ActionGroupPatch - The action group settings for an update operation. 155 *ActionGroupPatch `json:"properties,omitempty"` 156} 157 158// MarshalJSON is the custom marshaler for ActionGroupPatchBody. 159func (agpb ActionGroupPatchBody) MarshalJSON() ([]byte, error) { 160 objectMap := make(map[string]interface{}) 161 if agpb.Tags != nil { 162 objectMap["tags"] = agpb.Tags 163 } 164 if agpb.ActionGroupPatch != nil { 165 objectMap["properties"] = agpb.ActionGroupPatch 166 } 167 return json.Marshal(objectMap) 168} 169 170// UnmarshalJSON is the custom unmarshaler for ActionGroupPatchBody struct. 171func (agpb *ActionGroupPatchBody) UnmarshalJSON(body []byte) error { 172 var m map[string]*json.RawMessage 173 err := json.Unmarshal(body, &m) 174 if err != nil { 175 return err 176 } 177 for k, v := range m { 178 switch k { 179 case "tags": 180 if v != nil { 181 var tags map[string]*string 182 err = json.Unmarshal(*v, &tags) 183 if err != nil { 184 return err 185 } 186 agpb.Tags = tags 187 } 188 case "properties": 189 if v != nil { 190 var actionGroupPatch ActionGroupPatch 191 err = json.Unmarshal(*v, &actionGroupPatch) 192 if err != nil { 193 return err 194 } 195 agpb.ActionGroupPatch = &actionGroupPatch 196 } 197 } 198 } 199 200 return nil 201} 202 203// ActionGroupResource an action group resource. 204type ActionGroupResource struct { 205 autorest.Response `json:"-"` 206 // ActionGroup - The action groups properties of the resource. 207 *ActionGroup `json:"properties,omitempty"` 208 // ID - READ-ONLY; Azure resource Id 209 ID *string `json:"id,omitempty"` 210 // Name - READ-ONLY; Azure resource name 211 Name *string `json:"name,omitempty"` 212 // Type - READ-ONLY; Azure resource type 213 Type *string `json:"type,omitempty"` 214 // Kind - READ-ONLY; Azure resource kind 215 Kind *string `json:"kind,omitempty"` 216 // Identity - READ-ONLY; Azure resource identity 217 Identity *string `json:"identity,omitempty"` 218 // Location - Resource location 219 Location *string `json:"location,omitempty"` 220 // Tags - Resource tags 221 Tags map[string]*string `json:"tags"` 222} 223 224// MarshalJSON is the custom marshaler for ActionGroupResource. 225func (agr ActionGroupResource) MarshalJSON() ([]byte, error) { 226 objectMap := make(map[string]interface{}) 227 if agr.ActionGroup != nil { 228 objectMap["properties"] = agr.ActionGroup 229 } 230 if agr.Location != nil { 231 objectMap["location"] = agr.Location 232 } 233 if agr.Tags != nil { 234 objectMap["tags"] = agr.Tags 235 } 236 return json.Marshal(objectMap) 237} 238 239// UnmarshalJSON is the custom unmarshaler for ActionGroupResource struct. 240func (agr *ActionGroupResource) UnmarshalJSON(body []byte) error { 241 var m map[string]*json.RawMessage 242 err := json.Unmarshal(body, &m) 243 if err != nil { 244 return err 245 } 246 for k, v := range m { 247 switch k { 248 case "properties": 249 if v != nil { 250 var actionGroup ActionGroup 251 err = json.Unmarshal(*v, &actionGroup) 252 if err != nil { 253 return err 254 } 255 agr.ActionGroup = &actionGroup 256 } 257 case "id": 258 if v != nil { 259 var ID string 260 err = json.Unmarshal(*v, &ID) 261 if err != nil { 262 return err 263 } 264 agr.ID = &ID 265 } 266 case "name": 267 if v != nil { 268 var name string 269 err = json.Unmarshal(*v, &name) 270 if err != nil { 271 return err 272 } 273 agr.Name = &name 274 } 275 case "type": 276 if v != nil { 277 var typeVar string 278 err = json.Unmarshal(*v, &typeVar) 279 if err != nil { 280 return err 281 } 282 agr.Type = &typeVar 283 } 284 case "kind": 285 if v != nil { 286 var kind string 287 err = json.Unmarshal(*v, &kind) 288 if err != nil { 289 return err 290 } 291 agr.Kind = &kind 292 } 293 case "identity": 294 if v != nil { 295 var identity string 296 err = json.Unmarshal(*v, &identity) 297 if err != nil { 298 return err 299 } 300 agr.Identity = &identity 301 } 302 case "location": 303 if v != nil { 304 var location string 305 err = json.Unmarshal(*v, &location) 306 if err != nil { 307 return err 308 } 309 agr.Location = &location 310 } 311 case "tags": 312 if v != nil { 313 var tags map[string]*string 314 err = json.Unmarshal(*v, &tags) 315 if err != nil { 316 return err 317 } 318 agr.Tags = tags 319 } 320 } 321 } 322 323 return nil 324} 325 326// ActionList a list of Activity Log Alert rule actions. 327type ActionList struct { 328 // ActionGroups - The list of the Action Groups. 329 ActionGroups *[]ActionGroup `json:"actionGroups,omitempty"` 330} 331 332// ActivityLogAlertResource an Activity Log Alert rule resource. 333type ActivityLogAlertResource struct { 334 autorest.Response `json:"-"` 335 // AlertRuleProperties - The Activity Log Alert rule properties of the resource. 336 *AlertRuleProperties `json:"properties,omitempty"` 337 // ID - READ-ONLY; Azure resource Id 338 ID *string `json:"id,omitempty"` 339 // Name - READ-ONLY; Azure resource name 340 Name *string `json:"name,omitempty"` 341 // Type - READ-ONLY; Azure resource type 342 Type *string `json:"type,omitempty"` 343 // Kind - READ-ONLY; Azure resource kind 344 Kind *string `json:"kind,omitempty"` 345 // Identity - READ-ONLY; Azure resource identity 346 Identity *string `json:"identity,omitempty"` 347 // Location - Resource location 348 Location *string `json:"location,omitempty"` 349 // Tags - Resource tags 350 Tags map[string]*string `json:"tags"` 351} 352 353// MarshalJSON is the custom marshaler for ActivityLogAlertResource. 354func (alar ActivityLogAlertResource) MarshalJSON() ([]byte, error) { 355 objectMap := make(map[string]interface{}) 356 if alar.AlertRuleProperties != nil { 357 objectMap["properties"] = alar.AlertRuleProperties 358 } 359 if alar.Location != nil { 360 objectMap["location"] = alar.Location 361 } 362 if alar.Tags != nil { 363 objectMap["tags"] = alar.Tags 364 } 365 return json.Marshal(objectMap) 366} 367 368// UnmarshalJSON is the custom unmarshaler for ActivityLogAlertResource struct. 369func (alar *ActivityLogAlertResource) UnmarshalJSON(body []byte) error { 370 var m map[string]*json.RawMessage 371 err := json.Unmarshal(body, &m) 372 if err != nil { 373 return err 374 } 375 for k, v := range m { 376 switch k { 377 case "properties": 378 if v != nil { 379 var alertRuleProperties AlertRuleProperties 380 err = json.Unmarshal(*v, &alertRuleProperties) 381 if err != nil { 382 return err 383 } 384 alar.AlertRuleProperties = &alertRuleProperties 385 } 386 case "id": 387 if v != nil { 388 var ID string 389 err = json.Unmarshal(*v, &ID) 390 if err != nil { 391 return err 392 } 393 alar.ID = &ID 394 } 395 case "name": 396 if v != nil { 397 var name string 398 err = json.Unmarshal(*v, &name) 399 if err != nil { 400 return err 401 } 402 alar.Name = &name 403 } 404 case "type": 405 if v != nil { 406 var typeVar string 407 err = json.Unmarshal(*v, &typeVar) 408 if err != nil { 409 return err 410 } 411 alar.Type = &typeVar 412 } 413 case "kind": 414 if v != nil { 415 var kind string 416 err = json.Unmarshal(*v, &kind) 417 if err != nil { 418 return err 419 } 420 alar.Kind = &kind 421 } 422 case "identity": 423 if v != nil { 424 var identity string 425 err = json.Unmarshal(*v, &identity) 426 if err != nil { 427 return err 428 } 429 alar.Identity = &identity 430 } 431 case "location": 432 if v != nil { 433 var location string 434 err = json.Unmarshal(*v, &location) 435 if err != nil { 436 return err 437 } 438 alar.Location = &location 439 } 440 case "tags": 441 if v != nil { 442 var tags map[string]*string 443 err = json.Unmarshal(*v, &tags) 444 if err != nil { 445 return err 446 } 447 alar.Tags = tags 448 } 449 } 450 } 451 452 return nil 453} 454 455// AlertingAction specify action need to be taken when rule type is Alert 456type AlertingAction struct { 457 // Severity - Severity of the alert. Possible values include: 'AlertSeverityZero', 'AlertSeverityOne', 'AlertSeverityTwo', 'AlertSeverityThree', 'AlertSeverityFour' 458 Severity AlertSeverity `json:"severity,omitempty"` 459 // AznsAction - Azure action group reference. 460 AznsAction *AzNsActionGroup `json:"aznsAction,omitempty"` 461 // ThrottlingInMin - time (in minutes) for which Alerts should be throttled or suppressed. 462 ThrottlingInMin *int32 `json:"throttlingInMin,omitempty"` 463 // Trigger - The trigger condition that results in the alert rule being. 464 Trigger *TriggerCondition `json:"trigger,omitempty"` 465 // OdataType - Possible values include: 'OdataTypeBasicActionOdataTypeAction', 'OdataTypeBasicActionOdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction', 'OdataTypeBasicActionOdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction' 466 OdataType OdataTypeBasicAction `json:"odata.type,omitempty"` 467} 468 469// MarshalJSON is the custom marshaler for AlertingAction. 470func (aa AlertingAction) MarshalJSON() ([]byte, error) { 471 aa.OdataType = OdataTypeBasicActionOdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction 472 objectMap := make(map[string]interface{}) 473 if aa.Severity != "" { 474 objectMap["severity"] = aa.Severity 475 } 476 if aa.AznsAction != nil { 477 objectMap["aznsAction"] = aa.AznsAction 478 } 479 if aa.ThrottlingInMin != nil { 480 objectMap["throttlingInMin"] = aa.ThrottlingInMin 481 } 482 if aa.Trigger != nil { 483 objectMap["trigger"] = aa.Trigger 484 } 485 if aa.OdataType != "" { 486 objectMap["odata.type"] = aa.OdataType 487 } 488 return json.Marshal(objectMap) 489} 490 491// AsAlertingAction is the BasicAction implementation for AlertingAction. 492func (aa AlertingAction) AsAlertingAction() (*AlertingAction, bool) { 493 return &aa, true 494} 495 496// AsLogToMetricAction is the BasicAction implementation for AlertingAction. 497func (aa AlertingAction) AsLogToMetricAction() (*LogToMetricAction, bool) { 498 return nil, false 499} 500 501// AsAction is the BasicAction implementation for AlertingAction. 502func (aa AlertingAction) AsAction() (*Action, bool) { 503 return nil, false 504} 505 506// AsBasicAction is the BasicAction implementation for AlertingAction. 507func (aa AlertingAction) AsBasicAction() (BasicAction, bool) { 508 return &aa, true 509} 510 511// AlertRule an alert rule. 512type AlertRule struct { 513 // Name - the name of the alert rule. 514 Name *string `json:"name,omitempty"` 515 // Description - the description of the alert rule that will be included in the alert email. 516 Description *string `json:"description,omitempty"` 517 // ProvisioningState - the provisioning state. 518 ProvisioningState *string `json:"provisioningState,omitempty"` 519 // IsEnabled - the flag that indicates whether the alert rule is enabled. 520 IsEnabled *bool `json:"isEnabled,omitempty"` 521 // Condition - the condition that results in the alert rule being activated. 522 Condition BasicRuleCondition `json:"condition,omitempty"` 523 // Action - action that is performed when the alert rule becomes active, and when an alert condition is resolved. 524 Action BasicRuleAction `json:"action,omitempty"` 525 // Actions - the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. 526 Actions *[]BasicRuleAction `json:"actions,omitempty"` 527 // LastUpdatedTime - READ-ONLY; Last time the rule was updated in ISO8601 format. 528 LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` 529} 530 531// MarshalJSON is the custom marshaler for AlertRule. 532func (ar AlertRule) MarshalJSON() ([]byte, error) { 533 objectMap := make(map[string]interface{}) 534 if ar.Name != nil { 535 objectMap["name"] = ar.Name 536 } 537 if ar.Description != nil { 538 objectMap["description"] = ar.Description 539 } 540 if ar.ProvisioningState != nil { 541 objectMap["provisioningState"] = ar.ProvisioningState 542 } 543 if ar.IsEnabled != nil { 544 objectMap["isEnabled"] = ar.IsEnabled 545 } 546 objectMap["condition"] = ar.Condition 547 objectMap["action"] = ar.Action 548 if ar.Actions != nil { 549 objectMap["actions"] = ar.Actions 550 } 551 return json.Marshal(objectMap) 552} 553 554// UnmarshalJSON is the custom unmarshaler for AlertRule struct. 555func (ar *AlertRule) UnmarshalJSON(body []byte) error { 556 var m map[string]*json.RawMessage 557 err := json.Unmarshal(body, &m) 558 if err != nil { 559 return err 560 } 561 for k, v := range m { 562 switch k { 563 case "name": 564 if v != nil { 565 var name string 566 err = json.Unmarshal(*v, &name) 567 if err != nil { 568 return err 569 } 570 ar.Name = &name 571 } 572 case "description": 573 if v != nil { 574 var description string 575 err = json.Unmarshal(*v, &description) 576 if err != nil { 577 return err 578 } 579 ar.Description = &description 580 } 581 case "provisioningState": 582 if v != nil { 583 var provisioningState string 584 err = json.Unmarshal(*v, &provisioningState) 585 if err != nil { 586 return err 587 } 588 ar.ProvisioningState = &provisioningState 589 } 590 case "isEnabled": 591 if v != nil { 592 var isEnabled bool 593 err = json.Unmarshal(*v, &isEnabled) 594 if err != nil { 595 return err 596 } 597 ar.IsEnabled = &isEnabled 598 } 599 case "condition": 600 if v != nil { 601 condition, err := unmarshalBasicRuleCondition(*v) 602 if err != nil { 603 return err 604 } 605 ar.Condition = condition 606 } 607 case "action": 608 if v != nil { 609 action, err := unmarshalBasicRuleAction(*v) 610 if err != nil { 611 return err 612 } 613 ar.Action = action 614 } 615 case "actions": 616 if v != nil { 617 actions, err := unmarshalBasicRuleActionArray(*v) 618 if err != nil { 619 return err 620 } 621 ar.Actions = &actions 622 } 623 case "lastUpdatedTime": 624 if v != nil { 625 var lastUpdatedTime date.Time 626 err = json.Unmarshal(*v, &lastUpdatedTime) 627 if err != nil { 628 return err 629 } 630 ar.LastUpdatedTime = &lastUpdatedTime 631 } 632 } 633 } 634 635 return nil 636} 637 638// AlertRuleAllOfCondition an Activity Log Alert rule condition that is met when all its member conditions 639// are met. 640type AlertRuleAllOfCondition struct { 641 // AllOf - The list of Activity Log Alert rule conditions. 642 AllOf *[]AlertRuleAnyOfOrLeafCondition `json:"allOf,omitempty"` 643} 644 645// AlertRuleAnyOfOrLeafCondition an Activity Log Alert rule condition that is met when all its member 646// conditions are met. 647// Each condition can be of one of the following types: 648// __Important__: Each type has its unique subset of properties. Properties from different types CANNOT 649// exist in one condition. 650// * __Leaf Condition -__ must contain 'field' and either 'equals' or 'containsAny'. 651// _Please note, 'anyOf' should __not__ be set in a Leaf Condition._ 652// * __AnyOf Condition -__ must contain __only__ 'anyOf' (which is an array of Leaf Conditions). 653// _Please note, 'field', 'equals' and 'containsAny' should __not__ be set in an AnyOf Condition._ 654type AlertRuleAnyOfOrLeafCondition struct { 655 // AnyOf - An Activity Log Alert rule condition that is met when at least one of its member leaf conditions are met. 656 AnyOf *[]AlertRuleLeafCondition `json:"anyOf,omitempty"` 657 // Field - The name of the Activity Log event's field that this condition will examine. 658 // The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. 659 Field *string `json:"field,omitempty"` 660 // Equals - The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. 661 Equals *string `json:"equals,omitempty"` 662 // ContainsAny - The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. 663 ContainsAny *[]string `json:"containsAny,omitempty"` 664} 665 666// AlertRuleLeafCondition an Activity Log Alert rule condition that is met by comparing the field and value 667// of an Activity Log event. 668// This condition must contain 'field' and either 'equals' or 'containsAny'. 669type AlertRuleLeafCondition struct { 670 // Field - The name of the Activity Log event's field that this condition will examine. 671 // The possible values for this field are (case-insensitive): 'resourceId', 'category', 'caller', 'level', 'operationName', 'resourceGroup', 'resourceProvider', 'status', 'subStatus', 'resourceType', or anything beginning with 'properties'. 672 Field *string `json:"field,omitempty"` 673 // Equals - The value of the event's field will be compared to this value (case-insensitive) to determine if the condition is met. 674 Equals *string `json:"equals,omitempty"` 675 // ContainsAny - The value of the event's field will be compared to the values in this array (case-insensitive) to determine if the condition is met. 676 ContainsAny *[]string `json:"containsAny,omitempty"` 677} 678 679// AlertRuleList a list of Activity Log Alert rules. 680type AlertRuleList struct { 681 autorest.Response `json:"-"` 682 // Value - The list of Activity Log Alert rules. 683 Value *[]ActivityLogAlertResource `json:"value,omitempty"` 684 // NextLink - Provides the link to retrieve the next set of elements. 685 NextLink *string `json:"nextLink,omitempty"` 686} 687 688// AlertRuleListIterator provides access to a complete listing of ActivityLogAlertResource values. 689type AlertRuleListIterator struct { 690 i int 691 page AlertRuleListPage 692} 693 694// NextWithContext advances to the next value. If there was an error making 695// the request the iterator does not advance and the error is returned. 696func (iter *AlertRuleListIterator) NextWithContext(ctx context.Context) (err error) { 697 if tracing.IsEnabled() { 698 ctx = tracing.StartSpan(ctx, fqdn+"/AlertRuleListIterator.NextWithContext") 699 defer func() { 700 sc := -1 701 if iter.Response().Response.Response != nil { 702 sc = iter.Response().Response.Response.StatusCode 703 } 704 tracing.EndSpan(ctx, sc, err) 705 }() 706 } 707 iter.i++ 708 if iter.i < len(iter.page.Values()) { 709 return nil 710 } 711 err = iter.page.NextWithContext(ctx) 712 if err != nil { 713 iter.i-- 714 return err 715 } 716 iter.i = 0 717 return nil 718} 719 720// Next advances to the next value. If there was an error making 721// the request the iterator does not advance and the error is returned. 722// Deprecated: Use NextWithContext() instead. 723func (iter *AlertRuleListIterator) Next() error { 724 return iter.NextWithContext(context.Background()) 725} 726 727// NotDone returns true if the enumeration should be started or is not yet complete. 728func (iter AlertRuleListIterator) NotDone() bool { 729 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 730} 731 732// Response returns the raw server response from the last page request. 733func (iter AlertRuleListIterator) Response() AlertRuleList { 734 return iter.page.Response() 735} 736 737// Value returns the current value or a zero-initialized value if the 738// iterator has advanced beyond the end of the collection. 739func (iter AlertRuleListIterator) Value() ActivityLogAlertResource { 740 if !iter.page.NotDone() { 741 return ActivityLogAlertResource{} 742 } 743 return iter.page.Values()[iter.i] 744} 745 746// Creates a new instance of the AlertRuleListIterator type. 747func NewAlertRuleListIterator(page AlertRuleListPage) AlertRuleListIterator { 748 return AlertRuleListIterator{page: page} 749} 750 751// IsEmpty returns true if the ListResult contains no values. 752func (arl AlertRuleList) IsEmpty() bool { 753 return arl.Value == nil || len(*arl.Value) == 0 754} 755 756// hasNextLink returns true if the NextLink is not empty. 757func (arl AlertRuleList) hasNextLink() bool { 758 return arl.NextLink != nil && len(*arl.NextLink) != 0 759} 760 761// alertRuleListPreparer prepares a request to retrieve the next set of results. 762// It returns nil if no more results exist. 763func (arl AlertRuleList) alertRuleListPreparer(ctx context.Context) (*http.Request, error) { 764 if !arl.hasNextLink() { 765 return nil, nil 766 } 767 return autorest.Prepare((&http.Request{}).WithContext(ctx), 768 autorest.AsJSON(), 769 autorest.AsGet(), 770 autorest.WithBaseURL(to.String(arl.NextLink))) 771} 772 773// AlertRuleListPage contains a page of ActivityLogAlertResource values. 774type AlertRuleListPage struct { 775 fn func(context.Context, AlertRuleList) (AlertRuleList, error) 776 arl AlertRuleList 777} 778 779// NextWithContext advances to the next page of values. If there was an error making 780// the request the page does not advance and the error is returned. 781func (page *AlertRuleListPage) NextWithContext(ctx context.Context) (err error) { 782 if tracing.IsEnabled() { 783 ctx = tracing.StartSpan(ctx, fqdn+"/AlertRuleListPage.NextWithContext") 784 defer func() { 785 sc := -1 786 if page.Response().Response.Response != nil { 787 sc = page.Response().Response.Response.StatusCode 788 } 789 tracing.EndSpan(ctx, sc, err) 790 }() 791 } 792 for { 793 next, err := page.fn(ctx, page.arl) 794 if err != nil { 795 return err 796 } 797 page.arl = next 798 if !next.hasNextLink() || !next.IsEmpty() { 799 break 800 } 801 } 802 return nil 803} 804 805// Next advances to the next page of values. If there was an error making 806// the request the page does not advance and the error is returned. 807// Deprecated: Use NextWithContext() instead. 808func (page *AlertRuleListPage) Next() error { 809 return page.NextWithContext(context.Background()) 810} 811 812// NotDone returns true if the page enumeration should be started or is not yet complete. 813func (page AlertRuleListPage) NotDone() bool { 814 return !page.arl.IsEmpty() 815} 816 817// Response returns the raw server response from the last page request. 818func (page AlertRuleListPage) Response() AlertRuleList { 819 return page.arl 820} 821 822// Values returns the slice of values for the current page or nil if there are no values. 823func (page AlertRuleListPage) Values() []ActivityLogAlertResource { 824 if page.arl.IsEmpty() { 825 return nil 826 } 827 return *page.arl.Value 828} 829 830// Creates a new instance of the AlertRuleListPage type. 831func NewAlertRuleListPage(cur AlertRuleList, getNextPage func(context.Context, AlertRuleList) (AlertRuleList, error)) AlertRuleListPage { 832 return AlertRuleListPage{ 833 fn: getNextPage, 834 arl: cur, 835 } 836} 837 838// AlertRulePatchObject an Activity Log Alert rule object for the body of patch operations. 839type AlertRulePatchObject struct { 840 // Tags - The resource tags 841 Tags map[string]*string `json:"tags"` 842 // AlertRulePatchProperties - The activity log alert settings for an update operation. 843 *AlertRulePatchProperties `json:"properties,omitempty"` 844} 845 846// MarshalJSON is the custom marshaler for AlertRulePatchObject. 847func (arpo AlertRulePatchObject) MarshalJSON() ([]byte, error) { 848 objectMap := make(map[string]interface{}) 849 if arpo.Tags != nil { 850 objectMap["tags"] = arpo.Tags 851 } 852 if arpo.AlertRulePatchProperties != nil { 853 objectMap["properties"] = arpo.AlertRulePatchProperties 854 } 855 return json.Marshal(objectMap) 856} 857 858// UnmarshalJSON is the custom unmarshaler for AlertRulePatchObject struct. 859func (arpo *AlertRulePatchObject) UnmarshalJSON(body []byte) error { 860 var m map[string]*json.RawMessage 861 err := json.Unmarshal(body, &m) 862 if err != nil { 863 return err 864 } 865 for k, v := range m { 866 switch k { 867 case "tags": 868 if v != nil { 869 var tags map[string]*string 870 err = json.Unmarshal(*v, &tags) 871 if err != nil { 872 return err 873 } 874 arpo.Tags = tags 875 } 876 case "properties": 877 if v != nil { 878 var alertRulePatchProperties AlertRulePatchProperties 879 err = json.Unmarshal(*v, &alertRulePatchProperties) 880 if err != nil { 881 return err 882 } 883 arpo.AlertRulePatchProperties = &alertRulePatchProperties 884 } 885 } 886 } 887 888 return nil 889} 890 891// AlertRulePatchProperties an Activity Log Alert rule properties for patch operations. 892type AlertRulePatchProperties struct { 893 // Enabled - Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated. 894 Enabled *bool `json:"enabled,omitempty"` 895} 896 897// AlertRuleProperties an Azure Activity Log Alert rule. 898type AlertRuleProperties struct { 899 // Scopes - A list of resource IDs that will be used as prefixes. The alert will only apply to Activity Log events with resource IDs that fall under one of these prefixes. This list must include at least one item. 900 Scopes *[]string `json:"scopes,omitempty"` 901 // Condition - The condition that will cause this alert to activate. 902 Condition *AlertRuleAllOfCondition `json:"condition,omitempty"` 903 // Actions - The actions that will activate when the condition is met. 904 Actions *ActionList `json:"actions,omitempty"` 905 // Enabled - Indicates whether this Activity Log Alert rule is enabled. If an Activity Log Alert rule is not enabled, then none of its actions will be activated. 906 Enabled *bool `json:"enabled,omitempty"` 907 // Description - A description of this Activity Log Alert rule. 908 Description *string `json:"description,omitempty"` 909} 910 911// AlertRuleResource the alert rule resource. 912type AlertRuleResource struct { 913 autorest.Response `json:"-"` 914 // AlertRule - The alert rule properties of the resource. 915 *AlertRule `json:"properties,omitempty"` 916 // ID - READ-ONLY; Azure resource Id 917 ID *string `json:"id,omitempty"` 918 // Name - READ-ONLY; Azure resource name 919 Name *string `json:"name,omitempty"` 920 // Type - READ-ONLY; Azure resource type 921 Type *string `json:"type,omitempty"` 922 // Location - Resource location 923 Location *string `json:"location,omitempty"` 924 // Tags - Resource tags 925 Tags map[string]*string `json:"tags"` 926 // Kind - READ-ONLY; Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. 927 Kind *string `json:"kind,omitempty"` 928 // Etag - READ-ONLY; The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. 929 Etag *string `json:"etag,omitempty"` 930} 931 932// MarshalJSON is the custom marshaler for AlertRuleResource. 933func (arr AlertRuleResource) MarshalJSON() ([]byte, error) { 934 objectMap := make(map[string]interface{}) 935 if arr.AlertRule != nil { 936 objectMap["properties"] = arr.AlertRule 937 } 938 if arr.Location != nil { 939 objectMap["location"] = arr.Location 940 } 941 if arr.Tags != nil { 942 objectMap["tags"] = arr.Tags 943 } 944 return json.Marshal(objectMap) 945} 946 947// UnmarshalJSON is the custom unmarshaler for AlertRuleResource struct. 948func (arr *AlertRuleResource) UnmarshalJSON(body []byte) error { 949 var m map[string]*json.RawMessage 950 err := json.Unmarshal(body, &m) 951 if err != nil { 952 return err 953 } 954 for k, v := range m { 955 switch k { 956 case "properties": 957 if v != nil { 958 var alertRule AlertRule 959 err = json.Unmarshal(*v, &alertRule) 960 if err != nil { 961 return err 962 } 963 arr.AlertRule = &alertRule 964 } 965 case "id": 966 if v != nil { 967 var ID string 968 err = json.Unmarshal(*v, &ID) 969 if err != nil { 970 return err 971 } 972 arr.ID = &ID 973 } 974 case "name": 975 if v != nil { 976 var name string 977 err = json.Unmarshal(*v, &name) 978 if err != nil { 979 return err 980 } 981 arr.Name = &name 982 } 983 case "type": 984 if v != nil { 985 var typeVar string 986 err = json.Unmarshal(*v, &typeVar) 987 if err != nil { 988 return err 989 } 990 arr.Type = &typeVar 991 } 992 case "location": 993 if v != nil { 994 var location string 995 err = json.Unmarshal(*v, &location) 996 if err != nil { 997 return err 998 } 999 arr.Location = &location 1000 } 1001 case "tags": 1002 if v != nil { 1003 var tags map[string]*string 1004 err = json.Unmarshal(*v, &tags) 1005 if err != nil { 1006 return err 1007 } 1008 arr.Tags = tags 1009 } 1010 case "kind": 1011 if v != nil { 1012 var kind string 1013 err = json.Unmarshal(*v, &kind) 1014 if err != nil { 1015 return err 1016 } 1017 arr.Kind = &kind 1018 } 1019 case "etag": 1020 if v != nil { 1021 var etag string 1022 err = json.Unmarshal(*v, &etag) 1023 if err != nil { 1024 return err 1025 } 1026 arr.Etag = &etag 1027 } 1028 } 1029 } 1030 1031 return nil 1032} 1033 1034// AlertRuleResourceCollection represents a collection of alert rule resources. 1035type AlertRuleResourceCollection struct { 1036 autorest.Response `json:"-"` 1037 // Value - the values for the alert rule resources. 1038 Value *[]AlertRuleResource `json:"value,omitempty"` 1039} 1040 1041// AlertRuleResourcePatch the alert rule object for patch operations. 1042type AlertRuleResourcePatch struct { 1043 // Tags - Resource tags 1044 Tags map[string]*string `json:"tags"` 1045 // AlertRule - The properties of an alert rule. 1046 *AlertRule `json:"properties,omitempty"` 1047} 1048 1049// MarshalJSON is the custom marshaler for AlertRuleResourcePatch. 1050func (arrp AlertRuleResourcePatch) MarshalJSON() ([]byte, error) { 1051 objectMap := make(map[string]interface{}) 1052 if arrp.Tags != nil { 1053 objectMap["tags"] = arrp.Tags 1054 } 1055 if arrp.AlertRule != nil { 1056 objectMap["properties"] = arrp.AlertRule 1057 } 1058 return json.Marshal(objectMap) 1059} 1060 1061// UnmarshalJSON is the custom unmarshaler for AlertRuleResourcePatch struct. 1062func (arrp *AlertRuleResourcePatch) UnmarshalJSON(body []byte) error { 1063 var m map[string]*json.RawMessage 1064 err := json.Unmarshal(body, &m) 1065 if err != nil { 1066 return err 1067 } 1068 for k, v := range m { 1069 switch k { 1070 case "tags": 1071 if v != nil { 1072 var tags map[string]*string 1073 err = json.Unmarshal(*v, &tags) 1074 if err != nil { 1075 return err 1076 } 1077 arrp.Tags = tags 1078 } 1079 case "properties": 1080 if v != nil { 1081 var alertRule AlertRule 1082 err = json.Unmarshal(*v, &alertRule) 1083 if err != nil { 1084 return err 1085 } 1086 arrp.AlertRule = &alertRule 1087 } 1088 } 1089 } 1090 1091 return nil 1092} 1093 1094// ArmRoleReceiver an arm role receiver. 1095type ArmRoleReceiver struct { 1096 // Name - The name of the arm role receiver. Names must be unique across all receivers within an action group. 1097 Name *string `json:"name,omitempty"` 1098 // RoleID - The arm role id. 1099 RoleID *string `json:"roleId,omitempty"` 1100 // UseCommonAlertSchema - Indicates whether to use common alert schema. 1101 UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"` 1102} 1103 1104// AutomationRunbookReceiver the Azure Automation Runbook notification receiver. 1105type AutomationRunbookReceiver struct { 1106 // AutomationAccountID - The Azure automation account Id which holds this runbook and authenticate to Azure resource. 1107 AutomationAccountID *string `json:"automationAccountId,omitempty"` 1108 // RunbookName - The name for this runbook. 1109 RunbookName *string `json:"runbookName,omitempty"` 1110 // WebhookResourceID - The resource id for webhook linked to this runbook. 1111 WebhookResourceID *string `json:"webhookResourceId,omitempty"` 1112 // IsGlobalRunbook - Indicates whether this instance is global runbook. 1113 IsGlobalRunbook *bool `json:"isGlobalRunbook,omitempty"` 1114 // Name - Indicates name of the webhook. 1115 Name *string `json:"name,omitempty"` 1116 // ServiceURI - The URI where webhooks should be sent. 1117 ServiceURI *string `json:"serviceUri,omitempty"` 1118 // UseCommonAlertSchema - Indicates whether to use common alert schema. 1119 UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"` 1120} 1121 1122// AutoscaleNotification autoscale notification. 1123type AutoscaleNotification struct { 1124 // Operation - the operation associated with the notification and its value must be "scale" 1125 Operation *string `json:"operation,omitempty"` 1126 // Email - the email notification. 1127 Email *EmailNotification `json:"email,omitempty"` 1128 // Webhooks - the collection of webhook notifications. 1129 Webhooks *[]WebhookNotification `json:"webhooks,omitempty"` 1130} 1131 1132// AutoscaleProfile autoscale profile. 1133type AutoscaleProfile struct { 1134 // Name - the name of the profile. 1135 Name *string `json:"name,omitempty"` 1136 // Capacity - the number of instances that can be used during this profile. 1137 Capacity *ScaleCapacity `json:"capacity,omitempty"` 1138 // Rules - the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified. 1139 Rules *[]ScaleRule `json:"rules,omitempty"` 1140 // FixedDate - the specific date-time for the profile. This element is not used if the Recurrence element is used. 1141 FixedDate *TimeWindow `json:"fixedDate,omitempty"` 1142 // Recurrence - the repeating times at which this profile begins. This element is not used if the FixedDate element is used. 1143 Recurrence *Recurrence `json:"recurrence,omitempty"` 1144} 1145 1146// AutoscaleSetting a setting that contains all of the configuration for the automatic scaling of a 1147// resource. 1148type AutoscaleSetting struct { 1149 // Profiles - the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified. 1150 Profiles *[]AutoscaleProfile `json:"profiles,omitempty"` 1151 // Notifications - the collection of notifications. 1152 Notifications *[]AutoscaleNotification `json:"notifications,omitempty"` 1153 // Enabled - the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'true'. 1154 Enabled *bool `json:"enabled,omitempty"` 1155 // Name - the name of the autoscale setting. 1156 Name *string `json:"name,omitempty"` 1157 // TargetResourceURI - the resource identifier of the resource that the autoscale setting should be added to. 1158 TargetResourceURI *string `json:"targetResourceUri,omitempty"` 1159 // TargetResourceLocation - the location of the resource that the autoscale setting should be added to. 1160 TargetResourceLocation *string `json:"targetResourceLocation,omitempty"` 1161} 1162 1163// AutoscaleSettingResource the autoscale setting resource. 1164type AutoscaleSettingResource struct { 1165 autorest.Response `json:"-"` 1166 // AutoscaleSetting - The autoscale setting of the resource. 1167 *AutoscaleSetting `json:"properties,omitempty"` 1168 // ID - READ-ONLY; Azure resource Id 1169 ID *string `json:"id,omitempty"` 1170 // Name - READ-ONLY; Azure resource name 1171 Name *string `json:"name,omitempty"` 1172 // Type - READ-ONLY; Azure resource type 1173 Type *string `json:"type,omitempty"` 1174 // Location - Resource location 1175 Location *string `json:"location,omitempty"` 1176 // Tags - Resource tags 1177 Tags map[string]*string `json:"tags"` 1178 // Kind - READ-ONLY; Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. 1179 Kind *string `json:"kind,omitempty"` 1180 // Etag - READ-ONLY; The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. 1181 Etag *string `json:"etag,omitempty"` 1182} 1183 1184// MarshalJSON is the custom marshaler for AutoscaleSettingResource. 1185func (asr AutoscaleSettingResource) MarshalJSON() ([]byte, error) { 1186 objectMap := make(map[string]interface{}) 1187 if asr.AutoscaleSetting != nil { 1188 objectMap["properties"] = asr.AutoscaleSetting 1189 } 1190 if asr.Location != nil { 1191 objectMap["location"] = asr.Location 1192 } 1193 if asr.Tags != nil { 1194 objectMap["tags"] = asr.Tags 1195 } 1196 return json.Marshal(objectMap) 1197} 1198 1199// UnmarshalJSON is the custom unmarshaler for AutoscaleSettingResource struct. 1200func (asr *AutoscaleSettingResource) UnmarshalJSON(body []byte) error { 1201 var m map[string]*json.RawMessage 1202 err := json.Unmarshal(body, &m) 1203 if err != nil { 1204 return err 1205 } 1206 for k, v := range m { 1207 switch k { 1208 case "properties": 1209 if v != nil { 1210 var autoscaleSetting AutoscaleSetting 1211 err = json.Unmarshal(*v, &autoscaleSetting) 1212 if err != nil { 1213 return err 1214 } 1215 asr.AutoscaleSetting = &autoscaleSetting 1216 } 1217 case "id": 1218 if v != nil { 1219 var ID string 1220 err = json.Unmarshal(*v, &ID) 1221 if err != nil { 1222 return err 1223 } 1224 asr.ID = &ID 1225 } 1226 case "name": 1227 if v != nil { 1228 var name string 1229 err = json.Unmarshal(*v, &name) 1230 if err != nil { 1231 return err 1232 } 1233 asr.Name = &name 1234 } 1235 case "type": 1236 if v != nil { 1237 var typeVar string 1238 err = json.Unmarshal(*v, &typeVar) 1239 if err != nil { 1240 return err 1241 } 1242 asr.Type = &typeVar 1243 } 1244 case "location": 1245 if v != nil { 1246 var location string 1247 err = json.Unmarshal(*v, &location) 1248 if err != nil { 1249 return err 1250 } 1251 asr.Location = &location 1252 } 1253 case "tags": 1254 if v != nil { 1255 var tags map[string]*string 1256 err = json.Unmarshal(*v, &tags) 1257 if err != nil { 1258 return err 1259 } 1260 asr.Tags = tags 1261 } 1262 case "kind": 1263 if v != nil { 1264 var kind string 1265 err = json.Unmarshal(*v, &kind) 1266 if err != nil { 1267 return err 1268 } 1269 asr.Kind = &kind 1270 } 1271 case "etag": 1272 if v != nil { 1273 var etag string 1274 err = json.Unmarshal(*v, &etag) 1275 if err != nil { 1276 return err 1277 } 1278 asr.Etag = &etag 1279 } 1280 } 1281 } 1282 1283 return nil 1284} 1285 1286// AutoscaleSettingResourceCollection represents a collection of autoscale setting resources. 1287type AutoscaleSettingResourceCollection struct { 1288 autorest.Response `json:"-"` 1289 // Value - the values for the autoscale setting resources. 1290 Value *[]AutoscaleSettingResource `json:"value,omitempty"` 1291 // NextLink - URL to get the next set of results. 1292 NextLink *string `json:"nextLink,omitempty"` 1293} 1294 1295// AutoscaleSettingResourceCollectionIterator provides access to a complete listing of 1296// AutoscaleSettingResource values. 1297type AutoscaleSettingResourceCollectionIterator struct { 1298 i int 1299 page AutoscaleSettingResourceCollectionPage 1300} 1301 1302// NextWithContext advances to the next value. If there was an error making 1303// the request the iterator does not advance and the error is returned. 1304func (iter *AutoscaleSettingResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) { 1305 if tracing.IsEnabled() { 1306 ctx = tracing.StartSpan(ctx, fqdn+"/AutoscaleSettingResourceCollectionIterator.NextWithContext") 1307 defer func() { 1308 sc := -1 1309 if iter.Response().Response.Response != nil { 1310 sc = iter.Response().Response.Response.StatusCode 1311 } 1312 tracing.EndSpan(ctx, sc, err) 1313 }() 1314 } 1315 iter.i++ 1316 if iter.i < len(iter.page.Values()) { 1317 return nil 1318 } 1319 err = iter.page.NextWithContext(ctx) 1320 if err != nil { 1321 iter.i-- 1322 return err 1323 } 1324 iter.i = 0 1325 return nil 1326} 1327 1328// Next advances to the next value. If there was an error making 1329// the request the iterator does not advance and the error is returned. 1330// Deprecated: Use NextWithContext() instead. 1331func (iter *AutoscaleSettingResourceCollectionIterator) Next() error { 1332 return iter.NextWithContext(context.Background()) 1333} 1334 1335// NotDone returns true if the enumeration should be started or is not yet complete. 1336func (iter AutoscaleSettingResourceCollectionIterator) NotDone() bool { 1337 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1338} 1339 1340// Response returns the raw server response from the last page request. 1341func (iter AutoscaleSettingResourceCollectionIterator) Response() AutoscaleSettingResourceCollection { 1342 return iter.page.Response() 1343} 1344 1345// Value returns the current value or a zero-initialized value if the 1346// iterator has advanced beyond the end of the collection. 1347func (iter AutoscaleSettingResourceCollectionIterator) Value() AutoscaleSettingResource { 1348 if !iter.page.NotDone() { 1349 return AutoscaleSettingResource{} 1350 } 1351 return iter.page.Values()[iter.i] 1352} 1353 1354// Creates a new instance of the AutoscaleSettingResourceCollectionIterator type. 1355func NewAutoscaleSettingResourceCollectionIterator(page AutoscaleSettingResourceCollectionPage) AutoscaleSettingResourceCollectionIterator { 1356 return AutoscaleSettingResourceCollectionIterator{page: page} 1357} 1358 1359// IsEmpty returns true if the ListResult contains no values. 1360func (asrc AutoscaleSettingResourceCollection) IsEmpty() bool { 1361 return asrc.Value == nil || len(*asrc.Value) == 0 1362} 1363 1364// hasNextLink returns true if the NextLink is not empty. 1365func (asrc AutoscaleSettingResourceCollection) hasNextLink() bool { 1366 return asrc.NextLink != nil && len(*asrc.NextLink) != 0 1367} 1368 1369// autoscaleSettingResourceCollectionPreparer prepares a request to retrieve the next set of results. 1370// It returns nil if no more results exist. 1371func (asrc AutoscaleSettingResourceCollection) autoscaleSettingResourceCollectionPreparer(ctx context.Context) (*http.Request, error) { 1372 if !asrc.hasNextLink() { 1373 return nil, nil 1374 } 1375 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1376 autorest.AsJSON(), 1377 autorest.AsGet(), 1378 autorest.WithBaseURL(to.String(asrc.NextLink))) 1379} 1380 1381// AutoscaleSettingResourceCollectionPage contains a page of AutoscaleSettingResource values. 1382type AutoscaleSettingResourceCollectionPage struct { 1383 fn func(context.Context, AutoscaleSettingResourceCollection) (AutoscaleSettingResourceCollection, error) 1384 asrc AutoscaleSettingResourceCollection 1385} 1386 1387// NextWithContext advances to the next page of values. If there was an error making 1388// the request the page does not advance and the error is returned. 1389func (page *AutoscaleSettingResourceCollectionPage) NextWithContext(ctx context.Context) (err error) { 1390 if tracing.IsEnabled() { 1391 ctx = tracing.StartSpan(ctx, fqdn+"/AutoscaleSettingResourceCollectionPage.NextWithContext") 1392 defer func() { 1393 sc := -1 1394 if page.Response().Response.Response != nil { 1395 sc = page.Response().Response.Response.StatusCode 1396 } 1397 tracing.EndSpan(ctx, sc, err) 1398 }() 1399 } 1400 for { 1401 next, err := page.fn(ctx, page.asrc) 1402 if err != nil { 1403 return err 1404 } 1405 page.asrc = next 1406 if !next.hasNextLink() || !next.IsEmpty() { 1407 break 1408 } 1409 } 1410 return nil 1411} 1412 1413// Next advances to the next page of values. If there was an error making 1414// the request the page does not advance and the error is returned. 1415// Deprecated: Use NextWithContext() instead. 1416func (page *AutoscaleSettingResourceCollectionPage) Next() error { 1417 return page.NextWithContext(context.Background()) 1418} 1419 1420// NotDone returns true if the page enumeration should be started or is not yet complete. 1421func (page AutoscaleSettingResourceCollectionPage) NotDone() bool { 1422 return !page.asrc.IsEmpty() 1423} 1424 1425// Response returns the raw server response from the last page request. 1426func (page AutoscaleSettingResourceCollectionPage) Response() AutoscaleSettingResourceCollection { 1427 return page.asrc 1428} 1429 1430// Values returns the slice of values for the current page or nil if there are no values. 1431func (page AutoscaleSettingResourceCollectionPage) Values() []AutoscaleSettingResource { 1432 if page.asrc.IsEmpty() { 1433 return nil 1434 } 1435 return *page.asrc.Value 1436} 1437 1438// Creates a new instance of the AutoscaleSettingResourceCollectionPage type. 1439func NewAutoscaleSettingResourceCollectionPage(cur AutoscaleSettingResourceCollection, getNextPage func(context.Context, AutoscaleSettingResourceCollection) (AutoscaleSettingResourceCollection, error)) AutoscaleSettingResourceCollectionPage { 1440 return AutoscaleSettingResourceCollectionPage{ 1441 fn: getNextPage, 1442 asrc: cur, 1443 } 1444} 1445 1446// AutoscaleSettingResourcePatch the autoscale setting object for patch operations. 1447type AutoscaleSettingResourcePatch struct { 1448 // Tags - Resource tags 1449 Tags map[string]*string `json:"tags"` 1450 // AutoscaleSetting - The autoscale setting properties of the update operation. 1451 *AutoscaleSetting `json:"properties,omitempty"` 1452} 1453 1454// MarshalJSON is the custom marshaler for AutoscaleSettingResourcePatch. 1455func (asrp AutoscaleSettingResourcePatch) MarshalJSON() ([]byte, error) { 1456 objectMap := make(map[string]interface{}) 1457 if asrp.Tags != nil { 1458 objectMap["tags"] = asrp.Tags 1459 } 1460 if asrp.AutoscaleSetting != nil { 1461 objectMap["properties"] = asrp.AutoscaleSetting 1462 } 1463 return json.Marshal(objectMap) 1464} 1465 1466// UnmarshalJSON is the custom unmarshaler for AutoscaleSettingResourcePatch struct. 1467func (asrp *AutoscaleSettingResourcePatch) UnmarshalJSON(body []byte) error { 1468 var m map[string]*json.RawMessage 1469 err := json.Unmarshal(body, &m) 1470 if err != nil { 1471 return err 1472 } 1473 for k, v := range m { 1474 switch k { 1475 case "tags": 1476 if v != nil { 1477 var tags map[string]*string 1478 err = json.Unmarshal(*v, &tags) 1479 if err != nil { 1480 return err 1481 } 1482 asrp.Tags = tags 1483 } 1484 case "properties": 1485 if v != nil { 1486 var autoscaleSetting AutoscaleSetting 1487 err = json.Unmarshal(*v, &autoscaleSetting) 1488 if err != nil { 1489 return err 1490 } 1491 asrp.AutoscaleSetting = &autoscaleSetting 1492 } 1493 } 1494 } 1495 1496 return nil 1497} 1498 1499// AzNsActionGroup azure action group 1500type AzNsActionGroup struct { 1501 // ActionGroup - Azure Action Group reference. 1502 ActionGroup *[]string `json:"actionGroup,omitempty"` 1503 // EmailSubject - Custom subject override for all email ids in Azure action group 1504 EmailSubject *string `json:"emailSubject,omitempty"` 1505 // CustomWebhookPayload - Custom payload to be sent for all webhook URI in Azure action group 1506 CustomWebhookPayload *string `json:"customWebhookPayload,omitempty"` 1507} 1508 1509// AzureAppPushReceiver the Azure mobile App push notification receiver. 1510type AzureAppPushReceiver struct { 1511 // Name - The name of the Azure mobile app push receiver. Names must be unique across all receivers within an action group. 1512 Name *string `json:"name,omitempty"` 1513 // EmailAddress - The email address registered for the Azure mobile app. 1514 EmailAddress *string `json:"emailAddress,omitempty"` 1515} 1516 1517// AzureFunctionReceiver an azure function receiver. 1518type AzureFunctionReceiver struct { 1519 // Name - The name of the azure function receiver. Names must be unique across all receivers within an action group. 1520 Name *string `json:"name,omitempty"` 1521 // FunctionAppResourceID - The azure resource id of the function app. 1522 FunctionAppResourceID *string `json:"functionAppResourceId,omitempty"` 1523 // FunctionName - The function name in the function app. 1524 FunctionName *string `json:"functionName,omitempty"` 1525 // HTTPTriggerURL - The http trigger url where http request sent to. 1526 HTTPTriggerURL *string `json:"httpTriggerUrl,omitempty"` 1527 // UseCommonAlertSchema - Indicates whether to use common alert schema. 1528 UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"` 1529} 1530 1531// AzureMonitorMetricsDestination azure Monitor Metrics destination. 1532type AzureMonitorMetricsDestination struct { 1533 // Name - A friendly name for the destination. 1534 // This name should be unique across all destinations (regardless of type) within the data collection rule. 1535 Name *string `json:"name,omitempty"` 1536} 1537 1538// AzureMonitorPrivateLinkScope an Azure Monitor PrivateLinkScope definition. 1539type AzureMonitorPrivateLinkScope struct { 1540 autorest.Response `json:"-"` 1541 // AzureMonitorPrivateLinkScopeProperties - Properties that define a Azure Monitor PrivateLinkScope resource. 1542 *AzureMonitorPrivateLinkScopeProperties `json:"properties,omitempty"` 1543 // ID - READ-ONLY; Azure resource Id 1544 ID *string `json:"id,omitempty"` 1545 // Name - READ-ONLY; Azure resource name 1546 Name *string `json:"name,omitempty"` 1547 // Type - READ-ONLY; Azure resource type 1548 Type *string `json:"type,omitempty"` 1549 // Location - Resource location 1550 Location *string `json:"location,omitempty"` 1551 // Tags - Resource tags 1552 Tags map[string]*string `json:"tags"` 1553} 1554 1555// MarshalJSON is the custom marshaler for AzureMonitorPrivateLinkScope. 1556func (ampls AzureMonitorPrivateLinkScope) MarshalJSON() ([]byte, error) { 1557 objectMap := make(map[string]interface{}) 1558 if ampls.AzureMonitorPrivateLinkScopeProperties != nil { 1559 objectMap["properties"] = ampls.AzureMonitorPrivateLinkScopeProperties 1560 } 1561 if ampls.Location != nil { 1562 objectMap["location"] = ampls.Location 1563 } 1564 if ampls.Tags != nil { 1565 objectMap["tags"] = ampls.Tags 1566 } 1567 return json.Marshal(objectMap) 1568} 1569 1570// UnmarshalJSON is the custom unmarshaler for AzureMonitorPrivateLinkScope struct. 1571func (ampls *AzureMonitorPrivateLinkScope) UnmarshalJSON(body []byte) error { 1572 var m map[string]*json.RawMessage 1573 err := json.Unmarshal(body, &m) 1574 if err != nil { 1575 return err 1576 } 1577 for k, v := range m { 1578 switch k { 1579 case "properties": 1580 if v != nil { 1581 var azureMonitorPrivateLinkScopeProperties AzureMonitorPrivateLinkScopeProperties 1582 err = json.Unmarshal(*v, &azureMonitorPrivateLinkScopeProperties) 1583 if err != nil { 1584 return err 1585 } 1586 ampls.AzureMonitorPrivateLinkScopeProperties = &azureMonitorPrivateLinkScopeProperties 1587 } 1588 case "id": 1589 if v != nil { 1590 var ID string 1591 err = json.Unmarshal(*v, &ID) 1592 if err != nil { 1593 return err 1594 } 1595 ampls.ID = &ID 1596 } 1597 case "name": 1598 if v != nil { 1599 var name string 1600 err = json.Unmarshal(*v, &name) 1601 if err != nil { 1602 return err 1603 } 1604 ampls.Name = &name 1605 } 1606 case "type": 1607 if v != nil { 1608 var typeVar string 1609 err = json.Unmarshal(*v, &typeVar) 1610 if err != nil { 1611 return err 1612 } 1613 ampls.Type = &typeVar 1614 } 1615 case "location": 1616 if v != nil { 1617 var location string 1618 err = json.Unmarshal(*v, &location) 1619 if err != nil { 1620 return err 1621 } 1622 ampls.Location = &location 1623 } 1624 case "tags": 1625 if v != nil { 1626 var tags map[string]*string 1627 err = json.Unmarshal(*v, &tags) 1628 if err != nil { 1629 return err 1630 } 1631 ampls.Tags = tags 1632 } 1633 } 1634 } 1635 1636 return nil 1637} 1638 1639// AzureMonitorPrivateLinkScopeListResult describes the list of Azure Monitor PrivateLinkScope resources. 1640type AzureMonitorPrivateLinkScopeListResult struct { 1641 autorest.Response `json:"-"` 1642 // Value - List of Azure Monitor PrivateLinkScope definitions. 1643 Value *[]AzureMonitorPrivateLinkScope `json:"value,omitempty"` 1644 // NextLink - The URI to get the next set of Azure Monitor PrivateLinkScope definitions if too many PrivateLinkScopes where returned in the result set. 1645 NextLink *string `json:"nextLink,omitempty"` 1646} 1647 1648// AzureMonitorPrivateLinkScopeListResultIterator provides access to a complete listing of 1649// AzureMonitorPrivateLinkScope values. 1650type AzureMonitorPrivateLinkScopeListResultIterator struct { 1651 i int 1652 page AzureMonitorPrivateLinkScopeListResultPage 1653} 1654 1655// NextWithContext advances to the next value. If there was an error making 1656// the request the iterator does not advance and the error is returned. 1657func (iter *AzureMonitorPrivateLinkScopeListResultIterator) NextWithContext(ctx context.Context) (err error) { 1658 if tracing.IsEnabled() { 1659 ctx = tracing.StartSpan(ctx, fqdn+"/AzureMonitorPrivateLinkScopeListResultIterator.NextWithContext") 1660 defer func() { 1661 sc := -1 1662 if iter.Response().Response.Response != nil { 1663 sc = iter.Response().Response.Response.StatusCode 1664 } 1665 tracing.EndSpan(ctx, sc, err) 1666 }() 1667 } 1668 iter.i++ 1669 if iter.i < len(iter.page.Values()) { 1670 return nil 1671 } 1672 err = iter.page.NextWithContext(ctx) 1673 if err != nil { 1674 iter.i-- 1675 return err 1676 } 1677 iter.i = 0 1678 return nil 1679} 1680 1681// Next advances to the next value. If there was an error making 1682// the request the iterator does not advance and the error is returned. 1683// Deprecated: Use NextWithContext() instead. 1684func (iter *AzureMonitorPrivateLinkScopeListResultIterator) Next() error { 1685 return iter.NextWithContext(context.Background()) 1686} 1687 1688// NotDone returns true if the enumeration should be started or is not yet complete. 1689func (iter AzureMonitorPrivateLinkScopeListResultIterator) NotDone() bool { 1690 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1691} 1692 1693// Response returns the raw server response from the last page request. 1694func (iter AzureMonitorPrivateLinkScopeListResultIterator) Response() AzureMonitorPrivateLinkScopeListResult { 1695 return iter.page.Response() 1696} 1697 1698// Value returns the current value or a zero-initialized value if the 1699// iterator has advanced beyond the end of the collection. 1700func (iter AzureMonitorPrivateLinkScopeListResultIterator) Value() AzureMonitorPrivateLinkScope { 1701 if !iter.page.NotDone() { 1702 return AzureMonitorPrivateLinkScope{} 1703 } 1704 return iter.page.Values()[iter.i] 1705} 1706 1707// Creates a new instance of the AzureMonitorPrivateLinkScopeListResultIterator type. 1708func NewAzureMonitorPrivateLinkScopeListResultIterator(page AzureMonitorPrivateLinkScopeListResultPage) AzureMonitorPrivateLinkScopeListResultIterator { 1709 return AzureMonitorPrivateLinkScopeListResultIterator{page: page} 1710} 1711 1712// IsEmpty returns true if the ListResult contains no values. 1713func (amplslr AzureMonitorPrivateLinkScopeListResult) IsEmpty() bool { 1714 return amplslr.Value == nil || len(*amplslr.Value) == 0 1715} 1716 1717// hasNextLink returns true if the NextLink is not empty. 1718func (amplslr AzureMonitorPrivateLinkScopeListResult) hasNextLink() bool { 1719 return amplslr.NextLink != nil && len(*amplslr.NextLink) != 0 1720} 1721 1722// azureMonitorPrivateLinkScopeListResultPreparer prepares a request to retrieve the next set of results. 1723// It returns nil if no more results exist. 1724func (amplslr AzureMonitorPrivateLinkScopeListResult) azureMonitorPrivateLinkScopeListResultPreparer(ctx context.Context) (*http.Request, error) { 1725 if !amplslr.hasNextLink() { 1726 return nil, nil 1727 } 1728 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1729 autorest.AsJSON(), 1730 autorest.AsGet(), 1731 autorest.WithBaseURL(to.String(amplslr.NextLink))) 1732} 1733 1734// AzureMonitorPrivateLinkScopeListResultPage contains a page of AzureMonitorPrivateLinkScope values. 1735type AzureMonitorPrivateLinkScopeListResultPage struct { 1736 fn func(context.Context, AzureMonitorPrivateLinkScopeListResult) (AzureMonitorPrivateLinkScopeListResult, error) 1737 amplslr AzureMonitorPrivateLinkScopeListResult 1738} 1739 1740// NextWithContext advances to the next page of values. If there was an error making 1741// the request the page does not advance and the error is returned. 1742func (page *AzureMonitorPrivateLinkScopeListResultPage) NextWithContext(ctx context.Context) (err error) { 1743 if tracing.IsEnabled() { 1744 ctx = tracing.StartSpan(ctx, fqdn+"/AzureMonitorPrivateLinkScopeListResultPage.NextWithContext") 1745 defer func() { 1746 sc := -1 1747 if page.Response().Response.Response != nil { 1748 sc = page.Response().Response.Response.StatusCode 1749 } 1750 tracing.EndSpan(ctx, sc, err) 1751 }() 1752 } 1753 for { 1754 next, err := page.fn(ctx, page.amplslr) 1755 if err != nil { 1756 return err 1757 } 1758 page.amplslr = next 1759 if !next.hasNextLink() || !next.IsEmpty() { 1760 break 1761 } 1762 } 1763 return nil 1764} 1765 1766// Next advances to the next page of values. If there was an error making 1767// the request the page does not advance and the error is returned. 1768// Deprecated: Use NextWithContext() instead. 1769func (page *AzureMonitorPrivateLinkScopeListResultPage) Next() error { 1770 return page.NextWithContext(context.Background()) 1771} 1772 1773// NotDone returns true if the page enumeration should be started or is not yet complete. 1774func (page AzureMonitorPrivateLinkScopeListResultPage) NotDone() bool { 1775 return !page.amplslr.IsEmpty() 1776} 1777 1778// Response returns the raw server response from the last page request. 1779func (page AzureMonitorPrivateLinkScopeListResultPage) Response() AzureMonitorPrivateLinkScopeListResult { 1780 return page.amplslr 1781} 1782 1783// Values returns the slice of values for the current page or nil if there are no values. 1784func (page AzureMonitorPrivateLinkScopeListResultPage) Values() []AzureMonitorPrivateLinkScope { 1785 if page.amplslr.IsEmpty() { 1786 return nil 1787 } 1788 return *page.amplslr.Value 1789} 1790 1791// Creates a new instance of the AzureMonitorPrivateLinkScopeListResultPage type. 1792func NewAzureMonitorPrivateLinkScopeListResultPage(cur AzureMonitorPrivateLinkScopeListResult, getNextPage func(context.Context, AzureMonitorPrivateLinkScopeListResult) (AzureMonitorPrivateLinkScopeListResult, error)) AzureMonitorPrivateLinkScopeListResultPage { 1793 return AzureMonitorPrivateLinkScopeListResultPage{ 1794 fn: getNextPage, 1795 amplslr: cur, 1796 } 1797} 1798 1799// AzureMonitorPrivateLinkScopeProperties properties that define a Azure Monitor PrivateLinkScope resource. 1800type AzureMonitorPrivateLinkScopeProperties struct { 1801 // ProvisioningState - READ-ONLY; Current state of this PrivateLinkScope: whether or not is has been provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. Values will include Provisioning ,Succeeded, Canceled and Failed. 1802 ProvisioningState *string `json:"provisioningState,omitempty"` 1803 // PrivateEndpointConnections - READ-ONLY; List of private endpoint connections. 1804 PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` 1805} 1806 1807// MarshalJSON is the custom marshaler for AzureMonitorPrivateLinkScopeProperties. 1808func (amplsp AzureMonitorPrivateLinkScopeProperties) MarshalJSON() ([]byte, error) { 1809 objectMap := make(map[string]interface{}) 1810 return json.Marshal(objectMap) 1811} 1812 1813// AzureResource an azure resource object 1814type AzureResource struct { 1815 // ID - READ-ONLY; Azure resource Id 1816 ID *string `json:"id,omitempty"` 1817 // Name - READ-ONLY; Azure resource name 1818 Name *string `json:"name,omitempty"` 1819 // Type - READ-ONLY; Azure resource type 1820 Type *string `json:"type,omitempty"` 1821 // Kind - READ-ONLY; Azure resource kind 1822 Kind *string `json:"kind,omitempty"` 1823 // Identity - READ-ONLY; Azure resource identity 1824 Identity *string `json:"identity,omitempty"` 1825 // Location - Resource location 1826 Location *string `json:"location,omitempty"` 1827 // Tags - Resource tags 1828 Tags map[string]*string `json:"tags"` 1829} 1830 1831// MarshalJSON is the custom marshaler for AzureResource. 1832func (ar AzureResource) MarshalJSON() ([]byte, error) { 1833 objectMap := make(map[string]interface{}) 1834 if ar.Location != nil { 1835 objectMap["location"] = ar.Location 1836 } 1837 if ar.Tags != nil { 1838 objectMap["tags"] = ar.Tags 1839 } 1840 return json.Marshal(objectMap) 1841} 1842 1843// BaselineMetadata represents a baseline metadata value. 1844type BaselineMetadata struct { 1845 // Name - Name of the baseline metadata. 1846 Name *string `json:"name,omitempty"` 1847 // Value - Value of the baseline metadata. 1848 Value *string `json:"value,omitempty"` 1849} 1850 1851// ConfigurationAccessEndpointSpec definition of the endpoint used for accessing configuration. 1852type ConfigurationAccessEndpointSpec struct { 1853 // Endpoint - READ-ONLY; The endpoint. This property is READ-ONLY. 1854 Endpoint *string `json:"endpoint,omitempty"` 1855} 1856 1857// MarshalJSON is the custom marshaler for ConfigurationAccessEndpointSpec. 1858func (caes ConfigurationAccessEndpointSpec) MarshalJSON() ([]byte, error) { 1859 objectMap := make(map[string]interface{}) 1860 return json.Marshal(objectMap) 1861} 1862 1863// Criteria specifies the criteria for converting log to metric. 1864type Criteria struct { 1865 // MetricName - Name of the metric 1866 MetricName *string `json:"metricName,omitempty"` 1867 // Dimensions - List of Dimensions for creating metric 1868 Dimensions *[]Dimension `json:"dimensions,omitempty"` 1869} 1870 1871// DataCollectionEndpoint definition of data collection endpoint. 1872type DataCollectionEndpoint struct { 1873 // Description - Description of the data collection endpoint. 1874 Description *string `json:"description,omitempty"` 1875 // ImmutableID - The immutable ID of this data collection endpoint resource. This property is READ-ONLY. 1876 ImmutableID *string `json:"immutableId,omitempty"` 1877 // ConfigurationAccess - The endpoint used by agents to access their configuration. 1878 ConfigurationAccess *DataCollectionEndpointConfigurationAccess `json:"configurationAccess,omitempty"` 1879 // LogsIngestion - The endpoint used by clients to ingest logs. 1880 LogsIngestion *DataCollectionEndpointLogsIngestion `json:"logsIngestion,omitempty"` 1881 // NetworkAcls - Network access control rules for the endpoints. 1882 NetworkAcls *DataCollectionEndpointNetworkAcls `json:"networkAcls,omitempty"` 1883 // ProvisioningState - READ-ONLY; The resource provisioning state. This property is READ-ONLY. Possible values include: 'KnownDataCollectionEndpointProvisioningStateCreating', 'KnownDataCollectionEndpointProvisioningStateUpdating', 'KnownDataCollectionEndpointProvisioningStateDeleting', 'KnownDataCollectionEndpointProvisioningStateSucceeded', 'KnownDataCollectionEndpointProvisioningStateFailed' 1884 ProvisioningState KnownDataCollectionEndpointProvisioningState `json:"provisioningState,omitempty"` 1885} 1886 1887// MarshalJSON is the custom marshaler for DataCollectionEndpoint. 1888func (dce DataCollectionEndpoint) MarshalJSON() ([]byte, error) { 1889 objectMap := make(map[string]interface{}) 1890 if dce.Description != nil { 1891 objectMap["description"] = dce.Description 1892 } 1893 if dce.ImmutableID != nil { 1894 objectMap["immutableId"] = dce.ImmutableID 1895 } 1896 if dce.ConfigurationAccess != nil { 1897 objectMap["configurationAccess"] = dce.ConfigurationAccess 1898 } 1899 if dce.LogsIngestion != nil { 1900 objectMap["logsIngestion"] = dce.LogsIngestion 1901 } 1902 if dce.NetworkAcls != nil { 1903 objectMap["networkAcls"] = dce.NetworkAcls 1904 } 1905 return json.Marshal(objectMap) 1906} 1907 1908// DataCollectionEndpointConfigurationAccess the endpoint used by agents to access their configuration. 1909type DataCollectionEndpointConfigurationAccess struct { 1910 // Endpoint - READ-ONLY; The endpoint. This property is READ-ONLY. 1911 Endpoint *string `json:"endpoint,omitempty"` 1912} 1913 1914// MarshalJSON is the custom marshaler for DataCollectionEndpointConfigurationAccess. 1915func (dceA DataCollectionEndpointConfigurationAccess) MarshalJSON() ([]byte, error) { 1916 objectMap := make(map[string]interface{}) 1917 return json.Marshal(objectMap) 1918} 1919 1920// DataCollectionEndpointLogsIngestion the endpoint used by clients to ingest logs. 1921type DataCollectionEndpointLogsIngestion struct { 1922 // Endpoint - READ-ONLY; The endpoint. This property is READ-ONLY. 1923 Endpoint *string `json:"endpoint,omitempty"` 1924} 1925 1926// MarshalJSON is the custom marshaler for DataCollectionEndpointLogsIngestion. 1927func (dceI DataCollectionEndpointLogsIngestion) MarshalJSON() ([]byte, error) { 1928 objectMap := make(map[string]interface{}) 1929 return json.Marshal(objectMap) 1930} 1931 1932// DataCollectionEndpointNetworkAcls network access control rules for the endpoints. 1933type DataCollectionEndpointNetworkAcls struct { 1934 // PublicNetworkAccess - The configuration to set whether network access from public internet to the endpoints are allowed. Possible values include: 'KnownPublicNetworkAccessOptionsEnabled', 'KnownPublicNetworkAccessOptionsDisabled' 1935 PublicNetworkAccess KnownPublicNetworkAccessOptions `json:"publicNetworkAccess,omitempty"` 1936} 1937 1938// DataCollectionEndpointResource definition of ARM tracked top level resource. 1939type DataCollectionEndpointResource struct { 1940 autorest.Response `json:"-"` 1941 // DataCollectionEndpointResourceProperties - Resource properties. 1942 *DataCollectionEndpointResourceProperties `json:"properties,omitempty"` 1943 // Location - The geo-location where the resource lives. 1944 Location *string `json:"location,omitempty"` 1945 // Tags - Resource tags. 1946 Tags map[string]*string `json:"tags"` 1947 // Kind - The kind of the resource. Possible values include: 'KnownDataCollectionEndpointResourceKindLinux', 'KnownDataCollectionEndpointResourceKindWindows' 1948 Kind KnownDataCollectionEndpointResourceKind `json:"kind,omitempty"` 1949 // ID - READ-ONLY; Fully qualified ID of the resource. 1950 ID *string `json:"id,omitempty"` 1951 // Name - READ-ONLY; The name of the resource. 1952 Name *string `json:"name,omitempty"` 1953 // Type - READ-ONLY; The type of the resource. 1954 Type *string `json:"type,omitempty"` 1955 // Etag - READ-ONLY; Resource entity tag (ETag). 1956 Etag *string `json:"etag,omitempty"` 1957 // SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource. 1958 SystemData *DataCollectionEndpointResourceSystemData `json:"systemData,omitempty"` 1959} 1960 1961// MarshalJSON is the custom marshaler for DataCollectionEndpointResource. 1962func (dcer DataCollectionEndpointResource) MarshalJSON() ([]byte, error) { 1963 objectMap := make(map[string]interface{}) 1964 if dcer.DataCollectionEndpointResourceProperties != nil { 1965 objectMap["properties"] = dcer.DataCollectionEndpointResourceProperties 1966 } 1967 if dcer.Location != nil { 1968 objectMap["location"] = dcer.Location 1969 } 1970 if dcer.Tags != nil { 1971 objectMap["tags"] = dcer.Tags 1972 } 1973 if dcer.Kind != "" { 1974 objectMap["kind"] = dcer.Kind 1975 } 1976 return json.Marshal(objectMap) 1977} 1978 1979// UnmarshalJSON is the custom unmarshaler for DataCollectionEndpointResource struct. 1980func (dcer *DataCollectionEndpointResource) UnmarshalJSON(body []byte) error { 1981 var m map[string]*json.RawMessage 1982 err := json.Unmarshal(body, &m) 1983 if err != nil { 1984 return err 1985 } 1986 for k, v := range m { 1987 switch k { 1988 case "properties": 1989 if v != nil { 1990 var dataCollectionEndpointResourceProperties DataCollectionEndpointResourceProperties 1991 err = json.Unmarshal(*v, &dataCollectionEndpointResourceProperties) 1992 if err != nil { 1993 return err 1994 } 1995 dcer.DataCollectionEndpointResourceProperties = &dataCollectionEndpointResourceProperties 1996 } 1997 case "location": 1998 if v != nil { 1999 var location string 2000 err = json.Unmarshal(*v, &location) 2001 if err != nil { 2002 return err 2003 } 2004 dcer.Location = &location 2005 } 2006 case "tags": 2007 if v != nil { 2008 var tags map[string]*string 2009 err = json.Unmarshal(*v, &tags) 2010 if err != nil { 2011 return err 2012 } 2013 dcer.Tags = tags 2014 } 2015 case "kind": 2016 if v != nil { 2017 var kind KnownDataCollectionEndpointResourceKind 2018 err = json.Unmarshal(*v, &kind) 2019 if err != nil { 2020 return err 2021 } 2022 dcer.Kind = kind 2023 } 2024 case "id": 2025 if v != nil { 2026 var ID string 2027 err = json.Unmarshal(*v, &ID) 2028 if err != nil { 2029 return err 2030 } 2031 dcer.ID = &ID 2032 } 2033 case "name": 2034 if v != nil { 2035 var name string 2036 err = json.Unmarshal(*v, &name) 2037 if err != nil { 2038 return err 2039 } 2040 dcer.Name = &name 2041 } 2042 case "type": 2043 if v != nil { 2044 var typeVar string 2045 err = json.Unmarshal(*v, &typeVar) 2046 if err != nil { 2047 return err 2048 } 2049 dcer.Type = &typeVar 2050 } 2051 case "etag": 2052 if v != nil { 2053 var etag string 2054 err = json.Unmarshal(*v, &etag) 2055 if err != nil { 2056 return err 2057 } 2058 dcer.Etag = &etag 2059 } 2060 case "systemData": 2061 if v != nil { 2062 var systemData DataCollectionEndpointResourceSystemData 2063 err = json.Unmarshal(*v, &systemData) 2064 if err != nil { 2065 return err 2066 } 2067 dcer.SystemData = &systemData 2068 } 2069 } 2070 } 2071 2072 return nil 2073} 2074 2075// DataCollectionEndpointResourceListResult a pageable list of resources. 2076type DataCollectionEndpointResourceListResult struct { 2077 autorest.Response `json:"-"` 2078 // Value - A list of resources. 2079 Value *[]DataCollectionEndpointResource `json:"value,omitempty"` 2080 // NextLink - The URL to use for getting the next set of results. 2081 NextLink *string `json:"nextLink,omitempty"` 2082} 2083 2084// DataCollectionEndpointResourceListResultIterator provides access to a complete listing of 2085// DataCollectionEndpointResource values. 2086type DataCollectionEndpointResourceListResultIterator struct { 2087 i int 2088 page DataCollectionEndpointResourceListResultPage 2089} 2090 2091// NextWithContext advances to the next value. If there was an error making 2092// the request the iterator does not advance and the error is returned. 2093func (iter *DataCollectionEndpointResourceListResultIterator) NextWithContext(ctx context.Context) (err error) { 2094 if tracing.IsEnabled() { 2095 ctx = tracing.StartSpan(ctx, fqdn+"/DataCollectionEndpointResourceListResultIterator.NextWithContext") 2096 defer func() { 2097 sc := -1 2098 if iter.Response().Response.Response != nil { 2099 sc = iter.Response().Response.Response.StatusCode 2100 } 2101 tracing.EndSpan(ctx, sc, err) 2102 }() 2103 } 2104 iter.i++ 2105 if iter.i < len(iter.page.Values()) { 2106 return nil 2107 } 2108 err = iter.page.NextWithContext(ctx) 2109 if err != nil { 2110 iter.i-- 2111 return err 2112 } 2113 iter.i = 0 2114 return nil 2115} 2116 2117// Next advances to the next value. If there was an error making 2118// the request the iterator does not advance and the error is returned. 2119// Deprecated: Use NextWithContext() instead. 2120func (iter *DataCollectionEndpointResourceListResultIterator) Next() error { 2121 return iter.NextWithContext(context.Background()) 2122} 2123 2124// NotDone returns true if the enumeration should be started or is not yet complete. 2125func (iter DataCollectionEndpointResourceListResultIterator) NotDone() bool { 2126 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2127} 2128 2129// Response returns the raw server response from the last page request. 2130func (iter DataCollectionEndpointResourceListResultIterator) Response() DataCollectionEndpointResourceListResult { 2131 return iter.page.Response() 2132} 2133 2134// Value returns the current value or a zero-initialized value if the 2135// iterator has advanced beyond the end of the collection. 2136func (iter DataCollectionEndpointResourceListResultIterator) Value() DataCollectionEndpointResource { 2137 if !iter.page.NotDone() { 2138 return DataCollectionEndpointResource{} 2139 } 2140 return iter.page.Values()[iter.i] 2141} 2142 2143// Creates a new instance of the DataCollectionEndpointResourceListResultIterator type. 2144func NewDataCollectionEndpointResourceListResultIterator(page DataCollectionEndpointResourceListResultPage) DataCollectionEndpointResourceListResultIterator { 2145 return DataCollectionEndpointResourceListResultIterator{page: page} 2146} 2147 2148// IsEmpty returns true if the ListResult contains no values. 2149func (dcerlr DataCollectionEndpointResourceListResult) IsEmpty() bool { 2150 return dcerlr.Value == nil || len(*dcerlr.Value) == 0 2151} 2152 2153// hasNextLink returns true if the NextLink is not empty. 2154func (dcerlr DataCollectionEndpointResourceListResult) hasNextLink() bool { 2155 return dcerlr.NextLink != nil && len(*dcerlr.NextLink) != 0 2156} 2157 2158// dataCollectionEndpointResourceListResultPreparer prepares a request to retrieve the next set of results. 2159// It returns nil if no more results exist. 2160func (dcerlr DataCollectionEndpointResourceListResult) dataCollectionEndpointResourceListResultPreparer(ctx context.Context) (*http.Request, error) { 2161 if !dcerlr.hasNextLink() { 2162 return nil, nil 2163 } 2164 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2165 autorest.AsJSON(), 2166 autorest.AsGet(), 2167 autorest.WithBaseURL(to.String(dcerlr.NextLink))) 2168} 2169 2170// DataCollectionEndpointResourceListResultPage contains a page of DataCollectionEndpointResource values. 2171type DataCollectionEndpointResourceListResultPage struct { 2172 fn func(context.Context, DataCollectionEndpointResourceListResult) (DataCollectionEndpointResourceListResult, error) 2173 dcerlr DataCollectionEndpointResourceListResult 2174} 2175 2176// NextWithContext advances to the next page of values. If there was an error making 2177// the request the page does not advance and the error is returned. 2178func (page *DataCollectionEndpointResourceListResultPage) NextWithContext(ctx context.Context) (err error) { 2179 if tracing.IsEnabled() { 2180 ctx = tracing.StartSpan(ctx, fqdn+"/DataCollectionEndpointResourceListResultPage.NextWithContext") 2181 defer func() { 2182 sc := -1 2183 if page.Response().Response.Response != nil { 2184 sc = page.Response().Response.Response.StatusCode 2185 } 2186 tracing.EndSpan(ctx, sc, err) 2187 }() 2188 } 2189 for { 2190 next, err := page.fn(ctx, page.dcerlr) 2191 if err != nil { 2192 return err 2193 } 2194 page.dcerlr = next 2195 if !next.hasNextLink() || !next.IsEmpty() { 2196 break 2197 } 2198 } 2199 return nil 2200} 2201 2202// Next advances to the next page of values. If there was an error making 2203// the request the page does not advance and the error is returned. 2204// Deprecated: Use NextWithContext() instead. 2205func (page *DataCollectionEndpointResourceListResultPage) Next() error { 2206 return page.NextWithContext(context.Background()) 2207} 2208 2209// NotDone returns true if the page enumeration should be started or is not yet complete. 2210func (page DataCollectionEndpointResourceListResultPage) NotDone() bool { 2211 return !page.dcerlr.IsEmpty() 2212} 2213 2214// Response returns the raw server response from the last page request. 2215func (page DataCollectionEndpointResourceListResultPage) Response() DataCollectionEndpointResourceListResult { 2216 return page.dcerlr 2217} 2218 2219// Values returns the slice of values for the current page or nil if there are no values. 2220func (page DataCollectionEndpointResourceListResultPage) Values() []DataCollectionEndpointResource { 2221 if page.dcerlr.IsEmpty() { 2222 return nil 2223 } 2224 return *page.dcerlr.Value 2225} 2226 2227// Creates a new instance of the DataCollectionEndpointResourceListResultPage type. 2228func NewDataCollectionEndpointResourceListResultPage(cur DataCollectionEndpointResourceListResult, getNextPage func(context.Context, DataCollectionEndpointResourceListResult) (DataCollectionEndpointResourceListResult, error)) DataCollectionEndpointResourceListResultPage { 2229 return DataCollectionEndpointResourceListResultPage{ 2230 fn: getNextPage, 2231 dcerlr: cur, 2232 } 2233} 2234 2235// DataCollectionEndpointResourceProperties resource properties. 2236type DataCollectionEndpointResourceProperties struct { 2237 // Description - Description of the data collection endpoint. 2238 Description *string `json:"description,omitempty"` 2239 // ImmutableID - The immutable ID of this data collection endpoint resource. This property is READ-ONLY. 2240 ImmutableID *string `json:"immutableId,omitempty"` 2241 // ConfigurationAccess - The endpoint used by agents to access their configuration. 2242 ConfigurationAccess *DataCollectionEndpointConfigurationAccess `json:"configurationAccess,omitempty"` 2243 // LogsIngestion - The endpoint used by clients to ingest logs. 2244 LogsIngestion *DataCollectionEndpointLogsIngestion `json:"logsIngestion,omitempty"` 2245 // NetworkAcls - Network access control rules for the endpoints. 2246 NetworkAcls *DataCollectionEndpointNetworkAcls `json:"networkAcls,omitempty"` 2247 // ProvisioningState - READ-ONLY; The resource provisioning state. This property is READ-ONLY. Possible values include: 'KnownDataCollectionEndpointProvisioningStateCreating', 'KnownDataCollectionEndpointProvisioningStateUpdating', 'KnownDataCollectionEndpointProvisioningStateDeleting', 'KnownDataCollectionEndpointProvisioningStateSucceeded', 'KnownDataCollectionEndpointProvisioningStateFailed' 2248 ProvisioningState KnownDataCollectionEndpointProvisioningState `json:"provisioningState,omitempty"` 2249} 2250 2251// MarshalJSON is the custom marshaler for DataCollectionEndpointResourceProperties. 2252func (dcer DataCollectionEndpointResourceProperties) MarshalJSON() ([]byte, error) { 2253 objectMap := make(map[string]interface{}) 2254 if dcer.Description != nil { 2255 objectMap["description"] = dcer.Description 2256 } 2257 if dcer.ImmutableID != nil { 2258 objectMap["immutableId"] = dcer.ImmutableID 2259 } 2260 if dcer.ConfigurationAccess != nil { 2261 objectMap["configurationAccess"] = dcer.ConfigurationAccess 2262 } 2263 if dcer.LogsIngestion != nil { 2264 objectMap["logsIngestion"] = dcer.LogsIngestion 2265 } 2266 if dcer.NetworkAcls != nil { 2267 objectMap["networkAcls"] = dcer.NetworkAcls 2268 } 2269 return json.Marshal(objectMap) 2270} 2271 2272// DataCollectionEndpointResourceSystemData metadata pertaining to creation and last modification of the 2273// resource. 2274type DataCollectionEndpointResourceSystemData struct { 2275 // CreatedBy - The identity that created the resource. 2276 CreatedBy *string `json:"createdBy,omitempty"` 2277 // CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' 2278 CreatedByType CreatedByType `json:"createdByType,omitempty"` 2279 // CreatedAt - The timestamp of resource creation (UTC). 2280 CreatedAt *date.Time `json:"createdAt,omitempty"` 2281 // LastModifiedBy - The identity that last modified the resource. 2282 LastModifiedBy *string `json:"lastModifiedBy,omitempty"` 2283 // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' 2284 LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` 2285 // LastModifiedAt - The timestamp of resource last modification (UTC) 2286 LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` 2287} 2288 2289// DataCollectionRule definition of what monitoring data to collect and where that data should be sent. 2290type DataCollectionRule struct { 2291 // Description - Description of the data collection rule. 2292 Description *string `json:"description,omitempty"` 2293 // ImmutableID - READ-ONLY; The immutable ID of this data collection rule. This property is READ-ONLY. 2294 ImmutableID *string `json:"immutableId,omitempty"` 2295 // DataSources - The specification of data sources. 2296 // This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint. 2297 DataSources *DataCollectionRuleDataSources `json:"dataSources,omitempty"` 2298 // Destinations - The specification of destinations. 2299 Destinations *DataCollectionRuleDestinations `json:"destinations,omitempty"` 2300 // DataFlows - The specification of data flows. 2301 DataFlows *[]DataFlow `json:"dataFlows,omitempty"` 2302 // ProvisioningState - READ-ONLY; The resource provisioning state. Possible values include: 'KnownDataCollectionRuleProvisioningStateCreating', 'KnownDataCollectionRuleProvisioningStateUpdating', 'KnownDataCollectionRuleProvisioningStateDeleting', 'KnownDataCollectionRuleProvisioningStateSucceeded', 'KnownDataCollectionRuleProvisioningStateFailed' 2303 ProvisioningState KnownDataCollectionRuleProvisioningState `json:"provisioningState,omitempty"` 2304} 2305 2306// MarshalJSON is the custom marshaler for DataCollectionRule. 2307func (dcr DataCollectionRule) MarshalJSON() ([]byte, error) { 2308 objectMap := make(map[string]interface{}) 2309 if dcr.Description != nil { 2310 objectMap["description"] = dcr.Description 2311 } 2312 if dcr.DataSources != nil { 2313 objectMap["dataSources"] = dcr.DataSources 2314 } 2315 if dcr.Destinations != nil { 2316 objectMap["destinations"] = dcr.Destinations 2317 } 2318 if dcr.DataFlows != nil { 2319 objectMap["dataFlows"] = dcr.DataFlows 2320 } 2321 return json.Marshal(objectMap) 2322} 2323 2324// DataCollectionRuleAssociation definition of association of a data collection rule with a monitored Azure 2325// resource. 2326type DataCollectionRuleAssociation struct { 2327 // Description - Description of the association. 2328 Description *string `json:"description,omitempty"` 2329 // DataCollectionRuleID - The resource ID of the data collection rule that is to be associated. 2330 DataCollectionRuleID *string `json:"dataCollectionRuleId,omitempty"` 2331 // DataCollectionEndpointID - The resource ID of the data collection endpoint that is to be associated. 2332 DataCollectionEndpointID *string `json:"dataCollectionEndpointId,omitempty"` 2333 // ProvisioningState - READ-ONLY; The resource provisioning state. Possible values include: 'KnownDataCollectionRuleAssociationProvisioningStateCreating', 'KnownDataCollectionRuleAssociationProvisioningStateUpdating', 'KnownDataCollectionRuleAssociationProvisioningStateDeleting', 'KnownDataCollectionRuleAssociationProvisioningStateSucceeded', 'KnownDataCollectionRuleAssociationProvisioningStateFailed' 2334 ProvisioningState KnownDataCollectionRuleAssociationProvisioningState `json:"provisioningState,omitempty"` 2335} 2336 2337// MarshalJSON is the custom marshaler for DataCollectionRuleAssociation. 2338func (dcra DataCollectionRuleAssociation) MarshalJSON() ([]byte, error) { 2339 objectMap := make(map[string]interface{}) 2340 if dcra.Description != nil { 2341 objectMap["description"] = dcra.Description 2342 } 2343 if dcra.DataCollectionRuleID != nil { 2344 objectMap["dataCollectionRuleId"] = dcra.DataCollectionRuleID 2345 } 2346 if dcra.DataCollectionEndpointID != nil { 2347 objectMap["dataCollectionEndpointId"] = dcra.DataCollectionEndpointID 2348 } 2349 return json.Marshal(objectMap) 2350} 2351 2352// DataCollectionRuleAssociationProxyOnlyResource definition of generic ARM proxy resource. 2353type DataCollectionRuleAssociationProxyOnlyResource struct { 2354 autorest.Response `json:"-"` 2355 // DataCollectionRuleAssociationProxyOnlyResourceProperties - Resource properties. 2356 *DataCollectionRuleAssociationProxyOnlyResourceProperties `json:"properties,omitempty"` 2357 // ID - READ-ONLY; Fully qualified ID of the resource. 2358 ID *string `json:"id,omitempty"` 2359 // Name - READ-ONLY; The name of the resource. 2360 Name *string `json:"name,omitempty"` 2361 // Type - READ-ONLY; The type of the resource. 2362 Type *string `json:"type,omitempty"` 2363 // Etag - READ-ONLY; Resource entity tag (ETag). 2364 Etag *string `json:"etag,omitempty"` 2365 // SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource. 2366 SystemData *DataCollectionRuleAssociationProxyOnlyResourceSystemData `json:"systemData,omitempty"` 2367} 2368 2369// MarshalJSON is the custom marshaler for DataCollectionRuleAssociationProxyOnlyResource. 2370func (dcrapor DataCollectionRuleAssociationProxyOnlyResource) MarshalJSON() ([]byte, error) { 2371 objectMap := make(map[string]interface{}) 2372 if dcrapor.DataCollectionRuleAssociationProxyOnlyResourceProperties != nil { 2373 objectMap["properties"] = dcrapor.DataCollectionRuleAssociationProxyOnlyResourceProperties 2374 } 2375 return json.Marshal(objectMap) 2376} 2377 2378// UnmarshalJSON is the custom unmarshaler for DataCollectionRuleAssociationProxyOnlyResource struct. 2379func (dcrapor *DataCollectionRuleAssociationProxyOnlyResource) UnmarshalJSON(body []byte) error { 2380 var m map[string]*json.RawMessage 2381 err := json.Unmarshal(body, &m) 2382 if err != nil { 2383 return err 2384 } 2385 for k, v := range m { 2386 switch k { 2387 case "properties": 2388 if v != nil { 2389 var dataCollectionRuleAssociationProxyOnlyResourceProperties DataCollectionRuleAssociationProxyOnlyResourceProperties 2390 err = json.Unmarshal(*v, &dataCollectionRuleAssociationProxyOnlyResourceProperties) 2391 if err != nil { 2392 return err 2393 } 2394 dcrapor.DataCollectionRuleAssociationProxyOnlyResourceProperties = &dataCollectionRuleAssociationProxyOnlyResourceProperties 2395 } 2396 case "id": 2397 if v != nil { 2398 var ID string 2399 err = json.Unmarshal(*v, &ID) 2400 if err != nil { 2401 return err 2402 } 2403 dcrapor.ID = &ID 2404 } 2405 case "name": 2406 if v != nil { 2407 var name string 2408 err = json.Unmarshal(*v, &name) 2409 if err != nil { 2410 return err 2411 } 2412 dcrapor.Name = &name 2413 } 2414 case "type": 2415 if v != nil { 2416 var typeVar string 2417 err = json.Unmarshal(*v, &typeVar) 2418 if err != nil { 2419 return err 2420 } 2421 dcrapor.Type = &typeVar 2422 } 2423 case "etag": 2424 if v != nil { 2425 var etag string 2426 err = json.Unmarshal(*v, &etag) 2427 if err != nil { 2428 return err 2429 } 2430 dcrapor.Etag = &etag 2431 } 2432 case "systemData": 2433 if v != nil { 2434 var systemData DataCollectionRuleAssociationProxyOnlyResourceSystemData 2435 err = json.Unmarshal(*v, &systemData) 2436 if err != nil { 2437 return err 2438 } 2439 dcrapor.SystemData = &systemData 2440 } 2441 } 2442 } 2443 2444 return nil 2445} 2446 2447// DataCollectionRuleAssociationProxyOnlyResourceListResult a pageable list of resources. 2448type DataCollectionRuleAssociationProxyOnlyResourceListResult struct { 2449 autorest.Response `json:"-"` 2450 // Value - A list of resources. 2451 Value *[]DataCollectionRuleAssociationProxyOnlyResource `json:"value,omitempty"` 2452 // NextLink - The URL to use for getting the next set of results. 2453 NextLink *string `json:"nextLink,omitempty"` 2454} 2455 2456// DataCollectionRuleAssociationProxyOnlyResourceListResultIterator provides access to a complete listing 2457// of DataCollectionRuleAssociationProxyOnlyResource values. 2458type DataCollectionRuleAssociationProxyOnlyResourceListResultIterator struct { 2459 i int 2460 page DataCollectionRuleAssociationProxyOnlyResourceListResultPage 2461} 2462 2463// NextWithContext advances to the next value. If there was an error making 2464// the request the iterator does not advance and the error is returned. 2465func (iter *DataCollectionRuleAssociationProxyOnlyResourceListResultIterator) NextWithContext(ctx context.Context) (err error) { 2466 if tracing.IsEnabled() { 2467 ctx = tracing.StartSpan(ctx, fqdn+"/DataCollectionRuleAssociationProxyOnlyResourceListResultIterator.NextWithContext") 2468 defer func() { 2469 sc := -1 2470 if iter.Response().Response.Response != nil { 2471 sc = iter.Response().Response.Response.StatusCode 2472 } 2473 tracing.EndSpan(ctx, sc, err) 2474 }() 2475 } 2476 iter.i++ 2477 if iter.i < len(iter.page.Values()) { 2478 return nil 2479 } 2480 err = iter.page.NextWithContext(ctx) 2481 if err != nil { 2482 iter.i-- 2483 return err 2484 } 2485 iter.i = 0 2486 return nil 2487} 2488 2489// Next advances to the next value. If there was an error making 2490// the request the iterator does not advance and the error is returned. 2491// Deprecated: Use NextWithContext() instead. 2492func (iter *DataCollectionRuleAssociationProxyOnlyResourceListResultIterator) Next() error { 2493 return iter.NextWithContext(context.Background()) 2494} 2495 2496// NotDone returns true if the enumeration should be started or is not yet complete. 2497func (iter DataCollectionRuleAssociationProxyOnlyResourceListResultIterator) NotDone() bool { 2498 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2499} 2500 2501// Response returns the raw server response from the last page request. 2502func (iter DataCollectionRuleAssociationProxyOnlyResourceListResultIterator) Response() DataCollectionRuleAssociationProxyOnlyResourceListResult { 2503 return iter.page.Response() 2504} 2505 2506// Value returns the current value or a zero-initialized value if the 2507// iterator has advanced beyond the end of the collection. 2508func (iter DataCollectionRuleAssociationProxyOnlyResourceListResultIterator) Value() DataCollectionRuleAssociationProxyOnlyResource { 2509 if !iter.page.NotDone() { 2510 return DataCollectionRuleAssociationProxyOnlyResource{} 2511 } 2512 return iter.page.Values()[iter.i] 2513} 2514 2515// Creates a new instance of the DataCollectionRuleAssociationProxyOnlyResourceListResultIterator type. 2516func NewDataCollectionRuleAssociationProxyOnlyResourceListResultIterator(page DataCollectionRuleAssociationProxyOnlyResourceListResultPage) DataCollectionRuleAssociationProxyOnlyResourceListResultIterator { 2517 return DataCollectionRuleAssociationProxyOnlyResourceListResultIterator{page: page} 2518} 2519 2520// IsEmpty returns true if the ListResult contains no values. 2521func (dcraporlr DataCollectionRuleAssociationProxyOnlyResourceListResult) IsEmpty() bool { 2522 return dcraporlr.Value == nil || len(*dcraporlr.Value) == 0 2523} 2524 2525// hasNextLink returns true if the NextLink is not empty. 2526func (dcraporlr DataCollectionRuleAssociationProxyOnlyResourceListResult) hasNextLink() bool { 2527 return dcraporlr.NextLink != nil && len(*dcraporlr.NextLink) != 0 2528} 2529 2530// dataCollectionRuleAssociationProxyOnlyResourceListResultPreparer prepares a request to retrieve the next set of results. 2531// It returns nil if no more results exist. 2532func (dcraporlr DataCollectionRuleAssociationProxyOnlyResourceListResult) dataCollectionRuleAssociationProxyOnlyResourceListResultPreparer(ctx context.Context) (*http.Request, error) { 2533 if !dcraporlr.hasNextLink() { 2534 return nil, nil 2535 } 2536 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2537 autorest.AsJSON(), 2538 autorest.AsGet(), 2539 autorest.WithBaseURL(to.String(dcraporlr.NextLink))) 2540} 2541 2542// DataCollectionRuleAssociationProxyOnlyResourceListResultPage contains a page of 2543// DataCollectionRuleAssociationProxyOnlyResource values. 2544type DataCollectionRuleAssociationProxyOnlyResourceListResultPage struct { 2545 fn func(context.Context, DataCollectionRuleAssociationProxyOnlyResourceListResult) (DataCollectionRuleAssociationProxyOnlyResourceListResult, error) 2546 dcraporlr DataCollectionRuleAssociationProxyOnlyResourceListResult 2547} 2548 2549// NextWithContext advances to the next page of values. If there was an error making 2550// the request the page does not advance and the error is returned. 2551func (page *DataCollectionRuleAssociationProxyOnlyResourceListResultPage) NextWithContext(ctx context.Context) (err error) { 2552 if tracing.IsEnabled() { 2553 ctx = tracing.StartSpan(ctx, fqdn+"/DataCollectionRuleAssociationProxyOnlyResourceListResultPage.NextWithContext") 2554 defer func() { 2555 sc := -1 2556 if page.Response().Response.Response != nil { 2557 sc = page.Response().Response.Response.StatusCode 2558 } 2559 tracing.EndSpan(ctx, sc, err) 2560 }() 2561 } 2562 for { 2563 next, err := page.fn(ctx, page.dcraporlr) 2564 if err != nil { 2565 return err 2566 } 2567 page.dcraporlr = next 2568 if !next.hasNextLink() || !next.IsEmpty() { 2569 break 2570 } 2571 } 2572 return nil 2573} 2574 2575// Next advances to the next page of values. If there was an error making 2576// the request the page does not advance and the error is returned. 2577// Deprecated: Use NextWithContext() instead. 2578func (page *DataCollectionRuleAssociationProxyOnlyResourceListResultPage) Next() error { 2579 return page.NextWithContext(context.Background()) 2580} 2581 2582// NotDone returns true if the page enumeration should be started or is not yet complete. 2583func (page DataCollectionRuleAssociationProxyOnlyResourceListResultPage) NotDone() bool { 2584 return !page.dcraporlr.IsEmpty() 2585} 2586 2587// Response returns the raw server response from the last page request. 2588func (page DataCollectionRuleAssociationProxyOnlyResourceListResultPage) Response() DataCollectionRuleAssociationProxyOnlyResourceListResult { 2589 return page.dcraporlr 2590} 2591 2592// Values returns the slice of values for the current page or nil if there are no values. 2593func (page DataCollectionRuleAssociationProxyOnlyResourceListResultPage) Values() []DataCollectionRuleAssociationProxyOnlyResource { 2594 if page.dcraporlr.IsEmpty() { 2595 return nil 2596 } 2597 return *page.dcraporlr.Value 2598} 2599 2600// Creates a new instance of the DataCollectionRuleAssociationProxyOnlyResourceListResultPage type. 2601func NewDataCollectionRuleAssociationProxyOnlyResourceListResultPage(cur DataCollectionRuleAssociationProxyOnlyResourceListResult, getNextPage func(context.Context, DataCollectionRuleAssociationProxyOnlyResourceListResult) (DataCollectionRuleAssociationProxyOnlyResourceListResult, error)) DataCollectionRuleAssociationProxyOnlyResourceListResultPage { 2602 return DataCollectionRuleAssociationProxyOnlyResourceListResultPage{ 2603 fn: getNextPage, 2604 dcraporlr: cur, 2605 } 2606} 2607 2608// DataCollectionRuleAssociationProxyOnlyResourceProperties resource properties. 2609type DataCollectionRuleAssociationProxyOnlyResourceProperties struct { 2610 // Description - Description of the association. 2611 Description *string `json:"description,omitempty"` 2612 // DataCollectionRuleID - The resource ID of the data collection rule that is to be associated. 2613 DataCollectionRuleID *string `json:"dataCollectionRuleId,omitempty"` 2614 // DataCollectionEndpointID - The resource ID of the data collection endpoint that is to be associated. 2615 DataCollectionEndpointID *string `json:"dataCollectionEndpointId,omitempty"` 2616 // ProvisioningState - READ-ONLY; The resource provisioning state. Possible values include: 'KnownDataCollectionRuleAssociationProvisioningStateCreating', 'KnownDataCollectionRuleAssociationProvisioningStateUpdating', 'KnownDataCollectionRuleAssociationProvisioningStateDeleting', 'KnownDataCollectionRuleAssociationProvisioningStateSucceeded', 'KnownDataCollectionRuleAssociationProvisioningStateFailed' 2617 ProvisioningState KnownDataCollectionRuleAssociationProvisioningState `json:"provisioningState,omitempty"` 2618} 2619 2620// MarshalJSON is the custom marshaler for DataCollectionRuleAssociationProxyOnlyResourceProperties. 2621func (dcrapor DataCollectionRuleAssociationProxyOnlyResourceProperties) MarshalJSON() ([]byte, error) { 2622 objectMap := make(map[string]interface{}) 2623 if dcrapor.Description != nil { 2624 objectMap["description"] = dcrapor.Description 2625 } 2626 if dcrapor.DataCollectionRuleID != nil { 2627 objectMap["dataCollectionRuleId"] = dcrapor.DataCollectionRuleID 2628 } 2629 if dcrapor.DataCollectionEndpointID != nil { 2630 objectMap["dataCollectionEndpointId"] = dcrapor.DataCollectionEndpointID 2631 } 2632 return json.Marshal(objectMap) 2633} 2634 2635// DataCollectionRuleAssociationProxyOnlyResourceSystemData metadata pertaining to creation and last 2636// modification of the resource. 2637type DataCollectionRuleAssociationProxyOnlyResourceSystemData struct { 2638 // CreatedBy - The identity that created the resource. 2639 CreatedBy *string `json:"createdBy,omitempty"` 2640 // CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' 2641 CreatedByType CreatedByType `json:"createdByType,omitempty"` 2642 // CreatedAt - The timestamp of resource creation (UTC). 2643 CreatedAt *date.Time `json:"createdAt,omitempty"` 2644 // LastModifiedBy - The identity that last modified the resource. 2645 LastModifiedBy *string `json:"lastModifiedBy,omitempty"` 2646 // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' 2647 LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` 2648 // LastModifiedAt - The timestamp of resource last modification (UTC) 2649 LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` 2650} 2651 2652// DataCollectionRuleDataSources the specification of data sources. 2653// This property is optional and can be omitted if the rule is meant to be used via direct calls to the 2654// provisioned endpoint. 2655type DataCollectionRuleDataSources struct { 2656 // PerformanceCounters - The list of performance counter data source configurations. 2657 PerformanceCounters *[]PerfCounterDataSource `json:"performanceCounters,omitempty"` 2658 // WindowsEventLogs - The list of Windows Event Log data source configurations. 2659 WindowsEventLogs *[]WindowsEventLogDataSource `json:"windowsEventLogs,omitempty"` 2660 // Syslog - The list of Syslog data source configurations. 2661 Syslog *[]SyslogDataSource `json:"syslog,omitempty"` 2662 // Extensions - The list of Azure VM extension data source configurations. 2663 Extensions *[]ExtensionDataSource `json:"extensions,omitempty"` 2664} 2665 2666// DataCollectionRuleDestinations the specification of destinations. 2667type DataCollectionRuleDestinations struct { 2668 // LogAnalytics - List of Log Analytics destinations. 2669 LogAnalytics *[]LogAnalyticsDestination `json:"logAnalytics,omitempty"` 2670 // AzureMonitorMetrics - Azure Monitor Metrics destination. 2671 AzureMonitorMetrics *DestinationsSpecAzureMonitorMetrics `json:"azureMonitorMetrics,omitempty"` 2672} 2673 2674// DataCollectionRuleResource definition of ARM tracked top level resource. 2675type DataCollectionRuleResource struct { 2676 autorest.Response `json:"-"` 2677 // DataCollectionRuleResourceProperties - Resource properties. 2678 *DataCollectionRuleResourceProperties `json:"properties,omitempty"` 2679 // Location - The geo-location where the resource lives. 2680 Location *string `json:"location,omitempty"` 2681 // Tags - Resource tags. 2682 Tags map[string]*string `json:"tags"` 2683 // Kind - The kind of the resource. Possible values include: 'KnownDataCollectionRuleResourceKindLinux', 'KnownDataCollectionRuleResourceKindWindows' 2684 Kind KnownDataCollectionRuleResourceKind `json:"kind,omitempty"` 2685 // ID - READ-ONLY; Fully qualified ID of the resource. 2686 ID *string `json:"id,omitempty"` 2687 // Name - READ-ONLY; The name of the resource. 2688 Name *string `json:"name,omitempty"` 2689 // Type - READ-ONLY; The type of the resource. 2690 Type *string `json:"type,omitempty"` 2691 // Etag - READ-ONLY; Resource entity tag (ETag). 2692 Etag *string `json:"etag,omitempty"` 2693 // SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource. 2694 SystemData *DataCollectionRuleResourceSystemData `json:"systemData,omitempty"` 2695} 2696 2697// MarshalJSON is the custom marshaler for DataCollectionRuleResource. 2698func (dcrr DataCollectionRuleResource) MarshalJSON() ([]byte, error) { 2699 objectMap := make(map[string]interface{}) 2700 if dcrr.DataCollectionRuleResourceProperties != nil { 2701 objectMap["properties"] = dcrr.DataCollectionRuleResourceProperties 2702 } 2703 if dcrr.Location != nil { 2704 objectMap["location"] = dcrr.Location 2705 } 2706 if dcrr.Tags != nil { 2707 objectMap["tags"] = dcrr.Tags 2708 } 2709 if dcrr.Kind != "" { 2710 objectMap["kind"] = dcrr.Kind 2711 } 2712 return json.Marshal(objectMap) 2713} 2714 2715// UnmarshalJSON is the custom unmarshaler for DataCollectionRuleResource struct. 2716func (dcrr *DataCollectionRuleResource) UnmarshalJSON(body []byte) error { 2717 var m map[string]*json.RawMessage 2718 err := json.Unmarshal(body, &m) 2719 if err != nil { 2720 return err 2721 } 2722 for k, v := range m { 2723 switch k { 2724 case "properties": 2725 if v != nil { 2726 var dataCollectionRuleResourceProperties DataCollectionRuleResourceProperties 2727 err = json.Unmarshal(*v, &dataCollectionRuleResourceProperties) 2728 if err != nil { 2729 return err 2730 } 2731 dcrr.DataCollectionRuleResourceProperties = &dataCollectionRuleResourceProperties 2732 } 2733 case "location": 2734 if v != nil { 2735 var location string 2736 err = json.Unmarshal(*v, &location) 2737 if err != nil { 2738 return err 2739 } 2740 dcrr.Location = &location 2741 } 2742 case "tags": 2743 if v != nil { 2744 var tags map[string]*string 2745 err = json.Unmarshal(*v, &tags) 2746 if err != nil { 2747 return err 2748 } 2749 dcrr.Tags = tags 2750 } 2751 case "kind": 2752 if v != nil { 2753 var kind KnownDataCollectionRuleResourceKind 2754 err = json.Unmarshal(*v, &kind) 2755 if err != nil { 2756 return err 2757 } 2758 dcrr.Kind = kind 2759 } 2760 case "id": 2761 if v != nil { 2762 var ID string 2763 err = json.Unmarshal(*v, &ID) 2764 if err != nil { 2765 return err 2766 } 2767 dcrr.ID = &ID 2768 } 2769 case "name": 2770 if v != nil { 2771 var name string 2772 err = json.Unmarshal(*v, &name) 2773 if err != nil { 2774 return err 2775 } 2776 dcrr.Name = &name 2777 } 2778 case "type": 2779 if v != nil { 2780 var typeVar string 2781 err = json.Unmarshal(*v, &typeVar) 2782 if err != nil { 2783 return err 2784 } 2785 dcrr.Type = &typeVar 2786 } 2787 case "etag": 2788 if v != nil { 2789 var etag string 2790 err = json.Unmarshal(*v, &etag) 2791 if err != nil { 2792 return err 2793 } 2794 dcrr.Etag = &etag 2795 } 2796 case "systemData": 2797 if v != nil { 2798 var systemData DataCollectionRuleResourceSystemData 2799 err = json.Unmarshal(*v, &systemData) 2800 if err != nil { 2801 return err 2802 } 2803 dcrr.SystemData = &systemData 2804 } 2805 } 2806 } 2807 2808 return nil 2809} 2810 2811// DataCollectionRuleResourceListResult a pageable list of resources. 2812type DataCollectionRuleResourceListResult struct { 2813 autorest.Response `json:"-"` 2814 // Value - A list of resources. 2815 Value *[]DataCollectionRuleResource `json:"value,omitempty"` 2816 // NextLink - The URL to use for getting the next set of results. 2817 NextLink *string `json:"nextLink,omitempty"` 2818} 2819 2820// DataCollectionRuleResourceListResultIterator provides access to a complete listing of 2821// DataCollectionRuleResource values. 2822type DataCollectionRuleResourceListResultIterator struct { 2823 i int 2824 page DataCollectionRuleResourceListResultPage 2825} 2826 2827// NextWithContext advances to the next value. If there was an error making 2828// the request the iterator does not advance and the error is returned. 2829func (iter *DataCollectionRuleResourceListResultIterator) NextWithContext(ctx context.Context) (err error) { 2830 if tracing.IsEnabled() { 2831 ctx = tracing.StartSpan(ctx, fqdn+"/DataCollectionRuleResourceListResultIterator.NextWithContext") 2832 defer func() { 2833 sc := -1 2834 if iter.Response().Response.Response != nil { 2835 sc = iter.Response().Response.Response.StatusCode 2836 } 2837 tracing.EndSpan(ctx, sc, err) 2838 }() 2839 } 2840 iter.i++ 2841 if iter.i < len(iter.page.Values()) { 2842 return nil 2843 } 2844 err = iter.page.NextWithContext(ctx) 2845 if err != nil { 2846 iter.i-- 2847 return err 2848 } 2849 iter.i = 0 2850 return nil 2851} 2852 2853// Next advances to the next value. If there was an error making 2854// the request the iterator does not advance and the error is returned. 2855// Deprecated: Use NextWithContext() instead. 2856func (iter *DataCollectionRuleResourceListResultIterator) Next() error { 2857 return iter.NextWithContext(context.Background()) 2858} 2859 2860// NotDone returns true if the enumeration should be started or is not yet complete. 2861func (iter DataCollectionRuleResourceListResultIterator) NotDone() bool { 2862 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2863} 2864 2865// Response returns the raw server response from the last page request. 2866func (iter DataCollectionRuleResourceListResultIterator) Response() DataCollectionRuleResourceListResult { 2867 return iter.page.Response() 2868} 2869 2870// Value returns the current value or a zero-initialized value if the 2871// iterator has advanced beyond the end of the collection. 2872func (iter DataCollectionRuleResourceListResultIterator) Value() DataCollectionRuleResource { 2873 if !iter.page.NotDone() { 2874 return DataCollectionRuleResource{} 2875 } 2876 return iter.page.Values()[iter.i] 2877} 2878 2879// Creates a new instance of the DataCollectionRuleResourceListResultIterator type. 2880func NewDataCollectionRuleResourceListResultIterator(page DataCollectionRuleResourceListResultPage) DataCollectionRuleResourceListResultIterator { 2881 return DataCollectionRuleResourceListResultIterator{page: page} 2882} 2883 2884// IsEmpty returns true if the ListResult contains no values. 2885func (dcrrlr DataCollectionRuleResourceListResult) IsEmpty() bool { 2886 return dcrrlr.Value == nil || len(*dcrrlr.Value) == 0 2887} 2888 2889// hasNextLink returns true if the NextLink is not empty. 2890func (dcrrlr DataCollectionRuleResourceListResult) hasNextLink() bool { 2891 return dcrrlr.NextLink != nil && len(*dcrrlr.NextLink) != 0 2892} 2893 2894// dataCollectionRuleResourceListResultPreparer prepares a request to retrieve the next set of results. 2895// It returns nil if no more results exist. 2896func (dcrrlr DataCollectionRuleResourceListResult) dataCollectionRuleResourceListResultPreparer(ctx context.Context) (*http.Request, error) { 2897 if !dcrrlr.hasNextLink() { 2898 return nil, nil 2899 } 2900 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2901 autorest.AsJSON(), 2902 autorest.AsGet(), 2903 autorest.WithBaseURL(to.String(dcrrlr.NextLink))) 2904} 2905 2906// DataCollectionRuleResourceListResultPage contains a page of DataCollectionRuleResource values. 2907type DataCollectionRuleResourceListResultPage struct { 2908 fn func(context.Context, DataCollectionRuleResourceListResult) (DataCollectionRuleResourceListResult, error) 2909 dcrrlr DataCollectionRuleResourceListResult 2910} 2911 2912// NextWithContext advances to the next page of values. If there was an error making 2913// the request the page does not advance and the error is returned. 2914func (page *DataCollectionRuleResourceListResultPage) NextWithContext(ctx context.Context) (err error) { 2915 if tracing.IsEnabled() { 2916 ctx = tracing.StartSpan(ctx, fqdn+"/DataCollectionRuleResourceListResultPage.NextWithContext") 2917 defer func() { 2918 sc := -1 2919 if page.Response().Response.Response != nil { 2920 sc = page.Response().Response.Response.StatusCode 2921 } 2922 tracing.EndSpan(ctx, sc, err) 2923 }() 2924 } 2925 for { 2926 next, err := page.fn(ctx, page.dcrrlr) 2927 if err != nil { 2928 return err 2929 } 2930 page.dcrrlr = next 2931 if !next.hasNextLink() || !next.IsEmpty() { 2932 break 2933 } 2934 } 2935 return nil 2936} 2937 2938// Next advances to the next page of values. If there was an error making 2939// the request the page does not advance and the error is returned. 2940// Deprecated: Use NextWithContext() instead. 2941func (page *DataCollectionRuleResourceListResultPage) Next() error { 2942 return page.NextWithContext(context.Background()) 2943} 2944 2945// NotDone returns true if the page enumeration should be started or is not yet complete. 2946func (page DataCollectionRuleResourceListResultPage) NotDone() bool { 2947 return !page.dcrrlr.IsEmpty() 2948} 2949 2950// Response returns the raw server response from the last page request. 2951func (page DataCollectionRuleResourceListResultPage) Response() DataCollectionRuleResourceListResult { 2952 return page.dcrrlr 2953} 2954 2955// Values returns the slice of values for the current page or nil if there are no values. 2956func (page DataCollectionRuleResourceListResultPage) Values() []DataCollectionRuleResource { 2957 if page.dcrrlr.IsEmpty() { 2958 return nil 2959 } 2960 return *page.dcrrlr.Value 2961} 2962 2963// Creates a new instance of the DataCollectionRuleResourceListResultPage type. 2964func NewDataCollectionRuleResourceListResultPage(cur DataCollectionRuleResourceListResult, getNextPage func(context.Context, DataCollectionRuleResourceListResult) (DataCollectionRuleResourceListResult, error)) DataCollectionRuleResourceListResultPage { 2965 return DataCollectionRuleResourceListResultPage{ 2966 fn: getNextPage, 2967 dcrrlr: cur, 2968 } 2969} 2970 2971// DataCollectionRuleResourceProperties resource properties. 2972type DataCollectionRuleResourceProperties struct { 2973 // Description - Description of the data collection rule. 2974 Description *string `json:"description,omitempty"` 2975 // ImmutableID - READ-ONLY; The immutable ID of this data collection rule. This property is READ-ONLY. 2976 ImmutableID *string `json:"immutableId,omitempty"` 2977 // DataSources - The specification of data sources. 2978 // This property is optional and can be omitted if the rule is meant to be used via direct calls to the provisioned endpoint. 2979 DataSources *DataCollectionRuleDataSources `json:"dataSources,omitempty"` 2980 // Destinations - The specification of destinations. 2981 Destinations *DataCollectionRuleDestinations `json:"destinations,omitempty"` 2982 // DataFlows - The specification of data flows. 2983 DataFlows *[]DataFlow `json:"dataFlows,omitempty"` 2984 // ProvisioningState - READ-ONLY; The resource provisioning state. Possible values include: 'KnownDataCollectionRuleProvisioningStateCreating', 'KnownDataCollectionRuleProvisioningStateUpdating', 'KnownDataCollectionRuleProvisioningStateDeleting', 'KnownDataCollectionRuleProvisioningStateSucceeded', 'KnownDataCollectionRuleProvisioningStateFailed' 2985 ProvisioningState KnownDataCollectionRuleProvisioningState `json:"provisioningState,omitempty"` 2986} 2987 2988// MarshalJSON is the custom marshaler for DataCollectionRuleResourceProperties. 2989func (dcrr DataCollectionRuleResourceProperties) MarshalJSON() ([]byte, error) { 2990 objectMap := make(map[string]interface{}) 2991 if dcrr.Description != nil { 2992 objectMap["description"] = dcrr.Description 2993 } 2994 if dcrr.DataSources != nil { 2995 objectMap["dataSources"] = dcrr.DataSources 2996 } 2997 if dcrr.Destinations != nil { 2998 objectMap["destinations"] = dcrr.Destinations 2999 } 3000 if dcrr.DataFlows != nil { 3001 objectMap["dataFlows"] = dcrr.DataFlows 3002 } 3003 return json.Marshal(objectMap) 3004} 3005 3006// DataCollectionRuleResourceSystemData metadata pertaining to creation and last modification of the 3007// resource. 3008type DataCollectionRuleResourceSystemData struct { 3009 // CreatedBy - The identity that created the resource. 3010 CreatedBy *string `json:"createdBy,omitempty"` 3011 // CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' 3012 CreatedByType CreatedByType `json:"createdByType,omitempty"` 3013 // CreatedAt - The timestamp of resource creation (UTC). 3014 CreatedAt *date.Time `json:"createdAt,omitempty"` 3015 // LastModifiedBy - The identity that last modified the resource. 3016 LastModifiedBy *string `json:"lastModifiedBy,omitempty"` 3017 // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' 3018 LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` 3019 // LastModifiedAt - The timestamp of resource last modification (UTC) 3020 LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` 3021} 3022 3023// DataContainer information about a container with data for a given resource. 3024type DataContainer struct { 3025 // Workspace - Log Analytics workspace information. 3026 Workspace *WorkspaceInfo `json:"workspace,omitempty"` 3027} 3028 3029// DataFlow definition of which streams are sent to which destinations. 3030type DataFlow struct { 3031 // Streams - List of streams for this data flow. 3032 Streams *[]KnownDataFlowStreams `json:"streams,omitempty"` 3033 // Destinations - List of destinations for this data flow. 3034 Destinations *[]string `json:"destinations,omitempty"` 3035} 3036 3037// DataSourcesSpec specification of data sources that will be collected. 3038type DataSourcesSpec struct { 3039 // PerformanceCounters - The list of performance counter data source configurations. 3040 PerformanceCounters *[]PerfCounterDataSource `json:"performanceCounters,omitempty"` 3041 // WindowsEventLogs - The list of Windows Event Log data source configurations. 3042 WindowsEventLogs *[]WindowsEventLogDataSource `json:"windowsEventLogs,omitempty"` 3043 // Syslog - The list of Syslog data source configurations. 3044 Syslog *[]SyslogDataSource `json:"syslog,omitempty"` 3045 // Extensions - The list of Azure VM extension data source configurations. 3046 Extensions *[]ExtensionDataSource `json:"extensions,omitempty"` 3047} 3048 3049// DestinationsSpec specification of destinations that can be used in data flows. 3050type DestinationsSpec struct { 3051 // LogAnalytics - List of Log Analytics destinations. 3052 LogAnalytics *[]LogAnalyticsDestination `json:"logAnalytics,omitempty"` 3053 // AzureMonitorMetrics - Azure Monitor Metrics destination. 3054 AzureMonitorMetrics *DestinationsSpecAzureMonitorMetrics `json:"azureMonitorMetrics,omitempty"` 3055} 3056 3057// DestinationsSpecAzureMonitorMetrics azure Monitor Metrics destination. 3058type DestinationsSpecAzureMonitorMetrics struct { 3059 // Name - A friendly name for the destination. 3060 // This name should be unique across all destinations (regardless of type) within the data collection rule. 3061 Name *string `json:"name,omitempty"` 3062} 3063 3064// DiagnosticSettings the diagnostic settings. 3065type DiagnosticSettings struct { 3066 // StorageAccountID - The resource ID of the storage account to which you would like to send Diagnostic Logs. 3067 StorageAccountID *string `json:"storageAccountId,omitempty"` 3068 // ServiceBusRuleID - The service bus rule Id of the diagnostic setting. This is here to maintain backwards compatibility. 3069 ServiceBusRuleID *string `json:"serviceBusRuleId,omitempty"` 3070 // EventHubAuthorizationRuleID - The resource Id for the event hub authorization rule. 3071 EventHubAuthorizationRuleID *string `json:"eventHubAuthorizationRuleId,omitempty"` 3072 // EventHubName - The name of the event hub. If none is specified, the default event hub will be selected. 3073 EventHubName *string `json:"eventHubName,omitempty"` 3074 // Metrics - The list of metric settings. 3075 Metrics *[]MetricSettings `json:"metrics,omitempty"` 3076 // Logs - The list of logs settings. 3077 Logs *[]LogSettings `json:"logs,omitempty"` 3078 // WorkspaceID - The full ARM resource ID of the Log Analytics workspace to which you would like to send Diagnostic Logs. Example: /subscriptions/4b9e8510-67ab-4e9a-95a9-e2f1e570ea9c/resourceGroups/insights-integration/providers/Microsoft.OperationalInsights/workspaces/viruela2 3079 WorkspaceID *string `json:"workspaceId,omitempty"` 3080 // LogAnalyticsDestinationType - A string indicating whether the export to Log Analytics should use the default destination type, i.e. AzureDiagnostics, or use a destination type constructed as follows: <normalized service identity>_<normalized category name>. Possible values are: Dedicated and null (null is default.) 3081 LogAnalyticsDestinationType *string `json:"logAnalyticsDestinationType,omitempty"` 3082} 3083 3084// DiagnosticSettingsCategory the diagnostic settings Category. 3085type DiagnosticSettingsCategory struct { 3086 // CategoryType - The type of the diagnostic settings category. Possible values include: 'CategoryTypeMetrics', 'CategoryTypeLogs' 3087 CategoryType CategoryType `json:"categoryType,omitempty"` 3088} 3089 3090// DiagnosticSettingsCategoryResource the diagnostic settings category resource. 3091type DiagnosticSettingsCategoryResource struct { 3092 autorest.Response `json:"-"` 3093 // DiagnosticSettingsCategory - The properties of a Diagnostic Settings Category. 3094 *DiagnosticSettingsCategory `json:"properties,omitempty"` 3095 // ID - READ-ONLY; Azure resource Id 3096 ID *string `json:"id,omitempty"` 3097 // Name - READ-ONLY; Azure resource name 3098 Name *string `json:"name,omitempty"` 3099 // Type - READ-ONLY; Azure resource type 3100 Type *string `json:"type,omitempty"` 3101} 3102 3103// MarshalJSON is the custom marshaler for DiagnosticSettingsCategoryResource. 3104func (dscr DiagnosticSettingsCategoryResource) MarshalJSON() ([]byte, error) { 3105 objectMap := make(map[string]interface{}) 3106 if dscr.DiagnosticSettingsCategory != nil { 3107 objectMap["properties"] = dscr.DiagnosticSettingsCategory 3108 } 3109 return json.Marshal(objectMap) 3110} 3111 3112// UnmarshalJSON is the custom unmarshaler for DiagnosticSettingsCategoryResource struct. 3113func (dscr *DiagnosticSettingsCategoryResource) UnmarshalJSON(body []byte) error { 3114 var m map[string]*json.RawMessage 3115 err := json.Unmarshal(body, &m) 3116 if err != nil { 3117 return err 3118 } 3119 for k, v := range m { 3120 switch k { 3121 case "properties": 3122 if v != nil { 3123 var diagnosticSettingsCategory DiagnosticSettingsCategory 3124 err = json.Unmarshal(*v, &diagnosticSettingsCategory) 3125 if err != nil { 3126 return err 3127 } 3128 dscr.DiagnosticSettingsCategory = &diagnosticSettingsCategory 3129 } 3130 case "id": 3131 if v != nil { 3132 var ID string 3133 err = json.Unmarshal(*v, &ID) 3134 if err != nil { 3135 return err 3136 } 3137 dscr.ID = &ID 3138 } 3139 case "name": 3140 if v != nil { 3141 var name string 3142 err = json.Unmarshal(*v, &name) 3143 if err != nil { 3144 return err 3145 } 3146 dscr.Name = &name 3147 } 3148 case "type": 3149 if v != nil { 3150 var typeVar string 3151 err = json.Unmarshal(*v, &typeVar) 3152 if err != nil { 3153 return err 3154 } 3155 dscr.Type = &typeVar 3156 } 3157 } 3158 } 3159 3160 return nil 3161} 3162 3163// DiagnosticSettingsCategoryResourceCollection represents a collection of diagnostic setting category 3164// resources. 3165type DiagnosticSettingsCategoryResourceCollection struct { 3166 autorest.Response `json:"-"` 3167 // Value - The collection of diagnostic settings category resources. 3168 Value *[]DiagnosticSettingsCategoryResource `json:"value,omitempty"` 3169} 3170 3171// DiagnosticSettingsResource the diagnostic setting resource. 3172type DiagnosticSettingsResource struct { 3173 autorest.Response `json:"-"` 3174 // DiagnosticSettings - Properties of a Diagnostic Settings Resource. 3175 *DiagnosticSettings `json:"properties,omitempty"` 3176 // ID - READ-ONLY; Azure resource Id 3177 ID *string `json:"id,omitempty"` 3178 // Name - READ-ONLY; Azure resource name 3179 Name *string `json:"name,omitempty"` 3180 // Type - READ-ONLY; Azure resource type 3181 Type *string `json:"type,omitempty"` 3182} 3183 3184// MarshalJSON is the custom marshaler for DiagnosticSettingsResource. 3185func (dsr DiagnosticSettingsResource) MarshalJSON() ([]byte, error) { 3186 objectMap := make(map[string]interface{}) 3187 if dsr.DiagnosticSettings != nil { 3188 objectMap["properties"] = dsr.DiagnosticSettings 3189 } 3190 return json.Marshal(objectMap) 3191} 3192 3193// UnmarshalJSON is the custom unmarshaler for DiagnosticSettingsResource struct. 3194func (dsr *DiagnosticSettingsResource) UnmarshalJSON(body []byte) error { 3195 var m map[string]*json.RawMessage 3196 err := json.Unmarshal(body, &m) 3197 if err != nil { 3198 return err 3199 } 3200 for k, v := range m { 3201 switch k { 3202 case "properties": 3203 if v != nil { 3204 var diagnosticSettings DiagnosticSettings 3205 err = json.Unmarshal(*v, &diagnosticSettings) 3206 if err != nil { 3207 return err 3208 } 3209 dsr.DiagnosticSettings = &diagnosticSettings 3210 } 3211 case "id": 3212 if v != nil { 3213 var ID string 3214 err = json.Unmarshal(*v, &ID) 3215 if err != nil { 3216 return err 3217 } 3218 dsr.ID = &ID 3219 } 3220 case "name": 3221 if v != nil { 3222 var name string 3223 err = json.Unmarshal(*v, &name) 3224 if err != nil { 3225 return err 3226 } 3227 dsr.Name = &name 3228 } 3229 case "type": 3230 if v != nil { 3231 var typeVar string 3232 err = json.Unmarshal(*v, &typeVar) 3233 if err != nil { 3234 return err 3235 } 3236 dsr.Type = &typeVar 3237 } 3238 } 3239 } 3240 3241 return nil 3242} 3243 3244// DiagnosticSettingsResourceCollection represents a collection of alert rule resources. 3245type DiagnosticSettingsResourceCollection struct { 3246 autorest.Response `json:"-"` 3247 // Value - The collection of diagnostic settings resources;. 3248 Value *[]DiagnosticSettingsResource `json:"value,omitempty"` 3249} 3250 3251// Dimension specifies the criteria for converting log to metric. 3252type Dimension struct { 3253 // Name - Name of the dimension 3254 Name *string `json:"name,omitempty"` 3255 // Operator - Operator for dimension values 3256 Operator *string `json:"operator,omitempty"` 3257 // Values - List of dimension values 3258 Values *[]string `json:"values,omitempty"` 3259} 3260 3261// DynamicMetricCriteria criterion for dynamic threshold. 3262type DynamicMetricCriteria struct { 3263 // Operator - The operator used to compare the metric value against the threshold. Possible values include: 'DynamicThresholdOperatorGreaterThan', 'DynamicThresholdOperatorLessThan', 'DynamicThresholdOperatorGreaterOrLessThan' 3264 Operator DynamicThresholdOperator `json:"operator,omitempty"` 3265 // AlertSensitivity - The extent of deviation required to trigger an alert. This will affect how tight the threshold is to the metric series pattern. Possible values include: 'DynamicThresholdSensitivityLow', 'DynamicThresholdSensitivityMedium', 'DynamicThresholdSensitivityHigh' 3266 AlertSensitivity DynamicThresholdSensitivity `json:"alertSensitivity,omitempty"` 3267 // FailingPeriods - The minimum number of violations required within the selected lookback time window required to raise an alert. 3268 FailingPeriods *DynamicThresholdFailingPeriods `json:"failingPeriods,omitempty"` 3269 // IgnoreDataBefore - Use this option to set the date from which to start learning the metric historical data and calculate the dynamic thresholds (in ISO8601 format) 3270 IgnoreDataBefore *date.Time `json:"ignoreDataBefore,omitempty"` 3271 // AdditionalProperties - Unmatched properties from the message are deserialized this collection 3272 AdditionalProperties map[string]interface{} `json:""` 3273 // Name - Name of the criteria. 3274 Name *string `json:"name,omitempty"` 3275 // MetricName - Name of the metric. 3276 MetricName *string `json:"metricName,omitempty"` 3277 // MetricNamespace - Namespace of the metric. 3278 MetricNamespace *string `json:"metricNamespace,omitempty"` 3279 // TimeAggregation - the criteria time aggregation types. Possible values include: 'AggregationTypeEnumAverage', 'AggregationTypeEnumCount', 'AggregationTypeEnumMinimum', 'AggregationTypeEnumMaximum', 'AggregationTypeEnumTotal' 3280 TimeAggregation AggregationTypeEnum `json:"timeAggregation,omitempty"` 3281 // Dimensions - List of dimension conditions. 3282 Dimensions *[]MetricDimension `json:"dimensions,omitempty"` 3283 // SkipMetricValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped. 3284 SkipMetricValidation *bool `json:"skipMetricValidation,omitempty"` 3285 // CriterionType - Possible values include: 'CriterionTypeMultiMetricCriteria', 'CriterionTypeStaticThresholdCriterion', 'CriterionTypeDynamicThresholdCriterion' 3286 CriterionType CriterionType `json:"criterionType,omitempty"` 3287} 3288 3289// MarshalJSON is the custom marshaler for DynamicMetricCriteria. 3290func (dmc DynamicMetricCriteria) MarshalJSON() ([]byte, error) { 3291 dmc.CriterionType = CriterionTypeDynamicThresholdCriterion 3292 objectMap := make(map[string]interface{}) 3293 if dmc.Operator != "" { 3294 objectMap["operator"] = dmc.Operator 3295 } 3296 if dmc.AlertSensitivity != "" { 3297 objectMap["alertSensitivity"] = dmc.AlertSensitivity 3298 } 3299 if dmc.FailingPeriods != nil { 3300 objectMap["failingPeriods"] = dmc.FailingPeriods 3301 } 3302 if dmc.IgnoreDataBefore != nil { 3303 objectMap["ignoreDataBefore"] = dmc.IgnoreDataBefore 3304 } 3305 if dmc.Name != nil { 3306 objectMap["name"] = dmc.Name 3307 } 3308 if dmc.MetricName != nil { 3309 objectMap["metricName"] = dmc.MetricName 3310 } 3311 if dmc.MetricNamespace != nil { 3312 objectMap["metricNamespace"] = dmc.MetricNamespace 3313 } 3314 if dmc.TimeAggregation != "" { 3315 objectMap["timeAggregation"] = dmc.TimeAggregation 3316 } 3317 if dmc.Dimensions != nil { 3318 objectMap["dimensions"] = dmc.Dimensions 3319 } 3320 if dmc.SkipMetricValidation != nil { 3321 objectMap["skipMetricValidation"] = dmc.SkipMetricValidation 3322 } 3323 if dmc.CriterionType != "" { 3324 objectMap["criterionType"] = dmc.CriterionType 3325 } 3326 for k, v := range dmc.AdditionalProperties { 3327 objectMap[k] = v 3328 } 3329 return json.Marshal(objectMap) 3330} 3331 3332// AsMetricCriteria is the BasicMultiMetricCriteria implementation for DynamicMetricCriteria. 3333func (dmc DynamicMetricCriteria) AsMetricCriteria() (*MetricCriteria, bool) { 3334 return nil, false 3335} 3336 3337// AsDynamicMetricCriteria is the BasicMultiMetricCriteria implementation for DynamicMetricCriteria. 3338func (dmc DynamicMetricCriteria) AsDynamicMetricCriteria() (*DynamicMetricCriteria, bool) { 3339 return &dmc, true 3340} 3341 3342// AsMultiMetricCriteria is the BasicMultiMetricCriteria implementation for DynamicMetricCriteria. 3343func (dmc DynamicMetricCriteria) AsMultiMetricCriteria() (*MultiMetricCriteria, bool) { 3344 return nil, false 3345} 3346 3347// AsBasicMultiMetricCriteria is the BasicMultiMetricCriteria implementation for DynamicMetricCriteria. 3348func (dmc DynamicMetricCriteria) AsBasicMultiMetricCriteria() (BasicMultiMetricCriteria, bool) { 3349 return &dmc, true 3350} 3351 3352// UnmarshalJSON is the custom unmarshaler for DynamicMetricCriteria struct. 3353func (dmc *DynamicMetricCriteria) UnmarshalJSON(body []byte) error { 3354 var m map[string]*json.RawMessage 3355 err := json.Unmarshal(body, &m) 3356 if err != nil { 3357 return err 3358 } 3359 for k, v := range m { 3360 switch k { 3361 case "operator": 3362 if v != nil { 3363 var operator DynamicThresholdOperator 3364 err = json.Unmarshal(*v, &operator) 3365 if err != nil { 3366 return err 3367 } 3368 dmc.Operator = operator 3369 } 3370 case "alertSensitivity": 3371 if v != nil { 3372 var alertSensitivity DynamicThresholdSensitivity 3373 err = json.Unmarshal(*v, &alertSensitivity) 3374 if err != nil { 3375 return err 3376 } 3377 dmc.AlertSensitivity = alertSensitivity 3378 } 3379 case "failingPeriods": 3380 if v != nil { 3381 var failingPeriods DynamicThresholdFailingPeriods 3382 err = json.Unmarshal(*v, &failingPeriods) 3383 if err != nil { 3384 return err 3385 } 3386 dmc.FailingPeriods = &failingPeriods 3387 } 3388 case "ignoreDataBefore": 3389 if v != nil { 3390 var ignoreDataBefore date.Time 3391 err = json.Unmarshal(*v, &ignoreDataBefore) 3392 if err != nil { 3393 return err 3394 } 3395 dmc.IgnoreDataBefore = &ignoreDataBefore 3396 } 3397 default: 3398 if v != nil { 3399 var additionalProperties interface{} 3400 err = json.Unmarshal(*v, &additionalProperties) 3401 if err != nil { 3402 return err 3403 } 3404 if dmc.AdditionalProperties == nil { 3405 dmc.AdditionalProperties = make(map[string]interface{}) 3406 } 3407 dmc.AdditionalProperties[k] = additionalProperties 3408 } 3409 case "name": 3410 if v != nil { 3411 var name string 3412 err = json.Unmarshal(*v, &name) 3413 if err != nil { 3414 return err 3415 } 3416 dmc.Name = &name 3417 } 3418 case "metricName": 3419 if v != nil { 3420 var metricName string 3421 err = json.Unmarshal(*v, &metricName) 3422 if err != nil { 3423 return err 3424 } 3425 dmc.MetricName = &metricName 3426 } 3427 case "metricNamespace": 3428 if v != nil { 3429 var metricNamespace string 3430 err = json.Unmarshal(*v, &metricNamespace) 3431 if err != nil { 3432 return err 3433 } 3434 dmc.MetricNamespace = &metricNamespace 3435 } 3436 case "timeAggregation": 3437 if v != nil { 3438 var timeAggregation AggregationTypeEnum 3439 err = json.Unmarshal(*v, &timeAggregation) 3440 if err != nil { 3441 return err 3442 } 3443 dmc.TimeAggregation = timeAggregation 3444 } 3445 case "dimensions": 3446 if v != nil { 3447 var dimensions []MetricDimension 3448 err = json.Unmarshal(*v, &dimensions) 3449 if err != nil { 3450 return err 3451 } 3452 dmc.Dimensions = &dimensions 3453 } 3454 case "skipMetricValidation": 3455 if v != nil { 3456 var skipMetricValidation bool 3457 err = json.Unmarshal(*v, &skipMetricValidation) 3458 if err != nil { 3459 return err 3460 } 3461 dmc.SkipMetricValidation = &skipMetricValidation 3462 } 3463 case "criterionType": 3464 if v != nil { 3465 var criterionType CriterionType 3466 err = json.Unmarshal(*v, &criterionType) 3467 if err != nil { 3468 return err 3469 } 3470 dmc.CriterionType = criterionType 3471 } 3472 } 3473 } 3474 3475 return nil 3476} 3477 3478// DynamicThresholdFailingPeriods the minimum number of violations required within the selected lookback 3479// time window required to raise an alert. 3480type DynamicThresholdFailingPeriods struct { 3481 // NumberOfEvaluationPeriods - The number of aggregated lookback points. The lookback time window is calculated based on the aggregation granularity (windowSize) and the selected number of aggregated points. 3482 NumberOfEvaluationPeriods *float64 `json:"numberOfEvaluationPeriods,omitempty"` 3483 // MinFailingPeriodsToAlert - The number of violations to trigger an alert. Should be smaller or equal to numberOfEvaluationPeriods. 3484 MinFailingPeriodsToAlert *float64 `json:"minFailingPeriodsToAlert,omitempty"` 3485} 3486 3487// EmailNotification email notification of an autoscale event. 3488type EmailNotification struct { 3489 // SendToSubscriptionAdministrator - a value indicating whether to send email to subscription administrator. 3490 SendToSubscriptionAdministrator *bool `json:"sendToSubscriptionAdministrator,omitempty"` 3491 // SendToSubscriptionCoAdministrators - a value indicating whether to send email to subscription co-administrators. 3492 SendToSubscriptionCoAdministrators *bool `json:"sendToSubscriptionCoAdministrators,omitempty"` 3493 // CustomEmails - the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored. 3494 CustomEmails *[]string `json:"customEmails,omitempty"` 3495} 3496 3497// EmailReceiver an email receiver. 3498type EmailReceiver struct { 3499 // Name - The name of the email receiver. Names must be unique across all receivers within an action group. 3500 Name *string `json:"name,omitempty"` 3501 // EmailAddress - The email address of this receiver. 3502 EmailAddress *string `json:"emailAddress,omitempty"` 3503 // UseCommonAlertSchema - Indicates whether to use common alert schema. 3504 UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"` 3505 // Status - READ-ONLY; The receiver status of the e-mail. Possible values include: 'ReceiverStatusNotSpecified', 'ReceiverStatusEnabled', 'ReceiverStatusDisabled' 3506 Status ReceiverStatus `json:"status,omitempty"` 3507} 3508 3509// MarshalJSON is the custom marshaler for EmailReceiver. 3510func (er EmailReceiver) MarshalJSON() ([]byte, error) { 3511 objectMap := make(map[string]interface{}) 3512 if er.Name != nil { 3513 objectMap["name"] = er.Name 3514 } 3515 if er.EmailAddress != nil { 3516 objectMap["emailAddress"] = er.EmailAddress 3517 } 3518 if er.UseCommonAlertSchema != nil { 3519 objectMap["useCommonAlertSchema"] = er.UseCommonAlertSchema 3520 } 3521 return json.Marshal(objectMap) 3522} 3523 3524// EnableRequest describes a receiver that should be resubscribed. 3525type EnableRequest struct { 3526 // ReceiverName - The name of the receiver to resubscribe. 3527 ReceiverName *string `json:"receiverName,omitempty"` 3528} 3529 3530// Error error details. 3531type Error struct { 3532 // Code - Error code identifying the specific error. 3533 Code *string `json:"code,omitempty"` 3534 // Message - Error message in the caller's locale. 3535 Message *string `json:"message,omitempty"` 3536} 3537 3538// ErrorAdditionalInfo the resource management error additional info. 3539type ErrorAdditionalInfo struct { 3540 // Type - READ-ONLY; The additional info type. 3541 Type *string `json:"type,omitempty"` 3542 // Info - READ-ONLY; The additional info. 3543 Info interface{} `json:"info,omitempty"` 3544} 3545 3546// MarshalJSON is the custom marshaler for ErrorAdditionalInfo. 3547func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { 3548 objectMap := make(map[string]interface{}) 3549 return json.Marshal(objectMap) 3550} 3551 3552// ErrorContract describes the format of Error response. 3553type ErrorContract struct { 3554 // Error - The error details. 3555 Error *ErrorResponse `json:"error,omitempty"` 3556} 3557 3558// ErrorDetail the error detail. 3559type ErrorDetail struct { 3560 // Code - READ-ONLY; The error code. 3561 Code *string `json:"code,omitempty"` 3562 // Message - READ-ONLY; The error message. 3563 Message *string `json:"message,omitempty"` 3564 // Target - READ-ONLY; The error target. 3565 Target *string `json:"target,omitempty"` 3566 // Details - READ-ONLY; The error details. 3567 Details *[]ErrorDetail `json:"details,omitempty"` 3568 // AdditionalInfo - READ-ONLY; The error additional info. 3569 AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` 3570} 3571 3572// MarshalJSON is the custom marshaler for ErrorDetail. 3573func (ed ErrorDetail) MarshalJSON() ([]byte, error) { 3574 objectMap := make(map[string]interface{}) 3575 return json.Marshal(objectMap) 3576} 3577 3578// ErrorResponse describes the format of Error response. 3579type ErrorResponse struct { 3580 // Code - Error code 3581 Code *string `json:"code,omitempty"` 3582 // Message - Error message indicating why the operation failed. 3583 Message *string `json:"message,omitempty"` 3584} 3585 3586// ErrorResponseCommon the resource management error response. 3587type ErrorResponseCommon struct { 3588 // Details - READ-ONLY; The error details. 3589 Details *[]ErrorResponseCommon `json:"details,omitempty"` 3590 // AdditionalInfo - READ-ONLY; The error additional info. 3591 AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` 3592 // Code - Error code 3593 Code *string `json:"code,omitempty"` 3594 // Message - Error message indicating why the operation failed. 3595 Message *string `json:"message,omitempty"` 3596} 3597 3598// MarshalJSON is the custom marshaler for ErrorResponseCommon. 3599func (erc ErrorResponseCommon) MarshalJSON() ([]byte, error) { 3600 objectMap := make(map[string]interface{}) 3601 if erc.Code != nil { 3602 objectMap["code"] = erc.Code 3603 } 3604 if erc.Message != nil { 3605 objectMap["message"] = erc.Message 3606 } 3607 return json.Marshal(objectMap) 3608} 3609 3610// ErrorResponseCommonV2 common error response for all Azure Resource Manager APIs to return error details 3611// for failed operations. (This also follows the OData error response format.). 3612type ErrorResponseCommonV2 struct { 3613 // Error - The error object. 3614 Error *ErrorDetail `json:"error,omitempty"` 3615} 3616 3617// EventCategoryCollection a collection of event categories. Currently possible values are: Administrative, 3618// Security, ServiceHealth, Alert, Recommendation, Policy. 3619type EventCategoryCollection struct { 3620 autorest.Response `json:"-"` 3621 // Value - the list that includes the Azure event categories. 3622 Value *[]LocalizableString `json:"value,omitempty"` 3623} 3624 3625// EventData the Azure event log entries are of type EventData 3626type EventData struct { 3627 // Authorization - READ-ONLY; The sender authorization information. 3628 Authorization *SenderAuthorization `json:"authorization,omitempty"` 3629 // Claims - READ-ONLY; key value pairs to identify ARM permissions. 3630 Claims map[string]*string `json:"claims"` 3631 // Caller - READ-ONLY; the email address of the user who has performed the operation, the UPN claim or SPN claim based on availability. 3632 Caller *string `json:"caller,omitempty"` 3633 // Description - READ-ONLY; the description of the event. 3634 Description *string `json:"description,omitempty"` 3635 // ID - READ-ONLY; the Id of this event as required by ARM for RBAC. It contains the EventDataID and a timestamp information. 3636 ID *string `json:"id,omitempty"` 3637 // EventDataID - READ-ONLY; the event data Id. This is a unique identifier for an event. 3638 EventDataID *string `json:"eventDataId,omitempty"` 3639 // CorrelationID - READ-ONLY; the correlation Id, usually a GUID in the string format. The correlation Id is shared among the events that belong to the same uber operation. 3640 CorrelationID *string `json:"correlationId,omitempty"` 3641 // EventName - READ-ONLY; the event name. This value should not be confused with OperationName. For practical purposes, OperationName might be more appealing to end users. 3642 EventName *LocalizableString `json:"eventName,omitempty"` 3643 // Category - READ-ONLY; the event category. 3644 Category *LocalizableString `json:"category,omitempty"` 3645 // HTTPRequest - READ-ONLY; the HTTP request info. Usually includes the 'clientRequestId', 'clientIpAddress' (IP address of the user who initiated the event) and 'method' (HTTP method e.g. PUT). 3646 HTTPRequest *HTTPRequestInfo `json:"httpRequest,omitempty"` 3647 // Level - READ-ONLY; the event level. Possible values include: 'EventLevelCritical', 'EventLevelError', 'EventLevelWarning', 'EventLevelInformational', 'EventLevelVerbose' 3648 Level EventLevel `json:"level,omitempty"` 3649 // ResourceGroupName - READ-ONLY; the resource group name of the impacted resource. 3650 ResourceGroupName *string `json:"resourceGroupName,omitempty"` 3651 // ResourceProviderName - READ-ONLY; the resource provider name of the impacted resource. 3652 ResourceProviderName *LocalizableString `json:"resourceProviderName,omitempty"` 3653 // ResourceID - READ-ONLY; the resource uri that uniquely identifies the resource that caused this event. 3654 ResourceID *string `json:"resourceId,omitempty"` 3655 // ResourceType - READ-ONLY; the resource type 3656 ResourceType *LocalizableString `json:"resourceType,omitempty"` 3657 // OperationID - READ-ONLY; It is usually a GUID shared among the events corresponding to single operation. This value should not be confused with EventName. 3658 OperationID *string `json:"operationId,omitempty"` 3659 // OperationName - READ-ONLY; the operation name. 3660 OperationName *LocalizableString `json:"operationName,omitempty"` 3661 // Properties - READ-ONLY; the set of <Key, Value> pairs (usually a Dictionary<String, String>) that includes details about the event. 3662 Properties map[string]*string `json:"properties"` 3663 // Status - READ-ONLY; a string describing the status of the operation. Some typical values are: Started, In progress, Succeeded, Failed, Resolved. 3664 Status *LocalizableString `json:"status,omitempty"` 3665 // SubStatus - READ-ONLY; the event sub status. Most of the time, when included, this captures the HTTP status code of the REST call. Common values are: OK (HTTP Status Code: 200), Created (HTTP Status Code: 201), Accepted (HTTP Status Code: 202), No Content (HTTP Status Code: 204), Bad Request(HTTP Status Code: 400), Not Found (HTTP Status Code: 404), Conflict (HTTP Status Code: 409), Internal Server Error (HTTP Status Code: 500), Service Unavailable (HTTP Status Code:503), Gateway Timeout (HTTP Status Code: 504) 3666 SubStatus *LocalizableString `json:"subStatus,omitempty"` 3667 // EventTimestamp - READ-ONLY; the timestamp of when the event was generated by the Azure service processing the request corresponding the event. It in ISO 8601 format. 3668 EventTimestamp *date.Time `json:"eventTimestamp,omitempty"` 3669 // SubmissionTimestamp - READ-ONLY; the timestamp of when the event became available for querying via this API. It is in ISO 8601 format. This value should not be confused eventTimestamp. As there might be a delay between the occurrence time of the event, and the time that the event is submitted to the Azure logging infrastructure. 3670 SubmissionTimestamp *date.Time `json:"submissionTimestamp,omitempty"` 3671 // SubscriptionID - READ-ONLY; the Azure subscription Id usually a GUID. 3672 SubscriptionID *string `json:"subscriptionId,omitempty"` 3673 // TenantID - READ-ONLY; the Azure tenant Id 3674 TenantID *string `json:"tenantId,omitempty"` 3675} 3676 3677// MarshalJSON is the custom marshaler for EventData. 3678func (ed EventData) MarshalJSON() ([]byte, error) { 3679 objectMap := make(map[string]interface{}) 3680 return json.Marshal(objectMap) 3681} 3682 3683// EventDataCollection represents collection of events. 3684type EventDataCollection struct { 3685 autorest.Response `json:"-"` 3686 // Value - this list that includes the Azure audit logs. 3687 Value *[]EventData `json:"value,omitempty"` 3688 // NextLink - Provides the link to retrieve the next set of events. 3689 NextLink *string `json:"nextLink,omitempty"` 3690} 3691 3692// EventDataCollectionIterator provides access to a complete listing of EventData values. 3693type EventDataCollectionIterator struct { 3694 i int 3695 page EventDataCollectionPage 3696} 3697 3698// NextWithContext advances to the next value. If there was an error making 3699// the request the iterator does not advance and the error is returned. 3700func (iter *EventDataCollectionIterator) NextWithContext(ctx context.Context) (err error) { 3701 if tracing.IsEnabled() { 3702 ctx = tracing.StartSpan(ctx, fqdn+"/EventDataCollectionIterator.NextWithContext") 3703 defer func() { 3704 sc := -1 3705 if iter.Response().Response.Response != nil { 3706 sc = iter.Response().Response.Response.StatusCode 3707 } 3708 tracing.EndSpan(ctx, sc, err) 3709 }() 3710 } 3711 iter.i++ 3712 if iter.i < len(iter.page.Values()) { 3713 return nil 3714 } 3715 err = iter.page.NextWithContext(ctx) 3716 if err != nil { 3717 iter.i-- 3718 return err 3719 } 3720 iter.i = 0 3721 return nil 3722} 3723 3724// Next advances to the next value. If there was an error making 3725// the request the iterator does not advance and the error is returned. 3726// Deprecated: Use NextWithContext() instead. 3727func (iter *EventDataCollectionIterator) Next() error { 3728 return iter.NextWithContext(context.Background()) 3729} 3730 3731// NotDone returns true if the enumeration should be started or is not yet complete. 3732func (iter EventDataCollectionIterator) NotDone() bool { 3733 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3734} 3735 3736// Response returns the raw server response from the last page request. 3737func (iter EventDataCollectionIterator) Response() EventDataCollection { 3738 return iter.page.Response() 3739} 3740 3741// Value returns the current value or a zero-initialized value if the 3742// iterator has advanced beyond the end of the collection. 3743func (iter EventDataCollectionIterator) Value() EventData { 3744 if !iter.page.NotDone() { 3745 return EventData{} 3746 } 3747 return iter.page.Values()[iter.i] 3748} 3749 3750// Creates a new instance of the EventDataCollectionIterator type. 3751func NewEventDataCollectionIterator(page EventDataCollectionPage) EventDataCollectionIterator { 3752 return EventDataCollectionIterator{page: page} 3753} 3754 3755// IsEmpty returns true if the ListResult contains no values. 3756func (edc EventDataCollection) IsEmpty() bool { 3757 return edc.Value == nil || len(*edc.Value) == 0 3758} 3759 3760// hasNextLink returns true if the NextLink is not empty. 3761func (edc EventDataCollection) hasNextLink() bool { 3762 return edc.NextLink != nil && len(*edc.NextLink) != 0 3763} 3764 3765// eventDataCollectionPreparer prepares a request to retrieve the next set of results. 3766// It returns nil if no more results exist. 3767func (edc EventDataCollection) eventDataCollectionPreparer(ctx context.Context) (*http.Request, error) { 3768 if !edc.hasNextLink() { 3769 return nil, nil 3770 } 3771 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3772 autorest.AsJSON(), 3773 autorest.AsGet(), 3774 autorest.WithBaseURL(to.String(edc.NextLink))) 3775} 3776 3777// EventDataCollectionPage contains a page of EventData values. 3778type EventDataCollectionPage struct { 3779 fn func(context.Context, EventDataCollection) (EventDataCollection, error) 3780 edc EventDataCollection 3781} 3782 3783// NextWithContext advances to the next page of values. If there was an error making 3784// the request the page does not advance and the error is returned. 3785func (page *EventDataCollectionPage) NextWithContext(ctx context.Context) (err error) { 3786 if tracing.IsEnabled() { 3787 ctx = tracing.StartSpan(ctx, fqdn+"/EventDataCollectionPage.NextWithContext") 3788 defer func() { 3789 sc := -1 3790 if page.Response().Response.Response != nil { 3791 sc = page.Response().Response.Response.StatusCode 3792 } 3793 tracing.EndSpan(ctx, sc, err) 3794 }() 3795 } 3796 for { 3797 next, err := page.fn(ctx, page.edc) 3798 if err != nil { 3799 return err 3800 } 3801 page.edc = next 3802 if !next.hasNextLink() || !next.IsEmpty() { 3803 break 3804 } 3805 } 3806 return nil 3807} 3808 3809// Next advances to the next page of values. If there was an error making 3810// the request the page does not advance and the error is returned. 3811// Deprecated: Use NextWithContext() instead. 3812func (page *EventDataCollectionPage) Next() error { 3813 return page.NextWithContext(context.Background()) 3814} 3815 3816// NotDone returns true if the page enumeration should be started or is not yet complete. 3817func (page EventDataCollectionPage) NotDone() bool { 3818 return !page.edc.IsEmpty() 3819} 3820 3821// Response returns the raw server response from the last page request. 3822func (page EventDataCollectionPage) Response() EventDataCollection { 3823 return page.edc 3824} 3825 3826// Values returns the slice of values for the current page or nil if there are no values. 3827func (page EventDataCollectionPage) Values() []EventData { 3828 if page.edc.IsEmpty() { 3829 return nil 3830 } 3831 return *page.edc.Value 3832} 3833 3834// Creates a new instance of the EventDataCollectionPage type. 3835func NewEventDataCollectionPage(cur EventDataCollection, getNextPage func(context.Context, EventDataCollection) (EventDataCollection, error)) EventDataCollectionPage { 3836 return EventDataCollectionPage{ 3837 fn: getNextPage, 3838 edc: cur, 3839 } 3840} 3841 3842// ExtensionDataSource definition of which data will be collected from a separate VM extension that 3843// integrates with the Azure Monitor Agent. 3844// Collected from either Windows and Linux machines, depending on which extension is defined. 3845type ExtensionDataSource struct { 3846 // Streams - List of streams that this data source will be sent to. 3847 // A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will be sent to. 3848 Streams *[]KnownExtensionDataSourceStreams `json:"streams,omitempty"` 3849 // ExtensionName - The name of the VM extension. 3850 ExtensionName *string `json:"extensionName,omitempty"` 3851 // ExtensionSettings - The extension settings. The format is specific for particular extension. 3852 ExtensionSettings interface{} `json:"extensionSettings,omitempty"` 3853 // InputDataSources - The list of data sources this extension needs data from. 3854 InputDataSources *[]string `json:"inputDataSources,omitempty"` 3855 // Name - A friendly name for the data source. 3856 // This name should be unique across all data sources (regardless of type) within the data collection rule. 3857 Name *string `json:"name,omitempty"` 3858} 3859 3860// HTTPRequestInfo the Http request info. 3861type HTTPRequestInfo struct { 3862 // ClientRequestID - the client request id. 3863 ClientRequestID *string `json:"clientRequestId,omitempty"` 3864 // ClientIPAddress - the client Ip Address 3865 ClientIPAddress *string `json:"clientIpAddress,omitempty"` 3866 // Method - the Http request method. 3867 Method *string `json:"method,omitempty"` 3868 // URI - the Uri. 3869 URI *string `json:"uri,omitempty"` 3870} 3871 3872// Incident an alert incident indicates the activation status of an alert rule. 3873type Incident struct { 3874 autorest.Response `json:"-"` 3875 // Name - READ-ONLY; Incident name. 3876 Name *string `json:"name,omitempty"` 3877 // RuleName - READ-ONLY; Rule name that is associated with the incident. 3878 RuleName *string `json:"ruleName,omitempty"` 3879 // IsActive - READ-ONLY; A boolean to indicate whether the incident is active or resolved. 3880 IsActive *bool `json:"isActive,omitempty"` 3881 // ActivatedTime - READ-ONLY; The time at which the incident was activated in ISO8601 format. 3882 ActivatedTime *date.Time `json:"activatedTime,omitempty"` 3883 // ResolvedTime - READ-ONLY; The time at which the incident was resolved in ISO8601 format. If null, it means the incident is still active. 3884 ResolvedTime *date.Time `json:"resolvedTime,omitempty"` 3885} 3886 3887// MarshalJSON is the custom marshaler for Incident. 3888func (i Incident) MarshalJSON() ([]byte, error) { 3889 objectMap := make(map[string]interface{}) 3890 return json.Marshal(objectMap) 3891} 3892 3893// IncidentListResult the List incidents operation response. 3894type IncidentListResult struct { 3895 autorest.Response `json:"-"` 3896 // Value - the incident collection. 3897 Value *[]Incident `json:"value,omitempty"` 3898} 3899 3900// ItsmReceiver an Itsm receiver. 3901type ItsmReceiver struct { 3902 // Name - The name of the Itsm receiver. Names must be unique across all receivers within an action group. 3903 Name *string `json:"name,omitempty"` 3904 // WorkspaceID - OMS LA instance identifier. 3905 WorkspaceID *string `json:"workspaceId,omitempty"` 3906 // ConnectionID - Unique identification of ITSM connection among multiple defined in above workspace. 3907 ConnectionID *string `json:"connectionId,omitempty"` 3908 // TicketConfiguration - JSON blob for the configurations of the ITSM action. CreateMultipleWorkItems option will be part of this blob as well. 3909 TicketConfiguration *string `json:"ticketConfiguration,omitempty"` 3910 // Region - Region in which workspace resides. Supported values:'centralindia','japaneast','southeastasia','australiasoutheast','uksouth','westcentralus','canadacentral','eastus','westeurope' 3911 Region *string `json:"region,omitempty"` 3912} 3913 3914// LocalizableString the localizable string class. 3915type LocalizableString struct { 3916 // Value - the invariant value. 3917 Value *string `json:"value,omitempty"` 3918 // LocalizedValue - the locale specific value. 3919 LocalizedValue *string `json:"localizedValue,omitempty"` 3920} 3921 3922// LocationThresholdRuleCondition a rule condition based on a certain number of locations failing. 3923type LocationThresholdRuleCondition struct { 3924 // 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. 3925 WindowSize *string `json:"windowSize,omitempty"` 3926 // FailedLocationCount - the number of locations that must fail to activate the alert. 3927 FailedLocationCount *int32 `json:"failedLocationCount,omitempty"` 3928 // DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource. 3929 DataSource BasicRuleDataSource `json:"dataSource,omitempty"` 3930 // OdataType - Possible values include: 'OdataTypeBasicRuleConditionOdataTypeRuleCondition', 'OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition' 3931 OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"` 3932} 3933 3934// MarshalJSON is the custom marshaler for LocationThresholdRuleCondition. 3935func (ltrc LocationThresholdRuleCondition) MarshalJSON() ([]byte, error) { 3936 ltrc.OdataType = OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition 3937 objectMap := make(map[string]interface{}) 3938 if ltrc.WindowSize != nil { 3939 objectMap["windowSize"] = ltrc.WindowSize 3940 } 3941 if ltrc.FailedLocationCount != nil { 3942 objectMap["failedLocationCount"] = ltrc.FailedLocationCount 3943 } 3944 objectMap["dataSource"] = ltrc.DataSource 3945 if ltrc.OdataType != "" { 3946 objectMap["odata.type"] = ltrc.OdataType 3947 } 3948 return json.Marshal(objectMap) 3949} 3950 3951// AsThresholdRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition. 3952func (ltrc LocationThresholdRuleCondition) AsThresholdRuleCondition() (*ThresholdRuleCondition, bool) { 3953 return nil, false 3954} 3955 3956// AsLocationThresholdRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition. 3957func (ltrc LocationThresholdRuleCondition) AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool) { 3958 return <rc, true 3959} 3960 3961// AsManagementEventRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition. 3962func (ltrc LocationThresholdRuleCondition) AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool) { 3963 return nil, false 3964} 3965 3966// AsRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition. 3967func (ltrc LocationThresholdRuleCondition) AsRuleCondition() (*RuleCondition, bool) { 3968 return nil, false 3969} 3970 3971// AsBasicRuleCondition is the BasicRuleCondition implementation for LocationThresholdRuleCondition. 3972func (ltrc LocationThresholdRuleCondition) AsBasicRuleCondition() (BasicRuleCondition, bool) { 3973 return <rc, true 3974} 3975 3976// UnmarshalJSON is the custom unmarshaler for LocationThresholdRuleCondition struct. 3977func (ltrc *LocationThresholdRuleCondition) UnmarshalJSON(body []byte) error { 3978 var m map[string]*json.RawMessage 3979 err := json.Unmarshal(body, &m) 3980 if err != nil { 3981 return err 3982 } 3983 for k, v := range m { 3984 switch k { 3985 case "windowSize": 3986 if v != nil { 3987 var windowSize string 3988 err = json.Unmarshal(*v, &windowSize) 3989 if err != nil { 3990 return err 3991 } 3992 ltrc.WindowSize = &windowSize 3993 } 3994 case "failedLocationCount": 3995 if v != nil { 3996 var failedLocationCount int32 3997 err = json.Unmarshal(*v, &failedLocationCount) 3998 if err != nil { 3999 return err 4000 } 4001 ltrc.FailedLocationCount = &failedLocationCount 4002 } 4003 case "dataSource": 4004 if v != nil { 4005 dataSource, err := unmarshalBasicRuleDataSource(*v) 4006 if err != nil { 4007 return err 4008 } 4009 ltrc.DataSource = dataSource 4010 } 4011 case "odata.type": 4012 if v != nil { 4013 var odataType OdataTypeBasicRuleCondition 4014 err = json.Unmarshal(*v, &odataType) 4015 if err != nil { 4016 return err 4017 } 4018 ltrc.OdataType = odataType 4019 } 4020 } 4021 } 4022 4023 return nil 4024} 4025 4026// LogAnalyticsDestination log Analytics destination. 4027type LogAnalyticsDestination struct { 4028 // WorkspaceResourceID - The resource ID of the Log Analytics workspace. 4029 WorkspaceResourceID *string `json:"workspaceResourceId,omitempty"` 4030 // WorkspaceID - READ-ONLY; The Customer ID of the Log Analytics workspace. 4031 WorkspaceID *string `json:"workspaceId,omitempty"` 4032 // Name - A friendly name for the destination. 4033 // This name should be unique across all destinations (regardless of type) within the data collection rule. 4034 Name *string `json:"name,omitempty"` 4035} 4036 4037// MarshalJSON is the custom marshaler for LogAnalyticsDestination. 4038func (lad LogAnalyticsDestination) MarshalJSON() ([]byte, error) { 4039 objectMap := make(map[string]interface{}) 4040 if lad.WorkspaceResourceID != nil { 4041 objectMap["workspaceResourceId"] = lad.WorkspaceResourceID 4042 } 4043 if lad.Name != nil { 4044 objectMap["name"] = lad.Name 4045 } 4046 return json.Marshal(objectMap) 4047} 4048 4049// LogicAppReceiver a logic app receiver. 4050type LogicAppReceiver struct { 4051 // Name - The name of the logic app receiver. Names must be unique across all receivers within an action group. 4052 Name *string `json:"name,omitempty"` 4053 // ResourceID - The azure resource id of the logic app receiver. 4054 ResourceID *string `json:"resourceId,omitempty"` 4055 // CallbackURL - The callback url where http request sent to. 4056 CallbackURL *string `json:"callbackUrl,omitempty"` 4057 // UseCommonAlertSchema - Indicates whether to use common alert schema. 4058 UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"` 4059} 4060 4061// LogMetricTrigger a log metrics trigger descriptor. 4062type LogMetricTrigger struct { 4063 // ThresholdOperator - Evaluation operation for Metric -'GreaterThan' or 'LessThan' or 'Equal'. Possible values include: 'ConditionalOperatorGreaterThanOrEqual', 'ConditionalOperatorLessThanOrEqual', 'ConditionalOperatorGreaterThan', 'ConditionalOperatorLessThan', 'ConditionalOperatorEqual' 4064 ThresholdOperator ConditionalOperator `json:"thresholdOperator,omitempty"` 4065 // Threshold - The threshold of the metric trigger. 4066 Threshold *float64 `json:"threshold,omitempty"` 4067 // MetricTriggerType - Metric Trigger Type - 'Consecutive' or 'Total'. Possible values include: 'MetricTriggerTypeConsecutive', 'MetricTriggerTypeTotal' 4068 MetricTriggerType MetricTriggerType `json:"metricTriggerType,omitempty"` 4069 // MetricColumn - Evaluation of metric on a particular column 4070 MetricColumn *string `json:"metricColumn,omitempty"` 4071} 4072 4073// LogProfileCollection represents a collection of log profiles. 4074type LogProfileCollection struct { 4075 autorest.Response `json:"-"` 4076 // Value - the values of the log profiles. 4077 Value *[]LogProfileResource `json:"value,omitempty"` 4078} 4079 4080// LogProfileProperties the log profile properties. 4081type LogProfileProperties struct { 4082 // StorageAccountID - the resource id of the storage account to which you would like to send the Activity Log. 4083 StorageAccountID *string `json:"storageAccountId,omitempty"` 4084 // 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}'. 4085 ServiceBusRuleID *string `json:"serviceBusRuleId,omitempty"` 4086 // 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. 4087 Locations *[]string `json:"locations,omitempty"` 4088 // Categories - the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.' 4089 Categories *[]string `json:"categories,omitempty"` 4090 // RetentionPolicy - the retention policy for the events in the log. 4091 RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"` 4092} 4093 4094// LogProfileResource the log profile resource. 4095type LogProfileResource struct { 4096 autorest.Response `json:"-"` 4097 // LogProfileProperties - The log profile properties of the resource. 4098 *LogProfileProperties `json:"properties,omitempty"` 4099 // ID - READ-ONLY; Azure resource Id 4100 ID *string `json:"id,omitempty"` 4101 // Name - READ-ONLY; Azure resource name 4102 Name *string `json:"name,omitempty"` 4103 // Type - READ-ONLY; Azure resource type 4104 Type *string `json:"type,omitempty"` 4105 // Location - Resource location 4106 Location *string `json:"location,omitempty"` 4107 // Tags - Resource tags 4108 Tags map[string]*string `json:"tags"` 4109 // Kind - READ-ONLY; Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. 4110 Kind *string `json:"kind,omitempty"` 4111 // Etag - READ-ONLY; The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. 4112 Etag *string `json:"etag,omitempty"` 4113} 4114 4115// MarshalJSON is the custom marshaler for LogProfileResource. 4116func (lpr LogProfileResource) MarshalJSON() ([]byte, error) { 4117 objectMap := make(map[string]interface{}) 4118 if lpr.LogProfileProperties != nil { 4119 objectMap["properties"] = lpr.LogProfileProperties 4120 } 4121 if lpr.Location != nil { 4122 objectMap["location"] = lpr.Location 4123 } 4124 if lpr.Tags != nil { 4125 objectMap["tags"] = lpr.Tags 4126 } 4127 return json.Marshal(objectMap) 4128} 4129 4130// UnmarshalJSON is the custom unmarshaler for LogProfileResource struct. 4131func (lpr *LogProfileResource) UnmarshalJSON(body []byte) error { 4132 var m map[string]*json.RawMessage 4133 err := json.Unmarshal(body, &m) 4134 if err != nil { 4135 return err 4136 } 4137 for k, v := range m { 4138 switch k { 4139 case "properties": 4140 if v != nil { 4141 var logProfileProperties LogProfileProperties 4142 err = json.Unmarshal(*v, &logProfileProperties) 4143 if err != nil { 4144 return err 4145 } 4146 lpr.LogProfileProperties = &logProfileProperties 4147 } 4148 case "id": 4149 if v != nil { 4150 var ID string 4151 err = json.Unmarshal(*v, &ID) 4152 if err != nil { 4153 return err 4154 } 4155 lpr.ID = &ID 4156 } 4157 case "name": 4158 if v != nil { 4159 var name string 4160 err = json.Unmarshal(*v, &name) 4161 if err != nil { 4162 return err 4163 } 4164 lpr.Name = &name 4165 } 4166 case "type": 4167 if v != nil { 4168 var typeVar string 4169 err = json.Unmarshal(*v, &typeVar) 4170 if err != nil { 4171 return err 4172 } 4173 lpr.Type = &typeVar 4174 } 4175 case "location": 4176 if v != nil { 4177 var location string 4178 err = json.Unmarshal(*v, &location) 4179 if err != nil { 4180 return err 4181 } 4182 lpr.Location = &location 4183 } 4184 case "tags": 4185 if v != nil { 4186 var tags map[string]*string 4187 err = json.Unmarshal(*v, &tags) 4188 if err != nil { 4189 return err 4190 } 4191 lpr.Tags = tags 4192 } 4193 case "kind": 4194 if v != nil { 4195 var kind string 4196 err = json.Unmarshal(*v, &kind) 4197 if err != nil { 4198 return err 4199 } 4200 lpr.Kind = &kind 4201 } 4202 case "etag": 4203 if v != nil { 4204 var etag string 4205 err = json.Unmarshal(*v, &etag) 4206 if err != nil { 4207 return err 4208 } 4209 lpr.Etag = &etag 4210 } 4211 } 4212 } 4213 4214 return nil 4215} 4216 4217// LogProfileResourcePatch the log profile resource for patch operations. 4218type LogProfileResourcePatch struct { 4219 // Tags - Resource tags 4220 Tags map[string]*string `json:"tags"` 4221 // LogProfileProperties - The log profile properties for an update operation. 4222 *LogProfileProperties `json:"properties,omitempty"` 4223} 4224 4225// MarshalJSON is the custom marshaler for LogProfileResourcePatch. 4226func (lprp LogProfileResourcePatch) MarshalJSON() ([]byte, error) { 4227 objectMap := make(map[string]interface{}) 4228 if lprp.Tags != nil { 4229 objectMap["tags"] = lprp.Tags 4230 } 4231 if lprp.LogProfileProperties != nil { 4232 objectMap["properties"] = lprp.LogProfileProperties 4233 } 4234 return json.Marshal(objectMap) 4235} 4236 4237// UnmarshalJSON is the custom unmarshaler for LogProfileResourcePatch struct. 4238func (lprp *LogProfileResourcePatch) UnmarshalJSON(body []byte) error { 4239 var m map[string]*json.RawMessage 4240 err := json.Unmarshal(body, &m) 4241 if err != nil { 4242 return err 4243 } 4244 for k, v := range m { 4245 switch k { 4246 case "tags": 4247 if v != nil { 4248 var tags map[string]*string 4249 err = json.Unmarshal(*v, &tags) 4250 if err != nil { 4251 return err 4252 } 4253 lprp.Tags = tags 4254 } 4255 case "properties": 4256 if v != nil { 4257 var logProfileProperties LogProfileProperties 4258 err = json.Unmarshal(*v, &logProfileProperties) 4259 if err != nil { 4260 return err 4261 } 4262 lprp.LogProfileProperties = &logProfileProperties 4263 } 4264 } 4265 } 4266 4267 return nil 4268} 4269 4270// LogSearchRule log Search Rule Definition 4271type LogSearchRule struct { 4272 // CreatedWithAPIVersion - READ-ONLY; The api-version used when creating this alert rule 4273 CreatedWithAPIVersion *string `json:"createdWithApiVersion,omitempty"` 4274 // IsLegacyLogAnalyticsRule - READ-ONLY; True if alert rule is legacy Log Analytic rule 4275 IsLegacyLogAnalyticsRule *bool `json:"isLegacyLogAnalyticsRule,omitempty"` 4276 // Description - The description of the Log Search rule. 4277 Description *string `json:"description,omitempty"` 4278 // DisplayName - The display name of the alert rule 4279 DisplayName *string `json:"displayName,omitempty"` 4280 // AutoMitigate - The flag that indicates whether the alert should be automatically resolved or not. The default is false. 4281 AutoMitigate *bool `json:"autoMitigate,omitempty"` 4282 // Enabled - The flag which indicates whether the Log Search rule is enabled. Value should be true or false. Possible values include: 'EnabledTrue', 'EnabledFalse' 4283 Enabled Enabled `json:"enabled,omitempty"` 4284 // LastUpdatedTime - READ-ONLY; Last time the rule was updated in IS08601 format. 4285 LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` 4286 // ProvisioningState - READ-ONLY; Provisioning state of the scheduled query rule. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateDeploying', 'ProvisioningStateCanceled', 'ProvisioningStateFailed' 4287 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 4288 // Source - Data Source against which rule will Query Data 4289 Source *Source `json:"source,omitempty"` 4290 // Schedule - Schedule (Frequency, Time Window) for rule. Required for action type - AlertingAction 4291 Schedule *Schedule `json:"schedule,omitempty"` 4292 // Action - Action needs to be taken on rule execution. 4293 Action BasicAction `json:"action,omitempty"` 4294} 4295 4296// MarshalJSON is the custom marshaler for LogSearchRule. 4297func (lsr LogSearchRule) MarshalJSON() ([]byte, error) { 4298 objectMap := make(map[string]interface{}) 4299 if lsr.Description != nil { 4300 objectMap["description"] = lsr.Description 4301 } 4302 if lsr.DisplayName != nil { 4303 objectMap["displayName"] = lsr.DisplayName 4304 } 4305 if lsr.AutoMitigate != nil { 4306 objectMap["autoMitigate"] = lsr.AutoMitigate 4307 } 4308 if lsr.Enabled != "" { 4309 objectMap["enabled"] = lsr.Enabled 4310 } 4311 if lsr.Source != nil { 4312 objectMap["source"] = lsr.Source 4313 } 4314 if lsr.Schedule != nil { 4315 objectMap["schedule"] = lsr.Schedule 4316 } 4317 objectMap["action"] = lsr.Action 4318 return json.Marshal(objectMap) 4319} 4320 4321// UnmarshalJSON is the custom unmarshaler for LogSearchRule struct. 4322func (lsr *LogSearchRule) UnmarshalJSON(body []byte) error { 4323 var m map[string]*json.RawMessage 4324 err := json.Unmarshal(body, &m) 4325 if err != nil { 4326 return err 4327 } 4328 for k, v := range m { 4329 switch k { 4330 case "createdWithApiVersion": 4331 if v != nil { 4332 var createdWithAPIVersion string 4333 err = json.Unmarshal(*v, &createdWithAPIVersion) 4334 if err != nil { 4335 return err 4336 } 4337 lsr.CreatedWithAPIVersion = &createdWithAPIVersion 4338 } 4339 case "isLegacyLogAnalyticsRule": 4340 if v != nil { 4341 var isLegacyLogAnalyticsRule bool 4342 err = json.Unmarshal(*v, &isLegacyLogAnalyticsRule) 4343 if err != nil { 4344 return err 4345 } 4346 lsr.IsLegacyLogAnalyticsRule = &isLegacyLogAnalyticsRule 4347 } 4348 case "description": 4349 if v != nil { 4350 var description string 4351 err = json.Unmarshal(*v, &description) 4352 if err != nil { 4353 return err 4354 } 4355 lsr.Description = &description 4356 } 4357 case "displayName": 4358 if v != nil { 4359 var displayName string 4360 err = json.Unmarshal(*v, &displayName) 4361 if err != nil { 4362 return err 4363 } 4364 lsr.DisplayName = &displayName 4365 } 4366 case "autoMitigate": 4367 if v != nil { 4368 var autoMitigate bool 4369 err = json.Unmarshal(*v, &autoMitigate) 4370 if err != nil { 4371 return err 4372 } 4373 lsr.AutoMitigate = &autoMitigate 4374 } 4375 case "enabled": 4376 if v != nil { 4377 var enabled Enabled 4378 err = json.Unmarshal(*v, &enabled) 4379 if err != nil { 4380 return err 4381 } 4382 lsr.Enabled = enabled 4383 } 4384 case "lastUpdatedTime": 4385 if v != nil { 4386 var lastUpdatedTime date.Time 4387 err = json.Unmarshal(*v, &lastUpdatedTime) 4388 if err != nil { 4389 return err 4390 } 4391 lsr.LastUpdatedTime = &lastUpdatedTime 4392 } 4393 case "provisioningState": 4394 if v != nil { 4395 var provisioningState ProvisioningState 4396 err = json.Unmarshal(*v, &provisioningState) 4397 if err != nil { 4398 return err 4399 } 4400 lsr.ProvisioningState = provisioningState 4401 } 4402 case "source": 4403 if v != nil { 4404 var source Source 4405 err = json.Unmarshal(*v, &source) 4406 if err != nil { 4407 return err 4408 } 4409 lsr.Source = &source 4410 } 4411 case "schedule": 4412 if v != nil { 4413 var schedule Schedule 4414 err = json.Unmarshal(*v, &schedule) 4415 if err != nil { 4416 return err 4417 } 4418 lsr.Schedule = &schedule 4419 } 4420 case "action": 4421 if v != nil { 4422 action, err := unmarshalBasicAction(*v) 4423 if err != nil { 4424 return err 4425 } 4426 lsr.Action = action 4427 } 4428 } 4429 } 4430 4431 return nil 4432} 4433 4434// LogSearchRulePatch log Search Rule Definition for Patching 4435type LogSearchRulePatch struct { 4436 // Enabled - The flag which indicates whether the Log Search rule is enabled. Value should be true or false. Possible values include: 'EnabledTrue', 'EnabledFalse' 4437 Enabled Enabled `json:"enabled,omitempty"` 4438} 4439 4440// LogSearchRuleResource the Log Search Rule resource. 4441type LogSearchRuleResource struct { 4442 autorest.Response `json:"-"` 4443 // LogSearchRule - The rule properties of the resource. 4444 *LogSearchRule `json:"properties,omitempty"` 4445 // ID - READ-ONLY; Azure resource Id 4446 ID *string `json:"id,omitempty"` 4447 // Name - READ-ONLY; Azure resource name 4448 Name *string `json:"name,omitempty"` 4449 // Type - READ-ONLY; Azure resource type 4450 Type *string `json:"type,omitempty"` 4451 // Location - Resource location 4452 Location *string `json:"location,omitempty"` 4453 // Tags - Resource tags 4454 Tags map[string]*string `json:"tags"` 4455 // Kind - READ-ONLY; Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. 4456 Kind *string `json:"kind,omitempty"` 4457 // Etag - READ-ONLY; The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. 4458 Etag *string `json:"etag,omitempty"` 4459} 4460 4461// MarshalJSON is the custom marshaler for LogSearchRuleResource. 4462func (lsrr LogSearchRuleResource) MarshalJSON() ([]byte, error) { 4463 objectMap := make(map[string]interface{}) 4464 if lsrr.LogSearchRule != nil { 4465 objectMap["properties"] = lsrr.LogSearchRule 4466 } 4467 if lsrr.Location != nil { 4468 objectMap["location"] = lsrr.Location 4469 } 4470 if lsrr.Tags != nil { 4471 objectMap["tags"] = lsrr.Tags 4472 } 4473 return json.Marshal(objectMap) 4474} 4475 4476// UnmarshalJSON is the custom unmarshaler for LogSearchRuleResource struct. 4477func (lsrr *LogSearchRuleResource) UnmarshalJSON(body []byte) error { 4478 var m map[string]*json.RawMessage 4479 err := json.Unmarshal(body, &m) 4480 if err != nil { 4481 return err 4482 } 4483 for k, v := range m { 4484 switch k { 4485 case "properties": 4486 if v != nil { 4487 var logSearchRule LogSearchRule 4488 err = json.Unmarshal(*v, &logSearchRule) 4489 if err != nil { 4490 return err 4491 } 4492 lsrr.LogSearchRule = &logSearchRule 4493 } 4494 case "id": 4495 if v != nil { 4496 var ID string 4497 err = json.Unmarshal(*v, &ID) 4498 if err != nil { 4499 return err 4500 } 4501 lsrr.ID = &ID 4502 } 4503 case "name": 4504 if v != nil { 4505 var name string 4506 err = json.Unmarshal(*v, &name) 4507 if err != nil { 4508 return err 4509 } 4510 lsrr.Name = &name 4511 } 4512 case "type": 4513 if v != nil { 4514 var typeVar string 4515 err = json.Unmarshal(*v, &typeVar) 4516 if err != nil { 4517 return err 4518 } 4519 lsrr.Type = &typeVar 4520 } 4521 case "location": 4522 if v != nil { 4523 var location string 4524 err = json.Unmarshal(*v, &location) 4525 if err != nil { 4526 return err 4527 } 4528 lsrr.Location = &location 4529 } 4530 case "tags": 4531 if v != nil { 4532 var tags map[string]*string 4533 err = json.Unmarshal(*v, &tags) 4534 if err != nil { 4535 return err 4536 } 4537 lsrr.Tags = tags 4538 } 4539 case "kind": 4540 if v != nil { 4541 var kind string 4542 err = json.Unmarshal(*v, &kind) 4543 if err != nil { 4544 return err 4545 } 4546 lsrr.Kind = &kind 4547 } 4548 case "etag": 4549 if v != nil { 4550 var etag string 4551 err = json.Unmarshal(*v, &etag) 4552 if err != nil { 4553 return err 4554 } 4555 lsrr.Etag = &etag 4556 } 4557 } 4558 } 4559 4560 return nil 4561} 4562 4563// LogSearchRuleResourceCollection represents a collection of Log Search rule resources. 4564type LogSearchRuleResourceCollection struct { 4565 autorest.Response `json:"-"` 4566 // Value - The values for the Log Search Rule resources. 4567 Value *[]LogSearchRuleResource `json:"value,omitempty"` 4568} 4569 4570// LogSearchRuleResourcePatch the log search rule resource for patch operations. 4571type LogSearchRuleResourcePatch struct { 4572 // Tags - Resource tags 4573 Tags map[string]*string `json:"tags"` 4574 // LogSearchRulePatch - The log search rule properties of the resource. 4575 *LogSearchRulePatch `json:"properties,omitempty"` 4576} 4577 4578// MarshalJSON is the custom marshaler for LogSearchRuleResourcePatch. 4579func (lsrrp LogSearchRuleResourcePatch) MarshalJSON() ([]byte, error) { 4580 objectMap := make(map[string]interface{}) 4581 if lsrrp.Tags != nil { 4582 objectMap["tags"] = lsrrp.Tags 4583 } 4584 if lsrrp.LogSearchRulePatch != nil { 4585 objectMap["properties"] = lsrrp.LogSearchRulePatch 4586 } 4587 return json.Marshal(objectMap) 4588} 4589 4590// UnmarshalJSON is the custom unmarshaler for LogSearchRuleResourcePatch struct. 4591func (lsrrp *LogSearchRuleResourcePatch) UnmarshalJSON(body []byte) error { 4592 var m map[string]*json.RawMessage 4593 err := json.Unmarshal(body, &m) 4594 if err != nil { 4595 return err 4596 } 4597 for k, v := range m { 4598 switch k { 4599 case "tags": 4600 if v != nil { 4601 var tags map[string]*string 4602 err = json.Unmarshal(*v, &tags) 4603 if err != nil { 4604 return err 4605 } 4606 lsrrp.Tags = tags 4607 } 4608 case "properties": 4609 if v != nil { 4610 var logSearchRulePatch LogSearchRulePatch 4611 err = json.Unmarshal(*v, &logSearchRulePatch) 4612 if err != nil { 4613 return err 4614 } 4615 lsrrp.LogSearchRulePatch = &logSearchRulePatch 4616 } 4617 } 4618 } 4619 4620 return nil 4621} 4622 4623// LogSettings part of MultiTenantDiagnosticSettings. Specifies the settings for a particular log. 4624type LogSettings struct { 4625 // 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. 4626 Category *string `json:"category,omitempty"` 4627 // Enabled - a value indicating whether this log is enabled. 4628 Enabled *bool `json:"enabled,omitempty"` 4629 // RetentionPolicy - the retention policy for this log. 4630 RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"` 4631} 4632 4633// LogsIngestionEndpointSpec definition of the endpoint used for ingesting logs. 4634type LogsIngestionEndpointSpec struct { 4635 // Endpoint - READ-ONLY; The endpoint. This property is READ-ONLY. 4636 Endpoint *string `json:"endpoint,omitempty"` 4637} 4638 4639// MarshalJSON is the custom marshaler for LogsIngestionEndpointSpec. 4640func (lies LogsIngestionEndpointSpec) MarshalJSON() ([]byte, error) { 4641 objectMap := make(map[string]interface{}) 4642 return json.Marshal(objectMap) 4643} 4644 4645// LogToMetricAction specify action need to be taken when rule type is converting log to metric 4646type LogToMetricAction struct { 4647 // Criteria - Criteria of Metric 4648 Criteria *[]Criteria `json:"criteria,omitempty"` 4649 // OdataType - Possible values include: 'OdataTypeBasicActionOdataTypeAction', 'OdataTypeBasicActionOdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesAlertingAction', 'OdataTypeBasicActionOdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction' 4650 OdataType OdataTypeBasicAction `json:"odata.type,omitempty"` 4651} 4652 4653// MarshalJSON is the custom marshaler for LogToMetricAction. 4654func (ltma LogToMetricAction) MarshalJSON() ([]byte, error) { 4655 ltma.OdataType = OdataTypeBasicActionOdataTypeMicrosoftWindowsAzureManagementMonitoringAlertsModelsMicrosoftAppInsightsNexusDataContractsResourcesScheduledQueryRulesLogToMetricAction 4656 objectMap := make(map[string]interface{}) 4657 if ltma.Criteria != nil { 4658 objectMap["criteria"] = ltma.Criteria 4659 } 4660 if ltma.OdataType != "" { 4661 objectMap["odata.type"] = ltma.OdataType 4662 } 4663 return json.Marshal(objectMap) 4664} 4665 4666// AsAlertingAction is the BasicAction implementation for LogToMetricAction. 4667func (ltma LogToMetricAction) AsAlertingAction() (*AlertingAction, bool) { 4668 return nil, false 4669} 4670 4671// AsLogToMetricAction is the BasicAction implementation for LogToMetricAction. 4672func (ltma LogToMetricAction) AsLogToMetricAction() (*LogToMetricAction, bool) { 4673 return <ma, true 4674} 4675 4676// AsAction is the BasicAction implementation for LogToMetricAction. 4677func (ltma LogToMetricAction) AsAction() (*Action, bool) { 4678 return nil, false 4679} 4680 4681// AsBasicAction is the BasicAction implementation for LogToMetricAction. 4682func (ltma LogToMetricAction) AsBasicAction() (BasicAction, bool) { 4683 return <ma, true 4684} 4685 4686// ManagementEventAggregationCondition how the data that is collected should be combined over time. 4687type ManagementEventAggregationCondition struct { 4688 // Operator - the condition operator. Possible values include: 'ConditionOperatorGreaterThan', 'ConditionOperatorGreaterThanOrEqual', 'ConditionOperatorLessThan', 'ConditionOperatorLessThanOrEqual' 4689 Operator ConditionOperator `json:"operator,omitempty"` 4690 // Threshold - The threshold value that activates the alert. 4691 Threshold *float64 `json:"threshold,omitempty"` 4692 // 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. 4693 WindowSize *string `json:"windowSize,omitempty"` 4694} 4695 4696// ManagementEventRuleCondition a management event rule condition. 4697type ManagementEventRuleCondition struct { 4698 // 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. 4699 Aggregation *ManagementEventAggregationCondition `json:"aggregation,omitempty"` 4700 // DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource. 4701 DataSource BasicRuleDataSource `json:"dataSource,omitempty"` 4702 // OdataType - Possible values include: 'OdataTypeBasicRuleConditionOdataTypeRuleCondition', 'OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition' 4703 OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"` 4704} 4705 4706// MarshalJSON is the custom marshaler for ManagementEventRuleCondition. 4707func (merc ManagementEventRuleCondition) MarshalJSON() ([]byte, error) { 4708 merc.OdataType = OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition 4709 objectMap := make(map[string]interface{}) 4710 if merc.Aggregation != nil { 4711 objectMap["aggregation"] = merc.Aggregation 4712 } 4713 objectMap["dataSource"] = merc.DataSource 4714 if merc.OdataType != "" { 4715 objectMap["odata.type"] = merc.OdataType 4716 } 4717 return json.Marshal(objectMap) 4718} 4719 4720// AsThresholdRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition. 4721func (merc ManagementEventRuleCondition) AsThresholdRuleCondition() (*ThresholdRuleCondition, bool) { 4722 return nil, false 4723} 4724 4725// AsLocationThresholdRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition. 4726func (merc ManagementEventRuleCondition) AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool) { 4727 return nil, false 4728} 4729 4730// AsManagementEventRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition. 4731func (merc ManagementEventRuleCondition) AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool) { 4732 return &merc, true 4733} 4734 4735// AsRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition. 4736func (merc ManagementEventRuleCondition) AsRuleCondition() (*RuleCondition, bool) { 4737 return nil, false 4738} 4739 4740// AsBasicRuleCondition is the BasicRuleCondition implementation for ManagementEventRuleCondition. 4741func (merc ManagementEventRuleCondition) AsBasicRuleCondition() (BasicRuleCondition, bool) { 4742 return &merc, true 4743} 4744 4745// UnmarshalJSON is the custom unmarshaler for ManagementEventRuleCondition struct. 4746func (merc *ManagementEventRuleCondition) UnmarshalJSON(body []byte) error { 4747 var m map[string]*json.RawMessage 4748 err := json.Unmarshal(body, &m) 4749 if err != nil { 4750 return err 4751 } 4752 for k, v := range m { 4753 switch k { 4754 case "aggregation": 4755 if v != nil { 4756 var aggregation ManagementEventAggregationCondition 4757 err = json.Unmarshal(*v, &aggregation) 4758 if err != nil { 4759 return err 4760 } 4761 merc.Aggregation = &aggregation 4762 } 4763 case "dataSource": 4764 if v != nil { 4765 dataSource, err := unmarshalBasicRuleDataSource(*v) 4766 if err != nil { 4767 return err 4768 } 4769 merc.DataSource = dataSource 4770 } 4771 case "odata.type": 4772 if v != nil { 4773 var odataType OdataTypeBasicRuleCondition 4774 err = json.Unmarshal(*v, &odataType) 4775 if err != nil { 4776 return err 4777 } 4778 merc.OdataType = odataType 4779 } 4780 } 4781 } 4782 4783 return nil 4784} 4785 4786// MetadataValue represents a metric metadata value. 4787type MetadataValue struct { 4788 // Name - the name of the metadata. 4789 Name *LocalizableString `json:"name,omitempty"` 4790 // Value - the value of the metadata. 4791 Value *string `json:"value,omitempty"` 4792} 4793 4794// Metric the result data of a query. 4795type Metric struct { 4796 // ID - the metric Id. 4797 ID *string `json:"id,omitempty"` 4798 // Type - the resource type of the metric resource. 4799 Type *string `json:"type,omitempty"` 4800 // Name - the name and the display name of the metric, i.e. it is localizable string. 4801 Name *LocalizableString `json:"name,omitempty"` 4802 // DisplayDescription - Detailed description of this metric. 4803 DisplayDescription *string `json:"displayDescription,omitempty"` 4804 // ErrorCode - 'Success' or the error details on query failures for this metric. 4805 ErrorCode *string `json:"errorCode,omitempty"` 4806 // ErrorMessage - Error message encountered querying this specific metric. 4807 ErrorMessage *string `json:"errorMessage,omitempty"` 4808 // Unit - The unit of the metric. Possible values include: 'MetricUnitCount', 'MetricUnitBytes', 'MetricUnitSeconds', 'MetricUnitCountPerSecond', 'MetricUnitBytesPerSecond', 'MetricUnitPercent', 'MetricUnitMilliSeconds', 'MetricUnitByteSeconds', 'MetricUnitUnspecified', 'MetricUnitCores', 'MetricUnitMilliCores', 'MetricUnitNanoCores', 'MetricUnitBitsPerSecond' 4809 Unit MetricUnit `json:"unit,omitempty"` 4810 // Timeseries - the time series returned when a data query is performed. 4811 Timeseries *[]TimeSeriesElement `json:"timeseries,omitempty"` 4812} 4813 4814// MetricAlertAction an alert action. 4815type MetricAlertAction struct { 4816 // ActionGroupID - the id of the action group to use. 4817 ActionGroupID *string `json:"actionGroupId,omitempty"` 4818 // WebHookProperties - This field allows specifying custom properties, which would be appended to the alert payload sent as input to the webhook. 4819 WebHookProperties map[string]*string `json:"webHookProperties"` 4820} 4821 4822// MarshalJSON is the custom marshaler for MetricAlertAction. 4823func (maa MetricAlertAction) MarshalJSON() ([]byte, error) { 4824 objectMap := make(map[string]interface{}) 4825 if maa.ActionGroupID != nil { 4826 objectMap["actionGroupId"] = maa.ActionGroupID 4827 } 4828 if maa.WebHookProperties != nil { 4829 objectMap["webHookProperties"] = maa.WebHookProperties 4830 } 4831 return json.Marshal(objectMap) 4832} 4833 4834// BasicMetricAlertCriteria the rule criteria that defines the conditions of the alert rule. 4835type BasicMetricAlertCriteria interface { 4836 AsMetricAlertSingleResourceMultipleMetricCriteria() (*MetricAlertSingleResourceMultipleMetricCriteria, bool) 4837 AsWebtestLocationAvailabilityCriteria() (*WebtestLocationAvailabilityCriteria, bool) 4838 AsMetricAlertMultipleResourceMultipleMetricCriteria() (*MetricAlertMultipleResourceMultipleMetricCriteria, bool) 4839 AsMetricAlertCriteria() (*MetricAlertCriteria, bool) 4840} 4841 4842// MetricAlertCriteria the rule criteria that defines the conditions of the alert rule. 4843type MetricAlertCriteria struct { 4844 // AdditionalProperties - Unmatched properties from the message are deserialized this collection 4845 AdditionalProperties map[string]interface{} `json:""` 4846 // OdataType - Possible values include: 'OdataTypeBasicMetricAlertCriteriaOdataTypeMetricAlertCriteria', 'OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria', 'OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria', 'OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria' 4847 OdataType OdataTypeBasicMetricAlertCriteria `json:"odata.type,omitempty"` 4848} 4849 4850func unmarshalBasicMetricAlertCriteria(body []byte) (BasicMetricAlertCriteria, error) { 4851 var m map[string]interface{} 4852 err := json.Unmarshal(body, &m) 4853 if err != nil { 4854 return nil, err 4855 } 4856 4857 switch m["odata.type"] { 4858 case string(OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria): 4859 var masrmmc MetricAlertSingleResourceMultipleMetricCriteria 4860 err := json.Unmarshal(body, &masrmmc) 4861 return masrmmc, err 4862 case string(OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria): 4863 var wlac WebtestLocationAvailabilityCriteria 4864 err := json.Unmarshal(body, &wlac) 4865 return wlac, err 4866 case string(OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria): 4867 var mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria 4868 err := json.Unmarshal(body, &mamrmmc) 4869 return mamrmmc, err 4870 default: 4871 var mac MetricAlertCriteria 4872 err := json.Unmarshal(body, &mac) 4873 return mac, err 4874 } 4875} 4876func unmarshalBasicMetricAlertCriteriaArray(body []byte) ([]BasicMetricAlertCriteria, error) { 4877 var rawMessages []*json.RawMessage 4878 err := json.Unmarshal(body, &rawMessages) 4879 if err != nil { 4880 return nil, err 4881 } 4882 4883 macArray := make([]BasicMetricAlertCriteria, len(rawMessages)) 4884 4885 for index, rawMessage := range rawMessages { 4886 mac, err := unmarshalBasicMetricAlertCriteria(*rawMessage) 4887 if err != nil { 4888 return nil, err 4889 } 4890 macArray[index] = mac 4891 } 4892 return macArray, nil 4893} 4894 4895// MarshalJSON is the custom marshaler for MetricAlertCriteria. 4896func (mac MetricAlertCriteria) MarshalJSON() ([]byte, error) { 4897 mac.OdataType = OdataTypeBasicMetricAlertCriteriaOdataTypeMetricAlertCriteria 4898 objectMap := make(map[string]interface{}) 4899 if mac.OdataType != "" { 4900 objectMap["odata.type"] = mac.OdataType 4901 } 4902 for k, v := range mac.AdditionalProperties { 4903 objectMap[k] = v 4904 } 4905 return json.Marshal(objectMap) 4906} 4907 4908// AsMetricAlertSingleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertCriteria. 4909func (mac MetricAlertCriteria) AsMetricAlertSingleResourceMultipleMetricCriteria() (*MetricAlertSingleResourceMultipleMetricCriteria, bool) { 4910 return nil, false 4911} 4912 4913// AsWebtestLocationAvailabilityCriteria is the BasicMetricAlertCriteria implementation for MetricAlertCriteria. 4914func (mac MetricAlertCriteria) AsWebtestLocationAvailabilityCriteria() (*WebtestLocationAvailabilityCriteria, bool) { 4915 return nil, false 4916} 4917 4918// AsMetricAlertMultipleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertCriteria. 4919func (mac MetricAlertCriteria) AsMetricAlertMultipleResourceMultipleMetricCriteria() (*MetricAlertMultipleResourceMultipleMetricCriteria, bool) { 4920 return nil, false 4921} 4922 4923// AsMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertCriteria. 4924func (mac MetricAlertCriteria) AsMetricAlertCriteria() (*MetricAlertCriteria, bool) { 4925 return &mac, true 4926} 4927 4928// AsBasicMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertCriteria. 4929func (mac MetricAlertCriteria) AsBasicMetricAlertCriteria() (BasicMetricAlertCriteria, bool) { 4930 return &mac, true 4931} 4932 4933// UnmarshalJSON is the custom unmarshaler for MetricAlertCriteria struct. 4934func (mac *MetricAlertCriteria) UnmarshalJSON(body []byte) error { 4935 var m map[string]*json.RawMessage 4936 err := json.Unmarshal(body, &m) 4937 if err != nil { 4938 return err 4939 } 4940 for k, v := range m { 4941 switch k { 4942 default: 4943 if v != nil { 4944 var additionalProperties interface{} 4945 err = json.Unmarshal(*v, &additionalProperties) 4946 if err != nil { 4947 return err 4948 } 4949 if mac.AdditionalProperties == nil { 4950 mac.AdditionalProperties = make(map[string]interface{}) 4951 } 4952 mac.AdditionalProperties[k] = additionalProperties 4953 } 4954 case "odata.type": 4955 if v != nil { 4956 var odataType OdataTypeBasicMetricAlertCriteria 4957 err = json.Unmarshal(*v, &odataType) 4958 if err != nil { 4959 return err 4960 } 4961 mac.OdataType = odataType 4962 } 4963 } 4964 } 4965 4966 return nil 4967} 4968 4969// MetricAlertMultipleResourceMultipleMetricCriteria specifies the metric alert criteria for multiple 4970// resource that has multiple metric criteria. 4971type MetricAlertMultipleResourceMultipleMetricCriteria struct { 4972 // AllOf - the list of multiple metric criteria for this 'all of' operation. 4973 AllOf *[]BasicMultiMetricCriteria `json:"allOf,omitempty"` 4974 // AdditionalProperties - Unmatched properties from the message are deserialized this collection 4975 AdditionalProperties map[string]interface{} `json:""` 4976 // OdataType - Possible values include: 'OdataTypeBasicMetricAlertCriteriaOdataTypeMetricAlertCriteria', 'OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria', 'OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria', 'OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria' 4977 OdataType OdataTypeBasicMetricAlertCriteria `json:"odata.type,omitempty"` 4978} 4979 4980// MarshalJSON is the custom marshaler for MetricAlertMultipleResourceMultipleMetricCriteria. 4981func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) MarshalJSON() ([]byte, error) { 4982 mamrmmc.OdataType = OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria 4983 objectMap := make(map[string]interface{}) 4984 if mamrmmc.AllOf != nil { 4985 objectMap["allOf"] = mamrmmc.AllOf 4986 } 4987 if mamrmmc.OdataType != "" { 4988 objectMap["odata.type"] = mamrmmc.OdataType 4989 } 4990 for k, v := range mamrmmc.AdditionalProperties { 4991 objectMap[k] = v 4992 } 4993 return json.Marshal(objectMap) 4994} 4995 4996// AsMetricAlertSingleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertMultipleResourceMultipleMetricCriteria. 4997func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) AsMetricAlertSingleResourceMultipleMetricCriteria() (*MetricAlertSingleResourceMultipleMetricCriteria, bool) { 4998 return nil, false 4999} 5000 5001// AsWebtestLocationAvailabilityCriteria is the BasicMetricAlertCriteria implementation for MetricAlertMultipleResourceMultipleMetricCriteria. 5002func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) AsWebtestLocationAvailabilityCriteria() (*WebtestLocationAvailabilityCriteria, bool) { 5003 return nil, false 5004} 5005 5006// AsMetricAlertMultipleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertMultipleResourceMultipleMetricCriteria. 5007func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) AsMetricAlertMultipleResourceMultipleMetricCriteria() (*MetricAlertMultipleResourceMultipleMetricCriteria, bool) { 5008 return &mamrmmc, true 5009} 5010 5011// AsMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertMultipleResourceMultipleMetricCriteria. 5012func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) AsMetricAlertCriteria() (*MetricAlertCriteria, bool) { 5013 return nil, false 5014} 5015 5016// AsBasicMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertMultipleResourceMultipleMetricCriteria. 5017func (mamrmmc MetricAlertMultipleResourceMultipleMetricCriteria) AsBasicMetricAlertCriteria() (BasicMetricAlertCriteria, bool) { 5018 return &mamrmmc, true 5019} 5020 5021// UnmarshalJSON is the custom unmarshaler for MetricAlertMultipleResourceMultipleMetricCriteria struct. 5022func (mamrmmc *MetricAlertMultipleResourceMultipleMetricCriteria) UnmarshalJSON(body []byte) error { 5023 var m map[string]*json.RawMessage 5024 err := json.Unmarshal(body, &m) 5025 if err != nil { 5026 return err 5027 } 5028 for k, v := range m { 5029 switch k { 5030 case "allOf": 5031 if v != nil { 5032 allOf, err := unmarshalBasicMultiMetricCriteriaArray(*v) 5033 if err != nil { 5034 return err 5035 } 5036 mamrmmc.AllOf = &allOf 5037 } 5038 default: 5039 if v != nil { 5040 var additionalProperties interface{} 5041 err = json.Unmarshal(*v, &additionalProperties) 5042 if err != nil { 5043 return err 5044 } 5045 if mamrmmc.AdditionalProperties == nil { 5046 mamrmmc.AdditionalProperties = make(map[string]interface{}) 5047 } 5048 mamrmmc.AdditionalProperties[k] = additionalProperties 5049 } 5050 case "odata.type": 5051 if v != nil { 5052 var odataType OdataTypeBasicMetricAlertCriteria 5053 err = json.Unmarshal(*v, &odataType) 5054 if err != nil { 5055 return err 5056 } 5057 mamrmmc.OdataType = odataType 5058 } 5059 } 5060 } 5061 5062 return nil 5063} 5064 5065// MetricAlertProperties an alert rule. 5066type MetricAlertProperties struct { 5067 // Description - the description of the metric alert that will be included in the alert email. 5068 Description *string `json:"description,omitempty"` 5069 // Severity - Alert severity {0, 1, 2, 3, 4} 5070 Severity *int32 `json:"severity,omitempty"` 5071 // Enabled - the flag that indicates whether the metric alert is enabled. 5072 Enabled *bool `json:"enabled,omitempty"` 5073 // Scopes - the list of resource id's that this metric alert is scoped to. 5074 Scopes *[]string `json:"scopes,omitempty"` 5075 // EvaluationFrequency - how often the metric alert is evaluated represented in ISO 8601 duration format. 5076 EvaluationFrequency *string `json:"evaluationFrequency,omitempty"` 5077 // WindowSize - the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. 5078 WindowSize *string `json:"windowSize,omitempty"` 5079 // TargetResourceType - the resource type of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. 5080 TargetResourceType *string `json:"targetResourceType,omitempty"` 5081 // TargetResourceRegion - the region of the target resource(s) on which the alert is created/updated. Mandatory if the scope contains a subscription, resource group, or more than one resource. 5082 TargetResourceRegion *string `json:"targetResourceRegion,omitempty"` 5083 // Criteria - defines the specific alert criteria information. 5084 Criteria BasicMetricAlertCriteria `json:"criteria,omitempty"` 5085 // AutoMitigate - the flag that indicates whether the alert should be auto resolved or not. The default is true. 5086 AutoMitigate *bool `json:"autoMitigate,omitempty"` 5087 // Actions - the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. 5088 Actions *[]MetricAlertAction `json:"actions,omitempty"` 5089 // LastUpdatedTime - READ-ONLY; Last time the rule was updated in ISO8601 format. 5090 LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` 5091 // IsMigrated - READ-ONLY; the value indicating whether this alert rule is migrated. 5092 IsMigrated *bool `json:"isMigrated,omitempty"` 5093} 5094 5095// MarshalJSON is the custom marshaler for MetricAlertProperties. 5096func (mapVar MetricAlertProperties) MarshalJSON() ([]byte, error) { 5097 objectMap := make(map[string]interface{}) 5098 if mapVar.Description != nil { 5099 objectMap["description"] = mapVar.Description 5100 } 5101 if mapVar.Severity != nil { 5102 objectMap["severity"] = mapVar.Severity 5103 } 5104 if mapVar.Enabled != nil { 5105 objectMap["enabled"] = mapVar.Enabled 5106 } 5107 if mapVar.Scopes != nil { 5108 objectMap["scopes"] = mapVar.Scopes 5109 } 5110 if mapVar.EvaluationFrequency != nil { 5111 objectMap["evaluationFrequency"] = mapVar.EvaluationFrequency 5112 } 5113 if mapVar.WindowSize != nil { 5114 objectMap["windowSize"] = mapVar.WindowSize 5115 } 5116 if mapVar.TargetResourceType != nil { 5117 objectMap["targetResourceType"] = mapVar.TargetResourceType 5118 } 5119 if mapVar.TargetResourceRegion != nil { 5120 objectMap["targetResourceRegion"] = mapVar.TargetResourceRegion 5121 } 5122 objectMap["criteria"] = mapVar.Criteria 5123 if mapVar.AutoMitigate != nil { 5124 objectMap["autoMitigate"] = mapVar.AutoMitigate 5125 } 5126 if mapVar.Actions != nil { 5127 objectMap["actions"] = mapVar.Actions 5128 } 5129 return json.Marshal(objectMap) 5130} 5131 5132// UnmarshalJSON is the custom unmarshaler for MetricAlertProperties struct. 5133func (mapVar *MetricAlertProperties) UnmarshalJSON(body []byte) error { 5134 var m map[string]*json.RawMessage 5135 err := json.Unmarshal(body, &m) 5136 if err != nil { 5137 return err 5138 } 5139 for k, v := range m { 5140 switch k { 5141 case "description": 5142 if v != nil { 5143 var description string 5144 err = json.Unmarshal(*v, &description) 5145 if err != nil { 5146 return err 5147 } 5148 mapVar.Description = &description 5149 } 5150 case "severity": 5151 if v != nil { 5152 var severity int32 5153 err = json.Unmarshal(*v, &severity) 5154 if err != nil { 5155 return err 5156 } 5157 mapVar.Severity = &severity 5158 } 5159 case "enabled": 5160 if v != nil { 5161 var enabled bool 5162 err = json.Unmarshal(*v, &enabled) 5163 if err != nil { 5164 return err 5165 } 5166 mapVar.Enabled = &enabled 5167 } 5168 case "scopes": 5169 if v != nil { 5170 var scopes []string 5171 err = json.Unmarshal(*v, &scopes) 5172 if err != nil { 5173 return err 5174 } 5175 mapVar.Scopes = &scopes 5176 } 5177 case "evaluationFrequency": 5178 if v != nil { 5179 var evaluationFrequency string 5180 err = json.Unmarshal(*v, &evaluationFrequency) 5181 if err != nil { 5182 return err 5183 } 5184 mapVar.EvaluationFrequency = &evaluationFrequency 5185 } 5186 case "windowSize": 5187 if v != nil { 5188 var windowSize string 5189 err = json.Unmarshal(*v, &windowSize) 5190 if err != nil { 5191 return err 5192 } 5193 mapVar.WindowSize = &windowSize 5194 } 5195 case "targetResourceType": 5196 if v != nil { 5197 var targetResourceType string 5198 err = json.Unmarshal(*v, &targetResourceType) 5199 if err != nil { 5200 return err 5201 } 5202 mapVar.TargetResourceType = &targetResourceType 5203 } 5204 case "targetResourceRegion": 5205 if v != nil { 5206 var targetResourceRegion string 5207 err = json.Unmarshal(*v, &targetResourceRegion) 5208 if err != nil { 5209 return err 5210 } 5211 mapVar.TargetResourceRegion = &targetResourceRegion 5212 } 5213 case "criteria": 5214 if v != nil { 5215 criteria, err := unmarshalBasicMetricAlertCriteria(*v) 5216 if err != nil { 5217 return err 5218 } 5219 mapVar.Criteria = criteria 5220 } 5221 case "autoMitigate": 5222 if v != nil { 5223 var autoMitigate bool 5224 err = json.Unmarshal(*v, &autoMitigate) 5225 if err != nil { 5226 return err 5227 } 5228 mapVar.AutoMitigate = &autoMitigate 5229 } 5230 case "actions": 5231 if v != nil { 5232 var actions []MetricAlertAction 5233 err = json.Unmarshal(*v, &actions) 5234 if err != nil { 5235 return err 5236 } 5237 mapVar.Actions = &actions 5238 } 5239 case "lastUpdatedTime": 5240 if v != nil { 5241 var lastUpdatedTime date.Time 5242 err = json.Unmarshal(*v, &lastUpdatedTime) 5243 if err != nil { 5244 return err 5245 } 5246 mapVar.LastUpdatedTime = &lastUpdatedTime 5247 } 5248 case "isMigrated": 5249 if v != nil { 5250 var isMigrated bool 5251 err = json.Unmarshal(*v, &isMigrated) 5252 if err != nil { 5253 return err 5254 } 5255 mapVar.IsMigrated = &isMigrated 5256 } 5257 } 5258 } 5259 5260 return nil 5261} 5262 5263// MetricAlertPropertiesPatch an alert rule properties for patch. 5264type MetricAlertPropertiesPatch struct { 5265 // Description - the description of the metric alert that will be included in the alert email. 5266 Description *string `json:"description,omitempty"` 5267 // Severity - Alert severity {0, 1, 2, 3, 4} 5268 Severity *int32 `json:"severity,omitempty"` 5269 // Enabled - the flag that indicates whether the metric alert is enabled. 5270 Enabled *bool `json:"enabled,omitempty"` 5271 // Scopes - the list of resource id's that this metric alert is scoped to. 5272 Scopes *[]string `json:"scopes,omitempty"` 5273 // EvaluationFrequency - how often the metric alert is evaluated represented in ISO 8601 duration format. 5274 EvaluationFrequency *string `json:"evaluationFrequency,omitempty"` 5275 // WindowSize - the period of time (in ISO 8601 duration format) that is used to monitor alert activity based on the threshold. 5276 WindowSize *string `json:"windowSize,omitempty"` 5277 // TargetResourceType - the resource type of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. 5278 TargetResourceType *string `json:"targetResourceType,omitempty"` 5279 // TargetResourceRegion - the region of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria. 5280 TargetResourceRegion *string `json:"targetResourceRegion,omitempty"` 5281 // Criteria - defines the specific alert criteria information. 5282 Criteria BasicMetricAlertCriteria `json:"criteria,omitempty"` 5283 // AutoMitigate - the flag that indicates whether the alert should be auto resolved or not. The default is true. 5284 AutoMitigate *bool `json:"autoMitigate,omitempty"` 5285 // Actions - the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved. 5286 Actions *[]MetricAlertAction `json:"actions,omitempty"` 5287 // LastUpdatedTime - READ-ONLY; Last time the rule was updated in ISO8601 format. 5288 LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` 5289 // IsMigrated - READ-ONLY; the value indicating whether this alert rule is migrated. 5290 IsMigrated *bool `json:"isMigrated,omitempty"` 5291} 5292 5293// MarshalJSON is the custom marshaler for MetricAlertPropertiesPatch. 5294func (mapp MetricAlertPropertiesPatch) MarshalJSON() ([]byte, error) { 5295 objectMap := make(map[string]interface{}) 5296 if mapp.Description != nil { 5297 objectMap["description"] = mapp.Description 5298 } 5299 if mapp.Severity != nil { 5300 objectMap["severity"] = mapp.Severity 5301 } 5302 if mapp.Enabled != nil { 5303 objectMap["enabled"] = mapp.Enabled 5304 } 5305 if mapp.Scopes != nil { 5306 objectMap["scopes"] = mapp.Scopes 5307 } 5308 if mapp.EvaluationFrequency != nil { 5309 objectMap["evaluationFrequency"] = mapp.EvaluationFrequency 5310 } 5311 if mapp.WindowSize != nil { 5312 objectMap["windowSize"] = mapp.WindowSize 5313 } 5314 if mapp.TargetResourceType != nil { 5315 objectMap["targetResourceType"] = mapp.TargetResourceType 5316 } 5317 if mapp.TargetResourceRegion != nil { 5318 objectMap["targetResourceRegion"] = mapp.TargetResourceRegion 5319 } 5320 objectMap["criteria"] = mapp.Criteria 5321 if mapp.AutoMitigate != nil { 5322 objectMap["autoMitigate"] = mapp.AutoMitigate 5323 } 5324 if mapp.Actions != nil { 5325 objectMap["actions"] = mapp.Actions 5326 } 5327 return json.Marshal(objectMap) 5328} 5329 5330// UnmarshalJSON is the custom unmarshaler for MetricAlertPropertiesPatch struct. 5331func (mapp *MetricAlertPropertiesPatch) UnmarshalJSON(body []byte) error { 5332 var m map[string]*json.RawMessage 5333 err := json.Unmarshal(body, &m) 5334 if err != nil { 5335 return err 5336 } 5337 for k, v := range m { 5338 switch k { 5339 case "description": 5340 if v != nil { 5341 var description string 5342 err = json.Unmarshal(*v, &description) 5343 if err != nil { 5344 return err 5345 } 5346 mapp.Description = &description 5347 } 5348 case "severity": 5349 if v != nil { 5350 var severity int32 5351 err = json.Unmarshal(*v, &severity) 5352 if err != nil { 5353 return err 5354 } 5355 mapp.Severity = &severity 5356 } 5357 case "enabled": 5358 if v != nil { 5359 var enabled bool 5360 err = json.Unmarshal(*v, &enabled) 5361 if err != nil { 5362 return err 5363 } 5364 mapp.Enabled = &enabled 5365 } 5366 case "scopes": 5367 if v != nil { 5368 var scopes []string 5369 err = json.Unmarshal(*v, &scopes) 5370 if err != nil { 5371 return err 5372 } 5373 mapp.Scopes = &scopes 5374 } 5375 case "evaluationFrequency": 5376 if v != nil { 5377 var evaluationFrequency string 5378 err = json.Unmarshal(*v, &evaluationFrequency) 5379 if err != nil { 5380 return err 5381 } 5382 mapp.EvaluationFrequency = &evaluationFrequency 5383 } 5384 case "windowSize": 5385 if v != nil { 5386 var windowSize string 5387 err = json.Unmarshal(*v, &windowSize) 5388 if err != nil { 5389 return err 5390 } 5391 mapp.WindowSize = &windowSize 5392 } 5393 case "targetResourceType": 5394 if v != nil { 5395 var targetResourceType string 5396 err = json.Unmarshal(*v, &targetResourceType) 5397 if err != nil { 5398 return err 5399 } 5400 mapp.TargetResourceType = &targetResourceType 5401 } 5402 case "targetResourceRegion": 5403 if v != nil { 5404 var targetResourceRegion string 5405 err = json.Unmarshal(*v, &targetResourceRegion) 5406 if err != nil { 5407 return err 5408 } 5409 mapp.TargetResourceRegion = &targetResourceRegion 5410 } 5411 case "criteria": 5412 if v != nil { 5413 criteria, err := unmarshalBasicMetricAlertCriteria(*v) 5414 if err != nil { 5415 return err 5416 } 5417 mapp.Criteria = criteria 5418 } 5419 case "autoMitigate": 5420 if v != nil { 5421 var autoMitigate bool 5422 err = json.Unmarshal(*v, &autoMitigate) 5423 if err != nil { 5424 return err 5425 } 5426 mapp.AutoMitigate = &autoMitigate 5427 } 5428 case "actions": 5429 if v != nil { 5430 var actions []MetricAlertAction 5431 err = json.Unmarshal(*v, &actions) 5432 if err != nil { 5433 return err 5434 } 5435 mapp.Actions = &actions 5436 } 5437 case "lastUpdatedTime": 5438 if v != nil { 5439 var lastUpdatedTime date.Time 5440 err = json.Unmarshal(*v, &lastUpdatedTime) 5441 if err != nil { 5442 return err 5443 } 5444 mapp.LastUpdatedTime = &lastUpdatedTime 5445 } 5446 case "isMigrated": 5447 if v != nil { 5448 var isMigrated bool 5449 err = json.Unmarshal(*v, &isMigrated) 5450 if err != nil { 5451 return err 5452 } 5453 mapp.IsMigrated = &isMigrated 5454 } 5455 } 5456 } 5457 5458 return nil 5459} 5460 5461// MetricAlertResource the metric alert resource. 5462type MetricAlertResource struct { 5463 autorest.Response `json:"-"` 5464 // MetricAlertProperties - The alert rule properties of the resource. 5465 *MetricAlertProperties `json:"properties,omitempty"` 5466 // ID - READ-ONLY; Azure resource Id 5467 ID *string `json:"id,omitempty"` 5468 // Name - READ-ONLY; Azure resource name 5469 Name *string `json:"name,omitempty"` 5470 // Type - READ-ONLY; Azure resource type 5471 Type *string `json:"type,omitempty"` 5472 // Location - Resource location 5473 Location *string `json:"location,omitempty"` 5474 // Tags - Resource tags 5475 Tags map[string]*string `json:"tags"` 5476 // Kind - READ-ONLY; Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. 5477 Kind *string `json:"kind,omitempty"` 5478 // Etag - READ-ONLY; The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. 5479 Etag *string `json:"etag,omitempty"` 5480} 5481 5482// MarshalJSON is the custom marshaler for MetricAlertResource. 5483func (mar MetricAlertResource) MarshalJSON() ([]byte, error) { 5484 objectMap := make(map[string]interface{}) 5485 if mar.MetricAlertProperties != nil { 5486 objectMap["properties"] = mar.MetricAlertProperties 5487 } 5488 if mar.Location != nil { 5489 objectMap["location"] = mar.Location 5490 } 5491 if mar.Tags != nil { 5492 objectMap["tags"] = mar.Tags 5493 } 5494 return json.Marshal(objectMap) 5495} 5496 5497// UnmarshalJSON is the custom unmarshaler for MetricAlertResource struct. 5498func (mar *MetricAlertResource) UnmarshalJSON(body []byte) error { 5499 var m map[string]*json.RawMessage 5500 err := json.Unmarshal(body, &m) 5501 if err != nil { 5502 return err 5503 } 5504 for k, v := range m { 5505 switch k { 5506 case "properties": 5507 if v != nil { 5508 var metricAlertProperties MetricAlertProperties 5509 err = json.Unmarshal(*v, &metricAlertProperties) 5510 if err != nil { 5511 return err 5512 } 5513 mar.MetricAlertProperties = &metricAlertProperties 5514 } 5515 case "id": 5516 if v != nil { 5517 var ID string 5518 err = json.Unmarshal(*v, &ID) 5519 if err != nil { 5520 return err 5521 } 5522 mar.ID = &ID 5523 } 5524 case "name": 5525 if v != nil { 5526 var name string 5527 err = json.Unmarshal(*v, &name) 5528 if err != nil { 5529 return err 5530 } 5531 mar.Name = &name 5532 } 5533 case "type": 5534 if v != nil { 5535 var typeVar string 5536 err = json.Unmarshal(*v, &typeVar) 5537 if err != nil { 5538 return err 5539 } 5540 mar.Type = &typeVar 5541 } 5542 case "location": 5543 if v != nil { 5544 var location string 5545 err = json.Unmarshal(*v, &location) 5546 if err != nil { 5547 return err 5548 } 5549 mar.Location = &location 5550 } 5551 case "tags": 5552 if v != nil { 5553 var tags map[string]*string 5554 err = json.Unmarshal(*v, &tags) 5555 if err != nil { 5556 return err 5557 } 5558 mar.Tags = tags 5559 } 5560 case "kind": 5561 if v != nil { 5562 var kind string 5563 err = json.Unmarshal(*v, &kind) 5564 if err != nil { 5565 return err 5566 } 5567 mar.Kind = &kind 5568 } 5569 case "etag": 5570 if v != nil { 5571 var etag string 5572 err = json.Unmarshal(*v, &etag) 5573 if err != nil { 5574 return err 5575 } 5576 mar.Etag = &etag 5577 } 5578 } 5579 } 5580 5581 return nil 5582} 5583 5584// MetricAlertResourceCollection represents a collection of alert rule resources. 5585type MetricAlertResourceCollection struct { 5586 autorest.Response `json:"-"` 5587 // Value - the values for the alert rule resources. 5588 Value *[]MetricAlertResource `json:"value,omitempty"` 5589} 5590 5591// MetricAlertResourcePatch the metric alert resource for patch operations. 5592type MetricAlertResourcePatch struct { 5593 // Tags - Resource tags 5594 Tags map[string]*string `json:"tags"` 5595 // MetricAlertPropertiesPatch - The alert rule properties of the resource. 5596 *MetricAlertPropertiesPatch `json:"properties,omitempty"` 5597} 5598 5599// MarshalJSON is the custom marshaler for MetricAlertResourcePatch. 5600func (marp MetricAlertResourcePatch) MarshalJSON() ([]byte, error) { 5601 objectMap := make(map[string]interface{}) 5602 if marp.Tags != nil { 5603 objectMap["tags"] = marp.Tags 5604 } 5605 if marp.MetricAlertPropertiesPatch != nil { 5606 objectMap["properties"] = marp.MetricAlertPropertiesPatch 5607 } 5608 return json.Marshal(objectMap) 5609} 5610 5611// UnmarshalJSON is the custom unmarshaler for MetricAlertResourcePatch struct. 5612func (marp *MetricAlertResourcePatch) UnmarshalJSON(body []byte) error { 5613 var m map[string]*json.RawMessage 5614 err := json.Unmarshal(body, &m) 5615 if err != nil { 5616 return err 5617 } 5618 for k, v := range m { 5619 switch k { 5620 case "tags": 5621 if v != nil { 5622 var tags map[string]*string 5623 err = json.Unmarshal(*v, &tags) 5624 if err != nil { 5625 return err 5626 } 5627 marp.Tags = tags 5628 } 5629 case "properties": 5630 if v != nil { 5631 var metricAlertPropertiesPatch MetricAlertPropertiesPatch 5632 err = json.Unmarshal(*v, &metricAlertPropertiesPatch) 5633 if err != nil { 5634 return err 5635 } 5636 marp.MetricAlertPropertiesPatch = &metricAlertPropertiesPatch 5637 } 5638 } 5639 } 5640 5641 return nil 5642} 5643 5644// MetricAlertSingleResourceMultipleMetricCriteria specifies the metric alert criteria for a single 5645// resource that has multiple metric criteria. 5646type MetricAlertSingleResourceMultipleMetricCriteria struct { 5647 // AllOf - The list of metric criteria for this 'all of' operation. 5648 AllOf *[]MetricCriteria `json:"allOf,omitempty"` 5649 // AdditionalProperties - Unmatched properties from the message are deserialized this collection 5650 AdditionalProperties map[string]interface{} `json:""` 5651 // OdataType - Possible values include: 'OdataTypeBasicMetricAlertCriteriaOdataTypeMetricAlertCriteria', 'OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria', 'OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria', 'OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria' 5652 OdataType OdataTypeBasicMetricAlertCriteria `json:"odata.type,omitempty"` 5653} 5654 5655// MarshalJSON is the custom marshaler for MetricAlertSingleResourceMultipleMetricCriteria. 5656func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) MarshalJSON() ([]byte, error) { 5657 masrmmc.OdataType = OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria 5658 objectMap := make(map[string]interface{}) 5659 if masrmmc.AllOf != nil { 5660 objectMap["allOf"] = masrmmc.AllOf 5661 } 5662 if masrmmc.OdataType != "" { 5663 objectMap["odata.type"] = masrmmc.OdataType 5664 } 5665 for k, v := range masrmmc.AdditionalProperties { 5666 objectMap[k] = v 5667 } 5668 return json.Marshal(objectMap) 5669} 5670 5671// AsMetricAlertSingleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertSingleResourceMultipleMetricCriteria. 5672func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) AsMetricAlertSingleResourceMultipleMetricCriteria() (*MetricAlertSingleResourceMultipleMetricCriteria, bool) { 5673 return &masrmmc, true 5674} 5675 5676// AsWebtestLocationAvailabilityCriteria is the BasicMetricAlertCriteria implementation for MetricAlertSingleResourceMultipleMetricCriteria. 5677func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) AsWebtestLocationAvailabilityCriteria() (*WebtestLocationAvailabilityCriteria, bool) { 5678 return nil, false 5679} 5680 5681// AsMetricAlertMultipleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for MetricAlertSingleResourceMultipleMetricCriteria. 5682func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) AsMetricAlertMultipleResourceMultipleMetricCriteria() (*MetricAlertMultipleResourceMultipleMetricCriteria, bool) { 5683 return nil, false 5684} 5685 5686// AsMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertSingleResourceMultipleMetricCriteria. 5687func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) AsMetricAlertCriteria() (*MetricAlertCriteria, bool) { 5688 return nil, false 5689} 5690 5691// AsBasicMetricAlertCriteria is the BasicMetricAlertCriteria implementation for MetricAlertSingleResourceMultipleMetricCriteria. 5692func (masrmmc MetricAlertSingleResourceMultipleMetricCriteria) AsBasicMetricAlertCriteria() (BasicMetricAlertCriteria, bool) { 5693 return &masrmmc, true 5694} 5695 5696// UnmarshalJSON is the custom unmarshaler for MetricAlertSingleResourceMultipleMetricCriteria struct. 5697func (masrmmc *MetricAlertSingleResourceMultipleMetricCriteria) UnmarshalJSON(body []byte) error { 5698 var m map[string]*json.RawMessage 5699 err := json.Unmarshal(body, &m) 5700 if err != nil { 5701 return err 5702 } 5703 for k, v := range m { 5704 switch k { 5705 case "allOf": 5706 if v != nil { 5707 var allOf []MetricCriteria 5708 err = json.Unmarshal(*v, &allOf) 5709 if err != nil { 5710 return err 5711 } 5712 masrmmc.AllOf = &allOf 5713 } 5714 default: 5715 if v != nil { 5716 var additionalProperties interface{} 5717 err = json.Unmarshal(*v, &additionalProperties) 5718 if err != nil { 5719 return err 5720 } 5721 if masrmmc.AdditionalProperties == nil { 5722 masrmmc.AdditionalProperties = make(map[string]interface{}) 5723 } 5724 masrmmc.AdditionalProperties[k] = additionalProperties 5725 } 5726 case "odata.type": 5727 if v != nil { 5728 var odataType OdataTypeBasicMetricAlertCriteria 5729 err = json.Unmarshal(*v, &odataType) 5730 if err != nil { 5731 return err 5732 } 5733 masrmmc.OdataType = odataType 5734 } 5735 } 5736 } 5737 5738 return nil 5739} 5740 5741// MetricAlertStatus an alert status. 5742type MetricAlertStatus struct { 5743 // Name - The status name. 5744 Name *string `json:"name,omitempty"` 5745 // ID - The alert rule arm id. 5746 ID *string `json:"id,omitempty"` 5747 // Type - The extended resource type name. 5748 Type *string `json:"type,omitempty"` 5749 // Properties - The alert status properties of the metric alert status. 5750 Properties *MetricAlertStatusProperties `json:"properties,omitempty"` 5751} 5752 5753// MetricAlertStatusCollection represents a collection of alert rule resources. 5754type MetricAlertStatusCollection struct { 5755 autorest.Response `json:"-"` 5756 // Value - the values for the alert rule resources. 5757 Value *[]MetricAlertStatus `json:"value,omitempty"` 5758} 5759 5760// MetricAlertStatusProperties an alert status properties. 5761type MetricAlertStatusProperties struct { 5762 // Dimensions - An object describing the type of the dimensions. 5763 Dimensions map[string]*string `json:"dimensions"` 5764 // Status - status value 5765 Status *string `json:"status,omitempty"` 5766 // Timestamp - UTC time when the status was checked. 5767 Timestamp *date.Time `json:"timestamp,omitempty"` 5768} 5769 5770// MarshalJSON is the custom marshaler for MetricAlertStatusProperties. 5771func (masp MetricAlertStatusProperties) MarshalJSON() ([]byte, error) { 5772 objectMap := make(map[string]interface{}) 5773 if masp.Dimensions != nil { 5774 objectMap["dimensions"] = masp.Dimensions 5775 } 5776 if masp.Status != nil { 5777 objectMap["status"] = masp.Status 5778 } 5779 if masp.Timestamp != nil { 5780 objectMap["timestamp"] = masp.Timestamp 5781 } 5782 return json.Marshal(objectMap) 5783} 5784 5785// MetricAvailability metric availability specifies the time grain (aggregation interval or frequency) and 5786// the retention period for that time grain. 5787type MetricAvailability struct { 5788 // TimeGrain - the time grain specifies the aggregation interval for the metric. Expressed as a duration 'PT1M', 'P1D', etc. 5789 TimeGrain *string `json:"timeGrain,omitempty"` 5790 // Retention - the retention period for the metric at the specified timegrain. Expressed as a duration 'PT1M', 'P1D', etc. 5791 Retention *string `json:"retention,omitempty"` 5792} 5793 5794// MetricBaselinesProperties the response to a metric baselines query. 5795type MetricBaselinesProperties struct { 5796 // Timespan - The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally requested. 5797 Timespan *string `json:"timespan,omitempty"` 5798 // Interval - The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned back from what was originally requested. This is not present if a metadata request was made. 5799 Interval *string `json:"interval,omitempty"` 5800 // Namespace - The namespace of the metrics been queried. 5801 Namespace *string `json:"namespace,omitempty"` 5802 // Baselines - The baseline for each time series that was queried. 5803 Baselines *[]TimeSeriesBaseline `json:"baselines,omitempty"` 5804} 5805 5806// MetricBaselinesResponse a list of metric baselines. 5807type MetricBaselinesResponse struct { 5808 autorest.Response `json:"-"` 5809 // Value - The list of metric baselines. 5810 Value *[]SingleMetricBaseline `json:"value,omitempty"` 5811} 5812 5813// MetricCriteria criterion to filter metrics. 5814type MetricCriteria struct { 5815 // Operator - the criteria operator. Possible values include: 'OperatorEquals', 'OperatorNotEquals', 'OperatorGreaterThan', 'OperatorGreaterThanOrEqual', 'OperatorLessThan', 'OperatorLessThanOrEqual' 5816 Operator Operator `json:"operator,omitempty"` 5817 // Threshold - the criteria threshold value that activates the alert. 5818 Threshold *float64 `json:"threshold,omitempty"` 5819 // AdditionalProperties - Unmatched properties from the message are deserialized this collection 5820 AdditionalProperties map[string]interface{} `json:""` 5821 // Name - Name of the criteria. 5822 Name *string `json:"name,omitempty"` 5823 // MetricName - Name of the metric. 5824 MetricName *string `json:"metricName,omitempty"` 5825 // MetricNamespace - Namespace of the metric. 5826 MetricNamespace *string `json:"metricNamespace,omitempty"` 5827 // TimeAggregation - the criteria time aggregation types. Possible values include: 'AggregationTypeEnumAverage', 'AggregationTypeEnumCount', 'AggregationTypeEnumMinimum', 'AggregationTypeEnumMaximum', 'AggregationTypeEnumTotal' 5828 TimeAggregation AggregationTypeEnum `json:"timeAggregation,omitempty"` 5829 // Dimensions - List of dimension conditions. 5830 Dimensions *[]MetricDimension `json:"dimensions,omitempty"` 5831 // SkipMetricValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped. 5832 SkipMetricValidation *bool `json:"skipMetricValidation,omitempty"` 5833 // CriterionType - Possible values include: 'CriterionTypeMultiMetricCriteria', 'CriterionTypeStaticThresholdCriterion', 'CriterionTypeDynamicThresholdCriterion' 5834 CriterionType CriterionType `json:"criterionType,omitempty"` 5835} 5836 5837// MarshalJSON is the custom marshaler for MetricCriteria. 5838func (mc MetricCriteria) MarshalJSON() ([]byte, error) { 5839 mc.CriterionType = CriterionTypeStaticThresholdCriterion 5840 objectMap := make(map[string]interface{}) 5841 if mc.Operator != "" { 5842 objectMap["operator"] = mc.Operator 5843 } 5844 if mc.Threshold != nil { 5845 objectMap["threshold"] = mc.Threshold 5846 } 5847 if mc.Name != nil { 5848 objectMap["name"] = mc.Name 5849 } 5850 if mc.MetricName != nil { 5851 objectMap["metricName"] = mc.MetricName 5852 } 5853 if mc.MetricNamespace != nil { 5854 objectMap["metricNamespace"] = mc.MetricNamespace 5855 } 5856 if mc.TimeAggregation != "" { 5857 objectMap["timeAggregation"] = mc.TimeAggregation 5858 } 5859 if mc.Dimensions != nil { 5860 objectMap["dimensions"] = mc.Dimensions 5861 } 5862 if mc.SkipMetricValidation != nil { 5863 objectMap["skipMetricValidation"] = mc.SkipMetricValidation 5864 } 5865 if mc.CriterionType != "" { 5866 objectMap["criterionType"] = mc.CriterionType 5867 } 5868 for k, v := range mc.AdditionalProperties { 5869 objectMap[k] = v 5870 } 5871 return json.Marshal(objectMap) 5872} 5873 5874// AsMetricCriteria is the BasicMultiMetricCriteria implementation for MetricCriteria. 5875func (mc MetricCriteria) AsMetricCriteria() (*MetricCriteria, bool) { 5876 return &mc, true 5877} 5878 5879// AsDynamicMetricCriteria is the BasicMultiMetricCriteria implementation for MetricCriteria. 5880func (mc MetricCriteria) AsDynamicMetricCriteria() (*DynamicMetricCriteria, bool) { 5881 return nil, false 5882} 5883 5884// AsMultiMetricCriteria is the BasicMultiMetricCriteria implementation for MetricCriteria. 5885func (mc MetricCriteria) AsMultiMetricCriteria() (*MultiMetricCriteria, bool) { 5886 return nil, false 5887} 5888 5889// AsBasicMultiMetricCriteria is the BasicMultiMetricCriteria implementation for MetricCriteria. 5890func (mc MetricCriteria) AsBasicMultiMetricCriteria() (BasicMultiMetricCriteria, bool) { 5891 return &mc, true 5892} 5893 5894// UnmarshalJSON is the custom unmarshaler for MetricCriteria struct. 5895func (mc *MetricCriteria) UnmarshalJSON(body []byte) error { 5896 var m map[string]*json.RawMessage 5897 err := json.Unmarshal(body, &m) 5898 if err != nil { 5899 return err 5900 } 5901 for k, v := range m { 5902 switch k { 5903 case "operator": 5904 if v != nil { 5905 var operator Operator 5906 err = json.Unmarshal(*v, &operator) 5907 if err != nil { 5908 return err 5909 } 5910 mc.Operator = operator 5911 } 5912 case "threshold": 5913 if v != nil { 5914 var threshold float64 5915 err = json.Unmarshal(*v, &threshold) 5916 if err != nil { 5917 return err 5918 } 5919 mc.Threshold = &threshold 5920 } 5921 default: 5922 if v != nil { 5923 var additionalProperties interface{} 5924 err = json.Unmarshal(*v, &additionalProperties) 5925 if err != nil { 5926 return err 5927 } 5928 if mc.AdditionalProperties == nil { 5929 mc.AdditionalProperties = make(map[string]interface{}) 5930 } 5931 mc.AdditionalProperties[k] = additionalProperties 5932 } 5933 case "name": 5934 if v != nil { 5935 var name string 5936 err = json.Unmarshal(*v, &name) 5937 if err != nil { 5938 return err 5939 } 5940 mc.Name = &name 5941 } 5942 case "metricName": 5943 if v != nil { 5944 var metricName string 5945 err = json.Unmarshal(*v, &metricName) 5946 if err != nil { 5947 return err 5948 } 5949 mc.MetricName = &metricName 5950 } 5951 case "metricNamespace": 5952 if v != nil { 5953 var metricNamespace string 5954 err = json.Unmarshal(*v, &metricNamespace) 5955 if err != nil { 5956 return err 5957 } 5958 mc.MetricNamespace = &metricNamespace 5959 } 5960 case "timeAggregation": 5961 if v != nil { 5962 var timeAggregation AggregationTypeEnum 5963 err = json.Unmarshal(*v, &timeAggregation) 5964 if err != nil { 5965 return err 5966 } 5967 mc.TimeAggregation = timeAggregation 5968 } 5969 case "dimensions": 5970 if v != nil { 5971 var dimensions []MetricDimension 5972 err = json.Unmarshal(*v, &dimensions) 5973 if err != nil { 5974 return err 5975 } 5976 mc.Dimensions = &dimensions 5977 } 5978 case "skipMetricValidation": 5979 if v != nil { 5980 var skipMetricValidation bool 5981 err = json.Unmarshal(*v, &skipMetricValidation) 5982 if err != nil { 5983 return err 5984 } 5985 mc.SkipMetricValidation = &skipMetricValidation 5986 } 5987 case "criterionType": 5988 if v != nil { 5989 var criterionType CriterionType 5990 err = json.Unmarshal(*v, &criterionType) 5991 if err != nil { 5992 return err 5993 } 5994 mc.CriterionType = criterionType 5995 } 5996 } 5997 } 5998 5999 return nil 6000} 6001 6002// MetricDefinition metric definition class specifies the metadata for a metric. 6003type MetricDefinition struct { 6004 // IsDimensionRequired - Flag to indicate whether the dimension is required. 6005 IsDimensionRequired *bool `json:"isDimensionRequired,omitempty"` 6006 // ResourceID - the resource identifier of the resource that emitted the metric. 6007 ResourceID *string `json:"resourceId,omitempty"` 6008 // Namespace - the namespace the metric belongs to. 6009 Namespace *string `json:"namespace,omitempty"` 6010 // Name - the name and the display name of the metric, i.e. it is a localizable string. 6011 Name *LocalizableString `json:"name,omitempty"` 6012 // DisplayDescription - Detailed description of this metric. 6013 DisplayDescription *string `json:"displayDescription,omitempty"` 6014 // Category - Custom category name for this metric. 6015 Category *string `json:"category,omitempty"` 6016 // MetricClass - The class of the metric. Possible values include: 'MetricClassAvailability', 'MetricClassTransactions', 'MetricClassErrors', 'MetricClassLatency', 'MetricClassSaturation' 6017 MetricClass MetricClass `json:"metricClass,omitempty"` 6018 // Unit - The unit of the metric. Possible values include: 'MetricUnitCount', 'MetricUnitBytes', 'MetricUnitSeconds', 'MetricUnitCountPerSecond', 'MetricUnitBytesPerSecond', 'MetricUnitPercent', 'MetricUnitMilliSeconds', 'MetricUnitByteSeconds', 'MetricUnitUnspecified', 'MetricUnitCores', 'MetricUnitMilliCores', 'MetricUnitNanoCores', 'MetricUnitBitsPerSecond' 6019 Unit MetricUnit `json:"unit,omitempty"` 6020 // PrimaryAggregationType - the primary aggregation type value defining how to use the values for display. Possible values include: 'AggregationTypeNone', 'AggregationTypeAverage', 'AggregationTypeCount', 'AggregationTypeMinimum', 'AggregationTypeMaximum', 'AggregationTypeTotal' 6021 PrimaryAggregationType AggregationType `json:"primaryAggregationType,omitempty"` 6022 // SupportedAggregationTypes - the collection of what aggregation types are supported. 6023 SupportedAggregationTypes *[]AggregationType `json:"supportedAggregationTypes,omitempty"` 6024 // MetricAvailabilities - the collection of what aggregation intervals are available to be queried. 6025 MetricAvailabilities *[]MetricAvailability `json:"metricAvailabilities,omitempty"` 6026 // ID - the resource identifier of the metric definition. 6027 ID *string `json:"id,omitempty"` 6028 // Dimensions - the name and the display name of the dimension, i.e. it is a localizable string. 6029 Dimensions *[]LocalizableString `json:"dimensions,omitempty"` 6030} 6031 6032// MetricDefinitionCollection represents collection of metric definitions. 6033type MetricDefinitionCollection struct { 6034 autorest.Response `json:"-"` 6035 // Value - the values for the metric definitions. 6036 Value *[]MetricDefinition `json:"value,omitempty"` 6037} 6038 6039// MetricDimension specifies a metric dimension. 6040type MetricDimension struct { 6041 // Name - Name of the dimension. 6042 Name *string `json:"name,omitempty"` 6043 // Operator - the dimension operator. Only 'Include' and 'Exclude' are supported 6044 Operator *string `json:"operator,omitempty"` 6045 // Values - list of dimension values. 6046 Values *[]string `json:"values,omitempty"` 6047} 6048 6049// MetricNamespace metric namespace class specifies the metadata for a metric namespace. 6050type MetricNamespace struct { 6051 // ID - The ID of the metric namespace. 6052 ID *string `json:"id,omitempty"` 6053 // Type - The type of the namespace. 6054 Type *string `json:"type,omitempty"` 6055 // Name - The escaped name of the namespace. 6056 Name *string `json:"name,omitempty"` 6057 // Classification - Kind of namespace. Possible values include: 'NamespaceClassificationPlatform', 'NamespaceClassificationCustom', 'NamespaceClassificationQos' 6058 Classification NamespaceClassification `json:"classification,omitempty"` 6059 // Properties - Properties which include the fully qualified namespace name. 6060 Properties *MetricNamespaceName `json:"properties,omitempty"` 6061} 6062 6063// MetricNamespaceCollection represents collection of metric namespaces. 6064type MetricNamespaceCollection struct { 6065 autorest.Response `json:"-"` 6066 // Value - The values for the metric namespaces. 6067 Value *[]MetricNamespace `json:"value,omitempty"` 6068} 6069 6070// MetricNamespaceName the fully qualified metric namespace name. 6071type MetricNamespaceName struct { 6072 // MetricNamespaceName - The metric namespace name. 6073 MetricNamespaceName *string `json:"metricNamespaceName,omitempty"` 6074} 6075 6076// MetricSettings part of MultiTenantDiagnosticSettings. Specifies the settings for a particular metric. 6077type MetricSettings struct { 6078 // TimeGrain - the timegrain of the metric in ISO8601 format. 6079 TimeGrain *string `json:"timeGrain,omitempty"` 6080 // 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. 6081 Category *string `json:"category,omitempty"` 6082 // Enabled - a value indicating whether this category is enabled. 6083 Enabled *bool `json:"enabled,omitempty"` 6084 // RetentionPolicy - the retention policy for this category. 6085 RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"` 6086} 6087 6088// MetricSingleDimension the metric dimension name and value. 6089type MetricSingleDimension struct { 6090 // Name - Name of the dimension. 6091 Name *string `json:"name,omitempty"` 6092 // Value - Value of the dimension. 6093 Value *string `json:"value,omitempty"` 6094} 6095 6096// MetricTrigger the trigger that results in a scaling action. 6097type MetricTrigger struct { 6098 // MetricName - the name of the metric that defines what the rule monitors. 6099 MetricName *string `json:"metricName,omitempty"` 6100 // MetricNamespace - the namespace of the metric that defines what the rule monitors. 6101 MetricNamespace *string `json:"metricNamespace,omitempty"` 6102 // MetricResourceURI - the resource identifier of the resource the rule monitors. 6103 MetricResourceURI *string `json:"metricResourceUri,omitempty"` 6104 // MetricResourceLocation - the location of the resource the rule monitors. 6105 MetricResourceLocation *string `json:"metricResourceLocation,omitempty"` 6106 // 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. 6107 TimeGrain *string `json:"timeGrain,omitempty"` 6108 // Statistic - the metric statistic type. How the metrics from multiple instances are combined. Possible values include: 'MetricStatisticTypeAverage', 'MetricStatisticTypeMin', 'MetricStatisticTypeMax', 'MetricStatisticTypeSum', 'MetricStatisticTypeCount' 6109 Statistic MetricStatisticType `json:"statistic,omitempty"` 6110 // 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. 6111 TimeWindow *string `json:"timeWindow,omitempty"` 6112 // TimeAggregation - time aggregation type. How the data that is collected should be combined over time. The default value is Average. Possible values include: 'TimeAggregationTypeAverage', 'TimeAggregationTypeMinimum', 'TimeAggregationTypeMaximum', 'TimeAggregationTypeTotal', 'TimeAggregationTypeCount', 'TimeAggregationTypeLast' 6113 TimeAggregation TimeAggregationType `json:"timeAggregation,omitempty"` 6114 // Operator - the operator that is used to compare the metric data and the threshold. Possible values include: 'ComparisonOperationTypeEquals', 'ComparisonOperationTypeNotEquals', 'ComparisonOperationTypeGreaterThan', 'ComparisonOperationTypeGreaterThanOrEqual', 'ComparisonOperationTypeLessThan', 'ComparisonOperationTypeLessThanOrEqual' 6115 Operator ComparisonOperationType `json:"operator,omitempty"` 6116 // Threshold - the threshold of the metric that triggers the scale action. 6117 Threshold *float64 `json:"threshold,omitempty"` 6118 // Dimensions - List of dimension conditions. For example: [{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}]. 6119 Dimensions *[]ScaleRuleMetricDimension `json:"dimensions,omitempty"` 6120 // DividePerInstance - a value indicating whether metric should divide per instance. 6121 DividePerInstance *bool `json:"dividePerInstance,omitempty"` 6122} 6123 6124// MetricValue represents a metric value. 6125type MetricValue struct { 6126 // TimeStamp - the timestamp for the metric value in ISO 8601 format. 6127 TimeStamp *date.Time `json:"timeStamp,omitempty"` 6128 // Average - the average value in the time range. 6129 Average *float64 `json:"average,omitempty"` 6130 // Minimum - the least value in the time range. 6131 Minimum *float64 `json:"minimum,omitempty"` 6132 // Maximum - the greatest value in the time range. 6133 Maximum *float64 `json:"maximum,omitempty"` 6134 // Total - the sum of all of the values in the time range. 6135 Total *float64 `json:"total,omitempty"` 6136 // Count - the number of samples in the time range. Can be used to determine the number of values that contributed to the average value. 6137 Count *float64 `json:"count,omitempty"` 6138} 6139 6140// BasicMultiMetricCriteria the types of conditions for a multi resource alert. 6141type BasicMultiMetricCriteria interface { 6142 AsMetricCriteria() (*MetricCriteria, bool) 6143 AsDynamicMetricCriteria() (*DynamicMetricCriteria, bool) 6144 AsMultiMetricCriteria() (*MultiMetricCriteria, bool) 6145} 6146 6147// MultiMetricCriteria the types of conditions for a multi resource alert. 6148type MultiMetricCriteria struct { 6149 // AdditionalProperties - Unmatched properties from the message are deserialized this collection 6150 AdditionalProperties map[string]interface{} `json:""` 6151 // Name - Name of the criteria. 6152 Name *string `json:"name,omitempty"` 6153 // MetricName - Name of the metric. 6154 MetricName *string `json:"metricName,omitempty"` 6155 // MetricNamespace - Namespace of the metric. 6156 MetricNamespace *string `json:"metricNamespace,omitempty"` 6157 // TimeAggregation - the criteria time aggregation types. Possible values include: 'AggregationTypeEnumAverage', 'AggregationTypeEnumCount', 'AggregationTypeEnumMinimum', 'AggregationTypeEnumMaximum', 'AggregationTypeEnumTotal' 6158 TimeAggregation AggregationTypeEnum `json:"timeAggregation,omitempty"` 6159 // Dimensions - List of dimension conditions. 6160 Dimensions *[]MetricDimension `json:"dimensions,omitempty"` 6161 // SkipMetricValidation - Allows creating an alert rule on a custom metric that isn't yet emitted, by causing the metric validation to be skipped. 6162 SkipMetricValidation *bool `json:"skipMetricValidation,omitempty"` 6163 // CriterionType - Possible values include: 'CriterionTypeMultiMetricCriteria', 'CriterionTypeStaticThresholdCriterion', 'CriterionTypeDynamicThresholdCriterion' 6164 CriterionType CriterionType `json:"criterionType,omitempty"` 6165} 6166 6167func unmarshalBasicMultiMetricCriteria(body []byte) (BasicMultiMetricCriteria, error) { 6168 var m map[string]interface{} 6169 err := json.Unmarshal(body, &m) 6170 if err != nil { 6171 return nil, err 6172 } 6173 6174 switch m["criterionType"] { 6175 case string(CriterionTypeStaticThresholdCriterion): 6176 var mc MetricCriteria 6177 err := json.Unmarshal(body, &mc) 6178 return mc, err 6179 case string(CriterionTypeDynamicThresholdCriterion): 6180 var dmc DynamicMetricCriteria 6181 err := json.Unmarshal(body, &dmc) 6182 return dmc, err 6183 default: 6184 var mmc MultiMetricCriteria 6185 err := json.Unmarshal(body, &mmc) 6186 return mmc, err 6187 } 6188} 6189func unmarshalBasicMultiMetricCriteriaArray(body []byte) ([]BasicMultiMetricCriteria, error) { 6190 var rawMessages []*json.RawMessage 6191 err := json.Unmarshal(body, &rawMessages) 6192 if err != nil { 6193 return nil, err 6194 } 6195 6196 mmcArray := make([]BasicMultiMetricCriteria, len(rawMessages)) 6197 6198 for index, rawMessage := range rawMessages { 6199 mmc, err := unmarshalBasicMultiMetricCriteria(*rawMessage) 6200 if err != nil { 6201 return nil, err 6202 } 6203 mmcArray[index] = mmc 6204 } 6205 return mmcArray, nil 6206} 6207 6208// MarshalJSON is the custom marshaler for MultiMetricCriteria. 6209func (mmc MultiMetricCriteria) MarshalJSON() ([]byte, error) { 6210 mmc.CriterionType = CriterionTypeMultiMetricCriteria 6211 objectMap := make(map[string]interface{}) 6212 if mmc.Name != nil { 6213 objectMap["name"] = mmc.Name 6214 } 6215 if mmc.MetricName != nil { 6216 objectMap["metricName"] = mmc.MetricName 6217 } 6218 if mmc.MetricNamespace != nil { 6219 objectMap["metricNamespace"] = mmc.MetricNamespace 6220 } 6221 if mmc.TimeAggregation != "" { 6222 objectMap["timeAggregation"] = mmc.TimeAggregation 6223 } 6224 if mmc.Dimensions != nil { 6225 objectMap["dimensions"] = mmc.Dimensions 6226 } 6227 if mmc.SkipMetricValidation != nil { 6228 objectMap["skipMetricValidation"] = mmc.SkipMetricValidation 6229 } 6230 if mmc.CriterionType != "" { 6231 objectMap["criterionType"] = mmc.CriterionType 6232 } 6233 for k, v := range mmc.AdditionalProperties { 6234 objectMap[k] = v 6235 } 6236 return json.Marshal(objectMap) 6237} 6238 6239// AsMetricCriteria is the BasicMultiMetricCriteria implementation for MultiMetricCriteria. 6240func (mmc MultiMetricCriteria) AsMetricCriteria() (*MetricCriteria, bool) { 6241 return nil, false 6242} 6243 6244// AsDynamicMetricCriteria is the BasicMultiMetricCriteria implementation for MultiMetricCriteria. 6245func (mmc MultiMetricCriteria) AsDynamicMetricCriteria() (*DynamicMetricCriteria, bool) { 6246 return nil, false 6247} 6248 6249// AsMultiMetricCriteria is the BasicMultiMetricCriteria implementation for MultiMetricCriteria. 6250func (mmc MultiMetricCriteria) AsMultiMetricCriteria() (*MultiMetricCriteria, bool) { 6251 return &mmc, true 6252} 6253 6254// AsBasicMultiMetricCriteria is the BasicMultiMetricCriteria implementation for MultiMetricCriteria. 6255func (mmc MultiMetricCriteria) AsBasicMultiMetricCriteria() (BasicMultiMetricCriteria, bool) { 6256 return &mmc, true 6257} 6258 6259// UnmarshalJSON is the custom unmarshaler for MultiMetricCriteria struct. 6260func (mmc *MultiMetricCriteria) UnmarshalJSON(body []byte) error { 6261 var m map[string]*json.RawMessage 6262 err := json.Unmarshal(body, &m) 6263 if err != nil { 6264 return err 6265 } 6266 for k, v := range m { 6267 switch k { 6268 default: 6269 if v != nil { 6270 var additionalProperties interface{} 6271 err = json.Unmarshal(*v, &additionalProperties) 6272 if err != nil { 6273 return err 6274 } 6275 if mmc.AdditionalProperties == nil { 6276 mmc.AdditionalProperties = make(map[string]interface{}) 6277 } 6278 mmc.AdditionalProperties[k] = additionalProperties 6279 } 6280 case "name": 6281 if v != nil { 6282 var name string 6283 err = json.Unmarshal(*v, &name) 6284 if err != nil { 6285 return err 6286 } 6287 mmc.Name = &name 6288 } 6289 case "metricName": 6290 if v != nil { 6291 var metricName string 6292 err = json.Unmarshal(*v, &metricName) 6293 if err != nil { 6294 return err 6295 } 6296 mmc.MetricName = &metricName 6297 } 6298 case "metricNamespace": 6299 if v != nil { 6300 var metricNamespace string 6301 err = json.Unmarshal(*v, &metricNamespace) 6302 if err != nil { 6303 return err 6304 } 6305 mmc.MetricNamespace = &metricNamespace 6306 } 6307 case "timeAggregation": 6308 if v != nil { 6309 var timeAggregation AggregationTypeEnum 6310 err = json.Unmarshal(*v, &timeAggregation) 6311 if err != nil { 6312 return err 6313 } 6314 mmc.TimeAggregation = timeAggregation 6315 } 6316 case "dimensions": 6317 if v != nil { 6318 var dimensions []MetricDimension 6319 err = json.Unmarshal(*v, &dimensions) 6320 if err != nil { 6321 return err 6322 } 6323 mmc.Dimensions = &dimensions 6324 } 6325 case "skipMetricValidation": 6326 if v != nil { 6327 var skipMetricValidation bool 6328 err = json.Unmarshal(*v, &skipMetricValidation) 6329 if err != nil { 6330 return err 6331 } 6332 mmc.SkipMetricValidation = &skipMetricValidation 6333 } 6334 case "criterionType": 6335 if v != nil { 6336 var criterionType CriterionType 6337 err = json.Unmarshal(*v, &criterionType) 6338 if err != nil { 6339 return err 6340 } 6341 mmc.CriterionType = criterionType 6342 } 6343 } 6344 } 6345 6346 return nil 6347} 6348 6349// NetworkRuleSet definition of the network rules. 6350type NetworkRuleSet struct { 6351 // PublicNetworkAccess - The configuration to set whether network access from public internet to the endpoints are allowed. Possible values include: 'KnownPublicNetworkAccessOptionsEnabled', 'KnownPublicNetworkAccessOptionsDisabled' 6352 PublicNetworkAccess KnownPublicNetworkAccessOptions `json:"publicNetworkAccess,omitempty"` 6353} 6354 6355// Operation microsoft Insights API operation definition. 6356type Operation struct { 6357 // Name - Operation name: {provider}/{resource}/{operation} 6358 Name *string `json:"name,omitempty"` 6359 // Display - Display metadata associated with the operation. 6360 Display *OperationDisplay `json:"display,omitempty"` 6361} 6362 6363// OperationDisplay display metadata associated with the operation. 6364type OperationDisplay struct { 6365 // Provider - Service provider: Microsoft.Insights 6366 Provider *string `json:"provider,omitempty"` 6367 // Resource - Resource on which the operation is performed: AlertRules, Autoscale, etc. 6368 Resource *string `json:"resource,omitempty"` 6369 // Operation - Operation type: Read, write, delete, etc. 6370 Operation *string `json:"operation,omitempty"` 6371} 6372 6373// OperationListResult result of the request to list Microsoft.Insights operations. It contains a list of 6374// operations and a URL link to get the next set of results. 6375type OperationListResult struct { 6376 autorest.Response `json:"-"` 6377 // Value - List of operations supported by the Microsoft.Insights provider. 6378 Value *[]Operation `json:"value,omitempty"` 6379 // NextLink - URL to get the next set of operation list results if there are any. 6380 NextLink *string `json:"nextLink,omitempty"` 6381} 6382 6383// OperationStatus the status of operation. 6384type OperationStatus struct { 6385 autorest.Response `json:"-"` 6386 // ID - The operation Id. 6387 ID *string `json:"id,omitempty"` 6388 // Name - The operation name. 6389 Name *string `json:"name,omitempty"` 6390 // StartTime - Start time of the job in standard ISO8601 format. 6391 StartTime *date.Time `json:"startTime,omitempty"` 6392 // EndTime - End time of the job in standard ISO8601 format. 6393 EndTime *date.Time `json:"endTime,omitempty"` 6394 // Status - The status of the operation. 6395 Status *string `json:"status,omitempty"` 6396 // Error - The error detail of the operation if any. 6397 Error *ErrorResponseCommon `json:"error,omitempty"` 6398} 6399 6400// PerfCounterDataSource definition of which performance counters will be collected and how they will be 6401// collected by this data collection rule. 6402// Collected from both Windows and Linux machines where the counter is present. 6403type PerfCounterDataSource struct { 6404 // Streams - List of streams that this data source will be sent to. 6405 // A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will be sent to. 6406 Streams *[]KnownPerfCounterDataSourceStreams `json:"streams,omitempty"` 6407 // SamplingFrequencyInSeconds - The number of seconds between consecutive counter measurements (samples). 6408 SamplingFrequencyInSeconds *int32 `json:"samplingFrequencyInSeconds,omitempty"` 6409 // CounterSpecifiers - A list of specifier names of the performance counters you want to collect. 6410 // Use a wildcard (*) to collect a counter for all instances. 6411 // To get a list of performance counters on Windows, run the command 'typeperf'. 6412 CounterSpecifiers *[]string `json:"counterSpecifiers,omitempty"` 6413 // Name - A friendly name for the data source. 6414 // This name should be unique across all data sources (regardless of type) within the data collection rule. 6415 Name *string `json:"name,omitempty"` 6416} 6417 6418// PrivateEndpointConnection a private endpoint connection 6419type PrivateEndpointConnection struct { 6420 autorest.Response `json:"-"` 6421 // PrivateEndpointConnectionProperties - Resource properties. 6422 *PrivateEndpointConnectionProperties `json:"properties,omitempty"` 6423 // ID - READ-ONLY; Azure resource Id 6424 ID *string `json:"id,omitempty"` 6425 // Name - READ-ONLY; Azure resource name 6426 Name *string `json:"name,omitempty"` 6427 // Type - READ-ONLY; Azure resource type 6428 Type *string `json:"type,omitempty"` 6429} 6430 6431// MarshalJSON is the custom marshaler for PrivateEndpointConnection. 6432func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { 6433 objectMap := make(map[string]interface{}) 6434 if pec.PrivateEndpointConnectionProperties != nil { 6435 objectMap["properties"] = pec.PrivateEndpointConnectionProperties 6436 } 6437 return json.Marshal(objectMap) 6438} 6439 6440// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. 6441func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { 6442 var m map[string]*json.RawMessage 6443 err := json.Unmarshal(body, &m) 6444 if err != nil { 6445 return err 6446 } 6447 for k, v := range m { 6448 switch k { 6449 case "properties": 6450 if v != nil { 6451 var privateEndpointConnectionProperties PrivateEndpointConnectionProperties 6452 err = json.Unmarshal(*v, &privateEndpointConnectionProperties) 6453 if err != nil { 6454 return err 6455 } 6456 pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties 6457 } 6458 case "id": 6459 if v != nil { 6460 var ID string 6461 err = json.Unmarshal(*v, &ID) 6462 if err != nil { 6463 return err 6464 } 6465 pec.ID = &ID 6466 } 6467 case "name": 6468 if v != nil { 6469 var name string 6470 err = json.Unmarshal(*v, &name) 6471 if err != nil { 6472 return err 6473 } 6474 pec.Name = &name 6475 } 6476 case "type": 6477 if v != nil { 6478 var typeVar string 6479 err = json.Unmarshal(*v, &typeVar) 6480 if err != nil { 6481 return err 6482 } 6483 pec.Type = &typeVar 6484 } 6485 } 6486 } 6487 6488 return nil 6489} 6490 6491// PrivateEndpointConnectionListResult a list of private endpoint connections. 6492type PrivateEndpointConnectionListResult struct { 6493 autorest.Response `json:"-"` 6494 // Value - READ-ONLY; Array of results. 6495 Value *[]PrivateEndpointConnection `json:"value,omitempty"` 6496 // NextLink - READ-ONLY; Link to retrieve next page of results. 6497 NextLink *string `json:"nextLink,omitempty"` 6498} 6499 6500// MarshalJSON is the custom marshaler for PrivateEndpointConnectionListResult. 6501func (peclr PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { 6502 objectMap := make(map[string]interface{}) 6503 return json.Marshal(objectMap) 6504} 6505 6506// PrivateEndpointConnectionListResultIterator provides access to a complete listing of 6507// PrivateEndpointConnection values. 6508type PrivateEndpointConnectionListResultIterator struct { 6509 i int 6510 page PrivateEndpointConnectionListResultPage 6511} 6512 6513// NextWithContext advances to the next value. If there was an error making 6514// the request the iterator does not advance and the error is returned. 6515func (iter *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { 6516 if tracing.IsEnabled() { 6517 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.NextWithContext") 6518 defer func() { 6519 sc := -1 6520 if iter.Response().Response.Response != nil { 6521 sc = iter.Response().Response.Response.StatusCode 6522 } 6523 tracing.EndSpan(ctx, sc, err) 6524 }() 6525 } 6526 iter.i++ 6527 if iter.i < len(iter.page.Values()) { 6528 return nil 6529 } 6530 err = iter.page.NextWithContext(ctx) 6531 if err != nil { 6532 iter.i-- 6533 return err 6534 } 6535 iter.i = 0 6536 return nil 6537} 6538 6539// Next advances to the next value. If there was an error making 6540// the request the iterator does not advance and the error is returned. 6541// Deprecated: Use NextWithContext() instead. 6542func (iter *PrivateEndpointConnectionListResultIterator) Next() error { 6543 return iter.NextWithContext(context.Background()) 6544} 6545 6546// NotDone returns true if the enumeration should be started or is not yet complete. 6547func (iter PrivateEndpointConnectionListResultIterator) NotDone() bool { 6548 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6549} 6550 6551// Response returns the raw server response from the last page request. 6552func (iter PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult { 6553 return iter.page.Response() 6554} 6555 6556// Value returns the current value or a zero-initialized value if the 6557// iterator has advanced beyond the end of the collection. 6558func (iter PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection { 6559 if !iter.page.NotDone() { 6560 return PrivateEndpointConnection{} 6561 } 6562 return iter.page.Values()[iter.i] 6563} 6564 6565// Creates a new instance of the PrivateEndpointConnectionListResultIterator type. 6566func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator { 6567 return PrivateEndpointConnectionListResultIterator{page: page} 6568} 6569 6570// IsEmpty returns true if the ListResult contains no values. 6571func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool { 6572 return peclr.Value == nil || len(*peclr.Value) == 0 6573} 6574 6575// hasNextLink returns true if the NextLink is not empty. 6576func (peclr PrivateEndpointConnectionListResult) hasNextLink() bool { 6577 return peclr.NextLink != nil && len(*peclr.NextLink) != 0 6578} 6579 6580// privateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results. 6581// It returns nil if no more results exist. 6582func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { 6583 if !peclr.hasNextLink() { 6584 return nil, nil 6585 } 6586 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6587 autorest.AsJSON(), 6588 autorest.AsGet(), 6589 autorest.WithBaseURL(to.String(peclr.NextLink))) 6590} 6591 6592// PrivateEndpointConnectionListResultPage contains a page of PrivateEndpointConnection values. 6593type PrivateEndpointConnectionListResultPage struct { 6594 fn func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error) 6595 peclr PrivateEndpointConnectionListResult 6596} 6597 6598// NextWithContext advances to the next page of values. If there was an error making 6599// the request the page does not advance and the error is returned. 6600func (page *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { 6601 if tracing.IsEnabled() { 6602 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.NextWithContext") 6603 defer func() { 6604 sc := -1 6605 if page.Response().Response.Response != nil { 6606 sc = page.Response().Response.Response.StatusCode 6607 } 6608 tracing.EndSpan(ctx, sc, err) 6609 }() 6610 } 6611 for { 6612 next, err := page.fn(ctx, page.peclr) 6613 if err != nil { 6614 return err 6615 } 6616 page.peclr = next 6617 if !next.hasNextLink() || !next.IsEmpty() { 6618 break 6619 } 6620 } 6621 return nil 6622} 6623 6624// Next advances to the next page of values. If there was an error making 6625// the request the page does not advance and the error is returned. 6626// Deprecated: Use NextWithContext() instead. 6627func (page *PrivateEndpointConnectionListResultPage) Next() error { 6628 return page.NextWithContext(context.Background()) 6629} 6630 6631// NotDone returns true if the page enumeration should be started or is not yet complete. 6632func (page PrivateEndpointConnectionListResultPage) NotDone() bool { 6633 return !page.peclr.IsEmpty() 6634} 6635 6636// Response returns the raw server response from the last page request. 6637func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult { 6638 return page.peclr 6639} 6640 6641// Values returns the slice of values for the current page or nil if there are no values. 6642func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection { 6643 if page.peclr.IsEmpty() { 6644 return nil 6645 } 6646 return *page.peclr.Value 6647} 6648 6649// Creates a new instance of the PrivateEndpointConnectionListResultPage type. 6650func NewPrivateEndpointConnectionListResultPage(cur PrivateEndpointConnectionListResult, getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage { 6651 return PrivateEndpointConnectionListResultPage{ 6652 fn: getNextPage, 6653 peclr: cur, 6654 } 6655} 6656 6657// PrivateEndpointConnectionProperties properties of a private endpoint connection. 6658type PrivateEndpointConnectionProperties struct { 6659 // PrivateEndpoint - Private endpoint which the connection belongs to. 6660 PrivateEndpoint *PrivateEndpointProperty `json:"privateEndpoint,omitempty"` 6661 // PrivateLinkServiceConnectionState - Connection state of the private endpoint connection. 6662 PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"` 6663 // ProvisioningState - READ-ONLY; State of the private endpoint connection. 6664 ProvisioningState *string `json:"provisioningState,omitempty"` 6665} 6666 6667// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties. 6668func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { 6669 objectMap := make(map[string]interface{}) 6670 if pecp.PrivateEndpoint != nil { 6671 objectMap["privateEndpoint"] = pecp.PrivateEndpoint 6672 } 6673 if pecp.PrivateLinkServiceConnectionState != nil { 6674 objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState 6675 } 6676 return json.Marshal(objectMap) 6677} 6678 6679// PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 6680// of a long-running operation. 6681type PrivateEndpointConnectionsCreateOrUpdateFuture struct { 6682 azure.FutureAPI 6683 // Result returns the result of the asynchronous operation. 6684 // If the operation has not completed it will return an error. 6685 Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error) 6686} 6687 6688// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6689func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 6690 var azFuture azure.Future 6691 if err := json.Unmarshal(body, &azFuture); err != nil { 6692 return err 6693 } 6694 future.FutureAPI = &azFuture 6695 future.Result = future.result 6696 return nil 6697} 6698 6699// result is the default implementation for PrivateEndpointConnectionsCreateOrUpdateFuture.Result. 6700func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) { 6701 var done bool 6702 done, err = future.DoneWithContext(context.Background(), client) 6703 if err != nil { 6704 err = autorest.NewErrorWithError(err, "insights.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 6705 return 6706 } 6707 if !done { 6708 pec.Response.Response = future.Response() 6709 err = azure.NewAsyncOpIncompleteError("insights.PrivateEndpointConnectionsCreateOrUpdateFuture") 6710 return 6711 } 6712 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6713 if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { 6714 pec, err = client.CreateOrUpdateResponder(pec.Response.Response) 6715 if err != nil { 6716 err = autorest.NewErrorWithError(err, "insights.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pec.Response.Response, "Failure responding to request") 6717 } 6718 } 6719 return 6720} 6721 6722// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a 6723// long-running operation. 6724type PrivateEndpointConnectionsDeleteFuture struct { 6725 azure.FutureAPI 6726 // Result returns the result of the asynchronous operation. 6727 // If the operation has not completed it will return an error. 6728 Result func(PrivateEndpointConnectionsClient) (autorest.Response, error) 6729} 6730 6731// UnmarshalJSON is the custom unmarshaller for CreateFuture. 6732func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { 6733 var azFuture azure.Future 6734 if err := json.Unmarshal(body, &azFuture); err != nil { 6735 return err 6736 } 6737 future.FutureAPI = &azFuture 6738 future.Result = future.result 6739 return nil 6740} 6741 6742// result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result. 6743func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) { 6744 var done bool 6745 done, err = future.DoneWithContext(context.Background(), client) 6746 if err != nil { 6747 err = autorest.NewErrorWithError(err, "insights.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") 6748 return 6749 } 6750 if !done { 6751 ar.Response = future.Response() 6752 err = azure.NewAsyncOpIncompleteError("insights.PrivateEndpointConnectionsDeleteFuture") 6753 return 6754 } 6755 ar.Response = future.Response() 6756 return 6757} 6758 6759// PrivateEndpointProperty private endpoint which the connection belongs to. 6760type PrivateEndpointProperty struct { 6761 // ID - Resource id of the private endpoint. 6762 ID *string `json:"id,omitempty"` 6763} 6764 6765// PrivateLinkResource a private link resource 6766type PrivateLinkResource struct { 6767 autorest.Response `json:"-"` 6768 // PrivateLinkResourceProperties - Resource properties. 6769 *PrivateLinkResourceProperties `json:"properties,omitempty"` 6770 // ID - READ-ONLY; Azure resource Id 6771 ID *string `json:"id,omitempty"` 6772 // Name - READ-ONLY; Azure resource name 6773 Name *string `json:"name,omitempty"` 6774 // Type - READ-ONLY; Azure resource type 6775 Type *string `json:"type,omitempty"` 6776} 6777 6778// MarshalJSON is the custom marshaler for PrivateLinkResource. 6779func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { 6780 objectMap := make(map[string]interface{}) 6781 if plr.PrivateLinkResourceProperties != nil { 6782 objectMap["properties"] = plr.PrivateLinkResourceProperties 6783 } 6784 return json.Marshal(objectMap) 6785} 6786 6787// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. 6788func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error { 6789 var m map[string]*json.RawMessage 6790 err := json.Unmarshal(body, &m) 6791 if err != nil { 6792 return err 6793 } 6794 for k, v := range m { 6795 switch k { 6796 case "properties": 6797 if v != nil { 6798 var privateLinkResourceProperties PrivateLinkResourceProperties 6799 err = json.Unmarshal(*v, &privateLinkResourceProperties) 6800 if err != nil { 6801 return err 6802 } 6803 plr.PrivateLinkResourceProperties = &privateLinkResourceProperties 6804 } 6805 case "id": 6806 if v != nil { 6807 var ID string 6808 err = json.Unmarshal(*v, &ID) 6809 if err != nil { 6810 return err 6811 } 6812 plr.ID = &ID 6813 } 6814 case "name": 6815 if v != nil { 6816 var name string 6817 err = json.Unmarshal(*v, &name) 6818 if err != nil { 6819 return err 6820 } 6821 plr.Name = &name 6822 } 6823 case "type": 6824 if v != nil { 6825 var typeVar string 6826 err = json.Unmarshal(*v, &typeVar) 6827 if err != nil { 6828 return err 6829 } 6830 plr.Type = &typeVar 6831 } 6832 } 6833 } 6834 6835 return nil 6836} 6837 6838// PrivateLinkResourceListResult a list of private link resources 6839type PrivateLinkResourceListResult struct { 6840 autorest.Response `json:"-"` 6841 // Value - READ-ONLY; Array of results. 6842 Value *[]PrivateLinkResource `json:"value,omitempty"` 6843 // NextLink - READ-ONLY; Link to retrieve next page of results. 6844 NextLink *string `json:"nextLink,omitempty"` 6845} 6846 6847// MarshalJSON is the custom marshaler for PrivateLinkResourceListResult. 6848func (plrlr PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { 6849 objectMap := make(map[string]interface{}) 6850 return json.Marshal(objectMap) 6851} 6852 6853// PrivateLinkResourceListResultIterator provides access to a complete listing of PrivateLinkResource 6854// values. 6855type PrivateLinkResourceListResultIterator struct { 6856 i int 6857 page PrivateLinkResourceListResultPage 6858} 6859 6860// NextWithContext advances to the next value. If there was an error making 6861// the request the iterator does not advance and the error is returned. 6862func (iter *PrivateLinkResourceListResultIterator) NextWithContext(ctx context.Context) (err error) { 6863 if tracing.IsEnabled() { 6864 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultIterator.NextWithContext") 6865 defer func() { 6866 sc := -1 6867 if iter.Response().Response.Response != nil { 6868 sc = iter.Response().Response.Response.StatusCode 6869 } 6870 tracing.EndSpan(ctx, sc, err) 6871 }() 6872 } 6873 iter.i++ 6874 if iter.i < len(iter.page.Values()) { 6875 return nil 6876 } 6877 err = iter.page.NextWithContext(ctx) 6878 if err != nil { 6879 iter.i-- 6880 return err 6881 } 6882 iter.i = 0 6883 return nil 6884} 6885 6886// Next advances to the next value. If there was an error making 6887// the request the iterator does not advance and the error is returned. 6888// Deprecated: Use NextWithContext() instead. 6889func (iter *PrivateLinkResourceListResultIterator) Next() error { 6890 return iter.NextWithContext(context.Background()) 6891} 6892 6893// NotDone returns true if the enumeration should be started or is not yet complete. 6894func (iter PrivateLinkResourceListResultIterator) NotDone() bool { 6895 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6896} 6897 6898// Response returns the raw server response from the last page request. 6899func (iter PrivateLinkResourceListResultIterator) Response() PrivateLinkResourceListResult { 6900 return iter.page.Response() 6901} 6902 6903// Value returns the current value or a zero-initialized value if the 6904// iterator has advanced beyond the end of the collection. 6905func (iter PrivateLinkResourceListResultIterator) Value() PrivateLinkResource { 6906 if !iter.page.NotDone() { 6907 return PrivateLinkResource{} 6908 } 6909 return iter.page.Values()[iter.i] 6910} 6911 6912// Creates a new instance of the PrivateLinkResourceListResultIterator type. 6913func NewPrivateLinkResourceListResultIterator(page PrivateLinkResourceListResultPage) PrivateLinkResourceListResultIterator { 6914 return PrivateLinkResourceListResultIterator{page: page} 6915} 6916 6917// IsEmpty returns true if the ListResult contains no values. 6918func (plrlr PrivateLinkResourceListResult) IsEmpty() bool { 6919 return plrlr.Value == nil || len(*plrlr.Value) == 0 6920} 6921 6922// hasNextLink returns true if the NextLink is not empty. 6923func (plrlr PrivateLinkResourceListResult) hasNextLink() bool { 6924 return plrlr.NextLink != nil && len(*plrlr.NextLink) != 0 6925} 6926 6927// privateLinkResourceListResultPreparer prepares a request to retrieve the next set of results. 6928// It returns nil if no more results exist. 6929func (plrlr PrivateLinkResourceListResult) privateLinkResourceListResultPreparer(ctx context.Context) (*http.Request, error) { 6930 if !plrlr.hasNextLink() { 6931 return nil, nil 6932 } 6933 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6934 autorest.AsJSON(), 6935 autorest.AsGet(), 6936 autorest.WithBaseURL(to.String(plrlr.NextLink))) 6937} 6938 6939// PrivateLinkResourceListResultPage contains a page of PrivateLinkResource values. 6940type PrivateLinkResourceListResultPage struct { 6941 fn func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error) 6942 plrlr PrivateLinkResourceListResult 6943} 6944 6945// NextWithContext advances to the next page of values. If there was an error making 6946// the request the page does not advance and the error is returned. 6947func (page *PrivateLinkResourceListResultPage) NextWithContext(ctx context.Context) (err error) { 6948 if tracing.IsEnabled() { 6949 ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultPage.NextWithContext") 6950 defer func() { 6951 sc := -1 6952 if page.Response().Response.Response != nil { 6953 sc = page.Response().Response.Response.StatusCode 6954 } 6955 tracing.EndSpan(ctx, sc, err) 6956 }() 6957 } 6958 for { 6959 next, err := page.fn(ctx, page.plrlr) 6960 if err != nil { 6961 return err 6962 } 6963 page.plrlr = next 6964 if !next.hasNextLink() || !next.IsEmpty() { 6965 break 6966 } 6967 } 6968 return nil 6969} 6970 6971// Next advances to the next page of values. If there was an error making 6972// the request the page does not advance and the error is returned. 6973// Deprecated: Use NextWithContext() instead. 6974func (page *PrivateLinkResourceListResultPage) Next() error { 6975 return page.NextWithContext(context.Background()) 6976} 6977 6978// NotDone returns true if the page enumeration should be started or is not yet complete. 6979func (page PrivateLinkResourceListResultPage) NotDone() bool { 6980 return !page.plrlr.IsEmpty() 6981} 6982 6983// Response returns the raw server response from the last page request. 6984func (page PrivateLinkResourceListResultPage) Response() PrivateLinkResourceListResult { 6985 return page.plrlr 6986} 6987 6988// Values returns the slice of values for the current page or nil if there are no values. 6989func (page PrivateLinkResourceListResultPage) Values() []PrivateLinkResource { 6990 if page.plrlr.IsEmpty() { 6991 return nil 6992 } 6993 return *page.plrlr.Value 6994} 6995 6996// Creates a new instance of the PrivateLinkResourceListResultPage type. 6997func NewPrivateLinkResourceListResultPage(cur PrivateLinkResourceListResult, getNextPage func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)) PrivateLinkResourceListResultPage { 6998 return PrivateLinkResourceListResultPage{ 6999 fn: getNextPage, 7000 plrlr: cur, 7001 } 7002} 7003 7004// PrivateLinkResourceProperties properties of a private link resource. 7005type PrivateLinkResourceProperties struct { 7006 // GroupID - READ-ONLY; The private link resource group id. 7007 GroupID *string `json:"groupId,omitempty"` 7008 // RequiredMembers - READ-ONLY; The private link resource required member names. 7009 RequiredMembers *[]string `json:"requiredMembers,omitempty"` 7010} 7011 7012// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. 7013func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { 7014 objectMap := make(map[string]interface{}) 7015 return json.Marshal(objectMap) 7016} 7017 7018// PrivateLinkScopedResourcesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results 7019// of a long-running operation. 7020type PrivateLinkScopedResourcesCreateOrUpdateFuture struct { 7021 azure.FutureAPI 7022 // Result returns the result of the asynchronous operation. 7023 // If the operation has not completed it will return an error. 7024 Result func(PrivateLinkScopedResourcesClient) (ScopedResource, error) 7025} 7026 7027// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7028func (future *PrivateLinkScopedResourcesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 7029 var azFuture azure.Future 7030 if err := json.Unmarshal(body, &azFuture); err != nil { 7031 return err 7032 } 7033 future.FutureAPI = &azFuture 7034 future.Result = future.result 7035 return nil 7036} 7037 7038// result is the default implementation for PrivateLinkScopedResourcesCreateOrUpdateFuture.Result. 7039func (future *PrivateLinkScopedResourcesCreateOrUpdateFuture) result(client PrivateLinkScopedResourcesClient) (sr ScopedResource, err error) { 7040 var done bool 7041 done, err = future.DoneWithContext(context.Background(), client) 7042 if err != nil { 7043 err = autorest.NewErrorWithError(err, "insights.PrivateLinkScopedResourcesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 7044 return 7045 } 7046 if !done { 7047 sr.Response.Response = future.Response() 7048 err = azure.NewAsyncOpIncompleteError("insights.PrivateLinkScopedResourcesCreateOrUpdateFuture") 7049 return 7050 } 7051 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7052 if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { 7053 sr, err = client.CreateOrUpdateResponder(sr.Response.Response) 7054 if err != nil { 7055 err = autorest.NewErrorWithError(err, "insights.PrivateLinkScopedResourcesCreateOrUpdateFuture", "Result", sr.Response.Response, "Failure responding to request") 7056 } 7057 } 7058 return 7059} 7060 7061// PrivateLinkScopedResourcesDeleteFuture an abstraction for monitoring and retrieving the results of a 7062// long-running operation. 7063type PrivateLinkScopedResourcesDeleteFuture struct { 7064 azure.FutureAPI 7065 // Result returns the result of the asynchronous operation. 7066 // If the operation has not completed it will return an error. 7067 Result func(PrivateLinkScopedResourcesClient) (autorest.Response, error) 7068} 7069 7070// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7071func (future *PrivateLinkScopedResourcesDeleteFuture) UnmarshalJSON(body []byte) error { 7072 var azFuture azure.Future 7073 if err := json.Unmarshal(body, &azFuture); err != nil { 7074 return err 7075 } 7076 future.FutureAPI = &azFuture 7077 future.Result = future.result 7078 return nil 7079} 7080 7081// result is the default implementation for PrivateLinkScopedResourcesDeleteFuture.Result. 7082func (future *PrivateLinkScopedResourcesDeleteFuture) result(client PrivateLinkScopedResourcesClient) (ar autorest.Response, err error) { 7083 var done bool 7084 done, err = future.DoneWithContext(context.Background(), client) 7085 if err != nil { 7086 err = autorest.NewErrorWithError(err, "insights.PrivateLinkScopedResourcesDeleteFuture", "Result", future.Response(), "Polling failure") 7087 return 7088 } 7089 if !done { 7090 ar.Response = future.Response() 7091 err = azure.NewAsyncOpIncompleteError("insights.PrivateLinkScopedResourcesDeleteFuture") 7092 return 7093 } 7094 ar.Response = future.Response() 7095 return 7096} 7097 7098// PrivateLinkScopesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 7099// operation. 7100type PrivateLinkScopesDeleteFuture struct { 7101 azure.FutureAPI 7102 // Result returns the result of the asynchronous operation. 7103 // If the operation has not completed it will return an error. 7104 Result func(PrivateLinkScopesClient) (autorest.Response, error) 7105} 7106 7107// UnmarshalJSON is the custom unmarshaller for CreateFuture. 7108func (future *PrivateLinkScopesDeleteFuture) UnmarshalJSON(body []byte) error { 7109 var azFuture azure.Future 7110 if err := json.Unmarshal(body, &azFuture); err != nil { 7111 return err 7112 } 7113 future.FutureAPI = &azFuture 7114 future.Result = future.result 7115 return nil 7116} 7117 7118// result is the default implementation for PrivateLinkScopesDeleteFuture.Result. 7119func (future *PrivateLinkScopesDeleteFuture) result(client PrivateLinkScopesClient) (ar autorest.Response, err error) { 7120 var done bool 7121 done, err = future.DoneWithContext(context.Background(), client) 7122 if err != nil { 7123 err = autorest.NewErrorWithError(err, "insights.PrivateLinkScopesDeleteFuture", "Result", future.Response(), "Polling failure") 7124 return 7125 } 7126 if !done { 7127 ar.Response = future.Response() 7128 err = azure.NewAsyncOpIncompleteError("insights.PrivateLinkScopesDeleteFuture") 7129 return 7130 } 7131 ar.Response = future.Response() 7132 return 7133} 7134 7135// PrivateLinkScopesResource an azure resource object 7136type PrivateLinkScopesResource struct { 7137 // ID - READ-ONLY; Azure resource Id 7138 ID *string `json:"id,omitempty"` 7139 // Name - READ-ONLY; Azure resource name 7140 Name *string `json:"name,omitempty"` 7141 // Type - READ-ONLY; Azure resource type 7142 Type *string `json:"type,omitempty"` 7143 // Location - Resource location 7144 Location *string `json:"location,omitempty"` 7145 // Tags - Resource tags 7146 Tags map[string]*string `json:"tags"` 7147} 7148 7149// MarshalJSON is the custom marshaler for PrivateLinkScopesResource. 7150func (plsr PrivateLinkScopesResource) MarshalJSON() ([]byte, error) { 7151 objectMap := make(map[string]interface{}) 7152 if plsr.Location != nil { 7153 objectMap["location"] = plsr.Location 7154 } 7155 if plsr.Tags != nil { 7156 objectMap["tags"] = plsr.Tags 7157 } 7158 return json.Marshal(objectMap) 7159} 7160 7161// PrivateLinkServiceConnectionStateProperty state of the private endpoint connection. 7162type PrivateLinkServiceConnectionStateProperty struct { 7163 // Status - The private link service connection status. 7164 Status *string `json:"status,omitempty"` 7165 // Description - The private link service connection description. 7166 Description *string `json:"description,omitempty"` 7167 // ActionsRequired - READ-ONLY; The actions required for private link service connection. 7168 ActionsRequired *string `json:"actionsRequired,omitempty"` 7169} 7170 7171// MarshalJSON is the custom marshaler for PrivateLinkServiceConnectionStateProperty. 7172func (plscsp PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { 7173 objectMap := make(map[string]interface{}) 7174 if plscsp.Status != nil { 7175 objectMap["status"] = plscsp.Status 7176 } 7177 if plscsp.Description != nil { 7178 objectMap["description"] = plscsp.Description 7179 } 7180 return json.Marshal(objectMap) 7181} 7182 7183// ProxyOnlyResource a proxy only azure resource object 7184type ProxyOnlyResource struct { 7185 // ID - READ-ONLY; Azure resource Id 7186 ID *string `json:"id,omitempty"` 7187 // Name - READ-ONLY; Azure resource name 7188 Name *string `json:"name,omitempty"` 7189 // Type - READ-ONLY; Azure resource type 7190 Type *string `json:"type,omitempty"` 7191} 7192 7193// MarshalJSON is the custom marshaler for ProxyOnlyResource. 7194func (por ProxyOnlyResource) MarshalJSON() ([]byte, error) { 7195 objectMap := make(map[string]interface{}) 7196 return json.Marshal(objectMap) 7197} 7198 7199// ProxyResource an azure resource object 7200type ProxyResource struct { 7201 // ID - READ-ONLY; Azure resource Id 7202 ID *string `json:"id,omitempty"` 7203 // Name - READ-ONLY; Azure resource name 7204 Name *string `json:"name,omitempty"` 7205 // Type - READ-ONLY; Azure resource type 7206 Type *string `json:"type,omitempty"` 7207} 7208 7209// MarshalJSON is the custom marshaler for ProxyResource. 7210func (pr ProxyResource) MarshalJSON() ([]byte, error) { 7211 objectMap := make(map[string]interface{}) 7212 return json.Marshal(objectMap) 7213} 7214 7215// Recurrence the repeating times at which this profile begins. This element is not used if the FixedDate 7216// element is used. 7217type Recurrence struct { 7218 // Frequency - the recurrence frequency. How often the schedule profile should take effect. This value must be Week, meaning each week will have the same set of profiles. For example, to set a daily schedule, set **schedule** to every day of the week. The frequency property specifies that the schedule is repeated weekly. Possible values include: 'RecurrenceFrequencyNone', 'RecurrenceFrequencySecond', 'RecurrenceFrequencyMinute', 'RecurrenceFrequencyHour', 'RecurrenceFrequencyDay', 'RecurrenceFrequencyWeek', 'RecurrenceFrequencyMonth', 'RecurrenceFrequencyYear' 7219 Frequency RecurrenceFrequency `json:"frequency,omitempty"` 7220 // Schedule - the scheduling constraints for when the profile begins. 7221 Schedule *RecurrentSchedule `json:"schedule,omitempty"` 7222} 7223 7224// RecurrentSchedule the scheduling constraints for when the profile begins. 7225type RecurrentSchedule struct { 7226 // TimeZone - the timezone for the hours of the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time 7227 TimeZone *string `json:"timeZone,omitempty"` 7228 // Days - the collection of days that the profile takes effect on. Possible values are Sunday through Saturday. 7229 Days *[]string `json:"days,omitempty"` 7230 // 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). 7231 Hours *[]int32 `json:"hours,omitempty"` 7232 // Minutes - A collection of minutes at which the profile takes effect at. 7233 Minutes *[]int32 `json:"minutes,omitempty"` 7234} 7235 7236// Resource an azure resource object 7237type Resource struct { 7238 // ID - READ-ONLY; Azure resource Id 7239 ID *string `json:"id,omitempty"` 7240 // Name - READ-ONLY; Azure resource name 7241 Name *string `json:"name,omitempty"` 7242 // Type - READ-ONLY; Azure resource type 7243 Type *string `json:"type,omitempty"` 7244 // Location - Resource location 7245 Location *string `json:"location,omitempty"` 7246 // Tags - Resource tags 7247 Tags map[string]*string `json:"tags"` 7248 // Kind - READ-ONLY; Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. 7249 Kind *string `json:"kind,omitempty"` 7250 // Etag - READ-ONLY; The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. 7251 Etag *string `json:"etag,omitempty"` 7252} 7253 7254// MarshalJSON is the custom marshaler for Resource. 7255func (r Resource) MarshalJSON() ([]byte, error) { 7256 objectMap := make(map[string]interface{}) 7257 if r.Location != nil { 7258 objectMap["location"] = r.Location 7259 } 7260 if r.Tags != nil { 7261 objectMap["tags"] = r.Tags 7262 } 7263 return json.Marshal(objectMap) 7264} 7265 7266// ResourceForUpdate definition of ARM tracked top level resource properties for update operation. 7267type ResourceForUpdate struct { 7268 // Tags - Resource tags. 7269 Tags map[string]*string `json:"tags"` 7270} 7271 7272// MarshalJSON is the custom marshaler for ResourceForUpdate. 7273func (rfu ResourceForUpdate) MarshalJSON() ([]byte, error) { 7274 objectMap := make(map[string]interface{}) 7275 if rfu.Tags != nil { 7276 objectMap["tags"] = rfu.Tags 7277 } 7278 return json.Marshal(objectMap) 7279} 7280 7281// Response the response to a metrics query. 7282type Response struct { 7283 autorest.Response `json:"-"` 7284 // Cost - The integer value representing the relative cost of the query. 7285 Cost *float64 `json:"cost,omitempty"` 7286 // Timespan - The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally requested. 7287 Timespan *string `json:"timespan,omitempty"` 7288 // Interval - The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned back from what was originally requested. This is not present if a metadata request was made. 7289 Interval *string `json:"interval,omitempty"` 7290 // Namespace - The namespace of the metrics being queried 7291 Namespace *string `json:"namespace,omitempty"` 7292 // Resourceregion - The region of the resource being queried for metrics. 7293 Resourceregion *string `json:"resourceregion,omitempty"` 7294 // Value - the value of the collection. 7295 Value *[]Metric `json:"value,omitempty"` 7296} 7297 7298// ResponseWithError an error response from the API. 7299type ResponseWithError struct { 7300 // Error - Error information. 7301 Error *Error `json:"error,omitempty"` 7302} 7303 7304// RetentionPolicy specifies the retention policy for the log. 7305type RetentionPolicy struct { 7306 // Enabled - a value indicating whether the retention policy is enabled. 7307 Enabled *bool `json:"enabled,omitempty"` 7308 // Days - the number of days for the retention in days. A value of 0 will retain the events indefinitely. 7309 Days *int32 `json:"days,omitempty"` 7310} 7311 7312// BasicRuleAction the action that is performed when the alert rule becomes active, and when an alert condition is 7313// resolved. 7314type BasicRuleAction interface { 7315 AsRuleEmailAction() (*RuleEmailAction, bool) 7316 AsRuleWebhookAction() (*RuleWebhookAction, bool) 7317 AsRuleAction() (*RuleAction, bool) 7318} 7319 7320// RuleAction the action that is performed when the alert rule becomes active, and when an alert condition is 7321// resolved. 7322type RuleAction struct { 7323 // OdataType - Possible values include: 'OdataTypeBasicRuleActionOdataTypeRuleAction', 'OdataTypeBasicRuleActionOdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction', 'OdataTypeBasicRuleActionOdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction' 7324 OdataType OdataTypeBasicRuleAction `json:"odata.type,omitempty"` 7325} 7326 7327func unmarshalBasicRuleAction(body []byte) (BasicRuleAction, error) { 7328 var m map[string]interface{} 7329 err := json.Unmarshal(body, &m) 7330 if err != nil { 7331 return nil, err 7332 } 7333 7334 switch m["odata.type"] { 7335 case string(OdataTypeBasicRuleActionOdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction): 7336 var rea RuleEmailAction 7337 err := json.Unmarshal(body, &rea) 7338 return rea, err 7339 case string(OdataTypeBasicRuleActionOdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction): 7340 var rwa RuleWebhookAction 7341 err := json.Unmarshal(body, &rwa) 7342 return rwa, err 7343 default: 7344 var ra RuleAction 7345 err := json.Unmarshal(body, &ra) 7346 return ra, err 7347 } 7348} 7349func unmarshalBasicRuleActionArray(body []byte) ([]BasicRuleAction, error) { 7350 var rawMessages []*json.RawMessage 7351 err := json.Unmarshal(body, &rawMessages) 7352 if err != nil { 7353 return nil, err 7354 } 7355 7356 raArray := make([]BasicRuleAction, len(rawMessages)) 7357 7358 for index, rawMessage := range rawMessages { 7359 ra, err := unmarshalBasicRuleAction(*rawMessage) 7360 if err != nil { 7361 return nil, err 7362 } 7363 raArray[index] = ra 7364 } 7365 return raArray, nil 7366} 7367 7368// MarshalJSON is the custom marshaler for RuleAction. 7369func (ra RuleAction) MarshalJSON() ([]byte, error) { 7370 ra.OdataType = OdataTypeBasicRuleActionOdataTypeRuleAction 7371 objectMap := make(map[string]interface{}) 7372 if ra.OdataType != "" { 7373 objectMap["odata.type"] = ra.OdataType 7374 } 7375 return json.Marshal(objectMap) 7376} 7377 7378// AsRuleEmailAction is the BasicRuleAction implementation for RuleAction. 7379func (ra RuleAction) AsRuleEmailAction() (*RuleEmailAction, bool) { 7380 return nil, false 7381} 7382 7383// AsRuleWebhookAction is the BasicRuleAction implementation for RuleAction. 7384func (ra RuleAction) AsRuleWebhookAction() (*RuleWebhookAction, bool) { 7385 return nil, false 7386} 7387 7388// AsRuleAction is the BasicRuleAction implementation for RuleAction. 7389func (ra RuleAction) AsRuleAction() (*RuleAction, bool) { 7390 return &ra, true 7391} 7392 7393// AsBasicRuleAction is the BasicRuleAction implementation for RuleAction. 7394func (ra RuleAction) AsBasicRuleAction() (BasicRuleAction, bool) { 7395 return &ra, true 7396} 7397 7398// BasicRuleCondition the condition that results in the alert rule being activated. 7399type BasicRuleCondition interface { 7400 AsThresholdRuleCondition() (*ThresholdRuleCondition, bool) 7401 AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool) 7402 AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool) 7403 AsRuleCondition() (*RuleCondition, bool) 7404} 7405 7406// RuleCondition the condition that results in the alert rule being activated. 7407type RuleCondition struct { 7408 // DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource. 7409 DataSource BasicRuleDataSource `json:"dataSource,omitempty"` 7410 // OdataType - Possible values include: 'OdataTypeBasicRuleConditionOdataTypeRuleCondition', 'OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition' 7411 OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"` 7412} 7413 7414func unmarshalBasicRuleCondition(body []byte) (BasicRuleCondition, error) { 7415 var m map[string]interface{} 7416 err := json.Unmarshal(body, &m) 7417 if err != nil { 7418 return nil, err 7419 } 7420 7421 switch m["odata.type"] { 7422 case string(OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition): 7423 var trc ThresholdRuleCondition 7424 err := json.Unmarshal(body, &trc) 7425 return trc, err 7426 case string(OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition): 7427 var ltrc LocationThresholdRuleCondition 7428 err := json.Unmarshal(body, <rc) 7429 return ltrc, err 7430 case string(OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition): 7431 var merc ManagementEventRuleCondition 7432 err := json.Unmarshal(body, &merc) 7433 return merc, err 7434 default: 7435 var rc RuleCondition 7436 err := json.Unmarshal(body, &rc) 7437 return rc, err 7438 } 7439} 7440func unmarshalBasicRuleConditionArray(body []byte) ([]BasicRuleCondition, error) { 7441 var rawMessages []*json.RawMessage 7442 err := json.Unmarshal(body, &rawMessages) 7443 if err != nil { 7444 return nil, err 7445 } 7446 7447 rcArray := make([]BasicRuleCondition, len(rawMessages)) 7448 7449 for index, rawMessage := range rawMessages { 7450 rc, err := unmarshalBasicRuleCondition(*rawMessage) 7451 if err != nil { 7452 return nil, err 7453 } 7454 rcArray[index] = rc 7455 } 7456 return rcArray, nil 7457} 7458 7459// MarshalJSON is the custom marshaler for RuleCondition. 7460func (rc RuleCondition) MarshalJSON() ([]byte, error) { 7461 rc.OdataType = OdataTypeBasicRuleConditionOdataTypeRuleCondition 7462 objectMap := make(map[string]interface{}) 7463 objectMap["dataSource"] = rc.DataSource 7464 if rc.OdataType != "" { 7465 objectMap["odata.type"] = rc.OdataType 7466 } 7467 return json.Marshal(objectMap) 7468} 7469 7470// AsThresholdRuleCondition is the BasicRuleCondition implementation for RuleCondition. 7471func (rc RuleCondition) AsThresholdRuleCondition() (*ThresholdRuleCondition, bool) { 7472 return nil, false 7473} 7474 7475// AsLocationThresholdRuleCondition is the BasicRuleCondition implementation for RuleCondition. 7476func (rc RuleCondition) AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool) { 7477 return nil, false 7478} 7479 7480// AsManagementEventRuleCondition is the BasicRuleCondition implementation for RuleCondition. 7481func (rc RuleCondition) AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool) { 7482 return nil, false 7483} 7484 7485// AsRuleCondition is the BasicRuleCondition implementation for RuleCondition. 7486func (rc RuleCondition) AsRuleCondition() (*RuleCondition, bool) { 7487 return &rc, true 7488} 7489 7490// AsBasicRuleCondition is the BasicRuleCondition implementation for RuleCondition. 7491func (rc RuleCondition) AsBasicRuleCondition() (BasicRuleCondition, bool) { 7492 return &rc, true 7493} 7494 7495// UnmarshalJSON is the custom unmarshaler for RuleCondition struct. 7496func (rc *RuleCondition) UnmarshalJSON(body []byte) error { 7497 var m map[string]*json.RawMessage 7498 err := json.Unmarshal(body, &m) 7499 if err != nil { 7500 return err 7501 } 7502 for k, v := range m { 7503 switch k { 7504 case "dataSource": 7505 if v != nil { 7506 dataSource, err := unmarshalBasicRuleDataSource(*v) 7507 if err != nil { 7508 return err 7509 } 7510 rc.DataSource = dataSource 7511 } 7512 case "odata.type": 7513 if v != nil { 7514 var odataType OdataTypeBasicRuleCondition 7515 err = json.Unmarshal(*v, &odataType) 7516 if err != nil { 7517 return err 7518 } 7519 rc.OdataType = odataType 7520 } 7521 } 7522 } 7523 7524 return nil 7525} 7526 7527// BasicRuleDataSource the resource from which the rule collects its data. 7528type BasicRuleDataSource interface { 7529 AsRuleMetricDataSource() (*RuleMetricDataSource, bool) 7530 AsRuleManagementEventDataSource() (*RuleManagementEventDataSource, bool) 7531 AsRuleDataSource() (*RuleDataSource, bool) 7532} 7533 7534// RuleDataSource the resource from which the rule collects its data. 7535type RuleDataSource struct { 7536 // ResourceURI - the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule. 7537 ResourceURI *string `json:"resourceUri,omitempty"` 7538 // LegacyResourceID - the legacy resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule. 7539 LegacyResourceID *string `json:"legacyResourceId,omitempty"` 7540 // ResourceLocation - the location of the resource. 7541 ResourceLocation *string `json:"resourceLocation,omitempty"` 7542 // MetricNamespace - the namespace of the metric. 7543 MetricNamespace *string `json:"metricNamespace,omitempty"` 7544 // OdataType - Possible values include: 'OdataTypeRuleDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource' 7545 OdataType OdataType `json:"odata.type,omitempty"` 7546} 7547 7548func unmarshalBasicRuleDataSource(body []byte) (BasicRuleDataSource, error) { 7549 var m map[string]interface{} 7550 err := json.Unmarshal(body, &m) 7551 if err != nil { 7552 return nil, err 7553 } 7554 7555 switch m["odata.type"] { 7556 case string(OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource): 7557 var rmds RuleMetricDataSource 7558 err := json.Unmarshal(body, &rmds) 7559 return rmds, err 7560 case string(OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource): 7561 var rmeds RuleManagementEventDataSource 7562 err := json.Unmarshal(body, &rmeds) 7563 return rmeds, err 7564 default: 7565 var rds RuleDataSource 7566 err := json.Unmarshal(body, &rds) 7567 return rds, err 7568 } 7569} 7570func unmarshalBasicRuleDataSourceArray(body []byte) ([]BasicRuleDataSource, error) { 7571 var rawMessages []*json.RawMessage 7572 err := json.Unmarshal(body, &rawMessages) 7573 if err != nil { 7574 return nil, err 7575 } 7576 7577 rdsArray := make([]BasicRuleDataSource, len(rawMessages)) 7578 7579 for index, rawMessage := range rawMessages { 7580 rds, err := unmarshalBasicRuleDataSource(*rawMessage) 7581 if err != nil { 7582 return nil, err 7583 } 7584 rdsArray[index] = rds 7585 } 7586 return rdsArray, nil 7587} 7588 7589// MarshalJSON is the custom marshaler for RuleDataSource. 7590func (rds RuleDataSource) MarshalJSON() ([]byte, error) { 7591 rds.OdataType = OdataTypeRuleDataSource 7592 objectMap := make(map[string]interface{}) 7593 if rds.ResourceURI != nil { 7594 objectMap["resourceUri"] = rds.ResourceURI 7595 } 7596 if rds.LegacyResourceID != nil { 7597 objectMap["legacyResourceId"] = rds.LegacyResourceID 7598 } 7599 if rds.ResourceLocation != nil { 7600 objectMap["resourceLocation"] = rds.ResourceLocation 7601 } 7602 if rds.MetricNamespace != nil { 7603 objectMap["metricNamespace"] = rds.MetricNamespace 7604 } 7605 if rds.OdataType != "" { 7606 objectMap["odata.type"] = rds.OdataType 7607 } 7608 return json.Marshal(objectMap) 7609} 7610 7611// AsRuleMetricDataSource is the BasicRuleDataSource implementation for RuleDataSource. 7612func (rds RuleDataSource) AsRuleMetricDataSource() (*RuleMetricDataSource, bool) { 7613 return nil, false 7614} 7615 7616// AsRuleManagementEventDataSource is the BasicRuleDataSource implementation for RuleDataSource. 7617func (rds RuleDataSource) AsRuleManagementEventDataSource() (*RuleManagementEventDataSource, bool) { 7618 return nil, false 7619} 7620 7621// AsRuleDataSource is the BasicRuleDataSource implementation for RuleDataSource. 7622func (rds RuleDataSource) AsRuleDataSource() (*RuleDataSource, bool) { 7623 return &rds, true 7624} 7625 7626// AsBasicRuleDataSource is the BasicRuleDataSource implementation for RuleDataSource. 7627func (rds RuleDataSource) AsBasicRuleDataSource() (BasicRuleDataSource, bool) { 7628 return &rds, true 7629} 7630 7631// RuleEmailAction specifies the action to send email when the rule condition is evaluated. The 7632// discriminator is always RuleEmailAction in this case. 7633type RuleEmailAction struct { 7634 // SendToServiceOwners - Whether the administrators (service and co-administrators) of the service should be notified when the alert is activated. 7635 SendToServiceOwners *bool `json:"sendToServiceOwners,omitempty"` 7636 // CustomEmails - the list of administrator's custom email addresses to notify of the activation of the alert. 7637 CustomEmails *[]string `json:"customEmails,omitempty"` 7638 // OdataType - Possible values include: 'OdataTypeBasicRuleActionOdataTypeRuleAction', 'OdataTypeBasicRuleActionOdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction', 'OdataTypeBasicRuleActionOdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction' 7639 OdataType OdataTypeBasicRuleAction `json:"odata.type,omitempty"` 7640} 7641 7642// MarshalJSON is the custom marshaler for RuleEmailAction. 7643func (rea RuleEmailAction) MarshalJSON() ([]byte, error) { 7644 rea.OdataType = OdataTypeBasicRuleActionOdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction 7645 objectMap := make(map[string]interface{}) 7646 if rea.SendToServiceOwners != nil { 7647 objectMap["sendToServiceOwners"] = rea.SendToServiceOwners 7648 } 7649 if rea.CustomEmails != nil { 7650 objectMap["customEmails"] = rea.CustomEmails 7651 } 7652 if rea.OdataType != "" { 7653 objectMap["odata.type"] = rea.OdataType 7654 } 7655 return json.Marshal(objectMap) 7656} 7657 7658// AsRuleEmailAction is the BasicRuleAction implementation for RuleEmailAction. 7659func (rea RuleEmailAction) AsRuleEmailAction() (*RuleEmailAction, bool) { 7660 return &rea, true 7661} 7662 7663// AsRuleWebhookAction is the BasicRuleAction implementation for RuleEmailAction. 7664func (rea RuleEmailAction) AsRuleWebhookAction() (*RuleWebhookAction, bool) { 7665 return nil, false 7666} 7667 7668// AsRuleAction is the BasicRuleAction implementation for RuleEmailAction. 7669func (rea RuleEmailAction) AsRuleAction() (*RuleAction, bool) { 7670 return nil, false 7671} 7672 7673// AsBasicRuleAction is the BasicRuleAction implementation for RuleEmailAction. 7674func (rea RuleEmailAction) AsBasicRuleAction() (BasicRuleAction, bool) { 7675 return &rea, true 7676} 7677 7678// RuleManagementEventClaimsDataSource the claims for a rule management event data source. 7679type RuleManagementEventClaimsDataSource struct { 7680 // EmailAddress - the email address. 7681 EmailAddress *string `json:"emailAddress,omitempty"` 7682} 7683 7684// RuleManagementEventDataSource a rule management event data source. The discriminator fields is always 7685// RuleManagementEventDataSource in this case. 7686type RuleManagementEventDataSource struct { 7687 // EventName - the event name. 7688 EventName *string `json:"eventName,omitempty"` 7689 // EventSource - the event source. 7690 EventSource *string `json:"eventSource,omitempty"` 7691 // Level - the level. 7692 Level *string `json:"level,omitempty"` 7693 // OperationName - The name of the operation that should be checked for. If no name is provided, any operation will match. 7694 OperationName *string `json:"operationName,omitempty"` 7695 // ResourceGroupName - the resource group name. 7696 ResourceGroupName *string `json:"resourceGroupName,omitempty"` 7697 // ResourceProviderName - the resource provider name. 7698 ResourceProviderName *string `json:"resourceProviderName,omitempty"` 7699 // Status - The status of the operation that should be checked for. If no status is provided, any status will match. 7700 Status *string `json:"status,omitempty"` 7701 // SubStatus - the substatus. 7702 SubStatus *string `json:"subStatus,omitempty"` 7703 // Claims - the claims. 7704 Claims *RuleManagementEventClaimsDataSource `json:"claims,omitempty"` 7705 // ResourceURI - the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule. 7706 ResourceURI *string `json:"resourceUri,omitempty"` 7707 // LegacyResourceID - the legacy resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule. 7708 LegacyResourceID *string `json:"legacyResourceId,omitempty"` 7709 // ResourceLocation - the location of the resource. 7710 ResourceLocation *string `json:"resourceLocation,omitempty"` 7711 // MetricNamespace - the namespace of the metric. 7712 MetricNamespace *string `json:"metricNamespace,omitempty"` 7713 // OdataType - Possible values include: 'OdataTypeRuleDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource' 7714 OdataType OdataType `json:"odata.type,omitempty"` 7715} 7716 7717// MarshalJSON is the custom marshaler for RuleManagementEventDataSource. 7718func (rmeds RuleManagementEventDataSource) MarshalJSON() ([]byte, error) { 7719 rmeds.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource 7720 objectMap := make(map[string]interface{}) 7721 if rmeds.EventName != nil { 7722 objectMap["eventName"] = rmeds.EventName 7723 } 7724 if rmeds.EventSource != nil { 7725 objectMap["eventSource"] = rmeds.EventSource 7726 } 7727 if rmeds.Level != nil { 7728 objectMap["level"] = rmeds.Level 7729 } 7730 if rmeds.OperationName != nil { 7731 objectMap["operationName"] = rmeds.OperationName 7732 } 7733 if rmeds.ResourceGroupName != nil { 7734 objectMap["resourceGroupName"] = rmeds.ResourceGroupName 7735 } 7736 if rmeds.ResourceProviderName != nil { 7737 objectMap["resourceProviderName"] = rmeds.ResourceProviderName 7738 } 7739 if rmeds.Status != nil { 7740 objectMap["status"] = rmeds.Status 7741 } 7742 if rmeds.SubStatus != nil { 7743 objectMap["subStatus"] = rmeds.SubStatus 7744 } 7745 if rmeds.Claims != nil { 7746 objectMap["claims"] = rmeds.Claims 7747 } 7748 if rmeds.ResourceURI != nil { 7749 objectMap["resourceUri"] = rmeds.ResourceURI 7750 } 7751 if rmeds.LegacyResourceID != nil { 7752 objectMap["legacyResourceId"] = rmeds.LegacyResourceID 7753 } 7754 if rmeds.ResourceLocation != nil { 7755 objectMap["resourceLocation"] = rmeds.ResourceLocation 7756 } 7757 if rmeds.MetricNamespace != nil { 7758 objectMap["metricNamespace"] = rmeds.MetricNamespace 7759 } 7760 if rmeds.OdataType != "" { 7761 objectMap["odata.type"] = rmeds.OdataType 7762 } 7763 return json.Marshal(objectMap) 7764} 7765 7766// AsRuleMetricDataSource is the BasicRuleDataSource implementation for RuleManagementEventDataSource. 7767func (rmeds RuleManagementEventDataSource) AsRuleMetricDataSource() (*RuleMetricDataSource, bool) { 7768 return nil, false 7769} 7770 7771// AsRuleManagementEventDataSource is the BasicRuleDataSource implementation for RuleManagementEventDataSource. 7772func (rmeds RuleManagementEventDataSource) AsRuleManagementEventDataSource() (*RuleManagementEventDataSource, bool) { 7773 return &rmeds, true 7774} 7775 7776// AsRuleDataSource is the BasicRuleDataSource implementation for RuleManagementEventDataSource. 7777func (rmeds RuleManagementEventDataSource) AsRuleDataSource() (*RuleDataSource, bool) { 7778 return nil, false 7779} 7780 7781// AsBasicRuleDataSource is the BasicRuleDataSource implementation for RuleManagementEventDataSource. 7782func (rmeds RuleManagementEventDataSource) AsBasicRuleDataSource() (BasicRuleDataSource, bool) { 7783 return &rmeds, true 7784} 7785 7786// RuleMetricDataSource a rule metric data source. The discriminator value is always RuleMetricDataSource 7787// in this case. 7788type RuleMetricDataSource struct { 7789 // MetricName - the name of the metric that defines what the rule monitors. 7790 MetricName *string `json:"metricName,omitempty"` 7791 // ResourceURI - the resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule. 7792 ResourceURI *string `json:"resourceUri,omitempty"` 7793 // LegacyResourceID - the legacy resource identifier of the resource the rule monitors. **NOTE**: this property cannot be updated for an existing rule. 7794 LegacyResourceID *string `json:"legacyResourceId,omitempty"` 7795 // ResourceLocation - the location of the resource. 7796 ResourceLocation *string `json:"resourceLocation,omitempty"` 7797 // MetricNamespace - the namespace of the metric. 7798 MetricNamespace *string `json:"metricNamespace,omitempty"` 7799 // OdataType - Possible values include: 'OdataTypeRuleDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource', 'OdataTypeMicrosoftAzureManagementInsightsModelsRuleManagementEventDataSource' 7800 OdataType OdataType `json:"odata.type,omitempty"` 7801} 7802 7803// MarshalJSON is the custom marshaler for RuleMetricDataSource. 7804func (rmds RuleMetricDataSource) MarshalJSON() ([]byte, error) { 7805 rmds.OdataType = OdataTypeMicrosoftAzureManagementInsightsModelsRuleMetricDataSource 7806 objectMap := make(map[string]interface{}) 7807 if rmds.MetricName != nil { 7808 objectMap["metricName"] = rmds.MetricName 7809 } 7810 if rmds.ResourceURI != nil { 7811 objectMap["resourceUri"] = rmds.ResourceURI 7812 } 7813 if rmds.LegacyResourceID != nil { 7814 objectMap["legacyResourceId"] = rmds.LegacyResourceID 7815 } 7816 if rmds.ResourceLocation != nil { 7817 objectMap["resourceLocation"] = rmds.ResourceLocation 7818 } 7819 if rmds.MetricNamespace != nil { 7820 objectMap["metricNamespace"] = rmds.MetricNamespace 7821 } 7822 if rmds.OdataType != "" { 7823 objectMap["odata.type"] = rmds.OdataType 7824 } 7825 return json.Marshal(objectMap) 7826} 7827 7828// AsRuleMetricDataSource is the BasicRuleDataSource implementation for RuleMetricDataSource. 7829func (rmds RuleMetricDataSource) AsRuleMetricDataSource() (*RuleMetricDataSource, bool) { 7830 return &rmds, true 7831} 7832 7833// AsRuleManagementEventDataSource is the BasicRuleDataSource implementation for RuleMetricDataSource. 7834func (rmds RuleMetricDataSource) AsRuleManagementEventDataSource() (*RuleManagementEventDataSource, bool) { 7835 return nil, false 7836} 7837 7838// AsRuleDataSource is the BasicRuleDataSource implementation for RuleMetricDataSource. 7839func (rmds RuleMetricDataSource) AsRuleDataSource() (*RuleDataSource, bool) { 7840 return nil, false 7841} 7842 7843// AsBasicRuleDataSource is the BasicRuleDataSource implementation for RuleMetricDataSource. 7844func (rmds RuleMetricDataSource) AsBasicRuleDataSource() (BasicRuleDataSource, bool) { 7845 return &rmds, true 7846} 7847 7848// RuleWebhookAction specifies the action to post to service when the rule condition is evaluated. The 7849// discriminator is always RuleWebhookAction in this case. 7850type RuleWebhookAction struct { 7851 // ServiceURI - the service uri to Post the notification when the alert activates or resolves. 7852 ServiceURI *string `json:"serviceUri,omitempty"` 7853 // Properties - the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload. 7854 Properties map[string]*string `json:"properties"` 7855 // OdataType - Possible values include: 'OdataTypeBasicRuleActionOdataTypeRuleAction', 'OdataTypeBasicRuleActionOdataTypeMicrosoftAzureManagementInsightsModelsRuleEmailAction', 'OdataTypeBasicRuleActionOdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction' 7856 OdataType OdataTypeBasicRuleAction `json:"odata.type,omitempty"` 7857} 7858 7859// MarshalJSON is the custom marshaler for RuleWebhookAction. 7860func (rwa RuleWebhookAction) MarshalJSON() ([]byte, error) { 7861 rwa.OdataType = OdataTypeBasicRuleActionOdataTypeMicrosoftAzureManagementInsightsModelsRuleWebhookAction 7862 objectMap := make(map[string]interface{}) 7863 if rwa.ServiceURI != nil { 7864 objectMap["serviceUri"] = rwa.ServiceURI 7865 } 7866 if rwa.Properties != nil { 7867 objectMap["properties"] = rwa.Properties 7868 } 7869 if rwa.OdataType != "" { 7870 objectMap["odata.type"] = rwa.OdataType 7871 } 7872 return json.Marshal(objectMap) 7873} 7874 7875// AsRuleEmailAction is the BasicRuleAction implementation for RuleWebhookAction. 7876func (rwa RuleWebhookAction) AsRuleEmailAction() (*RuleEmailAction, bool) { 7877 return nil, false 7878} 7879 7880// AsRuleWebhookAction is the BasicRuleAction implementation for RuleWebhookAction. 7881func (rwa RuleWebhookAction) AsRuleWebhookAction() (*RuleWebhookAction, bool) { 7882 return &rwa, true 7883} 7884 7885// AsRuleAction is the BasicRuleAction implementation for RuleWebhookAction. 7886func (rwa RuleWebhookAction) AsRuleAction() (*RuleAction, bool) { 7887 return nil, false 7888} 7889 7890// AsBasicRuleAction is the BasicRuleAction implementation for RuleWebhookAction. 7891func (rwa RuleWebhookAction) AsBasicRuleAction() (BasicRuleAction, bool) { 7892 return &rwa, true 7893} 7894 7895// ScaleAction the parameters for the scaling action. 7896type ScaleAction struct { 7897 // Direction - the scale direction. Whether the scaling action increases or decreases the number of instances. Possible values include: 'ScaleDirectionNone', 'ScaleDirectionIncrease', 'ScaleDirectionDecrease' 7898 Direction ScaleDirection `json:"direction,omitempty"` 7899 // Type - the type of action that should occur when the scale rule fires. Possible values include: 'ScaleTypeChangeCount', 'ScaleTypePercentChangeCount', 'ScaleTypeExactCount', 'ScaleTypeServiceAllowedNextValue' 7900 Type ScaleType `json:"type,omitempty"` 7901 // Value - the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1. 7902 Value *string `json:"value,omitempty"` 7903 // 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. 7904 Cooldown *string `json:"cooldown,omitempty"` 7905} 7906 7907// ScaleCapacity the number of instances that can be used during this profile. 7908type ScaleCapacity struct { 7909 // Minimum - the minimum number of instances for the resource. 7910 Minimum *string `json:"minimum,omitempty"` 7911 // 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. 7912 Maximum *string `json:"maximum,omitempty"` 7913 // 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. 7914 Default *string `json:"default,omitempty"` 7915} 7916 7917// ScaleRule a rule that provide the triggers and parameters for the scaling action. 7918type ScaleRule struct { 7919 // MetricTrigger - the trigger that results in a scaling action. 7920 MetricTrigger *MetricTrigger `json:"metricTrigger,omitempty"` 7921 // ScaleAction - the parameters for the scaling action. 7922 ScaleAction *ScaleAction `json:"scaleAction,omitempty"` 7923} 7924 7925// ScaleRuleMetricDimension specifies an auto scale rule metric dimension. 7926type ScaleRuleMetricDimension struct { 7927 // DimensionName - Name of the dimension. 7928 DimensionName *string `json:"DimensionName,omitempty"` 7929 // Operator - the dimension operator. Only 'Equals' and 'NotEquals' are supported. 'Equals' being equal to any of the values. 'NotEquals' being not equal to all of the values. Possible values include: 'ScaleRuleMetricDimensionOperationTypeEquals', 'ScaleRuleMetricDimensionOperationTypeNotEquals' 7930 Operator ScaleRuleMetricDimensionOperationType `json:"Operator,omitempty"` 7931 // Values - list of dimension values. For example: ["App1","App2"]. 7932 Values *[]string `json:"Values,omitempty"` 7933} 7934 7935// Schedule defines how often to run the search and the time interval. 7936type Schedule struct { 7937 // FrequencyInMinutes - frequency (in minutes) at which rule condition should be evaluated. 7938 FrequencyInMinutes *int32 `json:"frequencyInMinutes,omitempty"` 7939 // TimeWindowInMinutes - Time window for which data needs to be fetched for query (should be greater than or equal to frequencyInMinutes). 7940 TimeWindowInMinutes *int32 `json:"timeWindowInMinutes,omitempty"` 7941} 7942 7943// ScopedResource a private link scoped resource 7944type ScopedResource struct { 7945 autorest.Response `json:"-"` 7946 // ScopedResourceProperties - Resource properties. 7947 *ScopedResourceProperties `json:"properties,omitempty"` 7948 // ID - READ-ONLY; Azure resource Id 7949 ID *string `json:"id,omitempty"` 7950 // Name - READ-ONLY; Azure resource name 7951 Name *string `json:"name,omitempty"` 7952 // Type - READ-ONLY; Azure resource type 7953 Type *string `json:"type,omitempty"` 7954} 7955 7956// MarshalJSON is the custom marshaler for ScopedResource. 7957func (sr ScopedResource) MarshalJSON() ([]byte, error) { 7958 objectMap := make(map[string]interface{}) 7959 if sr.ScopedResourceProperties != nil { 7960 objectMap["properties"] = sr.ScopedResourceProperties 7961 } 7962 return json.Marshal(objectMap) 7963} 7964 7965// UnmarshalJSON is the custom unmarshaler for ScopedResource struct. 7966func (sr *ScopedResource) UnmarshalJSON(body []byte) error { 7967 var m map[string]*json.RawMessage 7968 err := json.Unmarshal(body, &m) 7969 if err != nil { 7970 return err 7971 } 7972 for k, v := range m { 7973 switch k { 7974 case "properties": 7975 if v != nil { 7976 var scopedResourceProperties ScopedResourceProperties 7977 err = json.Unmarshal(*v, &scopedResourceProperties) 7978 if err != nil { 7979 return err 7980 } 7981 sr.ScopedResourceProperties = &scopedResourceProperties 7982 } 7983 case "id": 7984 if v != nil { 7985 var ID string 7986 err = json.Unmarshal(*v, &ID) 7987 if err != nil { 7988 return err 7989 } 7990 sr.ID = &ID 7991 } 7992 case "name": 7993 if v != nil { 7994 var name string 7995 err = json.Unmarshal(*v, &name) 7996 if err != nil { 7997 return err 7998 } 7999 sr.Name = &name 8000 } 8001 case "type": 8002 if v != nil { 8003 var typeVar string 8004 err = json.Unmarshal(*v, &typeVar) 8005 if err != nil { 8006 return err 8007 } 8008 sr.Type = &typeVar 8009 } 8010 } 8011 } 8012 8013 return nil 8014} 8015 8016// ScopedResourceListResult a list of scoped resources in a private link scope. 8017type ScopedResourceListResult struct { 8018 autorest.Response `json:"-"` 8019 // Value - READ-ONLY; Array of results. 8020 Value *[]ScopedResource `json:"value,omitempty"` 8021 // NextLink - READ-ONLY; Link to retrieve next page of results. 8022 NextLink *string `json:"nextLink,omitempty"` 8023} 8024 8025// MarshalJSON is the custom marshaler for ScopedResourceListResult. 8026func (srlr ScopedResourceListResult) MarshalJSON() ([]byte, error) { 8027 objectMap := make(map[string]interface{}) 8028 return json.Marshal(objectMap) 8029} 8030 8031// ScopedResourceListResultIterator provides access to a complete listing of ScopedResource values. 8032type ScopedResourceListResultIterator struct { 8033 i int 8034 page ScopedResourceListResultPage 8035} 8036 8037// NextWithContext advances to the next value. If there was an error making 8038// the request the iterator does not advance and the error is returned. 8039func (iter *ScopedResourceListResultIterator) NextWithContext(ctx context.Context) (err error) { 8040 if tracing.IsEnabled() { 8041 ctx = tracing.StartSpan(ctx, fqdn+"/ScopedResourceListResultIterator.NextWithContext") 8042 defer func() { 8043 sc := -1 8044 if iter.Response().Response.Response != nil { 8045 sc = iter.Response().Response.Response.StatusCode 8046 } 8047 tracing.EndSpan(ctx, sc, err) 8048 }() 8049 } 8050 iter.i++ 8051 if iter.i < len(iter.page.Values()) { 8052 return nil 8053 } 8054 err = iter.page.NextWithContext(ctx) 8055 if err != nil { 8056 iter.i-- 8057 return err 8058 } 8059 iter.i = 0 8060 return nil 8061} 8062 8063// Next advances to the next value. If there was an error making 8064// the request the iterator does not advance and the error is returned. 8065// Deprecated: Use NextWithContext() instead. 8066func (iter *ScopedResourceListResultIterator) Next() error { 8067 return iter.NextWithContext(context.Background()) 8068} 8069 8070// NotDone returns true if the enumeration should be started or is not yet complete. 8071func (iter ScopedResourceListResultIterator) NotDone() bool { 8072 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8073} 8074 8075// Response returns the raw server response from the last page request. 8076func (iter ScopedResourceListResultIterator) Response() ScopedResourceListResult { 8077 return iter.page.Response() 8078} 8079 8080// Value returns the current value or a zero-initialized value if the 8081// iterator has advanced beyond the end of the collection. 8082func (iter ScopedResourceListResultIterator) Value() ScopedResource { 8083 if !iter.page.NotDone() { 8084 return ScopedResource{} 8085 } 8086 return iter.page.Values()[iter.i] 8087} 8088 8089// Creates a new instance of the ScopedResourceListResultIterator type. 8090func NewScopedResourceListResultIterator(page ScopedResourceListResultPage) ScopedResourceListResultIterator { 8091 return ScopedResourceListResultIterator{page: page} 8092} 8093 8094// IsEmpty returns true if the ListResult contains no values. 8095func (srlr ScopedResourceListResult) IsEmpty() bool { 8096 return srlr.Value == nil || len(*srlr.Value) == 0 8097} 8098 8099// hasNextLink returns true if the NextLink is not empty. 8100func (srlr ScopedResourceListResult) hasNextLink() bool { 8101 return srlr.NextLink != nil && len(*srlr.NextLink) != 0 8102} 8103 8104// scopedResourceListResultPreparer prepares a request to retrieve the next set of results. 8105// It returns nil if no more results exist. 8106func (srlr ScopedResourceListResult) scopedResourceListResultPreparer(ctx context.Context) (*http.Request, error) { 8107 if !srlr.hasNextLink() { 8108 return nil, nil 8109 } 8110 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8111 autorest.AsJSON(), 8112 autorest.AsGet(), 8113 autorest.WithBaseURL(to.String(srlr.NextLink))) 8114} 8115 8116// ScopedResourceListResultPage contains a page of ScopedResource values. 8117type ScopedResourceListResultPage struct { 8118 fn func(context.Context, ScopedResourceListResult) (ScopedResourceListResult, error) 8119 srlr ScopedResourceListResult 8120} 8121 8122// NextWithContext advances to the next page of values. If there was an error making 8123// the request the page does not advance and the error is returned. 8124func (page *ScopedResourceListResultPage) NextWithContext(ctx context.Context) (err error) { 8125 if tracing.IsEnabled() { 8126 ctx = tracing.StartSpan(ctx, fqdn+"/ScopedResourceListResultPage.NextWithContext") 8127 defer func() { 8128 sc := -1 8129 if page.Response().Response.Response != nil { 8130 sc = page.Response().Response.Response.StatusCode 8131 } 8132 tracing.EndSpan(ctx, sc, err) 8133 }() 8134 } 8135 for { 8136 next, err := page.fn(ctx, page.srlr) 8137 if err != nil { 8138 return err 8139 } 8140 page.srlr = next 8141 if !next.hasNextLink() || !next.IsEmpty() { 8142 break 8143 } 8144 } 8145 return nil 8146} 8147 8148// Next advances to the next page of values. If there was an error making 8149// the request the page does not advance and the error is returned. 8150// Deprecated: Use NextWithContext() instead. 8151func (page *ScopedResourceListResultPage) Next() error { 8152 return page.NextWithContext(context.Background()) 8153} 8154 8155// NotDone returns true if the page enumeration should be started or is not yet complete. 8156func (page ScopedResourceListResultPage) NotDone() bool { 8157 return !page.srlr.IsEmpty() 8158} 8159 8160// Response returns the raw server response from the last page request. 8161func (page ScopedResourceListResultPage) Response() ScopedResourceListResult { 8162 return page.srlr 8163} 8164 8165// Values returns the slice of values for the current page or nil if there are no values. 8166func (page ScopedResourceListResultPage) Values() []ScopedResource { 8167 if page.srlr.IsEmpty() { 8168 return nil 8169 } 8170 return *page.srlr.Value 8171} 8172 8173// Creates a new instance of the ScopedResourceListResultPage type. 8174func NewScopedResourceListResultPage(cur ScopedResourceListResult, getNextPage func(context.Context, ScopedResourceListResult) (ScopedResourceListResult, error)) ScopedResourceListResultPage { 8175 return ScopedResourceListResultPage{ 8176 fn: getNextPage, 8177 srlr: cur, 8178 } 8179} 8180 8181// ScopedResourceProperties properties of a private link scoped resource. 8182type ScopedResourceProperties struct { 8183 // LinkedResourceID - The resource id of the scoped Azure monitor resource. 8184 LinkedResourceID *string `json:"linkedResourceId,omitempty"` 8185 // ProvisioningState - READ-ONLY; State of the private endpoint connection. 8186 ProvisioningState *string `json:"provisioningState,omitempty"` 8187} 8188 8189// MarshalJSON is the custom marshaler for ScopedResourceProperties. 8190func (srp ScopedResourceProperties) MarshalJSON() ([]byte, error) { 8191 objectMap := make(map[string]interface{}) 8192 if srp.LinkedResourceID != nil { 8193 objectMap["linkedResourceId"] = srp.LinkedResourceID 8194 } 8195 return json.Marshal(objectMap) 8196} 8197 8198// SenderAuthorization the authorization used by the user who has performed the operation that led to this 8199// event. This captures the RBAC properties of the event. These usually include the 'action', 'role' and 8200// the 'scope' 8201type SenderAuthorization struct { 8202 // Action - the permissible actions. For instance: microsoft.support/supporttickets/write 8203 Action *string `json:"action,omitempty"` 8204 // Role - the role of the user. For instance: Subscription Admin 8205 Role *string `json:"role,omitempty"` 8206 // Scope - the scope. 8207 Scope *string `json:"scope,omitempty"` 8208} 8209 8210// SingleBaseline the baseline values for a single sensitivity value. 8211type SingleBaseline struct { 8212 // Sensitivity - the sensitivity of the baseline. Possible values include: 'BaselineSensitivityLow', 'BaselineSensitivityMedium', 'BaselineSensitivityHigh' 8213 Sensitivity BaselineSensitivity `json:"sensitivity,omitempty"` 8214 // LowThresholds - The low thresholds of the baseline. 8215 LowThresholds *[]float64 `json:"lowThresholds,omitempty"` 8216 // HighThresholds - The high thresholds of the baseline. 8217 HighThresholds *[]float64 `json:"highThresholds,omitempty"` 8218} 8219 8220// SingleMetricBaseline the baseline results of a single metric. 8221type SingleMetricBaseline struct { 8222 // ID - The metric baseline Id. 8223 ID *string `json:"id,omitempty"` 8224 // Type - The resource type of the metric baseline resource. 8225 Type *string `json:"type,omitempty"` 8226 // Name - The name of the metric for which the baselines were retrieved. 8227 Name *string `json:"name,omitempty"` 8228 // MetricBaselinesProperties - The metric baseline properties of the metric. 8229 *MetricBaselinesProperties `json:"properties,omitempty"` 8230} 8231 8232// MarshalJSON is the custom marshaler for SingleMetricBaseline. 8233func (smb SingleMetricBaseline) MarshalJSON() ([]byte, error) { 8234 objectMap := make(map[string]interface{}) 8235 if smb.ID != nil { 8236 objectMap["id"] = smb.ID 8237 } 8238 if smb.Type != nil { 8239 objectMap["type"] = smb.Type 8240 } 8241 if smb.Name != nil { 8242 objectMap["name"] = smb.Name 8243 } 8244 if smb.MetricBaselinesProperties != nil { 8245 objectMap["properties"] = smb.MetricBaselinesProperties 8246 } 8247 return json.Marshal(objectMap) 8248} 8249 8250// UnmarshalJSON is the custom unmarshaler for SingleMetricBaseline struct. 8251func (smb *SingleMetricBaseline) UnmarshalJSON(body []byte) error { 8252 var m map[string]*json.RawMessage 8253 err := json.Unmarshal(body, &m) 8254 if err != nil { 8255 return err 8256 } 8257 for k, v := range m { 8258 switch k { 8259 case "id": 8260 if v != nil { 8261 var ID string 8262 err = json.Unmarshal(*v, &ID) 8263 if err != nil { 8264 return err 8265 } 8266 smb.ID = &ID 8267 } 8268 case "type": 8269 if v != nil { 8270 var typeVar string 8271 err = json.Unmarshal(*v, &typeVar) 8272 if err != nil { 8273 return err 8274 } 8275 smb.Type = &typeVar 8276 } 8277 case "name": 8278 if v != nil { 8279 var name string 8280 err = json.Unmarshal(*v, &name) 8281 if err != nil { 8282 return err 8283 } 8284 smb.Name = &name 8285 } 8286 case "properties": 8287 if v != nil { 8288 var metricBaselinesProperties MetricBaselinesProperties 8289 err = json.Unmarshal(*v, &metricBaselinesProperties) 8290 if err != nil { 8291 return err 8292 } 8293 smb.MetricBaselinesProperties = &metricBaselinesProperties 8294 } 8295 } 8296 } 8297 8298 return nil 8299} 8300 8301// SmsReceiver an SMS receiver. 8302type SmsReceiver struct { 8303 // Name - The name of the SMS receiver. Names must be unique across all receivers within an action group. 8304 Name *string `json:"name,omitempty"` 8305 // CountryCode - The country code of the SMS receiver. 8306 CountryCode *string `json:"countryCode,omitempty"` 8307 // PhoneNumber - The phone number of the SMS receiver. 8308 PhoneNumber *string `json:"phoneNumber,omitempty"` 8309 // Status - READ-ONLY; The status of the receiver. Possible values include: 'ReceiverStatusNotSpecified', 'ReceiverStatusEnabled', 'ReceiverStatusDisabled' 8310 Status ReceiverStatus `json:"status,omitempty"` 8311} 8312 8313// MarshalJSON is the custom marshaler for SmsReceiver. 8314func (sr SmsReceiver) MarshalJSON() ([]byte, error) { 8315 objectMap := make(map[string]interface{}) 8316 if sr.Name != nil { 8317 objectMap["name"] = sr.Name 8318 } 8319 if sr.CountryCode != nil { 8320 objectMap["countryCode"] = sr.CountryCode 8321 } 8322 if sr.PhoneNumber != nil { 8323 objectMap["phoneNumber"] = sr.PhoneNumber 8324 } 8325 return json.Marshal(objectMap) 8326} 8327 8328// Source specifies the log search query. 8329type Source struct { 8330 // Query - Log search query. Required for action type - AlertingAction 8331 Query *string `json:"query,omitempty"` 8332 // AuthorizedResources - List of Resource referred into query 8333 AuthorizedResources *[]string `json:"authorizedResources,omitempty"` 8334 // DataSourceID - The resource uri over which log search query is to be run. 8335 DataSourceID *string `json:"dataSourceId,omitempty"` 8336 // QueryType - Set value to 'ResultCount'. Possible values include: 'QueryTypeResultCount' 8337 QueryType QueryType `json:"queryType,omitempty"` 8338} 8339 8340// SyslogDataSource definition of which syslog data will be collected and how it will be collected. 8341// Only collected from Linux machines. 8342type SyslogDataSource struct { 8343 // Streams - List of streams that this data source will be sent to. 8344 // A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will be sent to. 8345 Streams *[]KnownSyslogDataSourceStreams `json:"streams,omitempty"` 8346 // FacilityNames - The list of facility names. 8347 FacilityNames *[]KnownSyslogDataSourceFacilityNames `json:"facilityNames,omitempty"` 8348 // LogLevels - The log levels to collect. 8349 LogLevels *[]KnownSyslogDataSourceLogLevels `json:"logLevels,omitempty"` 8350 // Name - A friendly name for the data source. 8351 // This name should be unique across all data sources (regardless of type) within the data collection rule. 8352 Name *string `json:"name,omitempty"` 8353} 8354 8355// SystemData metadata pertaining to creation and last modification of the resource. 8356type SystemData struct { 8357 // CreatedBy - The identity that created the resource. 8358 CreatedBy *string `json:"createdBy,omitempty"` 8359 // CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' 8360 CreatedByType CreatedByType `json:"createdByType,omitempty"` 8361 // CreatedAt - The timestamp of resource creation (UTC). 8362 CreatedAt *date.Time `json:"createdAt,omitempty"` 8363 // LastModifiedBy - The identity that last modified the resource. 8364 LastModifiedBy *string `json:"lastModifiedBy,omitempty"` 8365 // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' 8366 LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` 8367 // LastModifiedAt - The timestamp of resource last modification (UTC) 8368 LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` 8369} 8370 8371// TagsResource a container holding only the Tags for a resource, allowing the user to update the tags on a 8372// PrivateLinkScope instance. 8373type TagsResource struct { 8374 // Tags - Resource tags 8375 Tags map[string]*string `json:"tags"` 8376} 8377 8378// MarshalJSON is the custom marshaler for TagsResource. 8379func (tr TagsResource) MarshalJSON() ([]byte, error) { 8380 objectMap := make(map[string]interface{}) 8381 if tr.Tags != nil { 8382 objectMap["tags"] = tr.Tags 8383 } 8384 return json.Marshal(objectMap) 8385} 8386 8387// ThresholdRuleCondition a rule condition based on a metric crossing a threshold. 8388type ThresholdRuleCondition struct { 8389 // Operator - the operator used to compare the data and the threshold. Possible values include: 'ConditionOperatorGreaterThan', 'ConditionOperatorGreaterThanOrEqual', 'ConditionOperatorLessThan', 'ConditionOperatorLessThanOrEqual' 8390 Operator ConditionOperator `json:"operator,omitempty"` 8391 // Threshold - the threshold value that activates the alert. 8392 Threshold *float64 `json:"threshold,omitempty"` 8393 // 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. 8394 WindowSize *string `json:"windowSize,omitempty"` 8395 // 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' 8396 TimeAggregation TimeAggregationOperator `json:"timeAggregation,omitempty"` 8397 // DataSource - the resource from which the rule collects its data. For this type dataSource will always be of type RuleMetricDataSource. 8398 DataSource BasicRuleDataSource `json:"dataSource,omitempty"` 8399 // OdataType - Possible values include: 'OdataTypeBasicRuleConditionOdataTypeRuleCondition', 'OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition', 'OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsLocationThresholdRuleCondition', 'OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsManagementEventRuleCondition' 8400 OdataType OdataTypeBasicRuleCondition `json:"odata.type,omitempty"` 8401} 8402 8403// MarshalJSON is the custom marshaler for ThresholdRuleCondition. 8404func (trc ThresholdRuleCondition) MarshalJSON() ([]byte, error) { 8405 trc.OdataType = OdataTypeBasicRuleConditionOdataTypeMicrosoftAzureManagementInsightsModelsThresholdRuleCondition 8406 objectMap := make(map[string]interface{}) 8407 if trc.Operator != "" { 8408 objectMap["operator"] = trc.Operator 8409 } 8410 if trc.Threshold != nil { 8411 objectMap["threshold"] = trc.Threshold 8412 } 8413 if trc.WindowSize != nil { 8414 objectMap["windowSize"] = trc.WindowSize 8415 } 8416 if trc.TimeAggregation != "" { 8417 objectMap["timeAggregation"] = trc.TimeAggregation 8418 } 8419 objectMap["dataSource"] = trc.DataSource 8420 if trc.OdataType != "" { 8421 objectMap["odata.type"] = trc.OdataType 8422 } 8423 return json.Marshal(objectMap) 8424} 8425 8426// AsThresholdRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition. 8427func (trc ThresholdRuleCondition) AsThresholdRuleCondition() (*ThresholdRuleCondition, bool) { 8428 return &trc, true 8429} 8430 8431// AsLocationThresholdRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition. 8432func (trc ThresholdRuleCondition) AsLocationThresholdRuleCondition() (*LocationThresholdRuleCondition, bool) { 8433 return nil, false 8434} 8435 8436// AsManagementEventRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition. 8437func (trc ThresholdRuleCondition) AsManagementEventRuleCondition() (*ManagementEventRuleCondition, bool) { 8438 return nil, false 8439} 8440 8441// AsRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition. 8442func (trc ThresholdRuleCondition) AsRuleCondition() (*RuleCondition, bool) { 8443 return nil, false 8444} 8445 8446// AsBasicRuleCondition is the BasicRuleCondition implementation for ThresholdRuleCondition. 8447func (trc ThresholdRuleCondition) AsBasicRuleCondition() (BasicRuleCondition, bool) { 8448 return &trc, true 8449} 8450 8451// UnmarshalJSON is the custom unmarshaler for ThresholdRuleCondition struct. 8452func (trc *ThresholdRuleCondition) UnmarshalJSON(body []byte) error { 8453 var m map[string]*json.RawMessage 8454 err := json.Unmarshal(body, &m) 8455 if err != nil { 8456 return err 8457 } 8458 for k, v := range m { 8459 switch k { 8460 case "operator": 8461 if v != nil { 8462 var operator ConditionOperator 8463 err = json.Unmarshal(*v, &operator) 8464 if err != nil { 8465 return err 8466 } 8467 trc.Operator = operator 8468 } 8469 case "threshold": 8470 if v != nil { 8471 var threshold float64 8472 err = json.Unmarshal(*v, &threshold) 8473 if err != nil { 8474 return err 8475 } 8476 trc.Threshold = &threshold 8477 } 8478 case "windowSize": 8479 if v != nil { 8480 var windowSize string 8481 err = json.Unmarshal(*v, &windowSize) 8482 if err != nil { 8483 return err 8484 } 8485 trc.WindowSize = &windowSize 8486 } 8487 case "timeAggregation": 8488 if v != nil { 8489 var timeAggregation TimeAggregationOperator 8490 err = json.Unmarshal(*v, &timeAggregation) 8491 if err != nil { 8492 return err 8493 } 8494 trc.TimeAggregation = timeAggregation 8495 } 8496 case "dataSource": 8497 if v != nil { 8498 dataSource, err := unmarshalBasicRuleDataSource(*v) 8499 if err != nil { 8500 return err 8501 } 8502 trc.DataSource = dataSource 8503 } 8504 case "odata.type": 8505 if v != nil { 8506 var odataType OdataTypeBasicRuleCondition 8507 err = json.Unmarshal(*v, &odataType) 8508 if err != nil { 8509 return err 8510 } 8511 trc.OdataType = odataType 8512 } 8513 } 8514 } 8515 8516 return nil 8517} 8518 8519// TimeSeriesBaseline the baseline values for a single time series. 8520type TimeSeriesBaseline struct { 8521 // Aggregation - The aggregation type of the metric. 8522 Aggregation *string `json:"aggregation,omitempty"` 8523 // Dimensions - The dimensions of this time series. 8524 Dimensions *[]MetricSingleDimension `json:"dimensions,omitempty"` 8525 // Timestamps - The list of timestamps of the baselines. 8526 Timestamps *[]date.Time `json:"timestamps,omitempty"` 8527 // Data - The baseline values for each sensitivity. 8528 Data *[]SingleBaseline `json:"data,omitempty"` 8529 // MetadataValues - The baseline metadata values. 8530 MetadataValues *[]BaselineMetadata `json:"metadataValues,omitempty"` 8531} 8532 8533// TimeSeriesElement a time series result type. The discriminator value is always TimeSeries in this case. 8534type TimeSeriesElement struct { 8535 // Metadatavalues - the metadata values returned if $filter was specified in the call. 8536 Metadatavalues *[]MetadataValue `json:"metadatavalues,omitempty"` 8537 // Data - An array of data points representing the metric values. This is only returned if a result type of data is specified. 8538 Data *[]MetricValue `json:"data,omitempty"` 8539} 8540 8541// TimeWindow a specific date-time for the profile. 8542type TimeWindow struct { 8543 // TimeZone - the timezone of the start and end times for the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time 8544 TimeZone *string `json:"timeZone,omitempty"` 8545 // Start - the start time for the profile in ISO 8601 format. 8546 Start *date.Time `json:"start,omitempty"` 8547 // End - the end time for the profile in ISO 8601 format. 8548 End *date.Time `json:"end,omitempty"` 8549} 8550 8551// TriggerCondition the condition that results in the Log Search rule. 8552type TriggerCondition struct { 8553 // ThresholdOperator - Evaluation operation for rule - 'GreaterThan' or 'LessThan. Possible values include: 'ConditionalOperatorGreaterThanOrEqual', 'ConditionalOperatorLessThanOrEqual', 'ConditionalOperatorGreaterThan', 'ConditionalOperatorLessThan', 'ConditionalOperatorEqual' 8554 ThresholdOperator ConditionalOperator `json:"thresholdOperator,omitempty"` 8555 // Threshold - Result or count threshold based on which rule should be triggered. 8556 Threshold *float64 `json:"threshold,omitempty"` 8557 // MetricTrigger - Trigger condition for metric query rule 8558 MetricTrigger *LogMetricTrigger `json:"metricTrigger,omitempty"` 8559} 8560 8561// VMInsightsOnboardingStatus VM Insights onboarding status for a resource. 8562type VMInsightsOnboardingStatus struct { 8563 autorest.Response `json:"-"` 8564 // VMInsightsOnboardingStatusProperties - Resource properties. 8565 *VMInsightsOnboardingStatusProperties `json:"properties,omitempty"` 8566 // ID - READ-ONLY; Azure resource Id 8567 ID *string `json:"id,omitempty"` 8568 // Name - READ-ONLY; Azure resource name 8569 Name *string `json:"name,omitempty"` 8570 // Type - READ-ONLY; Azure resource type 8571 Type *string `json:"type,omitempty"` 8572} 8573 8574// MarshalJSON is the custom marshaler for VMInsightsOnboardingStatus. 8575func (vios VMInsightsOnboardingStatus) MarshalJSON() ([]byte, error) { 8576 objectMap := make(map[string]interface{}) 8577 if vios.VMInsightsOnboardingStatusProperties != nil { 8578 objectMap["properties"] = vios.VMInsightsOnboardingStatusProperties 8579 } 8580 return json.Marshal(objectMap) 8581} 8582 8583// UnmarshalJSON is the custom unmarshaler for VMInsightsOnboardingStatus struct. 8584func (vios *VMInsightsOnboardingStatus) UnmarshalJSON(body []byte) error { 8585 var m map[string]*json.RawMessage 8586 err := json.Unmarshal(body, &m) 8587 if err != nil { 8588 return err 8589 } 8590 for k, v := range m { 8591 switch k { 8592 case "properties": 8593 if v != nil { 8594 var VMInsightsOnboardingStatusProperties VMInsightsOnboardingStatusProperties 8595 err = json.Unmarshal(*v, &VMInsightsOnboardingStatusProperties) 8596 if err != nil { 8597 return err 8598 } 8599 vios.VMInsightsOnboardingStatusProperties = &VMInsightsOnboardingStatusProperties 8600 } 8601 case "id": 8602 if v != nil { 8603 var ID string 8604 err = json.Unmarshal(*v, &ID) 8605 if err != nil { 8606 return err 8607 } 8608 vios.ID = &ID 8609 } 8610 case "name": 8611 if v != nil { 8612 var name string 8613 err = json.Unmarshal(*v, &name) 8614 if err != nil { 8615 return err 8616 } 8617 vios.Name = &name 8618 } 8619 case "type": 8620 if v != nil { 8621 var typeVar string 8622 err = json.Unmarshal(*v, &typeVar) 8623 if err != nil { 8624 return err 8625 } 8626 vios.Type = &typeVar 8627 } 8628 } 8629 } 8630 8631 return nil 8632} 8633 8634// VMInsightsOnboardingStatusProperties resource properties. 8635type VMInsightsOnboardingStatusProperties struct { 8636 // ResourceID - Azure Resource Manager identifier of the resource whose onboarding status is being represented. 8637 ResourceID *string `json:"resourceId,omitempty"` 8638 // OnboardingStatus - The onboarding status for the resource. Note that, a higher level scope, e.g., resource group or subscription, is considered onboarded if at least one resource under it is onboarded. Possible values include: 'OnboardingStatusOnboarded', 'OnboardingStatusNotOnboarded', 'OnboardingStatusUnknown' 8639 OnboardingStatus OnboardingStatus `json:"onboardingStatus,omitempty"` 8640 // DataStatus - The status of VM Insights data from the resource. When reported as `present` the data array will contain information about the data containers to which data for the specified resource is being routed. Possible values include: 'DataStatusPresent', 'DataStatusNotPresent' 8641 DataStatus DataStatus `json:"dataStatus,omitempty"` 8642 // Data - Containers that currently store VM Insights data for the specified resource. 8643 Data *[]DataContainer `json:"data,omitempty"` 8644} 8645 8646// VoiceReceiver a voice receiver. 8647type VoiceReceiver struct { 8648 // Name - The name of the voice receiver. Names must be unique across all receivers within an action group. 8649 Name *string `json:"name,omitempty"` 8650 // CountryCode - The country code of the voice receiver. 8651 CountryCode *string `json:"countryCode,omitempty"` 8652 // PhoneNumber - The phone number of the voice receiver. 8653 PhoneNumber *string `json:"phoneNumber,omitempty"` 8654} 8655 8656// WebhookNotification webhook notification of an autoscale event. 8657type WebhookNotification struct { 8658 // ServiceURI - the service address to receive the notification. 8659 ServiceURI *string `json:"serviceUri,omitempty"` 8660 // Properties - a property bag of settings. This value can be empty. 8661 Properties map[string]*string `json:"properties"` 8662} 8663 8664// MarshalJSON is the custom marshaler for WebhookNotification. 8665func (wn WebhookNotification) MarshalJSON() ([]byte, error) { 8666 objectMap := make(map[string]interface{}) 8667 if wn.ServiceURI != nil { 8668 objectMap["serviceUri"] = wn.ServiceURI 8669 } 8670 if wn.Properties != nil { 8671 objectMap["properties"] = wn.Properties 8672 } 8673 return json.Marshal(objectMap) 8674} 8675 8676// WebhookReceiver a webhook receiver. 8677type WebhookReceiver struct { 8678 // Name - The name of the webhook receiver. Names must be unique across all receivers within an action group. 8679 Name *string `json:"name,omitempty"` 8680 // ServiceURI - The URI where webhooks should be sent. 8681 ServiceURI *string `json:"serviceUri,omitempty"` 8682 // UseCommonAlertSchema - Indicates whether to use common alert schema. 8683 UseCommonAlertSchema *bool `json:"useCommonAlertSchema,omitempty"` 8684 // UseAadAuth - Indicates whether or not use AAD authentication. 8685 UseAadAuth *bool `json:"useAadAuth,omitempty"` 8686 // ObjectID - Indicates the webhook app object Id for aad auth. 8687 ObjectID *string `json:"objectId,omitempty"` 8688 // IdentifierURI - Indicates the identifier uri for aad auth. 8689 IdentifierURI *string `json:"identifierUri,omitempty"` 8690 // TenantID - Indicates the tenant id for aad auth. 8691 TenantID *string `json:"tenantId,omitempty"` 8692} 8693 8694// WebtestLocationAvailabilityCriteria specifies the metric alert rule criteria for a web test resource. 8695type WebtestLocationAvailabilityCriteria struct { 8696 // WebTestID - The Application Insights web test Id. 8697 WebTestID *string `json:"webTestId,omitempty"` 8698 // ComponentID - The Application Insights resource Id. 8699 ComponentID *string `json:"componentId,omitempty"` 8700 // FailedLocationCount - The number of failed locations. 8701 FailedLocationCount *float64 `json:"failedLocationCount,omitempty"` 8702 // AdditionalProperties - Unmatched properties from the message are deserialized this collection 8703 AdditionalProperties map[string]interface{} `json:""` 8704 // OdataType - Possible values include: 'OdataTypeBasicMetricAlertCriteriaOdataTypeMetricAlertCriteria', 'OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorSingleResourceMultipleMetricCriteria', 'OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria', 'OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorMultipleResourceMultipleMetricCriteria' 8705 OdataType OdataTypeBasicMetricAlertCriteria `json:"odata.type,omitempty"` 8706} 8707 8708// MarshalJSON is the custom marshaler for WebtestLocationAvailabilityCriteria. 8709func (wlac WebtestLocationAvailabilityCriteria) MarshalJSON() ([]byte, error) { 8710 wlac.OdataType = OdataTypeBasicMetricAlertCriteriaOdataTypeMicrosoftAzureMonitorWebtestLocationAvailabilityCriteria 8711 objectMap := make(map[string]interface{}) 8712 if wlac.WebTestID != nil { 8713 objectMap["webTestId"] = wlac.WebTestID 8714 } 8715 if wlac.ComponentID != nil { 8716 objectMap["componentId"] = wlac.ComponentID 8717 } 8718 if wlac.FailedLocationCount != nil { 8719 objectMap["failedLocationCount"] = wlac.FailedLocationCount 8720 } 8721 if wlac.OdataType != "" { 8722 objectMap["odata.type"] = wlac.OdataType 8723 } 8724 for k, v := range wlac.AdditionalProperties { 8725 objectMap[k] = v 8726 } 8727 return json.Marshal(objectMap) 8728} 8729 8730// AsMetricAlertSingleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for WebtestLocationAvailabilityCriteria. 8731func (wlac WebtestLocationAvailabilityCriteria) AsMetricAlertSingleResourceMultipleMetricCriteria() (*MetricAlertSingleResourceMultipleMetricCriteria, bool) { 8732 return nil, false 8733} 8734 8735// AsWebtestLocationAvailabilityCriteria is the BasicMetricAlertCriteria implementation for WebtestLocationAvailabilityCriteria. 8736func (wlac WebtestLocationAvailabilityCriteria) AsWebtestLocationAvailabilityCriteria() (*WebtestLocationAvailabilityCriteria, bool) { 8737 return &wlac, true 8738} 8739 8740// AsMetricAlertMultipleResourceMultipleMetricCriteria is the BasicMetricAlertCriteria implementation for WebtestLocationAvailabilityCriteria. 8741func (wlac WebtestLocationAvailabilityCriteria) AsMetricAlertMultipleResourceMultipleMetricCriteria() (*MetricAlertMultipleResourceMultipleMetricCriteria, bool) { 8742 return nil, false 8743} 8744 8745// AsMetricAlertCriteria is the BasicMetricAlertCriteria implementation for WebtestLocationAvailabilityCriteria. 8746func (wlac WebtestLocationAvailabilityCriteria) AsMetricAlertCriteria() (*MetricAlertCriteria, bool) { 8747 return nil, false 8748} 8749 8750// AsBasicMetricAlertCriteria is the BasicMetricAlertCriteria implementation for WebtestLocationAvailabilityCriteria. 8751func (wlac WebtestLocationAvailabilityCriteria) AsBasicMetricAlertCriteria() (BasicMetricAlertCriteria, bool) { 8752 return &wlac, true 8753} 8754 8755// UnmarshalJSON is the custom unmarshaler for WebtestLocationAvailabilityCriteria struct. 8756func (wlac *WebtestLocationAvailabilityCriteria) UnmarshalJSON(body []byte) error { 8757 var m map[string]*json.RawMessage 8758 err := json.Unmarshal(body, &m) 8759 if err != nil { 8760 return err 8761 } 8762 for k, v := range m { 8763 switch k { 8764 case "webTestId": 8765 if v != nil { 8766 var webTestID string 8767 err = json.Unmarshal(*v, &webTestID) 8768 if err != nil { 8769 return err 8770 } 8771 wlac.WebTestID = &webTestID 8772 } 8773 case "componentId": 8774 if v != nil { 8775 var componentID string 8776 err = json.Unmarshal(*v, &componentID) 8777 if err != nil { 8778 return err 8779 } 8780 wlac.ComponentID = &componentID 8781 } 8782 case "failedLocationCount": 8783 if v != nil { 8784 var failedLocationCount float64 8785 err = json.Unmarshal(*v, &failedLocationCount) 8786 if err != nil { 8787 return err 8788 } 8789 wlac.FailedLocationCount = &failedLocationCount 8790 } 8791 default: 8792 if v != nil { 8793 var additionalProperties interface{} 8794 err = json.Unmarshal(*v, &additionalProperties) 8795 if err != nil { 8796 return err 8797 } 8798 if wlac.AdditionalProperties == nil { 8799 wlac.AdditionalProperties = make(map[string]interface{}) 8800 } 8801 wlac.AdditionalProperties[k] = additionalProperties 8802 } 8803 case "odata.type": 8804 if v != nil { 8805 var odataType OdataTypeBasicMetricAlertCriteria 8806 err = json.Unmarshal(*v, &odataType) 8807 if err != nil { 8808 return err 8809 } 8810 wlac.OdataType = odataType 8811 } 8812 } 8813 } 8814 8815 return nil 8816} 8817 8818// WindowsEventLogDataSource definition of which Windows Event Log events will be collected and how they 8819// will be collected. 8820// Only collected from Windows machines. 8821type WindowsEventLogDataSource struct { 8822 // Streams - List of streams that this data source will be sent to. 8823 // A stream indicates what schema will be used for this data and usually what table in Log Analytics the data will be sent to. 8824 Streams *[]KnownWindowsEventLogDataSourceStreams `json:"streams,omitempty"` 8825 // XPathQueries - A list of Windows Event Log queries in XPATH format. 8826 XPathQueries *[]string `json:"xPathQueries,omitempty"` 8827 // Name - A friendly name for the data source. 8828 // This name should be unique across all data sources (regardless of type) within the data collection rule. 8829 Name *string `json:"name,omitempty"` 8830} 8831 8832// WorkspaceInfo information about a Log Analytics Workspace. 8833type WorkspaceInfo struct { 8834 // ID - Azure Resource Manager identifier of the Log Analytics Workspace. 8835 ID *string `json:"id,omitempty"` 8836 // Location - Location of the Log Analytics workspace. 8837 Location *string `json:"location,omitempty"` 8838 // WorkspaceInfoProperties - Resource properties. 8839 *WorkspaceInfoProperties `json:"properties,omitempty"` 8840} 8841 8842// MarshalJSON is the custom marshaler for WorkspaceInfo. 8843func (wi WorkspaceInfo) MarshalJSON() ([]byte, error) { 8844 objectMap := make(map[string]interface{}) 8845 if wi.ID != nil { 8846 objectMap["id"] = wi.ID 8847 } 8848 if wi.Location != nil { 8849 objectMap["location"] = wi.Location 8850 } 8851 if wi.WorkspaceInfoProperties != nil { 8852 objectMap["properties"] = wi.WorkspaceInfoProperties 8853 } 8854 return json.Marshal(objectMap) 8855} 8856 8857// UnmarshalJSON is the custom unmarshaler for WorkspaceInfo struct. 8858func (wi *WorkspaceInfo) UnmarshalJSON(body []byte) error { 8859 var m map[string]*json.RawMessage 8860 err := json.Unmarshal(body, &m) 8861 if err != nil { 8862 return err 8863 } 8864 for k, v := range m { 8865 switch k { 8866 case "id": 8867 if v != nil { 8868 var ID string 8869 err = json.Unmarshal(*v, &ID) 8870 if err != nil { 8871 return err 8872 } 8873 wi.ID = &ID 8874 } 8875 case "location": 8876 if v != nil { 8877 var location string 8878 err = json.Unmarshal(*v, &location) 8879 if err != nil { 8880 return err 8881 } 8882 wi.Location = &location 8883 } 8884 case "properties": 8885 if v != nil { 8886 var workspaceInfoProperties WorkspaceInfoProperties 8887 err = json.Unmarshal(*v, &workspaceInfoProperties) 8888 if err != nil { 8889 return err 8890 } 8891 wi.WorkspaceInfoProperties = &workspaceInfoProperties 8892 } 8893 } 8894 } 8895 8896 return nil 8897} 8898 8899// WorkspaceInfoProperties resource properties. 8900type WorkspaceInfoProperties struct { 8901 // CustomerID - Log Analytics workspace identifier. 8902 CustomerID *string `json:"customerId,omitempty"` 8903} 8904