1package security 2 3// Copyright (c) Microsoft and contributors. All rights reserved. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Code generated by Microsoft (R) AutoRest Code Generator. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "context" 22 "encoding/json" 23 "github.com/Azure/go-autorest/autorest" 24 "github.com/Azure/go-autorest/autorest/azure" 25 "github.com/Azure/go-autorest/autorest/date" 26 "github.com/Azure/go-autorest/autorest/to" 27 "github.com/Azure/go-autorest/tracing" 28 "github.com/satori/go.uuid" 29 "net/http" 30) 31 32// The package's fully qualified name. 33const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security" 34 35// AadConnectivityState enumerates the values for aad connectivity state. 36type AadConnectivityState string 37 38const ( 39 // Connected ... 40 Connected AadConnectivityState = "Connected" 41 // Discovered ... 42 Discovered AadConnectivityState = "Discovered" 43 // NotLicensed ... 44 NotLicensed AadConnectivityState = "NotLicensed" 45) 46 47// PossibleAadConnectivityStateValues returns an array of possible values for the AadConnectivityState const type. 48func PossibleAadConnectivityStateValues() []AadConnectivityState { 49 return []AadConnectivityState{Connected, Discovered, NotLicensed} 50} 51 52// Action enumerates the values for action. 53type Action string 54 55const ( 56 // Add ... 57 Add Action = "Add" 58 // Recommended ... 59 Recommended Action = "Recommended" 60 // Remove ... 61 Remove Action = "Remove" 62) 63 64// PossibleActionValues returns an array of possible values for the Action const type. 65func PossibleActionValues() []Action { 66 return []Action{Add, Recommended, Remove} 67} 68 69// AlertNotifications enumerates the values for alert notifications. 70type AlertNotifications string 71 72const ( 73 // Off Don't get notifications on new alerts 74 Off AlertNotifications = "Off" 75 // On Get notifications on new alerts 76 On AlertNotifications = "On" 77) 78 79// PossibleAlertNotificationsValues returns an array of possible values for the AlertNotifications const type. 80func PossibleAlertNotificationsValues() []AlertNotifications { 81 return []AlertNotifications{Off, On} 82} 83 84// AlertsToAdmins enumerates the values for alerts to admins. 85type AlertsToAdmins string 86 87const ( 88 // AlertsToAdminsOff Don't send notification on new alerts to the subscription's admins 89 AlertsToAdminsOff AlertsToAdmins = "Off" 90 // AlertsToAdminsOn Send notification on new alerts to the subscription's admins 91 AlertsToAdminsOn AlertsToAdmins = "On" 92) 93 94// PossibleAlertsToAdminsValues returns an array of possible values for the AlertsToAdmins const type. 95func PossibleAlertsToAdminsValues() []AlertsToAdmins { 96 return []AlertsToAdmins{AlertsToAdminsOff, AlertsToAdminsOn} 97} 98 99// AssessedResourceType enumerates the values for assessed resource type. 100type AssessedResourceType string 101 102const ( 103 // AssessedResourceTypeAdditionalData ... 104 AssessedResourceTypeAdditionalData AssessedResourceType = "AdditionalData" 105 // AssessedResourceTypeContainerRegistryVulnerability ... 106 AssessedResourceTypeContainerRegistryVulnerability AssessedResourceType = "ContainerRegistryVulnerability" 107 // AssessedResourceTypeServerVulnerabilityAssessment ... 108 AssessedResourceTypeServerVulnerabilityAssessment AssessedResourceType = "ServerVulnerabilityAssessment" 109 // AssessedResourceTypeSQLServerVulnerability ... 110 AssessedResourceTypeSQLServerVulnerability AssessedResourceType = "SqlServerVulnerability" 111) 112 113// PossibleAssessedResourceTypeValues returns an array of possible values for the AssessedResourceType const type. 114func PossibleAssessedResourceTypeValues() []AssessedResourceType { 115 return []AssessedResourceType{AssessedResourceTypeAdditionalData, AssessedResourceTypeContainerRegistryVulnerability, AssessedResourceTypeServerVulnerabilityAssessment, AssessedResourceTypeSQLServerVulnerability} 116} 117 118// AutoProvision enumerates the values for auto provision. 119type AutoProvision string 120 121const ( 122 // AutoProvisionOff Do not install security agent on the VMs automatically 123 AutoProvisionOff AutoProvision = "Off" 124 // AutoProvisionOn Install missing security agent on VMs automatically 125 AutoProvisionOn AutoProvision = "On" 126) 127 128// PossibleAutoProvisionValues returns an array of possible values for the AutoProvision const type. 129func PossibleAutoProvisionValues() []AutoProvision { 130 return []AutoProvision{AutoProvisionOff, AutoProvisionOn} 131} 132 133// ConfigurationStatus enumerates the values for configuration status. 134type ConfigurationStatus string 135 136const ( 137 // Configured ... 138 Configured ConfigurationStatus = "Configured" 139 // Failed ... 140 Failed ConfigurationStatus = "Failed" 141 // InProgress ... 142 InProgress ConfigurationStatus = "InProgress" 143 // NoStatus ... 144 NoStatus ConfigurationStatus = "NoStatus" 145 // NotConfigured ... 146 NotConfigured ConfigurationStatus = "NotConfigured" 147) 148 149// PossibleConfigurationStatusValues returns an array of possible values for the ConfigurationStatus const type. 150func PossibleConfigurationStatusValues() []ConfigurationStatus { 151 return []ConfigurationStatus{Configured, Failed, InProgress, NoStatus, NotConfigured} 152} 153 154// ConfigurationStatus1 enumerates the values for configuration status 1. 155type ConfigurationStatus1 string 156 157const ( 158 // ConfigurationStatus1Configured ... 159 ConfigurationStatus1Configured ConfigurationStatus1 = "Configured" 160 // ConfigurationStatus1Failed ... 161 ConfigurationStatus1Failed ConfigurationStatus1 = "Failed" 162 // ConfigurationStatus1InProgress ... 163 ConfigurationStatus1InProgress ConfigurationStatus1 = "InProgress" 164 // ConfigurationStatus1NoStatus ... 165 ConfigurationStatus1NoStatus ConfigurationStatus1 = "NoStatus" 166 // ConfigurationStatus1NotConfigured ... 167 ConfigurationStatus1NotConfigured ConfigurationStatus1 = "NotConfigured" 168) 169 170// PossibleConfigurationStatus1Values returns an array of possible values for the ConfigurationStatus1 const type. 171func PossibleConfigurationStatus1Values() []ConfigurationStatus1 { 172 return []ConfigurationStatus1{ConfigurationStatus1Configured, ConfigurationStatus1Failed, ConfigurationStatus1InProgress, ConfigurationStatus1NoStatus, ConfigurationStatus1NotConfigured} 173} 174 175// ConfigurationStatus2 enumerates the values for configuration status 2. 176type ConfigurationStatus2 string 177 178const ( 179 // ConfigurationStatus2Configured ... 180 ConfigurationStatus2Configured ConfigurationStatus2 = "Configured" 181 // ConfigurationStatus2Failed ... 182 ConfigurationStatus2Failed ConfigurationStatus2 = "Failed" 183 // ConfigurationStatus2InProgress ... 184 ConfigurationStatus2InProgress ConfigurationStatus2 = "InProgress" 185 // ConfigurationStatus2NoStatus ... 186 ConfigurationStatus2NoStatus ConfigurationStatus2 = "NoStatus" 187 // ConfigurationStatus2NotConfigured ... 188 ConfigurationStatus2NotConfigured ConfigurationStatus2 = "NotConfigured" 189) 190 191// PossibleConfigurationStatus2Values returns an array of possible values for the ConfigurationStatus2 const type. 192func PossibleConfigurationStatus2Values() []ConfigurationStatus2 { 193 return []ConfigurationStatus2{ConfigurationStatus2Configured, ConfigurationStatus2Failed, ConfigurationStatus2InProgress, ConfigurationStatus2NoStatus, ConfigurationStatus2NotConfigured} 194} 195 196// ConnectionType enumerates the values for connection type. 197type ConnectionType string 198 199const ( 200 // External ... 201 External ConnectionType = "External" 202 // Internal ... 203 Internal ConnectionType = "Internal" 204) 205 206// PossibleConnectionTypeValues returns an array of possible values for the ConnectionType const type. 207func PossibleConnectionTypeValues() []ConnectionType { 208 return []ConnectionType{External, Internal} 209} 210 211// DataSource enumerates the values for data source. 212type DataSource string 213 214const ( 215 // TwinData Devices twin data 216 TwinData DataSource = "TwinData" 217) 218 219// PossibleDataSourceValues returns an array of possible values for the DataSource const type. 220func PossibleDataSourceValues() []DataSource { 221 return []DataSource{TwinData} 222} 223 224// Direction enumerates the values for direction. 225type Direction string 226 227const ( 228 // Inbound ... 229 Inbound Direction = "Inbound" 230 // Outbound ... 231 Outbound Direction = "Outbound" 232) 233 234// PossibleDirectionValues returns an array of possible values for the Direction const type. 235func PossibleDirectionValues() []Direction { 236 return []Direction{Inbound, Outbound} 237} 238 239// EnforcementMode enumerates the values for enforcement mode. 240type EnforcementMode string 241 242const ( 243 // Audit ... 244 Audit EnforcementMode = "Audit" 245 // Enforce ... 246 Enforce EnforcementMode = "Enforce" 247 // None ... 248 None EnforcementMode = "None" 249) 250 251// PossibleEnforcementModeValues returns an array of possible values for the EnforcementMode const type. 252func PossibleEnforcementModeValues() []EnforcementMode { 253 return []EnforcementMode{Audit, Enforce, None} 254} 255 256// EnforcementMode1 enumerates the values for enforcement mode 1. 257type EnforcementMode1 string 258 259const ( 260 // EnforcementMode1Audit ... 261 EnforcementMode1Audit EnforcementMode1 = "Audit" 262 // EnforcementMode1Enforce ... 263 EnforcementMode1Enforce EnforcementMode1 = "Enforce" 264 // EnforcementMode1None ... 265 EnforcementMode1None EnforcementMode1 = "None" 266) 267 268// PossibleEnforcementMode1Values returns an array of possible values for the EnforcementMode1 const type. 269func PossibleEnforcementMode1Values() []EnforcementMode1 { 270 return []EnforcementMode1{EnforcementMode1Audit, EnforcementMode1Enforce, EnforcementMode1None} 271} 272 273// Exe enumerates the values for exe. 274type Exe string 275 276const ( 277 // ExeAudit ... 278 ExeAudit Exe = "Audit" 279 // ExeEnforce ... 280 ExeEnforce Exe = "Enforce" 281 // ExeNone ... 282 ExeNone Exe = "None" 283) 284 285// PossibleExeValues returns an array of possible values for the Exe const type. 286func PossibleExeValues() []Exe { 287 return []Exe{ExeAudit, ExeEnforce, ExeNone} 288} 289 290// Executable enumerates the values for executable. 291type Executable string 292 293const ( 294 // ExecutableAudit ... 295 ExecutableAudit Executable = "Audit" 296 // ExecutableEnforce ... 297 ExecutableEnforce Executable = "Enforce" 298 // ExecutableNone ... 299 ExecutableNone Executable = "None" 300) 301 302// PossibleExecutableValues returns an array of possible values for the Executable const type. 303func PossibleExecutableValues() []Executable { 304 return []Executable{ExecutableAudit, ExecutableEnforce, ExecutableNone} 305} 306 307// ExportData enumerates the values for export data. 308type ExportData string 309 310const ( 311 // RawEvents Agent raw events 312 RawEvents ExportData = "RawEvents" 313) 314 315// PossibleExportDataValues returns an array of possible values for the ExportData const type. 316func PossibleExportDataValues() []ExportData { 317 return []ExportData{RawEvents} 318} 319 320// ExternalSecuritySolutionKind enumerates the values for external security solution kind. 321type ExternalSecuritySolutionKind string 322 323const ( 324 // AAD ... 325 AAD ExternalSecuritySolutionKind = "AAD" 326 // ATA ... 327 ATA ExternalSecuritySolutionKind = "ATA" 328 // CEF ... 329 CEF ExternalSecuritySolutionKind = "CEF" 330) 331 332// PossibleExternalSecuritySolutionKindValues returns an array of possible values for the ExternalSecuritySolutionKind const type. 333func PossibleExternalSecuritySolutionKindValues() []ExternalSecuritySolutionKind { 334 return []ExternalSecuritySolutionKind{AAD, ATA, CEF} 335} 336 337// Family enumerates the values for family. 338type Family string 339 340const ( 341 // Ngfw ... 342 Ngfw Family = "Ngfw" 343 // SaasWaf ... 344 SaasWaf Family = "SaasWaf" 345 // Va ... 346 Va Family = "Va" 347 // Waf ... 348 Waf Family = "Waf" 349) 350 351// PossibleFamilyValues returns an array of possible values for the Family const type. 352func PossibleFamilyValues() []Family { 353 return []Family{Ngfw, SaasWaf, Va, Waf} 354} 355 356// FileType enumerates the values for file type. 357type FileType string 358 359const ( 360 // FileTypeDll ... 361 FileTypeDll FileType = "Dll" 362 // FileTypeExe ... 363 FileTypeExe FileType = "Exe" 364 // FileTypeExecutable ... 365 FileTypeExecutable FileType = "Executable" 366 // FileTypeMsi ... 367 FileTypeMsi FileType = "Msi" 368 // FileTypeScript ... 369 FileTypeScript FileType = "Script" 370 // FileTypeUnknown ... 371 FileTypeUnknown FileType = "Unknown" 372) 373 374// PossibleFileTypeValues returns an array of possible values for the FileType const type. 375func PossibleFileTypeValues() []FileType { 376 return []FileType{FileTypeDll, FileTypeExe, FileTypeExecutable, FileTypeMsi, FileTypeScript, FileTypeUnknown} 377} 378 379// Issue enumerates the values for issue. 380type Issue string 381 382const ( 383 // ExecutableViolationsAudited ... 384 ExecutableViolationsAudited Issue = "ExecutableViolationsAudited" 385 // MsiAndScriptViolationsAudited ... 386 MsiAndScriptViolationsAudited Issue = "MsiAndScriptViolationsAudited" 387 // MsiAndScriptViolationsBlocked ... 388 MsiAndScriptViolationsBlocked Issue = "MsiAndScriptViolationsBlocked" 389 // RulesViolatedManually ... 390 RulesViolatedManually Issue = "RulesViolatedManually" 391 // ViolationsAudited ... 392 ViolationsAudited Issue = "ViolationsAudited" 393 // ViolationsBlocked ... 394 ViolationsBlocked Issue = "ViolationsBlocked" 395) 396 397// PossibleIssueValues returns an array of possible values for the Issue const type. 398func PossibleIssueValues() []Issue { 399 return []Issue{ExecutableViolationsAudited, MsiAndScriptViolationsAudited, MsiAndScriptViolationsBlocked, RulesViolatedManually, ViolationsAudited, ViolationsBlocked} 400} 401 402// KindEnum enumerates the values for kind enum. 403type KindEnum string 404 405const ( 406 // KindAAD ... 407 KindAAD KindEnum = "AAD" 408 // KindATA ... 409 KindATA KindEnum = "ATA" 410 // KindCEF ... 411 KindCEF KindEnum = "CEF" 412 // KindExternalSecuritySolution ... 413 KindExternalSecuritySolution KindEnum = "ExternalSecuritySolution" 414) 415 416// PossibleKindEnumValues returns an array of possible values for the KindEnum const type. 417func PossibleKindEnumValues() []KindEnum { 418 return []KindEnum{KindAAD, KindATA, KindCEF, KindExternalSecuritySolution} 419} 420 421// Msi enumerates the values for msi. 422type Msi string 423 424const ( 425 // MsiAudit ... 426 MsiAudit Msi = "Audit" 427 // MsiEnforce ... 428 MsiEnforce Msi = "Enforce" 429 // MsiNone ... 430 MsiNone Msi = "None" 431) 432 433// PossibleMsiValues returns an array of possible values for the Msi const type. 434func PossibleMsiValues() []Msi { 435 return []Msi{MsiAudit, MsiEnforce, MsiNone} 436} 437 438// PricingTier enumerates the values for pricing tier. 439type PricingTier string 440 441const ( 442 // Free Get free Azure security center experience with basic security features 443 Free PricingTier = "Free" 444 // Standard Get the standard Azure security center experience with advanced security features 445 Standard PricingTier = "Standard" 446) 447 448// PossiblePricingTierValues returns an array of possible values for the PricingTier const type. 449func PossiblePricingTierValues() []PricingTier { 450 return []PricingTier{Free, Standard} 451} 452 453// Protocol enumerates the values for protocol. 454type Protocol string 455 456const ( 457 // All ... 458 All Protocol = "*" 459 // TCP ... 460 TCP Protocol = "TCP" 461 // UDP ... 462 UDP Protocol = "UDP" 463) 464 465// PossibleProtocolValues returns an array of possible values for the Protocol const type. 466func PossibleProtocolValues() []Protocol { 467 return []Protocol{All, TCP, UDP} 468} 469 470// RecommendationAction enumerates the values for recommendation action. 471type RecommendationAction string 472 473const ( 474 // RecommendationActionAdd ... 475 RecommendationActionAdd RecommendationAction = "Add" 476 // RecommendationActionRecommended ... 477 RecommendationActionRecommended RecommendationAction = "Recommended" 478 // RecommendationActionRemove ... 479 RecommendationActionRemove RecommendationAction = "Remove" 480) 481 482// PossibleRecommendationActionValues returns an array of possible values for the RecommendationAction const type. 483func PossibleRecommendationActionValues() []RecommendationAction { 484 return []RecommendationAction{RecommendationActionAdd, RecommendationActionRecommended, RecommendationActionRemove} 485} 486 487// RecommendationAction1 enumerates the values for recommendation action 1. 488type RecommendationAction1 string 489 490const ( 491 // RecommendationAction1Add ... 492 RecommendationAction1Add RecommendationAction1 = "Add" 493 // RecommendationAction1Recommended ... 494 RecommendationAction1Recommended RecommendationAction1 = "Recommended" 495 // RecommendationAction1Remove ... 496 RecommendationAction1Remove RecommendationAction1 = "Remove" 497) 498 499// PossibleRecommendationAction1Values returns an array of possible values for the RecommendationAction1 const type. 500func PossibleRecommendationAction1Values() []RecommendationAction1 { 501 return []RecommendationAction1{RecommendationAction1Add, RecommendationAction1Recommended, RecommendationAction1Remove} 502} 503 504// RecommendationConfigStatus enumerates the values for recommendation config status. 505type RecommendationConfigStatus string 506 507const ( 508 // Disabled ... 509 Disabled RecommendationConfigStatus = "Disabled" 510 // Enabled ... 511 Enabled RecommendationConfigStatus = "Enabled" 512) 513 514// PossibleRecommendationConfigStatusValues returns an array of possible values for the RecommendationConfigStatus const type. 515func PossibleRecommendationConfigStatusValues() []RecommendationConfigStatus { 516 return []RecommendationConfigStatus{Disabled, Enabled} 517} 518 519// RecommendationStatus enumerates the values for recommendation status. 520type RecommendationStatus string 521 522const ( 523 // RecommendationStatusNoStatus ... 524 RecommendationStatusNoStatus RecommendationStatus = "NoStatus" 525 // RecommendationStatusNotAvailable ... 526 RecommendationStatusNotAvailable RecommendationStatus = "NotAvailable" 527 // RecommendationStatusNotRecommended ... 528 RecommendationStatusNotRecommended RecommendationStatus = "NotRecommended" 529 // RecommendationStatusRecommended ... 530 RecommendationStatusRecommended RecommendationStatus = "Recommended" 531) 532 533// PossibleRecommendationStatusValues returns an array of possible values for the RecommendationStatus const type. 534func PossibleRecommendationStatusValues() []RecommendationStatus { 535 return []RecommendationStatus{RecommendationStatusNoStatus, RecommendationStatusNotAvailable, RecommendationStatusNotRecommended, RecommendationStatusRecommended} 536} 537 538// RecommendationType enumerates the values for recommendation type. 539type RecommendationType string 540 541const ( 542 // IoTACRAuthentication Authentication schema used for pull an edge module from an ACR repository does not 543 // use Service Principal Authentication. 544 IoTACRAuthentication RecommendationType = "IoT_ACRAuthentication" 545 // IoTAgentSendsUnutilizedMessages IoT agent message size capacity is currently underutilized, causing an 546 // increase in the number of sent messages. Adjust message intervals for better utilization. 547 IoTAgentSendsUnutilizedMessages RecommendationType = "IoT_AgentSendsUnutilizedMessages" 548 // IoTBaseline Identified security related system configuration issues. 549 IoTBaseline RecommendationType = "IoT_Baseline" 550 // IoTEdgeHubMemOptimize You can optimize Edge Hub memory usage by turning off protocol heads for any 551 // protocols not used by Edge modules in your solution. 552 IoTEdgeHubMemOptimize RecommendationType = "IoT_EdgeHubMemOptimize" 553 // IoTEdgeLoggingOptions Logging is disabled for this edge module. 554 IoTEdgeLoggingOptions RecommendationType = "IoT_EdgeLoggingOptions" 555 // IoTInconsistentModuleSettings A minority within a device security group has inconsistent Edge Module 556 // settings with the rest of their group. 557 IoTInconsistentModuleSettings RecommendationType = "IoT_InconsistentModuleSettings" 558 // IoTInstallAgent Install the Azure Security of Things Agent. 559 IoTInstallAgent RecommendationType = "IoT_InstallAgent" 560 // IoTIPFilterDenyAll IP Filter Configuration should have rules defined for allowed traffic and should deny 561 // all other traffic by default. 562 IoTIPFilterDenyAll RecommendationType = "IoT_IPFilter_DenyAll" 563 // IoTIPFilterPermissiveRule An Allow IP Filter rules source IP range is too large. Overly permissive rules 564 // might expose your IoT hub to malicious intenders. 565 IoTIPFilterPermissiveRule RecommendationType = "IoT_IPFilter_PermissiveRule" 566 // IoTOpenPorts A listening endpoint was found on the device. 567 IoTOpenPorts RecommendationType = "IoT_OpenPorts" 568 // IoTPermissiveFirewallPolicy An Allowed firewall policy was found (INPUT/OUTPUT). The policy should Deny 569 // all traffic by default and define rules to allow necessary communication to/from the device. 570 IoTPermissiveFirewallPolicy RecommendationType = "IoT_PermissiveFirewallPolicy" 571 // IoTPermissiveInputFirewallRules A rule in the firewall has been found that contains a permissive pattern 572 // for a wide range of IP addresses or Ports. 573 IoTPermissiveInputFirewallRules RecommendationType = "IoT_PermissiveInputFirewallRules" 574 // IoTPermissiveOutputFirewallRules A rule in the firewall has been found that contains a permissive 575 // pattern for a wide range of IP addresses or Ports. 576 IoTPermissiveOutputFirewallRules RecommendationType = "IoT_PermissiveOutputFirewallRules" 577 // IoTPrivilegedDockerOptions Edge module is configured to run in privileged mode, with extensive Linux 578 // capabilities or with host-level network access (send/receive data to host machine). 579 IoTPrivilegedDockerOptions RecommendationType = "IoT_PrivilegedDockerOptions" 580 // IoTSharedCredentials Same authentication credentials to the IoT Hub used by multiple devices. This could 581 // indicate an illegitimate device impersonating a legitimate device. It also exposes the risk of device 582 // impersonation by an attacker. 583 IoTSharedCredentials RecommendationType = "IoT_SharedCredentials" 584 // IoTVulnerableTLSCipherSuite Insecure TLS configurations detected. Immediate upgrade recommended. 585 IoTVulnerableTLSCipherSuite RecommendationType = "IoT_VulnerableTLSCipherSuite" 586) 587 588// PossibleRecommendationTypeValues returns an array of possible values for the RecommendationType const type. 589func PossibleRecommendationTypeValues() []RecommendationType { 590 return []RecommendationType{IoTACRAuthentication, IoTAgentSendsUnutilizedMessages, IoTBaseline, IoTEdgeHubMemOptimize, IoTEdgeLoggingOptions, IoTInconsistentModuleSettings, IoTInstallAgent, IoTIPFilterDenyAll, IoTIPFilterPermissiveRule, IoTOpenPorts, IoTPermissiveFirewallPolicy, IoTPermissiveInputFirewallRules, IoTPermissiveOutputFirewallRules, IoTPrivilegedDockerOptions, IoTSharedCredentials, IoTVulnerableTLSCipherSuite} 591} 592 593// ReportedSeverity enumerates the values for reported severity. 594type ReportedSeverity string 595 596const ( 597 // High ... 598 High ReportedSeverity = "High" 599 // Informational ... 600 Informational ReportedSeverity = "Informational" 601 // Low ... 602 Low ReportedSeverity = "Low" 603 // Medium ... 604 Medium ReportedSeverity = "Medium" 605) 606 607// PossibleReportedSeverityValues returns an array of possible values for the ReportedSeverity const type. 608func PossibleReportedSeverityValues() []ReportedSeverity { 609 return []ReportedSeverity{High, Informational, Low, Medium} 610} 611 612// Script enumerates the values for script. 613type Script string 614 615const ( 616 // ScriptAudit ... 617 ScriptAudit Script = "Audit" 618 // ScriptEnforce ... 619 ScriptEnforce Script = "Enforce" 620 // ScriptNone ... 621 ScriptNone Script = "None" 622) 623 624// PossibleScriptValues returns an array of possible values for the Script const type. 625func PossibleScriptValues() []Script { 626 return []Script{ScriptAudit, ScriptEnforce, ScriptNone} 627} 628 629// SettingKind enumerates the values for setting kind. 630type SettingKind string 631 632const ( 633 // SettingKindAlertSuppressionSetting ... 634 SettingKindAlertSuppressionSetting SettingKind = "AlertSuppressionSetting" 635 // SettingKindDataExportSetting ... 636 SettingKindDataExportSetting SettingKind = "DataExportSetting" 637) 638 639// PossibleSettingKindValues returns an array of possible values for the SettingKind const type. 640func PossibleSettingKindValues() []SettingKind { 641 return []SettingKind{SettingKindAlertSuppressionSetting, SettingKindDataExportSetting} 642} 643 644// Severity enumerates the values for severity. 645type Severity string 646 647const ( 648 // SeverityHigh ... 649 SeverityHigh Severity = "High" 650 // SeverityLow ... 651 SeverityLow Severity = "Low" 652 // SeverityMedium ... 653 SeverityMedium Severity = "Medium" 654) 655 656// PossibleSeverityValues returns an array of possible values for the Severity const type. 657func PossibleSeverityValues() []Severity { 658 return []Severity{SeverityHigh, SeverityLow, SeverityMedium} 659} 660 661// SolutionStatus enumerates the values for solution status. 662type SolutionStatus string 663 664const ( 665 // SolutionStatusDisabled ... 666 SolutionStatusDisabled SolutionStatus = "Disabled" 667 // SolutionStatusEnabled ... 668 SolutionStatusEnabled SolutionStatus = "Enabled" 669) 670 671// PossibleSolutionStatusValues returns an array of possible values for the SolutionStatus const type. 672func PossibleSolutionStatusValues() []SolutionStatus { 673 return []SolutionStatus{SolutionStatusDisabled, SolutionStatusEnabled} 674} 675 676// Source enumerates the values for source. 677type Source string 678 679const ( 680 // SourceAws ... 681 SourceAws Source = "Aws" 682 // SourceAzure ... 683 SourceAzure Source = "Azure" 684 // SourceResourceDetails ... 685 SourceResourceDetails Source = "ResourceDetails" 686) 687 688// PossibleSourceValues returns an array of possible values for the Source const type. 689func PossibleSourceValues() []Source { 690 return []Source{SourceAws, SourceAzure, SourceResourceDetails} 691} 692 693// SourceSystem enumerates the values for source system. 694type SourceSystem string 695 696const ( 697 // SourceSystemAzureAppLocker ... 698 SourceSystemAzureAppLocker SourceSystem = "Azure_AppLocker" 699 // SourceSystemAzureAuditD ... 700 SourceSystemAzureAuditD SourceSystem = "Azure_AuditD" 701 // SourceSystemNonAzureAppLocker ... 702 SourceSystemNonAzureAppLocker SourceSystem = "NonAzure_AppLocker" 703 // SourceSystemNonAzureAuditD ... 704 SourceSystemNonAzureAuditD SourceSystem = "NonAzure_AuditD" 705 // SourceSystemNone ... 706 SourceSystemNone SourceSystem = "None" 707) 708 709// PossibleSourceSystemValues returns an array of possible values for the SourceSystem const type. 710func PossibleSourceSystemValues() []SourceSystem { 711 return []SourceSystem{SourceSystemAzureAppLocker, SourceSystemAzureAuditD, SourceSystemNonAzureAppLocker, SourceSystemNonAzureAuditD, SourceSystemNone} 712} 713 714// State enumerates the values for state. 715type State string 716 717const ( 718 // StateFailed At least one supported regulatory compliance control in the given standard has a state of 719 // failed 720 StateFailed State = "Failed" 721 // StatePassed All supported regulatory compliance controls in the given standard have a passed state 722 StatePassed State = "Passed" 723 // StateSkipped All supported regulatory compliance controls in the given standard have a state of skipped 724 StateSkipped State = "Skipped" 725 // StateUnsupported No supported regulatory compliance data for the given standard 726 StateUnsupported State = "Unsupported" 727) 728 729// PossibleStateValues returns an array of possible values for the State const type. 730func PossibleStateValues() []State { 731 return []State{StateFailed, StatePassed, StateSkipped, StateUnsupported} 732} 733 734// Status enumerates the values for status. 735type Status string 736 737const ( 738 // Initiated ... 739 Initiated Status = "Initiated" 740 // Revoked ... 741 Revoked Status = "Revoked" 742) 743 744// PossibleStatusValues returns an array of possible values for the Status const type. 745func PossibleStatusValues() []Status { 746 return []Status{Initiated, Revoked} 747} 748 749// StatusReason enumerates the values for status reason. 750type StatusReason string 751 752const ( 753 // Expired ... 754 Expired StatusReason = "Expired" 755 // NewerRequestInitiated ... 756 NewerRequestInitiated StatusReason = "NewerRequestInitiated" 757 // UserRequested ... 758 UserRequested StatusReason = "UserRequested" 759) 760 761// PossibleStatusReasonValues returns an array of possible values for the StatusReason const type. 762func PossibleStatusReasonValues() []StatusReason { 763 return []StatusReason{Expired, NewerRequestInitiated, UserRequested} 764} 765 766// SubAssessmentStatusCode enumerates the values for sub assessment status code. 767type SubAssessmentStatusCode string 768 769const ( 770 // Healthy The resource is healthy 771 Healthy SubAssessmentStatusCode = "Healthy" 772 // NotApplicable Assessment for this resource did not happen 773 NotApplicable SubAssessmentStatusCode = "NotApplicable" 774 // Unhealthy The resource has a security issue that needs to be addressed 775 Unhealthy SubAssessmentStatusCode = "Unhealthy" 776) 777 778// PossibleSubAssessmentStatusCodeValues returns an array of possible values for the SubAssessmentStatusCode const type. 779func PossibleSubAssessmentStatusCodeValues() []SubAssessmentStatusCode { 780 return []SubAssessmentStatusCode{Healthy, NotApplicable, Unhealthy} 781} 782 783// TransportProtocol enumerates the values for transport protocol. 784type TransportProtocol string 785 786const ( 787 // TransportProtocolTCP ... 788 TransportProtocolTCP TransportProtocol = "TCP" 789 // TransportProtocolUDP ... 790 TransportProtocolUDP TransportProtocol = "UDP" 791) 792 793// PossibleTransportProtocolValues returns an array of possible values for the TransportProtocol const type. 794func PossibleTransportProtocolValues() []TransportProtocol { 795 return []TransportProtocol{TransportProtocolTCP, TransportProtocolUDP} 796} 797 798// Type enumerates the values for type. 799type Type string 800 801const ( 802 // BinarySignature ... 803 BinarySignature Type = "BinarySignature" 804 // File ... 805 File Type = "File" 806 // FileHash ... 807 FileHash Type = "FileHash" 808 // ProductSignature ... 809 ProductSignature Type = "ProductSignature" 810 // PublisherSignature ... 811 PublisherSignature Type = "PublisherSignature" 812 // VersionAndAboveSignature ... 813 VersionAndAboveSignature Type = "VersionAndAboveSignature" 814) 815 816// PossibleTypeValues returns an array of possible values for the Type const type. 817func PossibleTypeValues() []Type { 818 return []Type{BinarySignature, File, FileHash, ProductSignature, PublisherSignature, VersionAndAboveSignature} 819} 820 821// ValueType enumerates the values for value type. 822type ValueType string 823 824const ( 825 // IPCidr An IP range in CIDR format (e.g. '192.168.0.1/8'). 826 IPCidr ValueType = "IpCidr" 827 // String Any string value. 828 String ValueType = "String" 829) 830 831// PossibleValueTypeValues returns an array of possible values for the ValueType const type. 832func PossibleValueTypeValues() []ValueType { 833 return []ValueType{IPCidr, String} 834} 835 836// AadConnectivityState1 describes an Azure resource with kind 837type AadConnectivityState1 struct { 838 // ConnectivityState - Possible values include: 'Discovered', 'NotLicensed', 'Connected' 839 ConnectivityState AadConnectivityState `json:"connectivityState,omitempty"` 840} 841 842// AadExternalSecuritySolution represents an AAD identity protection solution which sends logs to an OMS 843// workspace. 844type AadExternalSecuritySolution struct { 845 Properties *AadSolutionProperties `json:"properties,omitempty"` 846 // ID - READ-ONLY; Resource Id 847 ID *string `json:"id,omitempty"` 848 // Name - READ-ONLY; Resource name 849 Name *string `json:"name,omitempty"` 850 // Type - READ-ONLY; Resource type 851 Type *string `json:"type,omitempty"` 852 // Location - READ-ONLY; Location where the resource is stored 853 Location *string `json:"location,omitempty"` 854 // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' 855 Kind KindEnum `json:"kind,omitempty"` 856} 857 858// MarshalJSON is the custom marshaler for AadExternalSecuritySolution. 859func (aess AadExternalSecuritySolution) MarshalJSON() ([]byte, error) { 860 aess.Kind = KindAAD 861 objectMap := make(map[string]interface{}) 862 if aess.Properties != nil { 863 objectMap["properties"] = aess.Properties 864 } 865 if aess.Kind != "" { 866 objectMap["kind"] = aess.Kind 867 } 868 return json.Marshal(objectMap) 869} 870 871// AsCefExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AadExternalSecuritySolution. 872func (aess AadExternalSecuritySolution) AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) { 873 return nil, false 874} 875 876// AsAtaExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AadExternalSecuritySolution. 877func (aess AadExternalSecuritySolution) AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) { 878 return nil, false 879} 880 881// AsAadExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AadExternalSecuritySolution. 882func (aess AadExternalSecuritySolution) AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) { 883 return &aess, true 884} 885 886// AsExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AadExternalSecuritySolution. 887func (aess AadExternalSecuritySolution) AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) { 888 return nil, false 889} 890 891// AsBasicExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AadExternalSecuritySolution. 892func (aess AadExternalSecuritySolution) AsBasicExternalSecuritySolution() (BasicExternalSecuritySolution, bool) { 893 return &aess, true 894} 895 896// AadSolutionProperties ... 897type AadSolutionProperties struct { 898 DeviceVendor *string `json:"deviceVendor,omitempty"` 899 DeviceType *string `json:"deviceType,omitempty"` 900 Workspace *ConnectedWorkspace `json:"workspace,omitempty"` 901 // ConnectivityState - Possible values include: 'Discovered', 'NotLicensed', 'Connected' 902 ConnectivityState AadConnectivityState `json:"connectivityState,omitempty"` 903} 904 905// AdaptiveNetworkHardening the resource whose properties describes the Adaptive Network Hardening settings 906// for some Azure resource 907type AdaptiveNetworkHardening struct { 908 autorest.Response `json:"-"` 909 // AdaptiveNetworkHardeningProperties - Properties of the Adaptive Network Hardening resource 910 *AdaptiveNetworkHardeningProperties `json:"properties,omitempty"` 911 // ID - READ-ONLY; Resource Id 912 ID *string `json:"id,omitempty"` 913 // Name - READ-ONLY; Resource name 914 Name *string `json:"name,omitempty"` 915 // Type - READ-ONLY; Resource type 916 Type *string `json:"type,omitempty"` 917} 918 919// MarshalJSON is the custom marshaler for AdaptiveNetworkHardening. 920func (anh AdaptiveNetworkHardening) MarshalJSON() ([]byte, error) { 921 objectMap := make(map[string]interface{}) 922 if anh.AdaptiveNetworkHardeningProperties != nil { 923 objectMap["properties"] = anh.AdaptiveNetworkHardeningProperties 924 } 925 return json.Marshal(objectMap) 926} 927 928// UnmarshalJSON is the custom unmarshaler for AdaptiveNetworkHardening struct. 929func (anh *AdaptiveNetworkHardening) UnmarshalJSON(body []byte) error { 930 var m map[string]*json.RawMessage 931 err := json.Unmarshal(body, &m) 932 if err != nil { 933 return err 934 } 935 for k, v := range m { 936 switch k { 937 case "properties": 938 if v != nil { 939 var adaptiveNetworkHardeningProperties AdaptiveNetworkHardeningProperties 940 err = json.Unmarshal(*v, &adaptiveNetworkHardeningProperties) 941 if err != nil { 942 return err 943 } 944 anh.AdaptiveNetworkHardeningProperties = &adaptiveNetworkHardeningProperties 945 } 946 case "id": 947 if v != nil { 948 var ID string 949 err = json.Unmarshal(*v, &ID) 950 if err != nil { 951 return err 952 } 953 anh.ID = &ID 954 } 955 case "name": 956 if v != nil { 957 var name string 958 err = json.Unmarshal(*v, &name) 959 if err != nil { 960 return err 961 } 962 anh.Name = &name 963 } 964 case "type": 965 if v != nil { 966 var typeVar string 967 err = json.Unmarshal(*v, &typeVar) 968 if err != nil { 969 return err 970 } 971 anh.Type = &typeVar 972 } 973 } 974 } 975 976 return nil 977} 978 979// AdaptiveNetworkHardeningEnforceRequest ... 980type AdaptiveNetworkHardeningEnforceRequest struct { 981 // Rules - The rules to enforce 982 Rules *[]Rule `json:"rules,omitempty"` 983 // NetworkSecurityGroups - The Azure resource IDs of the effective network security groups that will be updated with the created security rules from the Adaptive Network Hardening rules 984 NetworkSecurityGroups *[]string `json:"networkSecurityGroups,omitempty"` 985} 986 987// AdaptiveNetworkHardeningProperties adaptive Network Hardening resource properties 988type AdaptiveNetworkHardeningProperties struct { 989 // Rules - The security rules which are recommended to be effective on the VM 990 Rules *[]Rule `json:"rules,omitempty"` 991 // RulesCalculationTime - The UTC time on which the rules were calculated 992 RulesCalculationTime *date.Time `json:"rulesCalculationTime,omitempty"` 993 // EffectiveNetworkSecurityGroups - The Network Security Groups effective on the network interfaces of the protected resource 994 EffectiveNetworkSecurityGroups *[]EffectiveNetworkSecurityGroups `json:"effectiveNetworkSecurityGroups,omitempty"` 995} 996 997// AdaptiveNetworkHardeningsEnforceFuture an abstraction for monitoring and retrieving the results of a 998// long-running operation. 999type AdaptiveNetworkHardeningsEnforceFuture struct { 1000 azure.Future 1001} 1002 1003// Result returns the result of the asynchronous operation. 1004// If the operation has not completed it will return an error. 1005func (future *AdaptiveNetworkHardeningsEnforceFuture) Result(client AdaptiveNetworkHardeningsClient) (ar autorest.Response, err error) { 1006 var done bool 1007 done, err = future.DoneWithContext(context.Background(), client) 1008 if err != nil { 1009 err = autorest.NewErrorWithError(err, "security.AdaptiveNetworkHardeningsEnforceFuture", "Result", future.Response(), "Polling failure") 1010 return 1011 } 1012 if !done { 1013 err = azure.NewAsyncOpIncompleteError("security.AdaptiveNetworkHardeningsEnforceFuture") 1014 return 1015 } 1016 ar.Response = future.Response() 1017 return 1018} 1019 1020// AdaptiveNetworkHardeningsList response for ListAdaptiveNetworkHardenings API service call 1021type AdaptiveNetworkHardeningsList struct { 1022 autorest.Response `json:"-"` 1023 // Value - A list of Adaptive Network Hardenings resources 1024 Value *[]AdaptiveNetworkHardening `json:"value,omitempty"` 1025 // NextLink - The URL to get the next set of results 1026 NextLink *string `json:"nextLink,omitempty"` 1027} 1028 1029// AdaptiveNetworkHardeningsListIterator provides access to a complete listing of AdaptiveNetworkHardening 1030// values. 1031type AdaptiveNetworkHardeningsListIterator struct { 1032 i int 1033 page AdaptiveNetworkHardeningsListPage 1034} 1035 1036// NextWithContext advances to the next value. If there was an error making 1037// the request the iterator does not advance and the error is returned. 1038func (iter *AdaptiveNetworkHardeningsListIterator) NextWithContext(ctx context.Context) (err error) { 1039 if tracing.IsEnabled() { 1040 ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveNetworkHardeningsListIterator.NextWithContext") 1041 defer func() { 1042 sc := -1 1043 if iter.Response().Response.Response != nil { 1044 sc = iter.Response().Response.Response.StatusCode 1045 } 1046 tracing.EndSpan(ctx, sc, err) 1047 }() 1048 } 1049 iter.i++ 1050 if iter.i < len(iter.page.Values()) { 1051 return nil 1052 } 1053 err = iter.page.NextWithContext(ctx) 1054 if err != nil { 1055 iter.i-- 1056 return err 1057 } 1058 iter.i = 0 1059 return nil 1060} 1061 1062// Next advances to the next value. If there was an error making 1063// the request the iterator does not advance and the error is returned. 1064// Deprecated: Use NextWithContext() instead. 1065func (iter *AdaptiveNetworkHardeningsListIterator) Next() error { 1066 return iter.NextWithContext(context.Background()) 1067} 1068 1069// NotDone returns true if the enumeration should be started or is not yet complete. 1070func (iter AdaptiveNetworkHardeningsListIterator) NotDone() bool { 1071 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1072} 1073 1074// Response returns the raw server response from the last page request. 1075func (iter AdaptiveNetworkHardeningsListIterator) Response() AdaptiveNetworkHardeningsList { 1076 return iter.page.Response() 1077} 1078 1079// Value returns the current value or a zero-initialized value if the 1080// iterator has advanced beyond the end of the collection. 1081func (iter AdaptiveNetworkHardeningsListIterator) Value() AdaptiveNetworkHardening { 1082 if !iter.page.NotDone() { 1083 return AdaptiveNetworkHardening{} 1084 } 1085 return iter.page.Values()[iter.i] 1086} 1087 1088// Creates a new instance of the AdaptiveNetworkHardeningsListIterator type. 1089func NewAdaptiveNetworkHardeningsListIterator(page AdaptiveNetworkHardeningsListPage) AdaptiveNetworkHardeningsListIterator { 1090 return AdaptiveNetworkHardeningsListIterator{page: page} 1091} 1092 1093// IsEmpty returns true if the ListResult contains no values. 1094func (anhl AdaptiveNetworkHardeningsList) IsEmpty() bool { 1095 return anhl.Value == nil || len(*anhl.Value) == 0 1096} 1097 1098// adaptiveNetworkHardeningsListPreparer prepares a request to retrieve the next set of results. 1099// It returns nil if no more results exist. 1100func (anhl AdaptiveNetworkHardeningsList) adaptiveNetworkHardeningsListPreparer(ctx context.Context) (*http.Request, error) { 1101 if anhl.NextLink == nil || len(to.String(anhl.NextLink)) < 1 { 1102 return nil, nil 1103 } 1104 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1105 autorest.AsJSON(), 1106 autorest.AsGet(), 1107 autorest.WithBaseURL(to.String(anhl.NextLink))) 1108} 1109 1110// AdaptiveNetworkHardeningsListPage contains a page of AdaptiveNetworkHardening values. 1111type AdaptiveNetworkHardeningsListPage struct { 1112 fn func(context.Context, AdaptiveNetworkHardeningsList) (AdaptiveNetworkHardeningsList, error) 1113 anhl AdaptiveNetworkHardeningsList 1114} 1115 1116// NextWithContext advances to the next page of values. If there was an error making 1117// the request the page does not advance and the error is returned. 1118func (page *AdaptiveNetworkHardeningsListPage) NextWithContext(ctx context.Context) (err error) { 1119 if tracing.IsEnabled() { 1120 ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveNetworkHardeningsListPage.NextWithContext") 1121 defer func() { 1122 sc := -1 1123 if page.Response().Response.Response != nil { 1124 sc = page.Response().Response.Response.StatusCode 1125 } 1126 tracing.EndSpan(ctx, sc, err) 1127 }() 1128 } 1129 next, err := page.fn(ctx, page.anhl) 1130 if err != nil { 1131 return err 1132 } 1133 page.anhl = next 1134 return nil 1135} 1136 1137// Next advances to the next page of values. If there was an error making 1138// the request the page does not advance and the error is returned. 1139// Deprecated: Use NextWithContext() instead. 1140func (page *AdaptiveNetworkHardeningsListPage) Next() error { 1141 return page.NextWithContext(context.Background()) 1142} 1143 1144// NotDone returns true if the page enumeration should be started or is not yet complete. 1145func (page AdaptiveNetworkHardeningsListPage) NotDone() bool { 1146 return !page.anhl.IsEmpty() 1147} 1148 1149// Response returns the raw server response from the last page request. 1150func (page AdaptiveNetworkHardeningsListPage) Response() AdaptiveNetworkHardeningsList { 1151 return page.anhl 1152} 1153 1154// Values returns the slice of values for the current page or nil if there are no values. 1155func (page AdaptiveNetworkHardeningsListPage) Values() []AdaptiveNetworkHardening { 1156 if page.anhl.IsEmpty() { 1157 return nil 1158 } 1159 return *page.anhl.Value 1160} 1161 1162// Creates a new instance of the AdaptiveNetworkHardeningsListPage type. 1163func NewAdaptiveNetworkHardeningsListPage(getNextPage func(context.Context, AdaptiveNetworkHardeningsList) (AdaptiveNetworkHardeningsList, error)) AdaptiveNetworkHardeningsListPage { 1164 return AdaptiveNetworkHardeningsListPage{fn: getNextPage} 1165} 1166 1167// BasicAdditionalData details of the sub-assessment 1168type BasicAdditionalData interface { 1169 AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) 1170 AsContainerRegistryVulnerabilityProperties() (*ContainerRegistryVulnerabilityProperties, bool) 1171 AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) 1172 AsAdditionalData() (*AdditionalData, bool) 1173} 1174 1175// AdditionalData details of the sub-assessment 1176type AdditionalData struct { 1177 // AssessedResourceType - Possible values include: 'AssessedResourceTypeAdditionalData', 'AssessedResourceTypeSQLServerVulnerability', 'AssessedResourceTypeContainerRegistryVulnerability', 'AssessedResourceTypeServerVulnerabilityAssessment' 1178 AssessedResourceType AssessedResourceType `json:"assessedResourceType,omitempty"` 1179} 1180 1181func unmarshalBasicAdditionalData(body []byte) (BasicAdditionalData, error) { 1182 var m map[string]interface{} 1183 err := json.Unmarshal(body, &m) 1184 if err != nil { 1185 return nil, err 1186 } 1187 1188 switch m["assessedResourceType"] { 1189 case string(AssessedResourceTypeSQLServerVulnerability): 1190 var ssvp SQLServerVulnerabilityProperties 1191 err := json.Unmarshal(body, &ssvp) 1192 return ssvp, err 1193 case string(AssessedResourceTypeContainerRegistryVulnerability): 1194 var crvp ContainerRegistryVulnerabilityProperties 1195 err := json.Unmarshal(body, &crvp) 1196 return crvp, err 1197 case string(AssessedResourceTypeServerVulnerabilityAssessment): 1198 var svp ServerVulnerabilityProperties 1199 err := json.Unmarshal(body, &svp) 1200 return svp, err 1201 default: 1202 var ad AdditionalData 1203 err := json.Unmarshal(body, &ad) 1204 return ad, err 1205 } 1206} 1207func unmarshalBasicAdditionalDataArray(body []byte) ([]BasicAdditionalData, error) { 1208 var rawMessages []*json.RawMessage 1209 err := json.Unmarshal(body, &rawMessages) 1210 if err != nil { 1211 return nil, err 1212 } 1213 1214 adArray := make([]BasicAdditionalData, len(rawMessages)) 1215 1216 for index, rawMessage := range rawMessages { 1217 ad, err := unmarshalBasicAdditionalData(*rawMessage) 1218 if err != nil { 1219 return nil, err 1220 } 1221 adArray[index] = ad 1222 } 1223 return adArray, nil 1224} 1225 1226// MarshalJSON is the custom marshaler for AdditionalData. 1227func (ad AdditionalData) MarshalJSON() ([]byte, error) { 1228 ad.AssessedResourceType = AssessedResourceTypeAdditionalData 1229 objectMap := make(map[string]interface{}) 1230 if ad.AssessedResourceType != "" { 1231 objectMap["assessedResourceType"] = ad.AssessedResourceType 1232 } 1233 return json.Marshal(objectMap) 1234} 1235 1236// AsSQLServerVulnerabilityProperties is the BasicAdditionalData implementation for AdditionalData. 1237func (ad AdditionalData) AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) { 1238 return nil, false 1239} 1240 1241// AsContainerRegistryVulnerabilityProperties is the BasicAdditionalData implementation for AdditionalData. 1242func (ad AdditionalData) AsContainerRegistryVulnerabilityProperties() (*ContainerRegistryVulnerabilityProperties, bool) { 1243 return nil, false 1244} 1245 1246// AsServerVulnerabilityProperties is the BasicAdditionalData implementation for AdditionalData. 1247func (ad AdditionalData) AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) { 1248 return nil, false 1249} 1250 1251// AsAdditionalData is the BasicAdditionalData implementation for AdditionalData. 1252func (ad AdditionalData) AsAdditionalData() (*AdditionalData, bool) { 1253 return &ad, true 1254} 1255 1256// AsBasicAdditionalData is the BasicAdditionalData implementation for AdditionalData. 1257func (ad AdditionalData) AsBasicAdditionalData() (BasicAdditionalData, bool) { 1258 return &ad, true 1259} 1260 1261// AdvancedThreatProtectionProperties the Advanced Threat Protection settings. 1262type AdvancedThreatProtectionProperties struct { 1263 // IsEnabled - Indicates whether Advanced Threat Protection is enabled. 1264 IsEnabled *bool `json:"isEnabled,omitempty"` 1265} 1266 1267// AdvancedThreatProtectionSetting the Advanced Threat Protection resource. 1268type AdvancedThreatProtectionSetting struct { 1269 autorest.Response `json:"-"` 1270 *AdvancedThreatProtectionProperties `json:"properties,omitempty"` 1271 // ID - READ-ONLY; Resource Id 1272 ID *string `json:"id,omitempty"` 1273 // Name - READ-ONLY; Resource name 1274 Name *string `json:"name,omitempty"` 1275 // Type - READ-ONLY; Resource type 1276 Type *string `json:"type,omitempty"` 1277} 1278 1279// MarshalJSON is the custom marshaler for AdvancedThreatProtectionSetting. 1280func (atps AdvancedThreatProtectionSetting) MarshalJSON() ([]byte, error) { 1281 objectMap := make(map[string]interface{}) 1282 if atps.AdvancedThreatProtectionProperties != nil { 1283 objectMap["properties"] = atps.AdvancedThreatProtectionProperties 1284 } 1285 return json.Marshal(objectMap) 1286} 1287 1288// UnmarshalJSON is the custom unmarshaler for AdvancedThreatProtectionSetting struct. 1289func (atps *AdvancedThreatProtectionSetting) UnmarshalJSON(body []byte) error { 1290 var m map[string]*json.RawMessage 1291 err := json.Unmarshal(body, &m) 1292 if err != nil { 1293 return err 1294 } 1295 for k, v := range m { 1296 switch k { 1297 case "properties": 1298 if v != nil { 1299 var advancedThreatProtectionProperties AdvancedThreatProtectionProperties 1300 err = json.Unmarshal(*v, &advancedThreatProtectionProperties) 1301 if err != nil { 1302 return err 1303 } 1304 atps.AdvancedThreatProtectionProperties = &advancedThreatProtectionProperties 1305 } 1306 case "id": 1307 if v != nil { 1308 var ID string 1309 err = json.Unmarshal(*v, &ID) 1310 if err != nil { 1311 return err 1312 } 1313 atps.ID = &ID 1314 } 1315 case "name": 1316 if v != nil { 1317 var name string 1318 err = json.Unmarshal(*v, &name) 1319 if err != nil { 1320 return err 1321 } 1322 atps.Name = &name 1323 } 1324 case "type": 1325 if v != nil { 1326 var typeVar string 1327 err = json.Unmarshal(*v, &typeVar) 1328 if err != nil { 1329 return err 1330 } 1331 atps.Type = &typeVar 1332 } 1333 } 1334 } 1335 1336 return nil 1337} 1338 1339// Alert security alert 1340type Alert struct { 1341 autorest.Response `json:"-"` 1342 *AlertProperties `json:"properties,omitempty"` 1343 // ID - READ-ONLY; Resource Id 1344 ID *string `json:"id,omitempty"` 1345 // Name - READ-ONLY; Resource name 1346 Name *string `json:"name,omitempty"` 1347 // Type - READ-ONLY; Resource type 1348 Type *string `json:"type,omitempty"` 1349} 1350 1351// MarshalJSON is the custom marshaler for Alert. 1352func (a Alert) MarshalJSON() ([]byte, error) { 1353 objectMap := make(map[string]interface{}) 1354 if a.AlertProperties != nil { 1355 objectMap["properties"] = a.AlertProperties 1356 } 1357 return json.Marshal(objectMap) 1358} 1359 1360// UnmarshalJSON is the custom unmarshaler for Alert struct. 1361func (a *Alert) UnmarshalJSON(body []byte) error { 1362 var m map[string]*json.RawMessage 1363 err := json.Unmarshal(body, &m) 1364 if err != nil { 1365 return err 1366 } 1367 for k, v := range m { 1368 switch k { 1369 case "properties": 1370 if v != nil { 1371 var alertProperties AlertProperties 1372 err = json.Unmarshal(*v, &alertProperties) 1373 if err != nil { 1374 return err 1375 } 1376 a.AlertProperties = &alertProperties 1377 } 1378 case "id": 1379 if v != nil { 1380 var ID string 1381 err = json.Unmarshal(*v, &ID) 1382 if err != nil { 1383 return err 1384 } 1385 a.ID = &ID 1386 } 1387 case "name": 1388 if v != nil { 1389 var name string 1390 err = json.Unmarshal(*v, &name) 1391 if err != nil { 1392 return err 1393 } 1394 a.Name = &name 1395 } 1396 case "type": 1397 if v != nil { 1398 var typeVar string 1399 err = json.Unmarshal(*v, &typeVar) 1400 if err != nil { 1401 return err 1402 } 1403 a.Type = &typeVar 1404 } 1405 } 1406 } 1407 1408 return nil 1409} 1410 1411// AlertConfidenceReason factors that increase our confidence that the alert is a true positive 1412type AlertConfidenceReason struct { 1413 // Type - READ-ONLY; Type of confidence factor 1414 Type *string `json:"type,omitempty"` 1415 // Reason - READ-ONLY; description of the confidence reason 1416 Reason *string `json:"reason,omitempty"` 1417} 1418 1419// AlertEntity changing set of properties depending on the entity type. 1420type AlertEntity struct { 1421 // AdditionalProperties - Unmatched properties from the message are deserialized this collection 1422 AdditionalProperties map[string]interface{} `json:""` 1423 // Type - READ-ONLY; Type of entity 1424 Type *string `json:"type,omitempty"` 1425} 1426 1427// MarshalJSON is the custom marshaler for AlertEntity. 1428func (ae AlertEntity) MarshalJSON() ([]byte, error) { 1429 objectMap := make(map[string]interface{}) 1430 for k, v := range ae.AdditionalProperties { 1431 objectMap[k] = v 1432 } 1433 return json.Marshal(objectMap) 1434} 1435 1436// UnmarshalJSON is the custom unmarshaler for AlertEntity struct. 1437func (ae *AlertEntity) UnmarshalJSON(body []byte) error { 1438 var m map[string]*json.RawMessage 1439 err := json.Unmarshal(body, &m) 1440 if err != nil { 1441 return err 1442 } 1443 for k, v := range m { 1444 switch k { 1445 default: 1446 if v != nil { 1447 var additionalProperties interface{} 1448 err = json.Unmarshal(*v, &additionalProperties) 1449 if err != nil { 1450 return err 1451 } 1452 if ae.AdditionalProperties == nil { 1453 ae.AdditionalProperties = make(map[string]interface{}) 1454 } 1455 ae.AdditionalProperties[k] = additionalProperties 1456 } 1457 case "type": 1458 if v != nil { 1459 var typeVar string 1460 err = json.Unmarshal(*v, &typeVar) 1461 if err != nil { 1462 return err 1463 } 1464 ae.Type = &typeVar 1465 } 1466 } 1467 } 1468 1469 return nil 1470} 1471 1472// AlertList list of security alerts 1473type AlertList struct { 1474 autorest.Response `json:"-"` 1475 Value *[]Alert `json:"value,omitempty"` 1476 // NextLink - READ-ONLY; The URI to fetch the next page. 1477 NextLink *string `json:"nextLink,omitempty"` 1478} 1479 1480// AlertListIterator provides access to a complete listing of Alert values. 1481type AlertListIterator struct { 1482 i int 1483 page AlertListPage 1484} 1485 1486// NextWithContext advances to the next value. If there was an error making 1487// the request the iterator does not advance and the error is returned. 1488func (iter *AlertListIterator) NextWithContext(ctx context.Context) (err error) { 1489 if tracing.IsEnabled() { 1490 ctx = tracing.StartSpan(ctx, fqdn+"/AlertListIterator.NextWithContext") 1491 defer func() { 1492 sc := -1 1493 if iter.Response().Response.Response != nil { 1494 sc = iter.Response().Response.Response.StatusCode 1495 } 1496 tracing.EndSpan(ctx, sc, err) 1497 }() 1498 } 1499 iter.i++ 1500 if iter.i < len(iter.page.Values()) { 1501 return nil 1502 } 1503 err = iter.page.NextWithContext(ctx) 1504 if err != nil { 1505 iter.i-- 1506 return err 1507 } 1508 iter.i = 0 1509 return nil 1510} 1511 1512// Next advances to the next value. If there was an error making 1513// the request the iterator does not advance and the error is returned. 1514// Deprecated: Use NextWithContext() instead. 1515func (iter *AlertListIterator) Next() error { 1516 return iter.NextWithContext(context.Background()) 1517} 1518 1519// NotDone returns true if the enumeration should be started or is not yet complete. 1520func (iter AlertListIterator) NotDone() bool { 1521 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1522} 1523 1524// Response returns the raw server response from the last page request. 1525func (iter AlertListIterator) Response() AlertList { 1526 return iter.page.Response() 1527} 1528 1529// Value returns the current value or a zero-initialized value if the 1530// iterator has advanced beyond the end of the collection. 1531func (iter AlertListIterator) Value() Alert { 1532 if !iter.page.NotDone() { 1533 return Alert{} 1534 } 1535 return iter.page.Values()[iter.i] 1536} 1537 1538// Creates a new instance of the AlertListIterator type. 1539func NewAlertListIterator(page AlertListPage) AlertListIterator { 1540 return AlertListIterator{page: page} 1541} 1542 1543// IsEmpty returns true if the ListResult contains no values. 1544func (al AlertList) IsEmpty() bool { 1545 return al.Value == nil || len(*al.Value) == 0 1546} 1547 1548// alertListPreparer prepares a request to retrieve the next set of results. 1549// It returns nil if no more results exist. 1550func (al AlertList) alertListPreparer(ctx context.Context) (*http.Request, error) { 1551 if al.NextLink == nil || len(to.String(al.NextLink)) < 1 { 1552 return nil, nil 1553 } 1554 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1555 autorest.AsJSON(), 1556 autorest.AsGet(), 1557 autorest.WithBaseURL(to.String(al.NextLink))) 1558} 1559 1560// AlertListPage contains a page of Alert values. 1561type AlertListPage struct { 1562 fn func(context.Context, AlertList) (AlertList, error) 1563 al AlertList 1564} 1565 1566// NextWithContext advances to the next page of values. If there was an error making 1567// the request the page does not advance and the error is returned. 1568func (page *AlertListPage) NextWithContext(ctx context.Context) (err error) { 1569 if tracing.IsEnabled() { 1570 ctx = tracing.StartSpan(ctx, fqdn+"/AlertListPage.NextWithContext") 1571 defer func() { 1572 sc := -1 1573 if page.Response().Response.Response != nil { 1574 sc = page.Response().Response.Response.StatusCode 1575 } 1576 tracing.EndSpan(ctx, sc, err) 1577 }() 1578 } 1579 next, err := page.fn(ctx, page.al) 1580 if err != nil { 1581 return err 1582 } 1583 page.al = next 1584 return nil 1585} 1586 1587// Next advances to the next page of values. If there was an error making 1588// the request the page does not advance and the error is returned. 1589// Deprecated: Use NextWithContext() instead. 1590func (page *AlertListPage) Next() error { 1591 return page.NextWithContext(context.Background()) 1592} 1593 1594// NotDone returns true if the page enumeration should be started or is not yet complete. 1595func (page AlertListPage) NotDone() bool { 1596 return !page.al.IsEmpty() 1597} 1598 1599// Response returns the raw server response from the last page request. 1600func (page AlertListPage) Response() AlertList { 1601 return page.al 1602} 1603 1604// Values returns the slice of values for the current page or nil if there are no values. 1605func (page AlertListPage) Values() []Alert { 1606 if page.al.IsEmpty() { 1607 return nil 1608 } 1609 return *page.al.Value 1610} 1611 1612// Creates a new instance of the AlertListPage type. 1613func NewAlertListPage(getNextPage func(context.Context, AlertList) (AlertList, error)) AlertListPage { 1614 return AlertListPage{fn: getNextPage} 1615} 1616 1617// AlertProperties describes security alert properties. 1618type AlertProperties struct { 1619 // State - READ-ONLY; State of the alert (Active, Dismissed etc.) 1620 State *string `json:"state,omitempty"` 1621 // ReportedTimeUtc - READ-ONLY; The time the incident was reported to Microsoft.Security in UTC 1622 ReportedTimeUtc *date.Time `json:"reportedTimeUtc,omitempty"` 1623 // VendorName - READ-ONLY; Name of the vendor that discovered the incident 1624 VendorName *string `json:"vendorName,omitempty"` 1625 // AlertName - READ-ONLY; Name of the alert type 1626 AlertName *string `json:"alertName,omitempty"` 1627 // AlertDisplayName - READ-ONLY; Display name of the alert type 1628 AlertDisplayName *string `json:"alertDisplayName,omitempty"` 1629 // DetectedTimeUtc - READ-ONLY; The time the incident was detected by the vendor 1630 DetectedTimeUtc *date.Time `json:"detectedTimeUtc,omitempty"` 1631 // Description - READ-ONLY; Description of the incident and what it means 1632 Description *string `json:"description,omitempty"` 1633 // RemediationSteps - READ-ONLY; Recommended steps to reradiate the incident 1634 RemediationSteps *string `json:"remediationSteps,omitempty"` 1635 // ActionTaken - READ-ONLY; The action that was taken as a response to the alert (Active, Blocked etc.) 1636 ActionTaken *string `json:"actionTaken,omitempty"` 1637 // ReportedSeverity - READ-ONLY; Estimated severity of this alert. Possible values include: 'Informational', 'Low', 'Medium', 'High' 1638 ReportedSeverity ReportedSeverity `json:"reportedSeverity,omitempty"` 1639 // CompromisedEntity - READ-ONLY; The entity that the incident happened on 1640 CompromisedEntity *string `json:"compromisedEntity,omitempty"` 1641 // AssociatedResource - READ-ONLY; Azure resource ID of the associated resource 1642 AssociatedResource *string `json:"associatedResource,omitempty"` 1643 ExtendedProperties map[string]interface{} `json:"extendedProperties"` 1644 // SystemSource - READ-ONLY; The type of the alerted resource (Azure, Non-Azure) 1645 SystemSource *string `json:"systemSource,omitempty"` 1646 // CanBeInvestigated - READ-ONLY; Whether this alert can be investigated with Azure Security Center 1647 CanBeInvestigated *bool `json:"canBeInvestigated,omitempty"` 1648 // IsIncident - READ-ONLY; Whether this alert is for incident type or not (otherwise - single alert) 1649 IsIncident *bool `json:"isIncident,omitempty"` 1650 // Entities - objects that are related to this alerts 1651 Entities *[]AlertEntity `json:"entities,omitempty"` 1652 // ConfidenceScore - READ-ONLY; level of confidence we have on the alert 1653 ConfidenceScore *float64 `json:"confidenceScore,omitempty"` 1654 // ConfidenceReasons - reasons the alert got the confidenceScore value 1655 ConfidenceReasons *[]AlertConfidenceReason `json:"confidenceReasons,omitempty"` 1656 // SubscriptionID - READ-ONLY; Azure subscription ID of the resource that had the security alert or the subscription ID of the workspace that this resource reports to 1657 SubscriptionID *string `json:"subscriptionId,omitempty"` 1658 // InstanceID - READ-ONLY; Instance ID of the alert. 1659 InstanceID *string `json:"instanceId,omitempty"` 1660 // WorkspaceArmID - READ-ONLY; Azure resource ID of the workspace that the alert was reported to. 1661 WorkspaceArmID *string `json:"workspaceArmId,omitempty"` 1662 // CorrelationKey - READ-ONLY; Alerts with the same CorrelationKey will be grouped together in Ibiza. 1663 CorrelationKey *string `json:"correlationKey,omitempty"` 1664} 1665 1666// MarshalJSON is the custom marshaler for AlertProperties. 1667func (ap AlertProperties) MarshalJSON() ([]byte, error) { 1668 objectMap := make(map[string]interface{}) 1669 if ap.ExtendedProperties != nil { 1670 objectMap["extendedProperties"] = ap.ExtendedProperties 1671 } 1672 if ap.Entities != nil { 1673 objectMap["entities"] = ap.Entities 1674 } 1675 if ap.ConfidenceReasons != nil { 1676 objectMap["confidenceReasons"] = ap.ConfidenceReasons 1677 } 1678 return json.Marshal(objectMap) 1679} 1680 1681// AllowedConnectionsList list of all possible traffic between Azure resources 1682type AllowedConnectionsList struct { 1683 autorest.Response `json:"-"` 1684 // Value - READ-ONLY 1685 Value *[]AllowedConnectionsResource `json:"value,omitempty"` 1686 // NextLink - READ-ONLY; The URI to fetch the next page. 1687 NextLink *string `json:"nextLink,omitempty"` 1688} 1689 1690// AllowedConnectionsListIterator provides access to a complete listing of AllowedConnectionsResource 1691// values. 1692type AllowedConnectionsListIterator struct { 1693 i int 1694 page AllowedConnectionsListPage 1695} 1696 1697// NextWithContext advances to the next value. If there was an error making 1698// the request the iterator does not advance and the error is returned. 1699func (iter *AllowedConnectionsListIterator) NextWithContext(ctx context.Context) (err error) { 1700 if tracing.IsEnabled() { 1701 ctx = tracing.StartSpan(ctx, fqdn+"/AllowedConnectionsListIterator.NextWithContext") 1702 defer func() { 1703 sc := -1 1704 if iter.Response().Response.Response != nil { 1705 sc = iter.Response().Response.Response.StatusCode 1706 } 1707 tracing.EndSpan(ctx, sc, err) 1708 }() 1709 } 1710 iter.i++ 1711 if iter.i < len(iter.page.Values()) { 1712 return nil 1713 } 1714 err = iter.page.NextWithContext(ctx) 1715 if err != nil { 1716 iter.i-- 1717 return err 1718 } 1719 iter.i = 0 1720 return nil 1721} 1722 1723// Next advances to the next value. If there was an error making 1724// the request the iterator does not advance and the error is returned. 1725// Deprecated: Use NextWithContext() instead. 1726func (iter *AllowedConnectionsListIterator) Next() error { 1727 return iter.NextWithContext(context.Background()) 1728} 1729 1730// NotDone returns true if the enumeration should be started or is not yet complete. 1731func (iter AllowedConnectionsListIterator) NotDone() bool { 1732 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1733} 1734 1735// Response returns the raw server response from the last page request. 1736func (iter AllowedConnectionsListIterator) Response() AllowedConnectionsList { 1737 return iter.page.Response() 1738} 1739 1740// Value returns the current value or a zero-initialized value if the 1741// iterator has advanced beyond the end of the collection. 1742func (iter AllowedConnectionsListIterator) Value() AllowedConnectionsResource { 1743 if !iter.page.NotDone() { 1744 return AllowedConnectionsResource{} 1745 } 1746 return iter.page.Values()[iter.i] 1747} 1748 1749// Creates a new instance of the AllowedConnectionsListIterator type. 1750func NewAllowedConnectionsListIterator(page AllowedConnectionsListPage) AllowedConnectionsListIterator { 1751 return AllowedConnectionsListIterator{page: page} 1752} 1753 1754// IsEmpty returns true if the ListResult contains no values. 1755func (ACL AllowedConnectionsList) IsEmpty() bool { 1756 return ACL.Value == nil || len(*ACL.Value) == 0 1757} 1758 1759// allowedConnectionsListPreparer prepares a request to retrieve the next set of results. 1760// It returns nil if no more results exist. 1761func (ACL AllowedConnectionsList) allowedConnectionsListPreparer(ctx context.Context) (*http.Request, error) { 1762 if ACL.NextLink == nil || len(to.String(ACL.NextLink)) < 1 { 1763 return nil, nil 1764 } 1765 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1766 autorest.AsJSON(), 1767 autorest.AsGet(), 1768 autorest.WithBaseURL(to.String(ACL.NextLink))) 1769} 1770 1771// AllowedConnectionsListPage contains a page of AllowedConnectionsResource values. 1772type AllowedConnectionsListPage struct { 1773 fn func(context.Context, AllowedConnectionsList) (AllowedConnectionsList, error) 1774 ACL AllowedConnectionsList 1775} 1776 1777// NextWithContext advances to the next page of values. If there was an error making 1778// the request the page does not advance and the error is returned. 1779func (page *AllowedConnectionsListPage) NextWithContext(ctx context.Context) (err error) { 1780 if tracing.IsEnabled() { 1781 ctx = tracing.StartSpan(ctx, fqdn+"/AllowedConnectionsListPage.NextWithContext") 1782 defer func() { 1783 sc := -1 1784 if page.Response().Response.Response != nil { 1785 sc = page.Response().Response.Response.StatusCode 1786 } 1787 tracing.EndSpan(ctx, sc, err) 1788 }() 1789 } 1790 next, err := page.fn(ctx, page.ACL) 1791 if err != nil { 1792 return err 1793 } 1794 page.ACL = next 1795 return nil 1796} 1797 1798// Next advances to the next page of values. If there was an error making 1799// the request the page does not advance and the error is returned. 1800// Deprecated: Use NextWithContext() instead. 1801func (page *AllowedConnectionsListPage) Next() error { 1802 return page.NextWithContext(context.Background()) 1803} 1804 1805// NotDone returns true if the page enumeration should be started or is not yet complete. 1806func (page AllowedConnectionsListPage) NotDone() bool { 1807 return !page.ACL.IsEmpty() 1808} 1809 1810// Response returns the raw server response from the last page request. 1811func (page AllowedConnectionsListPage) Response() AllowedConnectionsList { 1812 return page.ACL 1813} 1814 1815// Values returns the slice of values for the current page or nil if there are no values. 1816func (page AllowedConnectionsListPage) Values() []AllowedConnectionsResource { 1817 if page.ACL.IsEmpty() { 1818 return nil 1819 } 1820 return *page.ACL.Value 1821} 1822 1823// Creates a new instance of the AllowedConnectionsListPage type. 1824func NewAllowedConnectionsListPage(getNextPage func(context.Context, AllowedConnectionsList) (AllowedConnectionsList, error)) AllowedConnectionsListPage { 1825 return AllowedConnectionsListPage{fn: getNextPage} 1826} 1827 1828// AllowedConnectionsResource the resource whose properties describes the allowed traffic between Azure 1829// resources 1830type AllowedConnectionsResource struct { 1831 autorest.Response `json:"-"` 1832 // ID - READ-ONLY; Resource Id 1833 ID *string `json:"id,omitempty"` 1834 // Name - READ-ONLY; Resource name 1835 Name *string `json:"name,omitempty"` 1836 // Type - READ-ONLY; Resource type 1837 Type *string `json:"type,omitempty"` 1838 // Location - READ-ONLY; Location where the resource is stored 1839 Location *string `json:"location,omitempty"` 1840 // AllowedConnectionsResourceProperties - READ-ONLY 1841 *AllowedConnectionsResourceProperties `json:"properties,omitempty"` 1842} 1843 1844// MarshalJSON is the custom marshaler for AllowedConnectionsResource. 1845func (acr AllowedConnectionsResource) MarshalJSON() ([]byte, error) { 1846 objectMap := make(map[string]interface{}) 1847 return json.Marshal(objectMap) 1848} 1849 1850// UnmarshalJSON is the custom unmarshaler for AllowedConnectionsResource struct. 1851func (acr *AllowedConnectionsResource) UnmarshalJSON(body []byte) error { 1852 var m map[string]*json.RawMessage 1853 err := json.Unmarshal(body, &m) 1854 if err != nil { 1855 return err 1856 } 1857 for k, v := range m { 1858 switch k { 1859 case "id": 1860 if v != nil { 1861 var ID string 1862 err = json.Unmarshal(*v, &ID) 1863 if err != nil { 1864 return err 1865 } 1866 acr.ID = &ID 1867 } 1868 case "name": 1869 if v != nil { 1870 var name string 1871 err = json.Unmarshal(*v, &name) 1872 if err != nil { 1873 return err 1874 } 1875 acr.Name = &name 1876 } 1877 case "type": 1878 if v != nil { 1879 var typeVar string 1880 err = json.Unmarshal(*v, &typeVar) 1881 if err != nil { 1882 return err 1883 } 1884 acr.Type = &typeVar 1885 } 1886 case "location": 1887 if v != nil { 1888 var location string 1889 err = json.Unmarshal(*v, &location) 1890 if err != nil { 1891 return err 1892 } 1893 acr.Location = &location 1894 } 1895 case "properties": 1896 if v != nil { 1897 var allowedConnectionsResourceProperties AllowedConnectionsResourceProperties 1898 err = json.Unmarshal(*v, &allowedConnectionsResourceProperties) 1899 if err != nil { 1900 return err 1901 } 1902 acr.AllowedConnectionsResourceProperties = &allowedConnectionsResourceProperties 1903 } 1904 } 1905 } 1906 1907 return nil 1908} 1909 1910// AllowedConnectionsResourceProperties describes the allowed traffic between Azure resources 1911type AllowedConnectionsResourceProperties struct { 1912 // CalculatedDateTime - READ-ONLY; The UTC time on which the allowed connections resource was calculated 1913 CalculatedDateTime *date.Time `json:"calculatedDateTime,omitempty"` 1914 // ConnectableResources - READ-ONLY; List of connectable resources 1915 ConnectableResources *[]ConnectableResource `json:"connectableResources,omitempty"` 1916} 1917 1918// AllowlistCustomAlertRule a custom alert rule that checks if a value (depends on the custom alert type) 1919// is allowed 1920type AllowlistCustomAlertRule struct { 1921 // AllowlistValues - The values to allow. The format of the values depends on the rule type. 1922 AllowlistValues *[]string `json:"allowlistValues,omitempty"` 1923 // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'IPCidr', 'String' 1924 ValueType ValueType `json:"valueType,omitempty"` 1925 // DisplayName - READ-ONLY; The display name of the custom alert. 1926 DisplayName *string `json:"displayName,omitempty"` 1927 // Description - READ-ONLY; The description of the custom alert. 1928 Description *string `json:"description,omitempty"` 1929 // IsEnabled - Whether the custom alert is enabled. 1930 IsEnabled *bool `json:"isEnabled,omitempty"` 1931 // RuleType - The type of the custom alert rule. 1932 RuleType *string `json:"ruleType,omitempty"` 1933} 1934 1935// AppWhitelistingGroup ... 1936type AppWhitelistingGroup struct { 1937 autorest.Response `json:"-"` 1938 // ID - READ-ONLY; Resource Id 1939 ID *string `json:"id,omitempty"` 1940 // Name - READ-ONLY; Resource name 1941 Name *string `json:"name,omitempty"` 1942 // Type - READ-ONLY; Resource type 1943 Type *string `json:"type,omitempty"` 1944 // Location - READ-ONLY; Location where the resource is stored 1945 Location *string `json:"location,omitempty"` 1946 *AppWhitelistingGroupData `json:"properties,omitempty"` 1947} 1948 1949// MarshalJSON is the custom marshaler for AppWhitelistingGroup. 1950func (awg AppWhitelistingGroup) MarshalJSON() ([]byte, error) { 1951 objectMap := make(map[string]interface{}) 1952 if awg.AppWhitelistingGroupData != nil { 1953 objectMap["properties"] = awg.AppWhitelistingGroupData 1954 } 1955 return json.Marshal(objectMap) 1956} 1957 1958// UnmarshalJSON is the custom unmarshaler for AppWhitelistingGroup struct. 1959func (awg *AppWhitelistingGroup) UnmarshalJSON(body []byte) error { 1960 var m map[string]*json.RawMessage 1961 err := json.Unmarshal(body, &m) 1962 if err != nil { 1963 return err 1964 } 1965 for k, v := range m { 1966 switch k { 1967 case "id": 1968 if v != nil { 1969 var ID string 1970 err = json.Unmarshal(*v, &ID) 1971 if err != nil { 1972 return err 1973 } 1974 awg.ID = &ID 1975 } 1976 case "name": 1977 if v != nil { 1978 var name string 1979 err = json.Unmarshal(*v, &name) 1980 if err != nil { 1981 return err 1982 } 1983 awg.Name = &name 1984 } 1985 case "type": 1986 if v != nil { 1987 var typeVar string 1988 err = json.Unmarshal(*v, &typeVar) 1989 if err != nil { 1990 return err 1991 } 1992 awg.Type = &typeVar 1993 } 1994 case "location": 1995 if v != nil { 1996 var location string 1997 err = json.Unmarshal(*v, &location) 1998 if err != nil { 1999 return err 2000 } 2001 awg.Location = &location 2002 } 2003 case "properties": 2004 if v != nil { 2005 var appWhitelistingGroupData AppWhitelistingGroupData 2006 err = json.Unmarshal(*v, &appWhitelistingGroupData) 2007 if err != nil { 2008 return err 2009 } 2010 awg.AppWhitelistingGroupData = &appWhitelistingGroupData 2011 } 2012 } 2013 } 2014 2015 return nil 2016} 2017 2018// AppWhitelistingGroupData represents a VM/server group and set of rules that are Recommended by Azure 2019// Security Center to be allowed 2020type AppWhitelistingGroupData struct { 2021 // EnforcementMode - Possible values include: 'Audit', 'Enforce', 'None' 2022 EnforcementMode EnforcementMode `json:"enforcementMode,omitempty"` 2023 ProtectionMode *ProtectionMode `json:"protectionMode,omitempty"` 2024 // ConfigurationStatus - Possible values include: 'ConfigurationStatus2Configured', 'ConfigurationStatus2NotConfigured', 'ConfigurationStatus2InProgress', 'ConfigurationStatus2Failed', 'ConfigurationStatus2NoStatus' 2025 ConfigurationStatus ConfigurationStatus2 `json:"configurationStatus,omitempty"` 2026 // RecommendationStatus - Possible values include: 'RecommendationStatusRecommended', 'RecommendationStatusNotRecommended', 'RecommendationStatusNotAvailable', 'RecommendationStatusNoStatus' 2027 RecommendationStatus RecommendationStatus `json:"recommendationStatus,omitempty"` 2028 Issues *[]AppWhitelistingIssueSummary `json:"issues,omitempty"` 2029 // SourceSystem - Possible values include: 'SourceSystemAzureAppLocker', 'SourceSystemAzureAuditD', 'SourceSystemNonAzureAppLocker', 'SourceSystemNonAzureAuditD', 'SourceSystemNone' 2030 SourceSystem SourceSystem `json:"sourceSystem,omitempty"` 2031 VMRecommendations *[]VMRecommendation `json:"vmRecommendations,omitempty"` 2032 PathRecommendations *[]PathRecommendation `json:"pathRecommendations,omitempty"` 2033} 2034 2035// AppWhitelistingGroups represents a list of VM/server groups and set of rules that are Recommended by 2036// Azure Security Center to be allowed 2037type AppWhitelistingGroups struct { 2038 autorest.Response `json:"-"` 2039 Value *[]AppWhitelistingGroup `json:"value,omitempty"` 2040} 2041 2042// AppWhitelistingIssueSummary represents a summary of the alerts of the VM/server group 2043type AppWhitelistingIssueSummary struct { 2044 // Issue - Possible values include: 'ViolationsAudited', 'ViolationsBlocked', 'MsiAndScriptViolationsAudited', 'MsiAndScriptViolationsBlocked', 'ExecutableViolationsAudited', 'RulesViolatedManually' 2045 Issue Issue `json:"issue,omitempty"` 2046 // NumberOfVms - The number of machines in the VM/server group that have this alert 2047 NumberOfVms *float64 `json:"numberOfVms,omitempty"` 2048} 2049 2050// AppWhitelistingPutGroupData the altered data of the recommended VM/server group policy 2051type AppWhitelistingPutGroupData struct { 2052 // EnforcementMode - The enforcement mode of the group. Can also be defined per collection type by using ProtectionMode. Possible values include: 'EnforcementMode1Audit', 'EnforcementMode1Enforce', 'EnforcementMode1None' 2053 EnforcementMode EnforcementMode1 `json:"enforcementMode,omitempty"` 2054 // ProtectionMode - The protection mode of the group per collection type. Can also be defined for all collection types by using EnforcementMode 2055 ProtectionMode *ProtectionMode `json:"protectionMode,omitempty"` 2056 VMRecommendations *[]VMRecommendation `json:"vmRecommendations,omitempty"` 2057 PathRecommendations *[]PathRecommendation `json:"pathRecommendations,omitempty"` 2058} 2059 2060// AscLocation the ASC location of the subscription is in the "name" field 2061type AscLocation struct { 2062 autorest.Response `json:"-"` 2063 Properties interface{} `json:"properties,omitempty"` 2064 // ID - READ-ONLY; Resource Id 2065 ID *string `json:"id,omitempty"` 2066 // Name - READ-ONLY; Resource name 2067 Name *string `json:"name,omitempty"` 2068 // Type - READ-ONLY; Resource type 2069 Type *string `json:"type,omitempty"` 2070} 2071 2072// AscLocationList list of locations where ASC saves your data 2073type AscLocationList struct { 2074 autorest.Response `json:"-"` 2075 // Value - READ-ONLY 2076 Value *[]AscLocation `json:"value,omitempty"` 2077 // NextLink - READ-ONLY; The URI to fetch the next page. 2078 NextLink *string `json:"nextLink,omitempty"` 2079} 2080 2081// AscLocationListIterator provides access to a complete listing of AscLocation values. 2082type AscLocationListIterator struct { 2083 i int 2084 page AscLocationListPage 2085} 2086 2087// NextWithContext advances to the next value. If there was an error making 2088// the request the iterator does not advance and the error is returned. 2089func (iter *AscLocationListIterator) NextWithContext(ctx context.Context) (err error) { 2090 if tracing.IsEnabled() { 2091 ctx = tracing.StartSpan(ctx, fqdn+"/AscLocationListIterator.NextWithContext") 2092 defer func() { 2093 sc := -1 2094 if iter.Response().Response.Response != nil { 2095 sc = iter.Response().Response.Response.StatusCode 2096 } 2097 tracing.EndSpan(ctx, sc, err) 2098 }() 2099 } 2100 iter.i++ 2101 if iter.i < len(iter.page.Values()) { 2102 return nil 2103 } 2104 err = iter.page.NextWithContext(ctx) 2105 if err != nil { 2106 iter.i-- 2107 return err 2108 } 2109 iter.i = 0 2110 return nil 2111} 2112 2113// Next advances to the next value. If there was an error making 2114// the request the iterator does not advance and the error is returned. 2115// Deprecated: Use NextWithContext() instead. 2116func (iter *AscLocationListIterator) Next() error { 2117 return iter.NextWithContext(context.Background()) 2118} 2119 2120// NotDone returns true if the enumeration should be started or is not yet complete. 2121func (iter AscLocationListIterator) NotDone() bool { 2122 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2123} 2124 2125// Response returns the raw server response from the last page request. 2126func (iter AscLocationListIterator) Response() AscLocationList { 2127 return iter.page.Response() 2128} 2129 2130// Value returns the current value or a zero-initialized value if the 2131// iterator has advanced beyond the end of the collection. 2132func (iter AscLocationListIterator) Value() AscLocation { 2133 if !iter.page.NotDone() { 2134 return AscLocation{} 2135 } 2136 return iter.page.Values()[iter.i] 2137} 2138 2139// Creates a new instance of the AscLocationListIterator type. 2140func NewAscLocationListIterator(page AscLocationListPage) AscLocationListIterator { 2141 return AscLocationListIterator{page: page} 2142} 2143 2144// IsEmpty returns true if the ListResult contains no values. 2145func (all AscLocationList) IsEmpty() bool { 2146 return all.Value == nil || len(*all.Value) == 0 2147} 2148 2149// ascLocationListPreparer prepares a request to retrieve the next set of results. 2150// It returns nil if no more results exist. 2151func (all AscLocationList) ascLocationListPreparer(ctx context.Context) (*http.Request, error) { 2152 if all.NextLink == nil || len(to.String(all.NextLink)) < 1 { 2153 return nil, nil 2154 } 2155 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2156 autorest.AsJSON(), 2157 autorest.AsGet(), 2158 autorest.WithBaseURL(to.String(all.NextLink))) 2159} 2160 2161// AscLocationListPage contains a page of AscLocation values. 2162type AscLocationListPage struct { 2163 fn func(context.Context, AscLocationList) (AscLocationList, error) 2164 all AscLocationList 2165} 2166 2167// NextWithContext advances to the next page of values. If there was an error making 2168// the request the page does not advance and the error is returned. 2169func (page *AscLocationListPage) NextWithContext(ctx context.Context) (err error) { 2170 if tracing.IsEnabled() { 2171 ctx = tracing.StartSpan(ctx, fqdn+"/AscLocationListPage.NextWithContext") 2172 defer func() { 2173 sc := -1 2174 if page.Response().Response.Response != nil { 2175 sc = page.Response().Response.Response.StatusCode 2176 } 2177 tracing.EndSpan(ctx, sc, err) 2178 }() 2179 } 2180 next, err := page.fn(ctx, page.all) 2181 if err != nil { 2182 return err 2183 } 2184 page.all = next 2185 return nil 2186} 2187 2188// Next advances to the next page of values. If there was an error making 2189// the request the page does not advance and the error is returned. 2190// Deprecated: Use NextWithContext() instead. 2191func (page *AscLocationListPage) Next() error { 2192 return page.NextWithContext(context.Background()) 2193} 2194 2195// NotDone returns true if the page enumeration should be started or is not yet complete. 2196func (page AscLocationListPage) NotDone() bool { 2197 return !page.all.IsEmpty() 2198} 2199 2200// Response returns the raw server response from the last page request. 2201func (page AscLocationListPage) Response() AscLocationList { 2202 return page.all 2203} 2204 2205// Values returns the slice of values for the current page or nil if there are no values. 2206func (page AscLocationListPage) Values() []AscLocation { 2207 if page.all.IsEmpty() { 2208 return nil 2209 } 2210 return *page.all.Value 2211} 2212 2213// Creates a new instance of the AscLocationListPage type. 2214func NewAscLocationListPage(getNextPage func(context.Context, AscLocationList) (AscLocationList, error)) AscLocationListPage { 2215 return AscLocationListPage{fn: getNextPage} 2216} 2217 2218// AtaExternalSecuritySolution represents an ATA security solution which sends logs to an OMS workspace 2219type AtaExternalSecuritySolution struct { 2220 Properties *AtaSolutionProperties `json:"properties,omitempty"` 2221 // ID - READ-ONLY; Resource Id 2222 ID *string `json:"id,omitempty"` 2223 // Name - READ-ONLY; Resource name 2224 Name *string `json:"name,omitempty"` 2225 // Type - READ-ONLY; Resource type 2226 Type *string `json:"type,omitempty"` 2227 // Location - READ-ONLY; Location where the resource is stored 2228 Location *string `json:"location,omitempty"` 2229 // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' 2230 Kind KindEnum `json:"kind,omitempty"` 2231} 2232 2233// MarshalJSON is the custom marshaler for AtaExternalSecuritySolution. 2234func (aess AtaExternalSecuritySolution) MarshalJSON() ([]byte, error) { 2235 aess.Kind = KindATA 2236 objectMap := make(map[string]interface{}) 2237 if aess.Properties != nil { 2238 objectMap["properties"] = aess.Properties 2239 } 2240 if aess.Kind != "" { 2241 objectMap["kind"] = aess.Kind 2242 } 2243 return json.Marshal(objectMap) 2244} 2245 2246// AsCefExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. 2247func (aess AtaExternalSecuritySolution) AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) { 2248 return nil, false 2249} 2250 2251// AsAtaExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. 2252func (aess AtaExternalSecuritySolution) AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) { 2253 return &aess, true 2254} 2255 2256// AsAadExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. 2257func (aess AtaExternalSecuritySolution) AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) { 2258 return nil, false 2259} 2260 2261// AsExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. 2262func (aess AtaExternalSecuritySolution) AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) { 2263 return nil, false 2264} 2265 2266// AsBasicExternalSecuritySolution is the BasicExternalSecuritySolution implementation for AtaExternalSecuritySolution. 2267func (aess AtaExternalSecuritySolution) AsBasicExternalSecuritySolution() (BasicExternalSecuritySolution, bool) { 2268 return &aess, true 2269} 2270 2271// AtaSolutionProperties ... 2272type AtaSolutionProperties struct { 2273 LastEventReceived *string `json:"lastEventReceived,omitempty"` 2274 // AdditionalProperties - Unmatched properties from the message are deserialized this collection 2275 AdditionalProperties map[string]interface{} `json:""` 2276 DeviceVendor *string `json:"deviceVendor,omitempty"` 2277 DeviceType *string `json:"deviceType,omitempty"` 2278 Workspace *ConnectedWorkspace `json:"workspace,omitempty"` 2279} 2280 2281// MarshalJSON is the custom marshaler for AtaSolutionProperties. 2282func (asp AtaSolutionProperties) MarshalJSON() ([]byte, error) { 2283 objectMap := make(map[string]interface{}) 2284 if asp.LastEventReceived != nil { 2285 objectMap["lastEventReceived"] = asp.LastEventReceived 2286 } 2287 if asp.DeviceVendor != nil { 2288 objectMap["deviceVendor"] = asp.DeviceVendor 2289 } 2290 if asp.DeviceType != nil { 2291 objectMap["deviceType"] = asp.DeviceType 2292 } 2293 if asp.Workspace != nil { 2294 objectMap["workspace"] = asp.Workspace 2295 } 2296 for k, v := range asp.AdditionalProperties { 2297 objectMap[k] = v 2298 } 2299 return json.Marshal(objectMap) 2300} 2301 2302// UnmarshalJSON is the custom unmarshaler for AtaSolutionProperties struct. 2303func (asp *AtaSolutionProperties) UnmarshalJSON(body []byte) error { 2304 var m map[string]*json.RawMessage 2305 err := json.Unmarshal(body, &m) 2306 if err != nil { 2307 return err 2308 } 2309 for k, v := range m { 2310 switch k { 2311 case "lastEventReceived": 2312 if v != nil { 2313 var lastEventReceived string 2314 err = json.Unmarshal(*v, &lastEventReceived) 2315 if err != nil { 2316 return err 2317 } 2318 asp.LastEventReceived = &lastEventReceived 2319 } 2320 default: 2321 if v != nil { 2322 var additionalProperties interface{} 2323 err = json.Unmarshal(*v, &additionalProperties) 2324 if err != nil { 2325 return err 2326 } 2327 if asp.AdditionalProperties == nil { 2328 asp.AdditionalProperties = make(map[string]interface{}) 2329 } 2330 asp.AdditionalProperties[k] = additionalProperties 2331 } 2332 case "deviceVendor": 2333 if v != nil { 2334 var deviceVendor string 2335 err = json.Unmarshal(*v, &deviceVendor) 2336 if err != nil { 2337 return err 2338 } 2339 asp.DeviceVendor = &deviceVendor 2340 } 2341 case "deviceType": 2342 if v != nil { 2343 var deviceType string 2344 err = json.Unmarshal(*v, &deviceType) 2345 if err != nil { 2346 return err 2347 } 2348 asp.DeviceType = &deviceType 2349 } 2350 case "workspace": 2351 if v != nil { 2352 var workspace ConnectedWorkspace 2353 err = json.Unmarshal(*v, &workspace) 2354 if err != nil { 2355 return err 2356 } 2357 asp.Workspace = &workspace 2358 } 2359 } 2360 } 2361 2362 return nil 2363} 2364 2365// AutoProvisioningSetting auto provisioning setting 2366type AutoProvisioningSetting struct { 2367 autorest.Response `json:"-"` 2368 // AutoProvisioningSettingProperties - Auto provisioning setting data 2369 *AutoProvisioningSettingProperties `json:"properties,omitempty"` 2370 // ID - READ-ONLY; Resource Id 2371 ID *string `json:"id,omitempty"` 2372 // Name - READ-ONLY; Resource name 2373 Name *string `json:"name,omitempty"` 2374 // Type - READ-ONLY; Resource type 2375 Type *string `json:"type,omitempty"` 2376} 2377 2378// MarshalJSON is the custom marshaler for AutoProvisioningSetting. 2379func (aps AutoProvisioningSetting) MarshalJSON() ([]byte, error) { 2380 objectMap := make(map[string]interface{}) 2381 if aps.AutoProvisioningSettingProperties != nil { 2382 objectMap["properties"] = aps.AutoProvisioningSettingProperties 2383 } 2384 return json.Marshal(objectMap) 2385} 2386 2387// UnmarshalJSON is the custom unmarshaler for AutoProvisioningSetting struct. 2388func (aps *AutoProvisioningSetting) UnmarshalJSON(body []byte) error { 2389 var m map[string]*json.RawMessage 2390 err := json.Unmarshal(body, &m) 2391 if err != nil { 2392 return err 2393 } 2394 for k, v := range m { 2395 switch k { 2396 case "properties": 2397 if v != nil { 2398 var autoProvisioningSettingProperties AutoProvisioningSettingProperties 2399 err = json.Unmarshal(*v, &autoProvisioningSettingProperties) 2400 if err != nil { 2401 return err 2402 } 2403 aps.AutoProvisioningSettingProperties = &autoProvisioningSettingProperties 2404 } 2405 case "id": 2406 if v != nil { 2407 var ID string 2408 err = json.Unmarshal(*v, &ID) 2409 if err != nil { 2410 return err 2411 } 2412 aps.ID = &ID 2413 } 2414 case "name": 2415 if v != nil { 2416 var name string 2417 err = json.Unmarshal(*v, &name) 2418 if err != nil { 2419 return err 2420 } 2421 aps.Name = &name 2422 } 2423 case "type": 2424 if v != nil { 2425 var typeVar string 2426 err = json.Unmarshal(*v, &typeVar) 2427 if err != nil { 2428 return err 2429 } 2430 aps.Type = &typeVar 2431 } 2432 } 2433 } 2434 2435 return nil 2436} 2437 2438// AutoProvisioningSettingList list of all the auto provisioning settings response 2439type AutoProvisioningSettingList struct { 2440 autorest.Response `json:"-"` 2441 // Value - List of all the auto provisioning settings 2442 Value *[]AutoProvisioningSetting `json:"value,omitempty"` 2443 // NextLink - READ-ONLY; The URI to fetch the next page. 2444 NextLink *string `json:"nextLink,omitempty"` 2445} 2446 2447// AutoProvisioningSettingListIterator provides access to a complete listing of AutoProvisioningSetting 2448// values. 2449type AutoProvisioningSettingListIterator struct { 2450 i int 2451 page AutoProvisioningSettingListPage 2452} 2453 2454// NextWithContext advances to the next value. If there was an error making 2455// the request the iterator does not advance and the error is returned. 2456func (iter *AutoProvisioningSettingListIterator) NextWithContext(ctx context.Context) (err error) { 2457 if tracing.IsEnabled() { 2458 ctx = tracing.StartSpan(ctx, fqdn+"/AutoProvisioningSettingListIterator.NextWithContext") 2459 defer func() { 2460 sc := -1 2461 if iter.Response().Response.Response != nil { 2462 sc = iter.Response().Response.Response.StatusCode 2463 } 2464 tracing.EndSpan(ctx, sc, err) 2465 }() 2466 } 2467 iter.i++ 2468 if iter.i < len(iter.page.Values()) { 2469 return nil 2470 } 2471 err = iter.page.NextWithContext(ctx) 2472 if err != nil { 2473 iter.i-- 2474 return err 2475 } 2476 iter.i = 0 2477 return nil 2478} 2479 2480// Next advances to the next value. If there was an error making 2481// the request the iterator does not advance and the error is returned. 2482// Deprecated: Use NextWithContext() instead. 2483func (iter *AutoProvisioningSettingListIterator) Next() error { 2484 return iter.NextWithContext(context.Background()) 2485} 2486 2487// NotDone returns true if the enumeration should be started or is not yet complete. 2488func (iter AutoProvisioningSettingListIterator) NotDone() bool { 2489 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 2490} 2491 2492// Response returns the raw server response from the last page request. 2493func (iter AutoProvisioningSettingListIterator) Response() AutoProvisioningSettingList { 2494 return iter.page.Response() 2495} 2496 2497// Value returns the current value or a zero-initialized value if the 2498// iterator has advanced beyond the end of the collection. 2499func (iter AutoProvisioningSettingListIterator) Value() AutoProvisioningSetting { 2500 if !iter.page.NotDone() { 2501 return AutoProvisioningSetting{} 2502 } 2503 return iter.page.Values()[iter.i] 2504} 2505 2506// Creates a new instance of the AutoProvisioningSettingListIterator type. 2507func NewAutoProvisioningSettingListIterator(page AutoProvisioningSettingListPage) AutoProvisioningSettingListIterator { 2508 return AutoProvisioningSettingListIterator{page: page} 2509} 2510 2511// IsEmpty returns true if the ListResult contains no values. 2512func (apsl AutoProvisioningSettingList) IsEmpty() bool { 2513 return apsl.Value == nil || len(*apsl.Value) == 0 2514} 2515 2516// autoProvisioningSettingListPreparer prepares a request to retrieve the next set of results. 2517// It returns nil if no more results exist. 2518func (apsl AutoProvisioningSettingList) autoProvisioningSettingListPreparer(ctx context.Context) (*http.Request, error) { 2519 if apsl.NextLink == nil || len(to.String(apsl.NextLink)) < 1 { 2520 return nil, nil 2521 } 2522 return autorest.Prepare((&http.Request{}).WithContext(ctx), 2523 autorest.AsJSON(), 2524 autorest.AsGet(), 2525 autorest.WithBaseURL(to.String(apsl.NextLink))) 2526} 2527 2528// AutoProvisioningSettingListPage contains a page of AutoProvisioningSetting values. 2529type AutoProvisioningSettingListPage struct { 2530 fn func(context.Context, AutoProvisioningSettingList) (AutoProvisioningSettingList, error) 2531 apsl AutoProvisioningSettingList 2532} 2533 2534// NextWithContext advances to the next page of values. If there was an error making 2535// the request the page does not advance and the error is returned. 2536func (page *AutoProvisioningSettingListPage) NextWithContext(ctx context.Context) (err error) { 2537 if tracing.IsEnabled() { 2538 ctx = tracing.StartSpan(ctx, fqdn+"/AutoProvisioningSettingListPage.NextWithContext") 2539 defer func() { 2540 sc := -1 2541 if page.Response().Response.Response != nil { 2542 sc = page.Response().Response.Response.StatusCode 2543 } 2544 tracing.EndSpan(ctx, sc, err) 2545 }() 2546 } 2547 next, err := page.fn(ctx, page.apsl) 2548 if err != nil { 2549 return err 2550 } 2551 page.apsl = next 2552 return nil 2553} 2554 2555// Next advances to the next page of values. If there was an error making 2556// the request the page does not advance and the error is returned. 2557// Deprecated: Use NextWithContext() instead. 2558func (page *AutoProvisioningSettingListPage) Next() error { 2559 return page.NextWithContext(context.Background()) 2560} 2561 2562// NotDone returns true if the page enumeration should be started or is not yet complete. 2563func (page AutoProvisioningSettingListPage) NotDone() bool { 2564 return !page.apsl.IsEmpty() 2565} 2566 2567// Response returns the raw server response from the last page request. 2568func (page AutoProvisioningSettingListPage) Response() AutoProvisioningSettingList { 2569 return page.apsl 2570} 2571 2572// Values returns the slice of values for the current page or nil if there are no values. 2573func (page AutoProvisioningSettingListPage) Values() []AutoProvisioningSetting { 2574 if page.apsl.IsEmpty() { 2575 return nil 2576 } 2577 return *page.apsl.Value 2578} 2579 2580// Creates a new instance of the AutoProvisioningSettingListPage type. 2581func NewAutoProvisioningSettingListPage(getNextPage func(context.Context, AutoProvisioningSettingList) (AutoProvisioningSettingList, error)) AutoProvisioningSettingListPage { 2582 return AutoProvisioningSettingListPage{fn: getNextPage} 2583} 2584 2585// AutoProvisioningSettingProperties describes properties of an auto provisioning setting 2586type AutoProvisioningSettingProperties struct { 2587 // AutoProvision - Describes what kind of security agent provisioning action to take. Possible values include: 'AutoProvisionOn', 'AutoProvisionOff' 2588 AutoProvision AutoProvision `json:"autoProvision,omitempty"` 2589} 2590 2591// AwsResourceDetails details of the resource that was assessed 2592type AwsResourceDetails struct { 2593 // AccountID - READ-ONLY; AWS account ID 2594 AccountID *string `json:"accountId,omitempty"` 2595 // AwsResourceID - READ-ONLY; AWS resource ID. can be ARN or other 2596 AwsResourceID *string `json:"awsResourceId,omitempty"` 2597 // Source - Possible values include: 'SourceResourceDetails', 'SourceAzure', 'SourceAws' 2598 Source Source `json:"source,omitempty"` 2599} 2600 2601// MarshalJSON is the custom marshaler for AwsResourceDetails. 2602func (ard AwsResourceDetails) MarshalJSON() ([]byte, error) { 2603 ard.Source = SourceAws 2604 objectMap := make(map[string]interface{}) 2605 if ard.Source != "" { 2606 objectMap["source"] = ard.Source 2607 } 2608 return json.Marshal(objectMap) 2609} 2610 2611// AsAzureResourceDetails is the BasicResourceDetails implementation for AwsResourceDetails. 2612func (ard AwsResourceDetails) AsAzureResourceDetails() (*AzureResourceDetails, bool) { 2613 return nil, false 2614} 2615 2616// AsAwsResourceDetails is the BasicResourceDetails implementation for AwsResourceDetails. 2617func (ard AwsResourceDetails) AsAwsResourceDetails() (*AwsResourceDetails, bool) { 2618 return &ard, true 2619} 2620 2621// AsResourceDetails is the BasicResourceDetails implementation for AwsResourceDetails. 2622func (ard AwsResourceDetails) AsResourceDetails() (*ResourceDetails, bool) { 2623 return nil, false 2624} 2625 2626// AsBasicResourceDetails is the BasicResourceDetails implementation for AwsResourceDetails. 2627func (ard AwsResourceDetails) AsBasicResourceDetails() (BasicResourceDetails, bool) { 2628 return &ard, true 2629} 2630 2631// AzureResourceDetails details of the resource that was assessed 2632type AzureResourceDetails struct { 2633 // ID - READ-ONLY; Azure resource ID of the assessed resource 2634 ID *string `json:"id,omitempty"` 2635 // Source - Possible values include: 'SourceResourceDetails', 'SourceAzure', 'SourceAws' 2636 Source Source `json:"source,omitempty"` 2637} 2638 2639// MarshalJSON is the custom marshaler for AzureResourceDetails. 2640func (ard AzureResourceDetails) MarshalJSON() ([]byte, error) { 2641 ard.Source = SourceAzure 2642 objectMap := make(map[string]interface{}) 2643 if ard.Source != "" { 2644 objectMap["source"] = ard.Source 2645 } 2646 return json.Marshal(objectMap) 2647} 2648 2649// AsAzureResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. 2650func (ard AzureResourceDetails) AsAzureResourceDetails() (*AzureResourceDetails, bool) { 2651 return &ard, true 2652} 2653 2654// AsAwsResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. 2655func (ard AzureResourceDetails) AsAwsResourceDetails() (*AwsResourceDetails, bool) { 2656 return nil, false 2657} 2658 2659// AsResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. 2660func (ard AzureResourceDetails) AsResourceDetails() (*ResourceDetails, bool) { 2661 return nil, false 2662} 2663 2664// AsBasicResourceDetails is the BasicResourceDetails implementation for AzureResourceDetails. 2665func (ard AzureResourceDetails) AsBasicResourceDetails() (BasicResourceDetails, bool) { 2666 return &ard, true 2667} 2668 2669// CefExternalSecuritySolution represents a security solution which sends CEF logs to an OMS workspace 2670type CefExternalSecuritySolution struct { 2671 Properties *CefSolutionProperties `json:"properties,omitempty"` 2672 // ID - READ-ONLY; Resource Id 2673 ID *string `json:"id,omitempty"` 2674 // Name - READ-ONLY; Resource name 2675 Name *string `json:"name,omitempty"` 2676 // Type - READ-ONLY; Resource type 2677 Type *string `json:"type,omitempty"` 2678 // Location - READ-ONLY; Location where the resource is stored 2679 Location *string `json:"location,omitempty"` 2680 // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' 2681 Kind KindEnum `json:"kind,omitempty"` 2682} 2683 2684// MarshalJSON is the custom marshaler for CefExternalSecuritySolution. 2685func (cess CefExternalSecuritySolution) MarshalJSON() ([]byte, error) { 2686 cess.Kind = KindCEF 2687 objectMap := make(map[string]interface{}) 2688 if cess.Properties != nil { 2689 objectMap["properties"] = cess.Properties 2690 } 2691 if cess.Kind != "" { 2692 objectMap["kind"] = cess.Kind 2693 } 2694 return json.Marshal(objectMap) 2695} 2696 2697// AsCefExternalSecuritySolution is the BasicExternalSecuritySolution implementation for CefExternalSecuritySolution. 2698func (cess CefExternalSecuritySolution) AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) { 2699 return &cess, true 2700} 2701 2702// AsAtaExternalSecuritySolution is the BasicExternalSecuritySolution implementation for CefExternalSecuritySolution. 2703func (cess CefExternalSecuritySolution) AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) { 2704 return nil, false 2705} 2706 2707// AsAadExternalSecuritySolution is the BasicExternalSecuritySolution implementation for CefExternalSecuritySolution. 2708func (cess CefExternalSecuritySolution) AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) { 2709 return nil, false 2710} 2711 2712// AsExternalSecuritySolution is the BasicExternalSecuritySolution implementation for CefExternalSecuritySolution. 2713func (cess CefExternalSecuritySolution) AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) { 2714 return nil, false 2715} 2716 2717// AsBasicExternalSecuritySolution is the BasicExternalSecuritySolution implementation for CefExternalSecuritySolution. 2718func (cess CefExternalSecuritySolution) AsBasicExternalSecuritySolution() (BasicExternalSecuritySolution, bool) { 2719 return &cess, true 2720} 2721 2722// CefSolutionProperties ... 2723type CefSolutionProperties struct { 2724 Hostname *string `json:"hostname,omitempty"` 2725 Agent *string `json:"agent,omitempty"` 2726 LastEventReceived *string `json:"lastEventReceived,omitempty"` 2727 // AdditionalProperties - Unmatched properties from the message are deserialized this collection 2728 AdditionalProperties map[string]interface{} `json:""` 2729 DeviceVendor *string `json:"deviceVendor,omitempty"` 2730 DeviceType *string `json:"deviceType,omitempty"` 2731 Workspace *ConnectedWorkspace `json:"workspace,omitempty"` 2732} 2733 2734// MarshalJSON is the custom marshaler for CefSolutionProperties. 2735func (csp CefSolutionProperties) MarshalJSON() ([]byte, error) { 2736 objectMap := make(map[string]interface{}) 2737 if csp.Hostname != nil { 2738 objectMap["hostname"] = csp.Hostname 2739 } 2740 if csp.Agent != nil { 2741 objectMap["agent"] = csp.Agent 2742 } 2743 if csp.LastEventReceived != nil { 2744 objectMap["lastEventReceived"] = csp.LastEventReceived 2745 } 2746 if csp.DeviceVendor != nil { 2747 objectMap["deviceVendor"] = csp.DeviceVendor 2748 } 2749 if csp.DeviceType != nil { 2750 objectMap["deviceType"] = csp.DeviceType 2751 } 2752 if csp.Workspace != nil { 2753 objectMap["workspace"] = csp.Workspace 2754 } 2755 for k, v := range csp.AdditionalProperties { 2756 objectMap[k] = v 2757 } 2758 return json.Marshal(objectMap) 2759} 2760 2761// UnmarshalJSON is the custom unmarshaler for CefSolutionProperties struct. 2762func (csp *CefSolutionProperties) UnmarshalJSON(body []byte) error { 2763 var m map[string]*json.RawMessage 2764 err := json.Unmarshal(body, &m) 2765 if err != nil { 2766 return err 2767 } 2768 for k, v := range m { 2769 switch k { 2770 case "hostname": 2771 if v != nil { 2772 var hostname string 2773 err = json.Unmarshal(*v, &hostname) 2774 if err != nil { 2775 return err 2776 } 2777 csp.Hostname = &hostname 2778 } 2779 case "agent": 2780 if v != nil { 2781 var agent string 2782 err = json.Unmarshal(*v, &agent) 2783 if err != nil { 2784 return err 2785 } 2786 csp.Agent = &agent 2787 } 2788 case "lastEventReceived": 2789 if v != nil { 2790 var lastEventReceived string 2791 err = json.Unmarshal(*v, &lastEventReceived) 2792 if err != nil { 2793 return err 2794 } 2795 csp.LastEventReceived = &lastEventReceived 2796 } 2797 default: 2798 if v != nil { 2799 var additionalProperties interface{} 2800 err = json.Unmarshal(*v, &additionalProperties) 2801 if err != nil { 2802 return err 2803 } 2804 if csp.AdditionalProperties == nil { 2805 csp.AdditionalProperties = make(map[string]interface{}) 2806 } 2807 csp.AdditionalProperties[k] = additionalProperties 2808 } 2809 case "deviceVendor": 2810 if v != nil { 2811 var deviceVendor string 2812 err = json.Unmarshal(*v, &deviceVendor) 2813 if err != nil { 2814 return err 2815 } 2816 csp.DeviceVendor = &deviceVendor 2817 } 2818 case "deviceType": 2819 if v != nil { 2820 var deviceType string 2821 err = json.Unmarshal(*v, &deviceType) 2822 if err != nil { 2823 return err 2824 } 2825 csp.DeviceType = &deviceType 2826 } 2827 case "workspace": 2828 if v != nil { 2829 var workspace ConnectedWorkspace 2830 err = json.Unmarshal(*v, &workspace) 2831 if err != nil { 2832 return err 2833 } 2834 csp.Workspace = &workspace 2835 } 2836 } 2837 } 2838 2839 return nil 2840} 2841 2842// CloudError error response structure. 2843type CloudError struct { 2844 // CloudErrorBody - Error data 2845 *CloudErrorBody `json:"error,omitempty"` 2846} 2847 2848// MarshalJSON is the custom marshaler for CloudError. 2849func (ce CloudError) MarshalJSON() ([]byte, error) { 2850 objectMap := make(map[string]interface{}) 2851 if ce.CloudErrorBody != nil { 2852 objectMap["error"] = ce.CloudErrorBody 2853 } 2854 return json.Marshal(objectMap) 2855} 2856 2857// UnmarshalJSON is the custom unmarshaler for CloudError struct. 2858func (ce *CloudError) UnmarshalJSON(body []byte) error { 2859 var m map[string]*json.RawMessage 2860 err := json.Unmarshal(body, &m) 2861 if err != nil { 2862 return err 2863 } 2864 for k, v := range m { 2865 switch k { 2866 case "error": 2867 if v != nil { 2868 var cloudErrorBody CloudErrorBody 2869 err = json.Unmarshal(*v, &cloudErrorBody) 2870 if err != nil { 2871 return err 2872 } 2873 ce.CloudErrorBody = &cloudErrorBody 2874 } 2875 } 2876 } 2877 2878 return nil 2879} 2880 2881// CloudErrorBody error details. 2882type CloudErrorBody struct { 2883 // Code - READ-ONLY; An identifier for the error. Codes are invariant and are intended to be consumed programmatically. 2884 Code *string `json:"code,omitempty"` 2885 // Message - READ-ONLY; A message describing the error, intended to be suitable for display in a user interface. 2886 Message *string `json:"message,omitempty"` 2887} 2888 2889// Compliance compliance of a scope 2890type Compliance struct { 2891 autorest.Response `json:"-"` 2892 // ComplianceProperties - Compliance data 2893 *ComplianceProperties `json:"properties,omitempty"` 2894 // ID - READ-ONLY; Resource Id 2895 ID *string `json:"id,omitempty"` 2896 // Name - READ-ONLY; Resource name 2897 Name *string `json:"name,omitempty"` 2898 // Type - READ-ONLY; Resource type 2899 Type *string `json:"type,omitempty"` 2900} 2901 2902// MarshalJSON is the custom marshaler for Compliance. 2903func (c Compliance) MarshalJSON() ([]byte, error) { 2904 objectMap := make(map[string]interface{}) 2905 if c.ComplianceProperties != nil { 2906 objectMap["properties"] = c.ComplianceProperties 2907 } 2908 return json.Marshal(objectMap) 2909} 2910 2911// UnmarshalJSON is the custom unmarshaler for Compliance struct. 2912func (c *Compliance) UnmarshalJSON(body []byte) error { 2913 var m map[string]*json.RawMessage 2914 err := json.Unmarshal(body, &m) 2915 if err != nil { 2916 return err 2917 } 2918 for k, v := range m { 2919 switch k { 2920 case "properties": 2921 if v != nil { 2922 var complianceProperties ComplianceProperties 2923 err = json.Unmarshal(*v, &complianceProperties) 2924 if err != nil { 2925 return err 2926 } 2927 c.ComplianceProperties = &complianceProperties 2928 } 2929 case "id": 2930 if v != nil { 2931 var ID string 2932 err = json.Unmarshal(*v, &ID) 2933 if err != nil { 2934 return err 2935 } 2936 c.ID = &ID 2937 } 2938 case "name": 2939 if v != nil { 2940 var name string 2941 err = json.Unmarshal(*v, &name) 2942 if err != nil { 2943 return err 2944 } 2945 c.Name = &name 2946 } 2947 case "type": 2948 if v != nil { 2949 var typeVar string 2950 err = json.Unmarshal(*v, &typeVar) 2951 if err != nil { 2952 return err 2953 } 2954 c.Type = &typeVar 2955 } 2956 } 2957 } 2958 2959 return nil 2960} 2961 2962// ComplianceList list of Compliance objects response 2963type ComplianceList struct { 2964 autorest.Response `json:"-"` 2965 // Value - List of Compliance objects 2966 Value *[]Compliance `json:"value,omitempty"` 2967 // NextLink - READ-ONLY; The URI to fetch the next page. 2968 NextLink *string `json:"nextLink,omitempty"` 2969} 2970 2971// ComplianceListIterator provides access to a complete listing of Compliance values. 2972type ComplianceListIterator struct { 2973 i int 2974 page ComplianceListPage 2975} 2976 2977// NextWithContext advances to the next value. If there was an error making 2978// the request the iterator does not advance and the error is returned. 2979func (iter *ComplianceListIterator) NextWithContext(ctx context.Context) (err error) { 2980 if tracing.IsEnabled() { 2981 ctx = tracing.StartSpan(ctx, fqdn+"/ComplianceListIterator.NextWithContext") 2982 defer func() { 2983 sc := -1 2984 if iter.Response().Response.Response != nil { 2985 sc = iter.Response().Response.Response.StatusCode 2986 } 2987 tracing.EndSpan(ctx, sc, err) 2988 }() 2989 } 2990 iter.i++ 2991 if iter.i < len(iter.page.Values()) { 2992 return nil 2993 } 2994 err = iter.page.NextWithContext(ctx) 2995 if err != nil { 2996 iter.i-- 2997 return err 2998 } 2999 iter.i = 0 3000 return nil 3001} 3002 3003// Next advances to the next value. If there was an error making 3004// the request the iterator does not advance and the error is returned. 3005// Deprecated: Use NextWithContext() instead. 3006func (iter *ComplianceListIterator) Next() error { 3007 return iter.NextWithContext(context.Background()) 3008} 3009 3010// NotDone returns true if the enumeration should be started or is not yet complete. 3011func (iter ComplianceListIterator) NotDone() bool { 3012 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3013} 3014 3015// Response returns the raw server response from the last page request. 3016func (iter ComplianceListIterator) Response() ComplianceList { 3017 return iter.page.Response() 3018} 3019 3020// Value returns the current value or a zero-initialized value if the 3021// iterator has advanced beyond the end of the collection. 3022func (iter ComplianceListIterator) Value() Compliance { 3023 if !iter.page.NotDone() { 3024 return Compliance{} 3025 } 3026 return iter.page.Values()[iter.i] 3027} 3028 3029// Creates a new instance of the ComplianceListIterator type. 3030func NewComplianceListIterator(page ComplianceListPage) ComplianceListIterator { 3031 return ComplianceListIterator{page: page} 3032} 3033 3034// IsEmpty returns true if the ListResult contains no values. 3035func (cl ComplianceList) IsEmpty() bool { 3036 return cl.Value == nil || len(*cl.Value) == 0 3037} 3038 3039// complianceListPreparer prepares a request to retrieve the next set of results. 3040// It returns nil if no more results exist. 3041func (cl ComplianceList) complianceListPreparer(ctx context.Context) (*http.Request, error) { 3042 if cl.NextLink == nil || len(to.String(cl.NextLink)) < 1 { 3043 return nil, nil 3044 } 3045 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3046 autorest.AsJSON(), 3047 autorest.AsGet(), 3048 autorest.WithBaseURL(to.String(cl.NextLink))) 3049} 3050 3051// ComplianceListPage contains a page of Compliance values. 3052type ComplianceListPage struct { 3053 fn func(context.Context, ComplianceList) (ComplianceList, error) 3054 cl ComplianceList 3055} 3056 3057// NextWithContext advances to the next page of values. If there was an error making 3058// the request the page does not advance and the error is returned. 3059func (page *ComplianceListPage) NextWithContext(ctx context.Context) (err error) { 3060 if tracing.IsEnabled() { 3061 ctx = tracing.StartSpan(ctx, fqdn+"/ComplianceListPage.NextWithContext") 3062 defer func() { 3063 sc := -1 3064 if page.Response().Response.Response != nil { 3065 sc = page.Response().Response.Response.StatusCode 3066 } 3067 tracing.EndSpan(ctx, sc, err) 3068 }() 3069 } 3070 next, err := page.fn(ctx, page.cl) 3071 if err != nil { 3072 return err 3073 } 3074 page.cl = next 3075 return nil 3076} 3077 3078// Next advances to the next page of values. If there was an error making 3079// the request the page does not advance and the error is returned. 3080// Deprecated: Use NextWithContext() instead. 3081func (page *ComplianceListPage) Next() error { 3082 return page.NextWithContext(context.Background()) 3083} 3084 3085// NotDone returns true if the page enumeration should be started or is not yet complete. 3086func (page ComplianceListPage) NotDone() bool { 3087 return !page.cl.IsEmpty() 3088} 3089 3090// Response returns the raw server response from the last page request. 3091func (page ComplianceListPage) Response() ComplianceList { 3092 return page.cl 3093} 3094 3095// Values returns the slice of values for the current page or nil if there are no values. 3096func (page ComplianceListPage) Values() []Compliance { 3097 if page.cl.IsEmpty() { 3098 return nil 3099 } 3100 return *page.cl.Value 3101} 3102 3103// Creates a new instance of the ComplianceListPage type. 3104func NewComplianceListPage(getNextPage func(context.Context, ComplianceList) (ComplianceList, error)) ComplianceListPage { 3105 return ComplianceListPage{fn: getNextPage} 3106} 3107 3108// ComplianceProperties the Compliance score (percentage) of a Subscription is a sum of all Resources' 3109// Compliances under the given Subscription. A Resource Compliance is defined as the compliant ('healthy') 3110// Policy Definitions out of all Policy Definitions applicable to a given resource. 3111type ComplianceProperties struct { 3112 // AssessmentTimestampUtcDate - READ-ONLY; The timestamp when the Compliance calculation was conducted. 3113 AssessmentTimestampUtcDate *date.Time `json:"assessmentTimestampUtcDate,omitempty"` 3114 // ResourceCount - READ-ONLY; The resource count of the given subscription for which the Compliance calculation was conducted (needed for Management Group Compliance calculation). 3115 ResourceCount *int32 `json:"resourceCount,omitempty"` 3116 // AssessmentResult - READ-ONLY; An array of segment, which is the actually the compliance assessment. 3117 AssessmentResult *[]ComplianceSegment `json:"assessmentResult,omitempty"` 3118} 3119 3120// ComplianceSegment a segment of a compliance assessment. 3121type ComplianceSegment struct { 3122 // SegmentType - READ-ONLY; The segment type, e.g. compliant, non-compliance, insufficient coverage, N/A, etc. 3123 SegmentType *string `json:"segmentType,omitempty"` 3124 // Percentage - READ-ONLY; The size (%) of the segment. 3125 Percentage *float64 `json:"percentage,omitempty"` 3126} 3127 3128// ConnectableResource describes the allowed inbound and outbound traffic of an Azure resource 3129type ConnectableResource struct { 3130 // ID - READ-ONLY; The Azure resource id 3131 ID *string `json:"id,omitempty"` 3132 // InboundConnectedResources - READ-ONLY; The list of Azure resources that the resource has inbound allowed connection from 3133 InboundConnectedResources *[]ConnectedResource `json:"inboundConnectedResources,omitempty"` 3134 // OutboundConnectedResources - READ-ONLY; The list of Azure resources that the resource has outbound allowed connection to 3135 OutboundConnectedResources *[]ConnectedResource `json:"outboundConnectedResources,omitempty"` 3136} 3137 3138// ConnectedResource describes properties of a connected resource 3139type ConnectedResource struct { 3140 // ConnectedResourceID - READ-ONLY; The Azure resource id of the connected resource 3141 ConnectedResourceID *string `json:"connectedResourceId,omitempty"` 3142 // TCPPorts - READ-ONLY; The allowed tcp ports 3143 TCPPorts *string `json:"tcpPorts,omitempty"` 3144 // UDPPorts - READ-ONLY; The allowed udp ports 3145 UDPPorts *string `json:"udpPorts,omitempty"` 3146} 3147 3148// ConnectedWorkspace ... 3149type ConnectedWorkspace struct { 3150 // ID - Azure resource ID of the connected OMS workspace 3151 ID *string `json:"id,omitempty"` 3152} 3153 3154// Contact contact details for security issues 3155type Contact struct { 3156 autorest.Response `json:"-"` 3157 // ContactProperties - Security contact data 3158 *ContactProperties `json:"properties,omitempty"` 3159 // ID - READ-ONLY; Resource Id 3160 ID *string `json:"id,omitempty"` 3161 // Name - READ-ONLY; Resource name 3162 Name *string `json:"name,omitempty"` 3163 // Type - READ-ONLY; Resource type 3164 Type *string `json:"type,omitempty"` 3165} 3166 3167// MarshalJSON is the custom marshaler for Contact. 3168func (c Contact) MarshalJSON() ([]byte, error) { 3169 objectMap := make(map[string]interface{}) 3170 if c.ContactProperties != nil { 3171 objectMap["properties"] = c.ContactProperties 3172 } 3173 return json.Marshal(objectMap) 3174} 3175 3176// UnmarshalJSON is the custom unmarshaler for Contact struct. 3177func (c *Contact) UnmarshalJSON(body []byte) error { 3178 var m map[string]*json.RawMessage 3179 err := json.Unmarshal(body, &m) 3180 if err != nil { 3181 return err 3182 } 3183 for k, v := range m { 3184 switch k { 3185 case "properties": 3186 if v != nil { 3187 var contactProperties ContactProperties 3188 err = json.Unmarshal(*v, &contactProperties) 3189 if err != nil { 3190 return err 3191 } 3192 c.ContactProperties = &contactProperties 3193 } 3194 case "id": 3195 if v != nil { 3196 var ID string 3197 err = json.Unmarshal(*v, &ID) 3198 if err != nil { 3199 return err 3200 } 3201 c.ID = &ID 3202 } 3203 case "name": 3204 if v != nil { 3205 var name string 3206 err = json.Unmarshal(*v, &name) 3207 if err != nil { 3208 return err 3209 } 3210 c.Name = &name 3211 } 3212 case "type": 3213 if v != nil { 3214 var typeVar string 3215 err = json.Unmarshal(*v, &typeVar) 3216 if err != nil { 3217 return err 3218 } 3219 c.Type = &typeVar 3220 } 3221 } 3222 } 3223 3224 return nil 3225} 3226 3227// ContactList list of security contacts response 3228type ContactList struct { 3229 autorest.Response `json:"-"` 3230 // Value - READ-ONLY; List of security contacts 3231 Value *[]Contact `json:"value,omitempty"` 3232 // NextLink - READ-ONLY; The URI to fetch the next page. 3233 NextLink *string `json:"nextLink,omitempty"` 3234} 3235 3236// ContactListIterator provides access to a complete listing of Contact values. 3237type ContactListIterator struct { 3238 i int 3239 page ContactListPage 3240} 3241 3242// NextWithContext advances to the next value. If there was an error making 3243// the request the iterator does not advance and the error is returned. 3244func (iter *ContactListIterator) NextWithContext(ctx context.Context) (err error) { 3245 if tracing.IsEnabled() { 3246 ctx = tracing.StartSpan(ctx, fqdn+"/ContactListIterator.NextWithContext") 3247 defer func() { 3248 sc := -1 3249 if iter.Response().Response.Response != nil { 3250 sc = iter.Response().Response.Response.StatusCode 3251 } 3252 tracing.EndSpan(ctx, sc, err) 3253 }() 3254 } 3255 iter.i++ 3256 if iter.i < len(iter.page.Values()) { 3257 return nil 3258 } 3259 err = iter.page.NextWithContext(ctx) 3260 if err != nil { 3261 iter.i-- 3262 return err 3263 } 3264 iter.i = 0 3265 return nil 3266} 3267 3268// Next advances to the next value. If there was an error making 3269// the request the iterator does not advance and the error is returned. 3270// Deprecated: Use NextWithContext() instead. 3271func (iter *ContactListIterator) Next() error { 3272 return iter.NextWithContext(context.Background()) 3273} 3274 3275// NotDone returns true if the enumeration should be started or is not yet complete. 3276func (iter ContactListIterator) NotDone() bool { 3277 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3278} 3279 3280// Response returns the raw server response from the last page request. 3281func (iter ContactListIterator) Response() ContactList { 3282 return iter.page.Response() 3283} 3284 3285// Value returns the current value or a zero-initialized value if the 3286// iterator has advanced beyond the end of the collection. 3287func (iter ContactListIterator) Value() Contact { 3288 if !iter.page.NotDone() { 3289 return Contact{} 3290 } 3291 return iter.page.Values()[iter.i] 3292} 3293 3294// Creates a new instance of the ContactListIterator type. 3295func NewContactListIterator(page ContactListPage) ContactListIterator { 3296 return ContactListIterator{page: page} 3297} 3298 3299// IsEmpty returns true if the ListResult contains no values. 3300func (cl ContactList) IsEmpty() bool { 3301 return cl.Value == nil || len(*cl.Value) == 0 3302} 3303 3304// contactListPreparer prepares a request to retrieve the next set of results. 3305// It returns nil if no more results exist. 3306func (cl ContactList) contactListPreparer(ctx context.Context) (*http.Request, error) { 3307 if cl.NextLink == nil || len(to.String(cl.NextLink)) < 1 { 3308 return nil, nil 3309 } 3310 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3311 autorest.AsJSON(), 3312 autorest.AsGet(), 3313 autorest.WithBaseURL(to.String(cl.NextLink))) 3314} 3315 3316// ContactListPage contains a page of Contact values. 3317type ContactListPage struct { 3318 fn func(context.Context, ContactList) (ContactList, error) 3319 cl ContactList 3320} 3321 3322// NextWithContext advances to the next page of values. If there was an error making 3323// the request the page does not advance and the error is returned. 3324func (page *ContactListPage) NextWithContext(ctx context.Context) (err error) { 3325 if tracing.IsEnabled() { 3326 ctx = tracing.StartSpan(ctx, fqdn+"/ContactListPage.NextWithContext") 3327 defer func() { 3328 sc := -1 3329 if page.Response().Response.Response != nil { 3330 sc = page.Response().Response.Response.StatusCode 3331 } 3332 tracing.EndSpan(ctx, sc, err) 3333 }() 3334 } 3335 next, err := page.fn(ctx, page.cl) 3336 if err != nil { 3337 return err 3338 } 3339 page.cl = next 3340 return nil 3341} 3342 3343// Next advances to the next page of values. If there was an error making 3344// the request the page does not advance and the error is returned. 3345// Deprecated: Use NextWithContext() instead. 3346func (page *ContactListPage) Next() error { 3347 return page.NextWithContext(context.Background()) 3348} 3349 3350// NotDone returns true if the page enumeration should be started or is not yet complete. 3351func (page ContactListPage) NotDone() bool { 3352 return !page.cl.IsEmpty() 3353} 3354 3355// Response returns the raw server response from the last page request. 3356func (page ContactListPage) Response() ContactList { 3357 return page.cl 3358} 3359 3360// Values returns the slice of values for the current page or nil if there are no values. 3361func (page ContactListPage) Values() []Contact { 3362 if page.cl.IsEmpty() { 3363 return nil 3364 } 3365 return *page.cl.Value 3366} 3367 3368// Creates a new instance of the ContactListPage type. 3369func NewContactListPage(getNextPage func(context.Context, ContactList) (ContactList, error)) ContactListPage { 3370 return ContactListPage{fn: getNextPage} 3371} 3372 3373// ContactProperties describes security contact properties 3374type ContactProperties struct { 3375 // Email - The email of this security contact 3376 Email *string `json:"email,omitempty"` 3377 // Phone - The phone number of this security contact 3378 Phone *string `json:"phone,omitempty"` 3379 // AlertNotifications - Whether to send security alerts notifications to the security contact. Possible values include: 'On', 'Off' 3380 AlertNotifications AlertNotifications `json:"alertNotifications,omitempty"` 3381 // AlertsToAdmins - Whether to send security alerts notifications to subscription admins. Possible values include: 'AlertsToAdminsOn', 'AlertsToAdminsOff' 3382 AlertsToAdmins AlertsToAdmins `json:"alertsToAdmins,omitempty"` 3383} 3384 3385// ContainerRegistryVulnerabilityProperties additional context fields for container registry Vulnerability 3386// assessment 3387type ContainerRegistryVulnerabilityProperties struct { 3388 // Type - READ-ONLY; Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered, Vulnerability 3389 Type *string `json:"type,omitempty"` 3390 // Cvss - READ-ONLY; Dictionary from cvss version to cvss details object 3391 Cvss map[string]*CVSS `json:"cvss"` 3392 // Patchable - READ-ONLY; Indicates whether a patch is available or not 3393 Patchable *bool `json:"patchable,omitempty"` 3394 // Cve - READ-ONLY; List of CVEs 3395 Cve *[]CVE `json:"cve,omitempty"` 3396 // PublishedTime - READ-ONLY; Published time 3397 PublishedTime *date.Time `json:"publishedTime,omitempty"` 3398 // VendorReferences - READ-ONLY 3399 VendorReferences *[]VendorReference `json:"vendorReferences,omitempty"` 3400 // RepositoryName - READ-ONLY; Name of the repository which the vulnerable image belongs to 3401 RepositoryName *string `json:"repositoryName,omitempty"` 3402 // ImageDigest - READ-ONLY; Digest of the vulnerable image 3403 ImageDigest *string `json:"imageDigest,omitempty"` 3404 // AssessedResourceType - Possible values include: 'AssessedResourceTypeAdditionalData', 'AssessedResourceTypeSQLServerVulnerability', 'AssessedResourceTypeContainerRegistryVulnerability', 'AssessedResourceTypeServerVulnerabilityAssessment' 3405 AssessedResourceType AssessedResourceType `json:"assessedResourceType,omitempty"` 3406} 3407 3408// MarshalJSON is the custom marshaler for ContainerRegistryVulnerabilityProperties. 3409func (crvp ContainerRegistryVulnerabilityProperties) MarshalJSON() ([]byte, error) { 3410 crvp.AssessedResourceType = AssessedResourceTypeContainerRegistryVulnerability 3411 objectMap := make(map[string]interface{}) 3412 if crvp.AssessedResourceType != "" { 3413 objectMap["assessedResourceType"] = crvp.AssessedResourceType 3414 } 3415 return json.Marshal(objectMap) 3416} 3417 3418// AsSQLServerVulnerabilityProperties is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. 3419func (crvp ContainerRegistryVulnerabilityProperties) AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) { 3420 return nil, false 3421} 3422 3423// AsContainerRegistryVulnerabilityProperties is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. 3424func (crvp ContainerRegistryVulnerabilityProperties) AsContainerRegistryVulnerabilityProperties() (*ContainerRegistryVulnerabilityProperties, bool) { 3425 return &crvp, true 3426} 3427 3428// AsServerVulnerabilityProperties is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. 3429func (crvp ContainerRegistryVulnerabilityProperties) AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) { 3430 return nil, false 3431} 3432 3433// AsAdditionalData is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. 3434func (crvp ContainerRegistryVulnerabilityProperties) AsAdditionalData() (*AdditionalData, bool) { 3435 return nil, false 3436} 3437 3438// AsBasicAdditionalData is the BasicAdditionalData implementation for ContainerRegistryVulnerabilityProperties. 3439func (crvp ContainerRegistryVulnerabilityProperties) AsBasicAdditionalData() (BasicAdditionalData, bool) { 3440 return &crvp, true 3441} 3442 3443// CustomAlertRule a custom alert rule 3444type CustomAlertRule struct { 3445 // DisplayName - READ-ONLY; The display name of the custom alert. 3446 DisplayName *string `json:"displayName,omitempty"` 3447 // Description - READ-ONLY; The description of the custom alert. 3448 Description *string `json:"description,omitempty"` 3449 // IsEnabled - Whether the custom alert is enabled. 3450 IsEnabled *bool `json:"isEnabled,omitempty"` 3451 // RuleType - The type of the custom alert rule. 3452 RuleType *string `json:"ruleType,omitempty"` 3453} 3454 3455// CVE CVE details 3456type CVE struct { 3457 // Title - READ-ONLY; CVE title 3458 Title *string `json:"title,omitempty"` 3459 // Link - READ-ONLY; Link url 3460 Link *string `json:"link,omitempty"` 3461} 3462 3463// CVSS CVSS details 3464type CVSS struct { 3465 // Base - READ-ONLY; CVSS base 3466 Base *float64 `json:"base,omitempty"` 3467} 3468 3469// DataExportSetting represents a data export setting 3470type DataExportSetting struct { 3471 // DataExportSettingProperties - Data export setting data 3472 *DataExportSettingProperties `json:"properties,omitempty"` 3473 // Kind - the kind of the settings string (DataExportSetting). Possible values include: 'SettingKindDataExportSetting', 'SettingKindAlertSuppressionSetting' 3474 Kind SettingKind `json:"kind,omitempty"` 3475 // ID - READ-ONLY; Resource Id 3476 ID *string `json:"id,omitempty"` 3477 // Name - READ-ONLY; Resource name 3478 Name *string `json:"name,omitempty"` 3479 // Type - READ-ONLY; Resource type 3480 Type *string `json:"type,omitempty"` 3481} 3482 3483// MarshalJSON is the custom marshaler for DataExportSetting. 3484func (desVar DataExportSetting) MarshalJSON() ([]byte, error) { 3485 objectMap := make(map[string]interface{}) 3486 if desVar.DataExportSettingProperties != nil { 3487 objectMap["properties"] = desVar.DataExportSettingProperties 3488 } 3489 if desVar.Kind != "" { 3490 objectMap["kind"] = desVar.Kind 3491 } 3492 return json.Marshal(objectMap) 3493} 3494 3495// UnmarshalJSON is the custom unmarshaler for DataExportSetting struct. 3496func (desVar *DataExportSetting) UnmarshalJSON(body []byte) error { 3497 var m map[string]*json.RawMessage 3498 err := json.Unmarshal(body, &m) 3499 if err != nil { 3500 return err 3501 } 3502 for k, v := range m { 3503 switch k { 3504 case "properties": 3505 if v != nil { 3506 var dataExportSettingProperties DataExportSettingProperties 3507 err = json.Unmarshal(*v, &dataExportSettingProperties) 3508 if err != nil { 3509 return err 3510 } 3511 desVar.DataExportSettingProperties = &dataExportSettingProperties 3512 } 3513 case "kind": 3514 if v != nil { 3515 var kind SettingKind 3516 err = json.Unmarshal(*v, &kind) 3517 if err != nil { 3518 return err 3519 } 3520 desVar.Kind = kind 3521 } 3522 case "id": 3523 if v != nil { 3524 var ID string 3525 err = json.Unmarshal(*v, &ID) 3526 if err != nil { 3527 return err 3528 } 3529 desVar.ID = &ID 3530 } 3531 case "name": 3532 if v != nil { 3533 var name string 3534 err = json.Unmarshal(*v, &name) 3535 if err != nil { 3536 return err 3537 } 3538 desVar.Name = &name 3539 } 3540 case "type": 3541 if v != nil { 3542 var typeVar string 3543 err = json.Unmarshal(*v, &typeVar) 3544 if err != nil { 3545 return err 3546 } 3547 desVar.Type = &typeVar 3548 } 3549 } 3550 } 3551 3552 return nil 3553} 3554 3555// DataExportSettingProperties the data export setting properties 3556type DataExportSettingProperties struct { 3557 // Enabled - Is the data export setting is enabled 3558 Enabled *bool `json:"enabled,omitempty"` 3559} 3560 3561// DenylistCustomAlertRule a custom alert rule that checks if a value (depends on the custom alert type) is 3562// denied 3563type DenylistCustomAlertRule struct { 3564 // DenylistValues - The values to deny. The format of the values depends on the rule type. 3565 DenylistValues *[]string `json:"denylistValues,omitempty"` 3566 // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'IPCidr', 'String' 3567 ValueType ValueType `json:"valueType,omitempty"` 3568 // DisplayName - READ-ONLY; The display name of the custom alert. 3569 DisplayName *string `json:"displayName,omitempty"` 3570 // Description - READ-ONLY; The description of the custom alert. 3571 Description *string `json:"description,omitempty"` 3572 // IsEnabled - Whether the custom alert is enabled. 3573 IsEnabled *bool `json:"isEnabled,omitempty"` 3574 // RuleType - The type of the custom alert rule. 3575 RuleType *string `json:"ruleType,omitempty"` 3576} 3577 3578// DeviceSecurityGroup the device security group resource 3579type DeviceSecurityGroup struct { 3580 autorest.Response `json:"-"` 3581 // DeviceSecurityGroupProperties - Device Security group data 3582 *DeviceSecurityGroupProperties `json:"properties,omitempty"` 3583 // ID - READ-ONLY; Resource Id 3584 ID *string `json:"id,omitempty"` 3585 // Name - READ-ONLY; Resource name 3586 Name *string `json:"name,omitempty"` 3587 // Type - READ-ONLY; Resource type 3588 Type *string `json:"type,omitempty"` 3589} 3590 3591// MarshalJSON is the custom marshaler for DeviceSecurityGroup. 3592func (dsg DeviceSecurityGroup) MarshalJSON() ([]byte, error) { 3593 objectMap := make(map[string]interface{}) 3594 if dsg.DeviceSecurityGroupProperties != nil { 3595 objectMap["properties"] = dsg.DeviceSecurityGroupProperties 3596 } 3597 return json.Marshal(objectMap) 3598} 3599 3600// UnmarshalJSON is the custom unmarshaler for DeviceSecurityGroup struct. 3601func (dsg *DeviceSecurityGroup) UnmarshalJSON(body []byte) error { 3602 var m map[string]*json.RawMessage 3603 err := json.Unmarshal(body, &m) 3604 if err != nil { 3605 return err 3606 } 3607 for k, v := range m { 3608 switch k { 3609 case "properties": 3610 if v != nil { 3611 var deviceSecurityGroupProperties DeviceSecurityGroupProperties 3612 err = json.Unmarshal(*v, &deviceSecurityGroupProperties) 3613 if err != nil { 3614 return err 3615 } 3616 dsg.DeviceSecurityGroupProperties = &deviceSecurityGroupProperties 3617 } 3618 case "id": 3619 if v != nil { 3620 var ID string 3621 err = json.Unmarshal(*v, &ID) 3622 if err != nil { 3623 return err 3624 } 3625 dsg.ID = &ID 3626 } 3627 case "name": 3628 if v != nil { 3629 var name string 3630 err = json.Unmarshal(*v, &name) 3631 if err != nil { 3632 return err 3633 } 3634 dsg.Name = &name 3635 } 3636 case "type": 3637 if v != nil { 3638 var typeVar string 3639 err = json.Unmarshal(*v, &typeVar) 3640 if err != nil { 3641 return err 3642 } 3643 dsg.Type = &typeVar 3644 } 3645 } 3646 } 3647 3648 return nil 3649} 3650 3651// DeviceSecurityGroupList list of device security groups 3652type DeviceSecurityGroupList struct { 3653 autorest.Response `json:"-"` 3654 // Value - List of device security group objects 3655 Value *[]DeviceSecurityGroup `json:"value,omitempty"` 3656 // NextLink - READ-ONLY; The URI to fetch the next page. 3657 NextLink *string `json:"nextLink,omitempty"` 3658} 3659 3660// DeviceSecurityGroupListIterator provides access to a complete listing of DeviceSecurityGroup values. 3661type DeviceSecurityGroupListIterator struct { 3662 i int 3663 page DeviceSecurityGroupListPage 3664} 3665 3666// NextWithContext advances to the next value. If there was an error making 3667// the request the iterator does not advance and the error is returned. 3668func (iter *DeviceSecurityGroupListIterator) NextWithContext(ctx context.Context) (err error) { 3669 if tracing.IsEnabled() { 3670 ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupListIterator.NextWithContext") 3671 defer func() { 3672 sc := -1 3673 if iter.Response().Response.Response != nil { 3674 sc = iter.Response().Response.Response.StatusCode 3675 } 3676 tracing.EndSpan(ctx, sc, err) 3677 }() 3678 } 3679 iter.i++ 3680 if iter.i < len(iter.page.Values()) { 3681 return nil 3682 } 3683 err = iter.page.NextWithContext(ctx) 3684 if err != nil { 3685 iter.i-- 3686 return err 3687 } 3688 iter.i = 0 3689 return nil 3690} 3691 3692// Next advances to the next value. If there was an error making 3693// the request the iterator does not advance and the error is returned. 3694// Deprecated: Use NextWithContext() instead. 3695func (iter *DeviceSecurityGroupListIterator) Next() error { 3696 return iter.NextWithContext(context.Background()) 3697} 3698 3699// NotDone returns true if the enumeration should be started or is not yet complete. 3700func (iter DeviceSecurityGroupListIterator) NotDone() bool { 3701 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3702} 3703 3704// Response returns the raw server response from the last page request. 3705func (iter DeviceSecurityGroupListIterator) Response() DeviceSecurityGroupList { 3706 return iter.page.Response() 3707} 3708 3709// Value returns the current value or a zero-initialized value if the 3710// iterator has advanced beyond the end of the collection. 3711func (iter DeviceSecurityGroupListIterator) Value() DeviceSecurityGroup { 3712 if !iter.page.NotDone() { 3713 return DeviceSecurityGroup{} 3714 } 3715 return iter.page.Values()[iter.i] 3716} 3717 3718// Creates a new instance of the DeviceSecurityGroupListIterator type. 3719func NewDeviceSecurityGroupListIterator(page DeviceSecurityGroupListPage) DeviceSecurityGroupListIterator { 3720 return DeviceSecurityGroupListIterator{page: page} 3721} 3722 3723// IsEmpty returns true if the ListResult contains no values. 3724func (dsgl DeviceSecurityGroupList) IsEmpty() bool { 3725 return dsgl.Value == nil || len(*dsgl.Value) == 0 3726} 3727 3728// deviceSecurityGroupListPreparer prepares a request to retrieve the next set of results. 3729// It returns nil if no more results exist. 3730func (dsgl DeviceSecurityGroupList) deviceSecurityGroupListPreparer(ctx context.Context) (*http.Request, error) { 3731 if dsgl.NextLink == nil || len(to.String(dsgl.NextLink)) < 1 { 3732 return nil, nil 3733 } 3734 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3735 autorest.AsJSON(), 3736 autorest.AsGet(), 3737 autorest.WithBaseURL(to.String(dsgl.NextLink))) 3738} 3739 3740// DeviceSecurityGroupListPage contains a page of DeviceSecurityGroup values. 3741type DeviceSecurityGroupListPage struct { 3742 fn func(context.Context, DeviceSecurityGroupList) (DeviceSecurityGroupList, error) 3743 dsgl DeviceSecurityGroupList 3744} 3745 3746// NextWithContext advances to the next page of values. If there was an error making 3747// the request the page does not advance and the error is returned. 3748func (page *DeviceSecurityGroupListPage) NextWithContext(ctx context.Context) (err error) { 3749 if tracing.IsEnabled() { 3750 ctx = tracing.StartSpan(ctx, fqdn+"/DeviceSecurityGroupListPage.NextWithContext") 3751 defer func() { 3752 sc := -1 3753 if page.Response().Response.Response != nil { 3754 sc = page.Response().Response.Response.StatusCode 3755 } 3756 tracing.EndSpan(ctx, sc, err) 3757 }() 3758 } 3759 next, err := page.fn(ctx, page.dsgl) 3760 if err != nil { 3761 return err 3762 } 3763 page.dsgl = next 3764 return nil 3765} 3766 3767// Next advances to the next page of values. If there was an error making 3768// the request the page does not advance and the error is returned. 3769// Deprecated: Use NextWithContext() instead. 3770func (page *DeviceSecurityGroupListPage) Next() error { 3771 return page.NextWithContext(context.Background()) 3772} 3773 3774// NotDone returns true if the page enumeration should be started or is not yet complete. 3775func (page DeviceSecurityGroupListPage) NotDone() bool { 3776 return !page.dsgl.IsEmpty() 3777} 3778 3779// Response returns the raw server response from the last page request. 3780func (page DeviceSecurityGroupListPage) Response() DeviceSecurityGroupList { 3781 return page.dsgl 3782} 3783 3784// Values returns the slice of values for the current page or nil if there are no values. 3785func (page DeviceSecurityGroupListPage) Values() []DeviceSecurityGroup { 3786 if page.dsgl.IsEmpty() { 3787 return nil 3788 } 3789 return *page.dsgl.Value 3790} 3791 3792// Creates a new instance of the DeviceSecurityGroupListPage type. 3793func NewDeviceSecurityGroupListPage(getNextPage func(context.Context, DeviceSecurityGroupList) (DeviceSecurityGroupList, error)) DeviceSecurityGroupListPage { 3794 return DeviceSecurityGroupListPage{fn: getNextPage} 3795} 3796 3797// DeviceSecurityGroupProperties describes properties of a security group. 3798type DeviceSecurityGroupProperties struct { 3799 // ThresholdRules - A list of threshold custom alert rules. 3800 ThresholdRules *[]ThresholdCustomAlertRule `json:"thresholdRules,omitempty"` 3801 // TimeWindowRules - A list of time window custom alert rules. 3802 TimeWindowRules *[]TimeWindowCustomAlertRule `json:"timeWindowRules,omitempty"` 3803 // AllowlistRules - A list of allow-list custom alert rules. 3804 AllowlistRules *[]AllowlistCustomAlertRule `json:"allowlistRules,omitempty"` 3805 // DenylistRules - A list of deny-list custom alert rules. 3806 DenylistRules *[]DenylistCustomAlertRule `json:"denylistRules,omitempty"` 3807} 3808 3809// DiscoveredSecuritySolution ... 3810type DiscoveredSecuritySolution struct { 3811 autorest.Response `json:"-"` 3812 // ID - READ-ONLY; Resource Id 3813 ID *string `json:"id,omitempty"` 3814 // Name - READ-ONLY; Resource name 3815 Name *string `json:"name,omitempty"` 3816 // Type - READ-ONLY; Resource type 3817 Type *string `json:"type,omitempty"` 3818 // Location - READ-ONLY; Location where the resource is stored 3819 Location *string `json:"location,omitempty"` 3820 *DiscoveredSecuritySolutionProperties `json:"properties,omitempty"` 3821} 3822 3823// MarshalJSON is the custom marshaler for DiscoveredSecuritySolution. 3824func (dss DiscoveredSecuritySolution) MarshalJSON() ([]byte, error) { 3825 objectMap := make(map[string]interface{}) 3826 if dss.DiscoveredSecuritySolutionProperties != nil { 3827 objectMap["properties"] = dss.DiscoveredSecuritySolutionProperties 3828 } 3829 return json.Marshal(objectMap) 3830} 3831 3832// UnmarshalJSON is the custom unmarshaler for DiscoveredSecuritySolution struct. 3833func (dss *DiscoveredSecuritySolution) UnmarshalJSON(body []byte) error { 3834 var m map[string]*json.RawMessage 3835 err := json.Unmarshal(body, &m) 3836 if err != nil { 3837 return err 3838 } 3839 for k, v := range m { 3840 switch k { 3841 case "id": 3842 if v != nil { 3843 var ID string 3844 err = json.Unmarshal(*v, &ID) 3845 if err != nil { 3846 return err 3847 } 3848 dss.ID = &ID 3849 } 3850 case "name": 3851 if v != nil { 3852 var name string 3853 err = json.Unmarshal(*v, &name) 3854 if err != nil { 3855 return err 3856 } 3857 dss.Name = &name 3858 } 3859 case "type": 3860 if v != nil { 3861 var typeVar string 3862 err = json.Unmarshal(*v, &typeVar) 3863 if err != nil { 3864 return err 3865 } 3866 dss.Type = &typeVar 3867 } 3868 case "location": 3869 if v != nil { 3870 var location string 3871 err = json.Unmarshal(*v, &location) 3872 if err != nil { 3873 return err 3874 } 3875 dss.Location = &location 3876 } 3877 case "properties": 3878 if v != nil { 3879 var discoveredSecuritySolutionProperties DiscoveredSecuritySolutionProperties 3880 err = json.Unmarshal(*v, &discoveredSecuritySolutionProperties) 3881 if err != nil { 3882 return err 3883 } 3884 dss.DiscoveredSecuritySolutionProperties = &discoveredSecuritySolutionProperties 3885 } 3886 } 3887 } 3888 3889 return nil 3890} 3891 3892// DiscoveredSecuritySolutionList ... 3893type DiscoveredSecuritySolutionList struct { 3894 autorest.Response `json:"-"` 3895 Value *[]DiscoveredSecuritySolution `json:"value,omitempty"` 3896 // NextLink - READ-ONLY; The URI to fetch the next page. 3897 NextLink *string `json:"nextLink,omitempty"` 3898} 3899 3900// DiscoveredSecuritySolutionListIterator provides access to a complete listing of 3901// DiscoveredSecuritySolution values. 3902type DiscoveredSecuritySolutionListIterator struct { 3903 i int 3904 page DiscoveredSecuritySolutionListPage 3905} 3906 3907// NextWithContext advances to the next value. If there was an error making 3908// the request the iterator does not advance and the error is returned. 3909func (iter *DiscoveredSecuritySolutionListIterator) NextWithContext(ctx context.Context) (err error) { 3910 if tracing.IsEnabled() { 3911 ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionListIterator.NextWithContext") 3912 defer func() { 3913 sc := -1 3914 if iter.Response().Response.Response != nil { 3915 sc = iter.Response().Response.Response.StatusCode 3916 } 3917 tracing.EndSpan(ctx, sc, err) 3918 }() 3919 } 3920 iter.i++ 3921 if iter.i < len(iter.page.Values()) { 3922 return nil 3923 } 3924 err = iter.page.NextWithContext(ctx) 3925 if err != nil { 3926 iter.i-- 3927 return err 3928 } 3929 iter.i = 0 3930 return nil 3931} 3932 3933// Next advances to the next value. If there was an error making 3934// the request the iterator does not advance and the error is returned. 3935// Deprecated: Use NextWithContext() instead. 3936func (iter *DiscoveredSecuritySolutionListIterator) Next() error { 3937 return iter.NextWithContext(context.Background()) 3938} 3939 3940// NotDone returns true if the enumeration should be started or is not yet complete. 3941func (iter DiscoveredSecuritySolutionListIterator) NotDone() bool { 3942 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 3943} 3944 3945// Response returns the raw server response from the last page request. 3946func (iter DiscoveredSecuritySolutionListIterator) Response() DiscoveredSecuritySolutionList { 3947 return iter.page.Response() 3948} 3949 3950// Value returns the current value or a zero-initialized value if the 3951// iterator has advanced beyond the end of the collection. 3952func (iter DiscoveredSecuritySolutionListIterator) Value() DiscoveredSecuritySolution { 3953 if !iter.page.NotDone() { 3954 return DiscoveredSecuritySolution{} 3955 } 3956 return iter.page.Values()[iter.i] 3957} 3958 3959// Creates a new instance of the DiscoveredSecuritySolutionListIterator type. 3960func NewDiscoveredSecuritySolutionListIterator(page DiscoveredSecuritySolutionListPage) DiscoveredSecuritySolutionListIterator { 3961 return DiscoveredSecuritySolutionListIterator{page: page} 3962} 3963 3964// IsEmpty returns true if the ListResult contains no values. 3965func (dssl DiscoveredSecuritySolutionList) IsEmpty() bool { 3966 return dssl.Value == nil || len(*dssl.Value) == 0 3967} 3968 3969// discoveredSecuritySolutionListPreparer prepares a request to retrieve the next set of results. 3970// It returns nil if no more results exist. 3971func (dssl DiscoveredSecuritySolutionList) discoveredSecuritySolutionListPreparer(ctx context.Context) (*http.Request, error) { 3972 if dssl.NextLink == nil || len(to.String(dssl.NextLink)) < 1 { 3973 return nil, nil 3974 } 3975 return autorest.Prepare((&http.Request{}).WithContext(ctx), 3976 autorest.AsJSON(), 3977 autorest.AsGet(), 3978 autorest.WithBaseURL(to.String(dssl.NextLink))) 3979} 3980 3981// DiscoveredSecuritySolutionListPage contains a page of DiscoveredSecuritySolution values. 3982type DiscoveredSecuritySolutionListPage struct { 3983 fn func(context.Context, DiscoveredSecuritySolutionList) (DiscoveredSecuritySolutionList, error) 3984 dssl DiscoveredSecuritySolutionList 3985} 3986 3987// NextWithContext advances to the next page of values. If there was an error making 3988// the request the page does not advance and the error is returned. 3989func (page *DiscoveredSecuritySolutionListPage) NextWithContext(ctx context.Context) (err error) { 3990 if tracing.IsEnabled() { 3991 ctx = tracing.StartSpan(ctx, fqdn+"/DiscoveredSecuritySolutionListPage.NextWithContext") 3992 defer func() { 3993 sc := -1 3994 if page.Response().Response.Response != nil { 3995 sc = page.Response().Response.Response.StatusCode 3996 } 3997 tracing.EndSpan(ctx, sc, err) 3998 }() 3999 } 4000 next, err := page.fn(ctx, page.dssl) 4001 if err != nil { 4002 return err 4003 } 4004 page.dssl = next 4005 return nil 4006} 4007 4008// Next advances to the next page of values. If there was an error making 4009// the request the page does not advance and the error is returned. 4010// Deprecated: Use NextWithContext() instead. 4011func (page *DiscoveredSecuritySolutionListPage) Next() error { 4012 return page.NextWithContext(context.Background()) 4013} 4014 4015// NotDone returns true if the page enumeration should be started or is not yet complete. 4016func (page DiscoveredSecuritySolutionListPage) NotDone() bool { 4017 return !page.dssl.IsEmpty() 4018} 4019 4020// Response returns the raw server response from the last page request. 4021func (page DiscoveredSecuritySolutionListPage) Response() DiscoveredSecuritySolutionList { 4022 return page.dssl 4023} 4024 4025// Values returns the slice of values for the current page or nil if there are no values. 4026func (page DiscoveredSecuritySolutionListPage) Values() []DiscoveredSecuritySolution { 4027 if page.dssl.IsEmpty() { 4028 return nil 4029 } 4030 return *page.dssl.Value 4031} 4032 4033// Creates a new instance of the DiscoveredSecuritySolutionListPage type. 4034func NewDiscoveredSecuritySolutionListPage(getNextPage func(context.Context, DiscoveredSecuritySolutionList) (DiscoveredSecuritySolutionList, error)) DiscoveredSecuritySolutionListPage { 4035 return DiscoveredSecuritySolutionListPage{fn: getNextPage} 4036} 4037 4038// DiscoveredSecuritySolutionProperties ... 4039type DiscoveredSecuritySolutionProperties struct { 4040 // SecurityFamily - The security family of the discovered solution. Possible values include: 'Waf', 'Ngfw', 'SaasWaf', 'Va' 4041 SecurityFamily Family `json:"securityFamily,omitempty"` 4042 // Offer - The security solutions' image offer 4043 Offer *string `json:"offer,omitempty"` 4044 // Publisher - The security solutions' image publisher 4045 Publisher *string `json:"publisher,omitempty"` 4046 // Sku - The security solutions' image sku 4047 Sku *string `json:"sku,omitempty"` 4048} 4049 4050// EffectiveNetworkSecurityGroups describes the Network Security Groups effective on a network interface 4051type EffectiveNetworkSecurityGroups struct { 4052 // NetworkInterface - The Azure resource ID of the network interface 4053 NetworkInterface *string `json:"networkInterface,omitempty"` 4054 // NetworkSecurityGroups - The Network Security Groups effective on the network interface 4055 NetworkSecurityGroups *[]string `json:"networkSecurityGroups,omitempty"` 4056} 4057 4058// BasicExternalSecuritySolution represents a security solution external to Azure Security Center which sends 4059// information to an OMS workspace and whose data is displayed by Azure Security Center. 4060type BasicExternalSecuritySolution interface { 4061 AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) 4062 AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) 4063 AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) 4064 AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) 4065} 4066 4067// ExternalSecuritySolution represents a security solution external to Azure Security Center which sends 4068// information to an OMS workspace and whose data is displayed by Azure Security Center. 4069type ExternalSecuritySolution struct { 4070 autorest.Response `json:"-"` 4071 // ID - READ-ONLY; Resource Id 4072 ID *string `json:"id,omitempty"` 4073 // Name - READ-ONLY; Resource name 4074 Name *string `json:"name,omitempty"` 4075 // Type - READ-ONLY; Resource type 4076 Type *string `json:"type,omitempty"` 4077 // Location - READ-ONLY; Location where the resource is stored 4078 Location *string `json:"location,omitempty"` 4079 // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' 4080 Kind KindEnum `json:"kind,omitempty"` 4081} 4082 4083func unmarshalBasicExternalSecuritySolution(body []byte) (BasicExternalSecuritySolution, error) { 4084 var m map[string]interface{} 4085 err := json.Unmarshal(body, &m) 4086 if err != nil { 4087 return nil, err 4088 } 4089 4090 switch m["kind"] { 4091 case string(KindCEF): 4092 var cess CefExternalSecuritySolution 4093 err := json.Unmarshal(body, &cess) 4094 return cess, err 4095 case string(KindATA): 4096 var aess AtaExternalSecuritySolution 4097 err := json.Unmarshal(body, &aess) 4098 return aess, err 4099 case string(KindAAD): 4100 var aess AadExternalSecuritySolution 4101 err := json.Unmarshal(body, &aess) 4102 return aess, err 4103 default: 4104 var ess ExternalSecuritySolution 4105 err := json.Unmarshal(body, &ess) 4106 return ess, err 4107 } 4108} 4109func unmarshalBasicExternalSecuritySolutionArray(body []byte) ([]BasicExternalSecuritySolution, error) { 4110 var rawMessages []*json.RawMessage 4111 err := json.Unmarshal(body, &rawMessages) 4112 if err != nil { 4113 return nil, err 4114 } 4115 4116 essArray := make([]BasicExternalSecuritySolution, len(rawMessages)) 4117 4118 for index, rawMessage := range rawMessages { 4119 ess, err := unmarshalBasicExternalSecuritySolution(*rawMessage) 4120 if err != nil { 4121 return nil, err 4122 } 4123 essArray[index] = ess 4124 } 4125 return essArray, nil 4126} 4127 4128// MarshalJSON is the custom marshaler for ExternalSecuritySolution. 4129func (ess ExternalSecuritySolution) MarshalJSON() ([]byte, error) { 4130 ess.Kind = KindExternalSecuritySolution 4131 objectMap := make(map[string]interface{}) 4132 if ess.Kind != "" { 4133 objectMap["kind"] = ess.Kind 4134 } 4135 return json.Marshal(objectMap) 4136} 4137 4138// AsCefExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. 4139func (ess ExternalSecuritySolution) AsCefExternalSecuritySolution() (*CefExternalSecuritySolution, bool) { 4140 return nil, false 4141} 4142 4143// AsAtaExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. 4144func (ess ExternalSecuritySolution) AsAtaExternalSecuritySolution() (*AtaExternalSecuritySolution, bool) { 4145 return nil, false 4146} 4147 4148// AsAadExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. 4149func (ess ExternalSecuritySolution) AsAadExternalSecuritySolution() (*AadExternalSecuritySolution, bool) { 4150 return nil, false 4151} 4152 4153// AsExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. 4154func (ess ExternalSecuritySolution) AsExternalSecuritySolution() (*ExternalSecuritySolution, bool) { 4155 return &ess, true 4156} 4157 4158// AsBasicExternalSecuritySolution is the BasicExternalSecuritySolution implementation for ExternalSecuritySolution. 4159func (ess ExternalSecuritySolution) AsBasicExternalSecuritySolution() (BasicExternalSecuritySolution, bool) { 4160 return &ess, true 4161} 4162 4163// ExternalSecuritySolutionKind1 describes an Azure resource with kind 4164type ExternalSecuritySolutionKind1 struct { 4165 // Kind - The kind of the external solution. Possible values include: 'CEF', 'ATA', 'AAD' 4166 Kind ExternalSecuritySolutionKind `json:"kind,omitempty"` 4167} 4168 4169// ExternalSecuritySolutionList ... 4170type ExternalSecuritySolutionList struct { 4171 autorest.Response `json:"-"` 4172 Value *[]BasicExternalSecuritySolution `json:"value,omitempty"` 4173 // NextLink - READ-ONLY; The URI to fetch the next page. 4174 NextLink *string `json:"nextLink,omitempty"` 4175} 4176 4177// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionList struct. 4178func (essl *ExternalSecuritySolutionList) UnmarshalJSON(body []byte) error { 4179 var m map[string]*json.RawMessage 4180 err := json.Unmarshal(body, &m) 4181 if err != nil { 4182 return err 4183 } 4184 for k, v := range m { 4185 switch k { 4186 case "value": 4187 if v != nil { 4188 value, err := unmarshalBasicExternalSecuritySolutionArray(*v) 4189 if err != nil { 4190 return err 4191 } 4192 essl.Value = &value 4193 } 4194 case "nextLink": 4195 if v != nil { 4196 var nextLink string 4197 err = json.Unmarshal(*v, &nextLink) 4198 if err != nil { 4199 return err 4200 } 4201 essl.NextLink = &nextLink 4202 } 4203 } 4204 } 4205 4206 return nil 4207} 4208 4209// ExternalSecuritySolutionListIterator provides access to a complete listing of ExternalSecuritySolution 4210// values. 4211type ExternalSecuritySolutionListIterator struct { 4212 i int 4213 page ExternalSecuritySolutionListPage 4214} 4215 4216// NextWithContext advances to the next value. If there was an error making 4217// the request the iterator does not advance and the error is returned. 4218func (iter *ExternalSecuritySolutionListIterator) NextWithContext(ctx context.Context) (err error) { 4219 if tracing.IsEnabled() { 4220 ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionListIterator.NextWithContext") 4221 defer func() { 4222 sc := -1 4223 if iter.Response().Response.Response != nil { 4224 sc = iter.Response().Response.Response.StatusCode 4225 } 4226 tracing.EndSpan(ctx, sc, err) 4227 }() 4228 } 4229 iter.i++ 4230 if iter.i < len(iter.page.Values()) { 4231 return nil 4232 } 4233 err = iter.page.NextWithContext(ctx) 4234 if err != nil { 4235 iter.i-- 4236 return err 4237 } 4238 iter.i = 0 4239 return nil 4240} 4241 4242// Next advances to the next value. If there was an error making 4243// the request the iterator does not advance and the error is returned. 4244// Deprecated: Use NextWithContext() instead. 4245func (iter *ExternalSecuritySolutionListIterator) Next() error { 4246 return iter.NextWithContext(context.Background()) 4247} 4248 4249// NotDone returns true if the enumeration should be started or is not yet complete. 4250func (iter ExternalSecuritySolutionListIterator) NotDone() bool { 4251 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4252} 4253 4254// Response returns the raw server response from the last page request. 4255func (iter ExternalSecuritySolutionListIterator) Response() ExternalSecuritySolutionList { 4256 return iter.page.Response() 4257} 4258 4259// Value returns the current value or a zero-initialized value if the 4260// iterator has advanced beyond the end of the collection. 4261func (iter ExternalSecuritySolutionListIterator) Value() BasicExternalSecuritySolution { 4262 if !iter.page.NotDone() { 4263 return ExternalSecuritySolution{} 4264 } 4265 return iter.page.Values()[iter.i] 4266} 4267 4268// Creates a new instance of the ExternalSecuritySolutionListIterator type. 4269func NewExternalSecuritySolutionListIterator(page ExternalSecuritySolutionListPage) ExternalSecuritySolutionListIterator { 4270 return ExternalSecuritySolutionListIterator{page: page} 4271} 4272 4273// IsEmpty returns true if the ListResult contains no values. 4274func (essl ExternalSecuritySolutionList) IsEmpty() bool { 4275 return essl.Value == nil || len(*essl.Value) == 0 4276} 4277 4278// externalSecuritySolutionListPreparer prepares a request to retrieve the next set of results. 4279// It returns nil if no more results exist. 4280func (essl ExternalSecuritySolutionList) externalSecuritySolutionListPreparer(ctx context.Context) (*http.Request, error) { 4281 if essl.NextLink == nil || len(to.String(essl.NextLink)) < 1 { 4282 return nil, nil 4283 } 4284 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4285 autorest.AsJSON(), 4286 autorest.AsGet(), 4287 autorest.WithBaseURL(to.String(essl.NextLink))) 4288} 4289 4290// ExternalSecuritySolutionListPage contains a page of BasicExternalSecuritySolution values. 4291type ExternalSecuritySolutionListPage struct { 4292 fn func(context.Context, ExternalSecuritySolutionList) (ExternalSecuritySolutionList, error) 4293 essl ExternalSecuritySolutionList 4294} 4295 4296// NextWithContext advances to the next page of values. If there was an error making 4297// the request the page does not advance and the error is returned. 4298func (page *ExternalSecuritySolutionListPage) NextWithContext(ctx context.Context) (err error) { 4299 if tracing.IsEnabled() { 4300 ctx = tracing.StartSpan(ctx, fqdn+"/ExternalSecuritySolutionListPage.NextWithContext") 4301 defer func() { 4302 sc := -1 4303 if page.Response().Response.Response != nil { 4304 sc = page.Response().Response.Response.StatusCode 4305 } 4306 tracing.EndSpan(ctx, sc, err) 4307 }() 4308 } 4309 next, err := page.fn(ctx, page.essl) 4310 if err != nil { 4311 return err 4312 } 4313 page.essl = next 4314 return nil 4315} 4316 4317// Next advances to the next page of values. If there was an error making 4318// the request the page does not advance and the error is returned. 4319// Deprecated: Use NextWithContext() instead. 4320func (page *ExternalSecuritySolutionListPage) Next() error { 4321 return page.NextWithContext(context.Background()) 4322} 4323 4324// NotDone returns true if the page enumeration should be started or is not yet complete. 4325func (page ExternalSecuritySolutionListPage) NotDone() bool { 4326 return !page.essl.IsEmpty() 4327} 4328 4329// Response returns the raw server response from the last page request. 4330func (page ExternalSecuritySolutionListPage) Response() ExternalSecuritySolutionList { 4331 return page.essl 4332} 4333 4334// Values returns the slice of values for the current page or nil if there are no values. 4335func (page ExternalSecuritySolutionListPage) Values() []BasicExternalSecuritySolution { 4336 if page.essl.IsEmpty() { 4337 return nil 4338 } 4339 return *page.essl.Value 4340} 4341 4342// Creates a new instance of the ExternalSecuritySolutionListPage type. 4343func NewExternalSecuritySolutionListPage(getNextPage func(context.Context, ExternalSecuritySolutionList) (ExternalSecuritySolutionList, error)) ExternalSecuritySolutionListPage { 4344 return ExternalSecuritySolutionListPage{fn: getNextPage} 4345} 4346 4347// ExternalSecuritySolutionModel ... 4348type ExternalSecuritySolutionModel struct { 4349 autorest.Response `json:"-"` 4350 Value BasicExternalSecuritySolution `json:"value,omitempty"` 4351} 4352 4353// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionModel struct. 4354func (essm *ExternalSecuritySolutionModel) UnmarshalJSON(body []byte) error { 4355 ess, err := unmarshalBasicExternalSecuritySolution(body) 4356 if err != nil { 4357 return err 4358 } 4359 essm.Value = ess 4360 4361 return nil 4362} 4363 4364// ExternalSecuritySolutionProperties the solution properties (correspond to the solution kind) 4365type ExternalSecuritySolutionProperties struct { 4366 // AdditionalProperties - Unmatched properties from the message are deserialized this collection 4367 AdditionalProperties map[string]interface{} `json:""` 4368 DeviceVendor *string `json:"deviceVendor,omitempty"` 4369 DeviceType *string `json:"deviceType,omitempty"` 4370 Workspace *ConnectedWorkspace `json:"workspace,omitempty"` 4371} 4372 4373// MarshalJSON is the custom marshaler for ExternalSecuritySolutionProperties. 4374func (essp ExternalSecuritySolutionProperties) MarshalJSON() ([]byte, error) { 4375 objectMap := make(map[string]interface{}) 4376 if essp.DeviceVendor != nil { 4377 objectMap["deviceVendor"] = essp.DeviceVendor 4378 } 4379 if essp.DeviceType != nil { 4380 objectMap["deviceType"] = essp.DeviceType 4381 } 4382 if essp.Workspace != nil { 4383 objectMap["workspace"] = essp.Workspace 4384 } 4385 for k, v := range essp.AdditionalProperties { 4386 objectMap[k] = v 4387 } 4388 return json.Marshal(objectMap) 4389} 4390 4391// UnmarshalJSON is the custom unmarshaler for ExternalSecuritySolutionProperties struct. 4392func (essp *ExternalSecuritySolutionProperties) UnmarshalJSON(body []byte) error { 4393 var m map[string]*json.RawMessage 4394 err := json.Unmarshal(body, &m) 4395 if err != nil { 4396 return err 4397 } 4398 for k, v := range m { 4399 switch k { 4400 default: 4401 if v != nil { 4402 var additionalProperties interface{} 4403 err = json.Unmarshal(*v, &additionalProperties) 4404 if err != nil { 4405 return err 4406 } 4407 if essp.AdditionalProperties == nil { 4408 essp.AdditionalProperties = make(map[string]interface{}) 4409 } 4410 essp.AdditionalProperties[k] = additionalProperties 4411 } 4412 case "deviceVendor": 4413 if v != nil { 4414 var deviceVendor string 4415 err = json.Unmarshal(*v, &deviceVendor) 4416 if err != nil { 4417 return err 4418 } 4419 essp.DeviceVendor = &deviceVendor 4420 } 4421 case "deviceType": 4422 if v != nil { 4423 var deviceType string 4424 err = json.Unmarshal(*v, &deviceType) 4425 if err != nil { 4426 return err 4427 } 4428 essp.DeviceType = &deviceType 4429 } 4430 case "workspace": 4431 if v != nil { 4432 var workspace ConnectedWorkspace 4433 err = json.Unmarshal(*v, &workspace) 4434 if err != nil { 4435 return err 4436 } 4437 essp.Workspace = &workspace 4438 } 4439 } 4440 } 4441 4442 return nil 4443} 4444 4445// InformationProtectionKeyword the information type keyword. 4446type InformationProtectionKeyword struct { 4447 // Pattern - The keyword pattern. 4448 Pattern *string `json:"pattern,omitempty"` 4449 // Custom - Indicates whether the keyword is custom or not. 4450 Custom *bool `json:"custom,omitempty"` 4451 // CanBeNumeric - Indicates whether the keyword can be applied on numeric types or not. 4452 CanBeNumeric *bool `json:"canBeNumeric,omitempty"` 4453 // Excluded - Indicates whether the keyword is excluded or not. 4454 Excluded *bool `json:"excluded,omitempty"` 4455} 4456 4457// InformationProtectionPolicy information protection policy. 4458type InformationProtectionPolicy struct { 4459 autorest.Response `json:"-"` 4460 // InformationProtectionPolicyProperties - Information protection policy data 4461 *InformationProtectionPolicyProperties `json:"properties,omitempty"` 4462 // ID - READ-ONLY; Resource Id 4463 ID *string `json:"id,omitempty"` 4464 // Name - READ-ONLY; Resource name 4465 Name *string `json:"name,omitempty"` 4466 // Type - READ-ONLY; Resource type 4467 Type *string `json:"type,omitempty"` 4468} 4469 4470// MarshalJSON is the custom marshaler for InformationProtectionPolicy. 4471func (ipp InformationProtectionPolicy) MarshalJSON() ([]byte, error) { 4472 objectMap := make(map[string]interface{}) 4473 if ipp.InformationProtectionPolicyProperties != nil { 4474 objectMap["properties"] = ipp.InformationProtectionPolicyProperties 4475 } 4476 return json.Marshal(objectMap) 4477} 4478 4479// UnmarshalJSON is the custom unmarshaler for InformationProtectionPolicy struct. 4480func (ipp *InformationProtectionPolicy) UnmarshalJSON(body []byte) error { 4481 var m map[string]*json.RawMessage 4482 err := json.Unmarshal(body, &m) 4483 if err != nil { 4484 return err 4485 } 4486 for k, v := range m { 4487 switch k { 4488 case "properties": 4489 if v != nil { 4490 var informationProtectionPolicyProperties InformationProtectionPolicyProperties 4491 err = json.Unmarshal(*v, &informationProtectionPolicyProperties) 4492 if err != nil { 4493 return err 4494 } 4495 ipp.InformationProtectionPolicyProperties = &informationProtectionPolicyProperties 4496 } 4497 case "id": 4498 if v != nil { 4499 var ID string 4500 err = json.Unmarshal(*v, &ID) 4501 if err != nil { 4502 return err 4503 } 4504 ipp.ID = &ID 4505 } 4506 case "name": 4507 if v != nil { 4508 var name string 4509 err = json.Unmarshal(*v, &name) 4510 if err != nil { 4511 return err 4512 } 4513 ipp.Name = &name 4514 } 4515 case "type": 4516 if v != nil { 4517 var typeVar string 4518 err = json.Unmarshal(*v, &typeVar) 4519 if err != nil { 4520 return err 4521 } 4522 ipp.Type = &typeVar 4523 } 4524 } 4525 } 4526 4527 return nil 4528} 4529 4530// InformationProtectionPolicyList information protection policies response. 4531type InformationProtectionPolicyList struct { 4532 autorest.Response `json:"-"` 4533 // Value - List of information protection policies. 4534 Value *[]InformationProtectionPolicy `json:"value,omitempty"` 4535 // NextLink - READ-ONLY; The URI to fetch the next page. 4536 NextLink *string `json:"nextLink,omitempty"` 4537} 4538 4539// InformationProtectionPolicyListIterator provides access to a complete listing of 4540// InformationProtectionPolicy values. 4541type InformationProtectionPolicyListIterator struct { 4542 i int 4543 page InformationProtectionPolicyListPage 4544} 4545 4546// NextWithContext advances to the next value. If there was an error making 4547// the request the iterator does not advance and the error is returned. 4548func (iter *InformationProtectionPolicyListIterator) NextWithContext(ctx context.Context) (err error) { 4549 if tracing.IsEnabled() { 4550 ctx = tracing.StartSpan(ctx, fqdn+"/InformationProtectionPolicyListIterator.NextWithContext") 4551 defer func() { 4552 sc := -1 4553 if iter.Response().Response.Response != nil { 4554 sc = iter.Response().Response.Response.StatusCode 4555 } 4556 tracing.EndSpan(ctx, sc, err) 4557 }() 4558 } 4559 iter.i++ 4560 if iter.i < len(iter.page.Values()) { 4561 return nil 4562 } 4563 err = iter.page.NextWithContext(ctx) 4564 if err != nil { 4565 iter.i-- 4566 return err 4567 } 4568 iter.i = 0 4569 return nil 4570} 4571 4572// Next advances to the next value. If there was an error making 4573// the request the iterator does not advance and the error is returned. 4574// Deprecated: Use NextWithContext() instead. 4575func (iter *InformationProtectionPolicyListIterator) Next() error { 4576 return iter.NextWithContext(context.Background()) 4577} 4578 4579// NotDone returns true if the enumeration should be started or is not yet complete. 4580func (iter InformationProtectionPolicyListIterator) NotDone() bool { 4581 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4582} 4583 4584// Response returns the raw server response from the last page request. 4585func (iter InformationProtectionPolicyListIterator) Response() InformationProtectionPolicyList { 4586 return iter.page.Response() 4587} 4588 4589// Value returns the current value or a zero-initialized value if the 4590// iterator has advanced beyond the end of the collection. 4591func (iter InformationProtectionPolicyListIterator) Value() InformationProtectionPolicy { 4592 if !iter.page.NotDone() { 4593 return InformationProtectionPolicy{} 4594 } 4595 return iter.page.Values()[iter.i] 4596} 4597 4598// Creates a new instance of the InformationProtectionPolicyListIterator type. 4599func NewInformationProtectionPolicyListIterator(page InformationProtectionPolicyListPage) InformationProtectionPolicyListIterator { 4600 return InformationProtectionPolicyListIterator{page: page} 4601} 4602 4603// IsEmpty returns true if the ListResult contains no values. 4604func (ippl InformationProtectionPolicyList) IsEmpty() bool { 4605 return ippl.Value == nil || len(*ippl.Value) == 0 4606} 4607 4608// informationProtectionPolicyListPreparer prepares a request to retrieve the next set of results. 4609// It returns nil if no more results exist. 4610func (ippl InformationProtectionPolicyList) informationProtectionPolicyListPreparer(ctx context.Context) (*http.Request, error) { 4611 if ippl.NextLink == nil || len(to.String(ippl.NextLink)) < 1 { 4612 return nil, nil 4613 } 4614 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4615 autorest.AsJSON(), 4616 autorest.AsGet(), 4617 autorest.WithBaseURL(to.String(ippl.NextLink))) 4618} 4619 4620// InformationProtectionPolicyListPage contains a page of InformationProtectionPolicy values. 4621type InformationProtectionPolicyListPage struct { 4622 fn func(context.Context, InformationProtectionPolicyList) (InformationProtectionPolicyList, error) 4623 ippl InformationProtectionPolicyList 4624} 4625 4626// NextWithContext advances to the next page of values. If there was an error making 4627// the request the page does not advance and the error is returned. 4628func (page *InformationProtectionPolicyListPage) NextWithContext(ctx context.Context) (err error) { 4629 if tracing.IsEnabled() { 4630 ctx = tracing.StartSpan(ctx, fqdn+"/InformationProtectionPolicyListPage.NextWithContext") 4631 defer func() { 4632 sc := -1 4633 if page.Response().Response.Response != nil { 4634 sc = page.Response().Response.Response.StatusCode 4635 } 4636 tracing.EndSpan(ctx, sc, err) 4637 }() 4638 } 4639 next, err := page.fn(ctx, page.ippl) 4640 if err != nil { 4641 return err 4642 } 4643 page.ippl = next 4644 return nil 4645} 4646 4647// Next advances to the next page of values. If there was an error making 4648// the request the page does not advance and the error is returned. 4649// Deprecated: Use NextWithContext() instead. 4650func (page *InformationProtectionPolicyListPage) Next() error { 4651 return page.NextWithContext(context.Background()) 4652} 4653 4654// NotDone returns true if the page enumeration should be started or is not yet complete. 4655func (page InformationProtectionPolicyListPage) NotDone() bool { 4656 return !page.ippl.IsEmpty() 4657} 4658 4659// Response returns the raw server response from the last page request. 4660func (page InformationProtectionPolicyListPage) Response() InformationProtectionPolicyList { 4661 return page.ippl 4662} 4663 4664// Values returns the slice of values for the current page or nil if there are no values. 4665func (page InformationProtectionPolicyListPage) Values() []InformationProtectionPolicy { 4666 if page.ippl.IsEmpty() { 4667 return nil 4668 } 4669 return *page.ippl.Value 4670} 4671 4672// Creates a new instance of the InformationProtectionPolicyListPage type. 4673func NewInformationProtectionPolicyListPage(getNextPage func(context.Context, InformationProtectionPolicyList) (InformationProtectionPolicyList, error)) InformationProtectionPolicyListPage { 4674 return InformationProtectionPolicyListPage{fn: getNextPage} 4675} 4676 4677// InformationProtectionPolicyProperties describes properties of an information protection policy. 4678type InformationProtectionPolicyProperties struct { 4679 // LastModifiedUtc - READ-ONLY; Describes the last UTC time the policy was modified. 4680 LastModifiedUtc *date.Time `json:"lastModifiedUtc,omitempty"` 4681 // Labels - Dictionary of sensitivity labels. 4682 Labels map[string]*SensitivityLabel `json:"labels"` 4683 // InformationTypes - The sensitivity information types. 4684 InformationTypes map[string]*InformationType `json:"informationTypes"` 4685} 4686 4687// MarshalJSON is the custom marshaler for InformationProtectionPolicyProperties. 4688func (ippp InformationProtectionPolicyProperties) MarshalJSON() ([]byte, error) { 4689 objectMap := make(map[string]interface{}) 4690 if ippp.Labels != nil { 4691 objectMap["labels"] = ippp.Labels 4692 } 4693 if ippp.InformationTypes != nil { 4694 objectMap["informationTypes"] = ippp.InformationTypes 4695 } 4696 return json.Marshal(objectMap) 4697} 4698 4699// InformationType the information type. 4700type InformationType struct { 4701 // DisplayName - The name of the information type. 4702 DisplayName *string `json:"displayName,omitempty"` 4703 // Order - The order of the information type. 4704 Order *float64 `json:"order,omitempty"` 4705 // RecommendedLabelID - The recommended label id to be associated with this information type. 4706 RecommendedLabelID *uuid.UUID `json:"recommendedLabelId,omitempty"` 4707 // Enabled - Indicates whether the information type is enabled or not. 4708 Enabled *bool `json:"enabled,omitempty"` 4709 // Custom - Indicates whether the information type is custom or not. 4710 Custom *bool `json:"custom,omitempty"` 4711 // Keywords - The information type keywords. 4712 Keywords *[]InformationProtectionKeyword `json:"keywords,omitempty"` 4713} 4714 4715// IoTSecurityAggregatedAlert security Solution Aggregated Alert information 4716type IoTSecurityAggregatedAlert struct { 4717 autorest.Response `json:"-"` 4718 // ID - READ-ONLY; Resource Id 4719 ID *string `json:"id,omitempty"` 4720 // Name - READ-ONLY; Resource name 4721 Name *string `json:"name,omitempty"` 4722 // Type - READ-ONLY; Resource type 4723 Type *string `json:"type,omitempty"` 4724 // Tags - Resource tags 4725 Tags map[string]*string `json:"tags"` 4726 // IoTSecurityAggregatedAlertProperties - Security Solution Aggregated Alert data 4727 *IoTSecurityAggregatedAlertProperties `json:"properties,omitempty"` 4728} 4729 4730// MarshalJSON is the custom marshaler for IoTSecurityAggregatedAlert. 4731func (itsaa IoTSecurityAggregatedAlert) MarshalJSON() ([]byte, error) { 4732 objectMap := make(map[string]interface{}) 4733 if itsaa.Tags != nil { 4734 objectMap["tags"] = itsaa.Tags 4735 } 4736 if itsaa.IoTSecurityAggregatedAlertProperties != nil { 4737 objectMap["properties"] = itsaa.IoTSecurityAggregatedAlertProperties 4738 } 4739 return json.Marshal(objectMap) 4740} 4741 4742// UnmarshalJSON is the custom unmarshaler for IoTSecurityAggregatedAlert struct. 4743func (itsaa *IoTSecurityAggregatedAlert) UnmarshalJSON(body []byte) error { 4744 var m map[string]*json.RawMessage 4745 err := json.Unmarshal(body, &m) 4746 if err != nil { 4747 return err 4748 } 4749 for k, v := range m { 4750 switch k { 4751 case "id": 4752 if v != nil { 4753 var ID string 4754 err = json.Unmarshal(*v, &ID) 4755 if err != nil { 4756 return err 4757 } 4758 itsaa.ID = &ID 4759 } 4760 case "name": 4761 if v != nil { 4762 var name string 4763 err = json.Unmarshal(*v, &name) 4764 if err != nil { 4765 return err 4766 } 4767 itsaa.Name = &name 4768 } 4769 case "type": 4770 if v != nil { 4771 var typeVar string 4772 err = json.Unmarshal(*v, &typeVar) 4773 if err != nil { 4774 return err 4775 } 4776 itsaa.Type = &typeVar 4777 } 4778 case "tags": 4779 if v != nil { 4780 var tags map[string]*string 4781 err = json.Unmarshal(*v, &tags) 4782 if err != nil { 4783 return err 4784 } 4785 itsaa.Tags = tags 4786 } 4787 case "properties": 4788 if v != nil { 4789 var ioTSecurityAggregatedAlertProperties IoTSecurityAggregatedAlertProperties 4790 err = json.Unmarshal(*v, &ioTSecurityAggregatedAlertProperties) 4791 if err != nil { 4792 return err 4793 } 4794 itsaa.IoTSecurityAggregatedAlertProperties = &ioTSecurityAggregatedAlertProperties 4795 } 4796 } 4797 } 4798 4799 return nil 4800} 4801 4802// IoTSecurityAggregatedAlertList list of IoT aggregated security alerts 4803type IoTSecurityAggregatedAlertList struct { 4804 autorest.Response `json:"-"` 4805 // Value - List of aggregated alerts data 4806 Value *[]IoTSecurityAggregatedAlert `json:"value,omitempty"` 4807 // NextLink - READ-ONLY; The URI to fetch the next page. 4808 NextLink *string `json:"nextLink,omitempty"` 4809} 4810 4811// IoTSecurityAggregatedAlertListIterator provides access to a complete listing of 4812// IoTSecurityAggregatedAlert values. 4813type IoTSecurityAggregatedAlertListIterator struct { 4814 i int 4815 page IoTSecurityAggregatedAlertListPage 4816} 4817 4818// NextWithContext advances to the next value. If there was an error making 4819// the request the iterator does not advance and the error is returned. 4820func (iter *IoTSecurityAggregatedAlertListIterator) NextWithContext(ctx context.Context) (err error) { 4821 if tracing.IsEnabled() { 4822 ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecurityAggregatedAlertListIterator.NextWithContext") 4823 defer func() { 4824 sc := -1 4825 if iter.Response().Response.Response != nil { 4826 sc = iter.Response().Response.Response.StatusCode 4827 } 4828 tracing.EndSpan(ctx, sc, err) 4829 }() 4830 } 4831 iter.i++ 4832 if iter.i < len(iter.page.Values()) { 4833 return nil 4834 } 4835 err = iter.page.NextWithContext(ctx) 4836 if err != nil { 4837 iter.i-- 4838 return err 4839 } 4840 iter.i = 0 4841 return nil 4842} 4843 4844// Next advances to the next value. If there was an error making 4845// the request the iterator does not advance and the error is returned. 4846// Deprecated: Use NextWithContext() instead. 4847func (iter *IoTSecurityAggregatedAlertListIterator) Next() error { 4848 return iter.NextWithContext(context.Background()) 4849} 4850 4851// NotDone returns true if the enumeration should be started or is not yet complete. 4852func (iter IoTSecurityAggregatedAlertListIterator) NotDone() bool { 4853 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 4854} 4855 4856// Response returns the raw server response from the last page request. 4857func (iter IoTSecurityAggregatedAlertListIterator) Response() IoTSecurityAggregatedAlertList { 4858 return iter.page.Response() 4859} 4860 4861// Value returns the current value or a zero-initialized value if the 4862// iterator has advanced beyond the end of the collection. 4863func (iter IoTSecurityAggregatedAlertListIterator) Value() IoTSecurityAggregatedAlert { 4864 if !iter.page.NotDone() { 4865 return IoTSecurityAggregatedAlert{} 4866 } 4867 return iter.page.Values()[iter.i] 4868} 4869 4870// Creates a new instance of the IoTSecurityAggregatedAlertListIterator type. 4871func NewIoTSecurityAggregatedAlertListIterator(page IoTSecurityAggregatedAlertListPage) IoTSecurityAggregatedAlertListIterator { 4872 return IoTSecurityAggregatedAlertListIterator{page: page} 4873} 4874 4875// IsEmpty returns true if the ListResult contains no values. 4876func (itsaal IoTSecurityAggregatedAlertList) IsEmpty() bool { 4877 return itsaal.Value == nil || len(*itsaal.Value) == 0 4878} 4879 4880// ioTSecurityAggregatedAlertListPreparer prepares a request to retrieve the next set of results. 4881// It returns nil if no more results exist. 4882func (itsaal IoTSecurityAggregatedAlertList) ioTSecurityAggregatedAlertListPreparer(ctx context.Context) (*http.Request, error) { 4883 if itsaal.NextLink == nil || len(to.String(itsaal.NextLink)) < 1 { 4884 return nil, nil 4885 } 4886 return autorest.Prepare((&http.Request{}).WithContext(ctx), 4887 autorest.AsJSON(), 4888 autorest.AsGet(), 4889 autorest.WithBaseURL(to.String(itsaal.NextLink))) 4890} 4891 4892// IoTSecurityAggregatedAlertListPage contains a page of IoTSecurityAggregatedAlert values. 4893type IoTSecurityAggregatedAlertListPage struct { 4894 fn func(context.Context, IoTSecurityAggregatedAlertList) (IoTSecurityAggregatedAlertList, error) 4895 itsaal IoTSecurityAggregatedAlertList 4896} 4897 4898// NextWithContext advances to the next page of values. If there was an error making 4899// the request the page does not advance and the error is returned. 4900func (page *IoTSecurityAggregatedAlertListPage) NextWithContext(ctx context.Context) (err error) { 4901 if tracing.IsEnabled() { 4902 ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecurityAggregatedAlertListPage.NextWithContext") 4903 defer func() { 4904 sc := -1 4905 if page.Response().Response.Response != nil { 4906 sc = page.Response().Response.Response.StatusCode 4907 } 4908 tracing.EndSpan(ctx, sc, err) 4909 }() 4910 } 4911 next, err := page.fn(ctx, page.itsaal) 4912 if err != nil { 4913 return err 4914 } 4915 page.itsaal = next 4916 return nil 4917} 4918 4919// Next advances to the next page of values. If there was an error making 4920// the request the page does not advance and the error is returned. 4921// Deprecated: Use NextWithContext() instead. 4922func (page *IoTSecurityAggregatedAlertListPage) Next() error { 4923 return page.NextWithContext(context.Background()) 4924} 4925 4926// NotDone returns true if the page enumeration should be started or is not yet complete. 4927func (page IoTSecurityAggregatedAlertListPage) NotDone() bool { 4928 return !page.itsaal.IsEmpty() 4929} 4930 4931// Response returns the raw server response from the last page request. 4932func (page IoTSecurityAggregatedAlertListPage) Response() IoTSecurityAggregatedAlertList { 4933 return page.itsaal 4934} 4935 4936// Values returns the slice of values for the current page or nil if there are no values. 4937func (page IoTSecurityAggregatedAlertListPage) Values() []IoTSecurityAggregatedAlert { 4938 if page.itsaal.IsEmpty() { 4939 return nil 4940 } 4941 return *page.itsaal.Value 4942} 4943 4944// Creates a new instance of the IoTSecurityAggregatedAlertListPage type. 4945func NewIoTSecurityAggregatedAlertListPage(getNextPage func(context.Context, IoTSecurityAggregatedAlertList) (IoTSecurityAggregatedAlertList, error)) IoTSecurityAggregatedAlertListPage { 4946 return IoTSecurityAggregatedAlertListPage{fn: getNextPage} 4947} 4948 4949// IoTSecurityAggregatedAlertProperties security Solution Aggregated Alert data 4950type IoTSecurityAggregatedAlertProperties struct { 4951 // AlertType - READ-ONLY; Name of the alert type 4952 AlertType *string `json:"alertType,omitempty"` 4953 // AlertDisplayName - READ-ONLY; Display name of the alert type 4954 AlertDisplayName *string `json:"alertDisplayName,omitempty"` 4955 // AggregatedDateUtc - READ-ONLY; The date the incidents were detected by the vendor 4956 AggregatedDateUtc *date.Date `json:"aggregatedDateUtc,omitempty"` 4957 // VendorName - READ-ONLY; Name of the vendor that discovered the incident 4958 VendorName *string `json:"vendorName,omitempty"` 4959 // ReportedSeverity - READ-ONLY; Estimated severity of this alert. Possible values include: 'Informational', 'Low', 'Medium', 'High' 4960 ReportedSeverity ReportedSeverity `json:"reportedSeverity,omitempty"` 4961 // RemediationSteps - READ-ONLY; Recommended steps for remediation 4962 RemediationSteps *string `json:"remediationSteps,omitempty"` 4963 // Description - READ-ONLY; Description of the incident and what it means 4964 Description *string `json:"description,omitempty"` 4965 // Count - READ-ONLY; Occurrence number of the alert within the aggregated date 4966 Count *int32 `json:"count,omitempty"` 4967 // EffectedResourceType - READ-ONLY; Azure resource ID of the resource that got the alerts 4968 EffectedResourceType *string `json:"effectedResourceType,omitempty"` 4969 // SystemSource - READ-ONLY; The type of the alerted resource (Azure, Non-Azure) 4970 SystemSource *string `json:"systemSource,omitempty"` 4971 // ActionTaken - READ-ONLY; The action that was taken as a response to the alert (Active, Blocked etc.) 4972 ActionTaken *string `json:"actionTaken,omitempty"` 4973 // LogAnalyticsQuery - READ-ONLY; query in log analytics to get the list of affected devices/alerts 4974 LogAnalyticsQuery *string `json:"logAnalyticsQuery,omitempty"` 4975} 4976 4977// IoTSecurityAggregatedRecommendation security Solution Recommendation Information 4978type IoTSecurityAggregatedRecommendation struct { 4979 autorest.Response `json:"-"` 4980 // ID - READ-ONLY; Resource Id 4981 ID *string `json:"id,omitempty"` 4982 // Name - READ-ONLY; Resource name 4983 Name *string `json:"name,omitempty"` 4984 // Type - READ-ONLY; Resource type 4985 Type *string `json:"type,omitempty"` 4986 // Tags - Resource tags 4987 Tags map[string]*string `json:"tags"` 4988 // IoTSecurityAggregatedRecommendationProperties - Security Solution data 4989 *IoTSecurityAggregatedRecommendationProperties `json:"properties,omitempty"` 4990} 4991 4992// MarshalJSON is the custom marshaler for IoTSecurityAggregatedRecommendation. 4993func (itsar IoTSecurityAggregatedRecommendation) MarshalJSON() ([]byte, error) { 4994 objectMap := make(map[string]interface{}) 4995 if itsar.Tags != nil { 4996 objectMap["tags"] = itsar.Tags 4997 } 4998 if itsar.IoTSecurityAggregatedRecommendationProperties != nil { 4999 objectMap["properties"] = itsar.IoTSecurityAggregatedRecommendationProperties 5000 } 5001 return json.Marshal(objectMap) 5002} 5003 5004// UnmarshalJSON is the custom unmarshaler for IoTSecurityAggregatedRecommendation struct. 5005func (itsar *IoTSecurityAggregatedRecommendation) UnmarshalJSON(body []byte) error { 5006 var m map[string]*json.RawMessage 5007 err := json.Unmarshal(body, &m) 5008 if err != nil { 5009 return err 5010 } 5011 for k, v := range m { 5012 switch k { 5013 case "id": 5014 if v != nil { 5015 var ID string 5016 err = json.Unmarshal(*v, &ID) 5017 if err != nil { 5018 return err 5019 } 5020 itsar.ID = &ID 5021 } 5022 case "name": 5023 if v != nil { 5024 var name string 5025 err = json.Unmarshal(*v, &name) 5026 if err != nil { 5027 return err 5028 } 5029 itsar.Name = &name 5030 } 5031 case "type": 5032 if v != nil { 5033 var typeVar string 5034 err = json.Unmarshal(*v, &typeVar) 5035 if err != nil { 5036 return err 5037 } 5038 itsar.Type = &typeVar 5039 } 5040 case "tags": 5041 if v != nil { 5042 var tags map[string]*string 5043 err = json.Unmarshal(*v, &tags) 5044 if err != nil { 5045 return err 5046 } 5047 itsar.Tags = tags 5048 } 5049 case "properties": 5050 if v != nil { 5051 var ioTSecurityAggregatedRecommendationProperties IoTSecurityAggregatedRecommendationProperties 5052 err = json.Unmarshal(*v, &ioTSecurityAggregatedRecommendationProperties) 5053 if err != nil { 5054 return err 5055 } 5056 itsar.IoTSecurityAggregatedRecommendationProperties = &ioTSecurityAggregatedRecommendationProperties 5057 } 5058 } 5059 } 5060 5061 return nil 5062} 5063 5064// IoTSecurityAggregatedRecommendationList list of IoT aggregated security recommendations 5065type IoTSecurityAggregatedRecommendationList struct { 5066 autorest.Response `json:"-"` 5067 // Value - List of aggregated alerts data 5068 Value *[]IoTSecurityAggregatedRecommendation `json:"value,omitempty"` 5069 // NextLink - READ-ONLY; The URI to fetch the next page. 5070 NextLink *string `json:"nextLink,omitempty"` 5071} 5072 5073// IoTSecurityAggregatedRecommendationListIterator provides access to a complete listing of 5074// IoTSecurityAggregatedRecommendation values. 5075type IoTSecurityAggregatedRecommendationListIterator struct { 5076 i int 5077 page IoTSecurityAggregatedRecommendationListPage 5078} 5079 5080// NextWithContext advances to the next value. If there was an error making 5081// the request the iterator does not advance and the error is returned. 5082func (iter *IoTSecurityAggregatedRecommendationListIterator) NextWithContext(ctx context.Context) (err error) { 5083 if tracing.IsEnabled() { 5084 ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecurityAggregatedRecommendationListIterator.NextWithContext") 5085 defer func() { 5086 sc := -1 5087 if iter.Response().Response.Response != nil { 5088 sc = iter.Response().Response.Response.StatusCode 5089 } 5090 tracing.EndSpan(ctx, sc, err) 5091 }() 5092 } 5093 iter.i++ 5094 if iter.i < len(iter.page.Values()) { 5095 return nil 5096 } 5097 err = iter.page.NextWithContext(ctx) 5098 if err != nil { 5099 iter.i-- 5100 return err 5101 } 5102 iter.i = 0 5103 return nil 5104} 5105 5106// Next advances to the next value. If there was an error making 5107// the request the iterator does not advance and the error is returned. 5108// Deprecated: Use NextWithContext() instead. 5109func (iter *IoTSecurityAggregatedRecommendationListIterator) Next() error { 5110 return iter.NextWithContext(context.Background()) 5111} 5112 5113// NotDone returns true if the enumeration should be started or is not yet complete. 5114func (iter IoTSecurityAggregatedRecommendationListIterator) NotDone() bool { 5115 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5116} 5117 5118// Response returns the raw server response from the last page request. 5119func (iter IoTSecurityAggregatedRecommendationListIterator) Response() IoTSecurityAggregatedRecommendationList { 5120 return iter.page.Response() 5121} 5122 5123// Value returns the current value or a zero-initialized value if the 5124// iterator has advanced beyond the end of the collection. 5125func (iter IoTSecurityAggregatedRecommendationListIterator) Value() IoTSecurityAggregatedRecommendation { 5126 if !iter.page.NotDone() { 5127 return IoTSecurityAggregatedRecommendation{} 5128 } 5129 return iter.page.Values()[iter.i] 5130} 5131 5132// Creates a new instance of the IoTSecurityAggregatedRecommendationListIterator type. 5133func NewIoTSecurityAggregatedRecommendationListIterator(page IoTSecurityAggregatedRecommendationListPage) IoTSecurityAggregatedRecommendationListIterator { 5134 return IoTSecurityAggregatedRecommendationListIterator{page: page} 5135} 5136 5137// IsEmpty returns true if the ListResult contains no values. 5138func (itsarl IoTSecurityAggregatedRecommendationList) IsEmpty() bool { 5139 return itsarl.Value == nil || len(*itsarl.Value) == 0 5140} 5141 5142// ioTSecurityAggregatedRecommendationListPreparer prepares a request to retrieve the next set of results. 5143// It returns nil if no more results exist. 5144func (itsarl IoTSecurityAggregatedRecommendationList) ioTSecurityAggregatedRecommendationListPreparer(ctx context.Context) (*http.Request, error) { 5145 if itsarl.NextLink == nil || len(to.String(itsarl.NextLink)) < 1 { 5146 return nil, nil 5147 } 5148 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5149 autorest.AsJSON(), 5150 autorest.AsGet(), 5151 autorest.WithBaseURL(to.String(itsarl.NextLink))) 5152} 5153 5154// IoTSecurityAggregatedRecommendationListPage contains a page of IoTSecurityAggregatedRecommendation 5155// values. 5156type IoTSecurityAggregatedRecommendationListPage struct { 5157 fn func(context.Context, IoTSecurityAggregatedRecommendationList) (IoTSecurityAggregatedRecommendationList, error) 5158 itsarl IoTSecurityAggregatedRecommendationList 5159} 5160 5161// NextWithContext advances to the next page of values. If there was an error making 5162// the request the page does not advance and the error is returned. 5163func (page *IoTSecurityAggregatedRecommendationListPage) NextWithContext(ctx context.Context) (err error) { 5164 if tracing.IsEnabled() { 5165 ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecurityAggregatedRecommendationListPage.NextWithContext") 5166 defer func() { 5167 sc := -1 5168 if page.Response().Response.Response != nil { 5169 sc = page.Response().Response.Response.StatusCode 5170 } 5171 tracing.EndSpan(ctx, sc, err) 5172 }() 5173 } 5174 next, err := page.fn(ctx, page.itsarl) 5175 if err != nil { 5176 return err 5177 } 5178 page.itsarl = next 5179 return nil 5180} 5181 5182// Next advances to the next page of values. If there was an error making 5183// the request the page does not advance and the error is returned. 5184// Deprecated: Use NextWithContext() instead. 5185func (page *IoTSecurityAggregatedRecommendationListPage) Next() error { 5186 return page.NextWithContext(context.Background()) 5187} 5188 5189// NotDone returns true if the page enumeration should be started or is not yet complete. 5190func (page IoTSecurityAggregatedRecommendationListPage) NotDone() bool { 5191 return !page.itsarl.IsEmpty() 5192} 5193 5194// Response returns the raw server response from the last page request. 5195func (page IoTSecurityAggregatedRecommendationListPage) Response() IoTSecurityAggregatedRecommendationList { 5196 return page.itsarl 5197} 5198 5199// Values returns the slice of values for the current page or nil if there are no values. 5200func (page IoTSecurityAggregatedRecommendationListPage) Values() []IoTSecurityAggregatedRecommendation { 5201 if page.itsarl.IsEmpty() { 5202 return nil 5203 } 5204 return *page.itsarl.Value 5205} 5206 5207// Creates a new instance of the IoTSecurityAggregatedRecommendationListPage type. 5208func NewIoTSecurityAggregatedRecommendationListPage(getNextPage func(context.Context, IoTSecurityAggregatedRecommendationList) (IoTSecurityAggregatedRecommendationList, error)) IoTSecurityAggregatedRecommendationListPage { 5209 return IoTSecurityAggregatedRecommendationListPage{fn: getNextPage} 5210} 5211 5212// IoTSecurityAggregatedRecommendationProperties security Solution Recommendation Information 5213type IoTSecurityAggregatedRecommendationProperties struct { 5214 // RecommendationName - Name of the recommendation 5215 RecommendationName *string `json:"recommendationName,omitempty"` 5216 // RecommendationDisplayName - READ-ONLY; Display name of the recommendation type. 5217 RecommendationDisplayName *string `json:"recommendationDisplayName,omitempty"` 5218 // Description - READ-ONLY; Description of the incident and what it means 5219 Description *string `json:"description,omitempty"` 5220 // RecommendationTypeID - READ-ONLY; The recommendation-type GUID. 5221 RecommendationTypeID *string `json:"recommendationTypeId,omitempty"` 5222 // DetectedBy - READ-ONLY; Name of the vendor that discovered the issue 5223 DetectedBy *string `json:"detectedBy,omitempty"` 5224 // RemediationSteps - READ-ONLY; Recommended steps for remediation 5225 RemediationSteps *string `json:"remediationSteps,omitempty"` 5226 // ReportedSeverity - READ-ONLY; Estimated severity of this recommendation. Possible values include: 'Informational', 'Low', 'Medium', 'High' 5227 ReportedSeverity ReportedSeverity `json:"reportedSeverity,omitempty"` 5228 // HealthyDevices - READ-ONLY; the number of the healthy devices within the solution 5229 HealthyDevices *int32 `json:"healthyDevices,omitempty"` 5230 // UnhealthyDeviceCount - READ-ONLY; the number of the unhealthy devices within the solution 5231 UnhealthyDeviceCount *int32 `json:"unhealthyDeviceCount,omitempty"` 5232 // LogAnalyticsQuery - READ-ONLY; query in log analytics to get the list of affected devices/alerts 5233 LogAnalyticsQuery *string `json:"logAnalyticsQuery,omitempty"` 5234} 5235 5236// IoTSecurityAlertedDevice statistic information about the number of alerts per device during the last 5237// period 5238type IoTSecurityAlertedDevice struct { 5239 // DeviceID - READ-ONLY; Name of the alert type 5240 DeviceID *string `json:"deviceId,omitempty"` 5241 // AlertsCount - READ-ONLY; the number of alerts raised for this device 5242 AlertsCount *int32 `json:"alertsCount,omitempty"` 5243} 5244 5245// IoTSecurityAlertedDevicesList list of devices with the count of raised alerts 5246type IoTSecurityAlertedDevicesList struct { 5247 // Value - List of aggregated alerts data 5248 Value *[]IoTSecurityAlertedDevice `json:"value,omitempty"` 5249 // NextLink - READ-ONLY; The URI to fetch the next page. 5250 NextLink *string `json:"nextLink,omitempty"` 5251} 5252 5253// IoTSecurityDeviceAlert statistic information about the number of alerts per alert type during the last 5254// period 5255type IoTSecurityDeviceAlert struct { 5256 // AlertDisplayName - READ-ONLY; Display name of the alert 5257 AlertDisplayName *string `json:"alertDisplayName,omitempty"` 5258 // ReportedSeverity - READ-ONLY; Estimated severity of this alert. Possible values include: 'Informational', 'Low', 'Medium', 'High' 5259 ReportedSeverity ReportedSeverity `json:"reportedSeverity,omitempty"` 5260 // AlertsCount - READ-ONLY; the number of alerts raised for this alert type 5261 AlertsCount *int32 `json:"alertsCount,omitempty"` 5262} 5263 5264// IoTSecurityDeviceAlertsList list of alerts with the count of raised alerts 5265type IoTSecurityDeviceAlertsList struct { 5266 // Value - List of top alerts data 5267 Value *[]IoTSecurityDeviceAlert `json:"value,omitempty"` 5268 // NextLink - READ-ONLY; The URI to fetch the next page. 5269 NextLink *string `json:"nextLink,omitempty"` 5270} 5271 5272// IoTSecurityDeviceRecommendation statistic information about the number of recommendations per 5273// recommendation type 5274type IoTSecurityDeviceRecommendation struct { 5275 // RecommendationDisplayName - READ-ONLY; Display name of the recommendation 5276 RecommendationDisplayName *string `json:"recommendationDisplayName,omitempty"` 5277 // ReportedSeverity - READ-ONLY; Estimated severity of this recommendation. Possible values include: 'Informational', 'Low', 'Medium', 'High' 5278 ReportedSeverity ReportedSeverity `json:"reportedSeverity,omitempty"` 5279 // DevicesCount - READ-ONLY; the number of device with this recommendation 5280 DevicesCount *int32 `json:"devicesCount,omitempty"` 5281} 5282 5283// IoTSecurityDeviceRecommendationsList list of recommendations with the count of devices 5284type IoTSecurityDeviceRecommendationsList struct { 5285 // Value - List of aggregated recommendation data 5286 Value *[]IoTSecurityDeviceRecommendation `json:"value,omitempty"` 5287 // NextLink - READ-ONLY; The URI to fetch the next page. 5288 NextLink *string `json:"nextLink,omitempty"` 5289} 5290 5291// IoTSecuritySolutionAnalyticsModel security Analytics of a security solution 5292type IoTSecuritySolutionAnalyticsModel struct { 5293 autorest.Response `json:"-"` 5294 // IoTSecuritySolutionAnalyticsModelProperties - Security Solution Aggregated Alert data 5295 *IoTSecuritySolutionAnalyticsModelProperties `json:"properties,omitempty"` 5296 // ID - READ-ONLY; Resource Id 5297 ID *string `json:"id,omitempty"` 5298 // Name - READ-ONLY; Resource name 5299 Name *string `json:"name,omitempty"` 5300 // Type - READ-ONLY; Resource type 5301 Type *string `json:"type,omitempty"` 5302} 5303 5304// MarshalJSON is the custom marshaler for IoTSecuritySolutionAnalyticsModel. 5305func (itssam IoTSecuritySolutionAnalyticsModel) MarshalJSON() ([]byte, error) { 5306 objectMap := make(map[string]interface{}) 5307 if itssam.IoTSecuritySolutionAnalyticsModelProperties != nil { 5308 objectMap["properties"] = itssam.IoTSecuritySolutionAnalyticsModelProperties 5309 } 5310 return json.Marshal(objectMap) 5311} 5312 5313// UnmarshalJSON is the custom unmarshaler for IoTSecuritySolutionAnalyticsModel struct. 5314func (itssam *IoTSecuritySolutionAnalyticsModel) UnmarshalJSON(body []byte) error { 5315 var m map[string]*json.RawMessage 5316 err := json.Unmarshal(body, &m) 5317 if err != nil { 5318 return err 5319 } 5320 for k, v := range m { 5321 switch k { 5322 case "properties": 5323 if v != nil { 5324 var ioTSecuritySolutionAnalyticsModelProperties IoTSecuritySolutionAnalyticsModelProperties 5325 err = json.Unmarshal(*v, &ioTSecuritySolutionAnalyticsModelProperties) 5326 if err != nil { 5327 return err 5328 } 5329 itssam.IoTSecuritySolutionAnalyticsModelProperties = &ioTSecuritySolutionAnalyticsModelProperties 5330 } 5331 case "id": 5332 if v != nil { 5333 var ID string 5334 err = json.Unmarshal(*v, &ID) 5335 if err != nil { 5336 return err 5337 } 5338 itssam.ID = &ID 5339 } 5340 case "name": 5341 if v != nil { 5342 var name string 5343 err = json.Unmarshal(*v, &name) 5344 if err != nil { 5345 return err 5346 } 5347 itssam.Name = &name 5348 } 5349 case "type": 5350 if v != nil { 5351 var typeVar string 5352 err = json.Unmarshal(*v, &typeVar) 5353 if err != nil { 5354 return err 5355 } 5356 itssam.Type = &typeVar 5357 } 5358 } 5359 } 5360 5361 return nil 5362} 5363 5364// IoTSecuritySolutionAnalyticsModelList list of Security Analytics of a security solution 5365type IoTSecuritySolutionAnalyticsModelList struct { 5366 autorest.Response `json:"-"` 5367 // Value - List of Security Analytics of a security solution 5368 Value *[]IoTSecuritySolutionAnalyticsModel `json:"value,omitempty"` 5369 // NextLink - READ-ONLY; The URI to fetch the next page. 5370 NextLink *string `json:"nextLink,omitempty"` 5371} 5372 5373// IoTSecuritySolutionAnalyticsModelProperties security Analytics of a security solution properties 5374type IoTSecuritySolutionAnalyticsModelProperties struct { 5375 // Metrics - READ-ONLY; Security Analytics of a security solution 5376 Metrics *IoTSeverityMetrics `json:"metrics,omitempty"` 5377 // UnhealthyDeviceCount - READ-ONLY; number of unhealthy devices 5378 UnhealthyDeviceCount *int32 `json:"unhealthyDeviceCount,omitempty"` 5379 // DevicesMetrics - READ-ONLY; The list of devices metrics by the aggregated date. 5380 DevicesMetrics *[]IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem `json:"devicesMetrics,omitempty"` 5381 // TopAlertedDevices - The list of top 3 devices with the most attacked. 5382 TopAlertedDevices *IoTSecurityAlertedDevicesList `json:"topAlertedDevices,omitempty"` 5383 // MostPrevalentDeviceAlerts - The list of most prevalent 3 alerts. 5384 MostPrevalentDeviceAlerts *IoTSecurityDeviceAlertsList `json:"mostPrevalentDeviceAlerts,omitempty"` 5385 // MostPrevalentDeviceRecommendations - The list of most prevalent 3 recommendations. 5386 MostPrevalentDeviceRecommendations *IoTSecurityDeviceRecommendationsList `json:"mostPrevalentDeviceRecommendations,omitempty"` 5387} 5388 5389// IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem ... 5390type IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem struct { 5391 // Date - the date of the metrics 5392 Date *date.Time `json:"date,omitempty"` 5393 // DevicesMetrics - devices alerts count by severity. 5394 DevicesMetrics *IoTSeverityMetrics `json:"devicesMetrics,omitempty"` 5395} 5396 5397// IoTSecuritySolutionModel security Solution 5398type IoTSecuritySolutionModel struct { 5399 autorest.Response `json:"-"` 5400 // ID - READ-ONLY; Resource Id 5401 ID *string `json:"id,omitempty"` 5402 // Name - READ-ONLY; Resource name 5403 Name *string `json:"name,omitempty"` 5404 // Type - READ-ONLY; Resource type 5405 Type *string `json:"type,omitempty"` 5406 // Tags - Resource tags 5407 Tags map[string]*string `json:"tags"` 5408 // Location - The resource location. 5409 Location *string `json:"location,omitempty"` 5410 // IoTSecuritySolutionProperties - Security Solution data 5411 *IoTSecuritySolutionProperties `json:"properties,omitempty"` 5412} 5413 5414// MarshalJSON is the custom marshaler for IoTSecuritySolutionModel. 5415func (itssm IoTSecuritySolutionModel) MarshalJSON() ([]byte, error) { 5416 objectMap := make(map[string]interface{}) 5417 if itssm.Tags != nil { 5418 objectMap["tags"] = itssm.Tags 5419 } 5420 if itssm.Location != nil { 5421 objectMap["location"] = itssm.Location 5422 } 5423 if itssm.IoTSecuritySolutionProperties != nil { 5424 objectMap["properties"] = itssm.IoTSecuritySolutionProperties 5425 } 5426 return json.Marshal(objectMap) 5427} 5428 5429// UnmarshalJSON is the custom unmarshaler for IoTSecuritySolutionModel struct. 5430func (itssm *IoTSecuritySolutionModel) UnmarshalJSON(body []byte) error { 5431 var m map[string]*json.RawMessage 5432 err := json.Unmarshal(body, &m) 5433 if err != nil { 5434 return err 5435 } 5436 for k, v := range m { 5437 switch k { 5438 case "id": 5439 if v != nil { 5440 var ID string 5441 err = json.Unmarshal(*v, &ID) 5442 if err != nil { 5443 return err 5444 } 5445 itssm.ID = &ID 5446 } 5447 case "name": 5448 if v != nil { 5449 var name string 5450 err = json.Unmarshal(*v, &name) 5451 if err != nil { 5452 return err 5453 } 5454 itssm.Name = &name 5455 } 5456 case "type": 5457 if v != nil { 5458 var typeVar string 5459 err = json.Unmarshal(*v, &typeVar) 5460 if err != nil { 5461 return err 5462 } 5463 itssm.Type = &typeVar 5464 } 5465 case "tags": 5466 if v != nil { 5467 var tags map[string]*string 5468 err = json.Unmarshal(*v, &tags) 5469 if err != nil { 5470 return err 5471 } 5472 itssm.Tags = tags 5473 } 5474 case "location": 5475 if v != nil { 5476 var location string 5477 err = json.Unmarshal(*v, &location) 5478 if err != nil { 5479 return err 5480 } 5481 itssm.Location = &location 5482 } 5483 case "properties": 5484 if v != nil { 5485 var ioTSecuritySolutionProperties IoTSecuritySolutionProperties 5486 err = json.Unmarshal(*v, &ioTSecuritySolutionProperties) 5487 if err != nil { 5488 return err 5489 } 5490 itssm.IoTSecuritySolutionProperties = &ioTSecuritySolutionProperties 5491 } 5492 } 5493 } 5494 5495 return nil 5496} 5497 5498// IoTSecuritySolutionProperties security Solution setting data 5499type IoTSecuritySolutionProperties struct { 5500 // Workspace - Workspace resource ID 5501 Workspace *string `json:"workspace,omitempty"` 5502 // DisplayName - Resource display name. 5503 DisplayName *string `json:"displayName,omitempty"` 5504 // Status - Security solution status. Possible values include: 'SolutionStatusEnabled', 'SolutionStatusDisabled' 5505 Status SolutionStatus `json:"status,omitempty"` 5506 // Export - List of additional export to workspace data options 5507 Export *[]ExportData `json:"export,omitempty"` 5508 // DisabledDataSources - Disabled data sources. Disabling these data sources compromises the system. 5509 DisabledDataSources *[]DataSource `json:"disabledDataSources,omitempty"` 5510 // IotHubs - IoT Hub resource IDs 5511 IotHubs *[]string `json:"iotHubs,omitempty"` 5512 UserDefinedResources *UserDefinedResourcesProperties `json:"userDefinedResources,omitempty"` 5513 // AutoDiscoveredResources - READ-ONLY; List of resources that were automatically discovered as relevant to the security solution. 5514 AutoDiscoveredResources *[]string `json:"autoDiscoveredResources,omitempty"` 5515 RecommendationsConfiguration *[]RecommendationConfigurationProperties `json:"recommendationsConfiguration,omitempty"` 5516} 5517 5518// IoTSecuritySolutionsList list of iot solutions 5519type IoTSecuritySolutionsList struct { 5520 autorest.Response `json:"-"` 5521 // Value - List of security solutions 5522 Value *[]IoTSecuritySolutionModel `json:"value,omitempty"` 5523 // NextLink - READ-ONLY; The URI to fetch the next page. 5524 NextLink *string `json:"nextLink,omitempty"` 5525} 5526 5527// IoTSecuritySolutionsListIterator provides access to a complete listing of IoTSecuritySolutionModel 5528// values. 5529type IoTSecuritySolutionsListIterator struct { 5530 i int 5531 page IoTSecuritySolutionsListPage 5532} 5533 5534// NextWithContext advances to the next value. If there was an error making 5535// the request the iterator does not advance and the error is returned. 5536func (iter *IoTSecuritySolutionsListIterator) NextWithContext(ctx context.Context) (err error) { 5537 if tracing.IsEnabled() { 5538 ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsListIterator.NextWithContext") 5539 defer func() { 5540 sc := -1 5541 if iter.Response().Response.Response != nil { 5542 sc = iter.Response().Response.Response.StatusCode 5543 } 5544 tracing.EndSpan(ctx, sc, err) 5545 }() 5546 } 5547 iter.i++ 5548 if iter.i < len(iter.page.Values()) { 5549 return nil 5550 } 5551 err = iter.page.NextWithContext(ctx) 5552 if err != nil { 5553 iter.i-- 5554 return err 5555 } 5556 iter.i = 0 5557 return nil 5558} 5559 5560// Next advances to the next value. If there was an error making 5561// the request the iterator does not advance and the error is returned. 5562// Deprecated: Use NextWithContext() instead. 5563func (iter *IoTSecuritySolutionsListIterator) Next() error { 5564 return iter.NextWithContext(context.Background()) 5565} 5566 5567// NotDone returns true if the enumeration should be started or is not yet complete. 5568func (iter IoTSecuritySolutionsListIterator) NotDone() bool { 5569 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5570} 5571 5572// Response returns the raw server response from the last page request. 5573func (iter IoTSecuritySolutionsListIterator) Response() IoTSecuritySolutionsList { 5574 return iter.page.Response() 5575} 5576 5577// Value returns the current value or a zero-initialized value if the 5578// iterator has advanced beyond the end of the collection. 5579func (iter IoTSecuritySolutionsListIterator) Value() IoTSecuritySolutionModel { 5580 if !iter.page.NotDone() { 5581 return IoTSecuritySolutionModel{} 5582 } 5583 return iter.page.Values()[iter.i] 5584} 5585 5586// Creates a new instance of the IoTSecuritySolutionsListIterator type. 5587func NewIoTSecuritySolutionsListIterator(page IoTSecuritySolutionsListPage) IoTSecuritySolutionsListIterator { 5588 return IoTSecuritySolutionsListIterator{page: page} 5589} 5590 5591// IsEmpty returns true if the ListResult contains no values. 5592func (itssl IoTSecuritySolutionsList) IsEmpty() bool { 5593 return itssl.Value == nil || len(*itssl.Value) == 0 5594} 5595 5596// ioTSecuritySolutionsListPreparer prepares a request to retrieve the next set of results. 5597// It returns nil if no more results exist. 5598func (itssl IoTSecuritySolutionsList) ioTSecuritySolutionsListPreparer(ctx context.Context) (*http.Request, error) { 5599 if itssl.NextLink == nil || len(to.String(itssl.NextLink)) < 1 { 5600 return nil, nil 5601 } 5602 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5603 autorest.AsJSON(), 5604 autorest.AsGet(), 5605 autorest.WithBaseURL(to.String(itssl.NextLink))) 5606} 5607 5608// IoTSecuritySolutionsListPage contains a page of IoTSecuritySolutionModel values. 5609type IoTSecuritySolutionsListPage struct { 5610 fn func(context.Context, IoTSecuritySolutionsList) (IoTSecuritySolutionsList, error) 5611 itssl IoTSecuritySolutionsList 5612} 5613 5614// NextWithContext advances to the next page of values. If there was an error making 5615// the request the page does not advance and the error is returned. 5616func (page *IoTSecuritySolutionsListPage) NextWithContext(ctx context.Context) (err error) { 5617 if tracing.IsEnabled() { 5618 ctx = tracing.StartSpan(ctx, fqdn+"/IoTSecuritySolutionsListPage.NextWithContext") 5619 defer func() { 5620 sc := -1 5621 if page.Response().Response.Response != nil { 5622 sc = page.Response().Response.Response.StatusCode 5623 } 5624 tracing.EndSpan(ctx, sc, err) 5625 }() 5626 } 5627 next, err := page.fn(ctx, page.itssl) 5628 if err != nil { 5629 return err 5630 } 5631 page.itssl = next 5632 return nil 5633} 5634 5635// Next advances to the next page of values. If there was an error making 5636// the request the page does not advance and the error is returned. 5637// Deprecated: Use NextWithContext() instead. 5638func (page *IoTSecuritySolutionsListPage) Next() error { 5639 return page.NextWithContext(context.Background()) 5640} 5641 5642// NotDone returns true if the page enumeration should be started or is not yet complete. 5643func (page IoTSecuritySolutionsListPage) NotDone() bool { 5644 return !page.itssl.IsEmpty() 5645} 5646 5647// Response returns the raw server response from the last page request. 5648func (page IoTSecuritySolutionsListPage) Response() IoTSecuritySolutionsList { 5649 return page.itssl 5650} 5651 5652// Values returns the slice of values for the current page or nil if there are no values. 5653func (page IoTSecuritySolutionsListPage) Values() []IoTSecuritySolutionModel { 5654 if page.itssl.IsEmpty() { 5655 return nil 5656 } 5657 return *page.itssl.Value 5658} 5659 5660// Creates a new instance of the IoTSecuritySolutionsListPage type. 5661func NewIoTSecuritySolutionsListPage(getNextPage func(context.Context, IoTSecuritySolutionsList) (IoTSecuritySolutionsList, error)) IoTSecuritySolutionsListPage { 5662 return IoTSecuritySolutionsListPage{fn: getNextPage} 5663} 5664 5665// IoTSeverityMetrics severity metrics 5666type IoTSeverityMetrics struct { 5667 // High - count of high severity items 5668 High *int32 `json:"high,omitempty"` 5669 // Medium - count of medium severity items 5670 Medium *int32 `json:"medium,omitempty"` 5671 // Low - count of low severity items 5672 Low *int32 `json:"low,omitempty"` 5673} 5674 5675// JitNetworkAccessPoliciesList ... 5676type JitNetworkAccessPoliciesList struct { 5677 autorest.Response `json:"-"` 5678 Value *[]JitNetworkAccessPolicy `json:"value,omitempty"` 5679 // NextLink - READ-ONLY; The URI to fetch the next page. 5680 NextLink *string `json:"nextLink,omitempty"` 5681} 5682 5683// JitNetworkAccessPoliciesListIterator provides access to a complete listing of JitNetworkAccessPolicy 5684// values. 5685type JitNetworkAccessPoliciesListIterator struct { 5686 i int 5687 page JitNetworkAccessPoliciesListPage 5688} 5689 5690// NextWithContext advances to the next value. If there was an error making 5691// the request the iterator does not advance and the error is returned. 5692func (iter *JitNetworkAccessPoliciesListIterator) NextWithContext(ctx context.Context) (err error) { 5693 if tracing.IsEnabled() { 5694 ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesListIterator.NextWithContext") 5695 defer func() { 5696 sc := -1 5697 if iter.Response().Response.Response != nil { 5698 sc = iter.Response().Response.Response.StatusCode 5699 } 5700 tracing.EndSpan(ctx, sc, err) 5701 }() 5702 } 5703 iter.i++ 5704 if iter.i < len(iter.page.Values()) { 5705 return nil 5706 } 5707 err = iter.page.NextWithContext(ctx) 5708 if err != nil { 5709 iter.i-- 5710 return err 5711 } 5712 iter.i = 0 5713 return nil 5714} 5715 5716// Next advances to the next value. If there was an error making 5717// the request the iterator does not advance and the error is returned. 5718// Deprecated: Use NextWithContext() instead. 5719func (iter *JitNetworkAccessPoliciesListIterator) Next() error { 5720 return iter.NextWithContext(context.Background()) 5721} 5722 5723// NotDone returns true if the enumeration should be started or is not yet complete. 5724func (iter JitNetworkAccessPoliciesListIterator) NotDone() bool { 5725 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 5726} 5727 5728// Response returns the raw server response from the last page request. 5729func (iter JitNetworkAccessPoliciesListIterator) Response() JitNetworkAccessPoliciesList { 5730 return iter.page.Response() 5731} 5732 5733// Value returns the current value or a zero-initialized value if the 5734// iterator has advanced beyond the end of the collection. 5735func (iter JitNetworkAccessPoliciesListIterator) Value() JitNetworkAccessPolicy { 5736 if !iter.page.NotDone() { 5737 return JitNetworkAccessPolicy{} 5738 } 5739 return iter.page.Values()[iter.i] 5740} 5741 5742// Creates a new instance of the JitNetworkAccessPoliciesListIterator type. 5743func NewJitNetworkAccessPoliciesListIterator(page JitNetworkAccessPoliciesListPage) JitNetworkAccessPoliciesListIterator { 5744 return JitNetworkAccessPoliciesListIterator{page: page} 5745} 5746 5747// IsEmpty returns true if the ListResult contains no values. 5748func (jnapl JitNetworkAccessPoliciesList) IsEmpty() bool { 5749 return jnapl.Value == nil || len(*jnapl.Value) == 0 5750} 5751 5752// jitNetworkAccessPoliciesListPreparer prepares a request to retrieve the next set of results. 5753// It returns nil if no more results exist. 5754func (jnapl JitNetworkAccessPoliciesList) jitNetworkAccessPoliciesListPreparer(ctx context.Context) (*http.Request, error) { 5755 if jnapl.NextLink == nil || len(to.String(jnapl.NextLink)) < 1 { 5756 return nil, nil 5757 } 5758 return autorest.Prepare((&http.Request{}).WithContext(ctx), 5759 autorest.AsJSON(), 5760 autorest.AsGet(), 5761 autorest.WithBaseURL(to.String(jnapl.NextLink))) 5762} 5763 5764// JitNetworkAccessPoliciesListPage contains a page of JitNetworkAccessPolicy values. 5765type JitNetworkAccessPoliciesListPage struct { 5766 fn func(context.Context, JitNetworkAccessPoliciesList) (JitNetworkAccessPoliciesList, error) 5767 jnapl JitNetworkAccessPoliciesList 5768} 5769 5770// NextWithContext advances to the next page of values. If there was an error making 5771// the request the page does not advance and the error is returned. 5772func (page *JitNetworkAccessPoliciesListPage) NextWithContext(ctx context.Context) (err error) { 5773 if tracing.IsEnabled() { 5774 ctx = tracing.StartSpan(ctx, fqdn+"/JitNetworkAccessPoliciesListPage.NextWithContext") 5775 defer func() { 5776 sc := -1 5777 if page.Response().Response.Response != nil { 5778 sc = page.Response().Response.Response.StatusCode 5779 } 5780 tracing.EndSpan(ctx, sc, err) 5781 }() 5782 } 5783 next, err := page.fn(ctx, page.jnapl) 5784 if err != nil { 5785 return err 5786 } 5787 page.jnapl = next 5788 return nil 5789} 5790 5791// Next advances to the next page of values. If there was an error making 5792// the request the page does not advance and the error is returned. 5793// Deprecated: Use NextWithContext() instead. 5794func (page *JitNetworkAccessPoliciesListPage) Next() error { 5795 return page.NextWithContext(context.Background()) 5796} 5797 5798// NotDone returns true if the page enumeration should be started or is not yet complete. 5799func (page JitNetworkAccessPoliciesListPage) NotDone() bool { 5800 return !page.jnapl.IsEmpty() 5801} 5802 5803// Response returns the raw server response from the last page request. 5804func (page JitNetworkAccessPoliciesListPage) Response() JitNetworkAccessPoliciesList { 5805 return page.jnapl 5806} 5807 5808// Values returns the slice of values for the current page or nil if there are no values. 5809func (page JitNetworkAccessPoliciesListPage) Values() []JitNetworkAccessPolicy { 5810 if page.jnapl.IsEmpty() { 5811 return nil 5812 } 5813 return *page.jnapl.Value 5814} 5815 5816// Creates a new instance of the JitNetworkAccessPoliciesListPage type. 5817func NewJitNetworkAccessPoliciesListPage(getNextPage func(context.Context, JitNetworkAccessPoliciesList) (JitNetworkAccessPoliciesList, error)) JitNetworkAccessPoliciesListPage { 5818 return JitNetworkAccessPoliciesListPage{fn: getNextPage} 5819} 5820 5821// JitNetworkAccessPolicy ... 5822type JitNetworkAccessPolicy struct { 5823 autorest.Response `json:"-"` 5824 // ID - READ-ONLY; Resource Id 5825 ID *string `json:"id,omitempty"` 5826 // Name - READ-ONLY; Resource name 5827 Name *string `json:"name,omitempty"` 5828 // Type - READ-ONLY; Resource type 5829 Type *string `json:"type,omitempty"` 5830 // Kind - Kind of the resource 5831 Kind *string `json:"kind,omitempty"` 5832 // Location - READ-ONLY; Location where the resource is stored 5833 Location *string `json:"location,omitempty"` 5834 *JitNetworkAccessPolicyProperties `json:"properties,omitempty"` 5835} 5836 5837// MarshalJSON is the custom marshaler for JitNetworkAccessPolicy. 5838func (jnap JitNetworkAccessPolicy) MarshalJSON() ([]byte, error) { 5839 objectMap := make(map[string]interface{}) 5840 if jnap.Kind != nil { 5841 objectMap["kind"] = jnap.Kind 5842 } 5843 if jnap.JitNetworkAccessPolicyProperties != nil { 5844 objectMap["properties"] = jnap.JitNetworkAccessPolicyProperties 5845 } 5846 return json.Marshal(objectMap) 5847} 5848 5849// UnmarshalJSON is the custom unmarshaler for JitNetworkAccessPolicy struct. 5850func (jnap *JitNetworkAccessPolicy) UnmarshalJSON(body []byte) error { 5851 var m map[string]*json.RawMessage 5852 err := json.Unmarshal(body, &m) 5853 if err != nil { 5854 return err 5855 } 5856 for k, v := range m { 5857 switch k { 5858 case "id": 5859 if v != nil { 5860 var ID string 5861 err = json.Unmarshal(*v, &ID) 5862 if err != nil { 5863 return err 5864 } 5865 jnap.ID = &ID 5866 } 5867 case "name": 5868 if v != nil { 5869 var name string 5870 err = json.Unmarshal(*v, &name) 5871 if err != nil { 5872 return err 5873 } 5874 jnap.Name = &name 5875 } 5876 case "type": 5877 if v != nil { 5878 var typeVar string 5879 err = json.Unmarshal(*v, &typeVar) 5880 if err != nil { 5881 return err 5882 } 5883 jnap.Type = &typeVar 5884 } 5885 case "kind": 5886 if v != nil { 5887 var kind string 5888 err = json.Unmarshal(*v, &kind) 5889 if err != nil { 5890 return err 5891 } 5892 jnap.Kind = &kind 5893 } 5894 case "location": 5895 if v != nil { 5896 var location string 5897 err = json.Unmarshal(*v, &location) 5898 if err != nil { 5899 return err 5900 } 5901 jnap.Location = &location 5902 } 5903 case "properties": 5904 if v != nil { 5905 var jitNetworkAccessPolicyProperties JitNetworkAccessPolicyProperties 5906 err = json.Unmarshal(*v, &jitNetworkAccessPolicyProperties) 5907 if err != nil { 5908 return err 5909 } 5910 jnap.JitNetworkAccessPolicyProperties = &jitNetworkAccessPolicyProperties 5911 } 5912 } 5913 } 5914 5915 return nil 5916} 5917 5918// JitNetworkAccessPolicyInitiatePort ... 5919type JitNetworkAccessPolicyInitiatePort struct { 5920 Number *int32 `json:"number,omitempty"` 5921 // AllowedSourceAddressPrefix - Source of the allowed traffic. If omitted, the request will be for the source IP address of the initiate request. 5922 AllowedSourceAddressPrefix *string `json:"allowedSourceAddressPrefix,omitempty"` 5923 // EndTimeUtc - The time to close the request in UTC 5924 EndTimeUtc *date.Time `json:"endTimeUtc,omitempty"` 5925} 5926 5927// JitNetworkAccessPolicyInitiateRequest ... 5928type JitNetworkAccessPolicyInitiateRequest struct { 5929 // VirtualMachines - A list of virtual machines & ports to open access for 5930 VirtualMachines *[]JitNetworkAccessPolicyInitiateVirtualMachine `json:"virtualMachines,omitempty"` 5931 // Justification - The justification for making the initiate request 5932 Justification *string `json:"justification,omitempty"` 5933} 5934 5935// JitNetworkAccessPolicyInitiateVirtualMachine ... 5936type JitNetworkAccessPolicyInitiateVirtualMachine struct { 5937 // ID - Resource ID of the virtual machine that is linked to this policy 5938 ID *string `json:"id,omitempty"` 5939 // Ports - The ports to open for the resource with the `id` 5940 Ports *[]JitNetworkAccessPolicyInitiatePort `json:"ports,omitempty"` 5941} 5942 5943// JitNetworkAccessPolicyProperties ... 5944type JitNetworkAccessPolicyProperties struct { 5945 // VirtualMachines - Configurations for Microsoft.Compute/virtualMachines resource type. 5946 VirtualMachines *[]JitNetworkAccessPolicyVirtualMachine `json:"virtualMachines,omitempty"` 5947 Requests *[]JitNetworkAccessRequest `json:"requests,omitempty"` 5948 // ProvisioningState - READ-ONLY; Gets the provisioning state of the Just-in-Time policy. 5949 ProvisioningState *string `json:"provisioningState,omitempty"` 5950} 5951 5952// JitNetworkAccessPolicyVirtualMachine ... 5953type JitNetworkAccessPolicyVirtualMachine struct { 5954 // ID - Resource ID of the virtual machine that is linked to this policy 5955 ID *string `json:"id,omitempty"` 5956 // Ports - Port configurations for the virtual machine 5957 Ports *[]JitNetworkAccessPortRule `json:"ports,omitempty"` 5958 // PublicIPAddress - Public IP address of the Azure Firewall that is linked to this policy, if applicable 5959 PublicIPAddress *string `json:"publicIpAddress,omitempty"` 5960} 5961 5962// JitNetworkAccessPortRule ... 5963type JitNetworkAccessPortRule struct { 5964 Number *int32 `json:"number,omitempty"` 5965 // Protocol - Possible values include: 'TCP', 'UDP', 'All' 5966 Protocol Protocol `json:"protocol,omitempty"` 5967 // AllowedSourceAddressPrefix - Mutually exclusive with the "allowedSourceAddressPrefixes" parameter. Should be an IP address or CIDR, for example "192.168.0.3" or "192.168.0.0/16". 5968 AllowedSourceAddressPrefix *string `json:"allowedSourceAddressPrefix,omitempty"` 5969 // AllowedSourceAddressPrefixes - Mutually exclusive with the "allowedSourceAddressPrefix" parameter. 5970 AllowedSourceAddressPrefixes *[]string `json:"allowedSourceAddressPrefixes,omitempty"` 5971 // MaxRequestAccessDuration - Maximum duration requests can be made for. In ISO 8601 duration format. Minimum 5 minutes, maximum 1 day 5972 MaxRequestAccessDuration *string `json:"maxRequestAccessDuration,omitempty"` 5973} 5974 5975// JitNetworkAccessRequest ... 5976type JitNetworkAccessRequest struct { 5977 autorest.Response `json:"-"` 5978 VirtualMachines *[]JitNetworkAccessRequestVirtualMachine `json:"virtualMachines,omitempty"` 5979 // StartTimeUtc - The start time of the request in UTC 5980 StartTimeUtc *date.Time `json:"startTimeUtc,omitempty"` 5981 // Requestor - The identity of the person who made the request 5982 Requestor *string `json:"requestor,omitempty"` 5983 // Justification - The justification for making the initiate request 5984 Justification *string `json:"justification,omitempty"` 5985} 5986 5987// JitNetworkAccessRequestPort ... 5988type JitNetworkAccessRequestPort struct { 5989 Number *int32 `json:"number,omitempty"` 5990 // AllowedSourceAddressPrefix - Mutually exclusive with the "allowedSourceAddressPrefixes" parameter. Should be an IP address or CIDR, for example "192.168.0.3" or "192.168.0.0/16". 5991 AllowedSourceAddressPrefix *string `json:"allowedSourceAddressPrefix,omitempty"` 5992 // AllowedSourceAddressPrefixes - Mutually exclusive with the "allowedSourceAddressPrefix" parameter. 5993 AllowedSourceAddressPrefixes *[]string `json:"allowedSourceAddressPrefixes,omitempty"` 5994 // EndTimeUtc - The date & time at which the request ends in UTC 5995 EndTimeUtc *date.Time `json:"endTimeUtc,omitempty"` 5996 // Status - The status of the port. Possible values include: 'Revoked', 'Initiated' 5997 Status Status `json:"status,omitempty"` 5998 // StatusReason - A description of why the `status` has its value. Possible values include: 'Expired', 'UserRequested', 'NewerRequestInitiated' 5999 StatusReason StatusReason `json:"statusReason,omitempty"` 6000 // MappedPort - The port which is mapped to this port's `number` in the Azure Firewall, if applicable 6001 MappedPort *int32 `json:"mappedPort,omitempty"` 6002} 6003 6004// JitNetworkAccessRequestVirtualMachine ... 6005type JitNetworkAccessRequestVirtualMachine struct { 6006 // ID - Resource ID of the virtual machine that is linked to this policy 6007 ID *string `json:"id,omitempty"` 6008 // Ports - The ports that were opened for the virtual machine 6009 Ports *[]JitNetworkAccessRequestPort `json:"ports,omitempty"` 6010} 6011 6012// Kind describes an Azure resource with kind 6013type Kind struct { 6014 // Kind - Kind of the resource 6015 Kind *string `json:"kind,omitempty"` 6016} 6017 6018// ListCustomAlertRule a List custom alert rule 6019type ListCustomAlertRule struct { 6020 // ValueType - READ-ONLY; The value type of the items in the list. Possible values include: 'IPCidr', 'String' 6021 ValueType ValueType `json:"valueType,omitempty"` 6022 // DisplayName - READ-ONLY; The display name of the custom alert. 6023 DisplayName *string `json:"displayName,omitempty"` 6024 // Description - READ-ONLY; The description of the custom alert. 6025 Description *string `json:"description,omitempty"` 6026 // IsEnabled - Whether the custom alert is enabled. 6027 IsEnabled *bool `json:"isEnabled,omitempty"` 6028 // RuleType - The type of the custom alert rule. 6029 RuleType *string `json:"ruleType,omitempty"` 6030} 6031 6032// Location describes an Azure resource with location 6033type Location struct { 6034 // Location - READ-ONLY; Location where the resource is stored 6035 Location *string `json:"location,omitempty"` 6036} 6037 6038// Operation possible operation in the REST API of Microsoft.Security 6039type Operation struct { 6040 // Name - READ-ONLY; Name of the operation 6041 Name *string `json:"name,omitempty"` 6042 // Origin - READ-ONLY; Where the operation is originated 6043 Origin *string `json:"origin,omitempty"` 6044 Display *OperationDisplay `json:"display,omitempty"` 6045} 6046 6047// OperationDisplay security operation display 6048type OperationDisplay struct { 6049 // Provider - READ-ONLY; The resource provider for the operation. 6050 Provider *string `json:"provider,omitempty"` 6051 // Resource - READ-ONLY; The display name of the resource the operation applies to. 6052 Resource *string `json:"resource,omitempty"` 6053 // Operation - READ-ONLY; The display name of the security operation. 6054 Operation *string `json:"operation,omitempty"` 6055 // Description - READ-ONLY; The description of the operation. 6056 Description *string `json:"description,omitempty"` 6057} 6058 6059// OperationList list of possible operations for Microsoft.Security resource provider 6060type OperationList struct { 6061 autorest.Response `json:"-"` 6062 // Value - List of Security operations 6063 Value *[]Operation `json:"value,omitempty"` 6064 // NextLink - READ-ONLY; The URI to fetch the next page. 6065 NextLink *string `json:"nextLink,omitempty"` 6066} 6067 6068// OperationListIterator provides access to a complete listing of Operation values. 6069type OperationListIterator struct { 6070 i int 6071 page OperationListPage 6072} 6073 6074// NextWithContext advances to the next value. If there was an error making 6075// the request the iterator does not advance and the error is returned. 6076func (iter *OperationListIterator) NextWithContext(ctx context.Context) (err error) { 6077 if tracing.IsEnabled() { 6078 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListIterator.NextWithContext") 6079 defer func() { 6080 sc := -1 6081 if iter.Response().Response.Response != nil { 6082 sc = iter.Response().Response.Response.StatusCode 6083 } 6084 tracing.EndSpan(ctx, sc, err) 6085 }() 6086 } 6087 iter.i++ 6088 if iter.i < len(iter.page.Values()) { 6089 return nil 6090 } 6091 err = iter.page.NextWithContext(ctx) 6092 if err != nil { 6093 iter.i-- 6094 return err 6095 } 6096 iter.i = 0 6097 return nil 6098} 6099 6100// Next advances to the next value. If there was an error making 6101// the request the iterator does not advance and the error is returned. 6102// Deprecated: Use NextWithContext() instead. 6103func (iter *OperationListIterator) Next() error { 6104 return iter.NextWithContext(context.Background()) 6105} 6106 6107// NotDone returns true if the enumeration should be started or is not yet complete. 6108func (iter OperationListIterator) NotDone() bool { 6109 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6110} 6111 6112// Response returns the raw server response from the last page request. 6113func (iter OperationListIterator) Response() OperationList { 6114 return iter.page.Response() 6115} 6116 6117// Value returns the current value or a zero-initialized value if the 6118// iterator has advanced beyond the end of the collection. 6119func (iter OperationListIterator) Value() Operation { 6120 if !iter.page.NotDone() { 6121 return Operation{} 6122 } 6123 return iter.page.Values()[iter.i] 6124} 6125 6126// Creates a new instance of the OperationListIterator type. 6127func NewOperationListIterator(page OperationListPage) OperationListIterator { 6128 return OperationListIterator{page: page} 6129} 6130 6131// IsEmpty returns true if the ListResult contains no values. 6132func (ol OperationList) IsEmpty() bool { 6133 return ol.Value == nil || len(*ol.Value) == 0 6134} 6135 6136// operationListPreparer prepares a request to retrieve the next set of results. 6137// It returns nil if no more results exist. 6138func (ol OperationList) operationListPreparer(ctx context.Context) (*http.Request, error) { 6139 if ol.NextLink == nil || len(to.String(ol.NextLink)) < 1 { 6140 return nil, nil 6141 } 6142 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6143 autorest.AsJSON(), 6144 autorest.AsGet(), 6145 autorest.WithBaseURL(to.String(ol.NextLink))) 6146} 6147 6148// OperationListPage contains a page of Operation values. 6149type OperationListPage struct { 6150 fn func(context.Context, OperationList) (OperationList, error) 6151 ol OperationList 6152} 6153 6154// NextWithContext advances to the next page of values. If there was an error making 6155// the request the page does not advance and the error is returned. 6156func (page *OperationListPage) NextWithContext(ctx context.Context) (err error) { 6157 if tracing.IsEnabled() { 6158 ctx = tracing.StartSpan(ctx, fqdn+"/OperationListPage.NextWithContext") 6159 defer func() { 6160 sc := -1 6161 if page.Response().Response.Response != nil { 6162 sc = page.Response().Response.Response.StatusCode 6163 } 6164 tracing.EndSpan(ctx, sc, err) 6165 }() 6166 } 6167 next, err := page.fn(ctx, page.ol) 6168 if err != nil { 6169 return err 6170 } 6171 page.ol = next 6172 return nil 6173} 6174 6175// Next advances to the next page of values. If there was an error making 6176// the request the page does not advance and the error is returned. 6177// Deprecated: Use NextWithContext() instead. 6178func (page *OperationListPage) Next() error { 6179 return page.NextWithContext(context.Background()) 6180} 6181 6182// NotDone returns true if the page enumeration should be started or is not yet complete. 6183func (page OperationListPage) NotDone() bool { 6184 return !page.ol.IsEmpty() 6185} 6186 6187// Response returns the raw server response from the last page request. 6188func (page OperationListPage) Response() OperationList { 6189 return page.ol 6190} 6191 6192// Values returns the slice of values for the current page or nil if there are no values. 6193func (page OperationListPage) Values() []Operation { 6194 if page.ol.IsEmpty() { 6195 return nil 6196 } 6197 return *page.ol.Value 6198} 6199 6200// Creates a new instance of the OperationListPage type. 6201func NewOperationListPage(getNextPage func(context.Context, OperationList) (OperationList, error)) OperationListPage { 6202 return OperationListPage{fn: getNextPage} 6203} 6204 6205// PathRecommendation represents a path that is recommended to be allowed and its properties 6206type PathRecommendation struct { 6207 // Path - The full path to whitelist 6208 Path *string `json:"path,omitempty"` 6209 // Action - Possible values include: 'Recommended', 'Add', 'Remove' 6210 Action Action `json:"action,omitempty"` 6211 // Type - Possible values include: 'File', 'FileHash', 'PublisherSignature', 'ProductSignature', 'BinarySignature', 'VersionAndAboveSignature' 6212 Type Type `json:"type,omitempty"` 6213 PublisherInfo *PublisherInfo `json:"publisherInfo,omitempty"` 6214 // Common - Whether the path is commonly run on the machine 6215 Common *bool `json:"common,omitempty"` 6216 UserSids *[]string `json:"userSids,omitempty"` 6217 Usernames *[]UserRecommendation `json:"usernames,omitempty"` 6218 // FileType - Possible values include: 'FileTypeExe', 'FileTypeDll', 'FileTypeMsi', 'FileTypeScript', 'FileTypeExecutable', 'FileTypeUnknown' 6219 FileType FileType `json:"fileType,omitempty"` 6220 // ConfigurationStatus - Possible values include: 'ConfigurationStatus1Configured', 'ConfigurationStatus1NotConfigured', 'ConfigurationStatus1InProgress', 'ConfigurationStatus1Failed', 'ConfigurationStatus1NoStatus' 6221 ConfigurationStatus ConfigurationStatus1 `json:"configurationStatus,omitempty"` 6222} 6223 6224// Pricing azure Security Center is provided in two pricing tiers: free and standard, with the standard 6225// tier available with a trial period. The standard tier offers advanced security capabilities, while the 6226// free tier offers basic security features. 6227type Pricing struct { 6228 autorest.Response `json:"-"` 6229 // PricingProperties - Pricing data 6230 *PricingProperties `json:"properties,omitempty"` 6231 // ID - READ-ONLY; Resource Id 6232 ID *string `json:"id,omitempty"` 6233 // Name - READ-ONLY; Resource name 6234 Name *string `json:"name,omitempty"` 6235 // Type - READ-ONLY; Resource type 6236 Type *string `json:"type,omitempty"` 6237} 6238 6239// MarshalJSON is the custom marshaler for Pricing. 6240func (p Pricing) MarshalJSON() ([]byte, error) { 6241 objectMap := make(map[string]interface{}) 6242 if p.PricingProperties != nil { 6243 objectMap["properties"] = p.PricingProperties 6244 } 6245 return json.Marshal(objectMap) 6246} 6247 6248// UnmarshalJSON is the custom unmarshaler for Pricing struct. 6249func (p *Pricing) UnmarshalJSON(body []byte) error { 6250 var m map[string]*json.RawMessage 6251 err := json.Unmarshal(body, &m) 6252 if err != nil { 6253 return err 6254 } 6255 for k, v := range m { 6256 switch k { 6257 case "properties": 6258 if v != nil { 6259 var pricingProperties PricingProperties 6260 err = json.Unmarshal(*v, &pricingProperties) 6261 if err != nil { 6262 return err 6263 } 6264 p.PricingProperties = &pricingProperties 6265 } 6266 case "id": 6267 if v != nil { 6268 var ID string 6269 err = json.Unmarshal(*v, &ID) 6270 if err != nil { 6271 return err 6272 } 6273 p.ID = &ID 6274 } 6275 case "name": 6276 if v != nil { 6277 var name string 6278 err = json.Unmarshal(*v, &name) 6279 if err != nil { 6280 return err 6281 } 6282 p.Name = &name 6283 } 6284 case "type": 6285 if v != nil { 6286 var typeVar string 6287 err = json.Unmarshal(*v, &typeVar) 6288 if err != nil { 6289 return err 6290 } 6291 p.Type = &typeVar 6292 } 6293 } 6294 } 6295 6296 return nil 6297} 6298 6299// PricingList list of pricing configurations response. 6300type PricingList struct { 6301 autorest.Response `json:"-"` 6302 // Value - List of pricing configurations 6303 Value *[]Pricing `json:"value,omitempty"` 6304} 6305 6306// PricingProperties pricing properties for the relevant scope 6307type PricingProperties struct { 6308 // PricingTier - The pricing tier value. Azure Security Center is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features. Possible values include: 'Free', 'Standard' 6309 PricingTier PricingTier `json:"pricingTier,omitempty"` 6310 // FreeTrialRemainingTime - READ-ONLY; The duration left for the subscriptions free trial period - in ISO 8601 format (e.g. P3Y6M4DT12H30M5S). 6311 FreeTrialRemainingTime *string `json:"freeTrialRemainingTime,omitempty"` 6312} 6313 6314// ProtectionMode the protection mode of the collection/file types. Exe/Msi/Script are used for Windows, 6315// Executable is used for Linux. 6316type ProtectionMode struct { 6317 // Exe - Possible values include: 'ExeAudit', 'ExeEnforce', 'ExeNone' 6318 Exe Exe `json:"exe,omitempty"` 6319 // Msi - Possible values include: 'MsiAudit', 'MsiEnforce', 'MsiNone' 6320 Msi Msi `json:"msi,omitempty"` 6321 // Script - Possible values include: 'ScriptAudit', 'ScriptEnforce', 'ScriptNone' 6322 Script Script `json:"script,omitempty"` 6323 // Executable - Possible values include: 'ExecutableAudit', 'ExecutableEnforce', 'ExecutableNone' 6324 Executable Executable `json:"executable,omitempty"` 6325} 6326 6327// PublisherInfo represents the publisher information of a process/rule 6328type PublisherInfo struct { 6329 // PublisherName - The Subject field of the x.509 certificate used to sign the code, using the following fields - O = Organization, L = Locality, S = State or Province, and C = Country 6330 PublisherName *string `json:"publisherName,omitempty"` 6331 // ProductName - The product name taken from the file's version resource 6332 ProductName *string `json:"productName,omitempty"` 6333 // BinaryName - The "OriginalName" field taken from the file's version resource 6334 BinaryName *string `json:"binaryName,omitempty"` 6335 // Version - The binary file version taken from the file's version resource 6336 Version *string `json:"version,omitempty"` 6337} 6338 6339// RecommendationConfigurationProperties recommendation configuration 6340type RecommendationConfigurationProperties struct { 6341 // RecommendationType - The recommendation type. Possible values include: 'IoTACRAuthentication', 'IoTAgentSendsUnutilizedMessages', 'IoTBaseline', 'IoTEdgeHubMemOptimize', 'IoTEdgeLoggingOptions', 'IoTInconsistentModuleSettings', 'IoTInstallAgent', 'IoTIPFilterDenyAll', 'IoTIPFilterPermissiveRule', 'IoTOpenPorts', 'IoTPermissiveFirewallPolicy', 'IoTPermissiveInputFirewallRules', 'IoTPermissiveOutputFirewallRules', 'IoTPrivilegedDockerOptions', 'IoTSharedCredentials', 'IoTVulnerableTLSCipherSuite' 6342 RecommendationType RecommendationType `json:"recommendationType,omitempty"` 6343 // Name - READ-ONLY 6344 Name *string `json:"name,omitempty"` 6345 // Status - Recommendation status. The recommendation is not generated when the status is disabled. Possible values include: 'Disabled', 'Enabled' 6346 Status RecommendationConfigStatus `json:"status,omitempty"` 6347} 6348 6349// RegulatoryComplianceAssessment regulatory compliance assessment details and state 6350type RegulatoryComplianceAssessment struct { 6351 autorest.Response `json:"-"` 6352 // RegulatoryComplianceAssessmentProperties - Regulatory compliance assessment data 6353 *RegulatoryComplianceAssessmentProperties `json:"properties,omitempty"` 6354 // ID - READ-ONLY; Resource Id 6355 ID *string `json:"id,omitempty"` 6356 // Name - READ-ONLY; Resource name 6357 Name *string `json:"name,omitempty"` 6358 // Type - READ-ONLY; Resource type 6359 Type *string `json:"type,omitempty"` 6360} 6361 6362// MarshalJSON is the custom marshaler for RegulatoryComplianceAssessment. 6363func (rca RegulatoryComplianceAssessment) MarshalJSON() ([]byte, error) { 6364 objectMap := make(map[string]interface{}) 6365 if rca.RegulatoryComplianceAssessmentProperties != nil { 6366 objectMap["properties"] = rca.RegulatoryComplianceAssessmentProperties 6367 } 6368 return json.Marshal(objectMap) 6369} 6370 6371// UnmarshalJSON is the custom unmarshaler for RegulatoryComplianceAssessment struct. 6372func (rca *RegulatoryComplianceAssessment) UnmarshalJSON(body []byte) error { 6373 var m map[string]*json.RawMessage 6374 err := json.Unmarshal(body, &m) 6375 if err != nil { 6376 return err 6377 } 6378 for k, v := range m { 6379 switch k { 6380 case "properties": 6381 if v != nil { 6382 var regulatoryComplianceAssessmentProperties RegulatoryComplianceAssessmentProperties 6383 err = json.Unmarshal(*v, ®ulatoryComplianceAssessmentProperties) 6384 if err != nil { 6385 return err 6386 } 6387 rca.RegulatoryComplianceAssessmentProperties = ®ulatoryComplianceAssessmentProperties 6388 } 6389 case "id": 6390 if v != nil { 6391 var ID string 6392 err = json.Unmarshal(*v, &ID) 6393 if err != nil { 6394 return err 6395 } 6396 rca.ID = &ID 6397 } 6398 case "name": 6399 if v != nil { 6400 var name string 6401 err = json.Unmarshal(*v, &name) 6402 if err != nil { 6403 return err 6404 } 6405 rca.Name = &name 6406 } 6407 case "type": 6408 if v != nil { 6409 var typeVar string 6410 err = json.Unmarshal(*v, &typeVar) 6411 if err != nil { 6412 return err 6413 } 6414 rca.Type = &typeVar 6415 } 6416 } 6417 } 6418 6419 return nil 6420} 6421 6422// RegulatoryComplianceAssessmentList list of regulatory compliance assessment response 6423type RegulatoryComplianceAssessmentList struct { 6424 autorest.Response `json:"-"` 6425 Value *[]RegulatoryComplianceAssessment `json:"value,omitempty"` 6426 // NextLink - READ-ONLY; The URI to fetch the next page. 6427 NextLink *string `json:"nextLink,omitempty"` 6428} 6429 6430// RegulatoryComplianceAssessmentListIterator provides access to a complete listing of 6431// RegulatoryComplianceAssessment values. 6432type RegulatoryComplianceAssessmentListIterator struct { 6433 i int 6434 page RegulatoryComplianceAssessmentListPage 6435} 6436 6437// NextWithContext advances to the next value. If there was an error making 6438// the request the iterator does not advance and the error is returned. 6439func (iter *RegulatoryComplianceAssessmentListIterator) NextWithContext(ctx context.Context) (err error) { 6440 if tracing.IsEnabled() { 6441 ctx = tracing.StartSpan(ctx, fqdn+"/RegulatoryComplianceAssessmentListIterator.NextWithContext") 6442 defer func() { 6443 sc := -1 6444 if iter.Response().Response.Response != nil { 6445 sc = iter.Response().Response.Response.StatusCode 6446 } 6447 tracing.EndSpan(ctx, sc, err) 6448 }() 6449 } 6450 iter.i++ 6451 if iter.i < len(iter.page.Values()) { 6452 return nil 6453 } 6454 err = iter.page.NextWithContext(ctx) 6455 if err != nil { 6456 iter.i-- 6457 return err 6458 } 6459 iter.i = 0 6460 return nil 6461} 6462 6463// Next advances to the next value. If there was an error making 6464// the request the iterator does not advance and the error is returned. 6465// Deprecated: Use NextWithContext() instead. 6466func (iter *RegulatoryComplianceAssessmentListIterator) Next() error { 6467 return iter.NextWithContext(context.Background()) 6468} 6469 6470// NotDone returns true if the enumeration should be started or is not yet complete. 6471func (iter RegulatoryComplianceAssessmentListIterator) NotDone() bool { 6472 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6473} 6474 6475// Response returns the raw server response from the last page request. 6476func (iter RegulatoryComplianceAssessmentListIterator) Response() RegulatoryComplianceAssessmentList { 6477 return iter.page.Response() 6478} 6479 6480// Value returns the current value or a zero-initialized value if the 6481// iterator has advanced beyond the end of the collection. 6482func (iter RegulatoryComplianceAssessmentListIterator) Value() RegulatoryComplianceAssessment { 6483 if !iter.page.NotDone() { 6484 return RegulatoryComplianceAssessment{} 6485 } 6486 return iter.page.Values()[iter.i] 6487} 6488 6489// Creates a new instance of the RegulatoryComplianceAssessmentListIterator type. 6490func NewRegulatoryComplianceAssessmentListIterator(page RegulatoryComplianceAssessmentListPage) RegulatoryComplianceAssessmentListIterator { 6491 return RegulatoryComplianceAssessmentListIterator{page: page} 6492} 6493 6494// IsEmpty returns true if the ListResult contains no values. 6495func (rcal RegulatoryComplianceAssessmentList) IsEmpty() bool { 6496 return rcal.Value == nil || len(*rcal.Value) == 0 6497} 6498 6499// regulatoryComplianceAssessmentListPreparer prepares a request to retrieve the next set of results. 6500// It returns nil if no more results exist. 6501func (rcal RegulatoryComplianceAssessmentList) regulatoryComplianceAssessmentListPreparer(ctx context.Context) (*http.Request, error) { 6502 if rcal.NextLink == nil || len(to.String(rcal.NextLink)) < 1 { 6503 return nil, nil 6504 } 6505 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6506 autorest.AsJSON(), 6507 autorest.AsGet(), 6508 autorest.WithBaseURL(to.String(rcal.NextLink))) 6509} 6510 6511// RegulatoryComplianceAssessmentListPage contains a page of RegulatoryComplianceAssessment values. 6512type RegulatoryComplianceAssessmentListPage struct { 6513 fn func(context.Context, RegulatoryComplianceAssessmentList) (RegulatoryComplianceAssessmentList, error) 6514 rcal RegulatoryComplianceAssessmentList 6515} 6516 6517// NextWithContext advances to the next page of values. If there was an error making 6518// the request the page does not advance and the error is returned. 6519func (page *RegulatoryComplianceAssessmentListPage) NextWithContext(ctx context.Context) (err error) { 6520 if tracing.IsEnabled() { 6521 ctx = tracing.StartSpan(ctx, fqdn+"/RegulatoryComplianceAssessmentListPage.NextWithContext") 6522 defer func() { 6523 sc := -1 6524 if page.Response().Response.Response != nil { 6525 sc = page.Response().Response.Response.StatusCode 6526 } 6527 tracing.EndSpan(ctx, sc, err) 6528 }() 6529 } 6530 next, err := page.fn(ctx, page.rcal) 6531 if err != nil { 6532 return err 6533 } 6534 page.rcal = next 6535 return nil 6536} 6537 6538// Next advances to the next page of values. If there was an error making 6539// the request the page does not advance and the error is returned. 6540// Deprecated: Use NextWithContext() instead. 6541func (page *RegulatoryComplianceAssessmentListPage) Next() error { 6542 return page.NextWithContext(context.Background()) 6543} 6544 6545// NotDone returns true if the page enumeration should be started or is not yet complete. 6546func (page RegulatoryComplianceAssessmentListPage) NotDone() bool { 6547 return !page.rcal.IsEmpty() 6548} 6549 6550// Response returns the raw server response from the last page request. 6551func (page RegulatoryComplianceAssessmentListPage) Response() RegulatoryComplianceAssessmentList { 6552 return page.rcal 6553} 6554 6555// Values returns the slice of values for the current page or nil if there are no values. 6556func (page RegulatoryComplianceAssessmentListPage) Values() []RegulatoryComplianceAssessment { 6557 if page.rcal.IsEmpty() { 6558 return nil 6559 } 6560 return *page.rcal.Value 6561} 6562 6563// Creates a new instance of the RegulatoryComplianceAssessmentListPage type. 6564func NewRegulatoryComplianceAssessmentListPage(getNextPage func(context.Context, RegulatoryComplianceAssessmentList) (RegulatoryComplianceAssessmentList, error)) RegulatoryComplianceAssessmentListPage { 6565 return RegulatoryComplianceAssessmentListPage{fn: getNextPage} 6566} 6567 6568// RegulatoryComplianceAssessmentProperties regulatory compliance assessment data 6569type RegulatoryComplianceAssessmentProperties struct { 6570 // Description - READ-ONLY; The description of the regulatory compliance assessment 6571 Description *string `json:"description,omitempty"` 6572 // AssessmentType - READ-ONLY; The expected type of assessment contained in the AssessmentDetailsLink 6573 AssessmentType *string `json:"assessmentType,omitempty"` 6574 // AssessmentDetailsLink - READ-ONLY; Link to more detailed assessment results data. The response type will be according to the assessmentType field 6575 AssessmentDetailsLink *string `json:"assessmentDetailsLink,omitempty"` 6576 // State - Aggregative state based on the assessment's scanned resources states. Possible values include: 'StatePassed', 'StateFailed', 'StateSkipped', 'StateUnsupported' 6577 State State `json:"state,omitempty"` 6578 // PassedResources - READ-ONLY; The given assessment's related resources count with passed state. 6579 PassedResources *int32 `json:"passedResources,omitempty"` 6580 // FailedResources - READ-ONLY; The given assessment's related resources count with failed state. 6581 FailedResources *int32 `json:"failedResources,omitempty"` 6582 // SkippedResources - READ-ONLY; The given assessment's related resources count with skipped state. 6583 SkippedResources *int32 `json:"skippedResources,omitempty"` 6584 // UnsupportedResources - READ-ONLY; The given assessment's related resources count with unsupported state. 6585 UnsupportedResources *int32 `json:"unsupportedResources,omitempty"` 6586} 6587 6588// RegulatoryComplianceControl regulatory compliance control details and state 6589type RegulatoryComplianceControl struct { 6590 autorest.Response `json:"-"` 6591 // RegulatoryComplianceControlProperties - Regulatory compliance control data 6592 *RegulatoryComplianceControlProperties `json:"properties,omitempty"` 6593 // ID - READ-ONLY; Resource Id 6594 ID *string `json:"id,omitempty"` 6595 // Name - READ-ONLY; Resource name 6596 Name *string `json:"name,omitempty"` 6597 // Type - READ-ONLY; Resource type 6598 Type *string `json:"type,omitempty"` 6599} 6600 6601// MarshalJSON is the custom marshaler for RegulatoryComplianceControl. 6602func (rcc RegulatoryComplianceControl) MarshalJSON() ([]byte, error) { 6603 objectMap := make(map[string]interface{}) 6604 if rcc.RegulatoryComplianceControlProperties != nil { 6605 objectMap["properties"] = rcc.RegulatoryComplianceControlProperties 6606 } 6607 return json.Marshal(objectMap) 6608} 6609 6610// UnmarshalJSON is the custom unmarshaler for RegulatoryComplianceControl struct. 6611func (rcc *RegulatoryComplianceControl) UnmarshalJSON(body []byte) error { 6612 var m map[string]*json.RawMessage 6613 err := json.Unmarshal(body, &m) 6614 if err != nil { 6615 return err 6616 } 6617 for k, v := range m { 6618 switch k { 6619 case "properties": 6620 if v != nil { 6621 var regulatoryComplianceControlProperties RegulatoryComplianceControlProperties 6622 err = json.Unmarshal(*v, ®ulatoryComplianceControlProperties) 6623 if err != nil { 6624 return err 6625 } 6626 rcc.RegulatoryComplianceControlProperties = ®ulatoryComplianceControlProperties 6627 } 6628 case "id": 6629 if v != nil { 6630 var ID string 6631 err = json.Unmarshal(*v, &ID) 6632 if err != nil { 6633 return err 6634 } 6635 rcc.ID = &ID 6636 } 6637 case "name": 6638 if v != nil { 6639 var name string 6640 err = json.Unmarshal(*v, &name) 6641 if err != nil { 6642 return err 6643 } 6644 rcc.Name = &name 6645 } 6646 case "type": 6647 if v != nil { 6648 var typeVar string 6649 err = json.Unmarshal(*v, &typeVar) 6650 if err != nil { 6651 return err 6652 } 6653 rcc.Type = &typeVar 6654 } 6655 } 6656 } 6657 6658 return nil 6659} 6660 6661// RegulatoryComplianceControlList list of regulatory compliance controls response 6662type RegulatoryComplianceControlList struct { 6663 autorest.Response `json:"-"` 6664 // Value - List of regulatory compliance controls 6665 Value *[]RegulatoryComplianceControl `json:"value,omitempty"` 6666 // NextLink - READ-ONLY; The URI to fetch the next page. 6667 NextLink *string `json:"nextLink,omitempty"` 6668} 6669 6670// RegulatoryComplianceControlListIterator provides access to a complete listing of 6671// RegulatoryComplianceControl values. 6672type RegulatoryComplianceControlListIterator struct { 6673 i int 6674 page RegulatoryComplianceControlListPage 6675} 6676 6677// NextWithContext advances to the next value. If there was an error making 6678// the request the iterator does not advance and the error is returned. 6679func (iter *RegulatoryComplianceControlListIterator) NextWithContext(ctx context.Context) (err error) { 6680 if tracing.IsEnabled() { 6681 ctx = tracing.StartSpan(ctx, fqdn+"/RegulatoryComplianceControlListIterator.NextWithContext") 6682 defer func() { 6683 sc := -1 6684 if iter.Response().Response.Response != nil { 6685 sc = iter.Response().Response.Response.StatusCode 6686 } 6687 tracing.EndSpan(ctx, sc, err) 6688 }() 6689 } 6690 iter.i++ 6691 if iter.i < len(iter.page.Values()) { 6692 return nil 6693 } 6694 err = iter.page.NextWithContext(ctx) 6695 if err != nil { 6696 iter.i-- 6697 return err 6698 } 6699 iter.i = 0 6700 return nil 6701} 6702 6703// Next advances to the next value. If there was an error making 6704// the request the iterator does not advance and the error is returned. 6705// Deprecated: Use NextWithContext() instead. 6706func (iter *RegulatoryComplianceControlListIterator) Next() error { 6707 return iter.NextWithContext(context.Background()) 6708} 6709 6710// NotDone returns true if the enumeration should be started or is not yet complete. 6711func (iter RegulatoryComplianceControlListIterator) NotDone() bool { 6712 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6713} 6714 6715// Response returns the raw server response from the last page request. 6716func (iter RegulatoryComplianceControlListIterator) Response() RegulatoryComplianceControlList { 6717 return iter.page.Response() 6718} 6719 6720// Value returns the current value or a zero-initialized value if the 6721// iterator has advanced beyond the end of the collection. 6722func (iter RegulatoryComplianceControlListIterator) Value() RegulatoryComplianceControl { 6723 if !iter.page.NotDone() { 6724 return RegulatoryComplianceControl{} 6725 } 6726 return iter.page.Values()[iter.i] 6727} 6728 6729// Creates a new instance of the RegulatoryComplianceControlListIterator type. 6730func NewRegulatoryComplianceControlListIterator(page RegulatoryComplianceControlListPage) RegulatoryComplianceControlListIterator { 6731 return RegulatoryComplianceControlListIterator{page: page} 6732} 6733 6734// IsEmpty returns true if the ListResult contains no values. 6735func (rccl RegulatoryComplianceControlList) IsEmpty() bool { 6736 return rccl.Value == nil || len(*rccl.Value) == 0 6737} 6738 6739// regulatoryComplianceControlListPreparer prepares a request to retrieve the next set of results. 6740// It returns nil if no more results exist. 6741func (rccl RegulatoryComplianceControlList) regulatoryComplianceControlListPreparer(ctx context.Context) (*http.Request, error) { 6742 if rccl.NextLink == nil || len(to.String(rccl.NextLink)) < 1 { 6743 return nil, nil 6744 } 6745 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6746 autorest.AsJSON(), 6747 autorest.AsGet(), 6748 autorest.WithBaseURL(to.String(rccl.NextLink))) 6749} 6750 6751// RegulatoryComplianceControlListPage contains a page of RegulatoryComplianceControl values. 6752type RegulatoryComplianceControlListPage struct { 6753 fn func(context.Context, RegulatoryComplianceControlList) (RegulatoryComplianceControlList, error) 6754 rccl RegulatoryComplianceControlList 6755} 6756 6757// NextWithContext advances to the next page of values. If there was an error making 6758// the request the page does not advance and the error is returned. 6759func (page *RegulatoryComplianceControlListPage) NextWithContext(ctx context.Context) (err error) { 6760 if tracing.IsEnabled() { 6761 ctx = tracing.StartSpan(ctx, fqdn+"/RegulatoryComplianceControlListPage.NextWithContext") 6762 defer func() { 6763 sc := -1 6764 if page.Response().Response.Response != nil { 6765 sc = page.Response().Response.Response.StatusCode 6766 } 6767 tracing.EndSpan(ctx, sc, err) 6768 }() 6769 } 6770 next, err := page.fn(ctx, page.rccl) 6771 if err != nil { 6772 return err 6773 } 6774 page.rccl = next 6775 return nil 6776} 6777 6778// Next advances to the next page of values. If there was an error making 6779// the request the page does not advance and the error is returned. 6780// Deprecated: Use NextWithContext() instead. 6781func (page *RegulatoryComplianceControlListPage) Next() error { 6782 return page.NextWithContext(context.Background()) 6783} 6784 6785// NotDone returns true if the page enumeration should be started or is not yet complete. 6786func (page RegulatoryComplianceControlListPage) NotDone() bool { 6787 return !page.rccl.IsEmpty() 6788} 6789 6790// Response returns the raw server response from the last page request. 6791func (page RegulatoryComplianceControlListPage) Response() RegulatoryComplianceControlList { 6792 return page.rccl 6793} 6794 6795// Values returns the slice of values for the current page or nil if there are no values. 6796func (page RegulatoryComplianceControlListPage) Values() []RegulatoryComplianceControl { 6797 if page.rccl.IsEmpty() { 6798 return nil 6799 } 6800 return *page.rccl.Value 6801} 6802 6803// Creates a new instance of the RegulatoryComplianceControlListPage type. 6804func NewRegulatoryComplianceControlListPage(getNextPage func(context.Context, RegulatoryComplianceControlList) (RegulatoryComplianceControlList, error)) RegulatoryComplianceControlListPage { 6805 return RegulatoryComplianceControlListPage{fn: getNextPage} 6806} 6807 6808// RegulatoryComplianceControlProperties regulatory compliance control data 6809type RegulatoryComplianceControlProperties struct { 6810 // Description - READ-ONLY; The description of the regulatory compliance control 6811 Description *string `json:"description,omitempty"` 6812 // State - Aggregative state based on the control's supported assessments states. Possible values include: 'StatePassed', 'StateFailed', 'StateSkipped', 'StateUnsupported' 6813 State State `json:"state,omitempty"` 6814 // PassedAssessments - READ-ONLY; The number of supported regulatory compliance assessments of the given control with a passed state 6815 PassedAssessments *int32 `json:"passedAssessments,omitempty"` 6816 // FailedAssessments - READ-ONLY; The number of supported regulatory compliance assessments of the given control with a failed state 6817 FailedAssessments *int32 `json:"failedAssessments,omitempty"` 6818 // SkippedAssessments - READ-ONLY; The number of supported regulatory compliance assessments of the given control with a skipped state 6819 SkippedAssessments *int32 `json:"skippedAssessments,omitempty"` 6820} 6821 6822// RegulatoryComplianceStandard regulatory compliance standard details and state 6823type RegulatoryComplianceStandard struct { 6824 autorest.Response `json:"-"` 6825 // RegulatoryComplianceStandardProperties - Regulatory compliance standard data 6826 *RegulatoryComplianceStandardProperties `json:"properties,omitempty"` 6827 // ID - READ-ONLY; Resource Id 6828 ID *string `json:"id,omitempty"` 6829 // Name - READ-ONLY; Resource name 6830 Name *string `json:"name,omitempty"` 6831 // Type - READ-ONLY; Resource type 6832 Type *string `json:"type,omitempty"` 6833} 6834 6835// MarshalJSON is the custom marshaler for RegulatoryComplianceStandard. 6836func (rcs RegulatoryComplianceStandard) MarshalJSON() ([]byte, error) { 6837 objectMap := make(map[string]interface{}) 6838 if rcs.RegulatoryComplianceStandardProperties != nil { 6839 objectMap["properties"] = rcs.RegulatoryComplianceStandardProperties 6840 } 6841 return json.Marshal(objectMap) 6842} 6843 6844// UnmarshalJSON is the custom unmarshaler for RegulatoryComplianceStandard struct. 6845func (rcs *RegulatoryComplianceStandard) UnmarshalJSON(body []byte) error { 6846 var m map[string]*json.RawMessage 6847 err := json.Unmarshal(body, &m) 6848 if err != nil { 6849 return err 6850 } 6851 for k, v := range m { 6852 switch k { 6853 case "properties": 6854 if v != nil { 6855 var regulatoryComplianceStandardProperties RegulatoryComplianceStandardProperties 6856 err = json.Unmarshal(*v, ®ulatoryComplianceStandardProperties) 6857 if err != nil { 6858 return err 6859 } 6860 rcs.RegulatoryComplianceStandardProperties = ®ulatoryComplianceStandardProperties 6861 } 6862 case "id": 6863 if v != nil { 6864 var ID string 6865 err = json.Unmarshal(*v, &ID) 6866 if err != nil { 6867 return err 6868 } 6869 rcs.ID = &ID 6870 } 6871 case "name": 6872 if v != nil { 6873 var name string 6874 err = json.Unmarshal(*v, &name) 6875 if err != nil { 6876 return err 6877 } 6878 rcs.Name = &name 6879 } 6880 case "type": 6881 if v != nil { 6882 var typeVar string 6883 err = json.Unmarshal(*v, &typeVar) 6884 if err != nil { 6885 return err 6886 } 6887 rcs.Type = &typeVar 6888 } 6889 } 6890 } 6891 6892 return nil 6893} 6894 6895// RegulatoryComplianceStandardList list of regulatory compliance standards response 6896type RegulatoryComplianceStandardList struct { 6897 autorest.Response `json:"-"` 6898 Value *[]RegulatoryComplianceStandard `json:"value,omitempty"` 6899 // NextLink - READ-ONLY; The URI to fetch the next page. 6900 NextLink *string `json:"nextLink,omitempty"` 6901} 6902 6903// RegulatoryComplianceStandardListIterator provides access to a complete listing of 6904// RegulatoryComplianceStandard values. 6905type RegulatoryComplianceStandardListIterator struct { 6906 i int 6907 page RegulatoryComplianceStandardListPage 6908} 6909 6910// NextWithContext advances to the next value. If there was an error making 6911// the request the iterator does not advance and the error is returned. 6912func (iter *RegulatoryComplianceStandardListIterator) NextWithContext(ctx context.Context) (err error) { 6913 if tracing.IsEnabled() { 6914 ctx = tracing.StartSpan(ctx, fqdn+"/RegulatoryComplianceStandardListIterator.NextWithContext") 6915 defer func() { 6916 sc := -1 6917 if iter.Response().Response.Response != nil { 6918 sc = iter.Response().Response.Response.StatusCode 6919 } 6920 tracing.EndSpan(ctx, sc, err) 6921 }() 6922 } 6923 iter.i++ 6924 if iter.i < len(iter.page.Values()) { 6925 return nil 6926 } 6927 err = iter.page.NextWithContext(ctx) 6928 if err != nil { 6929 iter.i-- 6930 return err 6931 } 6932 iter.i = 0 6933 return nil 6934} 6935 6936// Next advances to the next value. If there was an error making 6937// the request the iterator does not advance and the error is returned. 6938// Deprecated: Use NextWithContext() instead. 6939func (iter *RegulatoryComplianceStandardListIterator) Next() error { 6940 return iter.NextWithContext(context.Background()) 6941} 6942 6943// NotDone returns true if the enumeration should be started or is not yet complete. 6944func (iter RegulatoryComplianceStandardListIterator) NotDone() bool { 6945 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 6946} 6947 6948// Response returns the raw server response from the last page request. 6949func (iter RegulatoryComplianceStandardListIterator) Response() RegulatoryComplianceStandardList { 6950 return iter.page.Response() 6951} 6952 6953// Value returns the current value or a zero-initialized value if the 6954// iterator has advanced beyond the end of the collection. 6955func (iter RegulatoryComplianceStandardListIterator) Value() RegulatoryComplianceStandard { 6956 if !iter.page.NotDone() { 6957 return RegulatoryComplianceStandard{} 6958 } 6959 return iter.page.Values()[iter.i] 6960} 6961 6962// Creates a new instance of the RegulatoryComplianceStandardListIterator type. 6963func NewRegulatoryComplianceStandardListIterator(page RegulatoryComplianceStandardListPage) RegulatoryComplianceStandardListIterator { 6964 return RegulatoryComplianceStandardListIterator{page: page} 6965} 6966 6967// IsEmpty returns true if the ListResult contains no values. 6968func (rcsl RegulatoryComplianceStandardList) IsEmpty() bool { 6969 return rcsl.Value == nil || len(*rcsl.Value) == 0 6970} 6971 6972// regulatoryComplianceStandardListPreparer prepares a request to retrieve the next set of results. 6973// It returns nil if no more results exist. 6974func (rcsl RegulatoryComplianceStandardList) regulatoryComplianceStandardListPreparer(ctx context.Context) (*http.Request, error) { 6975 if rcsl.NextLink == nil || len(to.String(rcsl.NextLink)) < 1 { 6976 return nil, nil 6977 } 6978 return autorest.Prepare((&http.Request{}).WithContext(ctx), 6979 autorest.AsJSON(), 6980 autorest.AsGet(), 6981 autorest.WithBaseURL(to.String(rcsl.NextLink))) 6982} 6983 6984// RegulatoryComplianceStandardListPage contains a page of RegulatoryComplianceStandard values. 6985type RegulatoryComplianceStandardListPage struct { 6986 fn func(context.Context, RegulatoryComplianceStandardList) (RegulatoryComplianceStandardList, error) 6987 rcsl RegulatoryComplianceStandardList 6988} 6989 6990// NextWithContext advances to the next page of values. If there was an error making 6991// the request the page does not advance and the error is returned. 6992func (page *RegulatoryComplianceStandardListPage) NextWithContext(ctx context.Context) (err error) { 6993 if tracing.IsEnabled() { 6994 ctx = tracing.StartSpan(ctx, fqdn+"/RegulatoryComplianceStandardListPage.NextWithContext") 6995 defer func() { 6996 sc := -1 6997 if page.Response().Response.Response != nil { 6998 sc = page.Response().Response.Response.StatusCode 6999 } 7000 tracing.EndSpan(ctx, sc, err) 7001 }() 7002 } 7003 next, err := page.fn(ctx, page.rcsl) 7004 if err != nil { 7005 return err 7006 } 7007 page.rcsl = next 7008 return nil 7009} 7010 7011// Next advances to the next page of values. If there was an error making 7012// the request the page does not advance and the error is returned. 7013// Deprecated: Use NextWithContext() instead. 7014func (page *RegulatoryComplianceStandardListPage) Next() error { 7015 return page.NextWithContext(context.Background()) 7016} 7017 7018// NotDone returns true if the page enumeration should be started or is not yet complete. 7019func (page RegulatoryComplianceStandardListPage) NotDone() bool { 7020 return !page.rcsl.IsEmpty() 7021} 7022 7023// Response returns the raw server response from the last page request. 7024func (page RegulatoryComplianceStandardListPage) Response() RegulatoryComplianceStandardList { 7025 return page.rcsl 7026} 7027 7028// Values returns the slice of values for the current page or nil if there are no values. 7029func (page RegulatoryComplianceStandardListPage) Values() []RegulatoryComplianceStandard { 7030 if page.rcsl.IsEmpty() { 7031 return nil 7032 } 7033 return *page.rcsl.Value 7034} 7035 7036// Creates a new instance of the RegulatoryComplianceStandardListPage type. 7037func NewRegulatoryComplianceStandardListPage(getNextPage func(context.Context, RegulatoryComplianceStandardList) (RegulatoryComplianceStandardList, error)) RegulatoryComplianceStandardListPage { 7038 return RegulatoryComplianceStandardListPage{fn: getNextPage} 7039} 7040 7041// RegulatoryComplianceStandardProperties regulatory compliance standard data 7042type RegulatoryComplianceStandardProperties struct { 7043 // State - Aggregative state based on the standard's supported controls states. Possible values include: 'StatePassed', 'StateFailed', 'StateSkipped', 'StateUnsupported' 7044 State State `json:"state,omitempty"` 7045 // PassedControls - READ-ONLY; The number of supported regulatory compliance controls of the given standard with a passed state 7046 PassedControls *int32 `json:"passedControls,omitempty"` 7047 // FailedControls - READ-ONLY; The number of supported regulatory compliance controls of the given standard with a failed state 7048 FailedControls *int32 `json:"failedControls,omitempty"` 7049 // SkippedControls - READ-ONLY; The number of supported regulatory compliance controls of the given standard with a skipped state 7050 SkippedControls *int32 `json:"skippedControls,omitempty"` 7051 // UnsupportedControls - READ-ONLY; The number of regulatory compliance controls of the given standard which are unsupported by automated assessments 7052 UnsupportedControls *int32 `json:"unsupportedControls,omitempty"` 7053} 7054 7055// Resource describes an Azure resource. 7056type Resource struct { 7057 // ID - READ-ONLY; Resource Id 7058 ID *string `json:"id,omitempty"` 7059 // Name - READ-ONLY; Resource name 7060 Name *string `json:"name,omitempty"` 7061 // Type - READ-ONLY; Resource type 7062 Type *string `json:"type,omitempty"` 7063} 7064 7065// BasicResourceDetails details of the resource that was assessed 7066type BasicResourceDetails interface { 7067 AsAzureResourceDetails() (*AzureResourceDetails, bool) 7068 AsAwsResourceDetails() (*AwsResourceDetails, bool) 7069 AsResourceDetails() (*ResourceDetails, bool) 7070} 7071 7072// ResourceDetails details of the resource that was assessed 7073type ResourceDetails struct { 7074 // Source - Possible values include: 'SourceResourceDetails', 'SourceAzure', 'SourceAws' 7075 Source Source `json:"source,omitempty"` 7076} 7077 7078func unmarshalBasicResourceDetails(body []byte) (BasicResourceDetails, error) { 7079 var m map[string]interface{} 7080 err := json.Unmarshal(body, &m) 7081 if err != nil { 7082 return nil, err 7083 } 7084 7085 switch m["source"] { 7086 case string(SourceAzure): 7087 var ard AzureResourceDetails 7088 err := json.Unmarshal(body, &ard) 7089 return ard, err 7090 case string(SourceAws): 7091 var ard AwsResourceDetails 7092 err := json.Unmarshal(body, &ard) 7093 return ard, err 7094 default: 7095 var rd ResourceDetails 7096 err := json.Unmarshal(body, &rd) 7097 return rd, err 7098 } 7099} 7100func unmarshalBasicResourceDetailsArray(body []byte) ([]BasicResourceDetails, error) { 7101 var rawMessages []*json.RawMessage 7102 err := json.Unmarshal(body, &rawMessages) 7103 if err != nil { 7104 return nil, err 7105 } 7106 7107 rdArray := make([]BasicResourceDetails, len(rawMessages)) 7108 7109 for index, rawMessage := range rawMessages { 7110 rd, err := unmarshalBasicResourceDetails(*rawMessage) 7111 if err != nil { 7112 return nil, err 7113 } 7114 rdArray[index] = rd 7115 } 7116 return rdArray, nil 7117} 7118 7119// MarshalJSON is the custom marshaler for ResourceDetails. 7120func (rd ResourceDetails) MarshalJSON() ([]byte, error) { 7121 rd.Source = SourceResourceDetails 7122 objectMap := make(map[string]interface{}) 7123 if rd.Source != "" { 7124 objectMap["source"] = rd.Source 7125 } 7126 return json.Marshal(objectMap) 7127} 7128 7129// AsAzureResourceDetails is the BasicResourceDetails implementation for ResourceDetails. 7130func (rd ResourceDetails) AsAzureResourceDetails() (*AzureResourceDetails, bool) { 7131 return nil, false 7132} 7133 7134// AsAwsResourceDetails is the BasicResourceDetails implementation for ResourceDetails. 7135func (rd ResourceDetails) AsAwsResourceDetails() (*AwsResourceDetails, bool) { 7136 return nil, false 7137} 7138 7139// AsResourceDetails is the BasicResourceDetails implementation for ResourceDetails. 7140func (rd ResourceDetails) AsResourceDetails() (*ResourceDetails, bool) { 7141 return &rd, true 7142} 7143 7144// AsBasicResourceDetails is the BasicResourceDetails implementation for ResourceDetails. 7145func (rd ResourceDetails) AsBasicResourceDetails() (BasicResourceDetails, bool) { 7146 return &rd, true 7147} 7148 7149// Rule describes remote addresses that is recommended to communicate with the Azure resource on some 7150// (Protocol, Port, Direction). All other remote addresses are recommended to be blocked 7151type Rule struct { 7152 // Name - The name of the rule 7153 Name *string `json:"name,omitempty"` 7154 // Direction - The rule's direction. Possible values include: 'Inbound', 'Outbound' 7155 Direction Direction `json:"direction,omitempty"` 7156 // DestinationPort - The rule's destination port 7157 DestinationPort *int32 `json:"destinationPort,omitempty"` 7158 // Protocols - The rule's transport protocols 7159 Protocols *[]TransportProtocol `json:"protocols,omitempty"` 7160 // IPAddresses - The remote IP addresses that should be able to communicate with the Azure resource on the rule's destination port and protocol 7161 IPAddresses *[]string `json:"ipAddresses,omitempty"` 7162} 7163 7164// SensitivityLabel the sensitivity label. 7165type SensitivityLabel struct { 7166 // DisplayName - The name of the sensitivity label. 7167 DisplayName *string `json:"displayName,omitempty"` 7168 // Order - The order of the sensitivity label. 7169 Order *float64 `json:"order,omitempty"` 7170 // Enabled - Indicates whether the label is enabled or not. 7171 Enabled *bool `json:"enabled,omitempty"` 7172} 7173 7174// ServerVulnerabilityProperties additional context fields for server vulnerability assessment 7175type ServerVulnerabilityProperties struct { 7176 // Type - READ-ONLY; Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered 7177 Type *string `json:"type,omitempty"` 7178 // Cvss - READ-ONLY; Dictionary from cvss version to cvss details object 7179 Cvss map[string]*CVSS `json:"cvss"` 7180 // Patchable - READ-ONLY; Indicates whether a patch is available or not 7181 Patchable *bool `json:"patchable,omitempty"` 7182 // Cve - READ-ONLY; List of CVEs 7183 Cve *[]CVE `json:"cve,omitempty"` 7184 // Threat - READ-ONLY; Threat name 7185 Threat *string `json:"threat,omitempty"` 7186 // PublishedTime - READ-ONLY; Published time 7187 PublishedTime *date.Time `json:"publishedTime,omitempty"` 7188 // VendorReferences - READ-ONLY 7189 VendorReferences *[]VendorReference `json:"vendorReferences,omitempty"` 7190 // AssessedResourceType - Possible values include: 'AssessedResourceTypeAdditionalData', 'AssessedResourceTypeSQLServerVulnerability', 'AssessedResourceTypeContainerRegistryVulnerability', 'AssessedResourceTypeServerVulnerabilityAssessment' 7191 AssessedResourceType AssessedResourceType `json:"assessedResourceType,omitempty"` 7192} 7193 7194// MarshalJSON is the custom marshaler for ServerVulnerabilityProperties. 7195func (svp ServerVulnerabilityProperties) MarshalJSON() ([]byte, error) { 7196 svp.AssessedResourceType = AssessedResourceTypeServerVulnerabilityAssessment 7197 objectMap := make(map[string]interface{}) 7198 if svp.AssessedResourceType != "" { 7199 objectMap["assessedResourceType"] = svp.AssessedResourceType 7200 } 7201 return json.Marshal(objectMap) 7202} 7203 7204// AsSQLServerVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. 7205func (svp ServerVulnerabilityProperties) AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) { 7206 return nil, false 7207} 7208 7209// AsContainerRegistryVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. 7210func (svp ServerVulnerabilityProperties) AsContainerRegistryVulnerabilityProperties() (*ContainerRegistryVulnerabilityProperties, bool) { 7211 return nil, false 7212} 7213 7214// AsServerVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. 7215func (svp ServerVulnerabilityProperties) AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) { 7216 return &svp, true 7217} 7218 7219// AsAdditionalData is the BasicAdditionalData implementation for ServerVulnerabilityProperties. 7220func (svp ServerVulnerabilityProperties) AsAdditionalData() (*AdditionalData, bool) { 7221 return nil, false 7222} 7223 7224// AsBasicAdditionalData is the BasicAdditionalData implementation for ServerVulnerabilityProperties. 7225func (svp ServerVulnerabilityProperties) AsBasicAdditionalData() (BasicAdditionalData, bool) { 7226 return &svp, true 7227} 7228 7229// Setting represents a security setting in Azure Security Center. 7230type Setting struct { 7231 autorest.Response `json:"-"` 7232 // Kind - the kind of the settings string (DataExportSetting). Possible values include: 'SettingKindDataExportSetting', 'SettingKindAlertSuppressionSetting' 7233 Kind SettingKind `json:"kind,omitempty"` 7234 // ID - READ-ONLY; Resource Id 7235 ID *string `json:"id,omitempty"` 7236 // Name - READ-ONLY; Resource name 7237 Name *string `json:"name,omitempty"` 7238 // Type - READ-ONLY; Resource type 7239 Type *string `json:"type,omitempty"` 7240} 7241 7242// SettingResource the kind of the security setting 7243type SettingResource struct { 7244 // Kind - the kind of the settings string (DataExportSetting). Possible values include: 'SettingKindDataExportSetting', 'SettingKindAlertSuppressionSetting' 7245 Kind SettingKind `json:"kind,omitempty"` 7246 // ID - READ-ONLY; Resource Id 7247 ID *string `json:"id,omitempty"` 7248 // Name - READ-ONLY; Resource name 7249 Name *string `json:"name,omitempty"` 7250 // Type - READ-ONLY; Resource type 7251 Type *string `json:"type,omitempty"` 7252} 7253 7254// SettingsList subscription settings list. 7255type SettingsList struct { 7256 autorest.Response `json:"-"` 7257 // Value - The settings list. 7258 Value *[]Setting `json:"value,omitempty"` 7259 // NextLink - READ-ONLY; The URI to fetch the next page. 7260 NextLink *string `json:"nextLink,omitempty"` 7261} 7262 7263// SettingsListIterator provides access to a complete listing of Setting values. 7264type SettingsListIterator struct { 7265 i int 7266 page SettingsListPage 7267} 7268 7269// NextWithContext advances to the next value. If there was an error making 7270// the request the iterator does not advance and the error is returned. 7271func (iter *SettingsListIterator) NextWithContext(ctx context.Context) (err error) { 7272 if tracing.IsEnabled() { 7273 ctx = tracing.StartSpan(ctx, fqdn+"/SettingsListIterator.NextWithContext") 7274 defer func() { 7275 sc := -1 7276 if iter.Response().Response.Response != nil { 7277 sc = iter.Response().Response.Response.StatusCode 7278 } 7279 tracing.EndSpan(ctx, sc, err) 7280 }() 7281 } 7282 iter.i++ 7283 if iter.i < len(iter.page.Values()) { 7284 return nil 7285 } 7286 err = iter.page.NextWithContext(ctx) 7287 if err != nil { 7288 iter.i-- 7289 return err 7290 } 7291 iter.i = 0 7292 return nil 7293} 7294 7295// Next advances to the next value. If there was an error making 7296// the request the iterator does not advance and the error is returned. 7297// Deprecated: Use NextWithContext() instead. 7298func (iter *SettingsListIterator) Next() error { 7299 return iter.NextWithContext(context.Background()) 7300} 7301 7302// NotDone returns true if the enumeration should be started or is not yet complete. 7303func (iter SettingsListIterator) NotDone() bool { 7304 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7305} 7306 7307// Response returns the raw server response from the last page request. 7308func (iter SettingsListIterator) Response() SettingsList { 7309 return iter.page.Response() 7310} 7311 7312// Value returns the current value or a zero-initialized value if the 7313// iterator has advanced beyond the end of the collection. 7314func (iter SettingsListIterator) Value() Setting { 7315 if !iter.page.NotDone() { 7316 return Setting{} 7317 } 7318 return iter.page.Values()[iter.i] 7319} 7320 7321// Creates a new instance of the SettingsListIterator type. 7322func NewSettingsListIterator(page SettingsListPage) SettingsListIterator { 7323 return SettingsListIterator{page: page} 7324} 7325 7326// IsEmpty returns true if the ListResult contains no values. 7327func (sl SettingsList) IsEmpty() bool { 7328 return sl.Value == nil || len(*sl.Value) == 0 7329} 7330 7331// settingsListPreparer prepares a request to retrieve the next set of results. 7332// It returns nil if no more results exist. 7333func (sl SettingsList) settingsListPreparer(ctx context.Context) (*http.Request, error) { 7334 if sl.NextLink == nil || len(to.String(sl.NextLink)) < 1 { 7335 return nil, nil 7336 } 7337 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7338 autorest.AsJSON(), 7339 autorest.AsGet(), 7340 autorest.WithBaseURL(to.String(sl.NextLink))) 7341} 7342 7343// SettingsListPage contains a page of Setting values. 7344type SettingsListPage struct { 7345 fn func(context.Context, SettingsList) (SettingsList, error) 7346 sl SettingsList 7347} 7348 7349// NextWithContext advances to the next page of values. If there was an error making 7350// the request the page does not advance and the error is returned. 7351func (page *SettingsListPage) NextWithContext(ctx context.Context) (err error) { 7352 if tracing.IsEnabled() { 7353 ctx = tracing.StartSpan(ctx, fqdn+"/SettingsListPage.NextWithContext") 7354 defer func() { 7355 sc := -1 7356 if page.Response().Response.Response != nil { 7357 sc = page.Response().Response.Response.StatusCode 7358 } 7359 tracing.EndSpan(ctx, sc, err) 7360 }() 7361 } 7362 next, err := page.fn(ctx, page.sl) 7363 if err != nil { 7364 return err 7365 } 7366 page.sl = next 7367 return nil 7368} 7369 7370// Next advances to the next page of values. If there was an error making 7371// the request the page does not advance and the error is returned. 7372// Deprecated: Use NextWithContext() instead. 7373func (page *SettingsListPage) Next() error { 7374 return page.NextWithContext(context.Background()) 7375} 7376 7377// NotDone returns true if the page enumeration should be started or is not yet complete. 7378func (page SettingsListPage) NotDone() bool { 7379 return !page.sl.IsEmpty() 7380} 7381 7382// Response returns the raw server response from the last page request. 7383func (page SettingsListPage) Response() SettingsList { 7384 return page.sl 7385} 7386 7387// Values returns the slice of values for the current page or nil if there are no values. 7388func (page SettingsListPage) Values() []Setting { 7389 if page.sl.IsEmpty() { 7390 return nil 7391 } 7392 return *page.sl.Value 7393} 7394 7395// Creates a new instance of the SettingsListPage type. 7396func NewSettingsListPage(getNextPage func(context.Context, SettingsList) (SettingsList, error)) SettingsListPage { 7397 return SettingsListPage{fn: getNextPage} 7398} 7399 7400// SQLServerVulnerabilityProperties details of the resource that was assessed 7401type SQLServerVulnerabilityProperties struct { 7402 // Type - READ-ONLY; The resource type the sub assessment refers to in its resource details 7403 Type *string `json:"type,omitempty"` 7404 // Query - READ-ONLY; The T-SQL query that runs on your SQL database to perform the particular check 7405 Query *string `json:"query,omitempty"` 7406 // AssessedResourceType - Possible values include: 'AssessedResourceTypeAdditionalData', 'AssessedResourceTypeSQLServerVulnerability', 'AssessedResourceTypeContainerRegistryVulnerability', 'AssessedResourceTypeServerVulnerabilityAssessment' 7407 AssessedResourceType AssessedResourceType `json:"assessedResourceType,omitempty"` 7408} 7409 7410// MarshalJSON is the custom marshaler for SQLServerVulnerabilityProperties. 7411func (ssvp SQLServerVulnerabilityProperties) MarshalJSON() ([]byte, error) { 7412 ssvp.AssessedResourceType = AssessedResourceTypeSQLServerVulnerability 7413 objectMap := make(map[string]interface{}) 7414 if ssvp.AssessedResourceType != "" { 7415 objectMap["assessedResourceType"] = ssvp.AssessedResourceType 7416 } 7417 return json.Marshal(objectMap) 7418} 7419 7420// AsSQLServerVulnerabilityProperties is the BasicAdditionalData implementation for SQLServerVulnerabilityProperties. 7421func (ssvp SQLServerVulnerabilityProperties) AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) { 7422 return &ssvp, true 7423} 7424 7425// AsContainerRegistryVulnerabilityProperties is the BasicAdditionalData implementation for SQLServerVulnerabilityProperties. 7426func (ssvp SQLServerVulnerabilityProperties) AsContainerRegistryVulnerabilityProperties() (*ContainerRegistryVulnerabilityProperties, bool) { 7427 return nil, false 7428} 7429 7430// AsServerVulnerabilityProperties is the BasicAdditionalData implementation for SQLServerVulnerabilityProperties. 7431func (ssvp SQLServerVulnerabilityProperties) AsServerVulnerabilityProperties() (*ServerVulnerabilityProperties, bool) { 7432 return nil, false 7433} 7434 7435// AsAdditionalData is the BasicAdditionalData implementation for SQLServerVulnerabilityProperties. 7436func (ssvp SQLServerVulnerabilityProperties) AsAdditionalData() (*AdditionalData, bool) { 7437 return nil, false 7438} 7439 7440// AsBasicAdditionalData is the BasicAdditionalData implementation for SQLServerVulnerabilityProperties. 7441func (ssvp SQLServerVulnerabilityProperties) AsBasicAdditionalData() (BasicAdditionalData, bool) { 7442 return &ssvp, true 7443} 7444 7445// SubAssessment security sub-assessment on a resource 7446type SubAssessment struct { 7447 autorest.Response `json:"-"` 7448 *SubAssessmentProperties `json:"properties,omitempty"` 7449 // ID - READ-ONLY; Resource Id 7450 ID *string `json:"id,omitempty"` 7451 // Name - READ-ONLY; Resource name 7452 Name *string `json:"name,omitempty"` 7453 // Type - READ-ONLY; Resource type 7454 Type *string `json:"type,omitempty"` 7455} 7456 7457// MarshalJSON is the custom marshaler for SubAssessment. 7458func (sa SubAssessment) MarshalJSON() ([]byte, error) { 7459 objectMap := make(map[string]interface{}) 7460 if sa.SubAssessmentProperties != nil { 7461 objectMap["properties"] = sa.SubAssessmentProperties 7462 } 7463 return json.Marshal(objectMap) 7464} 7465 7466// UnmarshalJSON is the custom unmarshaler for SubAssessment struct. 7467func (sa *SubAssessment) UnmarshalJSON(body []byte) error { 7468 var m map[string]*json.RawMessage 7469 err := json.Unmarshal(body, &m) 7470 if err != nil { 7471 return err 7472 } 7473 for k, v := range m { 7474 switch k { 7475 case "properties": 7476 if v != nil { 7477 var subAssessmentProperties SubAssessmentProperties 7478 err = json.Unmarshal(*v, &subAssessmentProperties) 7479 if err != nil { 7480 return err 7481 } 7482 sa.SubAssessmentProperties = &subAssessmentProperties 7483 } 7484 case "id": 7485 if v != nil { 7486 var ID string 7487 err = json.Unmarshal(*v, &ID) 7488 if err != nil { 7489 return err 7490 } 7491 sa.ID = &ID 7492 } 7493 case "name": 7494 if v != nil { 7495 var name string 7496 err = json.Unmarshal(*v, &name) 7497 if err != nil { 7498 return err 7499 } 7500 sa.Name = &name 7501 } 7502 case "type": 7503 if v != nil { 7504 var typeVar string 7505 err = json.Unmarshal(*v, &typeVar) 7506 if err != nil { 7507 return err 7508 } 7509 sa.Type = &typeVar 7510 } 7511 } 7512 } 7513 7514 return nil 7515} 7516 7517// SubAssessmentList list of security sub-assessments 7518type SubAssessmentList struct { 7519 autorest.Response `json:"-"` 7520 // Value - READ-ONLY 7521 Value *[]SubAssessment `json:"value,omitempty"` 7522 // NextLink - READ-ONLY; The URI to fetch the next page. 7523 NextLink *string `json:"nextLink,omitempty"` 7524} 7525 7526// SubAssessmentListIterator provides access to a complete listing of SubAssessment values. 7527type SubAssessmentListIterator struct { 7528 i int 7529 page SubAssessmentListPage 7530} 7531 7532// NextWithContext advances to the next value. If there was an error making 7533// the request the iterator does not advance and the error is returned. 7534func (iter *SubAssessmentListIterator) NextWithContext(ctx context.Context) (err error) { 7535 if tracing.IsEnabled() { 7536 ctx = tracing.StartSpan(ctx, fqdn+"/SubAssessmentListIterator.NextWithContext") 7537 defer func() { 7538 sc := -1 7539 if iter.Response().Response.Response != nil { 7540 sc = iter.Response().Response.Response.StatusCode 7541 } 7542 tracing.EndSpan(ctx, sc, err) 7543 }() 7544 } 7545 iter.i++ 7546 if iter.i < len(iter.page.Values()) { 7547 return nil 7548 } 7549 err = iter.page.NextWithContext(ctx) 7550 if err != nil { 7551 iter.i-- 7552 return err 7553 } 7554 iter.i = 0 7555 return nil 7556} 7557 7558// Next advances to the next value. If there was an error making 7559// the request the iterator does not advance and the error is returned. 7560// Deprecated: Use NextWithContext() instead. 7561func (iter *SubAssessmentListIterator) Next() error { 7562 return iter.NextWithContext(context.Background()) 7563} 7564 7565// NotDone returns true if the enumeration should be started or is not yet complete. 7566func (iter SubAssessmentListIterator) NotDone() bool { 7567 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7568} 7569 7570// Response returns the raw server response from the last page request. 7571func (iter SubAssessmentListIterator) Response() SubAssessmentList { 7572 return iter.page.Response() 7573} 7574 7575// Value returns the current value or a zero-initialized value if the 7576// iterator has advanced beyond the end of the collection. 7577func (iter SubAssessmentListIterator) Value() SubAssessment { 7578 if !iter.page.NotDone() { 7579 return SubAssessment{} 7580 } 7581 return iter.page.Values()[iter.i] 7582} 7583 7584// Creates a new instance of the SubAssessmentListIterator type. 7585func NewSubAssessmentListIterator(page SubAssessmentListPage) SubAssessmentListIterator { 7586 return SubAssessmentListIterator{page: page} 7587} 7588 7589// IsEmpty returns true if the ListResult contains no values. 7590func (sal SubAssessmentList) IsEmpty() bool { 7591 return sal.Value == nil || len(*sal.Value) == 0 7592} 7593 7594// subAssessmentListPreparer prepares a request to retrieve the next set of results. 7595// It returns nil if no more results exist. 7596func (sal SubAssessmentList) subAssessmentListPreparer(ctx context.Context) (*http.Request, error) { 7597 if sal.NextLink == nil || len(to.String(sal.NextLink)) < 1 { 7598 return nil, nil 7599 } 7600 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7601 autorest.AsJSON(), 7602 autorest.AsGet(), 7603 autorest.WithBaseURL(to.String(sal.NextLink))) 7604} 7605 7606// SubAssessmentListPage contains a page of SubAssessment values. 7607type SubAssessmentListPage struct { 7608 fn func(context.Context, SubAssessmentList) (SubAssessmentList, error) 7609 sal SubAssessmentList 7610} 7611 7612// NextWithContext advances to the next page of values. If there was an error making 7613// the request the page does not advance and the error is returned. 7614func (page *SubAssessmentListPage) NextWithContext(ctx context.Context) (err error) { 7615 if tracing.IsEnabled() { 7616 ctx = tracing.StartSpan(ctx, fqdn+"/SubAssessmentListPage.NextWithContext") 7617 defer func() { 7618 sc := -1 7619 if page.Response().Response.Response != nil { 7620 sc = page.Response().Response.Response.StatusCode 7621 } 7622 tracing.EndSpan(ctx, sc, err) 7623 }() 7624 } 7625 next, err := page.fn(ctx, page.sal) 7626 if err != nil { 7627 return err 7628 } 7629 page.sal = next 7630 return nil 7631} 7632 7633// Next advances to the next page of values. If there was an error making 7634// the request the page does not advance and the error is returned. 7635// Deprecated: Use NextWithContext() instead. 7636func (page *SubAssessmentListPage) Next() error { 7637 return page.NextWithContext(context.Background()) 7638} 7639 7640// NotDone returns true if the page enumeration should be started or is not yet complete. 7641func (page SubAssessmentListPage) NotDone() bool { 7642 return !page.sal.IsEmpty() 7643} 7644 7645// Response returns the raw server response from the last page request. 7646func (page SubAssessmentListPage) Response() SubAssessmentList { 7647 return page.sal 7648} 7649 7650// Values returns the slice of values for the current page or nil if there are no values. 7651func (page SubAssessmentListPage) Values() []SubAssessment { 7652 if page.sal.IsEmpty() { 7653 return nil 7654 } 7655 return *page.sal.Value 7656} 7657 7658// Creates a new instance of the SubAssessmentListPage type. 7659func NewSubAssessmentListPage(getNextPage func(context.Context, SubAssessmentList) (SubAssessmentList, error)) SubAssessmentListPage { 7660 return SubAssessmentListPage{fn: getNextPage} 7661} 7662 7663// SubAssessmentProperties describes properties of an sub-assessment. 7664type SubAssessmentProperties struct { 7665 // ID - READ-ONLY; Vulnerability ID 7666 ID *string `json:"id,omitempty"` 7667 // DisplayName - READ-ONLY; User friendly display name of the sub-assessment 7668 DisplayName *string `json:"displayName,omitempty"` 7669 Status *SubAssessmentStatus `json:"status,omitempty"` 7670 // Remediation - READ-ONLY; Information on how to remediate this sub-assessment 7671 Remediation *string `json:"remediation,omitempty"` 7672 // Impact - READ-ONLY; Description of the impact of this sub-assessment 7673 Impact *string `json:"impact,omitempty"` 7674 // Category - READ-ONLY; Category of the sub-assessment 7675 Category *string `json:"category,omitempty"` 7676 // Description - READ-ONLY; Human readable description of the assessment status 7677 Description *string `json:"description,omitempty"` 7678 // TimeGenerated - READ-ONLY; The date and time the sub-assessment was generated 7679 TimeGenerated *date.Time `json:"timeGenerated,omitempty"` 7680 ResourceDetails BasicResourceDetails `json:"resourceDetails,omitempty"` 7681 AdditionalData BasicAdditionalData `json:"additionalData,omitempty"` 7682} 7683 7684// UnmarshalJSON is the custom unmarshaler for SubAssessmentProperties struct. 7685func (sap *SubAssessmentProperties) UnmarshalJSON(body []byte) error { 7686 var m map[string]*json.RawMessage 7687 err := json.Unmarshal(body, &m) 7688 if err != nil { 7689 return err 7690 } 7691 for k, v := range m { 7692 switch k { 7693 case "id": 7694 if v != nil { 7695 var ID string 7696 err = json.Unmarshal(*v, &ID) 7697 if err != nil { 7698 return err 7699 } 7700 sap.ID = &ID 7701 } 7702 case "displayName": 7703 if v != nil { 7704 var displayName string 7705 err = json.Unmarshal(*v, &displayName) 7706 if err != nil { 7707 return err 7708 } 7709 sap.DisplayName = &displayName 7710 } 7711 case "status": 7712 if v != nil { 7713 var status SubAssessmentStatus 7714 err = json.Unmarshal(*v, &status) 7715 if err != nil { 7716 return err 7717 } 7718 sap.Status = &status 7719 } 7720 case "remediation": 7721 if v != nil { 7722 var remediation string 7723 err = json.Unmarshal(*v, &remediation) 7724 if err != nil { 7725 return err 7726 } 7727 sap.Remediation = &remediation 7728 } 7729 case "impact": 7730 if v != nil { 7731 var impact string 7732 err = json.Unmarshal(*v, &impact) 7733 if err != nil { 7734 return err 7735 } 7736 sap.Impact = &impact 7737 } 7738 case "category": 7739 if v != nil { 7740 var category string 7741 err = json.Unmarshal(*v, &category) 7742 if err != nil { 7743 return err 7744 } 7745 sap.Category = &category 7746 } 7747 case "description": 7748 if v != nil { 7749 var description string 7750 err = json.Unmarshal(*v, &description) 7751 if err != nil { 7752 return err 7753 } 7754 sap.Description = &description 7755 } 7756 case "timeGenerated": 7757 if v != nil { 7758 var timeGenerated date.Time 7759 err = json.Unmarshal(*v, &timeGenerated) 7760 if err != nil { 7761 return err 7762 } 7763 sap.TimeGenerated = &timeGenerated 7764 } 7765 case "resourceDetails": 7766 if v != nil { 7767 resourceDetails, err := unmarshalBasicResourceDetails(*v) 7768 if err != nil { 7769 return err 7770 } 7771 sap.ResourceDetails = resourceDetails 7772 } 7773 case "additionalData": 7774 if v != nil { 7775 additionalData, err := unmarshalBasicAdditionalData(*v) 7776 if err != nil { 7777 return err 7778 } 7779 sap.AdditionalData = additionalData 7780 } 7781 } 7782 } 7783 7784 return nil 7785} 7786 7787// SubAssessmentStatus status of the sub-assessment 7788type SubAssessmentStatus struct { 7789 // Code - READ-ONLY; Programmatic code for the status of the assessment. Possible values include: 'Healthy', 'Unhealthy', 'NotApplicable' 7790 Code SubAssessmentStatusCode `json:"code,omitempty"` 7791 // Cause - READ-ONLY; Programmatic code for the cause of the assessment status 7792 Cause *string `json:"cause,omitempty"` 7793 // Description - READ-ONLY; Human readable description of the assessment status 7794 Description *string `json:"description,omitempty"` 7795 // Severity - READ-ONLY; The sub-assessment severity level. Possible values include: 'SeverityLow', 'SeverityMedium', 'SeverityHigh' 7796 Severity Severity `json:"severity,omitempty"` 7797} 7798 7799// TagsResource a container holding only the Tags for a resource, allowing the user to update the tags. 7800type TagsResource struct { 7801 // Tags - Resource tags 7802 Tags map[string]*string `json:"tags"` 7803} 7804 7805// MarshalJSON is the custom marshaler for TagsResource. 7806func (tr TagsResource) MarshalJSON() ([]byte, error) { 7807 objectMap := make(map[string]interface{}) 7808 if tr.Tags != nil { 7809 objectMap["tags"] = tr.Tags 7810 } 7811 return json.Marshal(objectMap) 7812} 7813 7814// Task security task that we recommend to do in order to strengthen security 7815type Task struct { 7816 autorest.Response `json:"-"` 7817 *TaskProperties `json:"properties,omitempty"` 7818 // ID - READ-ONLY; Resource Id 7819 ID *string `json:"id,omitempty"` 7820 // Name - READ-ONLY; Resource name 7821 Name *string `json:"name,omitempty"` 7822 // Type - READ-ONLY; Resource type 7823 Type *string `json:"type,omitempty"` 7824} 7825 7826// MarshalJSON is the custom marshaler for Task. 7827func (t Task) MarshalJSON() ([]byte, error) { 7828 objectMap := make(map[string]interface{}) 7829 if t.TaskProperties != nil { 7830 objectMap["properties"] = t.TaskProperties 7831 } 7832 return json.Marshal(objectMap) 7833} 7834 7835// UnmarshalJSON is the custom unmarshaler for Task struct. 7836func (t *Task) UnmarshalJSON(body []byte) error { 7837 var m map[string]*json.RawMessage 7838 err := json.Unmarshal(body, &m) 7839 if err != nil { 7840 return err 7841 } 7842 for k, v := range m { 7843 switch k { 7844 case "properties": 7845 if v != nil { 7846 var taskProperties TaskProperties 7847 err = json.Unmarshal(*v, &taskProperties) 7848 if err != nil { 7849 return err 7850 } 7851 t.TaskProperties = &taskProperties 7852 } 7853 case "id": 7854 if v != nil { 7855 var ID string 7856 err = json.Unmarshal(*v, &ID) 7857 if err != nil { 7858 return err 7859 } 7860 t.ID = &ID 7861 } 7862 case "name": 7863 if v != nil { 7864 var name string 7865 err = json.Unmarshal(*v, &name) 7866 if err != nil { 7867 return err 7868 } 7869 t.Name = &name 7870 } 7871 case "type": 7872 if v != nil { 7873 var typeVar string 7874 err = json.Unmarshal(*v, &typeVar) 7875 if err != nil { 7876 return err 7877 } 7878 t.Type = &typeVar 7879 } 7880 } 7881 } 7882 7883 return nil 7884} 7885 7886// TaskList list of security task recommendations 7887type TaskList struct { 7888 autorest.Response `json:"-"` 7889 // Value - READ-ONLY 7890 Value *[]Task `json:"value,omitempty"` 7891 // NextLink - READ-ONLY; The URI to fetch the next page. 7892 NextLink *string `json:"nextLink,omitempty"` 7893} 7894 7895// TaskListIterator provides access to a complete listing of Task values. 7896type TaskListIterator struct { 7897 i int 7898 page TaskListPage 7899} 7900 7901// NextWithContext advances to the next value. If there was an error making 7902// the request the iterator does not advance and the error is returned. 7903func (iter *TaskListIterator) NextWithContext(ctx context.Context) (err error) { 7904 if tracing.IsEnabled() { 7905 ctx = tracing.StartSpan(ctx, fqdn+"/TaskListIterator.NextWithContext") 7906 defer func() { 7907 sc := -1 7908 if iter.Response().Response.Response != nil { 7909 sc = iter.Response().Response.Response.StatusCode 7910 } 7911 tracing.EndSpan(ctx, sc, err) 7912 }() 7913 } 7914 iter.i++ 7915 if iter.i < len(iter.page.Values()) { 7916 return nil 7917 } 7918 err = iter.page.NextWithContext(ctx) 7919 if err != nil { 7920 iter.i-- 7921 return err 7922 } 7923 iter.i = 0 7924 return nil 7925} 7926 7927// Next advances to the next value. If there was an error making 7928// the request the iterator does not advance and the error is returned. 7929// Deprecated: Use NextWithContext() instead. 7930func (iter *TaskListIterator) Next() error { 7931 return iter.NextWithContext(context.Background()) 7932} 7933 7934// NotDone returns true if the enumeration should be started or is not yet complete. 7935func (iter TaskListIterator) NotDone() bool { 7936 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 7937} 7938 7939// Response returns the raw server response from the last page request. 7940func (iter TaskListIterator) Response() TaskList { 7941 return iter.page.Response() 7942} 7943 7944// Value returns the current value or a zero-initialized value if the 7945// iterator has advanced beyond the end of the collection. 7946func (iter TaskListIterator) Value() Task { 7947 if !iter.page.NotDone() { 7948 return Task{} 7949 } 7950 return iter.page.Values()[iter.i] 7951} 7952 7953// Creates a new instance of the TaskListIterator type. 7954func NewTaskListIterator(page TaskListPage) TaskListIterator { 7955 return TaskListIterator{page: page} 7956} 7957 7958// IsEmpty returns true if the ListResult contains no values. 7959func (tl TaskList) IsEmpty() bool { 7960 return tl.Value == nil || len(*tl.Value) == 0 7961} 7962 7963// taskListPreparer prepares a request to retrieve the next set of results. 7964// It returns nil if no more results exist. 7965func (tl TaskList) taskListPreparer(ctx context.Context) (*http.Request, error) { 7966 if tl.NextLink == nil || len(to.String(tl.NextLink)) < 1 { 7967 return nil, nil 7968 } 7969 return autorest.Prepare((&http.Request{}).WithContext(ctx), 7970 autorest.AsJSON(), 7971 autorest.AsGet(), 7972 autorest.WithBaseURL(to.String(tl.NextLink))) 7973} 7974 7975// TaskListPage contains a page of Task values. 7976type TaskListPage struct { 7977 fn func(context.Context, TaskList) (TaskList, error) 7978 tl TaskList 7979} 7980 7981// NextWithContext advances to the next page of values. If there was an error making 7982// the request the page does not advance and the error is returned. 7983func (page *TaskListPage) NextWithContext(ctx context.Context) (err error) { 7984 if tracing.IsEnabled() { 7985 ctx = tracing.StartSpan(ctx, fqdn+"/TaskListPage.NextWithContext") 7986 defer func() { 7987 sc := -1 7988 if page.Response().Response.Response != nil { 7989 sc = page.Response().Response.Response.StatusCode 7990 } 7991 tracing.EndSpan(ctx, sc, err) 7992 }() 7993 } 7994 next, err := page.fn(ctx, page.tl) 7995 if err != nil { 7996 return err 7997 } 7998 page.tl = next 7999 return nil 8000} 8001 8002// Next advances to the next page of values. If there was an error making 8003// the request the page does not advance and the error is returned. 8004// Deprecated: Use NextWithContext() instead. 8005func (page *TaskListPage) Next() error { 8006 return page.NextWithContext(context.Background()) 8007} 8008 8009// NotDone returns true if the page enumeration should be started or is not yet complete. 8010func (page TaskListPage) NotDone() bool { 8011 return !page.tl.IsEmpty() 8012} 8013 8014// Response returns the raw server response from the last page request. 8015func (page TaskListPage) Response() TaskList { 8016 return page.tl 8017} 8018 8019// Values returns the slice of values for the current page or nil if there are no values. 8020func (page TaskListPage) Values() []Task { 8021 if page.tl.IsEmpty() { 8022 return nil 8023 } 8024 return *page.tl.Value 8025} 8026 8027// Creates a new instance of the TaskListPage type. 8028func NewTaskListPage(getNextPage func(context.Context, TaskList) (TaskList, error)) TaskListPage { 8029 return TaskListPage{fn: getNextPage} 8030} 8031 8032// TaskParameters changing set of properties, depending on the task type that is derived from the name 8033// field 8034type TaskParameters struct { 8035 // AdditionalProperties - Unmatched properties from the message are deserialized this collection 8036 AdditionalProperties map[string]interface{} `json:""` 8037 // Name - READ-ONLY; Name of the task type 8038 Name *string `json:"name,omitempty"` 8039} 8040 8041// MarshalJSON is the custom marshaler for TaskParameters. 8042func (tp TaskParameters) MarshalJSON() ([]byte, error) { 8043 objectMap := make(map[string]interface{}) 8044 for k, v := range tp.AdditionalProperties { 8045 objectMap[k] = v 8046 } 8047 return json.Marshal(objectMap) 8048} 8049 8050// UnmarshalJSON is the custom unmarshaler for TaskParameters struct. 8051func (tp *TaskParameters) UnmarshalJSON(body []byte) error { 8052 var m map[string]*json.RawMessage 8053 err := json.Unmarshal(body, &m) 8054 if err != nil { 8055 return err 8056 } 8057 for k, v := range m { 8058 switch k { 8059 default: 8060 if v != nil { 8061 var additionalProperties interface{} 8062 err = json.Unmarshal(*v, &additionalProperties) 8063 if err != nil { 8064 return err 8065 } 8066 if tp.AdditionalProperties == nil { 8067 tp.AdditionalProperties = make(map[string]interface{}) 8068 } 8069 tp.AdditionalProperties[k] = additionalProperties 8070 } 8071 case "name": 8072 if v != nil { 8073 var name string 8074 err = json.Unmarshal(*v, &name) 8075 if err != nil { 8076 return err 8077 } 8078 tp.Name = &name 8079 } 8080 } 8081 } 8082 8083 return nil 8084} 8085 8086// TaskProperties describes properties of a task. 8087type TaskProperties struct { 8088 // State - READ-ONLY; State of the task (Active, Resolved etc.) 8089 State *string `json:"state,omitempty"` 8090 // CreationTimeUtc - READ-ONLY; The time this task was discovered in UTC 8091 CreationTimeUtc *date.Time `json:"creationTimeUtc,omitempty"` 8092 SecurityTaskParameters *TaskParameters `json:"securityTaskParameters,omitempty"` 8093 // LastStateChangeTimeUtc - READ-ONLY; The time this task's details were last changed in UTC 8094 LastStateChangeTimeUtc *date.Time `json:"lastStateChangeTimeUtc,omitempty"` 8095 // SubState - READ-ONLY; Additional data on the state of the task 8096 SubState *string `json:"subState,omitempty"` 8097} 8098 8099// ThresholdCustomAlertRule a custom alert rule that checks if a value (depends on the custom alert type) 8100// is within the given range. 8101type ThresholdCustomAlertRule struct { 8102 // MinThreshold - The minimum threshold. 8103 MinThreshold *int32 `json:"minThreshold,omitempty"` 8104 // MaxThreshold - The maximum threshold. 8105 MaxThreshold *int32 `json:"maxThreshold,omitempty"` 8106 // DisplayName - READ-ONLY; The display name of the custom alert. 8107 DisplayName *string `json:"displayName,omitempty"` 8108 // Description - READ-ONLY; The description of the custom alert. 8109 Description *string `json:"description,omitempty"` 8110 // IsEnabled - Whether the custom alert is enabled. 8111 IsEnabled *bool `json:"isEnabled,omitempty"` 8112 // RuleType - The type of the custom alert rule. 8113 RuleType *string `json:"ruleType,omitempty"` 8114} 8115 8116// TimeWindowCustomAlertRule a custom alert rule that checks if the number of activities (depends on the 8117// custom alert type) in a time window is within the given range. 8118type TimeWindowCustomAlertRule struct { 8119 // DisplayName - READ-ONLY; The display name of the custom alert. 8120 DisplayName *string `json:"displayName,omitempty"` 8121 // Description - READ-ONLY; The description of the custom alert. 8122 Description *string `json:"description,omitempty"` 8123 // IsEnabled - Whether the custom alert is enabled. 8124 IsEnabled *bool `json:"isEnabled,omitempty"` 8125 // RuleType - The type of the custom alert rule. 8126 RuleType *string `json:"ruleType,omitempty"` 8127 // MinThreshold - The minimum threshold. 8128 MinThreshold *int32 `json:"minThreshold,omitempty"` 8129 // MaxThreshold - The maximum threshold. 8130 MaxThreshold *int32 `json:"maxThreshold,omitempty"` 8131 // TimeWindowSize - The time window size in iso8601 format. 8132 TimeWindowSize *string `json:"timeWindowSize,omitempty"` 8133} 8134 8135// TopologyList ... 8136type TopologyList struct { 8137 autorest.Response `json:"-"` 8138 // Value - READ-ONLY 8139 Value *[]TopologyResource `json:"value,omitempty"` 8140 // NextLink - READ-ONLY; The URI to fetch the next page. 8141 NextLink *string `json:"nextLink,omitempty"` 8142} 8143 8144// TopologyListIterator provides access to a complete listing of TopologyResource values. 8145type TopologyListIterator struct { 8146 i int 8147 page TopologyListPage 8148} 8149 8150// NextWithContext advances to the next value. If there was an error making 8151// the request the iterator does not advance and the error is returned. 8152func (iter *TopologyListIterator) NextWithContext(ctx context.Context) (err error) { 8153 if tracing.IsEnabled() { 8154 ctx = tracing.StartSpan(ctx, fqdn+"/TopologyListIterator.NextWithContext") 8155 defer func() { 8156 sc := -1 8157 if iter.Response().Response.Response != nil { 8158 sc = iter.Response().Response.Response.StatusCode 8159 } 8160 tracing.EndSpan(ctx, sc, err) 8161 }() 8162 } 8163 iter.i++ 8164 if iter.i < len(iter.page.Values()) { 8165 return nil 8166 } 8167 err = iter.page.NextWithContext(ctx) 8168 if err != nil { 8169 iter.i-- 8170 return err 8171 } 8172 iter.i = 0 8173 return nil 8174} 8175 8176// Next advances to the next value. If there was an error making 8177// the request the iterator does not advance and the error is returned. 8178// Deprecated: Use NextWithContext() instead. 8179func (iter *TopologyListIterator) Next() error { 8180 return iter.NextWithContext(context.Background()) 8181} 8182 8183// NotDone returns true if the enumeration should be started or is not yet complete. 8184func (iter TopologyListIterator) NotDone() bool { 8185 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8186} 8187 8188// Response returns the raw server response from the last page request. 8189func (iter TopologyListIterator) Response() TopologyList { 8190 return iter.page.Response() 8191} 8192 8193// Value returns the current value or a zero-initialized value if the 8194// iterator has advanced beyond the end of the collection. 8195func (iter TopologyListIterator) Value() TopologyResource { 8196 if !iter.page.NotDone() { 8197 return TopologyResource{} 8198 } 8199 return iter.page.Values()[iter.i] 8200} 8201 8202// Creates a new instance of the TopologyListIterator type. 8203func NewTopologyListIterator(page TopologyListPage) TopologyListIterator { 8204 return TopologyListIterator{page: page} 8205} 8206 8207// IsEmpty returns true if the ListResult contains no values. 8208func (tl TopologyList) IsEmpty() bool { 8209 return tl.Value == nil || len(*tl.Value) == 0 8210} 8211 8212// topologyListPreparer prepares a request to retrieve the next set of results. 8213// It returns nil if no more results exist. 8214func (tl TopologyList) topologyListPreparer(ctx context.Context) (*http.Request, error) { 8215 if tl.NextLink == nil || len(to.String(tl.NextLink)) < 1 { 8216 return nil, nil 8217 } 8218 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8219 autorest.AsJSON(), 8220 autorest.AsGet(), 8221 autorest.WithBaseURL(to.String(tl.NextLink))) 8222} 8223 8224// TopologyListPage contains a page of TopologyResource values. 8225type TopologyListPage struct { 8226 fn func(context.Context, TopologyList) (TopologyList, error) 8227 tl TopologyList 8228} 8229 8230// NextWithContext advances to the next page of values. If there was an error making 8231// the request the page does not advance and the error is returned. 8232func (page *TopologyListPage) NextWithContext(ctx context.Context) (err error) { 8233 if tracing.IsEnabled() { 8234 ctx = tracing.StartSpan(ctx, fqdn+"/TopologyListPage.NextWithContext") 8235 defer func() { 8236 sc := -1 8237 if page.Response().Response.Response != nil { 8238 sc = page.Response().Response.Response.StatusCode 8239 } 8240 tracing.EndSpan(ctx, sc, err) 8241 }() 8242 } 8243 next, err := page.fn(ctx, page.tl) 8244 if err != nil { 8245 return err 8246 } 8247 page.tl = next 8248 return nil 8249} 8250 8251// Next advances to the next page of values. If there was an error making 8252// the request the page does not advance and the error is returned. 8253// Deprecated: Use NextWithContext() instead. 8254func (page *TopologyListPage) Next() error { 8255 return page.NextWithContext(context.Background()) 8256} 8257 8258// NotDone returns true if the page enumeration should be started or is not yet complete. 8259func (page TopologyListPage) NotDone() bool { 8260 return !page.tl.IsEmpty() 8261} 8262 8263// Response returns the raw server response from the last page request. 8264func (page TopologyListPage) Response() TopologyList { 8265 return page.tl 8266} 8267 8268// Values returns the slice of values for the current page or nil if there are no values. 8269func (page TopologyListPage) Values() []TopologyResource { 8270 if page.tl.IsEmpty() { 8271 return nil 8272 } 8273 return *page.tl.Value 8274} 8275 8276// Creates a new instance of the TopologyListPage type. 8277func NewTopologyListPage(getNextPage func(context.Context, TopologyList) (TopologyList, error)) TopologyListPage { 8278 return TopologyListPage{fn: getNextPage} 8279} 8280 8281// TopologyResource ... 8282type TopologyResource struct { 8283 autorest.Response `json:"-"` 8284 // ID - READ-ONLY; Resource Id 8285 ID *string `json:"id,omitempty"` 8286 // Name - READ-ONLY; Resource name 8287 Name *string `json:"name,omitempty"` 8288 // Type - READ-ONLY; Resource type 8289 Type *string `json:"type,omitempty"` 8290 // Location - READ-ONLY; Location where the resource is stored 8291 Location *string `json:"location,omitempty"` 8292 // TopologyResourceProperties - READ-ONLY 8293 *TopologyResourceProperties `json:"properties,omitempty"` 8294} 8295 8296// MarshalJSON is the custom marshaler for TopologyResource. 8297func (tr TopologyResource) MarshalJSON() ([]byte, error) { 8298 objectMap := make(map[string]interface{}) 8299 return json.Marshal(objectMap) 8300} 8301 8302// UnmarshalJSON is the custom unmarshaler for TopologyResource struct. 8303func (tr *TopologyResource) UnmarshalJSON(body []byte) error { 8304 var m map[string]*json.RawMessage 8305 err := json.Unmarshal(body, &m) 8306 if err != nil { 8307 return err 8308 } 8309 for k, v := range m { 8310 switch k { 8311 case "id": 8312 if v != nil { 8313 var ID string 8314 err = json.Unmarshal(*v, &ID) 8315 if err != nil { 8316 return err 8317 } 8318 tr.ID = &ID 8319 } 8320 case "name": 8321 if v != nil { 8322 var name string 8323 err = json.Unmarshal(*v, &name) 8324 if err != nil { 8325 return err 8326 } 8327 tr.Name = &name 8328 } 8329 case "type": 8330 if v != nil { 8331 var typeVar string 8332 err = json.Unmarshal(*v, &typeVar) 8333 if err != nil { 8334 return err 8335 } 8336 tr.Type = &typeVar 8337 } 8338 case "location": 8339 if v != nil { 8340 var location string 8341 err = json.Unmarshal(*v, &location) 8342 if err != nil { 8343 return err 8344 } 8345 tr.Location = &location 8346 } 8347 case "properties": 8348 if v != nil { 8349 var topologyResourceProperties TopologyResourceProperties 8350 err = json.Unmarshal(*v, &topologyResourceProperties) 8351 if err != nil { 8352 return err 8353 } 8354 tr.TopologyResourceProperties = &topologyResourceProperties 8355 } 8356 } 8357 } 8358 8359 return nil 8360} 8361 8362// TopologyResourceProperties ... 8363type TopologyResourceProperties struct { 8364 // CalculatedDateTime - READ-ONLY; The UTC time on which the topology was calculated 8365 CalculatedDateTime *date.Time `json:"calculatedDateTime,omitempty"` 8366 // TopologyResources - READ-ONLY; Azure resources which are part of this topology resource 8367 TopologyResources *[]TopologySingleResource `json:"topologyResources,omitempty"` 8368} 8369 8370// TopologySingleResource ... 8371type TopologySingleResource struct { 8372 // ResourceID - READ-ONLY; Azure resource id 8373 ResourceID *string `json:"resourceId,omitempty"` 8374 // Severity - READ-ONLY; The security severity of the resource 8375 Severity *string `json:"severity,omitempty"` 8376 // RecommendationsExist - READ-ONLY; Indicates if the resource has security recommendations 8377 RecommendationsExist *bool `json:"recommendationsExist,omitempty"` 8378 // NetworkZones - READ-ONLY; Indicates the resource connectivity level to the Internet (InternetFacing, Internal ,etc.) 8379 NetworkZones *string `json:"networkZones,omitempty"` 8380 // TopologyScore - READ-ONLY; Score of the resource based on its security severity 8381 TopologyScore *int32 `json:"topologyScore,omitempty"` 8382 // Location - READ-ONLY; The location of this resource 8383 Location *string `json:"location,omitempty"` 8384 // Parents - READ-ONLY; Azure resources connected to this resource which are in higher level in the topology view 8385 Parents *[]TopologySingleResourceParent `json:"parents,omitempty"` 8386 // Children - READ-ONLY; Azure resources connected to this resource which are in lower level in the topology view 8387 Children *[]TopologySingleResourceChild `json:"children,omitempty"` 8388} 8389 8390// TopologySingleResourceChild ... 8391type TopologySingleResourceChild struct { 8392 // ResourceID - READ-ONLY; Azure resource id which serves as child resource in topology view 8393 ResourceID *string `json:"resourceId,omitempty"` 8394} 8395 8396// TopologySingleResourceParent ... 8397type TopologySingleResourceParent struct { 8398 // ResourceID - READ-ONLY; Azure resource id which serves as parent resource in topology view 8399 ResourceID *string `json:"resourceId,omitempty"` 8400} 8401 8402// UpdateIotSecuritySolutionData ... 8403type UpdateIotSecuritySolutionData struct { 8404 UserDefinedResources *UserDefinedResourcesProperties `json:"userDefinedResources,omitempty"` 8405 RecommendationsConfiguration *[]RecommendationConfigurationProperties `json:"recommendationsConfiguration,omitempty"` 8406 // Tags - Resource tags 8407 Tags map[string]*string `json:"tags"` 8408} 8409 8410// MarshalJSON is the custom marshaler for UpdateIotSecuritySolutionData. 8411func (uissd UpdateIotSecuritySolutionData) MarshalJSON() ([]byte, error) { 8412 objectMap := make(map[string]interface{}) 8413 if uissd.UserDefinedResources != nil { 8414 objectMap["userDefinedResources"] = uissd.UserDefinedResources 8415 } 8416 if uissd.RecommendationsConfiguration != nil { 8417 objectMap["recommendationsConfiguration"] = uissd.RecommendationsConfiguration 8418 } 8419 if uissd.Tags != nil { 8420 objectMap["tags"] = uissd.Tags 8421 } 8422 return json.Marshal(objectMap) 8423} 8424 8425// UserDefinedResourcesProperties properties of the solution's user defined resources. 8426type UserDefinedResourcesProperties struct { 8427 // Query - Azure Resource Graph query which represents the security solution's user defined resources. Required to start with "where type != "Microsoft.Devices/IotHubs"" 8428 Query *string `json:"query,omitempty"` 8429 // QuerySubscriptions - List of Azure subscription ids on which the user defined resources query should be executed. 8430 QuerySubscriptions *[]string `json:"querySubscriptions,omitempty"` 8431} 8432 8433// UserRecommendation represents a user that is recommended to be allowed for a certain rule 8434type UserRecommendation struct { 8435 // Username - Represents a user that is recommended to be allowed for a certain rule 8436 Username *string `json:"username,omitempty"` 8437 // RecommendationAction - Possible values include: 'RecommendationAction1Recommended', 'RecommendationAction1Add', 'RecommendationAction1Remove' 8438 RecommendationAction RecommendationAction1 `json:"recommendationAction,omitempty"` 8439} 8440 8441// VendorReference vendor reference 8442type VendorReference struct { 8443 // Title - READ-ONLY; Link title 8444 Title *string `json:"title,omitempty"` 8445 // Link - READ-ONLY; Link url 8446 Link *string `json:"link,omitempty"` 8447} 8448 8449// VMRecommendation represents a machine that is part of a VM/server group 8450type VMRecommendation struct { 8451 // ConfigurationStatus - Possible values include: 'Configured', 'NotConfigured', 'InProgress', 'Failed', 'NoStatus' 8452 ConfigurationStatus ConfigurationStatus `json:"configurationStatus,omitempty"` 8453 // RecommendationAction - Possible values include: 'RecommendationActionRecommended', 'RecommendationActionAdd', 'RecommendationActionRemove' 8454 RecommendationAction RecommendationAction `json:"recommendationAction,omitempty"` 8455 ResourceID *string `json:"resourceId,omitempty"` 8456} 8457 8458// WorkspaceSetting configures where to store the OMS agent data for workspaces under a scope 8459type WorkspaceSetting struct { 8460 autorest.Response `json:"-"` 8461 // WorkspaceSettingProperties - Workspace setting data 8462 *WorkspaceSettingProperties `json:"properties,omitempty"` 8463 // ID - READ-ONLY; Resource Id 8464 ID *string `json:"id,omitempty"` 8465 // Name - READ-ONLY; Resource name 8466 Name *string `json:"name,omitempty"` 8467 // Type - READ-ONLY; Resource type 8468 Type *string `json:"type,omitempty"` 8469} 8470 8471// MarshalJSON is the custom marshaler for WorkspaceSetting. 8472func (ws WorkspaceSetting) MarshalJSON() ([]byte, error) { 8473 objectMap := make(map[string]interface{}) 8474 if ws.WorkspaceSettingProperties != nil { 8475 objectMap["properties"] = ws.WorkspaceSettingProperties 8476 } 8477 return json.Marshal(objectMap) 8478} 8479 8480// UnmarshalJSON is the custom unmarshaler for WorkspaceSetting struct. 8481func (ws *WorkspaceSetting) UnmarshalJSON(body []byte) error { 8482 var m map[string]*json.RawMessage 8483 err := json.Unmarshal(body, &m) 8484 if err != nil { 8485 return err 8486 } 8487 for k, v := range m { 8488 switch k { 8489 case "properties": 8490 if v != nil { 8491 var workspaceSettingProperties WorkspaceSettingProperties 8492 err = json.Unmarshal(*v, &workspaceSettingProperties) 8493 if err != nil { 8494 return err 8495 } 8496 ws.WorkspaceSettingProperties = &workspaceSettingProperties 8497 } 8498 case "id": 8499 if v != nil { 8500 var ID string 8501 err = json.Unmarshal(*v, &ID) 8502 if err != nil { 8503 return err 8504 } 8505 ws.ID = &ID 8506 } 8507 case "name": 8508 if v != nil { 8509 var name string 8510 err = json.Unmarshal(*v, &name) 8511 if err != nil { 8512 return err 8513 } 8514 ws.Name = &name 8515 } 8516 case "type": 8517 if v != nil { 8518 var typeVar string 8519 err = json.Unmarshal(*v, &typeVar) 8520 if err != nil { 8521 return err 8522 } 8523 ws.Type = &typeVar 8524 } 8525 } 8526 } 8527 8528 return nil 8529} 8530 8531// WorkspaceSettingList list of workspace settings response 8532type WorkspaceSettingList struct { 8533 autorest.Response `json:"-"` 8534 // Value - List of workspace settings 8535 Value *[]WorkspaceSetting `json:"value,omitempty"` 8536 // NextLink - READ-ONLY; The URI to fetch the next page. 8537 NextLink *string `json:"nextLink,omitempty"` 8538} 8539 8540// WorkspaceSettingListIterator provides access to a complete listing of WorkspaceSetting values. 8541type WorkspaceSettingListIterator struct { 8542 i int 8543 page WorkspaceSettingListPage 8544} 8545 8546// NextWithContext advances to the next value. If there was an error making 8547// the request the iterator does not advance and the error is returned. 8548func (iter *WorkspaceSettingListIterator) NextWithContext(ctx context.Context) (err error) { 8549 if tracing.IsEnabled() { 8550 ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceSettingListIterator.NextWithContext") 8551 defer func() { 8552 sc := -1 8553 if iter.Response().Response.Response != nil { 8554 sc = iter.Response().Response.Response.StatusCode 8555 } 8556 tracing.EndSpan(ctx, sc, err) 8557 }() 8558 } 8559 iter.i++ 8560 if iter.i < len(iter.page.Values()) { 8561 return nil 8562 } 8563 err = iter.page.NextWithContext(ctx) 8564 if err != nil { 8565 iter.i-- 8566 return err 8567 } 8568 iter.i = 0 8569 return nil 8570} 8571 8572// Next advances to the next value. If there was an error making 8573// the request the iterator does not advance and the error is returned. 8574// Deprecated: Use NextWithContext() instead. 8575func (iter *WorkspaceSettingListIterator) Next() error { 8576 return iter.NextWithContext(context.Background()) 8577} 8578 8579// NotDone returns true if the enumeration should be started or is not yet complete. 8580func (iter WorkspaceSettingListIterator) NotDone() bool { 8581 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 8582} 8583 8584// Response returns the raw server response from the last page request. 8585func (iter WorkspaceSettingListIterator) Response() WorkspaceSettingList { 8586 return iter.page.Response() 8587} 8588 8589// Value returns the current value or a zero-initialized value if the 8590// iterator has advanced beyond the end of the collection. 8591func (iter WorkspaceSettingListIterator) Value() WorkspaceSetting { 8592 if !iter.page.NotDone() { 8593 return WorkspaceSetting{} 8594 } 8595 return iter.page.Values()[iter.i] 8596} 8597 8598// Creates a new instance of the WorkspaceSettingListIterator type. 8599func NewWorkspaceSettingListIterator(page WorkspaceSettingListPage) WorkspaceSettingListIterator { 8600 return WorkspaceSettingListIterator{page: page} 8601} 8602 8603// IsEmpty returns true if the ListResult contains no values. 8604func (wsl WorkspaceSettingList) IsEmpty() bool { 8605 return wsl.Value == nil || len(*wsl.Value) == 0 8606} 8607 8608// workspaceSettingListPreparer prepares a request to retrieve the next set of results. 8609// It returns nil if no more results exist. 8610func (wsl WorkspaceSettingList) workspaceSettingListPreparer(ctx context.Context) (*http.Request, error) { 8611 if wsl.NextLink == nil || len(to.String(wsl.NextLink)) < 1 { 8612 return nil, nil 8613 } 8614 return autorest.Prepare((&http.Request{}).WithContext(ctx), 8615 autorest.AsJSON(), 8616 autorest.AsGet(), 8617 autorest.WithBaseURL(to.String(wsl.NextLink))) 8618} 8619 8620// WorkspaceSettingListPage contains a page of WorkspaceSetting values. 8621type WorkspaceSettingListPage struct { 8622 fn func(context.Context, WorkspaceSettingList) (WorkspaceSettingList, error) 8623 wsl WorkspaceSettingList 8624} 8625 8626// NextWithContext advances to the next page of values. If there was an error making 8627// the request the page does not advance and the error is returned. 8628func (page *WorkspaceSettingListPage) NextWithContext(ctx context.Context) (err error) { 8629 if tracing.IsEnabled() { 8630 ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceSettingListPage.NextWithContext") 8631 defer func() { 8632 sc := -1 8633 if page.Response().Response.Response != nil { 8634 sc = page.Response().Response.Response.StatusCode 8635 } 8636 tracing.EndSpan(ctx, sc, err) 8637 }() 8638 } 8639 next, err := page.fn(ctx, page.wsl) 8640 if err != nil { 8641 return err 8642 } 8643 page.wsl = next 8644 return nil 8645} 8646 8647// Next advances to the next page of values. If there was an error making 8648// the request the page does not advance and the error is returned. 8649// Deprecated: Use NextWithContext() instead. 8650func (page *WorkspaceSettingListPage) Next() error { 8651 return page.NextWithContext(context.Background()) 8652} 8653 8654// NotDone returns true if the page enumeration should be started or is not yet complete. 8655func (page WorkspaceSettingListPage) NotDone() bool { 8656 return !page.wsl.IsEmpty() 8657} 8658 8659// Response returns the raw server response from the last page request. 8660func (page WorkspaceSettingListPage) Response() WorkspaceSettingList { 8661 return page.wsl 8662} 8663 8664// Values returns the slice of values for the current page or nil if there are no values. 8665func (page WorkspaceSettingListPage) Values() []WorkspaceSetting { 8666 if page.wsl.IsEmpty() { 8667 return nil 8668 } 8669 return *page.wsl.Value 8670} 8671 8672// Creates a new instance of the WorkspaceSettingListPage type. 8673func NewWorkspaceSettingListPage(getNextPage func(context.Context, WorkspaceSettingList) (WorkspaceSettingList, error)) WorkspaceSettingListPage { 8674 return WorkspaceSettingListPage{fn: getNextPage} 8675} 8676 8677// WorkspaceSettingProperties workspace setting data 8678type WorkspaceSettingProperties struct { 8679 // WorkspaceID - The full Azure ID of the workspace to save the data in 8680 WorkspaceID *string `json:"workspaceId,omitempty"` 8681 // Scope - All the VMs in this scope will send their security data to the mentioned workspace unless overridden by a setting with more specific scope 8682 Scope *string `json:"scope,omitempty"` 8683} 8684