From e10a115b3c0da41192850fcea94c505d46835963 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 3 Apr 2023 08:17:47 +0000 Subject: [PATCH] CodeGen from PR 23400 in Azure/azure-rest-api-specs Merge b18026f8c89c01de1041e7f538d44f5784ba5845 into f790e624d0d080b89d962a3bd19c65bc6a6b2f5e --- .../security/armsecurity/CHANGELOG.md | 178 ++ .../accountconnectors_client_example_test.go | 421 ----- ...applicationcontrols_client_example_test.go | 1321 -------------- ...venetworkhardenings_client_example_test.go | 194 -- ...cedthreatprotection_client_example_test.go | 82 - .../armsecurity/alerts_client_example_test.go | 1464 --------------- ...rtssuppressionrules_client_example_test.go | 296 --- .../allowedconnections_client_example_test.go | 235 --- .../armsecurity/apicollection_client.go | 181 ++ .../apicollectionoffboarding_client.go | 101 ++ .../apicollectiononboarding_client.go | 111 ++ .../application_client_example_test.go | 132 -- .../applications_client_example_test.go | 86 - .../assessments_client_example_test.go | 234 --- ...assessmentsmetadata_client_example_test.go | 418 ----- .../automations_client_example_test.go | 531 ------ ...rovisioningsettings_client_example_test.go | 118 -- .../security/armsecurity/autorest.md | 5 +- .../security/armsecurity/client_factory.go | 81 +- .../complianceresults_client_example_test.go | 98 - .../compliances_client_example_test.go | 122 -- ...onnectorapplication_client_example_test.go | 132 -- ...nnectorapplications_client_example_test.go | 86 - .../connectorgovernancerule_client.go | 115 -- ...ectorgovernancerule_client_example_test.go | 112 -- .../connectorgovernancerules_client.go | 225 --- ...ctorgovernancerules_client_example_test.go | 171 -- ...ctorgovernancerulesexecutestatus_client.go | 120 -- ...erulesexecutestatus_client_example_test.go | 45 - .../security/armsecurity/connectors_client.go | 24 +- .../connectors_client_example_test.go | 558 ------ .../security/armsecurity/constants.go | 111 +- .../contacts_client_example_test.go | 173 -- ...sessmentautomations_client_example_test.go | 273 --- ...itystoreassignments_client_example_test.go | 230 --- ...evicesecuritygroups_client_example_test.go | 664 ------- ...edsecuritysolutions_client_example_test.go | 154 -- ...alsecuritysolutions_client_example_test.go | 199 -- .../security/armsecurity/go.mod | 14 +- .../security/armsecurity/go.sum | 22 +- .../governanceassignments_client.go | 60 +- ...vernanceassignments_client_example_test.go | 209 --- .../armsecurity/governancerule_client.go | 104 -- .../governancerule_client_example_test.go | 112 -- .../armsecurity/governancerules_client.go | 354 ++-- .../governancerules_client_example_test.go | 213 --- .../armsecurity/healthreport_client.go | 92 + .../armsecurity/healthreports_client.go | 99 + ...nprotectionpolicies_client_example_test.go | 512 ------ .../ingestionsettings_client_example_test.go | 177 -- ...iotsecuritysolution_client_example_test.go | 1192 ------------ ...tysolutionanalytics_client_example_test.go | 211 --- ...ticsaggregatedalert_client_example_test.go | 173 -- ...yticsrecommendation_client_example_test.go | 117 -- ...tworkaccesspolicies_client_example_test.go | 530 ------ .../locations_client_example_test.go | 82 - .../mdeonboardings_client_example_test.go | 79 - .../security/armsecurity/models.go | 689 ++++++- .../security/armsecurity/models_serde.go | 1325 +++++++++++++- .../security/armsecurity/operators_client.go | 260 +++ .../armsecurity/polymorphic_helpers.go | 6 + .../security/armsecurity/pricings_client.go | 12 +- .../pricings_client_example_test.go | 223 --- ...mplianceassessments_client_example_test.go | 122 -- ...ycompliancecontrols_client_example_test.go | 114 -- ...compliancestandards_client_example_test.go | 126 -- .../security/armsecurity/response_types.go | 106 +- ...econtroldefinitions_client_example_test.go | 183 -- ...securescorecontrols_client_example_test.go | 1594 ----------------- .../securescores_client_example_test.go | 94 - ...erabilityassessment_client_example_test.go | 115 -- .../settings_client_example_test.go | 159 -- ...softwareinventories_client_example_test.go | 169 -- .../solutions_client_example_test.go | 102 -- ...utionsreferencedata_client_example_test.go | 120 -- ...erabilityassessmentbaselinerules_client.go | 20 +- ...ssmentbaselinerules_client_example_test.go | 320 ---- ...lnerabilityassessmentscanresults_client.go | 8 +- ...sessmentscanresults_client_example_test.go | 410 ----- .../sqlvulnerabilityassessmentscans_client.go | 8 +- ...lityassessmentscans_client_example_test.go | 165 -- .../subassessments_client_example_test.go | 225 --- ...tiongovernancerulesexecutestatus_client.go | 110 -- ...erulesexecutestatus_client_example_test.go | 45 - .../armsecurity/tasks_client_example_test.go | 337 ---- .../topology_client_example_test.go | 204 --- .../workspacesettings_client_example_test.go | 184 -- 87 files changed, 3404 insertions(+), 18304 deletions(-) delete mode 100644 sdk/resourcemanager/security/armsecurity/accountconnectors_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/adaptiveapplicationcontrols_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/adaptivenetworkhardenings_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/advancedthreatprotection_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/alerts_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/alertssuppressionrules_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/allowedconnections_client_example_test.go create mode 100644 sdk/resourcemanager/security/armsecurity/apicollection_client.go create mode 100644 sdk/resourcemanager/security/armsecurity/apicollectionoffboarding_client.go create mode 100644 sdk/resourcemanager/security/armsecurity/apicollectiononboarding_client.go delete mode 100644 sdk/resourcemanager/security/armsecurity/application_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/applications_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/assessments_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/assessmentsmetadata_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/automations_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/autoprovisioningsettings_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/complianceresults_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/compliances_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/connectorapplication_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/connectorapplications_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/connectorgovernancerule_client.go delete mode 100644 sdk/resourcemanager/security/armsecurity/connectorgovernancerule_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/connectorgovernancerules_client.go delete mode 100644 sdk/resourcemanager/security/armsecurity/connectorgovernancerules_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/connectorgovernancerulesexecutestatus_client.go delete mode 100644 sdk/resourcemanager/security/armsecurity/connectorgovernancerulesexecutestatus_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/connectors_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/contacts_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/customassessmentautomations_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/customentitystoreassignments_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/devicesecuritygroups_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/discoveredsecuritysolutions_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/externalsecuritysolutions_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/governanceassignments_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/governancerule_client.go delete mode 100644 sdk/resourcemanager/security/armsecurity/governancerule_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/governancerules_client_example_test.go create mode 100644 sdk/resourcemanager/security/armsecurity/healthreport_client.go create mode 100644 sdk/resourcemanager/security/armsecurity/healthreports_client.go delete mode 100644 sdk/resourcemanager/security/armsecurity/informationprotectionpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/ingestionsettings_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/iotsecuritysolution_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/iotsecuritysolutionanalytics_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsaggregatedalert_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsrecommendation_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/jitnetworkaccesspolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/locations_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/mdeonboardings_client_example_test.go create mode 100644 sdk/resourcemanager/security/armsecurity/operators_client.go delete mode 100644 sdk/resourcemanager/security/armsecurity/pricings_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/regulatorycomplianceassessments_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/regulatorycompliancecontrols_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/regulatorycompliancestandards_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/securescorecontroldefinitions_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/securescorecontrols_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/securescores_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/servervulnerabilityassessment_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/settings_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/softwareinventories_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/solutions_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/solutionsreferencedata_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentbaselinerules_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscanresults_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/subassessments_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/subscriptiongovernancerulesexecutestatus_client.go delete mode 100644 sdk/resourcemanager/security/armsecurity/subscriptiongovernancerulesexecutestatus_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/tasks_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/topology_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/workspacesettings_client_example_test.go diff --git a/sdk/resourcemanager/security/armsecurity/CHANGELOG.md b/sdk/resourcemanager/security/armsecurity/CHANGELOG.md index 23a043612edc..91a246cdc9ce 100644 --- a/sdk/resourcemanager/security/armsecurity/CHANGELOG.md +++ b/sdk/resourcemanager/security/armsecurity/CHANGELOG.md @@ -1,5 +1,183 @@ # Release History +## 0.10.0 (2023-04-03) +### Breaking Changes + +- Function `NewGovernanceRulesClient` parameter(s) have been changed from `(string, azcore.TokenCredential, *arm.ClientOptions)` to `(azcore.TokenCredential, *arm.ClientOptions)` +- Function `*GovernanceRulesClient.CreateOrUpdate` parameter(s) have been changed from `(context.Context, string, GovernanceRule, *GovernanceRulesClientCreateOrUpdateOptions)` to `(context.Context, string, string, GovernanceRule, *GovernanceRulesClientCreateOrUpdateOptions)` +- Function `*GovernanceRulesClient.Get` parameter(s) have been changed from `(context.Context, string, *GovernanceRulesClientGetOptions)` to `(context.Context, string, string, *GovernanceRulesClientGetOptions)` +- Function `NewConnectorGovernanceRuleClient` has been removed +- Function `*ConnectorGovernanceRuleClient.NewListPager` has been removed +- Function `NewConnectorGovernanceRulesClient` has been removed +- Function `*ConnectorGovernanceRulesClient.CreateOrUpdate` has been removed +- Function `*ConnectorGovernanceRulesClient.Delete` has been removed +- Function `*ConnectorGovernanceRulesClient.Get` has been removed +- Function `NewConnectorGovernanceRulesExecuteStatusClient` has been removed +- Function `*ConnectorGovernanceRulesExecuteStatusClient.BeginGet` has been removed +- Function `NewGovernanceRuleClient` has been removed +- Function `*GovernanceRuleClient.NewListPager` has been removed +- Function `*GovernanceRulesClient.BeginRuleIDExecuteSingleSecurityConnector` has been removed +- Function `*GovernanceRulesClient.BeginRuleIDExecuteSingleSubscription` has been removed +- Function `NewSubscriptionGovernanceRulesExecuteStatusClient` has been removed +- Function `*SubscriptionGovernanceRulesExecuteStatusClient.BeginGet` has been removed +- Operation `*GovernanceRulesClient.Delete` has been changed to LRO, use `*GovernanceRulesClient.BeginDelete` instead. +- Struct `ConnectorGovernanceRuleClient` has been removed +- Struct `ConnectorGovernanceRulesClient` has been removed +- Struct `ConnectorGovernanceRulesExecuteStatusClient` has been removed +- Struct `ExecuteRuleStatus` has been removed +- Struct `GovernanceRuleClient` has been removed +- Struct `SubscriptionGovernanceRulesExecuteStatusClient` has been removed + +### Features Added + +- New value `CloudNameGitLab` added to enum type `CloudName` +- New value `EnvironmentTypeGitlabScope` added to enum type `EnvironmentType` +- New value `OfferingTypeCspmMonitorGitLab`, `OfferingTypeDefenderForDevOpsGitLab` added to enum type `OfferingType` +- New enum type `Code` with values `CodeFailed`, `CodeSucceeded` +- New enum type `IsEnabled` with values `IsEnabledFalse`, `IsEnabledTrue` +- New enum type `OperationResult` with values `OperationResultCanceled`, `OperationResultFailed`, `OperationResultSucceeded` +- New enum type `ScopeName` with values `ScopeNameClusters`, `ScopeNameConnectors`, `ScopeNameUnknown`, `ScopeNameVirtualMachines` +- New enum type `StatusName` with values `StatusNameHealthy`, `StatusNameNotApplicable`, `StatusNameNotHealthy` +- New function `NewAPICollectionClient(string, azcore.TokenCredential, *arm.ClientOptions) (*APICollectionClient, error)` +- New function `*APICollectionClient.Get(context.Context, string, string, string, *APICollectionClientGetOptions) (APICollectionClientGetResponse, error)` +- New function `*APICollectionClient.NewListPager(string, string, *APICollectionClientListOptions) *runtime.Pager[APICollectionClientListResponse]` +- New function `NewAPICollectionOffboardingClient(string, azcore.TokenCredential, *arm.ClientOptions) (*APICollectionOffboardingClient, error)` +- New function `*APICollectionOffboardingClient.Delete(context.Context, string, string, string, *APICollectionOffboardingClientDeleteOptions) (APICollectionOffboardingClientDeleteResponse, error)` +- New function `NewAPICollectionOnboardingClient(string, azcore.TokenCredential, *arm.ClientOptions) (*APICollectionOnboardingClient, error)` +- New function `*APICollectionOnboardingClient.Create(context.Context, string, string, string, *APICollectionOnboardingClientCreateOptions) (APICollectionOnboardingClientCreateResponse, error)` +- New function `NewClientFactory(string, azcore.TokenCredential, *arm.ClientOptions) (*ClientFactory, error)` +- New function `*ClientFactory.NewAPICollectionClient() *APICollectionClient` +- New function `*ClientFactory.NewAPICollectionOffboardingClient() *APICollectionOffboardingClient` +- New function `*ClientFactory.NewAPICollectionOnboardingClient() *APICollectionOnboardingClient` +- New function `*ClientFactory.NewAccountConnectorsClient() *AccountConnectorsClient` +- New function `*ClientFactory.NewAdaptiveApplicationControlsClient() *AdaptiveApplicationControlsClient` +- New function `*ClientFactory.NewAdaptiveNetworkHardeningsClient() *AdaptiveNetworkHardeningsClient` +- New function `*ClientFactory.NewAdvancedThreatProtectionClient() *AdvancedThreatProtectionClient` +- New function `*ClientFactory.NewAlertsClient() *AlertsClient` +- New function `*ClientFactory.NewAlertsSuppressionRulesClient() *AlertsSuppressionRulesClient` +- New function `*ClientFactory.NewAllowedConnectionsClient() *AllowedConnectionsClient` +- New function `*ClientFactory.NewApplicationClient() *ApplicationClient` +- New function `*ClientFactory.NewApplicationsClient() *ApplicationsClient` +- New function `*ClientFactory.NewAssessmentsClient() *AssessmentsClient` +- New function `*ClientFactory.NewAssessmentsMetadataClient() *AssessmentsMetadataClient` +- New function `*ClientFactory.NewAutoProvisioningSettingsClient() *AutoProvisioningSettingsClient` +- New function `*ClientFactory.NewAutomationsClient() *AutomationsClient` +- New function `*ClientFactory.NewComplianceResultsClient() *ComplianceResultsClient` +- New function `*ClientFactory.NewCompliancesClient() *CompliancesClient` +- New function `*ClientFactory.NewConnectorApplicationClient() *ConnectorApplicationClient` +- New function `*ClientFactory.NewConnectorApplicationsClient() *ConnectorApplicationsClient` +- New function `*ClientFactory.NewConnectorsClient() *ConnectorsClient` +- New function `*ClientFactory.NewContactsClient() *ContactsClient` +- New function `*ClientFactory.NewCustomAssessmentAutomationsClient() *CustomAssessmentAutomationsClient` +- New function `*ClientFactory.NewCustomEntityStoreAssignmentsClient() *CustomEntityStoreAssignmentsClient` +- New function `*ClientFactory.NewDeviceSecurityGroupsClient() *DeviceSecurityGroupsClient` +- New function `*ClientFactory.NewDiscoveredSecuritySolutionsClient() *DiscoveredSecuritySolutionsClient` +- New function `*ClientFactory.NewExternalSecuritySolutionsClient() *ExternalSecuritySolutionsClient` +- New function `*ClientFactory.NewGovernanceAssignmentsClient() *GovernanceAssignmentsClient` +- New function `*ClientFactory.NewGovernanceRulesClient() *GovernanceRulesClient` +- New function `*ClientFactory.NewHealthReportClient() *HealthReportClient` +- New function `*ClientFactory.NewHealthReportsClient() *HealthReportsClient` +- New function `*ClientFactory.NewInformationProtectionPoliciesClient() *InformationProtectionPoliciesClient` +- New function `*ClientFactory.NewIngestionSettingsClient() *IngestionSettingsClient` +- New function `*ClientFactory.NewIotSecuritySolutionAnalyticsClient() *IotSecuritySolutionAnalyticsClient` +- New function `*ClientFactory.NewIotSecuritySolutionClient() *IotSecuritySolutionClient` +- New function `*ClientFactory.NewIotSecuritySolutionsAnalyticsAggregatedAlertClient() *IotSecuritySolutionsAnalyticsAggregatedAlertClient` +- New function `*ClientFactory.NewIotSecuritySolutionsAnalyticsRecommendationClient() *IotSecuritySolutionsAnalyticsRecommendationClient` +- New function `*ClientFactory.NewJitNetworkAccessPoliciesClient() *JitNetworkAccessPoliciesClient` +- New function `*ClientFactory.NewLocationsClient() *LocationsClient` +- New function `*ClientFactory.NewMdeOnboardingsClient() *MdeOnboardingsClient` +- New function `*ClientFactory.NewOperationsClient() *OperationsClient` +- New function `*ClientFactory.NewOperatorsClient() *OperatorsClient` +- New function `*ClientFactory.NewPricingsClient() *PricingsClient` +- New function `*ClientFactory.NewRegulatoryComplianceAssessmentsClient() *RegulatoryComplianceAssessmentsClient` +- New function `*ClientFactory.NewRegulatoryComplianceControlsClient() *RegulatoryComplianceControlsClient` +- New function `*ClientFactory.NewRegulatoryComplianceStandardsClient() *RegulatoryComplianceStandardsClient` +- New function `*ClientFactory.NewSQLVulnerabilityAssessmentBaselineRulesClient() *SQLVulnerabilityAssessmentBaselineRulesClient` +- New function `*ClientFactory.NewSQLVulnerabilityAssessmentScanResultsClient() *SQLVulnerabilityAssessmentScanResultsClient` +- New function `*ClientFactory.NewSQLVulnerabilityAssessmentScansClient() *SQLVulnerabilityAssessmentScansClient` +- New function `*ClientFactory.NewSecureScoreControlDefinitionsClient() *SecureScoreControlDefinitionsClient` +- New function `*ClientFactory.NewSecureScoreControlsClient() *SecureScoreControlsClient` +- New function `*ClientFactory.NewSecureScoresClient() *SecureScoresClient` +- New function `*ClientFactory.NewServerVulnerabilityAssessmentClient() *ServerVulnerabilityAssessmentClient` +- New function `*ClientFactory.NewSettingsClient() *SettingsClient` +- New function `*ClientFactory.NewSoftwareInventoriesClient() *SoftwareInventoriesClient` +- New function `*ClientFactory.NewSolutionsClient() *SolutionsClient` +- New function `*ClientFactory.NewSolutionsReferenceDataClient() *SolutionsReferenceDataClient` +- New function `*ClientFactory.NewSubAssessmentsClient() *SubAssessmentsClient` +- New function `*ClientFactory.NewTasksClient() *TasksClient` +- New function `*ClientFactory.NewTopologyClient() *TopologyClient` +- New function `*ClientFactory.NewWorkspaceSettingsClient() *WorkspaceSettingsClient` +- New function `*CspmMonitorGitLabOffering.GetCloudOffering() *CloudOffering` +- New function `*DefenderForDevOpsGitLabOffering.GetCloudOffering() *CloudOffering` +- New function `*GitlabScopeEnvironmentData.GetEnvironmentData() *EnvironmentData` +- New function `*GovernanceRulesClient.BeginExecute(context.Context, string, string, *GovernanceRulesClientBeginExecuteOptions) (*runtime.Poller[GovernanceRulesClientExecuteResponse], error)` +- New function `*GovernanceRulesClient.NewListPager(string, *GovernanceRulesClientListOptions) *runtime.Pager[GovernanceRulesClientListResponse]` +- New function `*GovernanceRulesClient.OperationResults(context.Context, string, string, string, *GovernanceRulesClientOperationResultsOptions) (GovernanceRulesClientOperationResultsResponse, error)` +- New function `NewHealthReportClient(azcore.TokenCredential, *arm.ClientOptions) (*HealthReportClient, error)` +- New function `*HealthReportClient.Get(context.Context, string, string, *HealthReportClientGetOptions) (HealthReportClientGetResponse, error)` +- New function `NewHealthReportsClient(azcore.TokenCredential, *arm.ClientOptions) (*HealthReportsClient, error)` +- New function `*HealthReportsClient.NewListPager(string, *HealthReportsClientListOptions) *runtime.Pager[HealthReportsClientListResponse]` +- New function `NewOperatorsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*OperatorsClient, error)` +- New function `*OperatorsClient.CreateOrUpdate(context.Context, string, string, *OperatorsClientCreateOrUpdateOptions) (OperatorsClientCreateOrUpdateResponse, error)` +- New function `*OperatorsClient.Delete(context.Context, string, string, *OperatorsClientDeleteOptions) (OperatorsClientDeleteResponse, error)` +- New function `*OperatorsClient.Get(context.Context, string, string, *OperatorsClientGetOptions) (OperatorsClientGetResponse, error)` +- New function `*OperatorsClient.List(context.Context, string, *OperatorsClientListOptions) (OperatorsClientListResponse, error)` +- New struct `APICollectionProperties` +- New struct `APICollectionResponse` +- New struct `APICollectionResponseList` +- New struct `ClientFactory` +- New struct `CspmMonitorGitLabOffering` +- New struct `DefenderCspmAwsOfferingDataSensitivityDiscovery` +- New struct `DefenderCspmAwsOfferingDatabasesDspm` +- New struct `DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration` +- New struct `DefenderFoDatabasesAwsOfferingDatabasesDspm` +- New struct `DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration` +- New struct `DefenderForDevOpsGitLabOffering` +- New struct `DefenderForServersAwsOfferingArcAutoProvisioningConfiguration` +- New struct `DefenderForServersGcpOfferingArcAutoProvisioningConfiguration` +- New struct `DefenderForServersGcpOfferingVMScanners` +- New struct `DefenderForServersGcpOfferingVMScannersConfiguration` +- New struct `EnvironmentDetails` +- New struct `ErrorDetail` +- New struct `ErrorDetailAutoGenerated` +- New struct `ErrorResponse` +- New struct `ErrorResponseAutoGenerated` +- New struct `Extension` +- New struct `GitlabScopeEnvironmentData` +- New struct `GovernanceRuleMetadata` +- New struct `HealthDataClassification` +- New struct `HealthReport` +- New struct `HealthReportProperties` +- New struct `HealthReportsList` +- New struct `Identity` +- New struct `Issue` +- New struct `OperationResultAutoGenerated` +- New struct `OperationStatus` +- New struct `Operator` +- New struct `OperatorList` +- New struct `ResourceDetailsAutoGenerated` +- New struct `StatusAutoGenerated` +- New field `AccountName` in struct `AwsEnvironmentData` +- New field `Regions` in struct `AwsEnvironmentData` +- New field `DataSensitivityDiscovery` in struct `DefenderCspmAwsOffering` +- New field `DatabasesDspm` in struct `DefenderCspmAwsOffering` +- New field `DatabasesDspm` in struct `DefenderFoDatabasesAwsOffering` +- New field `Configuration` in struct `DefenderFoDatabasesAwsOfferingArcAutoProvisioning` +- New field `Configuration` in struct `DefenderForDatabasesGcpOfferingArcAutoProvisioning` +- New field `Configuration` in struct `DefenderForServersAwsOfferingArcAutoProvisioning` +- New field `VMScanners` in struct `DefenderForServersGcpOffering` +- New field `Configuration` in struct `DefenderForServersGcpOfferingArcAutoProvisioning` +- New field `OrganizationName` in struct `GcpOrganizationalDataOrganization` +- New field `ProjectName` in struct `GcpProjectDetails` +- New field `ExcludedScopes` in struct `GovernanceRuleProperties` +- New field `IncludeMemberScopes` in struct `GovernanceRuleProperties` +- New field `Metadata` in struct `GovernanceRuleProperties` +- New field `TenantID` in struct `GovernanceRuleProperties` +- New field `EnablementTime` in struct `PricingProperties` +- New field `Extensions` in struct `PricingProperties` +- New field `LastScanTime` in struct `ScanProperties` + + ## 0.10.0 (2023-03-27) ### Features Added diff --git a/sdk/resourcemanager/security/armsecurity/accountconnectors_client_example_test.go b/sdk/resourcemanager/security/armsecurity/accountconnectors_client_example_test.go deleted file mode 100644 index 8dbeaf70e1f2..000000000000 --- a/sdk/resourcemanager/security/armsecurity/accountconnectors_client_example_test.go +++ /dev/null @@ -1,421 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/GetListConnectorSubscription_example.json -func ExampleAccountConnectorsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAccountConnectorsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ConnectorSettingList = armsecurity.ConnectorSettingList{ - // Value: []*armsecurity.ConnectorSetting{ - // { - // Name: to.Ptr("aws_dev1"), - // Type: to.Ptr("Microsoft.Security/connectors"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/connectors/aws_dev1"), - // Properties: &armsecurity.ConnectorSettingProperties{ - // AuthenticationDetails: &armsecurity.AwsCredsAuthenticationDetailsProperties{ - // AuthenticationProvisioningState: to.Ptr(armsecurity.AuthenticationProvisioningStateValid), - // AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeAwsCreds), - // GrantedPermissions: []*armsecurity.PermissionProperty{ - // to.Ptr(armsecurity.PermissionPropertyAWSAWSSecurityHubReadOnlyAccess), - // to.Ptr(armsecurity.PermissionPropertyAWSSecurityAudit), - // to.Ptr(armsecurity.PermissionPropertyAWSAmazonSSMAutomationRole)}, - // AccountID: to.Ptr("922315681122"), - // AwsAccessKeyID: to.Ptr(""), - // AwsSecretAccessKey: to.Ptr(""), - // }, - // HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - // AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - // HybridComputeProvisioningState: to.Ptr(armsecurity.HybridComputeProvisioningStateValid), - // ProxyServer: &armsecurity.ProxyServerProperties{ - // IP: to.Ptr("287.221.107.152"), - // Port: to.Ptr("34"), - // }, - // Region: to.Ptr("West US 2"), - // ResourceGroupName: to.Ptr("AwsConnectorRG"), - // ServicePrincipal: &armsecurity.ServicePrincipalProperties{ - // ApplicationID: to.Ptr("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1"), - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("aws_dev2"), - // Type: to.Ptr("Microsoft.Security/connectors"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/connectors/aws_dev2"), - // Properties: &armsecurity.ConnectorSettingProperties{ - // AuthenticationDetails: &armsecurity.AwAssumeRoleAuthenticationDetailsProperties{ - // AuthenticationProvisioningState: to.Ptr(armsecurity.AuthenticationProvisioningStateValid), - // AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeAwsAssumeRole), - // GrantedPermissions: []*armsecurity.PermissionProperty{ - // to.Ptr(armsecurity.PermissionPropertyAWSAWSSecurityHubReadOnlyAccess), - // to.Ptr(armsecurity.PermissionPropertyAWSSecurityAudit), - // to.Ptr(armsecurity.PermissionPropertyAWSAmazonSSMAutomationRole)}, - // AccountID: to.Ptr("81231569658"), - // AwsAssumeRoleArn: to.Ptr("arn:aws:iam::81231569658:role/AscConnector"), - // AwsExternalID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }, - // HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - // AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - // HybridComputeProvisioningState: to.Ptr(armsecurity.HybridComputeProvisioningStateValid), - // ProxyServer: &armsecurity.ProxyServerProperties{ - // IP: to.Ptr("167.210.187.160"), - // Port: to.Ptr("34"), - // }, - // Region: to.Ptr("West US 2"), - // ResourceGroupName: to.Ptr("AwsConnectorRG"), - // ServicePrincipal: &armsecurity.ServicePrincipalProperties{ - // ApplicationID: to.Ptr("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1"), - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("gcp_dev"), - // Type: to.Ptr("Microsoft.Security/connectors"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/connectors/gcp_dev"), - // Properties: &armsecurity.ConnectorSettingProperties{ - // AuthenticationDetails: &armsecurity.GcpCredentialsDetailsProperties{ - // AuthenticationProvisioningState: to.Ptr(armsecurity.AuthenticationProvisioningStateValid), - // AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeGcpCredentials), - // GrantedPermissions: []*armsecurity.PermissionProperty{ - // to.Ptr(armsecurity.PermissionPropertyGCPSecurityCenterAdminViewer)}, - // Type: to.Ptr(""), - // AuthProviderX509CertURL: to.Ptr(""), - // AuthURI: to.Ptr(""), - // ClientEmail: to.Ptr(""), - // ClientID: to.Ptr(""), - // ClientX509CertURL: to.Ptr(""), - // OrganizationID: to.Ptr("AscDemoOrg"), - // PrivateKey: to.Ptr(""), - // PrivateKeyID: to.Ptr(""), - // ProjectID: to.Ptr(""), - // TokenURI: to.Ptr(""), - // }, - // HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - // AutoProvision: to.Ptr(armsecurity.AutoProvisionOff), - // HybridComputeProvisioningState: to.Ptr(armsecurity.HybridComputeProvisioningStateInvalid), - // Region: to.Ptr(""), - // ResourceGroupName: to.Ptr(""), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/GetConnectorSubscription_example.json -func ExampleAccountConnectorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccountConnectorsClient().Get(ctx, "aws_dev1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectorSetting = armsecurity.ConnectorSetting{ - // Name: to.Ptr("aws_dev1"), - // Type: to.Ptr("Microsoft.Security/connectors"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/connectors/aws_dev1"), - // Properties: &armsecurity.ConnectorSettingProperties{ - // AuthenticationDetails: &armsecurity.AwsCredsAuthenticationDetailsProperties{ - // AuthenticationProvisioningState: to.Ptr(armsecurity.AuthenticationProvisioningStateValid), - // AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeAwsCreds), - // GrantedPermissions: []*armsecurity.PermissionProperty{ - // to.Ptr(armsecurity.PermissionPropertyAWSAWSSecurityHubReadOnlyAccess), - // to.Ptr(armsecurity.PermissionPropertyAWSSecurityAudit), - // to.Ptr(armsecurity.PermissionPropertyAWSAmazonSSMAutomationRole)}, - // AccountID: to.Ptr("922315681122"), - // AwsAccessKeyID: to.Ptr(""), - // AwsSecretAccessKey: to.Ptr(""), - // }, - // HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - // AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - // HybridComputeProvisioningState: to.Ptr(armsecurity.HybridComputeProvisioningStateValid), - // ProxyServer: &armsecurity.ProxyServerProperties{ - // IP: to.Ptr("287.221.107.152"), - // Port: to.Ptr("34"), - // }, - // Region: to.Ptr("West US 2"), - // ResourceGroupName: to.Ptr("AwsConnectorRG"), - // ServicePrincipal: &armsecurity.ServicePrincipalProperties{ - // ApplicationID: to.Ptr("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/CreateUpdateAwsAssumeRoleConnectorSubscription_example.json -func ExampleAccountConnectorsClient_CreateOrUpdate_awsAssumeRoleCreateACloudAccountConnectorForASubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccountConnectorsClient().CreateOrUpdate(ctx, "aws_dev2", armsecurity.ConnectorSetting{ - Properties: &armsecurity.ConnectorSettingProperties{ - AuthenticationDetails: &armsecurity.AwAssumeRoleAuthenticationDetailsProperties{ - AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeAwsAssumeRole), - AwsAssumeRoleArn: to.Ptr("arn:aws:iam::81231569658:role/AscConnector"), - AwsExternalID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - }, - HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - ProxyServer: &armsecurity.ProxyServerProperties{ - IP: to.Ptr("167.220.197.140"), - Port: to.Ptr("34"), - }, - Region: to.Ptr("West US 2"), - ResourceGroupName: to.Ptr("AwsConnectorRG"), - ServicePrincipal: &armsecurity.ServicePrincipalProperties{ - ApplicationID: to.Ptr("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1"), - Secret: to.Ptr(""), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectorSetting = armsecurity.ConnectorSetting{ - // Name: to.Ptr("aws_dev2"), - // Type: to.Ptr("Microsoft.Security/connectors"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/connectors/aws_dev2"), - // Properties: &armsecurity.ConnectorSettingProperties{ - // AuthenticationDetails: &armsecurity.AwAssumeRoleAuthenticationDetailsProperties{ - // AuthenticationProvisioningState: to.Ptr(armsecurity.AuthenticationProvisioningStateValid), - // AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeAwsAssumeRole), - // GrantedPermissions: []*armsecurity.PermissionProperty{ - // to.Ptr(armsecurity.PermissionPropertyAWSAWSSecurityHubReadOnlyAccess), - // to.Ptr(armsecurity.PermissionPropertyAWSSecurityAudit), - // to.Ptr(armsecurity.PermissionPropertyAWSAmazonSSMAutomationRole)}, - // AccountID: to.Ptr("81231569658"), - // AwsAssumeRoleArn: to.Ptr("arn:aws:iam::81231569658:role/AscConnector"), - // AwsExternalID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }, - // HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - // AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - // HybridComputeProvisioningState: to.Ptr(armsecurity.HybridComputeProvisioningStateValid), - // ProxyServer: &armsecurity.ProxyServerProperties{ - // IP: to.Ptr("167.220.197.140"), - // Port: to.Ptr("34"), - // }, - // Region: to.Ptr("West US 2"), - // ResourceGroupName: to.Ptr("AwsConnectorRG"), - // ServicePrincipal: &armsecurity.ServicePrincipalProperties{ - // ApplicationID: to.Ptr("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/CreateUpdateAwsCredConnectorSubscription_example.json -func ExampleAccountConnectorsClient_CreateOrUpdate_awsCredCreateACloudAccountConnectorForASubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccountConnectorsClient().CreateOrUpdate(ctx, "aws_dev1", armsecurity.ConnectorSetting{ - Properties: &armsecurity.ConnectorSettingProperties{ - AuthenticationDetails: &armsecurity.AwsCredsAuthenticationDetailsProperties{ - AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeAwsCreds), - AwsAccessKeyID: to.Ptr("AKIARPZCNODDNAEQFSOE"), - AwsSecretAccessKey: to.Ptr(""), - }, - HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - ProxyServer: &armsecurity.ProxyServerProperties{ - IP: to.Ptr("167.220.197.140"), - Port: to.Ptr("34"), - }, - Region: to.Ptr("West US 2"), - ResourceGroupName: to.Ptr("AwsConnectorRG"), - ServicePrincipal: &armsecurity.ServicePrincipalProperties{ - ApplicationID: to.Ptr("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1"), - Secret: to.Ptr(""), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectorSetting = armsecurity.ConnectorSetting{ - // Name: to.Ptr("aws_dev1"), - // Type: to.Ptr("Microsoft.Security/connectors"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/connectors/aws_dev1"), - // Properties: &armsecurity.ConnectorSettingProperties{ - // AuthenticationDetails: &armsecurity.AwsCredsAuthenticationDetailsProperties{ - // AuthenticationProvisioningState: to.Ptr(armsecurity.AuthenticationProvisioningStateValid), - // AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeAwsCreds), - // GrantedPermissions: []*armsecurity.PermissionProperty{ - // to.Ptr(armsecurity.PermissionPropertyAWSAWSSecurityHubReadOnlyAccess), - // to.Ptr(armsecurity.PermissionPropertyAWSSecurityAudit), - // to.Ptr(armsecurity.PermissionPropertyAWSAmazonSSMAutomationRole)}, - // AccountID: to.Ptr("922315681122"), - // AwsAccessKeyID: to.Ptr(""), - // AwsSecretAccessKey: to.Ptr(""), - // }, - // HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - // AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - // HybridComputeProvisioningState: to.Ptr(armsecurity.HybridComputeProvisioningStateValid), - // ProxyServer: &armsecurity.ProxyServerProperties{ - // IP: to.Ptr("287.221.107.152"), - // Port: to.Ptr("34"), - // }, - // Region: to.Ptr("West US 2"), - // ResourceGroupName: to.Ptr("AwsConnectorRG"), - // ServicePrincipal: &armsecurity.ServicePrincipalProperties{ - // ApplicationID: to.Ptr("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/CreateUpdateGcpCredentialsConnectorSubscription_example.json -func ExampleAccountConnectorsClient_CreateOrUpdate_gcpCredentialsCreateACloudAccountConnectorForASubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccountConnectorsClient().CreateOrUpdate(ctx, "gcp_dev", armsecurity.ConnectorSetting{ - Properties: &armsecurity.ConnectorSettingProperties{ - AuthenticationDetails: &armsecurity.GcpCredentialsDetailsProperties{ - AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeGcpCredentials), - Type: to.Ptr("service_account"), - AuthProviderX509CertURL: to.Ptr("https://www.googleapis.com/oauth2/v1/certs"), - AuthURI: to.Ptr("https://accounts.google.com/o/oauth2/auth"), - ClientEmail: to.Ptr("asc-135@asc-project-1234.iam.gserviceaccount.com"), - ClientID: to.Ptr("105889053725632919854"), - ClientX509CertURL: to.Ptr("https://www.googleapis.com/robot/v1/metadata/x509/asc-135%40asc-project-1234.iam.gserviceaccount.com"), - OrganizationID: to.Ptr("AscDemoOrg"), - PrivateKey: to.Ptr("-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCpxYHcLzcDZ6/Q\nAeQZnQXM5GTb3p09Xsbjo2T2F61b6I7FZiQXBrbw3Zf0CUCkkqTTpD5xifl82yQ6\n89V7SAe8hxI7esAcVDhm/aJMqzVjHLISAU2L3li1sn0jjY2oYtndwN6bRivP8O6t\n9F+W6E0zMlbCxtpZEHLbb6WxlJJrwEQ0MPH2yOCwZUQi6NHksAtEzX2nNKJNyUC7\nQyBVHHMm34H2bmZwsuQp3y2otpcJ9tJnVmYfC3k/w4x2L+DIK7JnQP/C1wQqu2du\nc0w6sydF6RhLoHButrVdYRJTdfK4k03SsSTyMqZ+f7LNnKw3xenzw1VmEpk8mvoQ\nt08tCBOrAgMBAAECggEAByzz6iyMtLYjNjV+QJ7kad6VbL2iA8AHxANZ9xTVHPdd\nYXaJu/dqsA+NpqDlfI8+LDva782XH/HbPCqmMUnAGfXTjXQIvqnIoIHD5F2wKfpC\nhIRNlMXXFgbvRxtqi11yO+80+XcjzuwuCmgzyhsTeEB+bkkdXXpWgHPdmv3emnM6\nMQM9Zgrug0Und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ATE KEY-----\n"), - PrivateKeyID: to.Ptr("6efg587hra2568as34d22326b044cc20dc2af"), - ProjectID: to.Ptr("asc-project-1234"), - TokenURI: to.Ptr("https://oauth2.googleapis.com/token"), - }, - HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - AutoProvision: to.Ptr(armsecurity.AutoProvisionOff), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectorSetting = armsecurity.ConnectorSetting{ - // Name: to.Ptr("gcp_dev"), - // Type: to.Ptr("Microsoft.Security/connectors"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/connectors/gcp_dev"), - // Properties: &armsecurity.ConnectorSettingProperties{ - // AuthenticationDetails: &armsecurity.GcpCredentialsDetailsProperties{ - // AuthenticationProvisioningState: to.Ptr(armsecurity.AuthenticationProvisioningStateValid), - // AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeGcpCredentials), - // GrantedPermissions: []*armsecurity.PermissionProperty{ - // to.Ptr(armsecurity.PermissionPropertyGCPSecurityCenterAdminViewer)}, - // Type: to.Ptr(""), - // AuthProviderX509CertURL: to.Ptr(""), - // AuthURI: to.Ptr(""), - // ClientEmail: to.Ptr(""), - // ClientID: to.Ptr(""), - // ClientX509CertURL: to.Ptr(""), - // OrganizationID: to.Ptr("AscDemoOrg"), - // PrivateKey: to.Ptr(""), - // PrivateKeyID: to.Ptr(""), - // ProjectID: to.Ptr(""), - // TokenURI: to.Ptr(""), - // }, - // HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - // AutoProvision: to.Ptr(armsecurity.AutoProvisionOff), - // HybridComputeProvisioningState: to.Ptr(armsecurity.HybridComputeProvisioningStateInvalid), - // Region: to.Ptr(""), - // ResourceGroupName: to.Ptr(""), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/DeleteConnectorSubscription_example.json -func ExampleAccountConnectorsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAccountConnectorsClient().Delete(ctx, "aws_dev1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/adaptiveapplicationcontrols_client_example_test.go b/sdk/resourcemanager/security/armsecurity/adaptiveapplicationcontrols_client_example_test.go deleted file mode 100644 index 90af6a7d767a..000000000000 --- a/sdk/resourcemanager/security/armsecurity/adaptiveapplicationcontrols_client_example_test.go +++ /dev/null @@ -1,1321 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/GetAdaptiveApplicationControlsSubscription_example.json -func ExampleAdaptiveApplicationControlsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdaptiveApplicationControlsClient().List(ctx, &armsecurity.AdaptiveApplicationControlsClientListOptions{IncludePathRecommendations: to.Ptr(true), - Summary: to.Ptr(false), - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AdaptiveApplicationControlGroups = armsecurity.AdaptiveApplicationControlGroups{ - // Value: []*armsecurity.AdaptiveApplicationControlGroup{ - // { - // Location: to.Ptr("centralus"), - // Name: to.Ptr("AMIT-VA"), - // Type: to.Ptr("Microsoft.Security/applicationWhitelistings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/centralus/applicationWhitelistings/AMIT-VA"), - // Properties: &armsecurity.AdaptiveApplicationControlGroupData{ - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementMode: to.Ptr(armsecurity.EnforcementModeAudit), - // Issues: []*armsecurity.AdaptiveApplicationControlIssueSummary{ - // }, - // PathRecommendations: []*armsecurity.PathRecommendation{ - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("C:\\Windows\\SoftwareDistribution\\Download\\Install\\Windows-KB890830-x64-V5.53-delta.exe"), - // Action: to.Ptr(armsecurity.RecommendationActionRemove), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusNoStatus), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // UserSids: []*string{ - // to.Ptr("S-1-5-18")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("LOCAL SYSTEM"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("C:\\WindowsAzure\\GuestAgent_2.7.1198.822\\CollectGuestLogs.exe"), - // Action: to.Ptr(armsecurity.RecommendationActionRemove), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusNoStatus), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // UserSids: []*string{ - // to.Ptr("S-1-5-18")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("LOCAL SYSTEM"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("PublisherSignature")), - // Path: to.Ptr("C:\\Windows\\System32\\wbem\\WmiPrvSE.exe"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("*"), - // PublisherName: to.Ptr("O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-5-18"), - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("Everyone"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("%OSDRIVE%\\WINDOWSAZURE\\SECAGENT\\WASECAGENTPROV.EXE"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("Everyone"), - // }}, - // }}, - // ProtectionMode: &armsecurity.ProtectionMode{ - // Exe: to.Ptr(armsecurity.EnforcementModeAudit), - // Msi: to.Ptr(armsecurity.EnforcementModeAudit), - // Script: to.Ptr(armsecurity.EnforcementModeNone), - // }, - // RecommendationStatus: to.Ptr(armsecurity.RecommendationStatusRecommended), - // SourceSystem: to.Ptr(armsecurity.SourceSystemAzureAppLocker), - // VMRecommendations: []*armsecurity.VMRecommendation{ - // { - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportSupported), - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/erelh-dsc/providers/microsoft.compute/virtualmachines/erelh-14011"), - // }, - // { - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportSupported), - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/amit-va/providers/microsoft.compute/virtualmachines/ream-test"), - // }, - // { - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportSupported), - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/v-arrikl-scheduledapps/providers/microsoft.compute/virtualmachines/v-arrikl-14060"), - // }}, - // }, - // }, - // { - // Location: to.Ptr("centralus"), - // Name: to.Ptr("ERELGROUP1"), - // Type: to.Ptr("Microsoft.Security/applicationWhitelistings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/centralus/applicationWhitelistings/ERELGROUP1"), - // Properties: &armsecurity.AdaptiveApplicationControlGroupData{ - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementMode: to.Ptr(armsecurity.EnforcementModeAudit), - // Issues: []*armsecurity.AdaptiveApplicationControlIssueSummary{ - // }, - // PathRecommendations: []*armsecurity.PathRecommendation{ - // { - // Type: to.Ptr(armsecurity.RecommendationType("PublisherSignature")), - // Path: to.Ptr("[Exe] O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US\\*\\*\\0.0.0.0"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("*"), - // PublisherName: to.Ptr("O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("Everyone"), - // }}, - // }}, - // ProtectionMode: &armsecurity.ProtectionMode{ - // Exe: to.Ptr(armsecurity.EnforcementModeAudit), - // Msi: to.Ptr(armsecurity.EnforcementModeNone), - // Script: to.Ptr(armsecurity.EnforcementModeNone), - // }, - // RecommendationStatus: to.Ptr(armsecurity.RecommendationStatusRecommended), - // SourceSystem: to.Ptr(armsecurity.SourceSystemAzureAppLocker), - // VMRecommendations: []*armsecurity.VMRecommendation{ - // { - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportNotSupported), - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/erelh-stable/providers/microsoft.compute/virtualmachines/erelh-16090"), - // }}, - // }, - // }, - // { - // Location: to.Ptr("centralus"), - // Name: to.Ptr("GROUP1"), - // Type: to.Ptr("Microsoft.Security/applicationWhitelistings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/centralus/applicationWhitelistings/GROUP1"), - // Properties: &armsecurity.AdaptiveApplicationControlGroupData{ - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementMode: to.Ptr(armsecurity.EnforcementModeAudit), - // Issues: []*armsecurity.AdaptiveApplicationControlIssueSummary{ - // }, - // PathRecommendations: []*armsecurity.PathRecommendation{ - // { - // Type: to.Ptr(armsecurity.RecommendationType("PublisherSignature")), - // Path: to.Ptr("[Exe] O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US\\*\\*\\0.0.0.0"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("*"), - // PublisherName: to.Ptr("O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("Everyone"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("ProductSignature")), - // Path: to.Ptr("%OSDRIVE%\\WINDOWSAZURE\\SECAGENT\\WASECAGENTPROV.EXE"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("MICROSOFT® COREXT"), - // PublisherName: to.Ptr("CN=MICROSOFT AZURE DEPENDENCY CODE SIGN"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("NT AUTHORITY\\SYSTEM"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("PublisherSignature")), - // Path: to.Ptr("%PROGRAMFILES%\\RAPID7\\INSIGHT AGENT\\COMPONENTS\\INSIGHT_AGENT\\2.6.7.9\\GET_PROXY.EXE"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("*"), - // PublisherName: to.Ptr("O=RAPID7 LLC, L=BOSTON, S=MASSACHUSETTS, C=US"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("NT AUTHORITY\\SYSTEM"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("ProductSignature")), - // Path: to.Ptr("%PROGRAMFILES%\\GOOGLE\\CHROME\\APPLICATION\\CHROME.EXE"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("GOOGLE CHROME"), - // PublisherName: to.Ptr("O=GOOGLE LLC, L=MOUNTAIN VIEW, S=CA, C=US"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("NT AUTHORITY\\SYSTEM"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("ProductSignature")), - // Path: to.Ptr("O=GOOGLE INC, L=MOUNTAIN VIEW, S=CALIFORNIA, C=US\\GOOGLE UPDATE\\*\\0.0.0.0"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("GOOGLE UPDATE"), - // PublisherName: to.Ptr("O=GOOGLE INC, L=MOUNTAIN VIEW, S=CALIFORNIA, C=US"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("NT AUTHORITY\\SYSTEM"), - // }}, - // }}, - // ProtectionMode: &armsecurity.ProtectionMode{ - // Exe: to.Ptr(armsecurity.EnforcementModeAudit), - // Msi: to.Ptr(armsecurity.EnforcementModeNone), - // Script: to.Ptr(armsecurity.EnforcementModeNone), - // }, - // RecommendationStatus: to.Ptr(armsecurity.RecommendationStatusRecommended), - // SourceSystem: to.Ptr(armsecurity.SourceSystemAzureAppLocker), - // VMRecommendations: []*armsecurity.VMRecommendation{ - // { - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportSupported), - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/talk-va/providers/microsoft.compute/virtualmachines/tal-win-vm"), - // }, - // { - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportSupported), - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/talk-va/providers/microsoft.compute/virtualmachines/tal-win-vm-jit"), - // }, - // { - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportSupported), - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/myresourcegroup/providers/microsoft.compute/virtualmachines/myvmweb"), - // }, - // { - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportSupported), - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/v-arrikl-scheduledapps/providers/microsoft.compute/virtualmachines/v-arrikl-14061"), - // }}, - // }, - // }, - // { - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("GROUP1"), - // Type: to.Ptr("Microsoft.Security/applicationWhitelistings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/westeurope/applicationWhitelistings/GROUP1"), - // Properties: &armsecurity.AdaptiveApplicationControlGroupData{ - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementMode: to.Ptr(armsecurity.EnforcementModeAudit), - // Issues: []*armsecurity.AdaptiveApplicationControlIssueSummary{ - // { - // Issue: to.Ptr(armsecurity.AdaptiveApplicationControlIssueExecutableViolationsAudited), - // NumberOfVMs: to.Ptr[float32](1), - // }}, - // PathRecommendations: []*armsecurity.PathRecommendation{ - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/sbin/init"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/sbin/upstart-udev-bridge"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/lib/systemd/systemd-udevd"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/sbin/upstart-socket-bridge"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/sbin/dhclient"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/bin/python3.4"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/sbin/upstart-file-bridge"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/bin/dbus-daemon"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("messagebus"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/lib/systemd/systemd-logind"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/sbin/getty"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/sbin/atd"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/sbin/cron"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/sbin/acpid"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/sbin/sshd"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/lib/linux-lts-xenial-tools-4.4.0-103/hv_vss_daemon"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/lib/linux-lts-xenial-tools-4.4.0-103/hv_kvp_daemon"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/sbin/nscd"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("unscd"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/sbin/ntpd"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("ntp"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/opt/microsoft/auoms/bin/auomscollect"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/opt/omi/bin/omiserver"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/opt/omi/bin/omiengine"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("omi"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/opt/omi/bin/omiagent"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/sbin/rsyslogd"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("syslog"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/bin/python2.7"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }, - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("omsagent"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/opt/microsoft/omsagent/ruby/bin/ruby"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("omsagent"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/opt/microsoft/auoms/bin/auoms"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/local/qualys/cloud-agent/bin/qualys-cloud-agent"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/bin/dash"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("omsagent"), - // }, - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/bin/sleep"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("omsagent"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/opt/dsc/bin/dsc_host"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(false), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("omsagent"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/bin/sudo"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(false), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/bin/bash"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(false), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/bin/apt-get"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(false), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/lib/apt/methods/http"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(false), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/lib/apt/methods/gpgv"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(false), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/lib/apt/methods/copy"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(false), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/bin/pgrep"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("omsagent"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/opt/microsoft/omsconfig/bin/omsconsistencyinvoker"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(false), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("omsagent"), - // }}, - // }}, - // ProtectionMode: &armsecurity.ProtectionMode{ - // Executable: to.Ptr(armsecurity.EnforcementModeAudit), - // }, - // RecommendationStatus: to.Ptr(armsecurity.RecommendationStatusRecommended), - // SourceSystem: to.Ptr(armsecurity.SourceSystemAzureAuditD), - // VMRecommendations: []*armsecurity.VMRecommendation{ - // { - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportUnknown), - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/nic-no-pip/providers/microsoft.compute/virtualmachines/nic-no-pip-vm"), - // }}, - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/GetAdaptiveApplicationControlsGroup_example.json -func ExampleAdaptiveApplicationControlsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdaptiveApplicationControlsClient().Get(ctx, "centralus", "ERELGROUP1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AdaptiveApplicationControlGroup = armsecurity.AdaptiveApplicationControlGroup{ - // Location: to.Ptr("centralus"), - // Name: to.Ptr("ERELGROUP1"), - // Type: to.Ptr("Microsoft.Security/applicationWhitelistings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/centralus/applicationWhitelistings/ERELGROUP1"), - // Properties: &armsecurity.AdaptiveApplicationControlGroupData{ - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementMode: to.Ptr(armsecurity.EnforcementModeAudit), - // Issues: []*armsecurity.AdaptiveApplicationControlIssueSummary{ - // }, - // PathRecommendations: []*armsecurity.PathRecommendation{ - // { - // Type: to.Ptr(armsecurity.RecommendationType("PublisherSignature")), - // Path: to.Ptr("[Exe] O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US\\*\\*\\0.0.0.0"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("*"), - // PublisherName: to.Ptr("O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("Everyone"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("ProductSignature")), - // Path: to.Ptr("%OSDRIVE%\\WINDOWSAZURE\\SECAGENT\\WASECAGENTPROV.EXE"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("MICROSOFT® COREXT"), - // PublisherName: to.Ptr("CN=MICROSOFT AZURE DEPENDENCY CODE SIGN"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("NT AUTHORITY\\SYSTEM"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("PublisherSignature")), - // Path: to.Ptr("%OSDRIVE%\\WINDOWSAZURE\\PACKAGES_201973_7415\\COLLECTGUESTLOGS.EXE"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("*"), - // PublisherName: to.Ptr("CN=MICROSOFT AZURE DEPENDENCY CODE SIGN"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("NT AUTHORITY\\SYSTEM"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("C:\\directory\\file.exe"), - // Action: to.Ptr(armsecurity.RecommendationActionAdd), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("Everyone"), - // }}, - // }}, - // ProtectionMode: &armsecurity.ProtectionMode{ - // Exe: to.Ptr(armsecurity.EnforcementModeAudit), - // Msi: to.Ptr(armsecurity.EnforcementModeAudit), - // Script: to.Ptr(armsecurity.EnforcementModeNone), - // }, - // RecommendationStatus: to.Ptr(armsecurity.RecommendationStatusRecommended), - // SourceSystem: to.Ptr(armsecurity.SourceSystemAzureAppLocker), - // VMRecommendations: []*armsecurity.VMRecommendation{ - // { - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportSupported), - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/erelh-stable/providers/microsoft.compute/virtualmachines/erelh-16090"), - // }, - // { - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportSupported), - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/matanvs/providers/microsoft.compute/virtualmachines/matanvs19"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/PutAdaptiveApplicationControls_example.json -func ExampleAdaptiveApplicationControlsClient_Put() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdaptiveApplicationControlsClient().Put(ctx, "centralus", "ERELGROUP1", armsecurity.AdaptiveApplicationControlGroup{ - Properties: &armsecurity.AdaptiveApplicationControlGroupData{ - EnforcementMode: to.Ptr(armsecurity.EnforcementModeAudit), - PathRecommendations: []*armsecurity.PathRecommendation{ - { - Type: to.Ptr(armsecurity.RecommendationType("PublisherSignature")), - Path: to.Ptr("[Exe] O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US\\*\\*\\0.0.0.0"), - Action: to.Ptr(armsecurity.RecommendationActionRecommended), - Common: to.Ptr(true), - ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - FileType: to.Ptr(armsecurity.FileTypeExe), - PublisherInfo: &armsecurity.PublisherInfo{ - BinaryName: to.Ptr("*"), - ProductName: to.Ptr("*"), - PublisherName: to.Ptr("O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US"), - Version: to.Ptr("0.0.0.0"), - }, - UserSids: []*string{ - to.Ptr("S-1-1-0")}, - Usernames: []*armsecurity.UserRecommendation{ - { - RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - Username: to.Ptr("Everyone"), - }}, - }, - { - Type: to.Ptr(armsecurity.RecommendationType("ProductSignature")), - Path: to.Ptr("%OSDRIVE%\\WINDOWSAZURE\\SECAGENT\\WASECAGENTPROV.EXE"), - Action: to.Ptr(armsecurity.RecommendationActionRecommended), - Common: to.Ptr(true), - ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - FileType: to.Ptr(armsecurity.FileTypeExe), - PublisherInfo: &armsecurity.PublisherInfo{ - BinaryName: to.Ptr("*"), - ProductName: to.Ptr("MICROSOFT® COREXT"), - PublisherName: to.Ptr("CN=MICROSOFT AZURE DEPENDENCY CODE SIGN"), - Version: to.Ptr("0.0.0.0"), - }, - UserSids: []*string{ - to.Ptr("S-1-1-0")}, - Usernames: []*armsecurity.UserRecommendation{ - { - RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - Username: to.Ptr("NT AUTHORITY\\SYSTEM"), - }}, - }, - { - Type: to.Ptr(armsecurity.RecommendationType("PublisherSignature")), - Path: to.Ptr("%OSDRIVE%\\WINDOWSAZURE\\PACKAGES_201973_7415\\COLLECTGUESTLOGS.EXE"), - Action: to.Ptr(armsecurity.RecommendationActionRecommended), - Common: to.Ptr(true), - ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - FileType: to.Ptr(armsecurity.FileTypeExe), - PublisherInfo: &armsecurity.PublisherInfo{ - BinaryName: to.Ptr("*"), - ProductName: to.Ptr("*"), - PublisherName: to.Ptr("CN=MICROSOFT AZURE DEPENDENCY CODE SIGN"), - Version: to.Ptr("0.0.0.0"), - }, - UserSids: []*string{ - to.Ptr("S-1-1-0")}, - Usernames: []*armsecurity.UserRecommendation{ - { - RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - Username: to.Ptr("NT AUTHORITY\\SYSTEM"), - }}, - }, - { - Type: to.Ptr(armsecurity.RecommendationType("File")), - Path: to.Ptr("C:\\directory\\file.exe"), - Action: to.Ptr(armsecurity.RecommendationActionAdd), - Common: to.Ptr(true), - }}, - ProtectionMode: &armsecurity.ProtectionMode{ - Exe: to.Ptr(armsecurity.EnforcementModeAudit), - Msi: to.Ptr(armsecurity.EnforcementModeNone), - Script: to.Ptr(armsecurity.EnforcementModeNone), - }, - VMRecommendations: []*armsecurity.VMRecommendation{ - { - ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportSupported), - RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/erelh-stable/providers/microsoft.compute/virtualmachines/erelh-16090"), - }, - { - ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportSupported), - RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/matanvs/providers/microsoft.compute/virtualmachines/matanvs19"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AdaptiveApplicationControlGroup = armsecurity.AdaptiveApplicationControlGroup{ - // Location: to.Ptr("centralus"), - // Name: to.Ptr("ERELGROUP1"), - // Type: to.Ptr("Microsoft.Security/applicationWhitelistings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/centralus/applicationWhitelistings/ERELGROUP1"), - // Properties: &armsecurity.AdaptiveApplicationControlGroupData{ - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusInProgress), - // EnforcementMode: to.Ptr(armsecurity.EnforcementModeAudit), - // Issues: []*armsecurity.AdaptiveApplicationControlIssueSummary{ - // }, - // PathRecommendations: []*armsecurity.PathRecommendation{ - // { - // Type: to.Ptr(armsecurity.RecommendationType("PublisherSignature")), - // Path: to.Ptr("[Exe] O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US\\*\\*\\0.0.0.0"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("*"), - // PublisherName: to.Ptr("O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("Everyone"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("ProductSignature")), - // Path: to.Ptr("%OSDRIVE%\\WINDOWSAZURE\\SECAGENT\\WASECAGENTPROV.EXE"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("MICROSOFT® COREXT"), - // PublisherName: to.Ptr("CN=MICROSOFT AZURE DEPENDENCY CODE SIGN"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("NT AUTHORITY\\SYSTEM"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("PublisherSignature")), - // Path: to.Ptr("%OSDRIVE%\\WINDOWSAZURE\\PACKAGES_201973_7415\\COLLECTGUESTLOGS.EXE"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("*"), - // PublisherName: to.Ptr("CN=MICROSOFT AZURE DEPENDENCY CODE SIGN"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("NT AUTHORITY\\SYSTEM"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("C:\\directory\\file.exe"), - // Action: to.Ptr(armsecurity.RecommendationActionAdd), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusNotConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("Everyone"), - // }}, - // }}, - // ProtectionMode: &armsecurity.ProtectionMode{ - // Exe: to.Ptr(armsecurity.EnforcementModeAudit), - // Msi: to.Ptr(armsecurity.EnforcementModeNone), - // Script: to.Ptr(armsecurity.EnforcementModeNone), - // }, - // RecommendationStatus: to.Ptr(armsecurity.RecommendationStatusRecommended), - // SourceSystem: to.Ptr(armsecurity.SourceSystemAzureAppLocker), - // VMRecommendations: []*armsecurity.VMRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/erelh-stable/providers/microsoft.compute/virtualmachines/erelh-16090"), - // }, - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/matanvs/providers/microsoft.compute/virtualmachines/matanvs19"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/DeleteAdaptiveApplicationControls_example.json -func ExampleAdaptiveApplicationControlsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAdaptiveApplicationControlsClient().Delete(ctx, "centralus", "GROUP1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/adaptivenetworkhardenings_client_example_test.go b/sdk/resourcemanager/security/armsecurity/adaptivenetworkhardenings_client_example_test.go deleted file mode 100644 index 0c800cdda4e4..000000000000 --- a/sdk/resourcemanager/security/armsecurity/adaptivenetworkhardenings_client_example_test.go +++ /dev/null @@ -1,194 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/ListByExtendedResourceAdaptiveNetworkHardenings_example.json -func ExampleAdaptiveNetworkHardeningsClient_NewListByExtendedResourcePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAdaptiveNetworkHardeningsClient().NewListByExtendedResourcePager("rg1", "Microsoft.Compute", "virtualMachines", "vm1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AdaptiveNetworkHardeningsList = armsecurity.AdaptiveNetworkHardeningsList{ - // Value: []*armsecurity.AdaptiveNetworkHardening{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/adaptiveNetworkHardenings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Security/adaptiveNetworkHardenings/default"), - // Properties: &armsecurity.AdaptiveNetworkHardeningProperties{ - // EffectiveNetworkSecurityGroups: []*armsecurity.EffectiveNetworkSecurityGroups{ - // { - // NetworkInterface: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/rg1/providers/Microsoft.Network/networkInterfaces/nic1"), - // NetworkSecurityGroups: []*string{ - // to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nicNsg"), - // to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/subnetNsg")}, - // }, - // { - // NetworkInterface: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/rg1/providers/Microsoft.Network/networkInterfaces/nic2"), - // NetworkSecurityGroups: []*string{ - // to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nicNsg2")}, - // }}, - // Rules: []*armsecurity.Rule{ - // { - // Name: to.Ptr("rule1"), - // DestinationPort: to.Ptr[int32](3389), - // Direction: to.Ptr(armsecurity.DirectionInbound), - // IPAddresses: []*string{ - // to.Ptr("100.10.1.1"), - // to.Ptr("200.20.2.2"), - // to.Ptr("81.199.3.0/24")}, - // Protocols: []*armsecurity.TransportProtocol{ - // to.Ptr(armsecurity.TransportProtocolTCP)}, - // }, - // { - // Name: to.Ptr("rule2"), - // DestinationPort: to.Ptr[int32](22), - // Direction: to.Ptr(armsecurity.DirectionInbound), - // IPAddresses: []*string{ - // }, - // Protocols: []*armsecurity.TransportProtocol{ - // to.Ptr(armsecurity.TransportProtocolTCP)}, - // }}, - // RulesCalculationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-15T00:00:00.0000000Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/GetAdaptiveNetworkHardening_example.json -func ExampleAdaptiveNetworkHardeningsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdaptiveNetworkHardeningsClient().Get(ctx, "rg1", "Microsoft.Compute", "virtualMachines", "vm1", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AdaptiveNetworkHardening = armsecurity.AdaptiveNetworkHardening{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/adaptiveNetworkHardenings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Security/adaptiveNetworkHardenings/default"), - // Properties: &armsecurity.AdaptiveNetworkHardeningProperties{ - // EffectiveNetworkSecurityGroups: []*armsecurity.EffectiveNetworkSecurityGroups{ - // { - // NetworkInterface: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/rg1/providers/Microsoft.Network/networkInterfaces/nic1"), - // NetworkSecurityGroups: []*string{ - // to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nicNsg"), - // to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/subnetNsg")}, - // }, - // { - // NetworkInterface: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/rg2/providers/Microsoft.Network/networkInterfaces/nic2"), - // NetworkSecurityGroups: []*string{ - // to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nicNsg")}, - // }}, - // Rules: []*armsecurity.Rule{ - // { - // Name: to.Ptr("rule1"), - // DestinationPort: to.Ptr[int32](3389), - // Direction: to.Ptr(armsecurity.DirectionInbound), - // IPAddresses: []*string{ - // to.Ptr("100.10.1.1"), - // to.Ptr("200.20.2.2"), - // to.Ptr("81.199.3.0/24")}, - // Protocols: []*armsecurity.TransportProtocol{ - // to.Ptr(armsecurity.TransportProtocolTCP)}, - // }, - // { - // Name: to.Ptr("rule2"), - // DestinationPort: to.Ptr[int32](22), - // Direction: to.Ptr(armsecurity.DirectionInbound), - // IPAddresses: []*string{ - // }, - // Protocols: []*armsecurity.TransportProtocol{ - // to.Ptr(armsecurity.TransportProtocolTCP)}, - // }}, - // RulesCalculationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-15T00:00:00.0000000Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/EnforceAdaptiveNetworkHardeningRules_example.json -func ExampleAdaptiveNetworkHardeningsClient_BeginEnforce() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAdaptiveNetworkHardeningsClient().BeginEnforce(ctx, "rg1", "Microsoft.Compute", "virtualMachines", "vm1", "default", armsecurity.AdaptiveNetworkHardeningEnforceRequest{ - NetworkSecurityGroups: []*string{ - to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg2")}, - Rules: []*armsecurity.Rule{ - { - Name: to.Ptr("rule1"), - DestinationPort: to.Ptr[int32](3389), - Direction: to.Ptr(armsecurity.DirectionInbound), - IPAddresses: []*string{ - to.Ptr("100.10.1.1"), - to.Ptr("200.20.2.2"), - to.Ptr("81.199.3.0/24")}, - Protocols: []*armsecurity.TransportProtocol{ - to.Ptr(armsecurity.TransportProtocolTCP)}, - }, - { - Name: to.Ptr("rule2"), - DestinationPort: to.Ptr[int32](22), - Direction: to.Ptr(armsecurity.DirectionInbound), - IPAddresses: []*string{}, - Protocols: []*armsecurity.TransportProtocol{ - to.Ptr(armsecurity.TransportProtocolTCP)}, - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/advancedthreatprotection_client_example_test.go b/sdk/resourcemanager/security/armsecurity/advancedthreatprotection_client_example_test.go deleted file mode 100644 index ec282bd89c7b..000000000000 --- a/sdk/resourcemanager/security/armsecurity/advancedthreatprotection_client_example_test.go +++ /dev/null @@ -1,82 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/AdvancedThreatProtection/GetAdvancedThreatProtectionSettings_example.json -func ExampleAdvancedThreatProtectionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdvancedThreatProtectionClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AdvancedThreatProtectionSetting = armsecurity.AdvancedThreatProtectionSetting{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Security/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/advancedThreatProtectionSettings/current"), - // Properties: &armsecurity.AdvancedThreatProtectionProperties{ - // IsEnabled: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/AdvancedThreatProtection/PutAdvancedThreatProtectionSettings_example.json -func ExampleAdvancedThreatProtectionClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdvancedThreatProtectionClient().Create(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", armsecurity.AdvancedThreatProtectionSetting{ - Name: to.Ptr("current"), - Type: to.Ptr("Microsoft.Security/advancedThreatProtectionSettings"), - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/advancedThreatProtectionSettings/current"), - Properties: &armsecurity.AdvancedThreatProtectionProperties{ - IsEnabled: to.Ptr(true), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AdvancedThreatProtectionSetting = armsecurity.AdvancedThreatProtectionSetting{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Security/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/advancedThreatProtectionSettings/current"), - // Properties: &armsecurity.AdvancedThreatProtectionProperties{ - // IsEnabled: to.Ptr(true), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/alerts_client_example_test.go b/sdk/resourcemanager/security/armsecurity/alerts_client_example_test.go deleted file mode 100644 index 0cecb0011ba7..000000000000 --- a/sdk/resourcemanager/security/armsecurity/alerts_client_example_test.go +++ /dev/null @@ -1,1464 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertsSubscription_example.json -func ExampleAlertsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAlertsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AlertList = armsecurity.AlertList{ - // Value: []*armsecurity.Alert{ - // { - // Name: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Type: to.Ptr("Microsoft.Security/Locations/alerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/alerts/2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA"), - // Properties: &armsecurity.AlertProperties{ - // Description: to.Ptr("This is a test alert generated by Azure Security Center. No further action is needed."), - // AlertDisplayName: to.Ptr("Azure Security Center test alert (not a threat)"), - // AlertType: to.Ptr("VM_EICAR"), - // AlertURI: to.Ptr("https://portal.azure.com/#blade/Microsoft_Azure_Security/AlertBlade/alertId/2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a/subscriptionId/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroup/myRg1/referencedFrom/alertDeepLink/location/westeurope"), - // CompromisedEntity: to.Ptr("vm1"), - // CorrelationKey: to.Ptr("kso0LFWxzCll5tqrk5hmrBJ+MY1BX806W6q6+0s9Lk="), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.0000000Z"); return t}()), - // Entities: []*armsecurity.AlertEntity{ - // { - // AdditionalProperties: map[string]any{ - // "address": "192.0.2.1", - // "location": map[string]any{ - // "asn": float64(6584), - // "city": "sonning", - // "countryCode": "gb", - // "latitude": float64(51.468), - // "longitude": float64(-0.909), - // "state": "wokingham", - // }, - // }, - // Type: to.Ptr("ip"), - // }}, - // ExtendedLinks: []map[string]*string{ - // map[string]*string{ - // "Category": to.Ptr("threat_reports"), - // "Href": to.Ptr("https://contoso.com/reports/DisplayReport"), - // "Label": to.Ptr("Report: RDP Brute Forcing"), - // "Type": to.Ptr("webLink"), - // }}, - // ExtendedProperties: map[string]*string{ - // "Property1": to.Ptr("Property1 information"), - // }, - // Intent: to.Ptr(armsecurity.IntentExecution), - // IsIncident: to.Ptr(true), - // ProcessingEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.9205584Z"); return t}()), - // ProductComponentName: to.Ptr("testName"), - // ProductName: to.Ptr("Azure Security Center"), - // RemediationSteps: []*string{ - // to.Ptr("No further action is needed.")}, - // ResourceIdentifiers: []armsecurity.ResourceIdentifierClassification{ - // &armsecurity.AzureResourceIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeAzureResource), - // AzureResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // &armsecurity.LogAnalyticsIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeLogAnalytics), - // AgentID: to.Ptr("75724a01-f021-4aa8-9ec2-329792373e6e"), - // WorkspaceID: to.Ptr("f419f624-acad-4d89-b86d-f62fa387f019"), - // WorkspaceResourceGroup: to.Ptr("myRg1"), - // WorkspaceSubscriptionID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }}, - // Severity: to.Ptr(armsecurity.AlertSeverityHigh), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.0000000Z"); return t}()), - // Status: to.Ptr(armsecurity.AlertStatusActive), - // SubTechniques: []*string{ - // to.Ptr("T1059.001"), - // to.Ptr("T1059.006"), - // to.Ptr("T1053.002")}, - // SupportingEvidence: &armsecurity.AlertPropertiesSupportingEvidence{ - // AdditionalProperties: map[string]any{ - // "columns": []any{ - // "Date", - // "Activity", - // "User", - // "TestedText", - // "TestedValue", - // }, - // "rows": []any{ - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser2", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser3", - // "true", - // true, - // }, - // }, - // "title": "Investigate activity test", - // }, - // Type: to.Ptr("tabularEvidences"), - // }, - // SystemAlertID: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Techniques: []*string{ - // to.Ptr("T1059"), - // to.Ptr("T1053"), - // to.Ptr("T1072")}, - // TimeGeneratedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.0000000Z"); return t}()), - // VendorName: to.Ptr("Microsoft"), - // Version: to.Ptr("2022-01-01"), - // }, - // }, - // { - // Name: to.Ptr("2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22"), - // Type: to.Ptr("Microsoft.Security/Locations/alerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg2/providers/Microsoft.Security/locations/westeurope/alerts/2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22"), - // Properties: &armsecurity.AlertProperties{ - // Description: to.Ptr("The process ‘c:\\users\\contosoUser\\scrsave.scr’ was observed executing from an uncommon location. Files with the .scr extensions are screen saver files and are normally reside and execute from the Windows system directory."), - // AlertDisplayName: to.Ptr("Suspicious Screensaver process executed"), - // AlertType: to.Ptr("VM_SuspiciousScreenSaver"), - // AlertURI: to.Ptr("https://portal.azure.com/#blade/Microsoft_Azure_Security/AlertBlade/alertId/2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a/subscriptionId/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroup/myRg1/referencedFrom/alertDeepLink/location/westeurope"), - // CompromisedEntity: to.Ptr("vm2"), - // CorrelationKey: to.Ptr("4hno6LF0xzCl5tqrk4nrBW+MY1BX816W6q6+0srk4"), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T13:51:45.0045913Z"); return t}()), - // Entities: []*armsecurity.AlertEntity{ - // { - // AdditionalProperties: map[string]any{ - // "OsVersion": nil, - // "azureID": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/myRg2/providers/microsoft.compute/virtualmachines/vm2", - // "dnsDomain": "", - // "hostName": "vm2", - // "netBiosName": "vm2", - // "ntDomain": "", - // "omsAgentID": "45b44640-3b94-4892-a28c-4a5cae27065a", - // "operatingSystem": "Unknown", - // }, - // Type: to.Ptr("host"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "name": "contosoUser", - // "logonId": "0x61450d87", - // "ntDomain": "vm2", - // "sid": "S-1-5-21-2144575486-8928446540-5163864319-500", - // }, - // Type: to.Ptr("account"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "name": "cmd.exe", - // "directory": "c:\\windows\\system32", - // }, - // Type: to.Ptr("file"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "processId": "0x3c44", - // }, - // Type: to.Ptr("process"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "name": "scrsave.scr", - // "directory": "c:\\users\\contosoUser", - // }, - // Type: to.Ptr("file"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "commandLine": "c:\\users\\contosoUser\\scrsave.scr", - // "creationTimeUtc": "2018-05-07T13:51:45.0045913Z", - // "processId": "0x4aec", - // }, - // Type: to.Ptr("process"), - // }}, - // ExtendedLinks: []map[string]*string{ - // map[string]*string{ - // "Category": to.Ptr("threat_reports"), - // "Href": to.Ptr("https://contoso.com/reports/DisplayReport"), - // "Label": to.Ptr("Report: RDP Brute Forcing"), - // "Type": to.Ptr("webLink"), - // }}, - // ExtendedProperties: map[string]*string{ - // "account logon id": to.Ptr("0x61450d87"), - // "command line": to.Ptr("c:\\users\\contosoUser\\scrsave.scr"), - // "domain name": to.Ptr("vm2"), - // "parent process": to.Ptr("cmd.exe"), - // "parent process id": to.Ptr("0x3c44"), - // "process id": to.Ptr("0x4aec"), - // "process name": to.Ptr("c:\\users\\contosoUser\\scrsave.scr"), - // "resourceType": to.Ptr("Virtual Machine"), - // "user SID": to.Ptr("S-1-5-21-2144575486-8928446540-5163864319-500"), - // "user name": to.Ptr("vm2\\contosoUser"), - // }, - // Intent: to.Ptr(armsecurity.IntentExecution), - // IsIncident: to.Ptr(true), - // ProcessingEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T13:51:48.9810457Z"); return t}()), - // ProductComponentName: to.Ptr("testName2"), - // ProductName: to.Ptr("Azure Security Center"), - // RemediationSteps: []*string{ - // to.Ptr("1. Run Process Explorer and try to identify unknown running processes (see https://technet.microsoft.com/en-us/sysinternals/bb896653.aspx)"), - // to.Ptr("2. Make sure the machine is completely updated and has an updated anti-malware application installed"), - // to.Ptr("3. Run a full anti-malware scan and verify that the threat was removed"), - // to.Ptr("4. Install and run Microsoft’s Malicious Software Removal Tool (see https://www.microsoft.com/en-us/download/malicious-software-removal-tool-details.aspx)"), - // to.Ptr("5. Run Microsoft’s Autoruns utility and try to identify unknown applications that are configured to run at login (see https://technet.microsoft.com/en-us/sysinternals/bb963902.aspx)"), - // to.Ptr("6. Escalate the alert to the information security team")}, - // ResourceIdentifiers: []armsecurity.ResourceIdentifierClassification{ - // &armsecurity.AzureResourceIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeAzureResource), - // AzureResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // &armsecurity.LogAnalyticsIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeLogAnalytics), - // AgentID: to.Ptr("75724a01-f021-4aa8-9ec2-329792373e6e"), - // WorkspaceID: to.Ptr("f419f624-acad-4d89-b86d-f62fa387f019"), - // WorkspaceResourceGroup: to.Ptr("myRg1"), - // WorkspaceSubscriptionID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }}, - // Severity: to.Ptr(armsecurity.AlertSeverityMedium), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T13:51:45.0045913Z"); return t}()), - // Status: to.Ptr(armsecurity.AlertStatusActive), - // SubTechniques: []*string{ - // to.Ptr("T1059.001"), - // to.Ptr("T1059.006"), - // to.Ptr("T1053.002")}, - // SupportingEvidence: &armsecurity.AlertPropertiesSupportingEvidence{ - // AdditionalProperties: map[string]any{ - // "supportingEvidenceList": []any{ - // map[string]any{ - // "type": "nestedList", - // "evidenceElements":[]any{ - // map[string]any{ - // "type": "evidenceElement", - // "innerElements": nil, - // "text":map[string]any{ - // "arguments":map[string]any{ - // "domainName":map[string]any{ - // "type": "string", - // "value": "domainName", - // }, - // "sensitiveEnumerationTypes":map[string]any{ - // "type": "string[]", - // "value":[]any{ - // "UseDesKey", - // }, - // }, - // }, - // "fallback": "Actor enumerated UseDesKey on domain1.test.local", - // "localizationKey": "AATP_ALERTS_LDAP_SENSITIVE_ATTRIBUTE_RECONNAISSANCE_SECURITY_ALERT_EVIDENCE_ENUMERATION_DETAIL_A7C00BD7", - // }, - // }, - // }, - // }, - // map[string]any{ - // "type": "tabularEvidences", - // "columns":[]any{ - // "Date", - // "Activity", - // "User", - // "TestedText", - // "TestedValue", - // }, - // "rows":[]any{ - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser2", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser3", - // "true", - // true, - // }, - // }, - // "title": "Investigate activity test", - // }, - // }, - // }, - // Type: to.Ptr("supportingEvidenceList"), - // }, - // SystemAlertID: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Techniques: []*string{ - // to.Ptr("T1059"), - // to.Ptr("T1053"), - // to.Ptr("T1072")}, - // TimeGeneratedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T13:51:48.3810457Z"); return t}()), - // VendorName: to.Ptr("Microsoft"), - // Version: to.Ptr("2022-01-01"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertsResourceGroup_example.json -func ExampleAlertsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAlertsClient().NewListByResourceGroupPager("myRg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AlertList = armsecurity.AlertList{ - // Value: []*armsecurity.Alert{ - // { - // Name: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Type: to.Ptr("Microsoft.Security/Locations/alerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/alerts/2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA"), - // Properties: &armsecurity.AlertProperties{ - // Description: to.Ptr("This is a test alert generated by Azure Security Center. No further action is needed."), - // AlertDisplayName: to.Ptr("Azure Security Center test alert (not a threat)"), - // AlertType: to.Ptr("VM_EICAR"), - // AlertURI: to.Ptr("https://portal.azure.com/#blade/Microsoft_Azure_Security/AlertBlade/alertId/2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a/subscriptionId/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroup/myRg1/referencedFrom/alertDeepLink/location/westeurope"), - // CompromisedEntity: to.Ptr("vm1"), - // CorrelationKey: to.Ptr("kso0LFWxzCll5tqrk5hmrBJ+MY1BX806W6q6+0s9Lk="), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.0000000Z"); return t}()), - // Entities: []*armsecurity.AlertEntity{ - // { - // AdditionalProperties: map[string]any{ - // "address": "192.0.2.1", - // "location": map[string]any{ - // "asn": float64(6584), - // "city": "sonning", - // "countryCode": "gb", - // "latitude": float64(51.468), - // "longitude": float64(-0.909), - // "state": "wokingham", - // }, - // }, - // Type: to.Ptr("ip"), - // }}, - // ExtendedLinks: []map[string]*string{ - // map[string]*string{ - // "Category": to.Ptr("threat_reports"), - // "Href": to.Ptr("https://contoso.com/reports/DisplayReport"), - // "Label": to.Ptr("Report: RDP Brute Forcing"), - // "Type": to.Ptr("webLink"), - // }}, - // ExtendedProperties: map[string]*string{ - // "Property1": to.Ptr("Property1 information"), - // }, - // Intent: to.Ptr(armsecurity.IntentExecution), - // IsIncident: to.Ptr(true), - // ProcessingEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.9205584Z"); return t}()), - // ProductComponentName: to.Ptr("testName"), - // ProductName: to.Ptr("Azure Security Center"), - // RemediationSteps: []*string{ - // to.Ptr("No further action is needed.")}, - // ResourceIdentifiers: []armsecurity.ResourceIdentifierClassification{ - // &armsecurity.AzureResourceIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeAzureResource), - // AzureResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // &armsecurity.LogAnalyticsIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeLogAnalytics), - // AgentID: to.Ptr("75724a01-f021-4aa8-9ec2-329792373e6e"), - // WorkspaceID: to.Ptr("f419f624-acad-4d89-b86d-f62fa387f019"), - // WorkspaceResourceGroup: to.Ptr("myRg1"), - // WorkspaceSubscriptionID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }}, - // Severity: to.Ptr(armsecurity.AlertSeverityHigh), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.0000000Z"); return t}()), - // Status: to.Ptr(armsecurity.AlertStatusActive), - // SubTechniques: []*string{ - // to.Ptr("T1059.001"), - // to.Ptr("T1059.006"), - // to.Ptr("T1053.002")}, - // SupportingEvidence: &armsecurity.AlertPropertiesSupportingEvidence{ - // AdditionalProperties: map[string]any{ - // "supportingEvidenceList": []any{ - // map[string]any{ - // "type": "nestedList", - // "evidenceElements":[]any{ - // map[string]any{ - // "type": "evidenceElement", - // "innerElements": nil, - // "text":map[string]any{ - // "arguments":map[string]any{ - // "domainName":map[string]any{ - // "type": "string", - // "value": "domainName", - // }, - // "sensitiveEnumerationTypes":map[string]any{ - // "type": "string[]", - // "value":[]any{ - // "UseDesKey", - // }, - // }, - // }, - // "fallback": "Actor enumerated UseDesKey on domain1.test.local", - // "localizationKey": "AATP_ALERTS_LDAP_SENSITIVE_ATTRIBUTE_RECONNAISSANCE_SECURITY_ALERT_EVIDENCE_ENUMERATION_DETAIL_A7C00BD7", - // }, - // }, - // }, - // }, - // map[string]any{ - // "type": "tabularEvidences", - // "columns":[]any{ - // "Date", - // "Activity", - // "User", - // "TestedText", - // "TestedValue", - // }, - // "rows":[]any{ - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser2", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser3", - // "true", - // true, - // }, - // }, - // "title": "Investigate activity test", - // }, - // }, - // }, - // Type: to.Ptr("supportingEvidenceList"), - // }, - // SystemAlertID: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Techniques: []*string{ - // to.Ptr("T1059"), - // to.Ptr("T1053"), - // to.Ptr("T1072")}, - // TimeGeneratedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.0000000Z"); return t}()), - // VendorName: to.Ptr("Microsoft"), - // Version: to.Ptr("2022-01-01"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertsSubscriptionsLocation_example.json -func ExampleAlertsClient_NewListSubscriptionLevelByRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAlertsClient().NewListSubscriptionLevelByRegionPager("westeurope", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AlertList = armsecurity.AlertList{ - // Value: []*armsecurity.Alert{ - // { - // Name: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Type: to.Ptr("Microsoft.Security/Locations/alerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/alerts/2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA"), - // Properties: &armsecurity.AlertProperties{ - // Description: to.Ptr("This is a test alert generated by Azure Security Center. No further action is needed."), - // AlertDisplayName: to.Ptr("Azure Security Center test alert (not a threat)"), - // AlertType: to.Ptr("VM_EICAR"), - // AlertURI: to.Ptr("https://portal.azure.com/#blade/Microsoft_Azure_Security/AlertBlade/alertId/2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a/subscriptionId/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroup/myRg1/referencedFrom/alertDeepLink/location/westeurope"), - // CompromisedEntity: to.Ptr("vm1"), - // CorrelationKey: to.Ptr("kso0LFWxzCll5tqrk5hmrBJ+MY1BX806W6q6+0s9Lk="), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.0000000Z"); return t}()), - // Entities: []*armsecurity.AlertEntity{ - // { - // AdditionalProperties: map[string]any{ - // "address": "192.0.2.1", - // "location": map[string]any{ - // "asn": float64(6584), - // "city": "sonning", - // "countryCode": "gb", - // "latitude": float64(51.468), - // "longitude": float64(-0.909), - // "state": "wokingham", - // }, - // }, - // Type: to.Ptr("ip"), - // }}, - // ExtendedLinks: []map[string]*string{ - // map[string]*string{ - // "Category": to.Ptr("threat_reports"), - // "Href": to.Ptr("https://contoso.com/reports/DisplayReport"), - // "Label": to.Ptr("Report: RDP Brute Forcing"), - // "Type": to.Ptr("webLink"), - // }}, - // ExtendedProperties: map[string]*string{ - // "Property1": to.Ptr("Property1 information"), - // }, - // Intent: to.Ptr(armsecurity.IntentExecution), - // IsIncident: to.Ptr(true), - // ProcessingEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.9205584Z"); return t}()), - // ProductComponentName: to.Ptr("testName"), - // ProductName: to.Ptr("Azure Security Center"), - // RemediationSteps: []*string{ - // to.Ptr("No further action is needed.")}, - // ResourceIdentifiers: []armsecurity.ResourceIdentifierClassification{ - // &armsecurity.AzureResourceIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeAzureResource), - // AzureResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // &armsecurity.LogAnalyticsIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeLogAnalytics), - // AgentID: to.Ptr("75724a01-f021-4aa8-9ec2-329792373e6e"), - // WorkspaceID: to.Ptr("f419f624-acad-4d89-b86d-f62fa387f019"), - // WorkspaceResourceGroup: to.Ptr("myRg1"), - // WorkspaceSubscriptionID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }}, - // Severity: to.Ptr(armsecurity.AlertSeverityHigh), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.0000000Z"); return t}()), - // Status: to.Ptr(armsecurity.AlertStatusActive), - // SubTechniques: []*string{ - // to.Ptr("T1059.001"), - // to.Ptr("T1059.006"), - // to.Ptr("T1053.002")}, - // SupportingEvidence: &armsecurity.AlertPropertiesSupportingEvidence{ - // AdditionalProperties: map[string]any{ - // "columns": []any{ - // "Date", - // "Activity", - // "User", - // "TestedText", - // "TestedValue", - // }, - // "rows": []any{ - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser2", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser3", - // "true", - // true, - // }, - // }, - // "title": "Investigate activity test", - // }, - // Type: to.Ptr("tabularEvidences"), - // }, - // SystemAlertID: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Techniques: []*string{ - // to.Ptr("T1059"), - // to.Ptr("T1053"), - // to.Ptr("T1072")}, - // TimeGeneratedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.0000000Z"); return t}()), - // VendorName: to.Ptr("Microsoft"), - // Version: to.Ptr("2022-01-01"), - // }, - // }, - // { - // Name: to.Ptr("2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22"), - // Type: to.Ptr("Microsoft.Security/Locations/alerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg2/providers/Microsoft.Security/locations/westeurope/alerts/2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22"), - // Properties: &armsecurity.AlertProperties{ - // Description: to.Ptr("The process ‘c:\\users\\contosoUser\\scrsave.scr’ was observed executing from an uncommon location. Files with the .scr extensions are screen saver files and are normally reside and execute from the Windows system directory."), - // AlertDisplayName: to.Ptr("Suspicious Screensaver process executed"), - // AlertType: to.Ptr("VM_SuspiciousScreenSaver"), - // AlertURI: to.Ptr("https://portal.azure.com/#blade/Microsoft_Azure_Security/AlertBlade/alertId/2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a/subscriptionId/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroup/myRg1/referencedFrom/alertDeepLink/location/westeurope"), - // CompromisedEntity: to.Ptr("vm2"), - // CorrelationKey: to.Ptr("4hno6LF0xzCl5tqrk4nrBW+MY1BX816W6q6+0srk4"), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T13:51:45.0045913Z"); return t}()), - // Entities: []*armsecurity.AlertEntity{ - // { - // AdditionalProperties: map[string]any{ - // "OsVersion": nil, - // "azureID": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/myRg2/providers/microsoft.compute/virtualmachines/vm2", - // "dnsDomain": "", - // "hostName": "vm2", - // "netBiosName": "vm2", - // "ntDomain": "", - // "omsAgentID": "45b44640-3b94-4892-a28c-4a5cae27065a", - // "operatingSystem": "Unknown", - // }, - // Type: to.Ptr("host"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "name": "contosoUser", - // "logonId": "0x61450d87", - // "ntDomain": "vm2", - // "sid": "S-1-5-21-2144575486-8928446540-5163864319-500", - // }, - // Type: to.Ptr("account"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "name": "cmd.exe", - // "directory": "c:\\windows\\system32", - // }, - // Type: to.Ptr("file"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "processId": "0x3c44", - // }, - // Type: to.Ptr("process"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "name": "scrsave.scr", - // "directory": "c:\\users\\contosoUser", - // }, - // Type: to.Ptr("file"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "commandLine": "c:\\users\\contosoUser\\scrsave.scr", - // "creationTimeUtc": "2018-05-07T13:51:45.0045913Z", - // "processId": "0x4aec", - // }, - // Type: to.Ptr("process"), - // }}, - // ExtendedLinks: []map[string]*string{ - // map[string]*string{ - // "Category": to.Ptr("threat_reports"), - // "Href": to.Ptr("https://contoso.com/reports/DisplayReport"), - // "Label": to.Ptr("Report: RDP Brute Forcing"), - // "Type": to.Ptr("webLink"), - // }}, - // ExtendedProperties: map[string]*string{ - // "account logon id": to.Ptr("0x61450d87"), - // "command line": to.Ptr("c:\\users\\contosoUser\\scrsave.scr"), - // "domainName": to.Ptr("vm2"), - // "parent process": to.Ptr("cmd.exe"), - // "parent process id": to.Ptr("0x3c44"), - // "process id": to.Ptr("0x4aec"), - // "processName": to.Ptr("c:\\users\\contosoUser\\scrsave.scr"), - // "resourceType": to.Ptr("Virtual Machine"), - // "user SID": to.Ptr("S-1-5-21-2144575486-8928446540-5163864319-500"), - // "userName": to.Ptr("vm2\\contosoUser"), - // }, - // Intent: to.Ptr(armsecurity.IntentExecution), - // IsIncident: to.Ptr(true), - // ProcessingEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T13:51:48.9810457Z"); return t}()), - // ProductComponentName: to.Ptr("testName2"), - // ProductName: to.Ptr("Azure Security Center"), - // RemediationSteps: []*string{ - // to.Ptr("1. Run Process Explorer and try to identify unknown running processes (see https://technet.microsoft.com/en-us/sysinternals/bb896653.aspx)"), - // to.Ptr("2. Make sure the machine is completely updated and has an updated anti-malware application installed"), - // to.Ptr("3. Run a full anti-malware scan and verify that the threat was removed"), - // to.Ptr("4. Install and run Microsoft’s Malicious Software Removal Tool (see https://www.microsoft.com/en-us/download/malicious-software-removal-tool-details.aspx)"), - // to.Ptr("5. Run Microsoft’s Autoruns utility and try to identify unknown applications that are configured to run at login (see https://technet.microsoft.com/en-us/sysinternals/bb963902.aspx)"), - // to.Ptr("6. Escalate the alert to the information security team")}, - // ResourceIdentifiers: []armsecurity.ResourceIdentifierClassification{ - // &armsecurity.AzureResourceIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeAzureResource), - // AzureResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // &armsecurity.LogAnalyticsIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeLogAnalytics), - // AgentID: to.Ptr("75724a01-f021-4aa8-9ec2-329792373e6e"), - // WorkspaceID: to.Ptr("f419f624-acad-4d89-b86d-f62fa387f019"), - // WorkspaceResourceGroup: to.Ptr("myRg1"), - // WorkspaceSubscriptionID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }}, - // Severity: to.Ptr(armsecurity.AlertSeverityMedium), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T13:51:45.0045913Z"); return t}()), - // Status: to.Ptr(armsecurity.AlertStatusActive), - // SubTechniques: []*string{ - // to.Ptr("T1059.001"), - // to.Ptr("T1059.006"), - // to.Ptr("T1053.002")}, - // SupportingEvidence: &armsecurity.AlertPropertiesSupportingEvidence{ - // AdditionalProperties: map[string]any{ - // "supportingEvidenceList": []any{ - // map[string]any{ - // "type": "nestedList", - // "evidenceElements":[]any{ - // map[string]any{ - // "type": "evidenceElement", - // "innerElements": nil, - // "text":map[string]any{ - // "arguments":map[string]any{ - // "domainName":map[string]any{ - // "type": "string", - // "value": "domainName", - // }, - // "sensitiveEnumerationTypes":map[string]any{ - // "type": "string[]", - // "value":[]any{ - // "UseDesKey", - // }, - // }, - // }, - // "fallback": "Actor enumerated UseDesKey on domain1.test.local", - // "localizationKey": "AATP_ALERTS_LDAP_SENSITIVE_ATTRIBUTE_RECONNAISSANCE_SECURITY_ALERT_EVIDENCE_ENUMERATION_DETAIL_A7C00BD7", - // }, - // }, - // }, - // }, - // map[string]any{ - // "type": "tabularEvidences", - // "columns":[]any{ - // "Date", - // "Activity", - // "User", - // "TestedText", - // "TestedValue", - // }, - // "rows":[]any{ - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser2", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser3", - // "true", - // true, - // }, - // }, - // "title": "Investigate activity test", - // }, - // }, - // }, - // Type: to.Ptr("supportingEvidenceList"), - // }, - // SystemAlertID: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Techniques: []*string{ - // to.Ptr("T1059"), - // to.Ptr("T1053"), - // to.Ptr("T1072")}, - // TimeGeneratedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T13:51:48.3810457Z"); return t}()), - // VendorName: to.Ptr("Microsoft"), - // Version: to.Ptr("2022-01-01"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertsResourceGroupLocation_example.json -func ExampleAlertsClient_NewListResourceGroupLevelByRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAlertsClient().NewListResourceGroupLevelByRegionPager("westeurope", "myRg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AlertList = armsecurity.AlertList{ - // Value: []*armsecurity.Alert{ - // { - // Name: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Type: to.Ptr("Microsoft.Security/Locations/alerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/alerts/2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA"), - // Properties: &armsecurity.AlertProperties{ - // Description: to.Ptr("This is a test alert generated by Azure Security Center. No further action is needed."), - // AlertDisplayName: to.Ptr("Azure Security Center test alert (not a threat)"), - // AlertType: to.Ptr("VM_EICAR"), - // AlertURI: to.Ptr("https://portal.azure.com/#blade/Microsoft_Azure_Security/AlertBlade/alertId/2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a/subscriptionId/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroup/myRg1/referencedFrom/alertDeepLink/location/westeurope"), - // CompromisedEntity: to.Ptr("vm1"), - // CorrelationKey: to.Ptr("kso0LFWxzCll5tqrk5hmrBJ+MY1BX806W6q6+0s9Lk="), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.0000000Z"); return t}()), - // Entities: []*armsecurity.AlertEntity{ - // { - // AdditionalProperties: map[string]any{ - // "address": "192.0.2.1", - // "location": map[string]any{ - // "asn": float64(6584), - // "city": "sonning", - // "countryCode": "gb", - // "latitude": float64(51.468), - // "longitude": float64(-0.909), - // "state": "wokingham", - // }, - // }, - // Type: to.Ptr("ip"), - // }}, - // ExtendedLinks: []map[string]*string{ - // map[string]*string{ - // "Category": to.Ptr("threat_reports"), - // "Href": to.Ptr("https://contoso.com/reports/DisplayReport"), - // "Label": to.Ptr("Report: RDP Brute Forcing"), - // "Type": to.Ptr("webLink"), - // }}, - // ExtendedProperties: map[string]*string{ - // "Property1": to.Ptr("Property1 information"), - // }, - // Intent: to.Ptr(armsecurity.IntentExecution), - // IsIncident: to.Ptr(true), - // ProcessingEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.9205584Z"); return t}()), - // ProductComponentName: to.Ptr("testName"), - // ProductName: to.Ptr("Azure Security Center"), - // RemediationSteps: []*string{ - // to.Ptr("No further action is needed.")}, - // ResourceIdentifiers: []armsecurity.ResourceIdentifierClassification{ - // &armsecurity.AzureResourceIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeAzureResource), - // AzureResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // &armsecurity.LogAnalyticsIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeLogAnalytics), - // AgentID: to.Ptr("75724a01-f021-4aa8-9ec2-329792373e6e"), - // WorkspaceID: to.Ptr("f419f624-acad-4d89-b86d-f62fa387f019"), - // WorkspaceResourceGroup: to.Ptr("myRg1"), - // WorkspaceSubscriptionID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }}, - // Severity: to.Ptr(armsecurity.AlertSeverityHigh), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.0000000Z"); return t}()), - // Status: to.Ptr(armsecurity.AlertStatusActive), - // SubTechniques: []*string{ - // to.Ptr("T1059.001"), - // to.Ptr("T1059.006"), - // to.Ptr("T1053.002")}, - // SupportingEvidence: &armsecurity.AlertPropertiesSupportingEvidence{ - // AdditionalProperties: map[string]any{ - // "supportingEvidenceList": []any{ - // map[string]any{ - // "type": "nestedList", - // "evidenceElements":[]any{ - // map[string]any{ - // "type": "evidenceElement", - // "innerElements": nil, - // "text":map[string]any{ - // "arguments":map[string]any{ - // "domainName":map[string]any{ - // "type": "string", - // "value": "domainName", - // }, - // "sensitiveEnumerationTypes":map[string]any{ - // "type": "string[]", - // "value":[]any{ - // "UseDesKey", - // }, - // }, - // }, - // "fallback": "Actor enumerated UseDesKey on domain1.test.local", - // "localizationKey": "AATP_ALERTS_LDAP_SENSITIVE_ATTRIBUTE_RECONNAISSANCE_SECURITY_ALERT_EVIDENCE_ENUMERATION_DETAIL_A7C00BD7", - // }, - // }, - // }, - // }, - // map[string]any{ - // "type": "tabularEvidences", - // "columns":[]any{ - // "Date", - // "Activity", - // "User", - // "TestedText", - // "TestedValue", - // }, - // "rows":[]any{ - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser2", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser3", - // "true", - // true, - // }, - // }, - // "title": "Investigate activity test", - // }, - // }, - // }, - // Type: to.Ptr("supportingEvidenceList"), - // }, - // SystemAlertID: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Techniques: []*string{ - // to.Ptr("T1059"), - // to.Ptr("T1053"), - // to.Ptr("T1072")}, - // TimeGeneratedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.0000000Z"); return t}()), - // VendorName: to.Ptr("Microsoft"), - // Version: to.Ptr("2022-01-01"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertSubscriptionLocation_example.json -func ExampleAlertsClient_GetSubscriptionLevel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAlertsClient().GetSubscriptionLevel(ctx, "westeurope", "2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Alert = armsecurity.Alert{ - // Name: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Type: to.Ptr("Microsoft.Security/Locations/alerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/alerts/2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA"), - // Properties: &armsecurity.AlertProperties{ - // Description: to.Ptr("This is a test alert generated by Azure Security Center. No further action is needed."), - // AlertDisplayName: to.Ptr("Azure Security Center test alert (not a threat)"), - // AlertType: to.Ptr("VM_EICAR"), - // AlertURI: to.Ptr("https://portal.azure.com/#blade/Microsoft_Azure_Security/AlertBlade/alertId/2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a/subscriptionId/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroup/myRg1/referencedFrom/alertDeepLink/location/westeurope"), - // CompromisedEntity: to.Ptr("vm1"), - // CorrelationKey: to.Ptr("kso0LFWxzCll5tqrk5hmrBJ+MY1BX806W6q6+0s9Lk="), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.0000000Z"); return t}()), - // Entities: []*armsecurity.AlertEntity{ - // { - // AdditionalProperties: map[string]any{ - // "address": "192.0.2.1", - // "location": map[string]any{ - // "asn": float64(6584), - // "city": "sonning", - // "countryCode": "gb", - // "latitude": float64(51.468), - // "longitude": float64(-0.909), - // "state": "wokingham", - // }, - // }, - // Type: to.Ptr("ip"), - // }}, - // ExtendedLinks: []map[string]*string{ - // map[string]*string{ - // "Category": to.Ptr("threat_reports"), - // "Href": to.Ptr("https://contoso.com/reports/DisplayReport"), - // "Label": to.Ptr("Report: RDP Brute Forcing"), - // "Type": to.Ptr("webLink"), - // }}, - // ExtendedProperties: map[string]*string{ - // "Property1": to.Ptr("Property1 information"), - // }, - // Intent: to.Ptr(armsecurity.IntentExecution), - // IsIncident: to.Ptr(true), - // ProcessingEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.9205584Z"); return t}()), - // ProductComponentName: to.Ptr("testName"), - // ProductName: to.Ptr("Azure Security Center"), - // RemediationSteps: []*string{ - // to.Ptr("No further action is needed.")}, - // ResourceIdentifiers: []armsecurity.ResourceIdentifierClassification{ - // &armsecurity.AzureResourceIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeAzureResource), - // AzureResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // &armsecurity.LogAnalyticsIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeLogAnalytics), - // AgentID: to.Ptr("75724a01-f021-4aa8-9ec2-329792373e6e"), - // WorkspaceID: to.Ptr("f419f624-acad-4d89-b86d-f62fa387f019"), - // WorkspaceResourceGroup: to.Ptr("myRg1"), - // WorkspaceSubscriptionID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }}, - // Severity: to.Ptr(armsecurity.AlertSeverityHigh), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.0000000Z"); return t}()), - // Status: to.Ptr(armsecurity.AlertStatusActive), - // SubTechniques: []*string{ - // to.Ptr("T1059.001"), - // to.Ptr("T1059.006"), - // to.Ptr("T1053.002")}, - // SupportingEvidence: &armsecurity.AlertPropertiesSupportingEvidence{ - // AdditionalProperties: map[string]any{ - // "columns": []any{ - // "Date", - // "Activity", - // "User", - // "TestedText", - // "TestedValue", - // }, - // "rows": []any{ - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser2", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser3", - // "true", - // true, - // }, - // }, - // "title": "Investigate activity test", - // }, - // Type: to.Ptr("tabularEvidences"), - // }, - // SystemAlertID: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Techniques: []*string{ - // to.Ptr("T1059"), - // to.Ptr("T1053"), - // to.Ptr("T1072")}, - // TimeGeneratedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.0000000Z"); return t}()), - // VendorName: to.Ptr("Microsoft"), - // Version: to.Ptr("2022-01-01"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertResourceGroupLocation_example.json -func ExampleAlertsClient_GetResourceGroupLevel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAlertsClient().GetResourceGroupLevel(ctx, "myRg1", "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Alert = armsecurity.Alert{ - // Name: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Type: to.Ptr("Microsoft.Security/Locations/alerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/alerts/2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA"), - // Properties: &armsecurity.AlertProperties{ - // Description: to.Ptr("This is a test alert generated by Azure Security Center. No further action is needed."), - // AlertDisplayName: to.Ptr("Azure Security Center test alert (not a threat)"), - // AlertType: to.Ptr("VM_EICAR"), - // AlertURI: to.Ptr("https://portal.azure.com/#blade/Microsoft_Azure_Security/AlertBlade/alertId/2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a/subscriptionId/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroup/myRg1/referencedFrom/alertDeepLink/location/westeurope"), - // CompromisedEntity: to.Ptr("vm1"), - // CorrelationKey: to.Ptr("kso0LFWxzCll5tqrk5hmrBJ+MY1BX806W6q6+0s9Lk="), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.0000000Z"); return t}()), - // Entities: []*armsecurity.AlertEntity{ - // { - // AdditionalProperties: map[string]any{ - // "address": "192.0.2.1", - // "location": map[string]any{ - // "asn": float64(6584), - // "city": "sonning", - // "countryCode": "gb", - // "latitude": float64(51.468), - // "longitude": float64(-0.909), - // "state": "wokingham", - // }, - // }, - // Type: to.Ptr("ip"), - // }}, - // ExtendedLinks: []map[string]*string{ - // map[string]*string{ - // "Category": to.Ptr("threat_reports"), - // "Href": to.Ptr("https://contoso.com/reports/DisplayReport"), - // "Label": to.Ptr("Report: RDP Brute Forcing"), - // "Type": to.Ptr("webLink"), - // }}, - // ExtendedProperties: map[string]*string{ - // "Property1": to.Ptr("Property1 information"), - // }, - // Intent: to.Ptr(armsecurity.IntentExecution), - // IsIncident: to.Ptr(true), - // ProcessingEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.9205584Z"); return t}()), - // ProductComponentName: to.Ptr("testName"), - // ProductName: to.Ptr("Azure Security Center"), - // RemediationSteps: []*string{ - // to.Ptr("No further action is needed.")}, - // ResourceIdentifiers: []armsecurity.ResourceIdentifierClassification{ - // &armsecurity.AzureResourceIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeAzureResource), - // AzureResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // &armsecurity.LogAnalyticsIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeLogAnalytics), - // AgentID: to.Ptr("75724a01-f021-4aa8-9ec2-329792373e6e"), - // WorkspaceID: to.Ptr("f419f624-acad-4d89-b86d-f62fa387f019"), - // WorkspaceResourceGroup: to.Ptr("myRg1"), - // WorkspaceSubscriptionID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }}, - // Severity: to.Ptr(armsecurity.AlertSeverityHigh), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.0000000Z"); return t}()), - // Status: to.Ptr(armsecurity.AlertStatusActive), - // SubTechniques: []*string{ - // to.Ptr("T1059.001"), - // to.Ptr("T1059.006"), - // to.Ptr("T1053.002")}, - // SupportingEvidence: &armsecurity.AlertPropertiesSupportingEvidence{ - // AdditionalProperties: map[string]any{ - // "supportingEvidenceList": []any{ - // map[string]any{ - // "type": "nestedList", - // "evidenceElements":[]any{ - // map[string]any{ - // "type": "evidenceElement", - // "innerElements": nil, - // "text":map[string]any{ - // "arguments":map[string]any{ - // "domainName":map[string]any{ - // "type": "string", - // "value": "domainName", - // }, - // "sensitiveEnumerationTypes":map[string]any{ - // "type": "string[]", - // "value":[]any{ - // "UseDesKey", - // }, - // }, - // }, - // "fallback": "Actor enumerated UseDesKey on domain1.test.local", - // "localizationKey": "AATP_ALERTS_LDAP_SENSITIVE_ATTRIBUTE_RECONNAISSANCE_SECURITY_ALERT_EVIDENCE_ENUMERATION_DETAIL_A7C00BD7", - // }, - // }, - // }, - // }, - // map[string]any{ - // "type": "tabularEvidences", - // "columns":[]any{ - // "Date", - // "Activity", - // "User", - // "TestedText", - // "TestedValue", - // }, - // "rows":[]any{ - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser2", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser3", - // "true", - // true, - // }, - // }, - // "title": "Investigate activity test", - // }, - // }, - // }, - // Type: to.Ptr("supportingEvidenceList"), - // }, - // SystemAlertID: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Techniques: []*string{ - // to.Ptr("T1059"), - // to.Ptr("T1053"), - // to.Ptr("T1072")}, - // TimeGeneratedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.0000000Z"); return t}()), - // VendorName: to.Ptr("Microsoft"), - // Version: to.Ptr("2022-01-01"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_dismiss_example.json -func ExampleAlertsClient_UpdateSubscriptionLevelStateToDismiss() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAlertsClient().UpdateSubscriptionLevelStateToDismiss(ctx, "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_resolve_example.json -func ExampleAlertsClient_UpdateSubscriptionLevelStateToResolve() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAlertsClient().UpdateSubscriptionLevelStateToResolve(ctx, "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_activate_example.json -func ExampleAlertsClient_UpdateSubscriptionLevelStateToActivate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAlertsClient().UpdateSubscriptionLevelStateToActivate(ctx, "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_inProgress_example.json -func ExampleAlertsClient_UpdateSubscriptionLevelStateToInProgress() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAlertsClient().UpdateSubscriptionLevelStateToInProgress(ctx, "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_resolve_example.json -func ExampleAlertsClient_UpdateResourceGroupLevelStateToResolve() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAlertsClient().UpdateResourceGroupLevelStateToResolve(ctx, "myRg2", "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_dismiss_example.json -func ExampleAlertsClient_UpdateResourceGroupLevelStateToDismiss() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAlertsClient().UpdateResourceGroupLevelStateToDismiss(ctx, "myRg2", "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_activate_example.json -func ExampleAlertsClient_UpdateResourceGroupLevelStateToActivate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAlertsClient().UpdateResourceGroupLevelStateToActivate(ctx, "myRg2", "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_inProgress_example.json -func ExampleAlertsClient_UpdateResourceGroupLevelStateToInProgress() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAlertsClient().UpdateResourceGroupLevelStateToInProgress(ctx, "myRg2", "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/SimulateAlerts_example.json -func ExampleAlertsClient_BeginSimulate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAlertsClient().BeginSimulate(ctx, "centralus", armsecurity.AlertSimulatorRequestBody{ - Properties: &armsecurity.AlertSimulatorBundlesRequestProperties{ - Kind: to.Ptr(armsecurity.KindBundles), - Bundles: []*armsecurity.BundleType{ - to.Ptr(armsecurity.BundleTypeAppServices), - to.Ptr(armsecurity.BundleTypeDNS), - to.Ptr(armsecurity.BundleTypeKeyVaults), - to.Ptr(armsecurity.BundleTypeKubernetesService), - to.Ptr(armsecurity.BundleTypeResourceManager), - to.Ptr(armsecurity.BundleTypeSQLServers), - to.Ptr(armsecurity.BundleTypeStorageAccounts), - to.Ptr(armsecurity.BundleTypeVirtualMachines), - to.Ptr(armsecurity.BundleTypeCosmosDbs)}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/alertssuppressionrules_client_example_test.go b/sdk/resourcemanager/security/armsecurity/alertssuppressionrules_client_example_test.go deleted file mode 100644 index 84195fdc8d73..000000000000 --- a/sdk/resourcemanager/security/armsecurity/alertssuppressionrules_client_example_test.go +++ /dev/null @@ -1,296 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRulesWithAlertType_example.json -func ExampleAlertsSuppressionRulesClient_NewListPager_getSuppressionAlertRuleForSubscriptionFilteredByAlertType() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAlertsSuppressionRulesClient().NewListPager(&armsecurity.AlertsSuppressionRulesClientListOptions{AlertType: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AlertsSuppressionRulesList = armsecurity.AlertsSuppressionRulesList{ - // Value: []*armsecurity.AlertsSuppressionRule{ - // { - // Name: to.Ptr("dismissIpAnomalyAlerts"), - // Type: to.Ptr("Microsoft.Security/alertsSuppressionRules"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/alertsSuppressionRules/dismissIpAnomalyAlerts"), - // Properties: &armsecurity.AlertsSuppressionRuleProperties{ - // AlertType: to.Ptr("IpAnomaly"), - // Comment: to.Ptr("Test VM"), - // ExpirationDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T19:50:47.083633Z"); return t}()), - // LastModifiedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-31T19:50:47.083633Z"); return t}()), - // Reason: to.Ptr("FalsePositive"), - // State: to.Ptr(armsecurity.RuleStateEnabled), - // SuppressionAlertsScope: &armsecurity.SuppressionAlertsScope{ - // AllOf: []*armsecurity.ScopeElement{ - // { - // AdditionalProperties: map[string]any{ - // "in": []any{ - // "104.215.95.187", - // "52.164.206.56", - // }, - // }, - // Field: to.Ptr("entities.ip.address"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "contains": "POWERSHELL.EXE", - // }, - // Field: to.Ptr("entities.process.commandline"), - // }}, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRules_example.json -func ExampleAlertsSuppressionRulesClient_NewListPager_getSuppressionRulesForSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAlertsSuppressionRulesClient().NewListPager(&armsecurity.AlertsSuppressionRulesClientListOptions{AlertType: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AlertsSuppressionRulesList = armsecurity.AlertsSuppressionRulesList{ - // Value: []*armsecurity.AlertsSuppressionRule{ - // { - // Name: to.Ptr("dismissIpAnomalyAlerts"), - // Type: to.Ptr("Microsoft.Security/alertsSuppressionRules"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/alertsSuppressionRules/dismissIpAnomalyAlerts"), - // Properties: &armsecurity.AlertsSuppressionRuleProperties{ - // AlertType: to.Ptr("IpAnomaly"), - // Comment: to.Ptr("Test VM"), - // ExpirationDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T19:50:47.083633Z"); return t}()), - // LastModifiedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-31T19:50:47.083633Z"); return t}()), - // Reason: to.Ptr("FalsePositive"), - // State: to.Ptr(armsecurity.RuleStateEnabled), - // SuppressionAlertsScope: &armsecurity.SuppressionAlertsScope{ - // AllOf: []*armsecurity.ScopeElement{ - // { - // AdditionalProperties: map[string]any{ - // "in": []any{ - // "104.215.95.187", - // "52.164.206.56", - // }, - // }, - // Field: to.Ptr("entities.ip.address"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "contains": "POWERSHELL.EXE", - // }, - // Field: to.Ptr("entities.process.commandline"), - // }}, - // }, - // }, - // }, - // { - // Name: to.Ptr("dismissDataExfiltrationAnomalyAlertsOnTestVMs"), - // Type: to.Ptr("Microsoft.Security/alertsSuppressionRules"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/alertsSuppressionRules/dismissDataExfiltrationAnomalyAlertsOnTestVMs"), - // Properties: &armsecurity.AlertsSuppressionRuleProperties{ - // AlertType: to.Ptr("DataExfiltrationAnomaly"), - // ExpirationDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T19:50:47.083633Z"); return t}()), - // LastModifiedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-31T19:50:47.083633Z"); return t}()), - // Reason: to.Ptr("FalsePositive"), - // State: to.Ptr(armsecurity.RuleStateEnabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRule_example.json -func ExampleAlertsSuppressionRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAlertsSuppressionRulesClient().Get(ctx, "dismissIpAnomalyAlerts", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AlertsSuppressionRule = armsecurity.AlertsSuppressionRule{ - // Name: to.Ptr("dismissIpAnomalyAlerts"), - // Type: to.Ptr("Microsoft.Security/alertsSuppressionRules"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/alertsSuppressionRules/dismissIpAnomalyAlerts"), - // Properties: &armsecurity.AlertsSuppressionRuleProperties{ - // AlertType: to.Ptr("IpAnomaly"), - // Comment: to.Ptr("Test VM"), - // ExpirationDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T19:50:47.083633Z"); return t}()), - // LastModifiedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-31T19:50:47.083633Z"); return t}()), - // Reason: to.Ptr("FalsePositive"), - // State: to.Ptr(armsecurity.RuleStateEnabled), - // SuppressionAlertsScope: &armsecurity.SuppressionAlertsScope{ - // AllOf: []*armsecurity.ScopeElement{ - // { - // AdditionalProperties: map[string]any{ - // "in": []any{ - // "104.215.95.187", - // "52.164.206.56", - // }, - // }, - // Field: to.Ptr("entities.ip.address"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "contains": "POWERSHELL.EXE", - // }, - // Field: to.Ptr("entities.process.commandline"), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/PutAlertsSuppressionRule_example.json -func ExampleAlertsSuppressionRulesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAlertsSuppressionRulesClient().Update(ctx, "dismissIpAnomalyAlerts", armsecurity.AlertsSuppressionRule{ - Properties: &armsecurity.AlertsSuppressionRuleProperties{ - AlertType: to.Ptr("IpAnomaly"), - Comment: to.Ptr("Test VM"), - ExpirationDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T19:50:47.083633Z"); return t }()), - Reason: to.Ptr("FalsePositive"), - State: to.Ptr(armsecurity.RuleStateEnabled), - SuppressionAlertsScope: &armsecurity.SuppressionAlertsScope{ - AllOf: []*armsecurity.ScopeElement{ - { - AdditionalProperties: map[string]any{ - "in": []any{ - "104.215.95.187", - "52.164.206.56", - }, - }, - Field: to.Ptr("entities.ip.address"), - }, - { - AdditionalProperties: map[string]any{ - "contains": "POWERSHELL.EXE", - }, - Field: to.Ptr("entities.process.commandline"), - }}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AlertsSuppressionRule = armsecurity.AlertsSuppressionRule{ - // Name: to.Ptr("dismissIpAnomalyAlerts"), - // Type: to.Ptr("Microsoft.Security/alertsSuppressionRules"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/alertsSuppressionRules/dismissIpAnomalyAlerts"), - // Properties: &armsecurity.AlertsSuppressionRuleProperties{ - // AlertType: to.Ptr("IpAnomaly"), - // Comment: to.Ptr("Test VM"), - // ExpirationDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T19:50:47.083633Z"); return t}()), - // LastModifiedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-31T19:50:47.083633Z"); return t}()), - // Reason: to.Ptr("FalsePositive"), - // State: to.Ptr(armsecurity.RuleStateEnabled), - // SuppressionAlertsScope: &armsecurity.SuppressionAlertsScope{ - // AllOf: []*armsecurity.ScopeElement{ - // { - // AdditionalProperties: map[string]any{ - // "in": []any{ - // "104.215.95.187", - // "52.164.206.56", - // }, - // }, - // Field: to.Ptr("entities.ip.address"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "contains": "POWERSHELL.EXE", - // }, - // Field: to.Ptr("entities.process.commandline"), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/DeleteAlertsSuppressionRule_example.json -func ExampleAlertsSuppressionRulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAlertsSuppressionRulesClient().Delete(ctx, "dismissIpAnomalyAlerts", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/allowedconnections_client_example_test.go b/sdk/resourcemanager/security/armsecurity/allowedconnections_client_example_test.go deleted file mode 100644 index 62c5f0c7a5f0..000000000000 --- a/sdk/resourcemanager/security/armsecurity/allowedconnections_client_example_test.go +++ /dev/null @@ -1,235 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/GetAllowedConnectionsSubscription_example.json -func ExampleAllowedConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAllowedConnectionsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AllowedConnectionsList = armsecurity.AllowedConnectionsList{ - // Value: []*armsecurity.AllowedConnectionsResource{ - // { - // Location: to.Ptr("centralus"), - // Name: to.Ptr("Internal"), - // Type: to.Ptr("Microsoft.Security/locations/allowedConnections"), - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Security/locations/centralus/allowedConnections/Internal"), - // Properties: &armsecurity.AllowedConnectionsResourceProperties{ - // CalculatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-06T14:55:32.3518545Z"); return t}()), - // ConnectableResources: []*armsecurity.ConnectableResource{ - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // }, - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // }, - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine3"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // }, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // }, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/GetAllowedConnectionsSubscriptionLocation_example.json -func ExampleAllowedConnectionsClient_NewListByHomeRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAllowedConnectionsClient().NewListByHomeRegionPager("centralus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AllowedConnectionsList = armsecurity.AllowedConnectionsList{ - // Value: []*armsecurity.AllowedConnectionsResource{ - // { - // Location: to.Ptr("centralus"), - // Name: to.Ptr("Internal"), - // Type: to.Ptr("Microsoft.Security/locations/allowedConnections"), - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Security/locations/centralus/allowedConnections/Internal"), - // Properties: &armsecurity.AllowedConnectionsResourceProperties{ - // CalculatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-06T14:55:32.3518545Z"); return t}()), - // ConnectableResources: []*armsecurity.ConnectableResource{ - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // }, - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // }, - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine3"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // }, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // }, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/GetAllowedConnections_example.json -func ExampleAllowedConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAllowedConnectionsClient().Get(ctx, "myResourceGroup", "centralus", armsecurity.ConnectionTypeInternal, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AllowedConnectionsResource = armsecurity.AllowedConnectionsResource{ - // Location: to.Ptr("centralus"), - // Name: to.Ptr("Internal"), - // Type: to.Ptr("Microsoft.Security/locations/allowedConnections"), - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Security/locations/centralus/allowedConnections/Internal"), - // Properties: &armsecurity.AllowedConnectionsResourceProperties{ - // CalculatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-06T14:55:32.3518545Z"); return t}()), - // ConnectableResources: []*armsecurity.ConnectableResource{ - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // }, - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // }, - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine3"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // }, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // }, - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/apicollection_client.go b/sdk/resourcemanager/security/armsecurity/apicollection_client.go new file mode 100644 index 000000000000..95bd4364e6c6 --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/apicollection_client.go @@ -0,0 +1,181 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armsecurity + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// APICollectionClient contains the methods for the APICollection group. +// Don't use this type directly, use NewAPICollectionClient() instead. +type APICollectionClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAPICollectionClient creates a new instance of APICollectionClient with the specified values. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAPICollectionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APICollectionClient, error) { + cl, err := arm.NewClient(moduleName+".APICollectionClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &APICollectionClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API is +// onboarded to Defender for APIs, the system will monitor the operations within the +// Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-20-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiCollectionID - A string representing the apiCollections resource within the Microsoft.Security provider namespace. This +// string matches the Azure API Management API name. +// - options - APICollectionClientGetOptions contains the optional parameters for the APICollectionClient.Get method. +func (client *APICollectionClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiCollectionID string, options *APICollectionClientGetOptions) (APICollectionClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiCollectionID, options) + if err != nil { + return APICollectionClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return APICollectionClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return APICollectionClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *APICollectionClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiCollectionID string, options *APICollectionClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiCollectionId}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiCollectionID == "" { + return nil, errors.New("parameter apiCollectionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiCollectionId}", url.PathEscape(apiCollectionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-20-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *APICollectionClient) getHandleResponse(resp *http.Response) (APICollectionClientGetResponse, error) { + result := APICollectionClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.APICollectionResponse); err != nil { + return APICollectionClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API +// Management API is onboarded to Defender for APIs, the system will monitor the operations within +// the Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. +// +// Generated from API version 2022-11-20-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - APICollectionClientListOptions contains the optional parameters for the APICollectionClient.NewListPager method. +func (client *APICollectionClient) NewListPager(resourceGroupName string, serviceName string, options *APICollectionClientListOptions) *runtime.Pager[APICollectionClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[APICollectionClientListResponse]{ + More: func(page APICollectionClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *APICollectionClientListResponse) (APICollectionClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return APICollectionClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return APICollectionClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return APICollectionClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *APICollectionClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *APICollectionClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-20-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *APICollectionClient) listHandleResponse(resp *http.Response) (APICollectionClientListResponse, error) { + result := APICollectionClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.APICollectionResponseList); err != nil { + return APICollectionClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/apicollectionoffboarding_client.go b/sdk/resourcemanager/security/armsecurity/apicollectionoffboarding_client.go new file mode 100644 index 000000000000..64a48581312b --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/apicollectionoffboarding_client.go @@ -0,0 +1,101 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armsecurity + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// APICollectionOffboardingClient contains the methods for the APICollectionOffboarding group. +// Don't use this type directly, use NewAPICollectionOffboardingClient() instead. +type APICollectionOffboardingClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAPICollectionOffboardingClient creates a new instance of APICollectionOffboardingClient with the specified values. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAPICollectionOffboardingClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APICollectionOffboardingClient, error) { + cl, err := arm.NewClient(moduleName+".APICollectionOffboardingClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &APICollectionOffboardingClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Delete - Offboard an Azure API Management API from Defender for APIs. The system will stop monitoring the operations within +// the Azure API Management API for intrusive behaviors. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-20-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiCollectionID - A string representing the apiCollections resource within the Microsoft.Security provider namespace. This +// string matches the Azure API Management API name. +// - options - APICollectionOffboardingClientDeleteOptions contains the optional parameters for the APICollectionOffboardingClient.Delete +// method. +func (client *APICollectionOffboardingClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiCollectionID string, options *APICollectionOffboardingClientDeleteOptions) (APICollectionOffboardingClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiCollectionID, options) + if err != nil { + return APICollectionOffboardingClientDeleteResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return APICollectionOffboardingClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return APICollectionOffboardingClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return APICollectionOffboardingClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *APICollectionOffboardingClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiCollectionID string, options *APICollectionOffboardingClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiCollectionId}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiCollectionID == "" { + return nil, errors.New("parameter apiCollectionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiCollectionId}", url.PathEscape(apiCollectionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-20-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/apicollectiononboarding_client.go b/sdk/resourcemanager/security/armsecurity/apicollectiononboarding_client.go new file mode 100644 index 000000000000..8e8a521dc71c --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/apicollectiononboarding_client.go @@ -0,0 +1,111 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armsecurity + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// APICollectionOnboardingClient contains the methods for the APICollectionOnboarding group. +// Don't use this type directly, use NewAPICollectionOnboardingClient() instead. +type APICollectionOnboardingClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAPICollectionOnboardingClient creates a new instance of APICollectionOnboardingClient with the specified values. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAPICollectionOnboardingClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APICollectionOnboardingClient, error) { + cl, err := arm.NewClient(moduleName+".APICollectionOnboardingClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &APICollectionOnboardingClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Create - Onboard an Azure API Management API to Defender for APIs. The system will start monitoring the operations within +// the Azure Management API for intrusive behaviors and provide alerts for attacks that +// have been detected. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-20-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiCollectionID - A string representing the apiCollections resource within the Microsoft.Security provider namespace. This +// string matches the Azure API Management API name. +// - options - APICollectionOnboardingClientCreateOptions contains the optional parameters for the APICollectionOnboardingClient.Create +// method. +func (client *APICollectionOnboardingClient) Create(ctx context.Context, resourceGroupName string, serviceName string, apiCollectionID string, options *APICollectionOnboardingClientCreateOptions) (APICollectionOnboardingClientCreateResponse, error) { + req, err := client.createCreateRequest(ctx, resourceGroupName, serviceName, apiCollectionID, options) + if err != nil { + return APICollectionOnboardingClientCreateResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return APICollectionOnboardingClientCreateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return APICollectionOnboardingClientCreateResponse{}, runtime.NewResponseError(resp) + } + return client.createHandleResponse(resp) +} + +// createCreateRequest creates the Create request. +func (client *APICollectionOnboardingClient) createCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiCollectionID string, options *APICollectionOnboardingClientCreateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiCollectionId}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiCollectionID == "" { + return nil, errors.New("parameter apiCollectionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiCollectionId}", url.PathEscape(apiCollectionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-20-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// createHandleResponse handles the Create response. +func (client *APICollectionOnboardingClient) createHandleResponse(resp *http.Response) (APICollectionOnboardingClientCreateResponse, error) { + result := APICollectionOnboardingClientCreateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.APICollectionResponse); err != nil { + return APICollectionOnboardingClientCreateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/application_client_example_test.go b/sdk/resourcemanager/security/armsecurity/application_client_example_test.go deleted file mode 100644 index c76c507fc59e..000000000000 --- a/sdk/resourcemanager/security/armsecurity/application_client_example_test.go +++ /dev/null @@ -1,132 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/GetApplication_example.json -func ExampleApplicationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationClient().Get(ctx, "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Application = armsecurity.Application{ - // Name: to.Ptr("ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Type: to.Ptr("Microsoft.Security/applications"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/applications/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.ApplicationProperties{ - // Description: to.Ptr("An application on critical recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "contains", - // "property": "$.Id", - // "value": "-bil-", - // }, - // }, - // }}, - // DisplayName: to.Ptr("Admin's application"), - // SourceResourceType: to.Ptr(armsecurity.ApplicationSourceResourceTypeAssessments), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/PutApplication_example.json -func ExampleApplicationClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationClient().CreateOrUpdate(ctx, "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", armsecurity.Application{ - Properties: &armsecurity.ApplicationProperties{ - Description: to.Ptr("An application on critical recommendations"), - ConditionSets: []any{ - map[string]any{ - "conditions": []any{ - map[string]any{ - "operator": "contains", - "property": "$.Id", - "value": "-bil-", - }, - }, - }}, - DisplayName: to.Ptr("Admin's application"), - SourceResourceType: to.Ptr(armsecurity.ApplicationSourceResourceTypeAssessments), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Application = armsecurity.Application{ - // Name: to.Ptr("1f3afdf9-d0c9-4c3d-847f-89da613e70a8"), - // Type: to.Ptr("Microsoft.Security/applications"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/applications/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.ApplicationProperties{ - // Description: to.Ptr("An application on critical recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "contains", - // "property": "$.Id", - // "value": "-dev-", - // }, - // }, - // }}, - // DisplayName: to.Ptr("Admin's application"), - // SourceResourceType: to.Ptr(armsecurity.ApplicationSourceResourceTypeAssessments), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/DeleteApplication_example.json -func ExampleApplicationClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewApplicationClient().Delete(ctx, "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/applications_client_example_test.go b/sdk/resourcemanager/security/armsecurity/applications_client_example_test.go deleted file mode 100644 index bb4ba7502416..000000000000 --- a/sdk/resourcemanager/security/armsecurity/applications_client_example_test.go +++ /dev/null @@ -1,86 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ListBySubscriptionApplications_example.json -func ExampleApplicationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ApplicationsList = armsecurity.ApplicationsList{ - // Value: []*armsecurity.Application{ - // { - // Name: to.Ptr("ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Type: to.Ptr("Microsoft.Security/applications"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/applications/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.ApplicationProperties{ - // Description: to.Ptr("An application on critical recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "contains", - // "property": "$.Id", - // "value": "-bil-", - // }, - // }, - // }}, - // DisplayName: to.Ptr("Admin's application"), - // SourceResourceType: to.Ptr(armsecurity.ApplicationSourceResourceTypeAssessments), - // }, - // }, - // { - // Name: to.Ptr("4106f43c-6d82-4fc8-a92c-dcfe50799d1d"), - // Type: to.Ptr("Microsoft.Security/applications"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/applications/4106f43c-6d82-4fc8-a92c-dcfe50799d1d"), - // Properties: &armsecurity.ApplicationProperties{ - // Description: to.Ptr("An application on critical recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "contains", - // "property": "$.Id", - // "value": "-prod-", - // }, - // }, - // }}, - // DisplayName: to.Ptr("Admin's application"), - // SourceResourceType: to.Ptr(armsecurity.ApplicationSourceResourceTypeAssessments), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/assessments_client_example_test.go b/sdk/resourcemanager/security/armsecurity/assessments_client_example_test.go deleted file mode 100644 index 93fe1e64b87f..000000000000 --- a/sdk/resourcemanager/security/armsecurity/assessments_client_example_test.go +++ /dev/null @@ -1,234 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/ListAssessments_example.json -func ExampleAssessmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAssessmentsClient().NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AssessmentList = armsecurity.AssessmentList{ - // Value: []*armsecurity.AssessmentResponse{ - // { - // Name: to.Ptr("21300918-b2e3-0346-785f-c77ff57d243b"), - // Type: to.Ptr("Microsoft.Security/assessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/providers/Microsoft.Security/assessments/21300918-b2e3-0346-785f-c77ff57d243b"), - // Properties: &armsecurity.AssessmentPropertiesResponse{ - // DisplayName: to.Ptr("Install endpoint protection solution on virtual machine scale sets"), - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1"), - // }, - // Status: &armsecurity.AssessmentStatusResponse{ - // Code: to.Ptr(armsecurity.AssessmentStatusCodeHealthy), - // FirstEvaluationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-12T09:07:18.6759138Z"); return t}()), - // StatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-12T09:07:18.6759138Z"); return t}()), - // }, - // }, - // }, - // { - // Name: to.Ptr("21300918-b2e3-0346-785f-c77ff57d243b"), - // Type: to.Ptr("Microsoft.Security/assessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2/providers/Microsoft.Security/assessments/21300918-b2e3-0346-785f-c77ff57d243b"), - // Properties: &armsecurity.AssessmentPropertiesResponse{ - // AdditionalData: map[string]*string{ - // "linkedWorkspaceId": to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myLaWorkspace"), - // }, - // DisplayName: to.Ptr("Install endpoint protection solution on virtual machine scale sets"), - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2"), - // }, - // Status: &armsecurity.AssessmentStatusResponse{ - // Description: to.Ptr("The effective policy for the assessment was evaluated to off - use Microsoft.Authorization/policyAssignments to turn this assessment on"), - // Cause: to.Ptr("OffByPolicy"), - // Code: to.Ptr(armsecurity.AssessmentStatusCodeNotApplicable), - // FirstEvaluationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-12T09:07:18.6759138Z"); return t}()), - // StatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-12T09:07:18.6759138Z"); return t}()), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/GetAssessment_example.json -func ExampleAssessmentsClient_Get_getSecurityRecommendationTaskFromSecurityDataLocation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAssessmentsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", "21300918-b2e3-0346-785f-c77ff57d243b", &armsecurity.AssessmentsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AssessmentResponse = armsecurity.AssessmentResponse{ - // Name: to.Ptr("21300918-b2e3-0346-785f-c77ff57d243b"), - // Type: to.Ptr("Microsoft.Security/assessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2/providers/Microsoft.Security/assessments/21300918-b2e3-0346-785f-c77ff57d243b"), - // Properties: &armsecurity.AssessmentPropertiesResponse{ - // AdditionalData: map[string]*string{ - // "linkedWorkspaceId": to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myLaWorkspace"), - // }, - // DisplayName: to.Ptr("Install endpoint protection solution on virtual machine scale sets"), - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2"), - // }, - // Status: &armsecurity.AssessmentStatusResponse{ - // Description: to.Ptr("The effective policy for the assessment was evaluated to off - use Microsoft.Authorization/policyAssignments to turn this assessment on"), - // Cause: to.Ptr("OffByPolicy"), - // Code: to.Ptr(armsecurity.AssessmentStatusCodeNotApplicable), - // FirstEvaluationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-12T09:07:18.6759138Z"); return t}()), - // StatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-12T09:07:18.6759138Z"); return t}()), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/GetAssessmentWithExpand_example.json -func ExampleAssessmentsClient_Get_getSecurityRecommendationTaskFromSecurityDataLocationWithExpandParameter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAssessmentsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", "21300918-b2e3-0346-785f-c77ff57d243b", &armsecurity.AssessmentsClientGetOptions{Expand: to.Ptr(armsecurity.ExpandEnumLinks)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AssessmentResponse = armsecurity.AssessmentResponse{ - // Name: to.Ptr("21300918-b2e3-0346-785f-c77ff57d243b"), - // Type: to.Ptr("Microsoft.Security/assessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2/providers/Microsoft.Security/assessments/21300918-b2e3-0346-785f-c77ff57d243b"), - // Properties: &armsecurity.AssessmentPropertiesResponse{ - // AdditionalData: map[string]*string{ - // "linkedWorkspaceId": to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myLaWorkspace"), - // }, - // DisplayName: to.Ptr("Install endpoint protection solution on virtual machine scale sets"), - // Links: &armsecurity.AssessmentLinks{ - // AzurePortalURI: to.Ptr("https://www.portal.azure.com/?fea#blade/Microsoft_Azure_Security/RecommendationsBlade/assessmentKey/21300918-b2e3-0346-785f-c77ff57d243b"), - // }, - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2"), - // }, - // Status: &armsecurity.AssessmentStatusResponse{ - // Description: to.Ptr("The effective policy for the assessment was evaluated to off - use Microsoft.Authorization/policyAssignments to turn this assessment on"), - // Cause: to.Ptr("OffByPolicy"), - // Code: to.Ptr(armsecurity.AssessmentStatusCodeNotApplicable), - // FirstEvaluationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-12T09:07:18.6759138Z"); return t}()), - // StatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-12T09:07:18.6759138Z"); return t}()), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/PutAssessment_example.json -func ExampleAssessmentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAssessmentsClient().CreateOrUpdate(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", "8bb8be0a-6010-4789-812f-e4d661c4ed0e", armsecurity.Assessment{ - Properties: &armsecurity.AssessmentProperties{ - ResourceDetails: &armsecurity.AzureResourceDetails{ - Source: to.Ptr(armsecurity.SourceAzure), - }, - Status: &armsecurity.AssessmentStatus{ - Code: to.Ptr(armsecurity.AssessmentStatusCodeHealthy), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AssessmentResponse = armsecurity.AssessmentResponse{ - // Name: to.Ptr("8bb8be0a-6010-4789-812f-e4d661c4ed0e"), - // Type: to.Ptr("Microsoft.Security/assessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/providers/Microsoft.Security/assessments/8bb8be0a-6010-4789-812f-e4d661c4ed0e"), - // Properties: &armsecurity.AssessmentPropertiesResponse{ - // DisplayName: to.Ptr("Install internal agent on VM"), - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/providers/Microsoft.Security/assessments/8bb8be0a-6010-4789-812f-e4d661c4ed0e"), - // }, - // Status: &armsecurity.AssessmentStatusResponse{ - // Code: to.Ptr(armsecurity.AssessmentStatusCodeHealthy), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/DeleteAssessment_example.json -func ExampleAssessmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAssessmentsClient().Delete(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", "8bb8be0a-6010-4789-812f-e4d661c4ed0e", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/assessmentsmetadata_client_example_test.go b/sdk/resourcemanager/security/armsecurity/assessmentsmetadata_client_example_test.go deleted file mode 100644 index e80b798ed5f1..000000000000 --- a/sdk/resourcemanager/security/armsecurity/assessmentsmetadata_client_example_test.go +++ /dev/null @@ -1,418 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/ListAssessmentsMetadata_example.json -func ExampleAssessmentsMetadataClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAssessmentsMetadataClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AssessmentMetadataResponseList = armsecurity.AssessmentMetadataResponseList{ - // Value: []*armsecurity.AssessmentMetadataResponse{ - // { - // Name: to.Ptr("21300918-b2e3-0346-785f-c77ff57d243b"), - // Type: to.Ptr("Microsoft.Security/assessmentMetadata"), - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/21300918-b2e3-0346-785f-c77ff57d243b"), - // Properties: &armsecurity.AssessmentMetadataPropertiesResponse{ - // Description: to.Ptr("Install an endpoint protection solution on your virtual machines scale sets, to protect them from threats and vulnerabilities."), - // AssessmentType: to.Ptr(armsecurity.AssessmentTypeBuiltIn), - // Categories: []*armsecurity.Categories{ - // to.Ptr(armsecurity.CategoriesCompute)}, - // DisplayName: to.Ptr("Install endpoint protection solution on virtual machine scale sets"), - // ImplementationEffort: to.Ptr(armsecurity.ImplementationEffortLow), - // PolicyDefinitionID: to.Ptr("/providers/Microsoft.Authorization/policyDefinitions/26a828e1-e88f-464e-bbb3-c134a282b9de"), - // RemediationDescription: to.Ptr("To install an endpoint protection solution: 1. Follow the instructions in How do I turn on antimalware in my virtual machine scale set"), - // Severity: to.Ptr(armsecurity.SeverityMedium), - // Threats: []*armsecurity.Threats{ - // to.Ptr(armsecurity.ThreatsDataExfiltration), - // to.Ptr(armsecurity.ThreatsDataSpillage), - // to.Ptr(armsecurity.ThreatsMaliciousInsider)}, - // UserImpact: to.Ptr(armsecurity.UserImpactLow), - // PlannedDeprecationDate: to.Ptr("03/2022"), - // PublishDates: &armsecurity.AssessmentMetadataPropertiesResponsePublishDates{ - // GA: to.Ptr("06/01/2021"), - // Public: to.Ptr("06/01/2021"), - // }, - // Tactics: []*armsecurity.Tactics{ - // to.Ptr(armsecurity.TacticsCredentialAccess), - // to.Ptr(armsecurity.TacticsPersistence), - // to.Ptr(armsecurity.TacticsExecution), - // to.Ptr(armsecurity.TacticsDefenseEvasion), - // to.Ptr(armsecurity.TacticsCollection), - // to.Ptr(armsecurity.TacticsDiscovery), - // to.Ptr(armsecurity.TacticsPrivilegeEscalation)}, - // Techniques: []*armsecurity.Techniques{ - // to.Ptr(armsecurity.TechniquesObfuscatedFilesOrInformation), - // to.Ptr(armsecurity.TechniquesIngressToolTransfer), - // to.Ptr(armsecurity.TechniquesPhishing), - // to.Ptr(armsecurity.TechniquesUserExecution)}, - // }, - // }, - // { - // Name: to.Ptr("bc303248-3d14-44c2-96a0-55f5c326b5fe"), - // Type: to.Ptr("Microsoft.Security/assessmentMetadata"), - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/bc303248-3d14-44c2-96a0-55f5c326b5fe"), - // Properties: &armsecurity.AssessmentMetadataPropertiesResponse{ - // Description: to.Ptr("Open remote management ports expose your VM to a high level of risk from internet-based attacks that attempt to brute force credentials to gain admin access to the machine."), - // AssessmentType: to.Ptr(armsecurity.AssessmentTypeCustomPolicy), - // Categories: []*armsecurity.Categories{ - // to.Ptr(armsecurity.CategoriesNetworking)}, - // DisplayName: to.Ptr("Close management ports on your virtual machines"), - // ImplementationEffort: to.Ptr(armsecurity.ImplementationEffortLow), - // PolicyDefinitionID: to.Ptr("/providers/Microsoft.Authorization/policyDefinitions/22730e10-96f6-4aac-ad84-9383d35b5917"), - // Preview: to.Ptr(true), - // RemediationDescription: to.Ptr("We recommend that you edit the inbound rules of the below virtual machines to restrict access to specific source ranges.
To restrict the access to your virtual machines: 1. Click on a VM from the list below 2. At the 'Networking' blade, click on each of the rules that allow management ports (e.g. RDP-3389, WINRM-5985, SSH-22) 3. Change the 'Action' property to 'Deny' 4. Click 'Save'"), - // Severity: to.Ptr(armsecurity.SeverityMedium), - // Threats: []*armsecurity.Threats{ - // to.Ptr(armsecurity.ThreatsDataExfiltration), - // to.Ptr(armsecurity.ThreatsDataSpillage), - // to.Ptr(armsecurity.ThreatsMaliciousInsider)}, - // UserImpact: to.Ptr(armsecurity.UserImpactHigh), - // PublishDates: &armsecurity.AssessmentMetadataPropertiesResponsePublishDates{ - // GA: to.Ptr("06/01/2021"), - // Public: to.Ptr("06/01/2021"), - // }, - // }, - // }, - // { - // Name: to.Ptr("ca039e75-a276-4175-aebc-bcd41e4b14b7"), - // Type: to.Ptr("Microsoft.Security/assessmentMetadata"), - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/ca039e75-a276-4175-aebc-bcd41e4b14b7"), - // Properties: &armsecurity.AssessmentMetadataPropertiesResponse{ - // Description: to.Ptr("Assessment that my organization created to view our security assessment in Azure Security Center"), - // AssessmentType: to.Ptr(armsecurity.AssessmentTypeCustomerManaged), - // Categories: []*armsecurity.Categories{ - // to.Ptr(armsecurity.CategoriesCompute)}, - // DisplayName: to.Ptr("My organization security assessment"), - // ImplementationEffort: to.Ptr(armsecurity.ImplementationEffortLow), - // RemediationDescription: to.Ptr("Fix it with these remediation instructions"), - // Severity: to.Ptr(armsecurity.SeverityMedium), - // Threats: []*armsecurity.Threats{ - // }, - // UserImpact: to.Ptr(armsecurity.UserImpactLow), - // PublishDates: &armsecurity.AssessmentMetadataPropertiesResponsePublishDates{ - // GA: to.Ptr("06/01/2021"), - // Public: to.Ptr("06/01/2021"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/GetAssessmentsMetadata_example.json -func ExampleAssessmentsMetadataClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAssessmentsMetadataClient().Get(ctx, "21300918-b2e3-0346-785f-c77ff57d243b", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AssessmentMetadataResponse = armsecurity.AssessmentMetadataResponse{ - // Name: to.Ptr("21300918-b2e3-0346-785f-c77ff57d243b"), - // Type: to.Ptr("Microsoft.Security/assessmentMetadata"), - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/21300918-b2e3-0346-785f-c77ff57d243b"), - // Properties: &armsecurity.AssessmentMetadataPropertiesResponse{ - // Description: to.Ptr("Install an endpoint protection solution on your virtual machines scale sets, to protect them from threats and vulnerabilities."), - // AssessmentType: to.Ptr(armsecurity.AssessmentTypeBuiltIn), - // Categories: []*armsecurity.Categories{ - // to.Ptr(armsecurity.CategoriesCompute)}, - // DisplayName: to.Ptr("Install endpoint protection solution on virtual machine scale sets"), - // ImplementationEffort: to.Ptr(armsecurity.ImplementationEffortLow), - // PolicyDefinitionID: to.Ptr("/providers/Microsoft.Authorization/policyDefinitions/26a828e1-e88f-464e-bbb3-c134a282b9de"), - // RemediationDescription: to.Ptr("To install an endpoint protection solution: 1. Follow the instructions in How do I turn on antimalware in my virtual machine scale set"), - // Severity: to.Ptr(armsecurity.SeverityMedium), - // Threats: []*armsecurity.Threats{ - // to.Ptr(armsecurity.ThreatsDataExfiltration), - // to.Ptr(armsecurity.ThreatsDataSpillage), - // to.Ptr(armsecurity.ThreatsMaliciousInsider)}, - // UserImpact: to.Ptr(armsecurity.UserImpactLow), - // PlannedDeprecationDate: to.Ptr("03/2022"), - // PublishDates: &armsecurity.AssessmentMetadataPropertiesResponsePublishDates{ - // GA: to.Ptr("06/01/2021"), - // Public: to.Ptr("06/01/2021"), - // }, - // Tactics: []*armsecurity.Tactics{ - // to.Ptr(armsecurity.TacticsCredentialAccess), - // to.Ptr(armsecurity.TacticsPersistence), - // to.Ptr(armsecurity.TacticsExecution), - // to.Ptr(armsecurity.TacticsDefenseEvasion), - // to.Ptr(armsecurity.TacticsCollection), - // to.Ptr(armsecurity.TacticsDiscovery), - // to.Ptr(armsecurity.TacticsPrivilegeEscalation)}, - // Techniques: []*armsecurity.Techniques{ - // to.Ptr(armsecurity.TechniquesObfuscatedFilesOrInformation), - // to.Ptr(armsecurity.TechniquesIngressToolTransfer), - // to.Ptr(armsecurity.TechniquesPhishing), - // to.Ptr(armsecurity.TechniquesUserExecution)}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/ListAssessmentsMetadata_subscription_example.json -func ExampleAssessmentsMetadataClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAssessmentsMetadataClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AssessmentMetadataResponseList = armsecurity.AssessmentMetadataResponseList{ - // Value: []*armsecurity.AssessmentMetadataResponse{ - // { - // Name: to.Ptr("21300918-b2e3-0346-785f-c77ff57d243b"), - // Type: to.Ptr("Microsoft.Security/assessmentMetadata"), - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/21300918-b2e3-0346-785f-c77ff57d243b"), - // Properties: &armsecurity.AssessmentMetadataPropertiesResponse{ - // Description: to.Ptr("Install an endpoint protection solution on your virtual machines scale sets, to protect them from threats and vulnerabilities."), - // AssessmentType: to.Ptr(armsecurity.AssessmentTypeBuiltIn), - // Categories: []*armsecurity.Categories{ - // to.Ptr(armsecurity.CategoriesCompute)}, - // DisplayName: to.Ptr("Install endpoint protection solution on virtual machine scale sets"), - // ImplementationEffort: to.Ptr(armsecurity.ImplementationEffortLow), - // PolicyDefinitionID: to.Ptr("/providers/Microsoft.Authorization/policyDefinitions/26a828e1-e88f-464e-bbb3-c134a282b9de"), - // RemediationDescription: to.Ptr("To install an endpoint protection solution: 1. Follow the instructions in How do I turn on antimalware in my virtual machine scale set"), - // Severity: to.Ptr(armsecurity.SeverityMedium), - // Threats: []*armsecurity.Threats{ - // to.Ptr(armsecurity.ThreatsDataExfiltration), - // to.Ptr(armsecurity.ThreatsDataSpillage), - // to.Ptr(armsecurity.ThreatsMaliciousInsider)}, - // UserImpact: to.Ptr(armsecurity.UserImpactLow), - // PlannedDeprecationDate: to.Ptr("03/2022"), - // PublishDates: &armsecurity.AssessmentMetadataPropertiesResponsePublishDates{ - // GA: to.Ptr("06/01/2021"), - // Public: to.Ptr("06/01/2021"), - // }, - // Tactics: []*armsecurity.Tactics{ - // to.Ptr(armsecurity.TacticsCredentialAccess), - // to.Ptr(armsecurity.TacticsPersistence), - // to.Ptr(armsecurity.TacticsExecution), - // to.Ptr(armsecurity.TacticsDefenseEvasion), - // to.Ptr(armsecurity.TacticsCollection), - // to.Ptr(armsecurity.TacticsDiscovery), - // to.Ptr(armsecurity.TacticsPrivilegeEscalation)}, - // Techniques: []*armsecurity.Techniques{ - // to.Ptr(armsecurity.TechniquesObfuscatedFilesOrInformation), - // to.Ptr(armsecurity.TechniquesIngressToolTransfer), - // to.Ptr(armsecurity.TechniquesPhishing), - // to.Ptr(armsecurity.TechniquesUserExecution)}, - // }, - // }, - // { - // Name: to.Ptr("bc303248-3d14-44c2-96a0-55f5c326b5fe"), - // Type: to.Ptr("Microsoft.Security/assessmentMetadata"), - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/bc303248-3d14-44c2-96a0-55f5c326b5fe"), - // Properties: &armsecurity.AssessmentMetadataPropertiesResponse{ - // Description: to.Ptr("Open remote management ports expose your VM to a high level of risk from internet-based attacks that attempt to brute force credentials to gain admin access to the machine."), - // AssessmentType: to.Ptr(armsecurity.AssessmentTypeCustomPolicy), - // Categories: []*armsecurity.Categories{ - // to.Ptr(armsecurity.CategoriesNetworking)}, - // DisplayName: to.Ptr("Close management ports on your virtual machines"), - // ImplementationEffort: to.Ptr(armsecurity.ImplementationEffortLow), - // PolicyDefinitionID: to.Ptr("/providers/Microsoft.Authorization/policyDefinitions/22730e10-96f6-4aac-ad84-9383d35b5917"), - // Preview: to.Ptr(true), - // RemediationDescription: to.Ptr("We recommend that you edit the inbound rules of the below virtual machines to restrict access to specific source ranges.
To restrict the access to your virtual machines: 1. Click on a VM from the list below 2. At the 'Networking' blade, click on each of the rules that allow management ports (e.g. RDP-3389, WINRM-5985, SSH-22) 3. Change the 'Action' property to 'Deny' 4. Click 'Save'"), - // Severity: to.Ptr(armsecurity.SeverityMedium), - // Threats: []*armsecurity.Threats{ - // to.Ptr(armsecurity.ThreatsDataExfiltration), - // to.Ptr(armsecurity.ThreatsDataSpillage), - // to.Ptr(armsecurity.ThreatsMaliciousInsider)}, - // UserImpact: to.Ptr(armsecurity.UserImpactHigh), - // PublishDates: &armsecurity.AssessmentMetadataPropertiesResponsePublishDates{ - // GA: to.Ptr("06/01/2021"), - // Public: to.Ptr("06/01/2021"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/GetAssessmentsMetadata_subscription_example.json -func ExampleAssessmentsMetadataClient_GetInSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAssessmentsMetadataClient().GetInSubscription(ctx, "21300918-b2e3-0346-785f-c77ff57d243b", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AssessmentMetadataResponse = armsecurity.AssessmentMetadataResponse{ - // Name: to.Ptr("21300918-b2e3-0346-785f-c77ff57d243b"), - // Type: to.Ptr("Microsoft.Security/assessmentMetadata"), - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/21300918-b2e3-0346-785f-c77ff57d243b"), - // Properties: &armsecurity.AssessmentMetadataPropertiesResponse{ - // Description: to.Ptr("Install an endpoint protection solution on your virtual machines scale sets, to protect them from threats and vulnerabilities."), - // AssessmentType: to.Ptr(armsecurity.AssessmentTypeBuiltIn), - // Categories: []*armsecurity.Categories{ - // to.Ptr(armsecurity.CategoriesCompute)}, - // DisplayName: to.Ptr("Install endpoint protection solution on virtual machine scale sets"), - // ImplementationEffort: to.Ptr(armsecurity.ImplementationEffortLow), - // PolicyDefinitionID: to.Ptr("/providers/Microsoft.Authorization/policyDefinitions/26a828e1-e88f-464e-bbb3-c134a282b9de"), - // RemediationDescription: to.Ptr("To install an endpoint protection solution: 1. Follow the instructions in How do I turn on antimalware in my virtual machine scale set"), - // Severity: to.Ptr(armsecurity.SeverityMedium), - // Threats: []*armsecurity.Threats{ - // to.Ptr(armsecurity.ThreatsDataExfiltration), - // to.Ptr(armsecurity.ThreatsDataSpillage), - // to.Ptr(armsecurity.ThreatsMaliciousInsider)}, - // UserImpact: to.Ptr(armsecurity.UserImpactLow), - // PlannedDeprecationDate: to.Ptr("03/2022"), - // PublishDates: &armsecurity.AssessmentMetadataPropertiesResponsePublishDates{ - // GA: to.Ptr("06/01/2021"), - // Public: to.Ptr("06/01/2021"), - // }, - // Tactics: []*armsecurity.Tactics{ - // to.Ptr(armsecurity.TacticsCredentialAccess), - // to.Ptr(armsecurity.TacticsPersistence), - // to.Ptr(armsecurity.TacticsExecution), - // to.Ptr(armsecurity.TacticsDefenseEvasion), - // to.Ptr(armsecurity.TacticsCollection), - // to.Ptr(armsecurity.TacticsDiscovery), - // to.Ptr(armsecurity.TacticsPrivilegeEscalation)}, - // Techniques: []*armsecurity.Techniques{ - // to.Ptr(armsecurity.TechniquesObfuscatedFilesOrInformation), - // to.Ptr(armsecurity.TechniquesIngressToolTransfer), - // to.Ptr(armsecurity.TechniquesPhishing), - // to.Ptr(armsecurity.TechniquesUserExecution)}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/CreateAssessmentsMetadata_subscription_example.json -func ExampleAssessmentsMetadataClient_CreateInSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAssessmentsMetadataClient().CreateInSubscription(ctx, "ca039e75-a276-4175-aebc-bcd41e4b14b7", armsecurity.AssessmentMetadataResponse{ - Properties: &armsecurity.AssessmentMetadataPropertiesResponse{ - Description: to.Ptr("Install an endpoint protection solution on your virtual machines scale sets, to protect them from threats and vulnerabilities."), - AssessmentType: to.Ptr(armsecurity.AssessmentTypeCustomerManaged), - Categories: []*armsecurity.Categories{ - to.Ptr(armsecurity.CategoriesCompute)}, - DisplayName: to.Ptr("Install endpoint protection solution on virtual machine scale sets"), - ImplementationEffort: to.Ptr(armsecurity.ImplementationEffortLow), - RemediationDescription: to.Ptr("To install an endpoint protection solution: 1. Follow the instructions in How do I turn on antimalware in my virtual machine scale set"), - Severity: to.Ptr(armsecurity.SeverityMedium), - Threats: []*armsecurity.Threats{ - to.Ptr(armsecurity.ThreatsDataExfiltration), - to.Ptr(armsecurity.ThreatsDataSpillage), - to.Ptr(armsecurity.ThreatsMaliciousInsider)}, - UserImpact: to.Ptr(armsecurity.UserImpactLow), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AssessmentMetadataResponse = armsecurity.AssessmentMetadataResponse{ - // Name: to.Ptr("ca039e75-a276-4175-aebc-bcd41e4b14b7"), - // Type: to.Ptr("Microsoft.Security/assessmentMetadata"), - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/ca039e75-a276-4175-aebc-bcd41e4b14b7"), - // Properties: &armsecurity.AssessmentMetadataPropertiesResponse{ - // Description: to.Ptr("Assessment that my organization created to view our security assessment in Azure Security Center"), - // AssessmentType: to.Ptr(armsecurity.AssessmentTypeCustomerManaged), - // Categories: []*armsecurity.Categories{ - // to.Ptr(armsecurity.CategoriesCompute)}, - // DisplayName: to.Ptr("My organization security assessment"), - // ImplementationEffort: to.Ptr(armsecurity.ImplementationEffortLow), - // RemediationDescription: to.Ptr("Fix it with these remediation instructions"), - // Severity: to.Ptr(armsecurity.SeverityMedium), - // Threats: []*armsecurity.Threats{ - // to.Ptr(armsecurity.ThreatsDataExfiltration), - // to.Ptr(armsecurity.ThreatsDataSpillage), - // to.Ptr(armsecurity.ThreatsMaliciousInsider)}, - // UserImpact: to.Ptr(armsecurity.UserImpactLow), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/DeleteAssessmentsMetadata_subscription_example.json -func ExampleAssessmentsMetadataClient_DeleteInSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAssessmentsMetadataClient().DeleteInSubscription(ctx, "ca039e75-a276-4175-aebc-bcd41e4b14b7", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/automations_client_example_test.go b/sdk/resourcemanager/security/armsecurity/automations_client_example_test.go deleted file mode 100644 index f9926d815f11..000000000000 --- a/sdk/resourcemanager/security/armsecurity/automations_client_example_test.go +++ /dev/null @@ -1,531 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/GetAutomationsSubscription_example.json -func ExampleAutomationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAutomationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AutomationList = armsecurity.AutomationList{ - // Value: []*armsecurity.Automation{ - // { - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Name: to.Ptr("exampleAutomation"), - // Type: to.Ptr("Microsoft.Security/automations"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/automations/exampleAutomation"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.AutomationProperties{ - // Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment"), - // Actions: []armsecurity.AutomationActionClassification{ - // &armsecurity.AutomationActionLogicApp{ - // ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - // LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - // }}, - // IsEnabled: to.Ptr(true), - // Scopes: []*armsecurity.AutomationScope{ - // { - // Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - // ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - // }}, - // Sources: []*armsecurity.AutomationSource{ - // { - // EventSource: to.Ptr(armsecurity.EventSourceAssessments), - // RuleSets: []*armsecurity.AutomationRuleSet{ - // { - // Rules: []*armsecurity.AutomationTriggeringRule{ - // { - // ExpectedValue: to.Ptr("customAssessment"), - // Operator: to.Ptr(armsecurity.OperatorEquals), - // PropertyJPath: to.Ptr("$.Entity.AssessmentType"), - // PropertyType: to.Ptr(armsecurity.PropertyTypeString), - // }}, - // }}, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/GetAutomationsResourceGroup_example.json -func ExampleAutomationsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAutomationsClient().NewListByResourceGroupPager("exampleResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AutomationList = armsecurity.AutomationList{ - // Value: []*armsecurity.Automation{ - // { - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Name: to.Ptr("exampleAutomation"), - // Type: to.Ptr("Microsoft.Security/automations"), - // ID: to.Ptr("/subscriptions/e4272367-5645-4c4e-9c67-3b74b59a6982/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/automations/exampleAutomation"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.AutomationProperties{ - // Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment"), - // Actions: []armsecurity.AutomationActionClassification{ - // &armsecurity.AutomationActionLogicApp{ - // ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - // LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - // }}, - // IsEnabled: to.Ptr(true), - // Scopes: []*armsecurity.AutomationScope{ - // { - // Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - // ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - // }}, - // Sources: []*armsecurity.AutomationSource{ - // { - // EventSource: to.Ptr(armsecurity.EventSourceAssessments), - // RuleSets: []*armsecurity.AutomationRuleSet{ - // { - // Rules: []*armsecurity.AutomationTriggeringRule{ - // { - // ExpectedValue: to.Ptr("customAssessment"), - // Operator: to.Ptr(armsecurity.OperatorEquals), - // PropertyJPath: to.Ptr("$.Entity.AssessmentType"), - // PropertyType: to.Ptr(armsecurity.PropertyTypeString), - // }}, - // }}, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/GetAutomationResourceGroup_example.json -func ExampleAutomationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutomationsClient().Get(ctx, "exampleResourceGroup", "exampleAutomation", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Automation = armsecurity.Automation{ - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Name: to.Ptr("exampleAutomation"), - // Type: to.Ptr("Microsoft.Security/automations"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/automations/exampleAutomation"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.AutomationProperties{ - // Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment"), - // Actions: []armsecurity.AutomationActionClassification{ - // &armsecurity.AutomationActionLogicApp{ - // ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - // LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - // }}, - // IsEnabled: to.Ptr(true), - // Scopes: []*armsecurity.AutomationScope{ - // { - // Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - // ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - // }}, - // Sources: []*armsecurity.AutomationSource{ - // { - // EventSource: to.Ptr(armsecurity.EventSourceAssessments), - // RuleSets: []*armsecurity.AutomationRuleSet{ - // { - // Rules: []*armsecurity.AutomationTriggeringRule{ - // { - // ExpectedValue: to.Ptr("customAssessment"), - // Operator: to.Ptr(armsecurity.OperatorEquals), - // PropertyJPath: to.Ptr("$.Entity.AssessmentType"), - // PropertyType: to.Ptr(armsecurity.PropertyTypeString), - // }}, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/PutAutomationAllAssessments_example.json -func ExampleAutomationsClient_CreateOrUpdate_createOrUpdateASecurityAutomationForAllAssessmentsIncludingAllSeverities() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutomationsClient().CreateOrUpdate(ctx, "exampleResourceGroup", "exampleAutomation", armsecurity.Automation{ - Location: to.Ptr("Central US"), - Etag: to.Ptr("etag value (must be supplied for update)"), - Tags: map[string]*string{}, - Properties: &armsecurity.AutomationProperties{ - Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment"), - Actions: []armsecurity.AutomationActionClassification{ - &armsecurity.AutomationActionLogicApp{ - ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - URI: to.Ptr("https://exampleTriggerUri1.com"), - }}, - IsEnabled: to.Ptr(true), - Scopes: []*armsecurity.AutomationScope{ - { - Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - }}, - Sources: []*armsecurity.AutomationSource{ - { - EventSource: to.Ptr(armsecurity.EventSourceAssessments), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Automation = armsecurity.Automation{ - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("new etag value"), - // Name: to.Ptr("exampleAutomation"), - // Type: to.Ptr("Microsoft.Security/automations"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/automations/exampleAutomation"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.AutomationProperties{ - // Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment"), - // Actions: []armsecurity.AutomationActionClassification{ - // &armsecurity.AutomationActionLogicApp{ - // ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - // LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - // }}, - // IsEnabled: to.Ptr(true), - // Scopes: []*armsecurity.AutomationScope{ - // { - // Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - // ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - // }}, - // Sources: []*armsecurity.AutomationSource{ - // { - // EventSource: to.Ptr(armsecurity.EventSourceAssessments), - // RuleSets: []*armsecurity.AutomationRuleSet{ - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/PutAutomationHighSeverityAssessments_example.json -func ExampleAutomationsClient_CreateOrUpdate_createOrUpdateASecurityAutomationForAllHighSeverityAssessments() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutomationsClient().CreateOrUpdate(ctx, "exampleResourceGroup", "exampleAutomation", armsecurity.Automation{ - Location: to.Ptr("Central US"), - Etag: to.Ptr("etag value (must be supplied for update)"), - Tags: map[string]*string{}, - Properties: &armsecurity.AutomationProperties{ - Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any high severity security assessment"), - Actions: []armsecurity.AutomationActionClassification{ - &armsecurity.AutomationActionLogicApp{ - ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - URI: to.Ptr("https://exampleTriggerUri1.com"), - }}, - IsEnabled: to.Ptr(true), - Scopes: []*armsecurity.AutomationScope{ - { - Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - }}, - Sources: []*armsecurity.AutomationSource{ - { - EventSource: to.Ptr(armsecurity.EventSourceAssessments), - RuleSets: []*armsecurity.AutomationRuleSet{ - { - Rules: []*armsecurity.AutomationTriggeringRule{ - { - ExpectedValue: to.Ptr("High"), - Operator: to.Ptr(armsecurity.OperatorEquals), - PropertyJPath: to.Ptr("properties.metadata.severity"), - PropertyType: to.Ptr(armsecurity.PropertyTypeString), - }}, - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Automation = armsecurity.Automation{ - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("new etag value"), - // Name: to.Ptr("exampleAutomation"), - // Type: to.Ptr("Microsoft.Security/automations"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/automations/exampleAutomation"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.AutomationProperties{ - // Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any high severity security assessment"), - // Actions: []armsecurity.AutomationActionClassification{ - // &armsecurity.AutomationActionLogicApp{ - // ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - // LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - // }}, - // IsEnabled: to.Ptr(true), - // Scopes: []*armsecurity.AutomationScope{ - // { - // Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - // ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - // }}, - // Sources: []*armsecurity.AutomationSource{ - // { - // EventSource: to.Ptr(armsecurity.EventSourceAssessments), - // RuleSets: []*armsecurity.AutomationRuleSet{ - // { - // Rules: []*armsecurity.AutomationTriggeringRule{ - // { - // ExpectedValue: to.Ptr("High"), - // Operator: to.Ptr(armsecurity.OperatorEquals), - // PropertyJPath: to.Ptr("properties.metadata.severity"), - // PropertyType: to.Ptr(armsecurity.PropertyTypeString), - // }}, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/PutDisableAutomation_example.json -func ExampleAutomationsClient_CreateOrUpdate_disableOrEnableASecurityAutomation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutomationsClient().CreateOrUpdate(ctx, "exampleResourceGroup", "exampleAutomation", armsecurity.Automation{ - Location: to.Ptr("Central US"), - Etag: to.Ptr("etag value (must be supplied for update)"), - Tags: map[string]*string{}, - Properties: &armsecurity.AutomationProperties{ - Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment"), - Actions: []armsecurity.AutomationActionClassification{ - &armsecurity.AutomationActionLogicApp{ - ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - URI: to.Ptr("https://exampleTriggerUri1.com"), - }}, - IsEnabled: to.Ptr(false), - Scopes: []*armsecurity.AutomationScope{ - { - Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - }}, - Sources: []*armsecurity.AutomationSource{ - { - EventSource: to.Ptr(armsecurity.EventSourceAssessments), - RuleSets: []*armsecurity.AutomationRuleSet{ - { - Rules: []*armsecurity.AutomationTriggeringRule{ - { - ExpectedValue: to.Ptr("customAssessment"), - Operator: to.Ptr(armsecurity.OperatorEquals), - PropertyJPath: to.Ptr("$.Entity.AssessmentType"), - PropertyType: to.Ptr(armsecurity.PropertyTypeString), - }}, - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Automation = armsecurity.Automation{ - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("new etag value"), - // Name: to.Ptr("exampleAutomation"), - // Type: to.Ptr("Microsoft.Security/automations"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/automations/exampleAutomation"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.AutomationProperties{ - // Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment"), - // Actions: []armsecurity.AutomationActionClassification{ - // &armsecurity.AutomationActionLogicApp{ - // ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - // LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - // }}, - // IsEnabled: to.Ptr(false), - // Scopes: []*armsecurity.AutomationScope{ - // { - // Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - // ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - // }}, - // Sources: []*armsecurity.AutomationSource{ - // { - // EventSource: to.Ptr(armsecurity.EventSourceAssessments), - // RuleSets: []*armsecurity.AutomationRuleSet{ - // { - // Rules: []*armsecurity.AutomationTriggeringRule{ - // { - // ExpectedValue: to.Ptr("customAssessment"), - // Operator: to.Ptr(armsecurity.OperatorEquals), - // PropertyJPath: to.Ptr("$.Entity.AssessmentType"), - // PropertyType: to.Ptr(armsecurity.PropertyTypeString), - // }}, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/DeleteAutomation_example.json -func ExampleAutomationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAutomationsClient().Delete(ctx, "myRg", "myAutomationName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/ValidateAutomation_example.json -func ExampleAutomationsClient_Validate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutomationsClient().Validate(ctx, "exampleResourceGroup", "exampleAutomation", armsecurity.Automation{ - Location: to.Ptr("Central US"), - Tags: map[string]*string{}, - Properties: &armsecurity.AutomationProperties{ - Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment"), - Actions: []armsecurity.AutomationActionClassification{ - &armsecurity.AutomationActionLogicApp{ - ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - URI: to.Ptr("https://exampleTriggerUri1.com"), - }}, - IsEnabled: to.Ptr(true), - Scopes: []*armsecurity.AutomationScope{ - { - Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - }}, - Sources: []*armsecurity.AutomationSource{ - { - EventSource: to.Ptr(armsecurity.EventSourceAssessments), - RuleSets: []*armsecurity.AutomationRuleSet{ - { - Rules: []*armsecurity.AutomationTriggeringRule{ - { - ExpectedValue: to.Ptr("customAssessment"), - Operator: to.Ptr(armsecurity.OperatorEquals), - PropertyJPath: to.Ptr("$.Entity.AssessmentType"), - PropertyType: to.Ptr(armsecurity.PropertyTypeString), - }}, - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutomationValidationStatus = armsecurity.AutomationValidationStatus{ - // IsValid: to.Ptr(true), - // Message: to.Ptr("Validation Successful"), - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/autoprovisioningsettings_client_example_test.go b/sdk/resourcemanager/security/armsecurity/autoprovisioningsettings_client_example_test.go deleted file mode 100644 index d58386973274..000000000000 --- a/sdk/resourcemanager/security/armsecurity/autoprovisioningsettings_client_example_test.go +++ /dev/null @@ -1,118 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/AutoProvisioningSettings/GetAutoProvisioningSettingsSubscription_example.json -func ExampleAutoProvisioningSettingsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAutoProvisioningSettingsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AutoProvisioningSettingList = armsecurity.AutoProvisioningSettingList{ - // Value: []*armsecurity.AutoProvisioningSetting{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/autoProvisioningSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/autoProvisioningSettings/default"), - // Properties: &armsecurity.AutoProvisioningSettingProperties{ - // AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/AutoProvisioningSettings/GetAutoProvisioningSettingSubscription_example.json -func ExampleAutoProvisioningSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutoProvisioningSettingsClient().Get(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutoProvisioningSetting = armsecurity.AutoProvisioningSetting{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/autoProvisioningSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/autoProvisioningSettings/default"), - // Properties: &armsecurity.AutoProvisioningSettingProperties{ - // AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/AutoProvisioningSettings/CreateAutoProvisioningSettingsSubscription_example.json -func ExampleAutoProvisioningSettingsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutoProvisioningSettingsClient().Create(ctx, "default", armsecurity.AutoProvisioningSetting{ - Name: to.Ptr("default"), - Type: to.Ptr("Microsoft.Security/autoProvisioningSettings"), - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/autoProvisioningSettings/default"), - Properties: &armsecurity.AutoProvisioningSettingProperties{ - AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutoProvisioningSetting = armsecurity.AutoProvisioningSetting{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/autoProvisioningSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/autoProvisioningSettings/default"), - // Properties: &armsecurity.AutoProvisioningSettingProperties{ - // AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/autorest.md b/sdk/resourcemanager/security/armsecurity/autorest.md index 1bfc30ad38ae..47aabc7eb588 100644 --- a/sdk/resourcemanager/security/armsecurity/autorest.md +++ b/sdk/resourcemanager/security/armsecurity/autorest.md @@ -4,10 +4,9 @@ ``` yaml azure-arm: true -tag: package-composite-v3 require: -- https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/security/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/security/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION module-version: 0.10.0 modelerfour: diff --git a/sdk/resourcemanager/security/armsecurity/client_factory.go b/sdk/resourcemanager/security/armsecurity/client_factory.go index 5f62d6c8327d..9aee6e48ffcb 100644 --- a/sdk/resourcemanager/security/armsecurity/client_factory.go +++ b/sdk/resourcemanager/security/armsecurity/client_factory.go @@ -243,97 +243,102 @@ func (c *ClientFactory) NewAccountConnectorsClient() *AccountConnectorsClient { return subClient } -func (c *ClientFactory) NewSQLVulnerabilityAssessmentScansClient() *SQLVulnerabilityAssessmentScansClient { - subClient, _ := NewSQLVulnerabilityAssessmentScansClient(c.credential, c.options) +func (c *ClientFactory) NewAlertsClient() *AlertsClient { + subClient, _ := NewAlertsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSQLVulnerabilityAssessmentScanResultsClient() *SQLVulnerabilityAssessmentScanResultsClient { - subClient, _ := NewSQLVulnerabilityAssessmentScanResultsClient(c.credential, c.options) +func (c *ClientFactory) NewSettingsClient() *SettingsClient { + subClient, _ := NewSettingsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSQLVulnerabilityAssessmentBaselineRulesClient() *SQLVulnerabilityAssessmentBaselineRulesClient { - subClient, _ := NewSQLVulnerabilityAssessmentBaselineRulesClient(c.credential, c.options) +func (c *ClientFactory) NewIngestionSettingsClient() *IngestionSettingsClient { + subClient, _ := NewIngestionSettingsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAlertsClient() *AlertsClient { - subClient, _ := NewAlertsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSoftwareInventoriesClient() *SoftwareInventoriesClient { + subClient, _ := NewSoftwareInventoriesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSettingsClient() *SettingsClient { - subClient, _ := NewSettingsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewGovernanceRulesClient() *GovernanceRulesClient { + subClient, _ := NewGovernanceRulesClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewIngestionSettingsClient() *IngestionSettingsClient { - subClient, _ := NewIngestionSettingsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewGovernanceAssignmentsClient() *GovernanceAssignmentsClient { + subClient, _ := NewGovernanceAssignmentsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewSoftwareInventoriesClient() *SoftwareInventoriesClient { - subClient, _ := NewSoftwareInventoriesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewApplicationsClient() *ApplicationsClient { + subClient, _ := NewApplicationsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewConnectorsClient() *ConnectorsClient { - subClient, _ := NewConnectorsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewApplicationClient() *ApplicationClient { + subClient, _ := NewApplicationClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewGovernanceRuleClient() *GovernanceRuleClient { - subClient, _ := NewGovernanceRuleClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewConnectorApplicationsClient() *ConnectorApplicationsClient { + subClient, _ := NewConnectorApplicationsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewGovernanceRulesClient() *GovernanceRulesClient { - subClient, _ := NewGovernanceRulesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewConnectorApplicationClient() *ConnectorApplicationClient { + subClient, _ := NewConnectorApplicationClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewConnectorGovernanceRuleClient() *ConnectorGovernanceRuleClient { - subClient, _ := NewConnectorGovernanceRuleClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAPICollectionClient() *APICollectionClient { + subClient, _ := NewAPICollectionClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewConnectorGovernanceRulesClient() *ConnectorGovernanceRulesClient { - subClient, _ := NewConnectorGovernanceRulesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAPICollectionOnboardingClient() *APICollectionOnboardingClient { + subClient, _ := NewAPICollectionOnboardingClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSubscriptionGovernanceRulesExecuteStatusClient() *SubscriptionGovernanceRulesExecuteStatusClient { - subClient, _ := NewSubscriptionGovernanceRulesExecuteStatusClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAPICollectionOffboardingClient() *APICollectionOffboardingClient { + subClient, _ := NewAPICollectionOffboardingClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewConnectorGovernanceRulesExecuteStatusClient() *ConnectorGovernanceRulesExecuteStatusClient { - subClient, _ := NewConnectorGovernanceRulesExecuteStatusClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewHealthReportsClient() *HealthReportsClient { + subClient, _ := NewHealthReportsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewGovernanceAssignmentsClient() *GovernanceAssignmentsClient { - subClient, _ := NewGovernanceAssignmentsClient(c.credential, c.options) +func (c *ClientFactory) NewHealthReportClient() *HealthReportClient { + subClient, _ := NewHealthReportClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewApplicationsClient() *ApplicationsClient { - subClient, _ := NewApplicationsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSQLVulnerabilityAssessmentScansClient() *SQLVulnerabilityAssessmentScansClient { + subClient, _ := NewSQLVulnerabilityAssessmentScansClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewApplicationClient() *ApplicationClient { - subClient, _ := NewApplicationClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSQLVulnerabilityAssessmentScanResultsClient() *SQLVulnerabilityAssessmentScanResultsClient { + subClient, _ := NewSQLVulnerabilityAssessmentScanResultsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewConnectorApplicationsClient() *ConnectorApplicationsClient { - subClient, _ := NewConnectorApplicationsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSQLVulnerabilityAssessmentBaselineRulesClient() *SQLVulnerabilityAssessmentBaselineRulesClient { + subClient, _ := NewSQLVulnerabilityAssessmentBaselineRulesClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewConnectorApplicationClient() *ConnectorApplicationClient { - subClient, _ := NewConnectorApplicationClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewConnectorsClient() *ConnectorsClient { + subClient, _ := NewConnectorsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewOperatorsClient() *OperatorsClient { + subClient, _ := NewOperatorsClient(c.subscriptionID, c.credential, c.options) return subClient } diff --git a/sdk/resourcemanager/security/armsecurity/complianceresults_client_example_test.go b/sdk/resourcemanager/security/armsecurity/complianceresults_client_example_test.go deleted file mode 100644 index 40c9cda6140a..000000000000 --- a/sdk/resourcemanager/security/armsecurity/complianceresults_client_example_test.go +++ /dev/null @@ -1,98 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2017-08-01/examples/ComplianceResults/ListComplianceResults_example.json -func ExampleComplianceResultsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewComplianceResultsClient().NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ComplianceResultList = armsecurity.ComplianceResultList{ - // Value: []*armsecurity.ComplianceResult{ - // { - // Name: to.Ptr("DesignateMoreThanOneOwner"), - // Type: to.Ptr("Microsoft.Security/complianceResults"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/complianceResults/DesignateMoreThanOneOwner"), - // Properties: &armsecurity.ComplianceResultProperties{ - // ResourceStatus: to.Ptr(armsecurity.ResourceStatusHealthy), - // }, - // }, - // { - // Name: to.Ptr("RemoveExternalAccountsWithReadPermissions"), - // Type: to.Ptr("Microsoft.Security/complianceResults"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/complianceResults/RemoveExternalAccountsWithReadPermissions"), - // Properties: &armsecurity.ComplianceResultProperties{ - // ResourceStatus: to.Ptr(armsecurity.ResourceStatusNotHealthy), - // }, - // }, - // { - // Name: to.Ptr("RemoveDeprecatedAccounts"), - // Type: to.Ptr("Microsoft.Security/complianceResults"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/complianceResults/RemoveDeprecatedAccounts"), - // Properties: &armsecurity.ComplianceResultProperties{ - // ResourceStatus: to.Ptr(armsecurity.ResourceStatusHealthy), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2017-08-01/examples/ComplianceResults/GetComplianceResults_example.json -func ExampleComplianceResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewComplianceResultsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "DesignateMoreThanOneOwner", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ComplianceResult = armsecurity.ComplianceResult{ - // Name: to.Ptr("DesignateMoreThanOneOwner"), - // Type: to.Ptr("Microsoft.Security/complianceResults"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/complianceResults/DesignateMoreThanOneOwner"), - // Properties: &armsecurity.ComplianceResultProperties{ - // ResourceStatus: to.Ptr(armsecurity.ResourceStatusHealthy), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/compliances_client_example_test.go b/sdk/resourcemanager/security/armsecurity/compliances_client_example_test.go deleted file mode 100644 index 4ffccdd4ddfe..000000000000 --- a/sdk/resourcemanager/security/armsecurity/compliances_client_example_test.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/Compliances/GetCompliances_example.json -func ExampleCompliancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCompliancesClient().NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ComplianceList = armsecurity.ComplianceList{ - // Value: []*armsecurity.Compliance{ - // { - // Name: to.Ptr("2018-01-01Z"), - // Type: to.Ptr("Microsoft.Security/compliances"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/compliances/2018-01-01Z"), - // Properties: &armsecurity.ComplianceProperties{ - // AssessmentResult: []*armsecurity.ComplianceSegment{ - // { - // Percentage: to.Ptr[float64](77.77777777777779), - // SegmentType: to.Ptr("Compliant"), - // }}, - // AssessmentTimestampUTCDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00Z"); return t}()), - // ResourceCount: to.Ptr[int32](18), - // }, - // }, - // { - // Name: to.Ptr("2018-01-02Z"), - // Type: to.Ptr("Microsoft.Security/compliances"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/compliances/2018-01-02Z"), - // Properties: &armsecurity.ComplianceProperties{ - // AssessmentResult: []*armsecurity.ComplianceSegment{ - // { - // Percentage: to.Ptr[float64](94.44444444444444), - // SegmentType: to.Ptr("Compliant"), - // }}, - // AssessmentTimestampUTCDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-02T00:00:00Z"); return t}()), - // ResourceCount: to.Ptr[int32](18), - // }, - // }, - // { - // Name: to.Ptr("2018-01-03Z"), - // Type: to.Ptr("Microsoft.Security/compliances"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/compliances/2018-01-03Z"), - // Properties: &armsecurity.ComplianceProperties{ - // AssessmentResult: []*armsecurity.ComplianceSegment{ - // { - // Percentage: to.Ptr[float64](100), - // SegmentType: to.Ptr("Compliant"), - // }}, - // AssessmentTimestampUTCDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-03T00:00:00Z"); return t}()), - // ResourceCount: to.Ptr[int32](18), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/Compliances/GetCompliance_example.json -func ExampleCompliancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCompliancesClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "2018-01-01Z", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Compliance = armsecurity.Compliance{ - // Name: to.Ptr("2018-01-01Z"), - // Type: to.Ptr("Microsoft.Security/compliances"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/compliances/2018-01-01Z"), - // Properties: &armsecurity.ComplianceProperties{ - // AssessmentResult: []*armsecurity.ComplianceSegment{ - // { - // Percentage: to.Ptr[float64](77.77777777777779), - // SegmentType: to.Ptr("Compliant"), - // }}, - // AssessmentTimestampUTCDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00Z"); return t}()), - // ResourceCount: to.Ptr[int32](18), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/connectorapplication_client_example_test.go b/sdk/resourcemanager/security/armsecurity/connectorapplication_client_example_test.go deleted file mode 100644 index add3e137c9cd..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectorapplication_client_example_test.go +++ /dev/null @@ -1,132 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/GetSecurityConnectorApplication_example.json -func ExampleConnectorApplicationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectorApplicationClient().Get(ctx, "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Application = armsecurity.Application{ - // Name: to.Ptr("ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Type: to.Ptr("Microsoft.Security/applications"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector/providers/Microsoft.Security/applications/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.ApplicationProperties{ - // Description: to.Ptr("An application on critical GCP recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "contains", - // "property": "$.Id", - // "value": "-bil-", - // }, - // }, - // }}, - // DisplayName: to.Ptr("GCP Admin's application"), - // SourceResourceType: to.Ptr(armsecurity.ApplicationSourceResourceTypeAssessments), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/PutSecurityConnectorApplication_example.json -func ExampleConnectorApplicationClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectorApplicationClient().CreateOrUpdate(ctx, "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", armsecurity.Application{ - Properties: &armsecurity.ApplicationProperties{ - Description: to.Ptr("An application on critical GCP recommendations"), - ConditionSets: []any{ - map[string]any{ - "conditions": []any{ - map[string]any{ - "operator": "contains", - "property": "$.Id", - "value": "-prod-", - }, - }, - }}, - DisplayName: to.Ptr("GCP Admin's application"), - SourceResourceType: to.Ptr(armsecurity.ApplicationSourceResourceTypeAssessments), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Application = armsecurity.Application{ - // Name: to.Ptr("1f3afdf9-d0c9-4c3d-847f-89da613e70a8"), - // Type: to.Ptr("Microsoft.Security/applications"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector/providers/Microsoft.Security/applications/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.ApplicationProperties{ - // Description: to.Ptr("An application on critical GCP recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "contains", - // "property": "$.Id", - // "value": "-bil-", - // }, - // }, - // }}, - // DisplayName: to.Ptr("GCP Admin's application"), - // SourceResourceType: to.Ptr(armsecurity.ApplicationSourceResourceTypeAssessments), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/DeleteSecurityConnectorApplication_example.json -func ExampleConnectorApplicationClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewConnectorApplicationClient().Delete(ctx, "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/connectorapplications_client_example_test.go b/sdk/resourcemanager/security/armsecurity/connectorapplications_client_example_test.go deleted file mode 100644 index b32fd11501a2..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectorapplications_client_example_test.go +++ /dev/null @@ -1,86 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ListBySecurityConnectorApplications_example.json -func ExampleConnectorApplicationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConnectorApplicationsClient().NewListPager("gcpResourceGroup", "gcpconnector", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ApplicationsList = armsecurity.ApplicationsList{ - // Value: []*armsecurity.Application{ - // { - // Name: to.Ptr("ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Type: to.Ptr("Microsoft.Security/applications"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector/providers/Microsoft.Security/applications/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.ApplicationProperties{ - // Description: to.Ptr("An application on critical GCP recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "contains", - // "property": "$.Id", - // "value": "-bil-", - // }, - // }, - // }}, - // DisplayName: to.Ptr("Admin's GCP application"), - // SourceResourceType: to.Ptr(armsecurity.ApplicationSourceResourceTypeAssessments), - // }, - // }, - // { - // Name: to.Ptr("4106f43c-6d82-4fc8-a92c-dcfe50799d1d"), - // Type: to.Ptr("Microsoft.Security/applications"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector/providers/Microsoft.Security/applications/4106f43c-6d82-4fc8-a92c-dcfe50799d1d"), - // Properties: &armsecurity.ApplicationProperties{ - // Description: to.Ptr("An application on critical GCP recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "contains", - // "property": "$.Id", - // "value": "-prod-", - // }, - // }, - // }}, - // DisplayName: to.Ptr("GCP Admin's application"), - // SourceResourceType: to.Ptr(armsecurity.ApplicationSourceResourceTypeAssessments), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/connectorgovernancerule_client.go b/sdk/resourcemanager/security/armsecurity/connectorgovernancerule_client.go deleted file mode 100644 index 5e2aeabc43ab..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectorgovernancerule_client.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ConnectorGovernanceRuleClient contains the methods for the SecurityConnectorGovernanceRule group. -// Don't use this type directly, use NewConnectorGovernanceRuleClient() instead. -type ConnectorGovernanceRuleClient struct { - internal *arm.Client - subscriptionID string -} - -// NewConnectorGovernanceRuleClient creates a new instance of ConnectorGovernanceRuleClient with the specified values. -// - subscriptionID - Azure subscription ID -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewConnectorGovernanceRuleClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectorGovernanceRuleClient, error) { - cl, err := arm.NewClient(moduleName+".ConnectorGovernanceRuleClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ConnectorGovernanceRuleClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListPager - Get a list of all relevant governanceRules over a security connector level scope -// -// Generated from API version 2022-01-01-preview -// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// - securityConnectorName - The security connector name. -// - options - ConnectorGovernanceRuleClientListOptions contains the optional parameters for the ConnectorGovernanceRuleClient.NewListPager -// method. -func (client *ConnectorGovernanceRuleClient) NewListPager(resourceGroupName string, securityConnectorName string, options *ConnectorGovernanceRuleClientListOptions) *runtime.Pager[ConnectorGovernanceRuleClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ConnectorGovernanceRuleClientListResponse]{ - More: func(page ConnectorGovernanceRuleClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ConnectorGovernanceRuleClientListResponse) (ConnectorGovernanceRuleClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, securityConnectorName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ConnectorGovernanceRuleClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ConnectorGovernanceRuleClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ConnectorGovernanceRuleClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ConnectorGovernanceRuleClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, options *ConnectorGovernanceRuleClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if securityConnectorName == "" { - return nil, errors.New("parameter securityConnectorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ConnectorGovernanceRuleClient) listHandleResponse(resp *http.Response) (ConnectorGovernanceRuleClientListResponse, error) { - result := ConnectorGovernanceRuleClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GovernanceRuleList); err != nil { - return ConnectorGovernanceRuleClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/security/armsecurity/connectorgovernancerule_client_example_test.go b/sdk/resourcemanager/security/armsecurity/connectorgovernancerule_client_example_test.go deleted file mode 100644 index 328c8e4df2a4..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectorgovernancerule_client_example_test.go +++ /dev/null @@ -1,112 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ListBySecurityConnectorGovernanceRules_example.json -func ExampleConnectorGovernanceRuleClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConnectorGovernanceRuleClient().NewListPager("gcpResourceGroup", "gcpconnector", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GovernanceRuleList = armsecurity.GovernanceRuleList{ - // Value: []*armsecurity.GovernanceRule{ - // { - // Name: to.Ptr("ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Type: to.Ptr("Microsoft.Security/governanceRules"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.GovernanceRuleProperties{ - // Description: to.Ptr("A rule on critical GCP recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "In", - // "property": "$.AssessmentKey", - // "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]", - // }, - // }, - // }}, - // DisplayName: to.Ptr("Admin's GCP rule"), - // GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(false), - // DisableOwnerEmailNotification: to.Ptr(false), - // }, - // IsDisabled: to.Ptr(false), - // IsGracePeriod: to.Ptr(true), - // OwnerSource: &armsecurity.GovernanceRuleOwnerSource{ - // Type: to.Ptr(armsecurity.GovernanceRuleOwnerSourceTypeManually), - // Value: to.Ptr("user@contoso.com"), - // }, - // RemediationTimeframe: to.Ptr("7.00:00:00"), - // RulePriority: to.Ptr[int32](100), - // RuleType: to.Ptr(armsecurity.GovernanceRuleTypeIntegrated), - // SourceResourceType: to.Ptr(armsecurity.GovernanceRuleSourceResourceTypeAssessments), - // }, - // }, - // { - // Name: to.Ptr("4106f43c-6d82-4fc8-a92c-dcfe50799d1d"), - // Type: to.Ptr("Microsoft.Security/governanceRules"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector/providers/Microsoft.Security/governanceRules/4106f43c-6d82-4fc8-a92c-dcfe50799d1d"), - // Properties: &armsecurity.GovernanceRuleProperties{ - // Description: to.Ptr("A rule on critical GCP recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "Equals", - // "property": "$.Metadata.Severity", - // "value": "Low", - // }, - // }, - // }}, - // DisplayName: to.Ptr("GCP Admin's rule"), - // GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(false), - // DisableOwnerEmailNotification: to.Ptr(false), - // }, - // IsDisabled: to.Ptr(false), - // IsGracePeriod: to.Ptr(true), - // OwnerSource: &armsecurity.GovernanceRuleOwnerSource{ - // Type: to.Ptr(armsecurity.GovernanceRuleOwnerSourceTypeManually), - // Value: to.Ptr("user@contoso.com"), - // }, - // RemediationTimeframe: to.Ptr("7.00:00:00"), - // RulePriority: to.Ptr[int32](200), - // RuleType: to.Ptr(armsecurity.GovernanceRuleTypeIntegrated), - // SourceResourceType: to.Ptr(armsecurity.GovernanceRuleSourceResourceTypeAssessments), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/connectorgovernancerules_client.go b/sdk/resourcemanager/security/armsecurity/connectorgovernancerules_client.go deleted file mode 100644 index 16bd04687a6b..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectorgovernancerules_client.go +++ /dev/null @@ -1,225 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ConnectorGovernanceRulesClient contains the methods for the SecurityConnectorGovernanceRules group. -// Don't use this type directly, use NewConnectorGovernanceRulesClient() instead. -type ConnectorGovernanceRulesClient struct { - internal *arm.Client - subscriptionID string -} - -// NewConnectorGovernanceRulesClient creates a new instance of ConnectorGovernanceRulesClient with the specified values. -// - subscriptionID - Azure subscription ID -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewConnectorGovernanceRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectorGovernanceRulesClient, error) { - cl, err := arm.NewClient(moduleName+".ConnectorGovernanceRulesClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ConnectorGovernanceRulesClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// CreateOrUpdate - Creates or update a security GovernanceRule on the given security connector. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-01-01-preview -// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// - securityConnectorName - The security connector name. -// - ruleID - The security GovernanceRule key - unique key for the standard GovernanceRule -// - governanceRule - GovernanceRule over a subscription scope -// - options - ConnectorGovernanceRulesClientCreateOrUpdateOptions contains the optional parameters for the ConnectorGovernanceRulesClient.CreateOrUpdate -// method. -func (client *ConnectorGovernanceRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, securityConnectorName string, ruleID string, governanceRule GovernanceRule, options *ConnectorGovernanceRulesClientCreateOrUpdateOptions) (ConnectorGovernanceRulesClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, securityConnectorName, ruleID, governanceRule, options) - if err != nil { - return ConnectorGovernanceRulesClientCreateOrUpdateResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ConnectorGovernanceRulesClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ConnectorGovernanceRulesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.createOrUpdateHandleResponse(resp) -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ConnectorGovernanceRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, ruleID string, governanceRule GovernanceRule, options *ConnectorGovernanceRulesClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if securityConnectorName == "" { - return nil, errors.New("parameter securityConnectorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) - if ruleID == "" { - return nil, errors.New("parameter ruleID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, governanceRule) -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *ConnectorGovernanceRulesClient) createOrUpdateHandleResponse(resp *http.Response) (ConnectorGovernanceRulesClientCreateOrUpdateResponse, error) { - result := ConnectorGovernanceRulesClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GovernanceRule); err != nil { - return ConnectorGovernanceRulesClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Delete a GovernanceRule over a given scope -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-01-01-preview -// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// - securityConnectorName - The security connector name. -// - ruleID - The security GovernanceRule key - unique key for the standard GovernanceRule -// - options - ConnectorGovernanceRulesClientDeleteOptions contains the optional parameters for the ConnectorGovernanceRulesClient.Delete -// method. -func (client *ConnectorGovernanceRulesClient) Delete(ctx context.Context, resourceGroupName string, securityConnectorName string, ruleID string, options *ConnectorGovernanceRulesClientDeleteOptions) (ConnectorGovernanceRulesClientDeleteResponse, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, securityConnectorName, ruleID, options) - if err != nil { - return ConnectorGovernanceRulesClientDeleteResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ConnectorGovernanceRulesClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ConnectorGovernanceRulesClientDeleteResponse{}, runtime.NewResponseError(resp) - } - return ConnectorGovernanceRulesClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ConnectorGovernanceRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, ruleID string, options *ConnectorGovernanceRulesClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if securityConnectorName == "" { - return nil, errors.New("parameter securityConnectorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) - if ruleID == "" { - return nil, errors.New("parameter ruleID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - return req, nil -} - -// Get - Get a specific governanceRule for the requested scope by ruleId -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-01-01-preview -// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// - securityConnectorName - The security connector name. -// - ruleID - The security GovernanceRule key - unique key for the standard GovernanceRule -// - options - ConnectorGovernanceRulesClientGetOptions contains the optional parameters for the ConnectorGovernanceRulesClient.Get -// method. -func (client *ConnectorGovernanceRulesClient) Get(ctx context.Context, resourceGroupName string, securityConnectorName string, ruleID string, options *ConnectorGovernanceRulesClientGetOptions) (ConnectorGovernanceRulesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, securityConnectorName, ruleID, options) - if err != nil { - return ConnectorGovernanceRulesClientGetResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return ConnectorGovernanceRulesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ConnectorGovernanceRulesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ConnectorGovernanceRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, ruleID string, options *ConnectorGovernanceRulesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if securityConnectorName == "" { - return nil, errors.New("parameter securityConnectorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) - if ruleID == "" { - return nil, errors.New("parameter ruleID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ConnectorGovernanceRulesClient) getHandleResponse(resp *http.Response) (ConnectorGovernanceRulesClientGetResponse, error) { - result := ConnectorGovernanceRulesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GovernanceRule); err != nil { - return ConnectorGovernanceRulesClientGetResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/security/armsecurity/connectorgovernancerules_client_example_test.go b/sdk/resourcemanager/security/armsecurity/connectorgovernancerules_client_example_test.go deleted file mode 100644 index 409b70553ff9..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectorgovernancerules_client_example_test.go +++ /dev/null @@ -1,171 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRule_example.json -func ExampleConnectorGovernanceRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectorGovernanceRulesClient().Get(ctx, "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GovernanceRule = armsecurity.GovernanceRule{ - // Name: to.Ptr("ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Type: to.Ptr("Microsoft.Security/governanceRules"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.GovernanceRuleProperties{ - // Description: to.Ptr("A rule on critical GCP recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "In", - // "property": "$.AssessmentKey", - // "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]", - // }, - // }, - // }}, - // DisplayName: to.Ptr("GCP Admin's rule"), - // GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(false), - // DisableOwnerEmailNotification: to.Ptr(false), - // }, - // IsDisabled: to.Ptr(false), - // IsGracePeriod: to.Ptr(true), - // OwnerSource: &armsecurity.GovernanceRuleOwnerSource{ - // Type: to.Ptr(armsecurity.GovernanceRuleOwnerSourceTypeManually), - // Value: to.Ptr("user@contoso.com"), - // }, - // RemediationTimeframe: to.Ptr("7.00:00:00"), - // RulePriority: to.Ptr[int32](200), - // RuleType: to.Ptr(armsecurity.GovernanceRuleTypeIntegrated), - // SourceResourceType: to.Ptr(armsecurity.GovernanceRuleSourceResourceTypeAssessments), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PutSecurityConnectorGovernanceRule_example.json -func ExampleConnectorGovernanceRulesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectorGovernanceRulesClient().CreateOrUpdate(ctx, "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", armsecurity.GovernanceRule{ - Properties: &armsecurity.GovernanceRuleProperties{ - Description: to.Ptr("A rule on critical GCP recommendations"), - ConditionSets: []any{ - map[string]any{ - "conditions": []any{ - map[string]any{ - "operator": "In", - "property": "$.AssessmentKey", - "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]", - }, - }, - }}, - DisplayName: to.Ptr("GCP Admin's rule"), - GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - DisableManagerEmailNotification: to.Ptr(true), - DisableOwnerEmailNotification: to.Ptr(false), - }, - IsDisabled: to.Ptr(false), - IsGracePeriod: to.Ptr(true), - OwnerSource: &armsecurity.GovernanceRuleOwnerSource{ - Type: to.Ptr(armsecurity.GovernanceRuleOwnerSourceTypeManually), - Value: to.Ptr("user@contoso.com"), - }, - RemediationTimeframe: to.Ptr("7.00:00:00"), - RulePriority: to.Ptr[int32](200), - RuleType: to.Ptr(armsecurity.GovernanceRuleTypeIntegrated), - SourceResourceType: to.Ptr(armsecurity.GovernanceRuleSourceResourceTypeAssessments), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GovernanceRule = armsecurity.GovernanceRule{ - // Name: to.Ptr("1f3afdf9-d0c9-4c3d-847f-89da613e70a8"), - // Type: to.Ptr("Microsoft.Security/governanceRules"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.GovernanceRuleProperties{ - // Description: to.Ptr("A rule on critical GCP recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "In", - // "property": "$.AssessmentKey", - // "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]", - // }, - // }, - // }}, - // DisplayName: to.Ptr("GCP Admin's rule"), - // GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(true), - // DisableOwnerEmailNotification: to.Ptr(false), - // }, - // IsDisabled: to.Ptr(false), - // IsGracePeriod: to.Ptr(true), - // OwnerSource: &armsecurity.GovernanceRuleOwnerSource{ - // Type: to.Ptr(armsecurity.GovernanceRuleOwnerSourceTypeManually), - // Value: to.Ptr("user@contoso.com"), - // }, - // RemediationTimeframe: to.Ptr("7.00:00:00"), - // RulePriority: to.Ptr[int32](200), - // RuleType: to.Ptr(armsecurity.GovernanceRuleTypeIntegrated), - // SourceResourceType: to.Ptr(armsecurity.GovernanceRuleSourceResourceTypeAssessments), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteSecurityConnectorGovernanceRule_example.json -func ExampleConnectorGovernanceRulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewConnectorGovernanceRulesClient().Delete(ctx, "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/connectorgovernancerulesexecutestatus_client.go b/sdk/resourcemanager/security/armsecurity/connectorgovernancerulesexecutestatus_client.go deleted file mode 100644 index 7d0abd248fa8..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectorgovernancerulesexecutestatus_client.go +++ /dev/null @@ -1,120 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ConnectorGovernanceRulesExecuteStatusClient contains the methods for the SecurityConnectorGovernanceRulesExecuteStatus group. -// Don't use this type directly, use NewConnectorGovernanceRulesExecuteStatusClient() instead. -type ConnectorGovernanceRulesExecuteStatusClient struct { - internal *arm.Client - subscriptionID string -} - -// NewConnectorGovernanceRulesExecuteStatusClient creates a new instance of ConnectorGovernanceRulesExecuteStatusClient with the specified values. -// - subscriptionID - Azure subscription ID -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewConnectorGovernanceRulesExecuteStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectorGovernanceRulesExecuteStatusClient, error) { - cl, err := arm.NewClient(moduleName+".ConnectorGovernanceRulesExecuteStatusClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &ConnectorGovernanceRulesExecuteStatusClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginGet - Get a specific governanceRule execution status for the requested scope by ruleId and operationId -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-01-01-preview -// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// - securityConnectorName - The security connector name. -// - ruleID - The security GovernanceRule key - unique key for the standard GovernanceRule -// - operationID - The security GovernanceRule execution key - unique key for the execution of GovernanceRule -// - options - ConnectorGovernanceRulesExecuteStatusClientBeginGetOptions contains the optional parameters for the ConnectorGovernanceRulesExecuteStatusClient.BeginGet -// method. -func (client *ConnectorGovernanceRulesExecuteStatusClient) BeginGet(ctx context.Context, resourceGroupName string, securityConnectorName string, ruleID string, operationID string, options *ConnectorGovernanceRulesExecuteStatusClientBeginGetOptions) (*runtime.Poller[ConnectorGovernanceRulesExecuteStatusClientGetResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.get(ctx, resourceGroupName, securityConnectorName, ruleID, operationID, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[ConnectorGovernanceRulesExecuteStatusClientGetResponse](resp, client.internal.Pipeline(), nil) - } else { - return runtime.NewPollerFromResumeToken[ConnectorGovernanceRulesExecuteStatusClientGetResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// Get - Get a specific governanceRule execution status for the requested scope by ruleId and operationId -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-01-01-preview -func (client *ConnectorGovernanceRulesExecuteStatusClient) get(ctx context.Context, resourceGroupName string, securityConnectorName string, ruleID string, operationID string, options *ConnectorGovernanceRulesExecuteStatusClientBeginGetOptions) (*http.Response, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, securityConnectorName, ruleID, operationID, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getCreateRequest creates the Get request. -func (client *ConnectorGovernanceRulesExecuteStatusClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, ruleID string, operationID string, options *ConnectorGovernanceRulesExecuteStatusClientBeginGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if securityConnectorName == "" { - return nil, errors.New("parameter securityConnectorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) - if ruleID == "" { - return nil, errors.New("parameter ruleID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) - if operationID == "" { - return nil, errors.New("parameter operationID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} diff --git a/sdk/resourcemanager/security/armsecurity/connectorgovernancerulesexecutestatus_client_example_test.go b/sdk/resourcemanager/security/armsecurity/connectorgovernancerulesexecutestatus_client_example_test.go deleted file mode 100644 index 582d602cae53..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectorgovernancerulesexecutestatus_client_example_test.go +++ /dev/null @@ -1,45 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRuleExecuteStatus_example.json -func ExampleConnectorGovernanceRulesExecuteStatusClient_BeginGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewConnectorGovernanceRulesExecuteStatusClient().BeginGet(ctx, "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExecuteRuleStatus = armsecurity.ExecuteRuleStatus{ - // OperationID: to.Ptr("58b33f4f-c8c7-4b01-99cc-d437db4d40dd"), - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/connectors_client.go b/sdk/resourcemanager/security/armsecurity/connectors_client.go index 3e173d5da7f1..b9be8a328758 100644 --- a/sdk/resourcemanager/security/armsecurity/connectors_client.go +++ b/sdk/resourcemanager/security/armsecurity/connectors_client.go @@ -48,7 +48,7 @@ func NewConnectorsClient(subscriptionID string, credential azcore.TokenCredentia // is issued for the same security connector id, then it will be updated. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-03-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - securityConnectorName - The security connector name. // - securityConnector - The security connector resource @@ -89,7 +89,7 @@ func (client *ConnectorsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, securityConnector) @@ -107,7 +107,7 @@ func (client *ConnectorsClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Deletes a security connector. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-03-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - securityConnectorName - The security connector name. // - options - ConnectorsClientDeleteOptions contains the optional parameters for the ConnectorsClient.Delete method. @@ -146,7 +146,7 @@ func (client *ConnectorsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -155,7 +155,7 @@ func (client *ConnectorsClient) deleteCreateRequest(ctx context.Context, resourc // Get - Retrieves details of a specific security connector // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-03-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - securityConnectorName - The security connector name. // - options - ConnectorsClientGetOptions contains the optional parameters for the ConnectorsClient.Get method. @@ -194,7 +194,7 @@ func (client *ConnectorsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -212,7 +212,7 @@ func (client *ConnectorsClient) getHandleResponse(resp *http.Response) (Connecto // NewListPager - Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response // to get the next page of security connectors for the specified subscription. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-03-01-preview // - options - ConnectorsClientListOptions contains the optional parameters for the ConnectorsClient.NewListPager method. func (client *ConnectorsClient) NewListPager(options *ConnectorsClientListOptions) *runtime.Pager[ConnectorsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ConnectorsClientListResponse]{ @@ -254,7 +254,7 @@ func (client *ConnectorsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -272,7 +272,7 @@ func (client *ConnectorsClient) listHandleResponse(resp *http.Response) (Connect // NewListByResourceGroupPager - Lists all the security connectors in the specified resource group. Use the 'nextLink' property // in the response to get the next page of security connectors for the specified resource group. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-03-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - options - ConnectorsClientListByResourceGroupOptions contains the optional parameters for the ConnectorsClient.NewListByResourceGroupPager // method. @@ -320,7 +320,7 @@ func (client *ConnectorsClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -338,7 +338,7 @@ func (client *ConnectorsClient) listByResourceGroupHandleResponse(resp *http.Res // Update - Updates a security connector // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-08-01-preview +// Generated from API version 2023-03-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - securityConnectorName - The security connector name. // - securityConnector - The security connector resource @@ -378,7 +378,7 @@ func (client *ConnectorsClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-08-01-preview") + reqQP.Set("api-version", "2023-03-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, securityConnector) diff --git a/sdk/resourcemanager/security/armsecurity/connectors_client_example_test.go b/sdk/resourcemanager/security/armsecurity/connectors_client_example_test.go deleted file mode 100644 index ac2c46cfab37..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectors_client_example_test.go +++ /dev/null @@ -1,558 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-08-01-preview/examples/SecurityConnectors/GetSecurityConnectorsSubscription_example.json -func ExampleConnectorsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConnectorsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ConnectorsList = armsecurity.ConnectorsList{ - // Value: []*armsecurity.Connector{ - // { - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("exampleSecurityConnectorAws"), - // Type: to.Ptr("Microsoft.Security/securityConnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup1/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorAws"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.AwsEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeAwsAccount), - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameAWS), - // HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorAwsOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorAws), - // NativeCloudConnection: &armsecurity.CspmMonitorAwsOfferingNativeCloudConnection{ - // CloudRoleArn: to.Ptr("arn:aws:iam::00000000:role/ASCMonitor"), - // }, - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("exampleSecurityConnectorAwsOrganization"), - // Type: to.Ptr("Microsoft.Security/securityConnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup2/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorAwsOrganization"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.AwsEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeAwsAccount), - // OrganizationalData: &armsecurity.AwsOrganizationalDataMaster{ - // OrganizationMembershipType: to.Ptr(armsecurity.OrganizationMembershipTypeOrganization), - // ExcludedAccountIDs: []*string{ - // to.Ptr("excludedAccountIdExample")}, - // StacksetName: to.Ptr("myStackSetName"), - // }, - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameAWS), - // HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorAwsOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorAws), - // NativeCloudConnection: &armsecurity.CspmMonitorAwsOfferingNativeCloudConnection{ - // CloudRoleArn: to.Ptr("arn:aws:iam::00000000:role/ASCMonitor"), - // }, - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("githubTest"), - // Type: to.Ptr("Microsoft.Security/securityconnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup3/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorGithub"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.GithubScopeEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeGithubScope), - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameGithub), - // HierarchyIdentifier: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup3/providers/Microsoft.SecurityDevops/githubConnectors/exampleGithubConnector"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorGithubOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorGithub), - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("AzureDevOpsTest"), - // Type: to.Ptr("Microsoft.Security/securityconnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup3/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorAzureDevOpsConnectors"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.GithubScopeEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeGithubScope), - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameGithub), - // HierarchyIdentifier: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup3/providers/Microsoft.SecurityDevops/azureDevOpsConnectors/exampleAzureDevOpsConnector"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorGithubOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorGithub), - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("exampleSecurityConnectorGcp"), - // Type: to.Ptr("Microsoft.Security/securityConnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup3/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorGcp"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.GcpProjectEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeGcpProject), - // ProjectDetails: &armsecurity.GcpProjectDetails{ - // ProjectID: to.Ptr("My-0GCP-Project"), - // ProjectNumber: to.Ptr("exampleHierarchyId"), - // WorkloadIdentityPoolID: to.Ptr("6c78da41157548d3b1d8b3c72effdf8c"), - // }, - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameGCP), - // HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorGcpOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorGcp), - // NativeCloudConnection: &armsecurity.CspmMonitorGcpOfferingNativeCloudConnection{ - // ServiceAccountEmailAddress: to.Ptr("capm@projectName.com"), - // WorkloadIdentityProviderID: to.Ptr("My workload identity provider Id"), - // }, - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-08-01-preview/examples/SecurityConnectors/GetSecurityConnectorsResourceGroup_example.json -func ExampleConnectorsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConnectorsClient().NewListByResourceGroupPager("exampleResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ConnectorsList = armsecurity.ConnectorsList{ - // Value: []*armsecurity.Connector{ - // { - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("exampleSecurityConnectorAws"), - // Type: to.Ptr("Microsoft.Security/securityConnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorAws"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.AwsEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeAwsAccount), - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameAWS), - // HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorAwsOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorAws), - // NativeCloudConnection: &armsecurity.CspmMonitorAwsOfferingNativeCloudConnection{ - // CloudRoleArn: to.Ptr("arn:aws:iam::00000000:role/ASCMonitor"), - // }, - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("exampleSecurityConnectorAwsOrganization"), - // Type: to.Ptr("Microsoft.Security/securityConnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorAwsOrganization"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.AwsEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeAwsAccount), - // OrganizationalData: &armsecurity.AwsOrganizationalDataMaster{ - // OrganizationMembershipType: to.Ptr(armsecurity.OrganizationMembershipTypeOrganization), - // ExcludedAccountIDs: []*string{ - // to.Ptr("excludedAccountIdExample")}, - // StacksetName: to.Ptr("myStackSetName"), - // }, - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameAWS), - // HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorAwsOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorAws), - // NativeCloudConnection: &armsecurity.CspmMonitorAwsOfferingNativeCloudConnection{ - // CloudRoleArn: to.Ptr("arn:aws:iam::00000000:role/ASCMonitor"), - // }, - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("exampleSecurityConnectorGcp"), - // Type: to.Ptr("Microsoft.Security/securityConnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorGcp"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.GcpProjectEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeGcpProject), - // ProjectDetails: &armsecurity.GcpProjectDetails{ - // ProjectID: to.Ptr("My-0GCP-Project"), - // ProjectNumber: to.Ptr("exampleHierarchyId"), - // WorkloadIdentityPoolID: to.Ptr("My-workload-identity-federation-pool-id"), - // }, - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameGCP), - // HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorGcpOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorGcp), - // NativeCloudConnection: &armsecurity.CspmMonitorGcpOfferingNativeCloudConnection{ - // ServiceAccountEmailAddress: to.Ptr("capm@projectName.com"), - // WorkloadIdentityProviderID: to.Ptr("My workload identity provider Id"), - // }, - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-08-01-preview/examples/SecurityConnectors/GetSecurityConnectorSingleResource_example.json -func ExampleConnectorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectorsClient().Get(ctx, "exampleResourceGroup", "exampleSecurityConnectorName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Connector = armsecurity.Connector{ - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("exampleSecurityConnectorName"), - // Type: to.Ptr("Microsoft.Security/securityConnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorName"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.AwsEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeAwsAccount), - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameAWS), - // HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorAwsOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorAws), - // NativeCloudConnection: &armsecurity.CspmMonitorAwsOfferingNativeCloudConnection{ - // CloudRoleArn: to.Ptr("arn:aws:iam::00000000:role/ASCMonitor"), - // }, - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-08-01-preview/examples/SecurityConnectors/PutSecurityConnector_example.json -func ExampleConnectorsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectorsClient().CreateOrUpdate(ctx, "exampleResourceGroup", "exampleSecurityConnectorName", armsecurity.Connector{ - Location: to.Ptr("Central US"), - Etag: to.Ptr("etag value (must be supplied for update)"), - Tags: map[string]*string{}, - Properties: &armsecurity.ConnectorProperties{ - EnvironmentData: &armsecurity.AwsEnvironmentData{ - EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeAwsAccount), - }, - EnvironmentName: to.Ptr(armsecurity.CloudNameAWS), - HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - Offerings: []armsecurity.CloudOfferingClassification{ - &armsecurity.CspmMonitorAwsOffering{ - OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorAws), - NativeCloudConnection: &armsecurity.CspmMonitorAwsOfferingNativeCloudConnection{ - CloudRoleArn: to.Ptr("arn:aws:iam::00000000:role/ASCMonitor"), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Connector = armsecurity.Connector{ - // Location: to.Ptr("Central US"), - // Etag: to.Ptr(""), - // Kind: to.Ptr(""), - // Name: to.Ptr("exampleSecurityConnectorName"), - // Type: to.Ptr("Microsoft.Security/securityConnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorName"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.AwsEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeAwsAccount), - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameAWS), - // HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorAwsOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorAws), - // NativeCloudConnection: &armsecurity.CspmMonitorAwsOfferingNativeCloudConnection{ - // CloudRoleArn: to.Ptr("arn:aws:iam::00000000:role/ASCMonitor"), - // }, - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-08-01-preview/examples/SecurityConnectors/PatchSecurityConnector_example.json -func ExampleConnectorsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectorsClient().Update(ctx, "exampleResourceGroup", "exampleSecurityConnectorName", armsecurity.Connector{ - Location: to.Ptr("Central US"), - Etag: to.Ptr("etag value (must be supplied for update)"), - Tags: map[string]*string{}, - Properties: &armsecurity.ConnectorProperties{ - EnvironmentData: &armsecurity.AwsEnvironmentData{ - EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeAwsAccount), - }, - EnvironmentName: to.Ptr(armsecurity.CloudNameAWS), - HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - Offerings: []armsecurity.CloudOfferingClassification{ - &armsecurity.CspmMonitorAwsOffering{ - OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorAws), - NativeCloudConnection: &armsecurity.CspmMonitorAwsOfferingNativeCloudConnection{ - CloudRoleArn: to.Ptr("arn:aws:iam::00000000:role/ASCMonitor"), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Connector = armsecurity.Connector{ - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("exampleSecurityConnectorName"), - // Type: to.Ptr("Microsoft.Security/securityConnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorName"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.AwsEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeAwsAccount), - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameAWS), - // HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorAwsOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorAws), - // NativeCloudConnection: &armsecurity.CspmMonitorAwsOfferingNativeCloudConnection{ - // CloudRoleArn: to.Ptr("arn:aws:iam::00000000:role/ASCMonitor"), - // }, - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-08-01-preview/examples/SecurityConnectors/DeleteSecurityConnector_example.json -func ExampleConnectorsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewConnectorsClient().Delete(ctx, "myRg", "mySecurityConnectorName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/constants.go b/sdk/resourcemanager/security/armsecurity/constants.go index 98f89235cbdd..ac3ded6d8a24 100644 --- a/sdk/resourcemanager/security/armsecurity/constants.go +++ b/sdk/resourcemanager/security/armsecurity/constants.go @@ -381,6 +381,7 @@ const ( CloudNameAzure CloudName = "Azure" CloudNameAzureDevOps CloudName = "AzureDevOps" CloudNameGCP CloudName = "GCP" + CloudNameGitLab CloudName = "GitLab" CloudNameGithub CloudName = "Github" ) @@ -391,10 +392,29 @@ func PossibleCloudNameValues() []CloudName { CloudNameAzure, CloudNameAzureDevOps, CloudNameGCP, + CloudNameGitLab, CloudNameGithub, } } +// Code - The operation status code. +type Code string + +const ( + // CodeFailed - Extension was not created/updated successfully. See operation status message for more details. + CodeFailed Code = "Failed" + // CodeSucceeded - Extension was created/updated successfully. + CodeSucceeded Code = "Succeeded" +) + +// PossibleCodeValues returns the possible values for the Code const type. +func PossibleCodeValues() []Code { + return []Code{ + CodeFailed, + CodeSucceeded, + } +} + // ConfigurationStatus - The configuration status of the machines group or machine or rule type ConfigurationStatus string @@ -566,6 +586,7 @@ const ( EnvironmentTypeAzureDevOpsScope EnvironmentType = "AzureDevOpsScope" EnvironmentTypeGcpProject EnvironmentType = "GcpProject" EnvironmentTypeGithubScope EnvironmentType = "GithubScope" + EnvironmentTypeGitlabScope EnvironmentType = "GitlabScope" ) // PossibleEnvironmentTypeValues returns the possible values for the EnvironmentType const type. @@ -575,6 +596,7 @@ func PossibleEnvironmentTypeValues() []EnvironmentType { EnvironmentTypeAzureDevOpsScope, EnvironmentTypeGcpProject, EnvironmentTypeGithubScope, + EnvironmentTypeGitlabScope, } } @@ -901,6 +923,24 @@ func PossibleIntentValues() []Intent { } } +// IsEnabled - Indicates whether the extension is enabled. +type IsEnabled string + +const ( + // IsEnabledFalse - Indicates the extension is disabled + IsEnabledFalse IsEnabled = "False" + // IsEnabledTrue - Indicates the extension is enabled + IsEnabledTrue IsEnabled = "True" +) + +// PossibleIsEnabledValues returns the possible values for the IsEnabled const type. +func PossibleIsEnabledValues() []IsEnabled { + return []IsEnabled{ + IsEnabledFalse, + IsEnabledTrue, + } +} + // Kind - The kind of alert simulation. type Kind string @@ -944,6 +984,7 @@ const ( OfferingTypeCspmMonitorAws OfferingType = "CspmMonitorAws" OfferingTypeCspmMonitorAzureDevOps OfferingType = "CspmMonitorAzureDevOps" OfferingTypeCspmMonitorGcp OfferingType = "CspmMonitorGcp" + OfferingTypeCspmMonitorGitLab OfferingType = "CspmMonitorGitLab" OfferingTypeCspmMonitorGithub OfferingType = "CspmMonitorGithub" OfferingTypeDefenderCspmAws OfferingType = "DefenderCspmAws" OfferingTypeDefenderCspmGcp OfferingType = "DefenderCspmGcp" @@ -952,6 +993,7 @@ const ( OfferingTypeDefenderForDatabasesAws OfferingType = "DefenderForDatabasesAws" OfferingTypeDefenderForDatabasesGcp OfferingType = "DefenderForDatabasesGcp" OfferingTypeDefenderForDevOpsAzureDevOps OfferingType = "DefenderForDevOpsAzureDevOps" + OfferingTypeDefenderForDevOpsGitLab OfferingType = "DefenderForDevOpsGitLab" OfferingTypeDefenderForDevOpsGithub OfferingType = "DefenderForDevOpsGithub" OfferingTypeDefenderForServersAws OfferingType = "DefenderForServersAws" OfferingTypeDefenderForServersGcp OfferingType = "DefenderForServersGcp" @@ -964,6 +1006,7 @@ func PossibleOfferingTypeValues() []OfferingType { OfferingTypeCspmMonitorAws, OfferingTypeCspmMonitorAzureDevOps, OfferingTypeCspmMonitorGcp, + OfferingTypeCspmMonitorGitLab, OfferingTypeCspmMonitorGithub, OfferingTypeDefenderCspmAws, OfferingTypeDefenderCspmGcp, @@ -972,6 +1015,7 @@ func PossibleOfferingTypeValues() []OfferingType { OfferingTypeDefenderForDatabasesAws, OfferingTypeDefenderForDatabasesGcp, OfferingTypeDefenderForDevOpsAzureDevOps, + OfferingTypeDefenderForDevOpsGitLab, OfferingTypeDefenderForDevOpsGithub, OfferingTypeDefenderForServersAws, OfferingTypeDefenderForServersGcp, @@ -979,6 +1023,27 @@ func PossibleOfferingTypeValues() []OfferingType { } } +// OperationResult - The status of the long run operation result of governance rule +type OperationResult string + +const ( + // OperationResultCanceled - The operation canceled + OperationResultCanceled OperationResult = "Canceled" + // OperationResultFailed - The operation failed + OperationResultFailed OperationResult = "Failed" + // OperationResultSucceeded - The operation succeeded + OperationResultSucceeded OperationResult = "Succeeded" +) + +// PossibleOperationResultValues returns the possible values for the OperationResult const type. +func PossibleOperationResultValues() []OperationResult { + return []OperationResult{ + OperationResultCanceled, + OperationResultFailed, + OperationResultSucceeded, + } +} + // Operator - A valid comparer operator to use. A case-insensitive comparison will be applied for String PropertyType. type Operator string @@ -1059,9 +1124,9 @@ func PossiblePermissionPropertyValues() []PermissionProperty { } } -// PricingTier - The pricing tier value. Microsoft Defender for Cloud 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. +// PricingTier - The pricing tier value. Microsoft Defender for Cloud is provided in two pricing tiers: free and standard. +// The standard tier offers advanced security capabilities, while the free tier offers basic +// security features. type PricingTier string const ( @@ -1500,7 +1565,7 @@ func PossibleScanTriggerTypeValues() []ScanTriggerType { } } -// ScanningMode - The scanning mode for the vm scan. +// ScanningMode - The scanning mode for the VM scan. type ScanningMode string const ( @@ -1514,6 +1579,26 @@ func PossibleScanningModeValues() []ScanningMode { } } +// ScopeName - The resource scope of the health report +type ScopeName string + +const ( + ScopeNameClusters ScopeName = "Clusters" + ScopeNameConnectors ScopeName = "Connectors" + ScopeNameUnknown ScopeName = "Unknown" + ScopeNameVirtualMachines ScopeName = "VirtualMachines" +) + +// PossibleScopeNameValues returns the possible values for the ScopeName const type. +func PossibleScopeNameValues() []ScopeName { + return []ScopeName{ + ScopeNameClusters, + ScopeNameConnectors, + ScopeNameUnknown, + ScopeNameVirtualMachines, + } +} + // SecurityFamily - The security family of the discovered solution type SecurityFamily string @@ -1731,6 +1816,24 @@ func PossibleStatusValues() []Status { } } +// StatusName - The status of the health report +type StatusName string + +const ( + StatusNameHealthy StatusName = "Healthy" + StatusNameNotApplicable StatusName = "NotApplicable" + StatusNameNotHealthy StatusName = "NotHealthy" +) + +// PossibleStatusNameValues returns the possible values for the StatusName const type. +func PossibleStatusNameValues() []StatusName { + return []StatusName{ + StatusNameHealthy, + StatusNameNotApplicable, + StatusNameNotHealthy, + } +} + // StatusReason - A description of why the status has its value type StatusReason string diff --git a/sdk/resourcemanager/security/armsecurity/contacts_client_example_test.go b/sdk/resourcemanager/security/armsecurity/contacts_client_example_test.go deleted file mode 100644 index 2fe33050aadb..000000000000 --- a/sdk/resourcemanager/security/armsecurity/contacts_client_example_test.go +++ /dev/null @@ -1,173 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/SecurityContacts/GetSecurityContactsSubscription_example.json -func ExampleContactsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewContactsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ContactList = armsecurity.ContactList{ - // Value: []*armsecurity.Contact{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/securityContact"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/securityContact/default"), - // Properties: &armsecurity.ContactProperties{ - // AlertNotifications: &armsecurity.ContactPropertiesAlertNotifications{ - // MinimalSeverity: to.Ptr(armsecurity.MinimalSeverityLow), - // State: to.Ptr(armsecurity.State("On")), - // }, - // Emails: to.Ptr("john@contoso.com;Jane@contoso.com"), - // NotificationsByRole: &armsecurity.ContactPropertiesNotificationsByRole{ - // Roles: []*armsecurity.Roles{ - // to.Ptr(armsecurity.RolesOwner), - // to.Ptr(armsecurity.Roles("Admin"))}, - // State: to.Ptr(armsecurity.State("On")), - // }, - // Phone: to.Ptr("(214)275-4038"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/SecurityContacts/GetSecurityContact_example.json -func ExampleContactsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewContactsClient().Get(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Contact = armsecurity.Contact{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/securityContacts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/securityContacts/default"), - // Properties: &armsecurity.ContactProperties{ - // AlertNotifications: &armsecurity.ContactPropertiesAlertNotifications{ - // MinimalSeverity: to.Ptr(armsecurity.MinimalSeverityLow), - // State: to.Ptr(armsecurity.State("On")), - // }, - // Emails: to.Ptr("john@contoso.com;jane@contoso.com"), - // NotificationsByRole: &armsecurity.ContactPropertiesNotificationsByRole{ - // Roles: []*armsecurity.Roles{ - // to.Ptr(armsecurity.RolesOwner)}, - // State: to.Ptr(armsecurity.State("On")), - // }, - // Phone: to.Ptr("(214)275-4038"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/SecurityContacts/CreateSecurityContact_example.json -func ExampleContactsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewContactsClient().Create(ctx, "default", armsecurity.Contact{ - Properties: &armsecurity.ContactProperties{ - AlertNotifications: &armsecurity.ContactPropertiesAlertNotifications{ - MinimalSeverity: to.Ptr(armsecurity.MinimalSeverityLow), - State: to.Ptr(armsecurity.State("On")), - }, - Emails: to.Ptr("john@contoso.com;jane@contoso.com"), - NotificationsByRole: &armsecurity.ContactPropertiesNotificationsByRole{ - Roles: []*armsecurity.Roles{ - to.Ptr(armsecurity.RolesOwner)}, - State: to.Ptr(armsecurity.State("On")), - }, - Phone: to.Ptr("(214)275-4038"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Contact = armsecurity.Contact{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/securityContact"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/securityContacts/default"), - // Properties: &armsecurity.ContactProperties{ - // AlertNotifications: &armsecurity.ContactPropertiesAlertNotifications{ - // MinimalSeverity: to.Ptr(armsecurity.MinimalSeverityLow), - // State: to.Ptr(armsecurity.State("On")), - // }, - // Emails: to.Ptr("john@microsoft.com;jane@microsoft.com"), - // NotificationsByRole: &armsecurity.ContactPropertiesNotificationsByRole{ - // Roles: []*armsecurity.Roles{ - // to.Ptr(armsecurity.RolesOwner)}, - // State: to.Ptr(armsecurity.State("On")), - // }, - // Phone: to.Ptr("(214)275-4038"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/SecurityContacts/DeleteSecurityContact_example.json -func ExampleContactsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewContactsClient().Delete(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/customassessmentautomations_client_example_test.go b/sdk/resourcemanager/security/armsecurity/customassessmentautomations_client_example_test.go deleted file mode 100644 index 78557a960196..000000000000 --- a/sdk/resourcemanager/security/armsecurity/customassessmentautomations_client_example_test.go +++ /dev/null @@ -1,273 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationGet_example.json -func ExampleCustomAssessmentAutomationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCustomAssessmentAutomationsClient().Get(ctx, "TestResourceGroup", "MyCustomAssessmentAutomation", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomAssessmentAutomation = armsecurity.CustomAssessmentAutomation{ - // Name: to.Ptr("MyCustomAssessmentAutomation"), - // Type: to.Ptr("Microsoft.Security/customAssessmentAutomations"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/TestResourceGroup/providers/Microsoft.Security/customAssessmentAutomations/MyCustomAssessmentAutomation"), - // Properties: &armsecurity.CustomAssessmentAutomationProperties{ - // Description: to.Ptr("organization passwords policy"), - // AssessmentKey: to.Ptr("d5f442f7-7e77-4bcf-a450-a9c1b9a94eeb"), - // CompressedQuery: to.Ptr("DQAKAEkAYQBtAF8ARwByAG8AdQBwAA0ACgB8ACAAZQB4AHQAZQBuAGQAIABIAGUAYQBsAHQAaABTAHQAYQB0AHUAcwAgAD0AIABpAGYAZgAoAHQAbwBzAHQAcgBpAG4AZwAoAFIAZQBjAG8AcgBkAC4AVQBzAGUAcgBOAGEAbQBlACkAIABjAG8AbgB0AGEAaQBuAHMAIAAnAHUAcwBlAHIAJwAsACAAJwBVAE4ASABFAEEATABUAEgAWQAnACwAIAAnAEgARQBBAEwAVABIAFkAJwApAA0ACgA="), - // DisplayName: to.Ptr("Password Policy"), - // RemediationDescription: to.Ptr("Change password policy to..."), - // Severity: to.Ptr(armsecurity.SeverityEnumLow), - // SupportedCloud: to.Ptr(armsecurity.SupportedCloudEnumAWS), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationCreate_example.json -func ExampleCustomAssessmentAutomationsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCustomAssessmentAutomationsClient().Create(ctx, "TestResourceGroup", "MyCustomAssessmentAutomation", armsecurity.CustomAssessmentAutomationRequest{ - Properties: &armsecurity.CustomAssessmentAutomationRequestProperties{ - Description: to.Ptr("Data should be encrypted"), - CompressedQuery: to.Ptr("DQAKAEkAYQBtAF8ARwByAG8AdQBwAA0ACgB8ACAAZQB4AHQAZQBuAGQAIABIAGUAYQBsAHQAaABTAHQAYQB0AHUAcwAgAD0AIABpAGYAZgAoAHQAbwBzAHQAcgBpAG4AZwAoAFIAZQBjAG8AcgBkAC4AVQBzAGUAcgBOAGEAbQBlACkAIABjAG8AbgB0AGEAaQBuAHMAIAAnAHUAcwBlAHIAJwAsACAAJwBVAE4ASABFAEEATABUAEgAWQAnACwAIAAnAEgARQBBAEwAVABIAFkAJwApAA0ACgA="), - DisplayName: to.Ptr("Password Policy"), - RemediationDescription: to.Ptr("Encrypt store by..."), - Severity: to.Ptr(armsecurity.SeverityEnumMedium), - SupportedCloud: to.Ptr(armsecurity.SupportedCloudEnumAWS), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomAssessmentAutomation = armsecurity.CustomAssessmentAutomation{ - // Name: to.Ptr("33e7cc6e-a139-4723-a0e5-76993aee0771"), - // Type: to.Ptr("Microsoft.Security/customAssessmentAutomations"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/TestResourceGroup/providers/Microsoft.Security/customAssessmentAutomations/33e7cc6e-a139-4723-a0e5-76993aee0771"), - // Properties: &armsecurity.CustomAssessmentAutomationProperties{ - // Description: to.Ptr("organization passwords policy"), - // AssessmentKey: to.Ptr("d5f442f7-7e77-4bcf-a450-a9c1b9a94eeb"), - // CompressedQuery: to.Ptr("DQAKAEkAYQBtAF8ARwByAG8AdQBwAA0ACgB8ACAAZQB4AHQAZQBuAGQAIABIAGUAYQBsAHQAaABTAHQAYQB0AHUAcwAgAD0AIABpAGYAZgAoAHQAbwBzAHQAcgBpAG4AZwAoAFIAZQBjAG8AcgBkAC4AVQBzAGUAcgBOAGEAbQBlACkAIABjAG8AbgB0AGEAaQBuAHMAIAAnAHUAcwBlAHIAJwAsACAAJwBVAE4ASABFAEEATABUAEgAWQAnACwAIAAnAEgARQBBAEwAVABIAFkAJwApAA0ACgA="), - // DisplayName: to.Ptr("Password Policy"), - // RemediationDescription: to.Ptr("Change password policy to..."), - // Severity: to.Ptr(armsecurity.SeverityEnumMedium), - // SupportedCloud: to.Ptr(armsecurity.SupportedCloudEnumAWS), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationDelete_example.json -func ExampleCustomAssessmentAutomationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewCustomAssessmentAutomationsClient().Delete(ctx, "TestResourceGroup", "MyCustomAssessmentAutomation", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationListByResourceGroup_example.json -func ExampleCustomAssessmentAutomationsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCustomAssessmentAutomationsClient().NewListByResourceGroupPager("TestResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CustomAssessmentAutomationsListResult = armsecurity.CustomAssessmentAutomationsListResult{ - // Value: []*armsecurity.CustomAssessmentAutomation{ - // { - // Name: to.Ptr("MyCustomAssessmentAutomation1"), - // Type: to.Ptr("Microsoft.Security/customAssessmentAutomations"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/TestResourceGroup/providers/Microsoft.Security/customAssessmentAutomations/MyCustomAssessmentAutomation1"), - // Properties: &armsecurity.CustomAssessmentAutomationProperties{ - // Description: to.Ptr("organization passwords policy"), - // AssessmentKey: to.Ptr("d5f442f7-7e77-4bcf-a450-a9c1b9a94eeb"), - // CompressedQuery: to.Ptr("DQAKAEkAYQBtAF8ARwByAG8AdQBwAA0ACgB8ACAAZQB4AHQAZQBuAGQAIABIAGUAYQBsAHQAaABTAHQAYQB0AHUAcwAgAD0AIABpAGYAZgAoAHQAbwBzAHQAcgBpAG4AZwAoAFIAZQBjAG8AcgBkAC4AVQBzAGUAcgBOAGEAbQBlACkAIABjAG8AbgB0AGEAaQBuAHMAIAAnAHUAcwBlAHIAJwAsACAAJwBVAE4ASABFAEEATABUAEgAWQAnACwAIAAnAEgARQBBAEwAVABIAFkAJwApAA0ACgA="), - // DisplayName: to.Ptr("Password Policy"), - // RemediationDescription: to.Ptr("Change password policy to..."), - // Severity: to.Ptr(armsecurity.SeverityEnumMedium), - // SupportedCloud: to.Ptr(armsecurity.SupportedCloudEnumAWS), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("MyCustomAssessmentAutomation2"), - // Type: to.Ptr("Microsoft.Security/customAssessmentAutomations"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/TestResourceGroup/providers/Microsoft.Security/customAssessmentAutomations/MyCustomAssessmentAutomation2"), - // Properties: &armsecurity.CustomAssessmentAutomationProperties{ - // Description: to.Ptr("organization passwords policy"), - // AssessmentKey: to.Ptr("fc1dbcd0-502c-4eab-9312-4014cfc8ea56"), - // CompressedQuery: to.Ptr("DQAKAEkAYQBtAF8AUABhAHMAcwB3AG8AcgBkAFAAbwBsAGkAYwB5ACAADQAKAHwAIABlAHgAdABlAG4AZAAgAEgAZQBhAGwAdABoAFMAdABhAHQAdQBzACAAPQAgAGkAZgBmACgAdABvAGkAbgB0ACgAUgBlAGMAbwByAGQALgBNAGkAbgBpAG0AdQBtAFAAYQBzAHMAdwBvAHIAZABMAGUAbgBnAHQAaAApACAAPAAgADgALAAgACcAVQBOAEgARQBBAEwAVABIAFkAJwAsACAAJwBIAEUAQQBMAFQASABZACcAKQANAAoA"), - // DisplayName: to.Ptr("Password Policy"), - // RemediationDescription: to.Ptr("Change password policy to..."), - // Severity: to.Ptr(armsecurity.SeverityEnumLow), - // SupportedCloud: to.Ptr(armsecurity.SupportedCloudEnumAWS), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:01:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:01:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationListBySubscription_example.json -func ExampleCustomAssessmentAutomationsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCustomAssessmentAutomationsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CustomAssessmentAutomationsListResult = armsecurity.CustomAssessmentAutomationsListResult{ - // Value: []*armsecurity.CustomAssessmentAutomation{ - // { - // Name: to.Ptr("MyCustomAssessmentAutomation1"), - // Type: to.Ptr("Microsoft.Security/customAssessmentAutomations"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/TestResourceGroup/providers/Microsoft.Security/customAssessmentAutomations/MyCustomAssessmentAutomation1"), - // Properties: &armsecurity.CustomAssessmentAutomationProperties{ - // Description: to.Ptr("organization passwords policy"), - // AssessmentKey: to.Ptr("d5f442f7-7e77-4bcf-a450-a9c1b9a94eeb"), - // CompressedQuery: to.Ptr("DQAKAEkAYQBtAF8ARwByAG8AdQBwAA0ACgB8ACAAZQB4AHQAZQBuAGQAIABIAGUAYQBsAHQAaABTAHQAYQB0AHUAcwAgAD0AIABpAGYAZgAoAHQAbwBzAHQAcgBpAG4AZwAoAFIAZQBjAG8AcgBkAC4AVQBzAGUAcgBOAGEAbQBlACkAIABjAG8AbgB0AGEAaQBuAHMAIAAnAHUAcwBlAHIAJwAsACAAJwBVAE4ASABFAEEATABUAEgAWQAnACwAIAAnAEgARQBBAEwAVABIAFkAJwApAA0ACgA="), - // DisplayName: to.Ptr("Password Policy"), - // RemediationDescription: to.Ptr("Change password policy to..."), - // Severity: to.Ptr(armsecurity.SeverityEnumMedium), - // SupportedCloud: to.Ptr(armsecurity.SupportedCloudEnumAWS), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("MyCustomAssessmentAutomation2"), - // Type: to.Ptr("Microsoft.Security/customAssessmentAutomations"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/TestResourceGroup/providers/Microsoft.Security/customAssessmentAutomations/MyCustomAssessmentAutomation2"), - // Properties: &armsecurity.CustomAssessmentAutomationProperties{ - // Description: to.Ptr("organization passwords policy"), - // AssessmentKey: to.Ptr("fc1dbcd0-502c-4eab-9312-4014cfc8ea56"), - // CompressedQuery: to.Ptr("Q29tcHV0ZV9OZXR3b3JrCnwgZXh0ZW5kIEhlYWx0aFN0YXR1cyA9ICdVTkhFQUxUSFkn"), - // DisplayName: to.Ptr("Password Policy"), - // RemediationDescription: to.Ptr("Change password policy to..."), - // Severity: to.Ptr(armsecurity.SeverityEnumLow), - // SupportedCloud: to.Ptr(armsecurity.SupportedCloudEnumGCP), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:01:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:01:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/customentitystoreassignments_client_example_test.go b/sdk/resourcemanager/security/armsecurity/customentitystoreassignments_client_example_test.go deleted file mode 100644 index ea46e0fc806c..000000000000 --- a/sdk/resourcemanager/security/armsecurity/customentitystoreassignments_client_example_test.go +++ /dev/null @@ -1,230 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentGet_example.json -func ExampleCustomEntityStoreAssignmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCustomEntityStoreAssignmentsClient().Get(ctx, "TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomEntityStoreAssignment = armsecurity.CustomEntityStoreAssignment{ - // Name: to.Ptr("33e7cc6e-a139-4723-a0e5-76993aee0771"), - // Type: to.Ptr("Microsoft.Security/customEntityStoreAssignments"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/TestResourceGroup/providers/Microsoft.Security/customEntityStoreAssignments/33e7cc6e-a139-4723-a0e5-76993aee0771"), - // Properties: &armsecurity.CustomEntityStoreAssignmentProperties{ - // EntityStoreDatabaseLink: to.Ptr("https://dataexplorer.azure.com/clusters/securitydatastore.centralus/databases/DiscoveryAwsKedamari?query=H4sIAAAAAAAAAwtILC4uzy9KCcjPyUyu5OWqUShJzE5VMAQAlMJzABgAAAA="), - // Principal: to.Ptr("aaduser=f3923a3e-ad57-4752-b1a9-fbf3c8e5e082;72f988bf-86f1-41af-91ab-2d7cd011db47"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentCreate_example.json -func ExampleCustomEntityStoreAssignmentsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCustomEntityStoreAssignmentsClient().Create(ctx, "TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", armsecurity.CustomEntityStoreAssignmentRequest{ - Properties: &armsecurity.CustomEntityStoreAssignmentRequestProperties{ - Principal: to.Ptr("aaduser=f3923a3e-ad57-4752-b1a9-fbf3c8e5e082;72f988bf-86f1-41af-91ab-2d7cd011db47"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomEntityStoreAssignment = armsecurity.CustomEntityStoreAssignment{ - // Name: to.Ptr("33e7cc6e-a139-4723-a0e5-76993aee0771"), - // Type: to.Ptr("Microsoft.Security/customEntityStoreAssignments"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/TestResourceGroup/providers/Microsoft.Security/customEntityStoreAssignments/33e7cc6e-a139-4723-a0e5-76993aee0771"), - // Properties: &armsecurity.CustomEntityStoreAssignmentProperties{ - // EntityStoreDatabaseLink: to.Ptr("https://dataexplorer.azure.com/clusters/securitydatastore.centralus/databases/DiscoveryAwsKedamari?query=H4sIAAAAAAAAAwtILC4uzy9KCcjPyUyu5OWqUShJzE5VMAQAlMJzABgAAAA="), - // Principal: to.Ptr("aaduser=f3923a3e-ad57-4752-b1a9-fbf3c8e5e082;72f988bf-86f1-41af-91ab-2d7cd011db47"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentDelete_example.json -func ExampleCustomEntityStoreAssignmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewCustomEntityStoreAssignmentsClient().Delete(ctx, "TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentListByResourceGroup_example.json -func ExampleCustomEntityStoreAssignmentsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCustomEntityStoreAssignmentsClient().NewListByResourceGroupPager("TestResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CustomEntityStoreAssignmentsListResult = armsecurity.CustomEntityStoreAssignmentsListResult{ - // Value: []*armsecurity.CustomEntityStoreAssignment{ - // { - // Name: to.Ptr("33e7cc6e-a139-4723-a0e5-76993aee0771"), - // Type: to.Ptr("Microsoft.Security/customEntityStoreAssignments"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/TestResourceGroup/providers/Microsoft.Security/customEntityStoreAssignments/33e7cc6e-a139-4723-a0e5-76993aee0771"), - // Properties: &armsecurity.CustomEntityStoreAssignmentProperties{ - // EntityStoreDatabaseLink: to.Ptr("https://dataexplorer.azure.com/clusters/securitydatastore.centralus/databases/DiscoveryAwsKedamari?query=H4sIAAAAAAAAAwtILC4uzy9KCcjPyUyu5OWqUShJzE5VMAQAlMJzABgAAAA="), - // Principal: to.Ptr("aaduser=f3923a3e-ad57-4752-b1a9-fbf3c8e5e082;72f988bf-86f1-41af-91ab-2d7cd011db47"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("a400695c-4728-d5cc-8e19-4b5a76f209df"), - // Type: to.Ptr("Microsoft.Security/customEntityStoreAssignments"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/TestResourceGroup/providers/Microsoft.Security/customEntityStoreAssignments/a400695c-4728-d5cc-8e19-4b5a76f209df"), - // Properties: &armsecurity.CustomEntityStoreAssignmentProperties{ - // EntityStoreDatabaseLink: to.Ptr("https://dataexplorer.azure.com/clusters/securitydatastore.centralus/databases/DiscoveryAwsKedamari?query=H4sIAAAAAAAAAwvIz8lMrgzKz0nlqlFIrShJzUtR8Cz2SE3MKcmoVLBVUE9LzClOVQcA1IFnficAAAA="), - // Principal: to.Ptr("aaduser=f6e2564c-f34a-9b61-416c-5e5e7e521118;72f988bf-86f1-41af-91ab-2d7cd011db47"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentListBySubscription_example.json -func ExampleCustomEntityStoreAssignmentsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCustomEntityStoreAssignmentsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CustomEntityStoreAssignmentsListResult = armsecurity.CustomEntityStoreAssignmentsListResult{ - // Value: []*armsecurity.CustomEntityStoreAssignment{ - // { - // Name: to.Ptr("33e7cc6e-a139-4723-a0e5-76993aee0771"), - // Type: to.Ptr("Microsoft.Security/customEntityStoreAssignments"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/TestResourceGroup/providers/Microsoft.Security/customEntityStoreAssignments/33e7cc6e-a139-4723-a0e5-76993aee0771"), - // Properties: &armsecurity.CustomEntityStoreAssignmentProperties{ - // EntityStoreDatabaseLink: to.Ptr("https://dataexplorer.azure.com/clusters/securitydatastore.centralus/databases/DiscoveryAwsKedamari?query=H4sIAAAAAAAAAwtILC4uzy9KCcjPyUyu5OWqUShJzE5VMAQAlMJzABgAAAA="), - // Principal: to.Ptr("aaduser=f3923a3e-ad57-4752-b1a9-fbf3c8e5e082;72f988bf-86f1-41af-91ab-2d7cd011db47"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("a400695c-4728-d5cc-8e19-4b5a76f209df"), - // Type: to.Ptr("Microsoft.Security/customEntityStoreAssignments"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/TestResourceGroup/providers/Microsoft.Security/customEntityStoreAssignments/a400695c-4728-d5cc-8e19-4b5a76f209df"), - // Properties: &armsecurity.CustomEntityStoreAssignmentProperties{ - // EntityStoreDatabaseLink: to.Ptr("https://dataexplorer.azure.com/clusters/securitydatastore.centralus/databases/DiscoveryAwsKedamari?query=H4sIAAAAAAAAAwvIz8lMrgzKz0nlqlFIrShJzUtR8Cz2SE3MKcmoVLBVUE9LzClOVQcA1IFnficAAAA="), - // Principal: to.Ptr("aaduser=f6e2564c-f34a-9b61-416c-5e5e7e521118;72f988bf-86f1-41af-91ab-2d7cd011db47"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:01:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:01:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/devicesecuritygroups_client_example_test.go b/sdk/resourcemanager/security/armsecurity/devicesecuritygroups_client_example_test.go deleted file mode 100644 index ebb32e5616a2..000000000000 --- a/sdk/resourcemanager/security/armsecurity/devicesecuritygroups_client_example_test.go +++ /dev/null @@ -1,664 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/ListDeviceSecurityGroups_example.json -func ExampleDeviceSecurityGroupsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDeviceSecurityGroupsClient().NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DeviceSecurityGroupList = armsecurity.DeviceSecurityGroupList{ - // Value: []*armsecurity.DeviceSecurityGroup{ - // { - // Name: to.Ptr("samplesecuritygroup"), - // Type: to.Ptr("Microsoft.Security/deviceSecurityGroups"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub/providers/Microsoft.Security/deviceSecurityGroups/samplesecuritygroup"), - // Properties: &armsecurity.DeviceSecurityGroupProperties{ - // AllowlistRules: []armsecurity.AllowlistCustomAlertRuleClassification{ - // &armsecurity.ConnectionToIPNotAllowed{ - // Description: to.Ptr("Get an alert when an outbound connection is created between your device and an ip that isn't allowed"), - // DisplayName: to.Ptr("Outbound connection to an ip that isn't allowed"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("ConnectionToIpNotAllowed"), - // ValueType: to.Ptr(armsecurity.ValueTypeIPCidr), - // AllowlistValues: []*string{ - // }, - // }, - // &armsecurity.LocalUserNotAllowed{ - // Description: to.Ptr("Get an alert when a local user that isn't allowed logins to the device"), - // DisplayName: to.Ptr("Login by a local user that isn't allowed"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("LocalUserNotAllowed"), - // ValueType: to.Ptr(armsecurity.ValueTypeString), - // AllowlistValues: []*string{ - // }, - // }, - // &armsecurity.ProcessNotAllowed{ - // Description: to.Ptr("Get an alert when a process that isn't allowed is executed"), - // DisplayName: to.Ptr("Execution of a process that isn't allowed"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("ProcessNotAllowed"), - // ValueType: to.Ptr(armsecurity.ValueTypeString), - // AllowlistValues: []*string{ - // }, - // }}, - // DenylistRules: []*armsecurity.DenylistCustomAlertRule{ - // }, - // ThresholdRules: []armsecurity.ThresholdCustomAlertRuleClassification{ - // }, - // TimeWindowRules: []armsecurity.TimeWindowCustomAlertRuleClassification{ - // &armsecurity.ActiveConnectionsNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of active connections of a device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of active connections is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("ActiveConnectionsNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.AmqpC2DMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (AMQP protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of cloud to device messages (AMQP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("AmqpC2DMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.MqttC2DMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (MQTT protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of cloud to device messages (MQTT protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("MqttC2DMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.HTTPC2DMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (HTTP protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of cloud to device messages (HTTP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("HttpC2DMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.AmqpC2DRejectedMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (AMQP protocol) that were rejected by the device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of rejected cloud to device messages (AMQP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("AmqpC2DRejectedMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.MqttC2DRejectedMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (MQTT protocol) that were rejected by the device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of rejected cloud to device messages (MQTT protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("MqttC2DRejectedMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.HTTPC2DRejectedMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (HTTP protocol) that were rejected by the device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of rejected cloud to device messages (HTTP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("HttpC2DRejectedMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.AmqpD2CMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of device to cloud messages (AMQP protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of device to cloud messages (AMQP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("AmqpD2CMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.MqttD2CMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of device to cloud messages (MQTT protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of device to cloud messages (MQTT protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("MqttD2CMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.HTTPD2CMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of device to cloud messages (HTTP protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of device to cloud messages (HTTP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("HttpD2CMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.DirectMethodInvokesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of direct method invokes in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of direct method invokes is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("DirectMethodInvokesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.FailedLocalLoginsNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of failed local logins on the device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of failed local logins is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("FailedLocalLoginsNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.FileUploadsNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of file uploads from the device to the cloud in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of file uploads is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("FileUploadsNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.QueuePurgesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of device queue purges in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of device queue purges is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("QueuePurgesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.TwinUpdatesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of twin updates (by the device or the service) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of twin updates is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("TwinUpdatesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.UnauthorizedOperationsNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number unauthorized operations in the time window is not in the allowed range. Unauthorized operations are operations that affect the device (or done by it) that fail because of an unauthorized error"), - // DisplayName: to.Ptr("Number of unauthorized operations is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("UnauthorizedOperationsNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/GetDeviceSecurityGroups_example.json -func ExampleDeviceSecurityGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDeviceSecurityGroupsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", "samplesecuritygroup", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DeviceSecurityGroup = armsecurity.DeviceSecurityGroup{ - // Name: to.Ptr("samplesecuritygroup"), - // Type: to.Ptr("Microsoft.Security/deviceSecurityGroups"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub/providers/Microsoft.Security/deviceSecurityGroups/samplesecuritygroup"), - // Properties: &armsecurity.DeviceSecurityGroupProperties{ - // AllowlistRules: []armsecurity.AllowlistCustomAlertRuleClassification{ - // &armsecurity.ConnectionToIPNotAllowed{ - // Description: to.Ptr("Get an alert when an outbound connection is created between your device and an ip that isn't allowed"), - // DisplayName: to.Ptr("Outbound connection to an ip that isn't allowed"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("ConnectionToIpNotAllowed"), - // ValueType: to.Ptr(armsecurity.ValueTypeIPCidr), - // AllowlistValues: []*string{ - // }, - // }, - // &armsecurity.LocalUserNotAllowed{ - // Description: to.Ptr("Get an alert when a local user that isn't allowed logins to the device"), - // DisplayName: to.Ptr("Login by a local user that isn't allowed"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("LocalUserNotAllowed"), - // ValueType: to.Ptr(armsecurity.ValueTypeString), - // AllowlistValues: []*string{ - // }, - // }, - // &armsecurity.ProcessNotAllowed{ - // Description: to.Ptr("Get an alert when a process that isn't allowed is executed"), - // DisplayName: to.Ptr("Execution of a process that isn't allowed"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("ProcessNotAllowed"), - // ValueType: to.Ptr(armsecurity.ValueTypeString), - // AllowlistValues: []*string{ - // }, - // }}, - // DenylistRules: []*armsecurity.DenylistCustomAlertRule{ - // }, - // ThresholdRules: []armsecurity.ThresholdCustomAlertRuleClassification{ - // }, - // TimeWindowRules: []armsecurity.TimeWindowCustomAlertRuleClassification{ - // &armsecurity.ActiveConnectionsNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of active connections of a device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of active connections is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("ActiveConnectionsNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.AmqpC2DMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (AMQP protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of cloud to device messages (AMQP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("AmqpC2DMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.MqttC2DMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (MQTT protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of cloud to device messages (MQTT protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("MqttC2DMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.HTTPC2DMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (HTTP protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of cloud to device messages (HTTP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("HttpC2DMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.AmqpC2DRejectedMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (AMQP protocol) that were rejected by the device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of rejected cloud to device messages (AMQP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("AmqpC2DRejectedMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.MqttC2DRejectedMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (MQTT protocol) that were rejected by the device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of rejected cloud to device messages (MQTT protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("MqttC2DRejectedMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.HTTPC2DRejectedMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (HTTP protocol) that were rejected by the device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of rejected cloud to device messages (HTTP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("HttpC2DRejectedMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.AmqpD2CMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of device to cloud messages (AMQP protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of device to cloud messages (AMQP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("AmqpD2CMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.MqttD2CMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of device to cloud messages (MQTT protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of device to cloud messages (MQTT protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("MqttD2CMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.HTTPD2CMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of device to cloud messages (HTTP protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of device to cloud messages (HTTP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("HttpD2CMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.DirectMethodInvokesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of direct method invokes in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of direct method invokes is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("DirectMethodInvokesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.FailedLocalLoginsNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of failed local logins on the device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of failed local logins is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("FailedLocalLoginsNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.FileUploadsNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of file uploads from the device to the cloud in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of file uploads is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("FileUploadsNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.QueuePurgesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of device queue purges in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of device queue purges is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("QueuePurgesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.TwinUpdatesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of twin updates (by the device or the service) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of twin updates is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("TwinUpdatesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.UnauthorizedOperationsNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number unauthorized operations in the time window is not in the allowed range. Unauthorized operations are operations that affect the device (or done by it) that fail because of an unauthorized error"), - // DisplayName: to.Ptr("Number of unauthorized operations is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("UnauthorizedOperationsNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/PutDeviceSecurityGroups_example.json -func ExampleDeviceSecurityGroupsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDeviceSecurityGroupsClient().CreateOrUpdate(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", "samplesecuritygroup", armsecurity.DeviceSecurityGroup{ - Properties: &armsecurity.DeviceSecurityGroupProperties{ - TimeWindowRules: []armsecurity.TimeWindowCustomAlertRuleClassification{ - &armsecurity.ActiveConnectionsNotInAllowedRange{ - IsEnabled: to.Ptr(true), - RuleType: to.Ptr("ActiveConnectionsNotInAllowedRange"), - MaxThreshold: to.Ptr[int32](30), - MinThreshold: to.Ptr[int32](0), - TimeWindowSize: to.Ptr("PT05M"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DeviceSecurityGroup = armsecurity.DeviceSecurityGroup{ - // Name: to.Ptr("samplesecuritygroup"), - // Type: to.Ptr("Microsoft.Security/deviceSecurityGroups"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub/providers/Microsoft.Security/deviceSecurityGroups/samplesecuritygroup"), - // Properties: &armsecurity.DeviceSecurityGroupProperties{ - // AllowlistRules: []armsecurity.AllowlistCustomAlertRuleClassification{ - // &armsecurity.ConnectionToIPNotAllowed{ - // Description: to.Ptr("Get an alert when an outbound connection is created between your device and an ip that isn't allowed"), - // DisplayName: to.Ptr("Outbound connection to an ip that isn't allowed"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("ConnectionToIpNotAllowed"), - // AllowlistValues: []*string{ - // }, - // }, - // &armsecurity.LocalUserNotAllowed{ - // Description: to.Ptr("Get an alert when a local user that isn't allowed logins to the device"), - // DisplayName: to.Ptr("Login by a local user that isn't allowed"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("LocalUserNotAllowed"), - // AllowlistValues: []*string{ - // }, - // }, - // &armsecurity.ProcessNotAllowed{ - // Description: to.Ptr("Get an alert when a process that isn't allowed is executed"), - // DisplayName: to.Ptr("Execution of a process that isn't allowed"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("ProcessNotAllowed"), - // AllowlistValues: []*string{ - // }, - // }}, - // DenylistRules: []*armsecurity.DenylistCustomAlertRule{ - // }, - // ThresholdRules: []armsecurity.ThresholdCustomAlertRuleClassification{ - // }, - // TimeWindowRules: []armsecurity.TimeWindowCustomAlertRuleClassification{ - // &armsecurity.ActiveConnectionsNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of active connections of a device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of active connections is not in allowed range"), - // IsEnabled: to.Ptr(true), - // RuleType: to.Ptr("ActiveConnectionsNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](30), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT05M"), - // }, - // &armsecurity.AmqpC2DMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (AMQP protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of cloud to device messages (AMQP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("AmqpC2DMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.MqttC2DMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (MQTT protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of cloud to device messages (MQTT protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("MqttC2DMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.HTTPC2DMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (HTTP protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of cloud to device messages (HTTP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("HttpC2DMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.AmqpC2DRejectedMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (AMQP protocol) that were rejected by the device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of rejected cloud to device messages (AMQP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("AmqpC2DRejectedMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.MqttC2DRejectedMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (MQTT protocol) that were rejected by the device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of rejected cloud to device messages (MQTT protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("MqttC2DRejectedMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.HTTPC2DRejectedMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (HTTP protocol) that were rejected by the device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of rejected cloud to device messages (HTTP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("HttpC2DRejectedMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.AmqpD2CMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of device to cloud messages (AMQP protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of device to cloud messages (AMQP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("AmqpD2CMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.MqttD2CMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of device to cloud messages (MQTT protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of device to cloud messages (MQTT protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("MqttD2CMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.HTTPD2CMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of device to cloud messages (HTTP protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of device to cloud messages (HTTP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("HttpD2CMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.DirectMethodInvokesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of direct method invokes in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of direct method invokes is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("DirectMethodInvokesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.FailedLocalLoginsNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of failed local logins on the device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of failed local logins is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("FailedLocalLoginsNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.FileUploadsNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of file uploads from the device to the cloud in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of file uploads is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("FileUploadsNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.QueuePurgesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of device queue purges in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of device queue purges is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("QueuePurgesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.TwinUpdatesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of twin updates (by the device or the service) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of twin updates is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("TwinUpdatesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.UnauthorizedOperationsNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number unauthorized operations in the time window is not in the allowed range. Unauthorized operations are operations that affect the device (or done by it) that fail because of an unauthorized error"), - // DisplayName: to.Ptr("Number of unauthorized operations is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("UnauthorizedOperationsNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/DeleteDeviceSecurityGroups_example.json -func ExampleDeviceSecurityGroupsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDeviceSecurityGroupsClient().Delete(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", "samplesecuritygroup", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/discoveredsecuritysolutions_client_example_test.go b/sdk/resourcemanager/security/armsecurity/discoveredsecuritysolutions_client_example_test.go deleted file mode 100644 index 1a15591da29a..000000000000 --- a/sdk/resourcemanager/security/armsecurity/discoveredsecuritysolutions_client_example_test.go +++ /dev/null @@ -1,154 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionsSubscription_example.json -func ExampleDiscoveredSecuritySolutionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDiscoveredSecuritySolutionsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DiscoveredSecuritySolutionList = armsecurity.DiscoveredSecuritySolutionList{ - // Value: []*armsecurity.DiscoveredSecuritySolution{ - // { - // Location: to.Ptr("eastus"), - // Name: to.Ptr("CP"), - // Type: to.Ptr("Microsoft.Security/locations/discoveredSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/centralus/discoveredSecuritySolutions/CP"), - // Properties: &armsecurity.DiscoveredSecuritySolutionProperties{ - // Offer: to.Ptr("cisco-asav"), - // Publisher: to.Ptr("cisco"), - // SecurityFamily: to.Ptr(armsecurity.SecurityFamilyNgfw), - // SKU: to.Ptr("asav-azure-byol"), - // }, - // }, - // { - // Location: to.Ptr("eastus2"), - // Name: to.Ptr("paloalto7"), - // Type: to.Ptr("Microsoft.Security/locations/discoveredSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg2/providers/Microsoft.Security/locations/centralus/discoveredSecuritySolutions/paloalto7"), - // Properties: &armsecurity.DiscoveredSecuritySolutionProperties{ - // Offer: to.Ptr("vmseries1"), - // Publisher: to.Ptr("paloaltonetworks"), - // SecurityFamily: to.Ptr(armsecurity.SecurityFamilyNgfw), - // SKU: to.Ptr("byol"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionsSubscriptionLocation_example.json -func ExampleDiscoveredSecuritySolutionsClient_NewListByHomeRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDiscoveredSecuritySolutionsClient().NewListByHomeRegionPager("centralus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DiscoveredSecuritySolutionList = armsecurity.DiscoveredSecuritySolutionList{ - // Value: []*armsecurity.DiscoveredSecuritySolution{ - // { - // Location: to.Ptr("eastus"), - // Name: to.Ptr("CP"), - // Type: to.Ptr("Microsoft.Security/locations/discoveredSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/centralus/discoveredSecuritySolutions/CP"), - // Properties: &armsecurity.DiscoveredSecuritySolutionProperties{ - // Offer: to.Ptr("cisco-asav"), - // Publisher: to.Ptr("cisco"), - // SecurityFamily: to.Ptr(armsecurity.SecurityFamilyNgfw), - // SKU: to.Ptr("asav-azure-byol"), - // }, - // }, - // { - // Location: to.Ptr("eastus2"), - // Name: to.Ptr("paloalto7"), - // Type: to.Ptr("Microsoft.Security/locations/discoveredSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg2/providers/Microsoft.Security/locations/centralus/discoveredSecuritySolutions/paloalto7"), - // Properties: &armsecurity.DiscoveredSecuritySolutionProperties{ - // Offer: to.Ptr("vmseries1"), - // Publisher: to.Ptr("paloaltonetworks"), - // SecurityFamily: to.Ptr(armsecurity.SecurityFamilyNgfw), - // SKU: to.Ptr("byol"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionResourceGroupLocation_example.json -func ExampleDiscoveredSecuritySolutionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDiscoveredSecuritySolutionsClient().Get(ctx, "myRg2", "centralus", "paloalto7", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DiscoveredSecuritySolution = armsecurity.DiscoveredSecuritySolution{ - // Location: to.Ptr("eastus2"), - // Name: to.Ptr("paloalto7"), - // Type: to.Ptr("Microsoft.Security/locations/discoveredSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg2/providers/Microsoft.Security/locations/centralus/discoveredSecuritySolutions/paloalto7"), - // Properties: &armsecurity.DiscoveredSecuritySolutionProperties{ - // Offer: to.Ptr("vmseries1"), - // Publisher: to.Ptr("paloaltonetworks"), - // SecurityFamily: to.Ptr(armsecurity.SecurityFamilyNgfw), - // SKU: to.Ptr("byol"), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/externalsecuritysolutions_client_example_test.go b/sdk/resourcemanager/security/armsecurity/externalsecuritysolutions_client_example_test.go deleted file mode 100644 index c3c144586cf0..000000000000 --- a/sdk/resourcemanager/security/armsecurity/externalsecuritysolutions_client_example_test.go +++ /dev/null @@ -1,199 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolutionsSubscription_example.json -func ExampleExternalSecuritySolutionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExternalSecuritySolutionsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExternalSecuritySolutionList = armsecurity.ExternalSecuritySolutionList{ - // Value: []*armsecurity.ExternalSecuritySolution{ - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Location: to.Ptr("eastus"), - // Name: to.Ptr("aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/defaultresourcegroup-eus/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus"), - // }, - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-weu"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/defaultresourcegroup-weu/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-weu"), - // }, - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindCEF), - // Location: to.Ptr("westcentralus"), - // Name: to.Ptr("cef_omsprd_barracudanetworks_waf_barracuda"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/unificationprod/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/cef_omsprd_barracudanetworks_waf_barracuda"), - // }, - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindCEF), - // Location: to.Ptr("westcentralus"), - // Name: to.Ptr("cef_omsprd_virtualhoneypot_Microsoft_demovm20"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/unificationprod/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/cef_omsprd_virtualhoneypot_Microsoft_demovm20"), - // }, - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindCEF), - // Location: to.Ptr("westcentralus"), - // Name: to.Ptr("cef_omsprd_virtualhoneypot_Microsoft_demovm10"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/unificationprod/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/cef_omsprd_virtualhoneypot_Microsoft_demovm10"), - // }, - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Location: to.Ptr("westcentralus"), - // Name: to.Ptr("aad_omsprd"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/unificationprod/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_omsprd"), - // }, - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Location: to.Ptr("japaneast"), - // Name: to.Ptr("aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-ejp"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/defaultresourcegroup-ejp/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-ejp"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolutionsSubscriptionLocation_example.json -func ExampleExternalSecuritySolutionsClient_NewListByHomeRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExternalSecuritySolutionsClient().NewListByHomeRegionPager("centralus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExternalSecuritySolutionList = armsecurity.ExternalSecuritySolutionList{ - // Value: []*armsecurity.ExternalSecuritySolution{ - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Location: to.Ptr("eastus"), - // Name: to.Ptr("aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/defaultresourcegroup-eus/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus"), - // }, - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-weu"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/defaultresourcegroup-weu/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-weu"), - // }, - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindCEF), - // Location: to.Ptr("westcentralus"), - // Name: to.Ptr("cef_omsprd_barracudanetworks_waf_barracuda"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/unificationprod/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/cef_omsprd_barracudanetworks_waf_barracuda"), - // }, - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindCEF), - // Location: to.Ptr("westcentralus"), - // Name: to.Ptr("cef_omsprd_virtualhoneypot_Microsoft_demovm20"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/unificationprod/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/cef_omsprd_virtualhoneypot_Microsoft_demovm20"), - // }, - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindCEF), - // Location: to.Ptr("westcentralus"), - // Name: to.Ptr("cef_omsprd_virtualhoneypot_Microsoft_demovm10"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/unificationprod/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/cef_omsprd_virtualhoneypot_Microsoft_demovm10"), - // }, - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Location: to.Ptr("westcentralus"), - // Name: to.Ptr("aad_omsprd"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/unificationprod/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_omsprd"), - // }, - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Location: to.Ptr("japaneast"), - // Name: to.Ptr("aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-ejp"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/defaultresourcegroup-ejp/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-ejp"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolution_example.json -func ExampleExternalSecuritySolutionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExternalSecuritySolutionsClient().Get(ctx, "defaultresourcegroup-eus", "centralus", "aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExternalSecuritySolution = armsecurity.ExternalSecuritySolution{ - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Location: to.Ptr("eastus"), - // Name: to.Ptr("aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/defaultresourcegroup-eus/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus"), - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/go.mod b/sdk/resourcemanager/security/armsecurity/go.mod index 246ab881c075..4315949e4bb0 100644 --- a/sdk/resourcemanager/security/armsecurity/go.mod +++ b/sdk/resourcemanager/security/armsecurity/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurit go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect golang.org/x/text v0.7.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/security/armsecurity/go.sum b/sdk/resourcemanager/security/armsecurity/go.sum index 8ba445a8c4da..b6bd7eaad1ba 100644 --- a/sdk/resourcemanager/security/armsecurity/go.sum +++ b/sdk/resourcemanager/security/armsecurity/go.sum @@ -1,31 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/security/armsecurity/governanceassignments_client.go b/sdk/resourcemanager/security/armsecurity/governanceassignments_client.go index 8856e84d2090..8829044848f2 100644 --- a/sdk/resourcemanager/security/armsecurity/governanceassignments_client.go +++ b/sdk/resourcemanager/security/armsecurity/governanceassignments_client.go @@ -41,15 +41,16 @@ func NewGovernanceAssignmentsClient(credential azcore.TokenCredential, options * return client, nil } -// CreateOrUpdate - Creates or update a security GovernanceAssignment on the given subscription. +// CreateOrUpdate - Creates or updates a governance assignment on the given subscription. // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-01-01-preview -// - scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group -// (/providers/Microsoft.Management/managementGroups/mgName). -// - assessmentName - The Assessment Key - Unique key for the assessment type -// - assignmentKey - The security governance assignment key - the assessment key of the required governance assignment -// - governanceAssignment - GovernanceAssignment over a subscription scope +// - scope - The scope of the Governance assignments. Valid scopes are: subscription (format: 'subscriptions/{subscriptionId}'), +// or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - assessmentName - The Assessment Key - A unique key for the assessment type +// - assignmentKey - The governance assignment key - the assessment key of the required governance assignment +// - governanceAssignment - Governance assignment over a subscription scope // - options - GovernanceAssignmentsClientCreateOrUpdateOptions contains the optional parameters for the GovernanceAssignmentsClient.CreateOrUpdate // method. func (client *GovernanceAssignmentsClient) CreateOrUpdate(ctx context.Context, scope string, assessmentName string, assignmentKey string, governanceAssignment GovernanceAssignment, options *GovernanceAssignmentsClientCreateOrUpdateOptions) (GovernanceAssignmentsClientCreateOrUpdateResponse, error) { @@ -70,7 +71,10 @@ func (client *GovernanceAssignmentsClient) CreateOrUpdate(ctx context.Context, s // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *GovernanceAssignmentsClient) createOrUpdateCreateRequest(ctx context.Context, scope string, assessmentName string, assignmentKey string, governanceAssignment GovernanceAssignment, options *GovernanceAssignmentsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}" - urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) if assessmentName == "" { return nil, errors.New("parameter assessmentName cannot be empty") } @@ -103,10 +107,11 @@ func (client *GovernanceAssignmentsClient) createOrUpdateHandleResponse(resp *ht // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-01-01-preview -// - scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group -// (/providers/Microsoft.Management/managementGroups/mgName). -// - assessmentName - The Assessment Key - Unique key for the assessment type -// - assignmentKey - The security governance assignment key - the assessment key of the required governance assignment +// - scope - The scope of the Governance assignments. Valid scopes are: subscription (format: 'subscriptions/{subscriptionId}'), +// or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - assessmentName - The Assessment Key - A unique key for the assessment type +// - assignmentKey - The governance assignment key - the assessment key of the required governance assignment // - options - GovernanceAssignmentsClientDeleteOptions contains the optional parameters for the GovernanceAssignmentsClient.Delete // method. func (client *GovernanceAssignmentsClient) Delete(ctx context.Context, scope string, assessmentName string, assignmentKey string, options *GovernanceAssignmentsClientDeleteOptions) (GovernanceAssignmentsClientDeleteResponse, error) { @@ -127,7 +132,10 @@ func (client *GovernanceAssignmentsClient) Delete(ctx context.Context, scope str // deleteCreateRequest creates the Delete request. func (client *GovernanceAssignmentsClient) deleteCreateRequest(ctx context.Context, scope string, assessmentName string, assignmentKey string, options *GovernanceAssignmentsClientDeleteOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}" - urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) if assessmentName == "" { return nil, errors.New("parameter assessmentName cannot be empty") } @@ -150,10 +158,11 @@ func (client *GovernanceAssignmentsClient) deleteCreateRequest(ctx context.Conte // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-01-01-preview -// - scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group -// (/providers/Microsoft.Management/managementGroups/mgName). -// - assessmentName - The Assessment Key - Unique key for the assessment type -// - assignmentKey - The security governance assignment key - the assessment key of the required governance assignment +// - scope - The scope of the Governance assignments. Valid scopes are: subscription (format: 'subscriptions/{subscriptionId}'), +// or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - assessmentName - The Assessment Key - A unique key for the assessment type +// - assignmentKey - The governance assignment key - the assessment key of the required governance assignment // - options - GovernanceAssignmentsClientGetOptions contains the optional parameters for the GovernanceAssignmentsClient.Get // method. func (client *GovernanceAssignmentsClient) Get(ctx context.Context, scope string, assessmentName string, assignmentKey string, options *GovernanceAssignmentsClientGetOptions) (GovernanceAssignmentsClientGetResponse, error) { @@ -174,7 +183,10 @@ func (client *GovernanceAssignmentsClient) Get(ctx context.Context, scope string // getCreateRequest creates the Get request. func (client *GovernanceAssignmentsClient) getCreateRequest(ctx context.Context, scope string, assessmentName string, assignmentKey string, options *GovernanceAssignmentsClientGetOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}" - urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) if assessmentName == "" { return nil, errors.New("parameter assessmentName cannot be empty") } @@ -203,12 +215,13 @@ func (client *GovernanceAssignmentsClient) getHandleResponse(resp *http.Response return result, nil } -// NewListPager - Get security governanceAssignments on all your resources inside a scope +// NewListPager - Get governance assignments on all of your resources inside a scope // // Generated from API version 2022-01-01-preview -// - scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group -// (/providers/Microsoft.Management/managementGroups/mgName). -// - assessmentName - The Assessment Key - Unique key for the assessment type +// - scope - The scope of the Governance assignments. Valid scopes are: subscription (format: 'subscriptions/{subscriptionId}'), +// or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - assessmentName - The Assessment Key - A unique key for the assessment type // - options - GovernanceAssignmentsClientListOptions contains the optional parameters for the GovernanceAssignmentsClient.NewListPager // method. func (client *GovernanceAssignmentsClient) NewListPager(scope string, assessmentName string, options *GovernanceAssignmentsClientListOptions) *runtime.Pager[GovernanceAssignmentsClientListResponse] { @@ -242,7 +255,10 @@ func (client *GovernanceAssignmentsClient) NewListPager(scope string, assessment // listCreateRequest creates the List request. func (client *GovernanceAssignmentsClient) listCreateRequest(ctx context.Context, scope string, assessmentName string, options *GovernanceAssignmentsClientListOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments" - urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) if assessmentName == "" { return nil, errors.New("parameter assessmentName cannot be empty") } diff --git a/sdk/resourcemanager/security/armsecurity/governanceassignments_client_example_test.go b/sdk/resourcemanager/security/armsecurity/governanceassignments_client_example_test.go deleted file mode 100644 index caab49d0ccb9..000000000000 --- a/sdk/resourcemanager/security/armsecurity/governanceassignments_client_example_test.go +++ /dev/null @@ -1,209 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/ListGovernanceAssignments_example.json -func ExampleGovernanceAssignmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGovernanceAssignmentsClient().NewListPager("subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd", "6b9421dd-5555-2251-9b3d-2be58e2f82cd", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GovernanceAssignmentsList = armsecurity.GovernanceAssignmentsList{ - // Value: []*armsecurity.GovernanceAssignment{ - // { - // Name: to.Ptr("6634ff9f-127b-4bf2-8e6e-b1737f5e789c"), - // Type: to.Ptr("Microsoft.Security/assessments/governanceAssignments"), - // ID: to.Ptr("/subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012/providers/Microsoft.Security/assessments/6b9421dd-5555-2251-9b3d-2be58e2f82cd/governanceAssignments/6634ff9f-127b-4bf2-8e6e-b1737f5e789c"), - // Properties: &armsecurity.GovernanceAssignmentProperties{ - // AdditionalData: &armsecurity.GovernanceAssignmentAdditionalData{ - // TicketLink: to.Ptr("https://snow.com"), - // TicketNumber: to.Ptr[int32](123123), - // TicketStatus: to.Ptr("Active"), - // }, - // IsGracePeriod: to.Ptr(true), - // Owner: to.Ptr("user@contoso.com"), - // RemediationDueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-07T13:00:00.0000000Z"); return t}()), - // RemediationEta: &armsecurity.RemediationEta{ - // Eta: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T13:00:00.0000000Z"); return t}()), - // Justification: to.Ptr("Justification of ETA"), - // }, - // }, - // }, - // { - // Name: to.Ptr("41fb92a5-43dc-4c00-a969-469c16cef7a7"), - // Type: to.Ptr("Microsoft.Security/assessments/governanceAssignments"), - // ID: to.Ptr("/subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2011/providers/Microsoft.Security/assessments/6b9421dd-5555-2251-9b3d-2be58e2f82cd/governanceAssignments/41fb92a5-43dc-4c00-a969-469c16cef7a7"), - // Properties: &armsecurity.GovernanceAssignmentProperties{ - // AdditionalData: &armsecurity.GovernanceAssignmentAdditionalData{ - // TicketLink: to.Ptr("https://snow.com"), - // TicketNumber: to.Ptr[int32](653424), - // TicketStatus: to.Ptr("Active"), - // }, - // IsGracePeriod: to.Ptr(true), - // Owner: to.Ptr("user2@contoso.com"), - // RemediationDueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-07T13:00:00.0000000Z"); return t}()), - // RemediationEta: &armsecurity.RemediationEta{ - // Eta: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T13:00:00.0000000Z"); return t}()), - // Justification: to.Ptr("Justification of ETA"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/GetGovernanceAssignment_example.json -func ExampleGovernanceAssignmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGovernanceAssignmentsClient().Get(ctx, "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", "6b9421dd-5555-2251-9b3d-2be58e2f82cd", "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GovernanceAssignment = armsecurity.GovernanceAssignment{ - // Name: to.Ptr("6634ff9f-127b-4bf2-8e6e-b1737f5e789c"), - // Type: to.Ptr("Microsoft.Security/assessments/governanceAssignments"), - // ID: to.Ptr("/subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012/providers/Microsoft.Security/assessments/6b9421dd-5555-2251-9b3d-2be58e2f82cd/governanceAssignments/6634ff9f-127b-4bf2-8e6e-b1737f5e789c"), - // Properties: &armsecurity.GovernanceAssignmentProperties{ - // AdditionalData: &armsecurity.GovernanceAssignmentAdditionalData{ - // TicketLink: to.Ptr("https://snow.com"), - // TicketNumber: to.Ptr[int32](123123), - // TicketStatus: to.Ptr("Active"), - // }, - // GovernanceEmailNotification: &armsecurity.GovernanceEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(false), - // DisableOwnerEmailNotification: to.Ptr(false), - // }, - // IsGracePeriod: to.Ptr(true), - // Owner: to.Ptr("user@contoso.com"), - // RemediationDueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-07T13:00:00.0000000Z"); return t}()), - // RemediationEta: &armsecurity.RemediationEta{ - // Eta: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T13:00:00.0000000Z"); return t}()), - // Justification: to.Ptr("Justification of ETA"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/PutGovernanceAssignment_example.json -func ExampleGovernanceAssignmentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGovernanceAssignmentsClient().CreateOrUpdate(ctx, "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", "6b9421dd-5555-2251-9b3d-2be58e2f82cd", "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", armsecurity.GovernanceAssignment{ - Properties: &armsecurity.GovernanceAssignmentProperties{ - AdditionalData: &armsecurity.GovernanceAssignmentAdditionalData{ - TicketLink: to.Ptr("https://snow.com"), - TicketNumber: to.Ptr[int32](123123), - TicketStatus: to.Ptr("Active"), - }, - GovernanceEmailNotification: &armsecurity.GovernanceEmailNotification{ - DisableManagerEmailNotification: to.Ptr(false), - DisableOwnerEmailNotification: to.Ptr(false), - }, - IsGracePeriod: to.Ptr(true), - Owner: to.Ptr("user@contoso.com"), - RemediationDueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-07T13:00:00.0000000Z"); return t }()), - RemediationEta: &armsecurity.RemediationEta{ - Eta: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T13:00:00.0000000Z"); return t }()), - Justification: to.Ptr("Justification of ETA"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GovernanceAssignment = armsecurity.GovernanceAssignment{ - // Name: to.Ptr("6634ff9f-127b-4bf2-8e6e-b1737f5e789c"), - // Type: to.Ptr("Microsoft.Security/assessments/governanceAssignments"), - // ID: to.Ptr("/subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012/providers/Microsoft.Security/assessments/6b9421dd-5555-2251-9b3d-2be58e2f82cd/governanceAssignments/6634ff9f-127b-4bf2-8e6e-b1737f5e789c"), - // Properties: &armsecurity.GovernanceAssignmentProperties{ - // AdditionalData: &armsecurity.GovernanceAssignmentAdditionalData{ - // TicketLink: to.Ptr("https://snow.com"), - // TicketNumber: to.Ptr[int32](123123), - // TicketStatus: to.Ptr("Active"), - // }, - // GovernanceEmailNotification: &armsecurity.GovernanceEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(false), - // DisableOwnerEmailNotification: to.Ptr(false), - // }, - // IsGracePeriod: to.Ptr(true), - // Owner: to.Ptr("user@contoso.com"), - // RemediationDueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-07T13:00:00.0000000Z"); return t}()), - // RemediationEta: &armsecurity.RemediationEta{ - // Eta: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T13:00:00.0000000Z"); return t}()), - // Justification: to.Ptr("Justification of ETA"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/DeleteGovernanceAssignment_example.json -func ExampleGovernanceAssignmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewGovernanceAssignmentsClient().Delete(ctx, "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", "6b9421dd-5555-2251-9b3d-2be58e2f82cd", "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/governancerule_client.go b/sdk/resourcemanager/security/armsecurity/governancerule_client.go deleted file mode 100644 index bf540b50b4e6..000000000000 --- a/sdk/resourcemanager/security/armsecurity/governancerule_client.go +++ /dev/null @@ -1,104 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// GovernanceRuleClient contains the methods for the GovernanceRule group. -// Don't use this type directly, use NewGovernanceRuleClient() instead. -type GovernanceRuleClient struct { - internal *arm.Client - subscriptionID string -} - -// NewGovernanceRuleClient creates a new instance of GovernanceRuleClient with the specified values. -// - subscriptionID - Azure subscription ID -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewGovernanceRuleClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GovernanceRuleClient, error) { - cl, err := arm.NewClient(moduleName+".GovernanceRuleClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &GovernanceRuleClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// NewListPager - Get a list of all relevant governanceRules over a subscription level scope -// -// Generated from API version 2022-01-01-preview -// - options - GovernanceRuleClientListOptions contains the optional parameters for the GovernanceRuleClient.NewListPager method. -func (client *GovernanceRuleClient) NewListPager(options *GovernanceRuleClientListOptions) *runtime.Pager[GovernanceRuleClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[GovernanceRuleClientListResponse]{ - More: func(page GovernanceRuleClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GovernanceRuleClientListResponse) (GovernanceRuleClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return GovernanceRuleClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return GovernanceRuleClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GovernanceRuleClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *GovernanceRuleClient) listCreateRequest(ctx context.Context, options *GovernanceRuleClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *GovernanceRuleClient) listHandleResponse(resp *http.Response) (GovernanceRuleClientListResponse, error) { - result := GovernanceRuleClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GovernanceRuleList); err != nil { - return GovernanceRuleClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/security/armsecurity/governancerule_client_example_test.go b/sdk/resourcemanager/security/armsecurity/governancerule_client_example_test.go deleted file mode 100644 index 8cd0975e0797..000000000000 --- a/sdk/resourcemanager/security/armsecurity/governancerule_client_example_test.go +++ /dev/null @@ -1,112 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ListBySubscriptionGovernanceRules_example.json -func ExampleGovernanceRuleClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGovernanceRuleClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GovernanceRuleList = armsecurity.GovernanceRuleList{ - // Value: []*armsecurity.GovernanceRule{ - // { - // Name: to.Ptr("ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Type: to.Ptr("Microsoft.Security/governanceRules"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.GovernanceRuleProperties{ - // Description: to.Ptr("A rule on critical recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "In", - // "property": "$.AssessmentKey", - // "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]", - // }, - // }, - // }}, - // DisplayName: to.Ptr("Admin's rule"), - // GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(false), - // DisableOwnerEmailNotification: to.Ptr(false), - // }, - // IsDisabled: to.Ptr(false), - // IsGracePeriod: to.Ptr(true), - // OwnerSource: &armsecurity.GovernanceRuleOwnerSource{ - // Type: to.Ptr(armsecurity.GovernanceRuleOwnerSourceTypeManually), - // Value: to.Ptr("user@contoso.com"), - // }, - // RemediationTimeframe: to.Ptr("7.00:00:00"), - // RulePriority: to.Ptr[int32](100), - // RuleType: to.Ptr(armsecurity.GovernanceRuleTypeIntegrated), - // SourceResourceType: to.Ptr(armsecurity.GovernanceRuleSourceResourceTypeAssessments), - // }, - // }, - // { - // Name: to.Ptr("4106f43c-6d82-4fc8-a92c-dcfe50799d1d"), - // Type: to.Ptr("Microsoft.Security/governanceRules"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/governanceRules/4106f43c-6d82-4fc8-a92c-dcfe50799d1d"), - // Properties: &armsecurity.GovernanceRuleProperties{ - // Description: to.Ptr("A rule on critical recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "Equals", - // "property": "$.Metadata.Severity", - // "value": "Low", - // }, - // }, - // }}, - // DisplayName: to.Ptr("Admin's rule"), - // GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(true), - // DisableOwnerEmailNotification: to.Ptr(true), - // }, - // IsDisabled: to.Ptr(false), - // IsGracePeriod: to.Ptr(true), - // OwnerSource: &armsecurity.GovernanceRuleOwnerSource{ - // Type: to.Ptr(armsecurity.GovernanceRuleOwnerSourceTypeManually), - // Value: to.Ptr("user@contoso.com"), - // }, - // RemediationTimeframe: to.Ptr("7.00:00:00"), - // RulePriority: to.Ptr[int32](200), - // RuleType: to.Ptr(armsecurity.GovernanceRuleTypeIntegrated), - // SourceResourceType: to.Ptr(armsecurity.GovernanceRuleSourceResourceTypeAssessments), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/governancerules_client.go b/sdk/resourcemanager/security/armsecurity/governancerules_client.go index 114a35e623ef..4377ee18c5bd 100644 --- a/sdk/resourcemanager/security/armsecurity/governancerules_client.go +++ b/sdk/resourcemanager/security/armsecurity/governancerules_client.go @@ -24,36 +24,37 @@ import ( // GovernanceRulesClient contains the methods for the GovernanceRules group. // Don't use this type directly, use NewGovernanceRulesClient() instead. type GovernanceRulesClient struct { - internal *arm.Client - subscriptionID string + internal *arm.Client } // NewGovernanceRulesClient creates a new instance of GovernanceRulesClient with the specified values. -// - subscriptionID - Azure subscription ID // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. -func NewGovernanceRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GovernanceRulesClient, error) { +func NewGovernanceRulesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*GovernanceRulesClient, error) { cl, err := arm.NewClient(moduleName+".GovernanceRulesClient", moduleVersion, credential, options) if err != nil { return nil, err } client := &GovernanceRulesClient{ - subscriptionID: subscriptionID, - internal: cl, + internal: cl, } return client, nil } -// CreateOrUpdate - Creates or update a security GovernanceRule on the given subscription. +// CreateOrUpdate - Creates or updates a governance rule over a given scope // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-01-01-preview -// - ruleID - The security GovernanceRule key - unique key for the standard GovernanceRule -// - governanceRule - GovernanceRule over a subscription scope +// - scope - The scope of the Governance rules. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), +// subscription (format: +// 'subscriptions/{subscriptionId}'), or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - ruleID - The governance rule key - unique key for the standard governance rule (GUID) +// - governanceRule - Governance rule over a given scope // - options - GovernanceRulesClientCreateOrUpdateOptions contains the optional parameters for the GovernanceRulesClient.CreateOrUpdate // method. -func (client *GovernanceRulesClient) CreateOrUpdate(ctx context.Context, ruleID string, governanceRule GovernanceRule, options *GovernanceRulesClientCreateOrUpdateOptions) (GovernanceRulesClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, ruleID, governanceRule, options) +func (client *GovernanceRulesClient) CreateOrUpdate(ctx context.Context, scope string, ruleID string, governanceRule GovernanceRule, options *GovernanceRulesClientCreateOrUpdateOptions) (GovernanceRulesClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, scope, ruleID, governanceRule, options) if err != nil { return GovernanceRulesClientCreateOrUpdateResponse{}, err } @@ -68,12 +69,12 @@ func (client *GovernanceRulesClient) CreateOrUpdate(ctx context.Context, ruleID } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *GovernanceRulesClient) createOrUpdateCreateRequest(ctx context.Context, ruleID string, governanceRule GovernanceRule, options *GovernanceRulesClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") +func (client *GovernanceRulesClient) createOrUpdateCreateRequest(ctx context.Context, scope string, ruleID string, governanceRule GovernanceRule, options *GovernanceRulesClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}" + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) if ruleID == "" { return nil, errors.New("parameter ruleID cannot be empty") } @@ -98,34 +99,57 @@ func (client *GovernanceRulesClient) createOrUpdateHandleResponse(resp *http.Res return result, nil } -// Delete - Delete a GovernanceRule over a given scope +// BeginDelete - Delete a Governance rule over a given scope // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-01-01-preview -// - ruleID - The security GovernanceRule key - unique key for the standard GovernanceRule -// - options - GovernanceRulesClientDeleteOptions contains the optional parameters for the GovernanceRulesClient.Delete method. -func (client *GovernanceRulesClient) Delete(ctx context.Context, ruleID string, options *GovernanceRulesClientDeleteOptions) (GovernanceRulesClientDeleteResponse, error) { - req, err := client.deleteCreateRequest(ctx, ruleID, options) +// - scope - The scope of the Governance rules. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), +// subscription (format: +// 'subscriptions/{subscriptionId}'), or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - ruleID - The governance rule key - unique key for the standard governance rule (GUID) +// - options - GovernanceRulesClientBeginDeleteOptions contains the optional parameters for the GovernanceRulesClient.BeginDelete +// method. +func (client *GovernanceRulesClient) BeginDelete(ctx context.Context, scope string, ruleID string, options *GovernanceRulesClientBeginDeleteOptions) (*runtime.Poller[GovernanceRulesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, scope, ruleID, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GovernanceRulesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[GovernanceRulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Delete a Governance rule over a given scope +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-01-01-preview +func (client *GovernanceRulesClient) deleteOperation(ctx context.Context, scope string, ruleID string, options *GovernanceRulesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, scope, ruleID, options) if err != nil { - return GovernanceRulesClientDeleteResponse{}, err + return nil, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return GovernanceRulesClientDeleteResponse{}, err + return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return GovernanceRulesClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) } - return GovernanceRulesClientDeleteResponse{}, nil + return resp, nil } // deleteCreateRequest creates the Delete request. -func (client *GovernanceRulesClient) deleteCreateRequest(ctx context.Context, ruleID string, options *GovernanceRulesClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") +func (client *GovernanceRulesClient) deleteCreateRequest(ctx context.Context, scope string, ruleID string, options *GovernanceRulesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}" + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) if ruleID == "" { return nil, errors.New("parameter ruleID cannot be empty") } @@ -140,14 +164,87 @@ func (client *GovernanceRulesClient) deleteCreateRequest(ctx context.Context, ru return req, nil } -// Get - Get a specific governanceRule for the requested scope by ruleId +// BeginExecute - Execute a governance rule +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-01-01-preview +// - scope - The scope of the Governance rules. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), +// subscription (format: +// 'subscriptions/{subscriptionId}'), or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - ruleID - The governance rule key - unique key for the standard governance rule (GUID) +// - options - GovernanceRulesClientBeginExecuteOptions contains the optional parameters for the GovernanceRulesClient.BeginExecute +// method. +func (client *GovernanceRulesClient) BeginExecute(ctx context.Context, scope string, ruleID string, options *GovernanceRulesClientBeginExecuteOptions) (*runtime.Poller[GovernanceRulesClientExecuteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.execute(ctx, scope, ruleID, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GovernanceRulesClientExecuteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[GovernanceRulesClientExecuteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Execute - Execute a governance rule +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-01-01-preview +func (client *GovernanceRulesClient) execute(ctx context.Context, scope string, ruleID string, options *GovernanceRulesClientBeginExecuteOptions) (*http.Response, error) { + req, err := client.executeCreateRequest(ctx, scope, ruleID, options) + if err != nil { + return nil, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// executeCreateRequest creates the Execute request. +func (client *GovernanceRulesClient) executeCreateRequest(ctx context.Context, scope string, ruleID string, options *GovernanceRulesClientBeginExecuteOptions) (*policy.Request, error) { + urlPath := "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}/execute" + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) + if ruleID == "" { + return nil, errors.New("parameter ruleID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.ExecuteGovernanceRuleParams != nil { + return req, runtime.MarshalAsJSON(req, *options.ExecuteGovernanceRuleParams) + } + return req, nil +} + +// Get - Get a specific governance rule for the requested scope by ruleId // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-01-01-preview -// - ruleID - The security GovernanceRule key - unique key for the standard GovernanceRule +// - scope - The scope of the Governance rules. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), +// subscription (format: +// 'subscriptions/{subscriptionId}'), or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - ruleID - The governance rule key - unique key for the standard governance rule (GUID) // - options - GovernanceRulesClientGetOptions contains the optional parameters for the GovernanceRulesClient.Get method. -func (client *GovernanceRulesClient) Get(ctx context.Context, ruleID string, options *GovernanceRulesClientGetOptions) (GovernanceRulesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, ruleID, options) +func (client *GovernanceRulesClient) Get(ctx context.Context, scope string, ruleID string, options *GovernanceRulesClientGetOptions) (GovernanceRulesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, scope, ruleID, options) if err != nil { return GovernanceRulesClientGetResponse{}, err } @@ -162,12 +259,12 @@ func (client *GovernanceRulesClient) Get(ctx context.Context, ruleID string, opt } // getCreateRequest creates the Get request. -func (client *GovernanceRulesClient) getCreateRequest(ctx context.Context, ruleID string, options *GovernanceRulesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") +func (client *GovernanceRulesClient) getCreateRequest(ctx context.Context, scope string, ruleID string, options *GovernanceRulesClientGetOptions) (*policy.Request, error) { + urlPath := "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}" + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) if ruleID == "" { return nil, errors.New("parameter ruleID cannot be empty") } @@ -192,66 +289,51 @@ func (client *GovernanceRulesClient) getHandleResponse(resp *http.Response) (Gov return result, nil } -// BeginRuleIDExecuteSingleSecurityConnector - Execute a security GovernanceRule on the given security connector. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-01-01-preview -// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// - securityConnectorName - The security connector name. -// - ruleID - The security GovernanceRule key - unique key for the standard GovernanceRule -// - options - GovernanceRulesClientBeginRuleIDExecuteSingleSecurityConnectorOptions contains the optional parameters for the -// GovernanceRulesClient.BeginRuleIDExecuteSingleSecurityConnector method. -func (client *GovernanceRulesClient) BeginRuleIDExecuteSingleSecurityConnector(ctx context.Context, resourceGroupName string, securityConnectorName string, ruleID string, options *GovernanceRulesClientBeginRuleIDExecuteSingleSecurityConnectorOptions) (*runtime.Poller[GovernanceRulesClientRuleIDExecuteSingleSecurityConnectorResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.ruleIDExecuteSingleSecurityConnector(ctx, resourceGroupName, securityConnectorName, ruleID, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[GovernanceRulesClientRuleIDExecuteSingleSecurityConnectorResponse](resp, client.internal.Pipeline(), nil) - } else { - return runtime.NewPollerFromResumeToken[GovernanceRulesClientRuleIDExecuteSingleSecurityConnectorResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// RuleIDExecuteSingleSecurityConnector - Execute a security GovernanceRule on the given security connector. -// If the operation fails it returns an *azcore.ResponseError type. +// NewListPager - Get a list of all relevant governance rules over a scope // // Generated from API version 2022-01-01-preview -func (client *GovernanceRulesClient) ruleIDExecuteSingleSecurityConnector(ctx context.Context, resourceGroupName string, securityConnectorName string, ruleID string, options *GovernanceRulesClientBeginRuleIDExecuteSingleSecurityConnectorOptions) (*http.Response, error) { - req, err := client.ruleIDExecuteSingleSecurityConnectorCreateRequest(ctx, resourceGroupName, securityConnectorName, ruleID, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil +// - scope - The scope of the Governance rules. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), +// subscription (format: +// 'subscriptions/{subscriptionId}'), or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - options - GovernanceRulesClientListOptions contains the optional parameters for the GovernanceRulesClient.NewListPager +// method. +func (client *GovernanceRulesClient) NewListPager(scope string, options *GovernanceRulesClientListOptions) *runtime.Pager[GovernanceRulesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[GovernanceRulesClientListResponse]{ + More: func(page GovernanceRulesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *GovernanceRulesClientListResponse) (GovernanceRulesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, scope, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return GovernanceRulesClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GovernanceRulesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GovernanceRulesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) } -// ruleIDExecuteSingleSecurityConnectorCreateRequest creates the RuleIDExecuteSingleSecurityConnector request. -func (client *GovernanceRulesClient) ruleIDExecuteSingleSecurityConnectorCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, ruleID string, options *GovernanceRulesClientBeginRuleIDExecuteSingleSecurityConnectorOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/execute" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") +// listCreateRequest creates the List request. +func (client *GovernanceRulesClient) listCreateRequest(ctx context.Context, scope string, options *GovernanceRulesClientListOptions) (*policy.Request, error) { + urlPath := "/{scope}/providers/Microsoft.Security/governanceRules" + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if securityConnectorName == "" { - return nil, errors.New("parameter securityConnectorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) - if ruleID == "" { - return nil, errors.New("parameter ruleID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -259,62 +341,61 @@ func (client *GovernanceRulesClient) ruleIDExecuteSingleSecurityConnectorCreateR reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.ExecuteGovernanceRuleParams != nil { - return req, runtime.MarshalAsJSON(req, *options.ExecuteGovernanceRuleParams) - } return req, nil } -// BeginRuleIDExecuteSingleSubscription - Execute a security GovernanceRule on the given subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-01-01-preview -// - ruleID - The security GovernanceRule key - unique key for the standard GovernanceRule -// - options - GovernanceRulesClientBeginRuleIDExecuteSingleSubscriptionOptions contains the optional parameters for the GovernanceRulesClient.BeginRuleIDExecuteSingleSubscription -// method. -func (client *GovernanceRulesClient) BeginRuleIDExecuteSingleSubscription(ctx context.Context, ruleID string, options *GovernanceRulesClientBeginRuleIDExecuteSingleSubscriptionOptions) (*runtime.Poller[GovernanceRulesClientRuleIDExecuteSingleSubscriptionResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.ruleIDExecuteSingleSubscription(ctx, ruleID, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[GovernanceRulesClientRuleIDExecuteSingleSubscriptionResponse](resp, client.internal.Pipeline(), nil) - } else { - return runtime.NewPollerFromResumeToken[GovernanceRulesClientRuleIDExecuteSingleSubscriptionResponse](options.ResumeToken, client.internal.Pipeline(), nil) +// listHandleResponse handles the List response. +func (client *GovernanceRulesClient) listHandleResponse(resp *http.Response) (GovernanceRulesClientListResponse, error) { + result := GovernanceRulesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GovernanceRuleList); err != nil { + return GovernanceRulesClientListResponse{}, err } + return result, nil } -// RuleIDExecuteSingleSubscription - Execute a security GovernanceRule on the given subscription. +// OperationResults - Get governance rules long run operation result for the requested scope by ruleId and operationId // If the operation fails it returns an *azcore.ResponseError type. // // Generated from API version 2022-01-01-preview -func (client *GovernanceRulesClient) ruleIDExecuteSingleSubscription(ctx context.Context, ruleID string, options *GovernanceRulesClientBeginRuleIDExecuteSingleSubscriptionOptions) (*http.Response, error) { - req, err := client.ruleIDExecuteSingleSubscriptionCreateRequest(ctx, ruleID, options) +// - scope - The scope of the Governance rules. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), +// subscription (format: +// 'subscriptions/{subscriptionId}'), or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - ruleID - The governance rule key - unique key for the standard governance rule (GUID) +// - operationID - The governance rule long running operation unique key +// - options - GovernanceRulesClientOperationResultsOptions contains the optional parameters for the GovernanceRulesClient.OperationResults +// method. +func (client *GovernanceRulesClient) OperationResults(ctx context.Context, scope string, ruleID string, operationID string, options *GovernanceRulesClientOperationResultsOptions) (GovernanceRulesClientOperationResultsResponse, error) { + req, err := client.operationResultsCreateRequest(ctx, scope, ruleID, operationID, options) if err != nil { - return nil, err + return GovernanceRulesClientOperationResultsResponse{}, err } resp, err := client.internal.Pipeline().Do(req) if err != nil { - return nil, err + return GovernanceRulesClientOperationResultsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return GovernanceRulesClientOperationResultsResponse{}, runtime.NewResponseError(resp) } - return resp, nil + return client.operationResultsHandleResponse(resp) } -// ruleIDExecuteSingleSubscriptionCreateRequest creates the RuleIDExecuteSingleSubscription request. -func (client *GovernanceRulesClient) ruleIDExecuteSingleSubscriptionCreateRequest(ctx context.Context, ruleID string, options *GovernanceRulesClientBeginRuleIDExecuteSingleSubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/execute" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") +// operationResultsCreateRequest creates the OperationResults request. +func (client *GovernanceRulesClient) operationResultsCreateRequest(ctx context.Context, scope string, ruleID string, operationID string, options *GovernanceRulesClientOperationResultsOptions) (*policy.Request, error) { + urlPath := "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}" + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) if ruleID == "" { return nil, errors.New("parameter ruleID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if operationID == "" { + return nil, errors.New("parameter operationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } @@ -322,8 +403,17 @@ func (client *GovernanceRulesClient) ruleIDExecuteSingleSubscriptionCreateReques reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.ExecuteGovernanceRuleParams != nil { - return req, runtime.MarshalAsJSON(req, *options.ExecuteGovernanceRuleParams) - } return req, nil } + +// operationResultsHandleResponse handles the OperationResults response. +func (client *GovernanceRulesClient) operationResultsHandleResponse(resp *http.Response) (GovernanceRulesClientOperationResultsResponse, error) { + result := GovernanceRulesClientOperationResultsResponse{} + if val := resp.Header.Get("location"); val != "" { + result.Location = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.OperationResultAutoGenerated); err != nil { + return GovernanceRulesClientOperationResultsResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/governancerules_client_example_test.go b/sdk/resourcemanager/security/armsecurity/governancerules_client_example_test.go deleted file mode 100644 index b5145cf8370b..000000000000 --- a/sdk/resourcemanager/security/armsecurity/governancerules_client_example_test.go +++ /dev/null @@ -1,213 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRule_example.json -func ExampleGovernanceRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGovernanceRulesClient().Get(ctx, "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GovernanceRule = armsecurity.GovernanceRule{ - // Name: to.Ptr("ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Type: to.Ptr("Microsoft.Security/governanceRules"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.GovernanceRuleProperties{ - // Description: to.Ptr("A rule on critical recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "In", - // "property": "$.AssessmentKey", - // "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]", - // }, - // }, - // }}, - // DisplayName: to.Ptr("Admin's rule"), - // GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(false), - // DisableOwnerEmailNotification: to.Ptr(false), - // }, - // IsDisabled: to.Ptr(false), - // IsGracePeriod: to.Ptr(true), - // OwnerSource: &armsecurity.GovernanceRuleOwnerSource{ - // Type: to.Ptr(armsecurity.GovernanceRuleOwnerSourceTypeManually), - // Value: to.Ptr("user@contoso.com"), - // }, - // RemediationTimeframe: to.Ptr("7.00:00:00"), - // RulePriority: to.Ptr[int32](200), - // RuleType: to.Ptr(armsecurity.GovernanceRuleTypeIntegrated), - // SourceResourceType: to.Ptr(armsecurity.GovernanceRuleSourceResourceTypeAssessments), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PutGovernanceRule_example.json -func ExampleGovernanceRulesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGovernanceRulesClient().CreateOrUpdate(ctx, "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", armsecurity.GovernanceRule{ - Properties: &armsecurity.GovernanceRuleProperties{ - Description: to.Ptr("A rule on critical recommendations"), - ConditionSets: []any{ - map[string]any{ - "conditions": []any{ - map[string]any{ - "operator": "In", - "property": "$.AssessmentKey", - "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]", - }, - }, - }}, - DisplayName: to.Ptr("Admin's rule"), - GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - DisableManagerEmailNotification: to.Ptr(false), - DisableOwnerEmailNotification: to.Ptr(false), - }, - IsDisabled: to.Ptr(false), - IsGracePeriod: to.Ptr(true), - OwnerSource: &armsecurity.GovernanceRuleOwnerSource{ - Type: to.Ptr(armsecurity.GovernanceRuleOwnerSourceTypeManually), - Value: to.Ptr("user@contoso.com"), - }, - RemediationTimeframe: to.Ptr("7.00:00:00"), - RulePriority: to.Ptr[int32](200), - RuleType: to.Ptr(armsecurity.GovernanceRuleTypeIntegrated), - SourceResourceType: to.Ptr(armsecurity.GovernanceRuleSourceResourceTypeAssessments), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GovernanceRule = armsecurity.GovernanceRule{ - // Name: to.Ptr("1f3afdf9-d0c9-4c3d-847f-89da613e70a8"), - // Type: to.Ptr("Microsoft.Security/governanceRules"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.GovernanceRuleProperties{ - // Description: to.Ptr("A rule on critical recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "In", - // "property": "$.AssessmentKey", - // "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]", - // }, - // }, - // }}, - // DisplayName: to.Ptr("Admin's rule"), - // GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(false), - // DisableOwnerEmailNotification: to.Ptr(false), - // }, - // IsDisabled: to.Ptr(false), - // IsGracePeriod: to.Ptr(true), - // OwnerSource: &armsecurity.GovernanceRuleOwnerSource{ - // Type: to.Ptr(armsecurity.GovernanceRuleOwnerSourceTypeManually), - // Value: to.Ptr("user@contoso.com"), - // }, - // RemediationTimeframe: to.Ptr("7.00:00:00"), - // RulePriority: to.Ptr[int32](200), - // RuleType: to.Ptr(armsecurity.GovernanceRuleTypeIntegrated), - // SourceResourceType: to.Ptr(armsecurity.GovernanceRuleSourceResourceTypeAssessments), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteGovernanceRule_example.json -func ExampleGovernanceRulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewGovernanceRulesClient().Delete(ctx, "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PostGovernanceRule_example.json -func ExampleGovernanceRulesClient_BeginRuleIDExecuteSingleSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGovernanceRulesClient().BeginRuleIDExecuteSingleSubscription(ctx, "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", &armsecurity.GovernanceRulesClientBeginRuleIDExecuteSingleSubscriptionOptions{ExecuteGovernanceRuleParams: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PostSecurityConnectorGovernanceRule_example.json -func ExampleGovernanceRulesClient_BeginRuleIDExecuteSingleSecurityConnector() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGovernanceRulesClient().BeginRuleIDExecuteSingleSecurityConnector(ctx, "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", &armsecurity.GovernanceRulesClientBeginRuleIDExecuteSingleSecurityConnectorOptions{ExecuteGovernanceRuleParams: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/healthreport_client.go b/sdk/resourcemanager/security/armsecurity/healthreport_client.go new file mode 100644 index 000000000000..781f34614bce --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/healthreport_client.go @@ -0,0 +1,92 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armsecurity + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// HealthReportClient contains the methods for the HealthReport group. +// Don't use this type directly, use NewHealthReportClient() instead. +type HealthReportClient struct { + internal *arm.Client +} + +// NewHealthReportClient creates a new instance of HealthReportClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewHealthReportClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*HealthReportClient, error) { + cl, err := arm.NewClient(moduleName+".HealthReportClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &HealthReportClient{ + internal: cl, + } + return client, nil +} + +// Get - Get health report of resource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-02-01-preview +// - resourceID - The identifier of the resource. +// - healthReportName - The health report Key - Unique key for the health report type +// - options - HealthReportClientGetOptions contains the optional parameters for the HealthReportClient.Get method. +func (client *HealthReportClient) Get(ctx context.Context, resourceID string, healthReportName string, options *HealthReportClientGetOptions) (HealthReportClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceID, healthReportName, options) + if err != nil { + return HealthReportClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return HealthReportClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return HealthReportClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *HealthReportClient) getCreateRequest(ctx context.Context, resourceID string, healthReportName string, options *HealthReportClientGetOptions) (*policy.Request, error) { + urlPath := "/{resourceId}/providers/Microsoft.Security/healthReports/{healthReportName}" + urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID) + if healthReportName == "" { + return nil, errors.New("parameter healthReportName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{healthReportName}", url.PathEscape(healthReportName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-02-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *HealthReportClient) getHandleResponse(resp *http.Response) (HealthReportClientGetResponse, error) { + result := HealthReportClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.HealthReport); err != nil { + return HealthReportClientGetResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/healthreports_client.go b/sdk/resourcemanager/security/armsecurity/healthreports_client.go new file mode 100644 index 000000000000..12bb83ab50f2 --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/healthreports_client.go @@ -0,0 +1,99 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armsecurity + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "strings" +) + +// HealthReportsClient contains the methods for the HealthReports group. +// Don't use this type directly, use NewHealthReportsClient() instead. +type HealthReportsClient struct { + internal *arm.Client +} + +// NewHealthReportsClient creates a new instance of HealthReportsClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewHealthReportsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*HealthReportsClient, error) { + cl, err := arm.NewClient(moduleName+".HealthReportsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &HealthReportsClient{ + internal: cl, + } + return client, nil +} + +// NewListPager - Get a list of all health reports inside a scope. Valid scopes are: subscription (format: 'subscriptions/{subscriptionId}'), +// or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// +// Generated from API version 2023-02-01-preview +// - scope - The scope at which the operation is performed. +// - options - HealthReportsClientListOptions contains the optional parameters for the HealthReportsClient.NewListPager method. +func (client *HealthReportsClient) NewListPager(scope string, options *HealthReportsClientListOptions) *runtime.Pager[HealthReportsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[HealthReportsClientListResponse]{ + More: func(page HealthReportsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *HealthReportsClientListResponse) (HealthReportsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, scope, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return HealthReportsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return HealthReportsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return HealthReportsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *HealthReportsClient) listCreateRequest(ctx context.Context, scope string, options *HealthReportsClientListOptions) (*policy.Request, error) { + urlPath := "/{scope}/providers/Microsoft.Security/healthReports" + urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-02-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *HealthReportsClient) listHandleResponse(resp *http.Response) (HealthReportsClientListResponse, error) { + result := HealthReportsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.HealthReportsList); err != nil { + return HealthReportsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/informationprotectionpolicies_client_example_test.go b/sdk/resourcemanager/security/armsecurity/informationprotectionpolicies_client_example_test.go deleted file mode 100644 index bcbfa42a5fa6..000000000000 --- a/sdk/resourcemanager/security/armsecurity/informationprotectionpolicies_client_example_test.go +++ /dev/null @@ -1,512 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/GetCustomInformationProtectionPolicy_example.json -func ExampleInformationProtectionPoliciesClient_Get_getTheCustomizedInformationProtectionPolicyForAManagementGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInformationProtectionPoliciesClient().Get(ctx, "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", armsecurity.InformationProtectionPolicyNameCustom, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.InformationProtectionPolicy = armsecurity.InformationProtectionPolicy{ - // Name: to.Ptr("custom"), - // Type: to.Ptr("Microsoft.Security/informationProtectionPolicies"), - // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e/providers/Microsoft.Security/informationProtectionPolicies/custom"), - // Properties: &armsecurity.InformationProtectionPolicyProperties{ - // InformationTypes: map[string]*armsecurity.InformationType{ - // "3bf35491-99b8-41f2-86d5-c1200a7df658": &armsecurity.InformationType{ - // Custom: to.Ptr(true), - // DisplayName: to.Ptr("Custom"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(true), - // Custom: to.Ptr(true), - // Pattern: to.Ptr("%custom%"), - // }}, - // Order: to.Ptr[int32](1400), - // RecommendedLabelID: to.Ptr("7aa516c7-5a53-4857-bc6e-6808c6acd542"), - // }, - // "7fb9419d-2473-4ad8-8e11-b25cc8cf6a07": &armsecurity.InformationType{ - // Custom: to.Ptr(false), - // DisplayName: to.Ptr("Networking"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(true), - // Pattern: to.Ptr("%networking%"), - // }}, - // Order: to.Ptr[int32](100), - // RecommendedLabelID: to.Ptr("575739d2-3d53-4df0-9042-4c7772d5c7b1"), - // }, - // }, - // Labels: map[string]*armsecurity.SensitivityLabel{ - // "1345da73-bc5a-4a8f-b7dd-3820eb713da8": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("Public"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](100), - // }, - // "575739d2-3d53-4df0-9042-4c7772d5c7b1": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("Confidential"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](300), - // }, - // "7aa516c7-5a53-4857-bc6e-6808c6acd542": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("General"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](200), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/GetEffectiveInformationProtectionPolicy_example.json -func ExampleInformationProtectionPoliciesClient_Get_getTheEffectiveInformationProtectionPolicyForAManagementGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInformationProtectionPoliciesClient().Get(ctx, "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", armsecurity.InformationProtectionPolicyNameEffective, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.InformationProtectionPolicy = armsecurity.InformationProtectionPolicy{ - // Name: to.Ptr("effective"), - // Type: to.Ptr("Microsoft.Security/informationProtectionPolicies"), - // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e/providers/Microsoft.Security/informationProtectionPolicies/effective"), - // Properties: &armsecurity.InformationProtectionPolicyProperties{ - // InformationTypes: map[string]*armsecurity.InformationType{ - // "3bf35491-99b8-41f2-86d5-c1200a7df658": &armsecurity.InformationType{ - // Custom: to.Ptr(true), - // DisplayName: to.Ptr("Custom"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(true), - // Pattern: to.Ptr("%networking%"), - // }}, - // Order: to.Ptr[int32](1400), - // RecommendedLabelID: to.Ptr("7aa516c7-5a53-4857-bc6e-6808c6acd542"), - // }, - // "5856f35c-8e08-4d08-9bf7-87a146150569": &armsecurity.InformationType{ - // Custom: to.Ptr(false), - // DisplayName: to.Ptr("Contact Info"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%email%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%e-mail%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%addr%"), - // }, - // { - // CanBeNumeric: to.Ptr(true), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%street%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%city%"), - // }}, - // Order: to.Ptr[int32](200), - // RecommendedLabelID: to.Ptr("575739d2-3d53-4df0-9042-4c7772d5c7b1"), - // }, - // "7fb9419d-2473-4ad8-8e11-b25cc8cf6a07": &armsecurity.InformationType{ - // Custom: to.Ptr(false), - // DisplayName: to.Ptr("Networking"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%ip%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("ip%address%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%mac%address%"), - // }, - // { - // CanBeNumeric: to.Ptr(true), - // Custom: to.Ptr(true), - // Excluded: to.Ptr(true), - // Pattern: to.Ptr("%networking%"), - // }}, - // Order: to.Ptr[int32](100), - // RecommendedLabelID: to.Ptr("575739d2-3d53-4df0-9042-4c7772d5c7b1"), - // }, - // }, - // Labels: map[string]*armsecurity.SensitivityLabel{ - // "1345da73-bc5a-4a8f-b7dd-3820eb713da8": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("Public"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](100), - // }, - // "575739d2-3d53-4df0-9042-4c7772d5c7b1": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("Confidential"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](300), - // }, - // "7aa516c7-5a53-4857-bc6e-6808c6acd542": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("General"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](200), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/CreateOrUpdateInformationProtectionPolicy_example.json -func ExampleInformationProtectionPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInformationProtectionPoliciesClient().CreateOrUpdate(ctx, "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", armsecurity.InformationProtectionPolicyNameCustom, armsecurity.InformationProtectionPolicy{ - Properties: &armsecurity.InformationProtectionPolicyProperties{ - InformationTypes: map[string]*armsecurity.InformationType{ - "3bf35491-99b8-41f2-86d5-c1200a7df658": { - Custom: to.Ptr(true), - DisplayName: to.Ptr("Custom"), - Enabled: to.Ptr(true), - Keywords: []*armsecurity.InformationProtectionKeyword{ - { - CanBeNumeric: to.Ptr(true), - Custom: to.Ptr(true), - Pattern: to.Ptr("%custom%"), - }}, - Order: to.Ptr[int32](1400), - RecommendedLabelID: to.Ptr("7aa516c7-5a53-4857-bc6e-6808c6acd542"), - }, - "7fb9419d-2473-4ad8-8e11-b25cc8cf6a07": { - Custom: to.Ptr(false), - DisplayName: to.Ptr("Networking"), - Enabled: to.Ptr(true), - Keywords: []*armsecurity.InformationProtectionKeyword{ - { - CanBeNumeric: to.Ptr(false), - Custom: to.Ptr(true), - Pattern: to.Ptr("%networking%"), - }}, - Order: to.Ptr[int32](100), - RecommendedLabelID: to.Ptr("575739d2-3d53-4df0-9042-4c7772d5c7b1"), - }, - }, - Labels: map[string]*armsecurity.SensitivityLabel{ - "1345da73-bc5a-4a8f-b7dd-3820eb713da8": { - DisplayName: to.Ptr("Public"), - Enabled: to.Ptr(true), - Order: to.Ptr[int32](100), - }, - "575739d2-3d53-4df0-9042-4c7772d5c7b1": { - DisplayName: to.Ptr("Confidential"), - Enabled: to.Ptr(true), - Order: to.Ptr[int32](300), - }, - "7aa516c7-5a53-4857-bc6e-6808c6acd542": { - DisplayName: to.Ptr("General"), - Enabled: to.Ptr(true), - Order: to.Ptr[int32](200), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.InformationProtectionPolicy = armsecurity.InformationProtectionPolicy{ - // Name: to.Ptr("custom"), - // Type: to.Ptr("Microsoft.Security/informationProtectionPolicies"), - // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e/providers/Microsoft.Security/informationProtectionPolicies/custom"), - // Properties: &armsecurity.InformationProtectionPolicyProperties{ - // InformationTypes: map[string]*armsecurity.InformationType{ - // "3bf35491-99b8-41f2-86d5-c1200a7df658": &armsecurity.InformationType{ - // Custom: to.Ptr(true), - // DisplayName: to.Ptr("Custom"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(true), - // Custom: to.Ptr(true), - // Pattern: to.Ptr("%custom%"), - // }}, - // Order: to.Ptr[int32](1400), - // RecommendedLabelID: to.Ptr("7aa516c7-5a53-4857-bc6e-6808c6acd542"), - // }, - // "7fb9419d-2473-4ad8-8e11-b25cc8cf6a07": &armsecurity.InformationType{ - // Custom: to.Ptr(false), - // DisplayName: to.Ptr("Networking"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(true), - // Pattern: to.Ptr("%networking%"), - // }}, - // Order: to.Ptr[int32](100), - // RecommendedLabelID: to.Ptr("575739d2-3d53-4df0-9042-4c7772d5c7b1"), - // }, - // }, - // Labels: map[string]*armsecurity.SensitivityLabel{ - // "1345da73-bc5a-4a8f-b7dd-3820eb713da8": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("Public"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](100), - // }, - // "575739d2-3d53-4df0-9042-4c7772d5c7b1": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("Confidential"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](300), - // }, - // "7aa516c7-5a53-4857-bc6e-6808c6acd542": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("General"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](200), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/ListInformationProtectionPolicies_example.json -func ExampleInformationProtectionPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInformationProtectionPoliciesClient().NewListPager("providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.InformationProtectionPolicyList = armsecurity.InformationProtectionPolicyList{ - // Value: []*armsecurity.InformationProtectionPolicy{ - // { - // Name: to.Ptr("effective"), - // Type: to.Ptr("Microsoft.Security/informationProtectionPolicies"), - // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e/providers/Microsoft.Security/informationProtectionPolicies/effective"), - // Properties: &armsecurity.InformationProtectionPolicyProperties{ - // InformationTypes: map[string]*armsecurity.InformationType{ - // "3bf35491-99b8-41f2-86d5-c1200a7df658": &armsecurity.InformationType{ - // Custom: to.Ptr(true), - // DisplayName: to.Ptr("Custom"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(true), - // Pattern: to.Ptr("%networking%"), - // }}, - // Order: to.Ptr[int32](1400), - // RecommendedLabelID: to.Ptr("7aa516c7-5a53-4857-bc6e-6808c6acd542"), - // }, - // "5856f35c-8e08-4d08-9bf7-87a146150569": &armsecurity.InformationType{ - // Custom: to.Ptr(false), - // DisplayName: to.Ptr("Contact Info"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%email%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%e-mail%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%addr%"), - // }, - // { - // CanBeNumeric: to.Ptr(true), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%street%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%city%"), - // }}, - // Order: to.Ptr[int32](200), - // RecommendedLabelID: to.Ptr("575739d2-3d53-4df0-9042-4c7772d5c7b1"), - // }, - // "7fb9419d-2473-4ad8-8e11-b25cc8cf6a07": &armsecurity.InformationType{ - // Custom: to.Ptr(false), - // DisplayName: to.Ptr("Networking"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%ip%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("ip%address%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%mac%address%"), - // }, - // { - // CanBeNumeric: to.Ptr(true), - // Custom: to.Ptr(true), - // Pattern: to.Ptr("%networking%"), - // }}, - // Order: to.Ptr[int32](100), - // RecommendedLabelID: to.Ptr("575739d2-3d53-4df0-9042-4c7772d5c7b1"), - // }, - // }, - // Labels: map[string]*armsecurity.SensitivityLabel{ - // "1345da73-bc5a-4a8f-b7dd-3820eb713da8": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("Public"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](100), - // }, - // "575739d2-3d53-4df0-9042-4c7772d5c7b1": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("Confidential"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](300), - // }, - // "7aa516c7-5a53-4857-bc6e-6808c6acd542": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("General"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](200), - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("custom"), - // Type: to.Ptr("Microsoft.Security/informationProtectionPolicies"), - // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e/providers/Microsoft.Security/informationProtectionPolicies/custom"), - // Properties: &armsecurity.InformationProtectionPolicyProperties{ - // InformationTypes: map[string]*armsecurity.InformationType{ - // "3bf35491-99b8-41f2-86d5-c1200a7df658": &armsecurity.InformationType{ - // Custom: to.Ptr(true), - // DisplayName: to.Ptr("Custom"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(true), - // Custom: to.Ptr(true), - // Pattern: to.Ptr("%custom%"), - // }}, - // Order: to.Ptr[int32](1400), - // RecommendedLabelID: to.Ptr("7aa516c7-5a53-4857-bc6e-6808c6acd542"), - // }, - // "7fb9419d-2473-4ad8-8e11-b25cc8cf6a07": &armsecurity.InformationType{ - // Custom: to.Ptr(false), - // DisplayName: to.Ptr("Networking"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(true), - // Pattern: to.Ptr("%networking%"), - // }}, - // Order: to.Ptr[int32](100), - // RecommendedLabelID: to.Ptr("575739d2-3d53-4df0-9042-4c7772d5c7b1"), - // }, - // }, - // Labels: map[string]*armsecurity.SensitivityLabel{ - // "1345da73-bc5a-4a8f-b7dd-3820eb713da8": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("Public"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](100), - // }, - // "575739d2-3d53-4df0-9042-4c7772d5c7b1": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("Confidential"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](300), - // }, - // "7aa516c7-5a53-4857-bc6e-6808c6acd542": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("General"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](200), - // }, - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/ingestionsettings_client_example_test.go b/sdk/resourcemanager/security/armsecurity/ingestionsettings_client_example_test.go deleted file mode 100644 index eb6a4e4c1951..000000000000 --- a/sdk/resourcemanager/security/armsecurity/ingestionsettings_client_example_test.go +++ /dev/null @@ -1,177 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/GetIngestionSettings_example.json -func ExampleIngestionSettingsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIngestionSettingsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IngestionSettingList = armsecurity.IngestionSettingList{ - // Value: []*armsecurity.IngestionSetting{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/ingestionSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/ingestionSettings/default"), - // }, - // { - // Name: to.Ptr("default2"), - // Type: to.Ptr("Microsoft.Security/ingestionSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/ingestionSettings/default2"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/GetIngestionSetting_example.json -func ExampleIngestionSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIngestionSettingsClient().Get(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IngestionSetting = armsecurity.IngestionSetting{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/ingestionSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/ingestionSettings/default"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/CreateIngestionSetting_example.json -func ExampleIngestionSettingsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIngestionSettingsClient().Create(ctx, "default", armsecurity.IngestionSetting{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IngestionSetting = armsecurity.IngestionSetting{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/ingestionSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/ingestionSettings/default"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/DeleteIngestionSetting_example.json -func ExampleIngestionSettingsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewIngestionSettingsClient().Delete(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/ListTokensIngestionSetting_example.json -func ExampleIngestionSettingsClient_ListTokens() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIngestionSettingsClient().ListTokens(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IngestionSettingToken = armsecurity.IngestionSettingToken{ - // Token: to.Ptr(""), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/ListConnectionStrings_example.json -func ExampleIngestionSettingsClient_ListConnectionStrings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIngestionSettingsClient().ListConnectionStrings(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectionStrings = armsecurity.ConnectionStrings{ - // Value: []*armsecurity.IngestionConnectionString{ - // { - // Location: to.Ptr("CUS"), - // Value: to.Ptr(""), - // }, - // { - // Location: to.Ptr("WEU"), - // Value: to.Ptr(""), - // }}, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/iotsecuritysolution_client_example_test.go b/sdk/resourcemanager/security/armsecurity/iotsecuritysolution_client_example_test.go deleted file mode 100644 index 399317edfe6c..000000000000 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolution_client_example_test.go +++ /dev/null @@ -1,1192 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsListByIotHub.json -func ExampleIotSecuritySolutionClient_NewListBySubscriptionPager_listIoTSecuritySolutionsByIoTHub() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIotSecuritySolutionClient().NewListBySubscriptionPager(&armsecurity.IotSecuritySolutionClientListBySubscriptionOptions{Filter: to.Ptr("properties.iotHubs/any(i eq \"/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub\")")}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IoTSecuritySolutionsList = armsecurity.IoTSecuritySolutionsList{ - // Value: []*armsecurity.IoTSecuritySolutionModel{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/IoTSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East Us"), - // Properties: &armsecurity.IoTSecuritySolutionProperties{ - // AutoDiscoveredResources: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735"), - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // DisabledDataSources: []*armsecurity.DataSource{ - // }, - // DisplayName: to.Ptr("Solution Default"), - // Export: []*armsecurity.ExportData{ - // to.Ptr(armsecurity.ExportDataRawEvents)}, - // IotHubs: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - // { - // Name: to.Ptr("Service Principal Not Used with ACR"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAcrauthentication), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Agent sending underutilized messages"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAgentSendsUnutilizedMessages), - // Status: to.Ptr(armsecurity.RecommendationConfigStatus("TurnedOn")), - // }, - // { - // Name: to.Ptr("Operating system (OS) baseline validation failure"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTBaseline), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Edge Hub memory can be optimized"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeHubMemOptimize), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("No Logging Configured for Edge Module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeLoggingOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Module Settings Inconsistent in SecurityGroup"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInconsistentModuleSettings), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Install the Azure Security of Things Agent"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInstallAgent), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Default IP Filter Policy should be Deny"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterDenyAll), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("IP Filter rule includes large IP range"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterPermissiveRule), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Open Ports On Device"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveFirewallPolicy), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the input chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveInputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the output chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveOutputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPrivilegedDockerOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Same Authentication Credentials used by multiple devices"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("TLS cipher suite upgrade"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTVulnerableTLSCipherSuite), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }}, - // Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - // UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - // UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - // Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - // QuerySubscriptions: []*string{ - // to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - // }, - // Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsList.json -func ExampleIotSecuritySolutionClient_NewListBySubscriptionPager_listIoTSecuritySolutionsBySubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIotSecuritySolutionClient().NewListBySubscriptionPager(&armsecurity.IotSecuritySolutionClientListBySubscriptionOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IoTSecuritySolutionsList = armsecurity.IoTSecuritySolutionsList{ - // Value: []*armsecurity.IoTSecuritySolutionModel{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/IoTSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East Us"), - // Properties: &armsecurity.IoTSecuritySolutionProperties{ - // AutoDiscoveredResources: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735"), - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // DisabledDataSources: []*armsecurity.DataSource{ - // }, - // DisplayName: to.Ptr("Solution Default"), - // Export: []*armsecurity.ExportData{ - // }, - // IotHubs: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - // { - // Name: to.Ptr("Service Principal Not Used with ACR"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAcrauthentication), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Agent sending underutilized messages"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAgentSendsUnutilizedMessages), - // Status: to.Ptr(armsecurity.RecommendationConfigStatus("TurnedOn")), - // }, - // { - // Name: to.Ptr("Operating system (OS) baseline validation failure"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTBaseline), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Edge Hub memory can be optimized"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeHubMemOptimize), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("No Logging Configured for Edge Module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeLoggingOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Module Settings Inconsistent in SecurityGroup"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInconsistentModuleSettings), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Install the Azure Security of Things Agent"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInstallAgent), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Default IP Filter Policy should be Deny"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterDenyAll), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("IP Filter rule includes large IP range"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterPermissiveRule), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Open Ports On Device"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveFirewallPolicy), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the input chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveInputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the output chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveOutputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPrivilegedDockerOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Same Authentication Credentials used by multiple devices"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("TLS cipher suite upgrade"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTVulnerableTLSCipherSuite), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }}, - // Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - // UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - // UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - // Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - // QuerySubscriptions: []*string{ - // to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - // }, - // Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("sec-solution"), - // Type: to.Ptr("Microsoft.Security/IoTSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SecondGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/sec-solution"), - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East Us"), - // Properties: &armsecurity.IoTSecuritySolutionProperties{ - // AutoDiscoveredResources: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735"), - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/IotHubSecond")}, - // DisabledDataSources: []*armsecurity.DataSource{ - // }, - // DisplayName: to.Ptr("Second Solution"), - // Export: []*armsecurity.ExportData{ - // to.Ptr(armsecurity.ExportDataRawEvents)}, - // IotHubs: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/IotHubSecond")}, - // RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - // { - // Name: to.Ptr("Service Principal Not Used with ACR"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAcrauthentication), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Agent sending underutilized messages"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAgentSendsUnutilizedMessages), - // Status: to.Ptr(armsecurity.RecommendationConfigStatus("TurnedOn")), - // }, - // { - // Name: to.Ptr("Operating system (OS) baseline validation failure"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTBaseline), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Edge Hub memory can be optimized"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeHubMemOptimize), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("No Logging Configured for Edge Module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeLoggingOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Module Settings Inconsistent in SecurityGroup"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInconsistentModuleSettings), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Install the Azure Security of Things Agent"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInstallAgent), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Default IP Filter Policy should be Deny"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterDenyAll), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("IP Filter rule includes large IP range"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterPermissiveRule), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Open Ports On Device"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveFirewallPolicy), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the input chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveInputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the output chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveOutputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPrivilegedDockerOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Same Authentication Credentials used by multiple devices"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("TLS cipher suite upgrade"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTVulnerableTLSCipherSuite), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }}, - // Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - // UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - // UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - // Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - // QuerySubscriptions: []*string{ - // to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - // }, - // Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsListByRg.json -func ExampleIotSecuritySolutionClient_NewListByResourceGroupPager_listIoTSecuritySolutionsByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIotSecuritySolutionClient().NewListByResourceGroupPager("MyGroup", &armsecurity.IotSecuritySolutionClientListByResourceGroupOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IoTSecuritySolutionsList = armsecurity.IoTSecuritySolutionsList{ - // Value: []*armsecurity.IoTSecuritySolutionModel{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/IoTSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East Us"), - // Properties: &armsecurity.IoTSecuritySolutionProperties{ - // AutoDiscoveredResources: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735"), - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // DisabledDataSources: []*armsecurity.DataSource{ - // }, - // DisplayName: to.Ptr("Solution Default"), - // Export: []*armsecurity.ExportData{ - // }, - // IotHubs: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - // { - // Name: to.Ptr("Service Principal Not Used with ACR"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAcrauthentication), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Agent sending underutilized messages"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAgentSendsUnutilizedMessages), - // Status: to.Ptr(armsecurity.RecommendationConfigStatus("TurnedOn")), - // }, - // { - // Name: to.Ptr("Operating system (OS) baseline validation failure"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTBaseline), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Edge Hub memory can be optimized"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeHubMemOptimize), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("No Logging Configured for Edge Module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeLoggingOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Module Settings Inconsistent in SecurityGroup"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInconsistentModuleSettings), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Install the Azure Security of Things Agent"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInstallAgent), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Default IP Filter Policy should be Deny"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterDenyAll), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("IP Filter rule includes large IP range"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterPermissiveRule), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Open Ports On Device"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveFirewallPolicy), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the input chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveInputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the output chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveOutputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPrivilegedDockerOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Same Authentication Credentials used by multiple devices"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("TLS cipher suite upgrade"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTVulnerableTLSCipherSuite), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }}, - // Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - // UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - // UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - // Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - // QuerySubscriptions: []*string{ - // to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - // }, - // Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsListByIotHubAndRg.json -func ExampleIotSecuritySolutionClient_NewListByResourceGroupPager_listIoTSecuritySolutionsByResourceGroupAndIoTHub() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIotSecuritySolutionClient().NewListByResourceGroupPager("MyRg", &armsecurity.IotSecuritySolutionClientListByResourceGroupOptions{Filter: to.Ptr("properties.iotHubs/any(i eq \"/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub\")")}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IoTSecuritySolutionsList = armsecurity.IoTSecuritySolutionsList{ - // Value: []*armsecurity.IoTSecuritySolutionModel{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/IoTSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyRg/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East Us"), - // Properties: &armsecurity.IoTSecuritySolutionProperties{ - // AutoDiscoveredResources: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735"), - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // DisabledDataSources: []*armsecurity.DataSource{ - // }, - // DisplayName: to.Ptr("Solution Default"), - // Export: []*armsecurity.ExportData{ - // to.Ptr(armsecurity.ExportDataRawEvents)}, - // IotHubs: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - // { - // Name: to.Ptr("Service Principal Not Used with ACR"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAcrauthentication), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Agent sending underutilized messages"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAgentSendsUnutilizedMessages), - // Status: to.Ptr(armsecurity.RecommendationConfigStatus("TurnedOn")), - // }, - // { - // Name: to.Ptr("Operating system (OS) baseline validation failure"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTBaseline), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Edge Hub memory can be optimized"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeHubMemOptimize), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("No Logging Configured for Edge Module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeLoggingOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Module Settings Inconsistent in SecurityGroup"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInconsistentModuleSettings), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Install the Azure Security of Things Agent"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInstallAgent), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Default IP Filter Policy should be Deny"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterDenyAll), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("IP Filter rule includes large IP range"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterPermissiveRule), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Open Ports On Device"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveFirewallPolicy), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the input chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveInputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the output chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveOutputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPrivilegedDockerOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Same Authentication Credentials used by multiple devices"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("TLS cipher suite upgrade"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTVulnerableTLSCipherSuite), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }}, - // Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - // UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - // UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - // Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - // QuerySubscriptions: []*string{ - // to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - // }, - // Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolution.json -func ExampleIotSecuritySolutionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIotSecuritySolutionClient().Get(ctx, "MyGroup", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IoTSecuritySolutionModel = armsecurity.IoTSecuritySolutionModel{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/IoTSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East Us"), - // Properties: &armsecurity.IoTSecuritySolutionProperties{ - // AutoDiscoveredResources: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735"), - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // DisabledDataSources: []*armsecurity.DataSource{ - // }, - // DisplayName: to.Ptr("Solution Default"), - // Export: []*armsecurity.ExportData{ - // }, - // IotHubs: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - // { - // Name: to.Ptr("Service Principal Not Used with ACR"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAcrauthentication), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Agent sending underutilized messages"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAgentSendsUnutilizedMessages), - // Status: to.Ptr(armsecurity.RecommendationConfigStatus("TurnedOn")), - // }, - // { - // Name: to.Ptr("Operating system (OS) baseline validation failure"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTBaseline), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Edge Hub memory can be optimized"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeHubMemOptimize), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("No Logging Configured for Edge Module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeLoggingOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Module Settings Inconsistent in SecurityGroup"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInconsistentModuleSettings), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Install the Azure Security of Things Agent"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInstallAgent), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Default IP Filter Policy should be Deny"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterDenyAll), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("IP Filter rule includes large IP range"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterPermissiveRule), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Open Ports On Device"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveFirewallPolicy), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the input chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveInputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the output chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveOutputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPrivilegedDockerOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Same Authentication Credentials used by multiple devices"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("TLS cipher suite upgrade"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTVulnerableTLSCipherSuite), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }}, - // Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - // UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - // UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - // Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - // QuerySubscriptions: []*string{ - // to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - // }, - // Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/CreateIoTSecuritySolution.json -func ExampleIotSecuritySolutionClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIotSecuritySolutionClient().CreateOrUpdate(ctx, "MyGroup", "default", armsecurity.IoTSecuritySolutionModel{ - Tags: map[string]*string{}, - Location: to.Ptr("East Us"), - Properties: &armsecurity.IoTSecuritySolutionProperties{ - DisabledDataSources: []*armsecurity.DataSource{}, - DisplayName: to.Ptr("Solution Default"), - Export: []*armsecurity.ExportData{}, - IotHubs: []*string{ - to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - { - RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - }, - { - RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - }}, - Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - QuerySubscriptions: []*string{ - to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - }, - Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IoTSecuritySolutionModel = armsecurity.IoTSecuritySolutionModel{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/IoTSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/Locations/eastus/IoTSecuritySolutions/default"), - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East Us"), - // Properties: &armsecurity.IoTSecuritySolutionProperties{ - // AutoDiscoveredResources: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735"), - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // DisabledDataSources: []*armsecurity.DataSource{ - // }, - // DisplayName: to.Ptr("Solution Default"), - // Export: []*armsecurity.ExportData{ - // }, - // IotHubs: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - // { - // Name: to.Ptr("Service Principal Not Used with ACR"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAcrauthentication), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Agent sending underutilized messages"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAgentSendsUnutilizedMessages), - // Status: to.Ptr(armsecurity.RecommendationConfigStatus("TurnedOn")), - // }, - // { - // Name: to.Ptr("Operating system (OS) baseline validation failure"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTBaseline), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Edge Hub memory can be optimized"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeHubMemOptimize), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("No Logging Configured for Edge Module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeLoggingOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Module Settings Inconsistent in SecurityGroup"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInconsistentModuleSettings), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Install the Azure Security of Things Agent"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInstallAgent), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Default IP Filter Policy should be Deny"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterDenyAll), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("IP Filter rule includes large IP range"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterPermissiveRule), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Open Ports On Device"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveFirewallPolicy), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the input chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveInputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the output chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveOutputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPrivilegedDockerOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Same Authentication Credentials used by multiple devices"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("TLS cipher suite upgrade"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTVulnerableTLSCipherSuite), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }}, - // Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - // UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - // UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - // Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - // QuerySubscriptions: []*string{ - // to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - // }, - // Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/UpdateIoTSecuritySolution.json -func ExampleIotSecuritySolutionClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIotSecuritySolutionClient().Update(ctx, "myRg", "default", armsecurity.UpdateIotSecuritySolutionData{ - Tags: map[string]*string{ - "foo": to.Ptr("bar"), - }, - Properties: &armsecurity.UpdateIoTSecuritySolutionProperties{ - RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - { - RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - }, - { - RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - }}, - UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"v2\""), - QuerySubscriptions: []*string{ - to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IoTSecuritySolutionModel = armsecurity.IoTSecuritySolutionModel{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/IoTSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/Locations/eastus/IoTSecuritySolutions/default"), - // Tags: map[string]*string{ - // "foo": to.Ptr("bar"), - // }, - // Location: to.Ptr("East Us"), - // Properties: &armsecurity.IoTSecuritySolutionProperties{ - // AutoDiscoveredResources: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735"), - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // DisabledDataSources: []*armsecurity.DataSource{ - // }, - // DisplayName: to.Ptr("Solution Default"), - // Export: []*armsecurity.ExportData{ - // to.Ptr(armsecurity.ExportDataRawEvents)}, - // IotHubs: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - // { - // Name: to.Ptr("Service Principal Not Used with ACR"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAcrauthentication), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Agent sending underutilized messages"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAgentSendsUnutilizedMessages), - // Status: to.Ptr(armsecurity.RecommendationConfigStatus("TurnedOn")), - // }, - // { - // Name: to.Ptr("Operating system (OS) baseline validation failure"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTBaseline), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Edge Hub memory can be optimized"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeHubMemOptimize), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("No Logging Configured for Edge Module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeLoggingOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Module Settings Inconsistent in SecurityGroup"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInconsistentModuleSettings), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Install the Azure Security of Things Agent"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInstallAgent), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Default IP Filter Policy should be Deny"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterDenyAll), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("IP Filter rule includes large IP range"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterPermissiveRule), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Open Ports On Device"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveFirewallPolicy), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the input chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveInputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the output chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveOutputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPrivilegedDockerOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Same Authentication Credentials used by multiple devices"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("TLS cipher suite upgrade"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTVulnerableTLSCipherSuite), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }}, - // Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - // UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - // UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - // Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"v2\""), - // QuerySubscriptions: []*string{ - // to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - // }, - // Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/DeleteIoTSecuritySolution.json -func ExampleIotSecuritySolutionClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewIotSecuritySolutionClient().Delete(ctx, "MyGroup", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionanalytics_client_example_test.go b/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionanalytics_client_example_test.go deleted file mode 100644 index 68d3394dfb6d..000000000000 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionanalytics_client_example_test.go +++ /dev/null @@ -1,211 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAnalyticsList.json -func ExampleIotSecuritySolutionAnalyticsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIotSecuritySolutionAnalyticsClient().List(ctx, "MyGroup", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IoTSecuritySolutionAnalyticsModelList = armsecurity.IoTSecuritySolutionAnalyticsModelList{ - // Value: []*armsecurity.IoTSecuritySolutionAnalyticsModel{ - // { - // Name: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Type: to.Ptr("Microsoft.Security/iotSecuritySolutions/analyticsModels"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Properties: &armsecurity.IoTSecuritySolutionAnalyticsModelProperties{ - // DevicesMetrics: []*armsecurity.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem{ - // { - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-02-01T00:00:00Z"); return t}()), - // DevicesMetrics: &armsecurity.IoTSeverityMetrics{ - // High: to.Ptr[int64](3), - // Low: to.Ptr[int64](70), - // Medium: to.Ptr[int64](15), - // }, - // }, - // { - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-02-02T00:00:00Z"); return t}()), - // DevicesMetrics: &armsecurity.IoTSeverityMetrics{ - // High: to.Ptr[int64](3), - // Low: to.Ptr[int64](65), - // Medium: to.Ptr[int64](45), - // }, - // }}, - // Metrics: &armsecurity.IoTSeverityMetrics{ - // High: to.Ptr[int64](5), - // Low: to.Ptr[int64](102), - // Medium: to.Ptr[int64](200), - // }, - // MostPrevalentDeviceAlerts: []*armsecurity.IoTSecurityDeviceAlert{ - // { - // AlertDisplayName: to.Ptr("Custom Alert - number of device to cloud messages in AMQP protocol is not in the allowed range"), - // AlertsCount: to.Ptr[int64](200), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // }, - // { - // AlertDisplayName: to.Ptr("Custom Alert - execution of a process that is not allowed"), - // AlertsCount: to.Ptr[int64](170), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityMedium), - // }, - // { - // AlertDisplayName: to.Ptr("Successful Bruteforce"), - // AlertsCount: to.Ptr[int64](150), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // }}, - // MostPrevalentDeviceRecommendations: []*armsecurity.IoTSecurityDeviceRecommendation{ - // { - // DevicesCount: to.Ptr[int64](200), - // RecommendationDisplayName: to.Ptr("Install the Azure Security of Things Agent"), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // }, - // { - // DevicesCount: to.Ptr[int64](170), - // RecommendationDisplayName: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // }, - // { - // DevicesCount: to.Ptr[int64](150), - // RecommendationDisplayName: to.Ptr("Same Authentication Credentials used by multiple devices"), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityMedium), - // }}, - // TopAlertedDevices: []*armsecurity.IoTSecurityAlertedDevice{ - // { - // AlertsCount: to.Ptr[int64](200), - // DeviceID: to.Ptr("id1"), - // }, - // { - // AlertsCount: to.Ptr[int64](170), - // DeviceID: to.Ptr("id2"), - // }, - // { - // AlertsCount: to.Ptr[int64](150), - // DeviceID: to.Ptr("id3"), - // }}, - // UnhealthyDeviceCount: to.Ptr[int64](1200), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAnalytics.json -func ExampleIotSecuritySolutionAnalyticsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIotSecuritySolutionAnalyticsClient().Get(ctx, "MyGroup", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IoTSecuritySolutionAnalyticsModel = armsecurity.IoTSecuritySolutionAnalyticsModel{ - // Name: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Type: to.Ptr("Microsoft.Security/iotSecuritySolutions/analyticsModels"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Properties: &armsecurity.IoTSecuritySolutionAnalyticsModelProperties{ - // DevicesMetrics: []*armsecurity.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem{ - // { - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-02-01T00:00:00Z"); return t}()), - // DevicesMetrics: &armsecurity.IoTSeverityMetrics{ - // High: to.Ptr[int64](3), - // Low: to.Ptr[int64](70), - // Medium: to.Ptr[int64](15), - // }, - // }, - // { - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-02-02T00:00:00Z"); return t}()), - // DevicesMetrics: &armsecurity.IoTSeverityMetrics{ - // High: to.Ptr[int64](3), - // Low: to.Ptr[int64](65), - // Medium: to.Ptr[int64](45), - // }, - // }}, - // Metrics: &armsecurity.IoTSeverityMetrics{ - // High: to.Ptr[int64](5), - // Low: to.Ptr[int64](102), - // Medium: to.Ptr[int64](200), - // }, - // MostPrevalentDeviceAlerts: []*armsecurity.IoTSecurityDeviceAlert{ - // { - // AlertDisplayName: to.Ptr("Custom Alert - number of device to cloud messages in AMQP protocol is not in the allowed range"), - // AlertsCount: to.Ptr[int64](200), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // }, - // { - // AlertDisplayName: to.Ptr("Custom Alert - execution of a process that is not allowed"), - // AlertsCount: to.Ptr[int64](170), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityMedium), - // }, - // { - // AlertDisplayName: to.Ptr("Successful Bruteforce"), - // AlertsCount: to.Ptr[int64](150), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // }}, - // MostPrevalentDeviceRecommendations: []*armsecurity.IoTSecurityDeviceRecommendation{ - // { - // DevicesCount: to.Ptr[int64](200), - // RecommendationDisplayName: to.Ptr("Install the Azure Security of Things Agent"), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // }, - // { - // DevicesCount: to.Ptr[int64](170), - // RecommendationDisplayName: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // }, - // { - // DevicesCount: to.Ptr[int64](150), - // RecommendationDisplayName: to.Ptr("Same Authentication Credentials used by multiple devices"), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityMedium), - // }}, - // TopAlertedDevices: []*armsecurity.IoTSecurityAlertedDevice{ - // { - // AlertsCount: to.Ptr[int64](200), - // DeviceID: to.Ptr("id1"), - // }, - // { - // AlertsCount: to.Ptr[int64](170), - // DeviceID: to.Ptr("id2"), - // }, - // { - // AlertsCount: to.Ptr[int64](150), - // DeviceID: to.Ptr("id3"), - // }}, - // UnhealthyDeviceCount: to.Ptr[int64](1200), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsaggregatedalert_client_example_test.go b/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsaggregatedalert_client_example_test.go deleted file mode 100644 index c9835488e5de..000000000000 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsaggregatedalert_client_example_test.go +++ /dev/null @@ -1,173 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAggregatedAlertList.json -func ExampleIotSecuritySolutionsAnalyticsAggregatedAlertClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIotSecuritySolutionsAnalyticsAggregatedAlertClient().NewListPager("MyGroup", "default", &armsecurity.IotSecuritySolutionsAnalyticsAggregatedAlertClientListOptions{Top: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IoTSecurityAggregatedAlertList = armsecurity.IoTSecurityAggregatedAlertList{ - // Value: []*armsecurity.IoTSecurityAggregatedAlert{ - // { - // Name: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/IoT_Bruteforce_Fail/2019-02-02"), - // Type: to.Ptr("Microsoft.Security/iotSecuritySolutions/analyticsModels/aggregatedAlerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/IoT_Bruteforce_Fail/2019-02-02"), - // Properties: &armsecurity.IoTSecurityAggregatedAlertProperties{ - // Description: to.Ptr("Multiple unsuccsseful login attempts identified. A Bruteforce attack on the device failed."), - // ActionTaken: to.Ptr("Detected"), - // AggregatedDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2019-02-02"); return t}()), - // AlertDisplayName: to.Ptr("Failed Bruteforce"), - // AlertType: to.Ptr("IoT_Bruteforce_Fail"), - // Count: to.Ptr[int64](50), - // EffectedResourceType: to.Ptr("IoT Device"), - // LogAnalyticsQuery: to.Ptr("SecurityAlert | where tolower(ResourceId) == tolower('/subscriptions/b77ec8a9-04ed-48d2-a87a-e5887b978ba6/resourceGroups/IoT-Solution-DemoEnv/providers/Microsoft.Devices/IotHubs/rtogm-hub') and tolower(AlertName) == tolower('Custom Alert - number of device to cloud messages in MQTT protocol is not in the allowed range') | extend DeviceId=parse_json(ExtendedProperties)['DeviceId'] | project DeviceId, TimeGenerated, DisplayName, AlertSeverity, Description, RemediationSteps, ExtendedProperties"), - // RemediationSteps: to.Ptr(""), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // SystemSource: to.Ptr("Devices"), - // TopDevicesList: []*armsecurity.IoTSecurityAggregatedAlertPropertiesTopDevicesListItem{ - // { - // AlertsCount: to.Ptr[int64](45), - // DeviceID: to.Ptr("testDevice1"), - // LastOccurrence: to.Ptr("10:42"), - // }, - // { - // AlertsCount: to.Ptr[int64](30), - // DeviceID: to.Ptr("testDevice2"), - // LastOccurrence: to.Ptr("15:42"), - // }}, - // VendorName: to.Ptr("Microsoft"), - // }, - // }, - // { - // Name: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/IoT_Bruteforce_Success/2019-02-02"), - // Type: to.Ptr("Microsoft.Security/iotSecuritySolutions/analyticsModels/aggregatedAlerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/IoT_Bruteforce_Success/2019-02-02"), - // Properties: &armsecurity.IoTSecurityAggregatedAlertProperties{ - // Description: to.Ptr("Multiple unsuccsseful login attempts identified followed by a succssful login. A Bruteforce attack on the device was Successfule"), - // ActionTaken: to.Ptr("Detected"), - // AggregatedDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2019-02-02"); return t}()), - // AlertDisplayName: to.Ptr("Successful Bruteforce"), - // AlertType: to.Ptr("IoT_Bruteforce_Success"), - // Count: to.Ptr[int64](600000), - // EffectedResourceType: to.Ptr("IoT Device"), - // LogAnalyticsQuery: to.Ptr("SecurityAlert | where tolower(ResourceId) == tolower('/subscriptions/b77ec8a9-04ed-48d2-a87a-e5887b978ba6/resourceGroups/IoT-Solution-DemoEnv/providers/Microsoft.Devices/IotHubs/rtogm-hub') and tolower(AlertName) == tolower('Custom Alert - number of device to cloud messages in MQTT protocol is not in the allowed range') | extend DeviceId=parse_json(ExtendedProperties)['DeviceId'] | project DeviceId, TimeGenerated, DisplayName, AlertSeverity, Description, RemediationSteps, ExtendedProperties"), - // RemediationSteps: to.Ptr(""), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // SystemSource: to.Ptr("Devices"), - // TopDevicesList: []*armsecurity.IoTSecurityAggregatedAlertPropertiesTopDevicesListItem{ - // { - // AlertsCount: to.Ptr[int64](12321), - // DeviceID: to.Ptr("testDevice1"), - // LastOccurrence: to.Ptr("10:42"), - // }, - // { - // AlertsCount: to.Ptr[int64](455), - // DeviceID: to.Ptr("testDevice2"), - // LastOccurrence: to.Ptr("15:42"), - // }}, - // VendorName: to.Ptr("Microsoft"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAggregatedAlert.json -func ExampleIotSecuritySolutionsAnalyticsAggregatedAlertClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIotSecuritySolutionsAnalyticsAggregatedAlertClient().Get(ctx, "MyGroup", "default", "IoT_Bruteforce_Fail/2019-02-02", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IoTSecurityAggregatedAlert = armsecurity.IoTSecurityAggregatedAlert{ - // Name: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/IoT_Bruteforce_Fail/2019-02-02"), - // Type: to.Ptr("Microsoft.Security/iotSecuritySolutions/analyticsModels/aggregatedAlerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/IoT_Bruteforce_Fail/2019-02-02"), - // Properties: &armsecurity.IoTSecurityAggregatedAlertProperties{ - // Description: to.Ptr("Multiple unsuccsseful login attempts identified. A Bruteforce attack on the device failed."), - // ActionTaken: to.Ptr("Detected"), - // AggregatedDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2019-02-02"); return t}()), - // AlertDisplayName: to.Ptr("Failed Bruteforce"), - // AlertType: to.Ptr("IoT_Bruteforce_Fail"), - // Count: to.Ptr[int64](50), - // EffectedResourceType: to.Ptr("IoT Device"), - // LogAnalyticsQuery: to.Ptr("SecurityAlert | where tolower(ResourceId) == tolower('/subscriptions/b77ec8a9-04ed-48d2-a87a-e5887b978ba6/resourceGroups/IoT-Solution-DemoEnv/providers/Microsoft.Devices/IotHubs/rtogm-hub') and tolower(AlertName) == tolower('Custom Alert - number of device to cloud messages in MQTT protocol is not in the allowed range') | extend DeviceId=parse_json(ExtendedProperties)['DeviceId'] | project DeviceId, TimeGenerated, DisplayName, AlertSeverity, Description, RemediationSteps, ExtendedProperties"), - // RemediationSteps: to.Ptr(""), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // SystemSource: to.Ptr("Devices"), - // TopDevicesList: []*armsecurity.IoTSecurityAggregatedAlertPropertiesTopDevicesListItem{ - // { - // AlertsCount: to.Ptr[int64](100), - // DeviceID: to.Ptr("testDevice1"), - // LastOccurrence: to.Ptr("10:42"), - // }, - // { - // AlertsCount: to.Ptr[int64](80), - // DeviceID: to.Ptr("testDevice2"), - // LastOccurrence: to.Ptr("15:42"), - // }}, - // VendorName: to.Ptr("Microsoft"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/PostIoTSecuritySolutionsSecurityAggregatedAlertDismiss.json -func ExampleIotSecuritySolutionsAnalyticsAggregatedAlertClient_Dismiss() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewIotSecuritySolutionsAnalyticsAggregatedAlertClient().Dismiss(ctx, "IoTEdgeResources", "default", "IoT_Bruteforce_Fail/2019-02-02/dismiss", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsrecommendation_client_example_test.go b/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsrecommendation_client_example_test.go deleted file mode 100644 index 065beaadedd6..000000000000 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsrecommendation_client_example_test.go +++ /dev/null @@ -1,117 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityRecommendation.json -func ExampleIotSecuritySolutionsAnalyticsRecommendationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIotSecuritySolutionsAnalyticsRecommendationClient().Get(ctx, "IoTEdgeResources", "default", "OpenPortsOnDevice", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IoTSecurityAggregatedRecommendation = armsecurity.IoTSecurityAggregatedRecommendation{ - // Name: to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/OpenPortsOnDevice"), - // Type: to.Ptr("Microsoft.Security/iotSecuritySolutions/analyticsModels/aggregatedRecommendations"), - // ID: to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/OpenPortsOnDevice"), - // Properties: &armsecurity.IoTSecurityAggregatedRecommendationProperties{ - // Description: to.Ptr("An allowed firewall policy was found in main firewall Chains (INPUT/OUTPUT). The policy should Deny all traffic by default define rules to allow necessary communication to/from the device"), - // DetectedBy: to.Ptr("Microsoft"), - // HealthyDevices: to.Ptr[int64](10000), - // LogAnalyticsQuery: to.Ptr("SecurityRecommendation | where tolower(AssessedResourceId) == tolower('/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Devices/IotHubs/t-ofdadu-hub') and tolower(RecommendationName) == tolower('OpenPortsOnDevice')"), - // RecommendationDisplayName: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationName: to.Ptr("OpenPortsOnDevice"), - // RecommendationTypeID: to.Ptr("{20ff7fc3-e762-44dd-bd96-b71116dcdc23}"), - // RemediationSteps: to.Ptr(""), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // UnhealthyDeviceCount: to.Ptr[int64](200), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityRecommendationList.json -func ExampleIotSecuritySolutionsAnalyticsRecommendationClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIotSecuritySolutionsAnalyticsRecommendationClient().NewListPager("IoTEdgeResources", "default", &armsecurity.IotSecuritySolutionsAnalyticsRecommendationClientListOptions{Top: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IoTSecurityAggregatedRecommendationList = armsecurity.IoTSecurityAggregatedRecommendationList{ - // Value: []*armsecurity.IoTSecurityAggregatedRecommendation{ - // { - // Name: to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/OpenPortsOnDevice"), - // Type: to.Ptr("Microsoft.Security/iotSecuritySolutions/analyticsModels/aggregatedRecommendations"), - // ID: to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/OpenPortsOnDevice"), - // Properties: &armsecurity.IoTSecurityAggregatedRecommendationProperties{ - // Description: to.Ptr("An allowed firewall policy was found in main firewall Chains (INPUT/OUTPUT). The policy should Deny all traffic by default define rules to allow necessary communication to/from the device"), - // DetectedBy: to.Ptr("Microsoft"), - // HealthyDevices: to.Ptr[int64](10000), - // LogAnalyticsQuery: to.Ptr("SecurityRecommendation | where tolower(AssessedResourceId) == tolower('/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Devices/IotHubs/t-ofdadu-hub') and tolower(RecommendationName) == tolower('OpenPortsOnDevice')"), - // RecommendationDisplayName: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationName: to.Ptr("OpenPortsOnDevice"), - // RecommendationTypeID: to.Ptr("{20ff7fc3-e762-44dd-bd96-b71116dcdc23}"), - // RemediationSteps: to.Ptr(""), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // UnhealthyDeviceCount: to.Ptr[int64](200), - // }, - // }, - // { - // Name: to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/IoT_InstallAgent"), - // Type: to.Ptr("Microsoft.Security/iotSecuritySolutions/analyticsModels/aggregatedRecommendations"), - // ID: to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/TooLargeIPRange"), - // Properties: &armsecurity.IoTSecurityAggregatedRecommendationProperties{ - // Description: to.Ptr("An allow IP filter rule source IP range is too large. Overly permissive rules can expose your IoT hub to malicious actors."), - // DetectedBy: to.Ptr("Microsoft"), - // HealthyDevices: to.Ptr[int64](130000), - // LogAnalyticsQuery: to.Ptr("SecurityRecommendation | where tolower(AssessedResourceId) == tolower('/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Devices/IotHubs/t-ofdadu-hub') and tolower(RecommendationName) == tolower('TooLargeIPRange')"), - // RecommendationDisplayName: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationName: to.Ptr("TooLargeIPRange"), - // RecommendationTypeID: to.Ptr("{20ff7fc3-e762-44dd-bd96-b71116dcdc23}"), - // RemediationSteps: to.Ptr(""), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityHigh), - // UnhealthyDeviceCount: to.Ptr[int64](1), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/jitnetworkaccesspolicies_client_example_test.go b/sdk/resourcemanager/security/armsecurity/jitnetworkaccesspolicies_client_example_test.go deleted file mode 100644 index 95378deb081a..000000000000 --- a/sdk/resourcemanager/security/armsecurity/jitnetworkaccesspolicies_client_example_test.go +++ /dev/null @@ -1,530 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesSubscription_example.json -func ExampleJitNetworkAccessPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJitNetworkAccessPoliciesClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JitNetworkAccessPoliciesList = armsecurity.JitNetworkAccessPoliciesList{ - // Value: []*armsecurity.JitNetworkAccessPolicy{ - // { - // Kind: to.Ptr("Basic"), - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/locations/jitNetworkAccessPolicies"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/default"), - // Properties: &armsecurity.JitNetworkAccessPolicyProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // Requests: []*armsecurity.JitNetworkAccessRequest{ - // { - // Justification: to.Ptr("testing a new version of the product"), - // Requestor: to.Ptr("barbara@contoso.com"), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T08:06:45.5691611Z"); return t}()), - // VirtualMachines: []*armsecurity.JitNetworkAccessRequestVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessRequestPort{ - // { - // AllowedSourceAddressPrefix: to.Ptr("192.127.0.2"), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T09:06:45.5691611Z"); return t}()), - // Number: to.Ptr[int32](3389), - // Status: to.Ptr(armsecurity.StatusInitiated), - // StatusReason: to.Ptr(armsecurity.StatusReasonUserRequested), - // }}, - // }}, - // }}, - // VirtualMachines: []*armsecurity.JitNetworkAccessPolicyVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessPortRule{ - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](22), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }, - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](3389), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }}, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesSubscriptionLocation_example.json -func ExampleJitNetworkAccessPoliciesClient_NewListByRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJitNetworkAccessPoliciesClient().NewListByRegionPager("westeurope", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JitNetworkAccessPoliciesList = armsecurity.JitNetworkAccessPoliciesList{ - // Value: []*armsecurity.JitNetworkAccessPolicy{ - // { - // Kind: to.Ptr("Basic"), - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/locations/jitNetworkAccessPolicies"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/default"), - // Properties: &armsecurity.JitNetworkAccessPolicyProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // Requests: []*armsecurity.JitNetworkAccessRequest{ - // { - // Justification: to.Ptr("testing a new version of the product"), - // Requestor: to.Ptr("barbara@contoso.com"), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T08:06:45.5691611Z"); return t}()), - // VirtualMachines: []*armsecurity.JitNetworkAccessRequestVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessRequestPort{ - // { - // AllowedSourceAddressPrefix: to.Ptr("192.127.0.2"), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T09:06:45.5691611Z"); return t}()), - // Number: to.Ptr[int32](3389), - // Status: to.Ptr(armsecurity.StatusInitiated), - // StatusReason: to.Ptr(armsecurity.StatusReasonUserRequested), - // }}, - // }}, - // }}, - // VirtualMachines: []*armsecurity.JitNetworkAccessPolicyVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessPortRule{ - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](22), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }, - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](3389), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }}, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesResourceGroup_example.json -func ExampleJitNetworkAccessPoliciesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJitNetworkAccessPoliciesClient().NewListByResourceGroupPager("myRg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JitNetworkAccessPoliciesList = armsecurity.JitNetworkAccessPoliciesList{ - // Value: []*armsecurity.JitNetworkAccessPolicy{ - // { - // Kind: to.Ptr("Basic"), - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/locations/jitNetworkAccessPolicies"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/default"), - // Properties: &armsecurity.JitNetworkAccessPolicyProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // Requests: []*armsecurity.JitNetworkAccessRequest{ - // { - // Justification: to.Ptr("testing a new version of the product"), - // Requestor: to.Ptr("barbara@contoso.com"), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T08:06:45.5691611Z"); return t}()), - // VirtualMachines: []*armsecurity.JitNetworkAccessRequestVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessRequestPort{ - // { - // AllowedSourceAddressPrefix: to.Ptr("192.127.0.2"), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T09:06:45.5691611Z"); return t}()), - // Number: to.Ptr[int32](3389), - // Status: to.Ptr(armsecurity.StatusInitiated), - // StatusReason: to.Ptr(armsecurity.StatusReasonUserRequested), - // }}, - // }}, - // }}, - // VirtualMachines: []*armsecurity.JitNetworkAccessPolicyVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessPortRule{ - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](22), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }, - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](3389), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }}, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesResourceGroupLocation_example.json -func ExampleJitNetworkAccessPoliciesClient_NewListByResourceGroupAndRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJitNetworkAccessPoliciesClient().NewListByResourceGroupAndRegionPager("myRg1", "westeurope", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JitNetworkAccessPoliciesList = armsecurity.JitNetworkAccessPoliciesList{ - // Value: []*armsecurity.JitNetworkAccessPolicy{ - // { - // Kind: to.Ptr("Basic"), - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/locations/jitNetworkAccessPolicies"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/default"), - // Properties: &armsecurity.JitNetworkAccessPolicyProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // Requests: []*armsecurity.JitNetworkAccessRequest{ - // { - // Justification: to.Ptr("testing a new version of the product"), - // Requestor: to.Ptr("barbara@contoso.com"), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T08:06:45.5691611Z"); return t}()), - // VirtualMachines: []*armsecurity.JitNetworkAccessRequestVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessRequestPort{ - // { - // AllowedSourceAddressPrefix: to.Ptr("192.127.0.2"), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T09:06:45.5691611Z"); return t}()), - // Number: to.Ptr[int32](3389), - // Status: to.Ptr(armsecurity.StatusInitiated), - // StatusReason: to.Ptr(armsecurity.StatusReasonUserRequested), - // }}, - // }}, - // }}, - // VirtualMachines: []*armsecurity.JitNetworkAccessPolicyVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessPortRule{ - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](22), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }, - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](3389), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }}, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPolicy_example.json -func ExampleJitNetworkAccessPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJitNetworkAccessPoliciesClient().Get(ctx, "myRg1", "westeurope", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JitNetworkAccessPolicy = armsecurity.JitNetworkAccessPolicy{ - // Kind: to.Ptr("Basic"), - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/locations/jitNetworkAccessPolicies"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/default"), - // Properties: &armsecurity.JitNetworkAccessPolicyProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // Requests: []*armsecurity.JitNetworkAccessRequest{ - // { - // Justification: to.Ptr("testing a new version of the product"), - // Requestor: to.Ptr("barbara@contoso.com"), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T08:06:45.5691611Z"); return t}()), - // VirtualMachines: []*armsecurity.JitNetworkAccessRequestVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessRequestPort{ - // { - // AllowedSourceAddressPrefix: to.Ptr("192.127.0.2"), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T09:06:45.5691611Z"); return t}()), - // Number: to.Ptr[int32](3389), - // Status: to.Ptr(armsecurity.StatusInitiated), - // StatusReason: to.Ptr(armsecurity.StatusReasonUserRequested), - // }}, - // }}, - // }}, - // VirtualMachines: []*armsecurity.JitNetworkAccessPolicyVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessPortRule{ - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](22), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }, - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](3389), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/CreateJitNetworkAccessPolicy_example.json -func ExampleJitNetworkAccessPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJitNetworkAccessPoliciesClient().CreateOrUpdate(ctx, "myRg1", "westeurope", "default", armsecurity.JitNetworkAccessPolicy{ - Kind: to.Ptr("Basic"), - Location: to.Ptr("westeurope"), - Name: to.Ptr("default"), - Type: to.Ptr("Microsoft.Security/locations/jitNetworkAccessPolicies"), - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/default"), - Properties: &armsecurity.JitNetworkAccessPolicyProperties{ - ProvisioningState: to.Ptr("Succeeded"), - Requests: []*armsecurity.JitNetworkAccessRequest{ - { - Requestor: to.Ptr("barbara@contoso.com"), - StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T08:06:45.5691611Z"); return t }()), - VirtualMachines: []*armsecurity.JitNetworkAccessRequestVirtualMachine{ - { - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - Ports: []*armsecurity.JitNetworkAccessRequestPort{ - { - AllowedSourceAddressPrefix: to.Ptr("192.127.0.2"), - EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T09:06:45.5691611Z"); return t }()), - Number: to.Ptr[int32](3389), - Status: to.Ptr(armsecurity.StatusInitiated), - StatusReason: to.Ptr(armsecurity.StatusReasonUserRequested), - }}, - }}, - }}, - VirtualMachines: []*armsecurity.JitNetworkAccessPolicyVirtualMachine{ - { - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - Ports: []*armsecurity.JitNetworkAccessPortRule{ - { - AllowedSourceAddressPrefix: to.Ptr("*"), - MaxRequestAccessDuration: to.Ptr("PT3H"), - Number: to.Ptr[int32](22), - Protocol: to.Ptr(armsecurity.ProtocolAll), - }, - { - AllowedSourceAddressPrefix: to.Ptr("*"), - MaxRequestAccessDuration: to.Ptr("PT3H"), - Number: to.Ptr[int32](3389), - Protocol: to.Ptr(armsecurity.ProtocolAll), - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JitNetworkAccessPolicy = armsecurity.JitNetworkAccessPolicy{ - // Kind: to.Ptr("Basic"), - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/locations/jitNetworkAccessPolicies"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/default"), - // Properties: &armsecurity.JitNetworkAccessPolicyProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // Requests: []*armsecurity.JitNetworkAccessRequest{ - // { - // Requestor: to.Ptr("barbara@contoso.com"), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T08:06:45.5691611Z"); return t}()), - // VirtualMachines: []*armsecurity.JitNetworkAccessRequestVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessRequestPort{ - // { - // AllowedSourceAddressPrefix: to.Ptr("192.127.0.2"), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T09:06:45.5691611Z"); return t}()), - // Number: to.Ptr[int32](3389), - // Status: to.Ptr(armsecurity.StatusInitiated), - // StatusReason: to.Ptr(armsecurity.StatusReasonUserRequested), - // }}, - // }}, - // }}, - // VirtualMachines: []*armsecurity.JitNetworkAccessPolicyVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessPortRule{ - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](22), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }, - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](3389), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/DeleteJitNetworkAccessPolicy_example.json -func ExampleJitNetworkAccessPoliciesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewJitNetworkAccessPoliciesClient().Delete(ctx, "myRg1", "westeurope", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/InitiateJitNetworkAccessPolicy_example.json -func ExampleJitNetworkAccessPoliciesClient_Initiate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewJitNetworkAccessPoliciesClient().Initiate(ctx, "myRg1", "westeurope", "default", armsecurity.JitNetworkAccessPolicyInitiateRequest{ - Justification: to.Ptr("testing a new version of the product"), - VirtualMachines: []*armsecurity.JitNetworkAccessPolicyInitiateVirtualMachine{ - { - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - Ports: []*armsecurity.JitNetworkAccessPolicyInitiatePort{ - { - AllowedSourceAddressPrefix: to.Ptr("192.127.0.2"), - Number: to.Ptr[int32](3389), - }}, - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/locations_client_example_test.go b/sdk/resourcemanager/security/armsecurity/locations_client_example_test.go deleted file mode 100644 index da71138a32c9..000000000000 --- a/sdk/resourcemanager/security/armsecurity/locations_client_example_test.go +++ /dev/null @@ -1,82 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Locations/GetLocations_example.json -func ExampleLocationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLocationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AscLocationList = armsecurity.AscLocationList{ - // Value: []*armsecurity.AscLocation{ - // { - // Name: to.Ptr("centralus"), - // Type: to.Ptr("Microsoft.Security/locations"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/centralus"), - // Properties: map[string]any{ - // "homeRegionName": "centralus", - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Locations/GetLocation_example.json -func ExampleLocationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocationsClient().Get(ctx, "centralus", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AscLocation = armsecurity.AscLocation{ - // Name: to.Ptr("centralus"), - // Type: to.Ptr("Microsoft.Security/locations"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/centralus"), - // Properties: map[string]any{ - // "homeRegionName": "centralus", - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/mdeonboardings_client_example_test.go b/sdk/resourcemanager/security/armsecurity/mdeonboardings_client_example_test.go deleted file mode 100644 index 9369263c292b..000000000000 --- a/sdk/resourcemanager/security/armsecurity/mdeonboardings_client_example_test.go +++ /dev/null @@ -1,79 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2021-10-01-preview/examples/MdeOnboardings/ListMdeOnboardings_example.json -func ExampleMdeOnboardingsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMdeOnboardingsClient().List(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MdeOnboardingDataList = armsecurity.MdeOnboardingDataList{ - // Value: []*armsecurity.MdeOnboardingData{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/mdeOnboarding"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/mdeOnboarding/default"), - // Properties: &armsecurity.MdeOnboardingDataProperties{ - // OnboardingPackageLinux: []byte("QGVjaG8gb2ZmCgplY2hvLiA+TlVMIDI+JjEKZWNobyBTdGFydGluZyBXaW5kb3dzIERlZmVuZGVyIEFkdmFuY2VkIFRocmVhdCBQcm90ZWN0aW9uIG9uYm9hcmRpbmcgcHJvY2Vzcy4uLiA+TlVMIDI+JjEKZWNoby4gPk5VTCAyPiYxCgpzZXQgZXJyb3JDb2RlPTAKc2V0IGxhc3RFcnJvcj0wCnNldCAidHJvdWJsZXNob290SW5mbz1Gb3IgbW9yZSBpbmZvcm1hdGlvbiwgdmlzaXQ6IGh0dHBzOi8vZ28ubWljcm9zb2Z0LmNvbS9md2xpbmsvcC8/bGlua2lkPTgyMjgwNyIKc2V0ICJlcnJvckRlc2NyaXB0aW9uPSIKCmVjaG8gVGVzdGluZyBhZG1pbmlzdHJhdG9yIHByaXZpbGVnZXMgPk5VTCAyPiYxCgpuZXQgc2Vzc2lvbiA+TlVMIDI+JjEKaWYgJUVSUk9STEVWRUwlIE5FUSAwICgKCUBlY2hvIFNjcmlwdCBpcyBydW5uaW5nIHdpdGggaW5zdWZmaWNpZW50IHByaXZpbGVnZXMuIFBsZWFzZSBydW4gd2l0aCBhZG1pbmlzdHJhdG9yIHByaXZpbGVnZXM+ICVUTVAlXHNlbnNlVG1wLnR4dAoJc2V0IGVycm9yQ29kZT02NQogc2V0IGxhc3RFcnJvcj0lRVJST1JMRVZFTCUKCUdPVE8gRVJST1IKKQoKZWNobyBTY3JpcHQgaXMgcnVubmluZyB3aXRoIHN1ZmZpY2llbnQgcHJpdmlsZWdlcyA+TlVMIDI+JjEKZWNoby4gPk5VTCAyPiYxCmVjaG8gUGVyZm9ybWluZyBvbmJvYXJkaW5nIG9wZXJhdGlvbnMgPk5VTCAyPiYxCmVjaG8uID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1lc3NhZ2Upe2VzLldyaXRlKFwiT25ib2FyZGluZ1NjcmlwdFwiLCBUZWxlbWV0cnlDcml0aWNhbE9wdGlvbiwgbmV3IE9uYm9hcmRpbmcge01lc3NhZ2UgPSBtZXNzYWdlfSk7fSBwcml2YXRlIHN0YXRpYyByZWFkb25seSBzdHJpbmdbXSB0ZWxlbWV0cnlUcmFpdHMgPSB7IFwiRVRXX0dST1VQXCIsIFwiezVFQ0IwQkFDLUI5MzAtNDdGNS1BOEE0LUU4MjUzNTI5RURCN31cIiB9OyBwcml2YXRlIEV2ZW50U291cmNlIGVzID0gbmV3IEV2ZW50U291cmNlKFwiTWljcm9zb2Z0LldpbmRvd3MuU2Vuc2UuQ2xpZW50Lk1hbmFnZW1lbnRcIixFdmVudFNvdXJjZVNldHRpbmdzLkV0d1NlbGZEZXNjcmliaW5nRXZlbnRGb3JtYXQsdGVsZW1ldHJ5VHJhaXRzKTt9fSc7ICRsb2dnZXIgPSBOZXctT2JqZWN0IC1UeXBlTmFtZSBTZW5zZS5UcmFjZTsgJGxvZ2dlci5Xcml0ZU9uYm9hcmRpbmdNZXNzYWdlKCclc3VjY2Vzc091dHB1dCUnKSIgPk5VTCAyPiYxCiIlUFJPR1JBTUZJTEVTJVxXaW5kb3dzIERlZmVuZGVyXE1wQ21kUnVuLmV4ZSIgLVJlbG9hZEVuZ2luZSA+TlVMIDI+JjEKCkdPVE8gQ0xFQU5VUAoKOkNMRUFOVVAKaWYgZXhpc3QgJVRNUCVcc2Vuc2VUbXAudHh0IGRlbCAlVE1QJVxzZW5zZVRtcC50eHQKRVhJVCAvQiAlZXJyb3JDb2RlJQo=="), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2021-10-01-preview/examples/MdeOnboardings/GetMdeOnboardings_example.json -func ExampleMdeOnboardingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMdeOnboardingsClient().Get(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MdeOnboardingData = armsecurity.MdeOnboardingData{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/mdeOnboardings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/mdeOnboardings/default"), - // Properties: &armsecurity.MdeOnboardingDataProperties{ - // OnboardingPackageLinux: []byte("QGVjaG8gb2ZmCgplY2hvLiA+TlVMIDI+JjEKZWNobyBTdGFydGluZyBXaW5kb3dzIERlZmVuZGVyIEFkdmFuY2VkIFRocmVhdCBQcm90ZWN0aW9uIG9uYm9hcmRpbmcgcHJvY2Vzcy4uLiA+TlVMIDI+JjEKZWNoby4gPk5VTCAyPiYxCgpzZXQgZXJyb3JDb2RlPTAKc2V0IGxhc3RFcnJvcj0wCnNldCAidHJvdWJsZXNob290SW5mbz1Gb3IgbW9yZSBpbmZvcm1hdGlvbiwgdmlzaXQ6IGh0dHBzOi8vZ28ubWljcm9zb2Z0LmNvbS9md2xpbmsvcC8/bGlua2lkPTgyMjgwNyIKc2V0ICJlcnJvckRlc2NyaXB0aW9uPSIKCmVjaG8gVGVzdGluZyBhZG1pbmlzdHJhdG9yIHByaXZpbGVnZXMgPk5VTCAyPiYxCgpuZXQgc2Vzc2lvbiA+TlVMIDI+JjEKaWYgJUVSUk9STEVWRUwlIE5FUSAwICgKCUBlY2hvIFNjcmlwdCBpcyBydW5uaW5nIHdpdGggaW5zdWZmaWNpZW50IHByaXZpbGVnZXMuIF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A+TlVMIDI+JjEKCkdPVE8gQ0xFQU5VUAoKOkNMRUFOVVAKaWYgZXhpc3QgJVRNUCVcc2Vuc2VUbXAudHh0IGRlbCAlVE1QJVxzZW5zZVRtcC50eHQKRVhJVCAvQiAlZXJyb3JDb2RlJQo=="), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/models.go b/sdk/resourcemanager/security/armsecurity/models.go index 8abda8a177a4..eb225ea88670 100644 --- a/sdk/resourcemanager/security/armsecurity/models.go +++ b/sdk/resourcemanager/security/armsecurity/models.go @@ -52,6 +52,61 @@ type AADSolutionProperties struct { Workspace *ConnectedWorkspace `json:"workspace,omitempty"` } +// APICollectionClientGetOptions contains the optional parameters for the APICollectionClient.Get method. +type APICollectionClientGetOptions struct { + // placeholder for future optional parameters +} + +// APICollectionClientListOptions contains the optional parameters for the APICollectionClient.NewListPager method. +type APICollectionClientListOptions struct { + // placeholder for future optional parameters +} + +// APICollectionOffboardingClientDeleteOptions contains the optional parameters for the APICollectionOffboardingClient.Delete +// method. +type APICollectionOffboardingClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// APICollectionOnboardingClientCreateOptions contains the optional parameters for the APICollectionOnboardingClient.Create +// method. +type APICollectionOnboardingClientCreateOptions struct { + // placeholder for future optional parameters +} + +// APICollectionProperties - Describes the properties of an API collection. +type APICollectionProperties struct { + // Additional data regarding the API collection. + AdditionalData map[string]*string `json:"additionalData,omitempty"` + + // The display name of the Azure API Management API. + DisplayName *string `json:"displayName,omitempty"` +} + +// APICollectionResponse - An API collection as represented by Defender for APIs. +type APICollectionResponse struct { + // Describes the properties of an API collection. + Properties *APICollectionProperties `json:"properties,omitempty"` + + // READ-ONLY; Resource Id + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Resource type + Type *string `json:"type,omitempty" azure:"ro"` +} + +// APICollectionResponseList - Page of a list of API collections as represented by Defender for APIs. +type APICollectionResponseList struct { + // READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; API collections in this page. + Value []*APICollectionResponse `json:"value,omitempty" azure:"ro"` +} + // AccountConnectorsClientCreateOrUpdateOptions contains the optional parameters for the AccountConnectorsClient.CreateOrUpdate // method. type AccountConnectorsClientCreateOrUpdateOptions struct { @@ -423,8 +478,9 @@ type AlertProperties struct { // READ-ONLY; The name of Azure Security Center pricing tier which powering this alert. Learn more: https://docs.microsoft.com/en-us/azure/security-center/security-center-pricing ProductComponentName *string `json:"productComponentName,omitempty" azure:"ro"` - // READ-ONLY; The name of the product which published this alert (Azure Security Center, Azure ATP, Microsoft Defender ATP, - // O365 ATP, MCAS, and so on). + // READ-ONLY; The name of the product which published this alert (Microsoft Sentinel, Microsoft Defender for Identity, Microsoft + // Defender for Endpoint, Microsoft Defender for Office, Microsoft Defender for Cloud + // Apps, and so on). ProductName *string `json:"productName,omitempty" azure:"ro"` // READ-ONLY; Manual action items to take to remediate the alert. @@ -1834,13 +1890,19 @@ func (a *AwsCredsAuthenticationDetailsProperties) GetAuthenticationDetailsProper } } -// AwsEnvironmentData - The aws connector environment data +// AwsEnvironmentData - The AWS connector environment data type AwsEnvironmentData struct { // REQUIRED; The type of the environment data. EnvironmentType *EnvironmentType `json:"environmentType,omitempty"` // The AWS account's organizational data OrganizationalData AwsOrganizationalDataClassification `json:"organizationalData,omitempty"` + + // list of regions to scan + Regions []*string `json:"regions,omitempty"` + + // READ-ONLY; The AWS account name + AccountName *string `json:"accountName,omitempty" azure:"ro"` } // GetEnvironmentData implements the EnvironmentDataClassification interface for type AwsEnvironmentData. @@ -1859,7 +1921,7 @@ type AwsOrganizationalDataClassification interface { GetAwsOrganizationalData() *AwsOrganizationalData } -// AwsOrganizationalData - The awsOrganization data +// AwsOrganizationalData - The AWS organization data type AwsOrganizationalData struct { // REQUIRED; The multi cloud account's membership type in the organization OrganizationMembershipType *OrganizationMembershipType `json:"organizationMembershipType,omitempty"` @@ -1868,7 +1930,7 @@ type AwsOrganizationalData struct { // GetAwsOrganizationalData implements the AwsOrganizationalDataClassification interface for type AwsOrganizationalData. func (a *AwsOrganizationalData) GetAwsOrganizationalData() *AwsOrganizationalData { return a } -// AwsOrganizationalDataMaster - The awsOrganization data for the master account +// AwsOrganizationalDataMaster - The AWS organization data for the master account type AwsOrganizationalDataMaster struct { // REQUIRED; The multi cloud account's membership type in the organization OrganizationMembershipType *OrganizationMembershipType `json:"organizationMembershipType,omitempty"` @@ -1887,7 +1949,7 @@ func (a *AwsOrganizationalDataMaster) GetAwsOrganizationalData() *AwsOrganizatio } } -// AwsOrganizationalDataMember - The awsOrganization data for the member account +// AwsOrganizationalDataMember - The AWS organization data for the member account type AwsOrganizationalDataMember struct { // REQUIRED; The multi cloud account's membership type in the organization OrganizationMembershipType *OrganizationMembershipType `json:"organizationMembershipType,omitempty"` @@ -2046,10 +2108,10 @@ type CefSolutionProperties struct { // CloudOfferingClassification provides polymorphic access to related types. // Call the interface's GetCloudOffering() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *CloudOffering, *CspmMonitorAwsOffering, *CspmMonitorAzureDevOpsOffering, *CspmMonitorGcpOffering, *CspmMonitorGithubOffering, -// - *DefenderCspmAwsOffering, *DefenderCspmGcpOffering, *DefenderFoDatabasesAwsOffering, *DefenderForContainersAwsOffering, -// - *DefenderForContainersGcpOffering, *DefenderForDatabasesGcpOffering, *DefenderForDevOpsAzureDevOpsOffering, *DefenderForDevOpsGithubOffering, -// - *DefenderForServersAwsOffering, *DefenderForServersGcpOffering, *InformationProtectionAwsOffering +// - *CloudOffering, *CspmMonitorAwsOffering, *CspmMonitorAzureDevOpsOffering, *CspmMonitorGcpOffering, *CspmMonitorGitLabOffering, +// - *CspmMonitorGithubOffering, *DefenderCspmAwsOffering, *DefenderCspmGcpOffering, *DefenderFoDatabasesAwsOffering, *DefenderForContainersAwsOffering, +// - *DefenderForContainersGcpOffering, *DefenderForDatabasesGcpOffering, *DefenderForDevOpsAzureDevOpsOffering, *DefenderForDevOpsGitLabOffering, +// - *DefenderForDevOpsGithubOffering, *DefenderForServersAwsOffering, *DefenderForServersGcpOffering, *InformationProtectionAwsOffering type CloudOfferingClassification interface { // GetCloudOffering returns the CloudOffering content of the underlying type. GetCloudOffering() *CloudOffering @@ -2375,36 +2437,6 @@ type ConnectorApplicationsClientListOptions struct { // placeholder for future optional parameters } -// ConnectorGovernanceRuleClientListOptions contains the optional parameters for the ConnectorGovernanceRuleClient.NewListPager -// method. -type ConnectorGovernanceRuleClientListOptions struct { - // placeholder for future optional parameters -} - -// ConnectorGovernanceRulesClientCreateOrUpdateOptions contains the optional parameters for the ConnectorGovernanceRulesClient.CreateOrUpdate -// method. -type ConnectorGovernanceRulesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ConnectorGovernanceRulesClientDeleteOptions contains the optional parameters for the ConnectorGovernanceRulesClient.Delete -// method. -type ConnectorGovernanceRulesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ConnectorGovernanceRulesClientGetOptions contains the optional parameters for the ConnectorGovernanceRulesClient.Get method. -type ConnectorGovernanceRulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ConnectorGovernanceRulesExecuteStatusClientBeginGetOptions contains the optional parameters for the ConnectorGovernanceRulesExecuteStatusClient.BeginGet -// method. -type ConnectorGovernanceRulesExecuteStatusClientBeginGetOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // ConnectorProperties - A set of properties that defines the security connector configuration. type ConnectorProperties struct { // The security connector environment data. @@ -2687,6 +2719,23 @@ type CspmMonitorGcpOfferingNativeCloudConnection struct { WorkloadIdentityProviderID *string `json:"workloadIdentityProviderId,omitempty"` } +// CspmMonitorGitLabOffering - The CSPM (Cloud security posture management) monitoring for gitlab offering +type CspmMonitorGitLabOffering struct { + // REQUIRED; The type of the security offering. + OfferingType *OfferingType `json:"offeringType,omitempty"` + + // READ-ONLY; The offering description. + Description *string `json:"description,omitempty" azure:"ro"` +} + +// GetCloudOffering implements the CloudOfferingClassification interface for type CspmMonitorGitLabOffering. +func (c *CspmMonitorGitLabOffering) GetCloudOffering() *CloudOffering { + return &CloudOffering{ + OfferingType: c.OfferingType, + Description: c.Description, + } +} + // CspmMonitorGithubOffering - The CSPM monitoring for github offering type CspmMonitorGithubOffering struct { // REQUIRED; The type of the security offering. @@ -2966,11 +3015,17 @@ func (d *DataExportSettings) GetSetting() *Setting { } } -// DefenderCspmAwsOffering - The CSPM P1 for Aws offering +// DefenderCspmAwsOffering - The CSPM P1 for AWS offering type DefenderCspmAwsOffering struct { // REQUIRED; The type of the security offering. OfferingType *OfferingType `json:"offeringType,omitempty"` + // The Microsoft Defender Data Sensitivity discovery configuration + DataSensitivityDiscovery *DefenderCspmAwsOfferingDataSensitivityDiscovery `json:"dataSensitivityDiscovery,omitempty"` + + // The databases DSPM configuration + DatabasesDspm *DefenderCspmAwsOfferingDatabasesDspm `json:"databasesDspm,omitempty"` + // The Microsoft Defender for Server VM scanning configuration VMScanners *DefenderCspmAwsOfferingVMScanners `json:"vmScanners,omitempty"` @@ -2986,6 +3041,24 @@ func (d *DefenderCspmAwsOffering) GetCloudOffering() *CloudOffering { } } +// DefenderCspmAwsOfferingDataSensitivityDiscovery - The Microsoft Defender Data Sensitivity discovery configuration +type DefenderCspmAwsOfferingDataSensitivityDiscovery struct { + // The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` + + // Is Microsoft Defender Data Sensitivity discovery enabled + Enabled *bool `json:"enabled,omitempty"` +} + +// DefenderCspmAwsOfferingDatabasesDspm - The databases DSPM configuration +type DefenderCspmAwsOfferingDatabasesDspm struct { + // The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` + + // Is databases DSPM protection enabled + Enabled *bool `json:"enabled,omitempty"` +} + // DefenderCspmAwsOfferingVMScanners - The Microsoft Defender for Server VM scanning configuration type DefenderCspmAwsOfferingVMScanners struct { // configuration for Microsoft Defender for Server VM scanning @@ -3003,7 +3076,7 @@ type DefenderCspmAwsOfferingVMScannersConfiguration struct { // VM tags that indicates that VM should not be scanned ExclusionTags map[string]*string `json:"exclusionTags,omitempty"` - // The scanning mode for the vm scan. + // The scanning mode for the VM scan. ScanningMode *ScanningMode `json:"scanningMode,omitempty"` } @@ -3032,6 +3105,9 @@ type DefenderFoDatabasesAwsOffering struct { // The ARC autoprovisioning configuration ArcAutoProvisioning *DefenderFoDatabasesAwsOfferingArcAutoProvisioning `json:"arcAutoProvisioning,omitempty"` + // The databases data security posture management (DSPM) configuration + DatabasesDspm *DefenderFoDatabasesAwsOfferingDatabasesDspm `json:"databasesDspm,omitempty"` + // The RDS configuration Rds *DefenderFoDatabasesAwsOfferingRds `json:"rds,omitempty"` @@ -3052,10 +3128,31 @@ type DefenderFoDatabasesAwsOfferingArcAutoProvisioning struct { // The cloud role ARN in AWS for this feature CloudRoleArn *string `json:"cloudRoleArn,omitempty"` + // Configuration for servers Arc auto provisioning + Configuration *DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration `json:"configuration,omitempty"` + // Is arc auto provisioning enabled Enabled *bool `json:"enabled,omitempty"` } +// DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration - Configuration for servers Arc auto provisioning +type DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration struct { + // Optional Arc private link scope resource id to link the Arc agent + PrivateLinkScope *string `json:"privateLinkScope,omitempty"` + + // Optional http proxy endpoint to use for the Arc agent + Proxy *string `json:"proxy,omitempty"` +} + +// DefenderFoDatabasesAwsOfferingDatabasesDspm - The databases data security posture management (DSPM) configuration +type DefenderFoDatabasesAwsOfferingDatabasesDspm struct { + // The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` + + // Is databases data security posture management (DSPM) protection enabled + Enabled *bool `json:"enabled,omitempty"` +} + // DefenderFoDatabasesAwsOfferingRds - The RDS configuration type DefenderFoDatabasesAwsOfferingRds struct { // The cloud role ARN in AWS for this feature @@ -3223,10 +3320,22 @@ func (d *DefenderForDatabasesGcpOffering) GetCloudOffering() *CloudOffering { // DefenderForDatabasesGcpOfferingArcAutoProvisioning - The ARC autoprovisioning configuration type DefenderForDatabasesGcpOfferingArcAutoProvisioning struct { + // Configuration for servers Arc auto provisioning + Configuration *DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration `json:"configuration,omitempty"` + // Is arc auto provisioning enabled Enabled *bool `json:"enabled,omitempty"` } +// DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration - Configuration for servers Arc auto provisioning +type DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration struct { + // Optional Arc private link scope resource id to link the Arc agent + PrivateLinkScope *string `json:"privateLinkScope,omitempty"` + + // Optional http proxy endpoint to use for the Arc agent + Proxy *string `json:"proxy,omitempty"` +} + // DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning - The native cloud connection configuration type DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning struct { // The service account email address in GCP for this offering @@ -3253,6 +3362,23 @@ func (d *DefenderForDevOpsAzureDevOpsOffering) GetCloudOffering() *CloudOffering } } +// DefenderForDevOpsGitLabOffering - The Defender for DevOps for Gitlab offering +type DefenderForDevOpsGitLabOffering struct { + // REQUIRED; The type of the security offering. + OfferingType *OfferingType `json:"offeringType,omitempty"` + + // READ-ONLY; The offering description. + Description *string `json:"description,omitempty" azure:"ro"` +} + +// GetCloudOffering implements the CloudOfferingClassification interface for type DefenderForDevOpsGitLabOffering. +func (d *DefenderForDevOpsGitLabOffering) GetCloudOffering() *CloudOffering { + return &CloudOffering{ + OfferingType: d.OfferingType, + Description: d.Description, + } +} + // DefenderForDevOpsGithubOffering - The Defender for DevOps for Github offering type DefenderForDevOpsGithubOffering struct { // REQUIRED; The type of the security offering. @@ -3310,10 +3436,22 @@ type DefenderForServersAwsOfferingArcAutoProvisioning struct { // The cloud role ARN in AWS for this feature CloudRoleArn *string `json:"cloudRoleArn,omitempty"` + // Configuration for servers Arc auto provisioning + Configuration *DefenderForServersAwsOfferingArcAutoProvisioningConfiguration `json:"configuration,omitempty"` + // Is arc auto provisioning enabled Enabled *bool `json:"enabled,omitempty"` } +// DefenderForServersAwsOfferingArcAutoProvisioningConfiguration - Configuration for servers Arc auto provisioning +type DefenderForServersAwsOfferingArcAutoProvisioningConfiguration struct { + // Optional Arc private link scope resource id to link the Arc agent + PrivateLinkScope *string `json:"privateLinkScope,omitempty"` + + // Optional HTTP proxy endpoint to use for the Arc agent + Proxy *string `json:"proxy,omitempty"` +} + // DefenderForServersAwsOfferingDefenderForServers - The Defender for servers connection configuration type DefenderForServersAwsOfferingDefenderForServers struct { // The cloud role ARN in AWS for this feature @@ -3352,7 +3490,7 @@ type DefenderForServersAwsOfferingVMScannersConfiguration struct { // VM tags that indicates that VM should not be scanned ExclusionTags map[string]*string `json:"exclusionTags,omitempty"` - // The scanning mode for the vm scan. + // The scanning mode for the VM scan. ScanningMode *ScanningMode `json:"scanningMode,omitempty"` } @@ -3388,6 +3526,9 @@ type DefenderForServersGcpOffering struct { // configuration for the servers offering subPlan SubPlan *DefenderForServersGcpOfferingSubPlan `json:"subPlan,omitempty"` + // The Microsoft Defender for Server VM scanning configuration + VMScanners *DefenderForServersGcpOfferingVMScanners `json:"vmScanners,omitempty"` + // The Vulnerability Assessment autoprovisioning configuration VaAutoProvisioning *DefenderForServersGcpOfferingVaAutoProvisioning `json:"vaAutoProvisioning,omitempty"` @@ -3405,10 +3546,22 @@ func (d *DefenderForServersGcpOffering) GetCloudOffering() *CloudOffering { // DefenderForServersGcpOfferingArcAutoProvisioning - The ARC autoprovisioning configuration type DefenderForServersGcpOfferingArcAutoProvisioning struct { + // Configuration for servers Arc auto provisioning + Configuration *DefenderForServersGcpOfferingArcAutoProvisioningConfiguration `json:"configuration,omitempty"` + // Is arc auto provisioning enabled Enabled *bool `json:"enabled,omitempty"` } +// DefenderForServersGcpOfferingArcAutoProvisioningConfiguration - Configuration for servers Arc auto provisioning +type DefenderForServersGcpOfferingArcAutoProvisioningConfiguration struct { + // Optional Arc private link scope resource id to link the Arc agent + PrivateLinkScope *string `json:"privateLinkScope,omitempty"` + + // Optional HTTP proxy endpoint to use for the Arc agent + Proxy *string `json:"proxy,omitempty"` +} + // DefenderForServersGcpOfferingDefenderForServers - The Defender for servers connection configuration type DefenderForServersGcpOfferingDefenderForServers struct { // The service account email address in GCP for this feature @@ -3433,6 +3586,24 @@ type DefenderForServersGcpOfferingSubPlan struct { Type *SubPlan `json:"type,omitempty"` } +// DefenderForServersGcpOfferingVMScanners - The Microsoft Defender for Server VM scanning configuration +type DefenderForServersGcpOfferingVMScanners struct { + // configuration for Microsoft Defender for Server VM scanning + Configuration *DefenderForServersGcpOfferingVMScannersConfiguration `json:"configuration,omitempty"` + + // Is Microsoft Defender for Server VM scanning enabled + Enabled *bool `json:"enabled,omitempty"` +} + +// DefenderForServersGcpOfferingVMScannersConfiguration - configuration for Microsoft Defender for Server VM scanning +type DefenderForServersGcpOfferingVMScannersConfiguration struct { + // VM tags that indicate that VM should not be scanned + ExclusionTags map[string]*string `json:"exclusionTags,omitempty"` + + // The scanning mode for the VM scan. + ScanningMode *ScanningMode `json:"scanningMode,omitempty"` +} + // DefenderForServersGcpOfferingVaAutoProvisioning - The Vulnerability Assessment autoprovisioning configuration type DefenderForServersGcpOfferingVaAutoProvisioning struct { // configuration for Vulnerability Assessment autoprovisioning @@ -3684,7 +3855,8 @@ type EffectiveNetworkSecurityGroups struct { // EnvironmentDataClassification provides polymorphic access to related types. // Call the interface's GetEnvironmentData() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *AwsEnvironmentData, *AzureDevOpsScopeEnvironmentData, *EnvironmentData, *GcpProjectEnvironmentData, *GithubScopeEnvironmentData +// - *AwsEnvironmentData, *AzureDevOpsScopeEnvironmentData, *EnvironmentData, *GcpProjectEnvironmentData, *GithubScopeEnvironmentData, +// - *GitlabScopeEnvironmentData type EnvironmentDataClassification interface { // GetEnvironmentData returns the EnvironmentData content of the underlying type. GetEnvironmentData() *EnvironmentData @@ -3699,6 +3871,25 @@ type EnvironmentData struct { // GetEnvironmentData implements the EnvironmentDataClassification interface for type EnvironmentData. func (e *EnvironmentData) GetEnvironmentData() *EnvironmentData { return e } +// EnvironmentDetails - The environment details of the resource +type EnvironmentDetails struct { + // The hierarchy id of the connector (in case of Azure - the subscription Id, in case of MC - the hierarchyId id) + EnvironmentHierarchyID *string `json:"environmentHierarchyId,omitempty"` + + // The native resource id of the resource (in case of Azure - the resource Id, in case of MC - the native resource id) + NativeResourceID *string `json:"nativeResourceId,omitempty"` + + // The organizational hierarchy id of the connector (in case of Azure - the subscription Id, in case of MC - the organizational + // hierarchyId id) + OrganizationalHierarchyID *string `json:"organizationalHierarchyId,omitempty"` + + // The subscription Id + SubscriptionID *string `json:"subscriptionId,omitempty"` + + // The tenant Id + TenantID *string `json:"tenantId,omitempty"` +} + // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. @@ -3708,16 +3899,87 @@ type ErrorAdditionalInfo struct { Type *string `json:"type,omitempty" azure:"ro"` } +// ErrorDetail - The error detail. +type ErrorDetail struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"` + + // READ-ONLY; The error code. + Code *string `json:"code,omitempty" azure:"ro"` + + // READ-ONLY; The error details. + Details []*ErrorDetail `json:"details,omitempty" azure:"ro"` + + // READ-ONLY; The error message. + Message *string `json:"message,omitempty" azure:"ro"` + + // READ-ONLY; The error target. + Target *string `json:"target,omitempty" azure:"ro"` +} + +// ErrorDetailAutoGenerated - The error detail. +type ErrorDetailAutoGenerated struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"` + + // READ-ONLY; The error code. + Code *string `json:"code,omitempty" azure:"ro"` + + // READ-ONLY; The error details. + Details []*ErrorDetailAutoGenerated `json:"details,omitempty" azure:"ro"` + + // READ-ONLY; The error message. + Message *string `json:"message,omitempty" azure:"ro"` + + // READ-ONLY; The error target. + Target *string `json:"target,omitempty" azure:"ro"` +} + +// ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. +// (This also follows the OData error response format.). +type ErrorResponse struct { + // The error object. + Error *ErrorDetail `json:"error,omitempty"` +} + +// ErrorResponseAutoGenerated - Common error response for all Azure Resource Manager APIs to return error details for failed +// operations. (This also follows the OData error response format.). +type ErrorResponseAutoGenerated struct { + // The error object. + Error *ErrorDetailAutoGenerated `json:"error,omitempty"` +} + // ExecuteGovernanceRuleParams - Governance rule execution parameters type ExecuteGovernanceRuleParams struct { // Describe if governance rule should be override Override *bool `json:"override,omitempty"` } -// ExecuteRuleStatus - Execute status of Security GovernanceRule over a given scope -type ExecuteRuleStatus struct { - // READ-ONLY; Unique key for the execution of GovernanceRule - OperationID *string `json:"operationId,omitempty" azure:"ro"` +// Extension - A plan's extension properties +type Extension struct { + // REQUIRED; Indicates whether the extension is enabled. + IsEnabled *IsEnabled `json:"isEnabled,omitempty"` + + // REQUIRED; The extension name. Supported values are: + // AgentlessDiscoveryForKubernetes - API-based discovery of information about Kubernetes cluster architecture, workload objects, + // and setup. Required for Kubernetes inventory, identity and network + // exposure detection, attack path analysis and risk hunting as part of the cloud security explorer. Available for CloudPosture + // plan. + // OnUploadMalwareScanning - Limits the GB to be scanned per month for each storage account within the subscription. Once + // this limit reached on a given storage account, Blobs won't be scanned during + // current calendar month. Available for StorageAccounts plan. + // SensitiveDataDiscovery - Sensitive data discovery identifies Blob storage container with sensitive data such as credentials, + // credit cards, and more, to help prioritize and investigate security events. + // Available for StorageAccounts and CloudPosture plans. + // ContainerRegistriesVulnerabilityAssessments - Provides vulnerability management for images stored in your container registries. + // Available for CloudPosture and Containers plans. + Name *string `json:"name,omitempty"` + + // Property values associated with the extension. + AdditionalExtensionProperties map[string]any `json:"additionalExtensionProperties,omitempty"` + + // READ-ONLY; Optional. A status describing the success/failure of the extension's enablement/disablement operation. + OperationStatus *OperationStatus `json:"operationStatus,omitempty" azure:"ro"` } // ExternalSecuritySolution - Represents a security solution external to Microsoft Defender for Cloud which sends information @@ -4005,6 +4267,9 @@ type GcpOrganizationalDataOrganization struct { // The GCP workload identity provider id which represents the permissions required to auto provision security connectors WorkloadIdentityProviderID *string `json:"workloadIdentityProviderId,omitempty"` + + // READ-ONLY; GCP organization name + OrganizationName *string `json:"organizationName,omitempty" azure:"ro"` } // GetGcpOrganizationalData implements the GcpOrganizationalDataClassification interface for type GcpOrganizationalDataOrganization. @@ -4022,6 +4287,9 @@ type GcpProjectDetails struct { // The unique GCP Project number ProjectNumber *string `json:"projectNumber,omitempty"` + // READ-ONLY; GCP project name + ProjectName *string `json:"projectName,omitempty" azure:"ro"` + // READ-ONLY; The GCP workload identity federation pool id WorkloadIdentityPoolID *string `json:"workloadIdentityPoolId,omitempty" azure:"ro"` } @@ -4058,9 +4326,22 @@ func (g *GithubScopeEnvironmentData) GetEnvironmentData() *EnvironmentData { } } -// GovernanceAssignment - Security GovernanceAssignment over a given scope +// GitlabScopeEnvironmentData - The GitLab scope connector's environment data +type GitlabScopeEnvironmentData struct { + // REQUIRED; The type of the environment data. + EnvironmentType *EnvironmentType `json:"environmentType,omitempty"` +} + +// GetEnvironmentData implements the EnvironmentDataClassification interface for type GitlabScopeEnvironmentData. +func (g *GitlabScopeEnvironmentData) GetEnvironmentData() *EnvironmentData { + return &EnvironmentData{ + EnvironmentType: g.EnvironmentType, + } +} + +// GovernanceAssignment - Governance assignment over a given scope type GovernanceAssignment struct { - // Properties of a security governanceAssignment + // The properties of a governance assignment Properties *GovernanceAssignmentProperties `json:"properties,omitempty"` // READ-ONLY; Resource Id @@ -4073,15 +4354,15 @@ type GovernanceAssignment struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GovernanceAssignmentAdditionalData - Describe the additional data of GovernanceAssignment - optional +// GovernanceAssignmentAdditionalData - Describe the additional data of governance assignment - optional type GovernanceAssignmentAdditionalData struct { - // Ticket link associated with this GovernanceAssignment - for example: https://snow.com + // Ticket link associated with this governance assignment - for example: https://snow.com TicketLink *string `json:"ticketLink,omitempty"` - // Ticket number associated with this GovernanceAssignment + // Ticket number associated with this governance assignment TicketNumber *int32 `json:"ticketNumber,omitempty"` - // The ticket status associated with this GovernanceAssignment - for example: Active + // The ticket status associated with this governance assignment - for example: Active TicketStatus *string `json:"ticketStatus,omitempty"` } @@ -4128,7 +4409,7 @@ type GovernanceAssignmentsClientListOptions struct { // placeholder for future optional parameters } -// GovernanceAssignmentsList - Page of a security governance assignments list +// GovernanceAssignmentsList - Page of a governance assignments list type GovernanceAssignmentsList struct { // READ-ONLY; The URI to fetch the next page NextLink *string `json:"nextLink,omitempty" azure:"ro"` @@ -4146,9 +4427,9 @@ type GovernanceEmailNotification struct { DisableOwnerEmailNotification *bool `json:"disableOwnerEmailNotification,omitempty"` } -// GovernanceRule - Security GovernanceRule over a given scope +// GovernanceRule - Governance rule over a given scope type GovernanceRule struct { - // Properties of a security governanceRule + // Properties of a governance rule Properties *GovernanceRuleProperties `json:"properties,omitempty"` // READ-ONLY; Resource Id @@ -4161,29 +4442,39 @@ type GovernanceRule struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GovernanceRuleClientListOptions contains the optional parameters for the GovernanceRuleClient.NewListPager method. -type GovernanceRuleClientListOptions struct { - // placeholder for future optional parameters -} - -// GovernanceRuleEmailNotification - The governance email weekly notification configuration. +// GovernanceRuleEmailNotification - The governance email weekly notification configuration type GovernanceRuleEmailNotification struct { - // Defines whether manager email notifications are disabled. + // Defines whether manager email notifications are disabled DisableManagerEmailNotification *bool `json:"disableManagerEmailNotification,omitempty"` - // Defines whether owner email notifications are disabled. + // Defines whether owner email notifications are disabled DisableOwnerEmailNotification *bool `json:"disableOwnerEmailNotification,omitempty"` } -// GovernanceRuleList - Page of a security governanceRules list +// GovernanceRuleList - Page of a governance rules list type GovernanceRuleList struct { // READ-ONLY; The URI to fetch the next page NextLink *string `json:"nextLink,omitempty" azure:"ro"` - // READ-ONLY; Collection of governanceRules in this page + // READ-ONLY; Collection of governance rules in this page Value []*GovernanceRule `json:"value,omitempty" azure:"ro"` } +// GovernanceRuleMetadata - The governance rule metadata +type GovernanceRuleMetadata struct { + // READ-ONLY; Governance rule Created by object id (GUID) + CreatedBy *string `json:"createdBy,omitempty" azure:"ro"` + + // READ-ONLY; Governance rule creation date + CreatedOn *time.Time `json:"createdOn,omitempty" azure:"ro"` + + // READ-ONLY; Governance rule last updated by object id (GUID) + UpdatedBy *string `json:"updatedBy,omitempty" azure:"ro"` + + // READ-ONLY; Governance rule last update date + UpdatedOn *time.Time `json:"updatedOn,omitempty" azure:"ro"` +} + // GovernanceRuleOwnerSource - Describe the owner source of governance rule type GovernanceRuleOwnerSource struct { // The owner type for the governance rule owner source @@ -4193,19 +4484,19 @@ type GovernanceRuleOwnerSource struct { Value *string `json:"value,omitempty"` } -// GovernanceRuleProperties - Describes properties of an governanceRule +// GovernanceRuleProperties - Describes properties of an governance rule type GovernanceRuleProperties struct { // REQUIRED; The governance rule conditionSets - see examples ConditionSets []any `json:"conditionSets,omitempty"` - // REQUIRED; display name of the governanceRule + // REQUIRED; Display name of the governance rule DisplayName *string `json:"displayName,omitempty"` - // REQUIRED; The Owner source for the governance rule - e.g. Manually by user@contoso.com - see example + // REQUIRED; The owner source for the governance rule - e.g. Manually by user@contoso.com - see example OwnerSource *GovernanceRuleOwnerSource `json:"ownerSource,omitempty"` - // REQUIRED; The governance rule priority, priority to the lower number. Rules with the same priority on the same subscription - // will not be allowed + // REQUIRED; The governance rule priority, priority to the lower number. Rules with the same priority on the same scope will + // not be allowed RulePriority *int32 `json:"rulePriority,omitempty"` // REQUIRED; The rule type of the governance rule, defines the source of the rule e.g. Integrated @@ -4214,36 +4505,44 @@ type GovernanceRuleProperties struct { // REQUIRED; The governance rule source, what the rule affects, e.g. Assessments SourceResourceType *GovernanceRuleSourceResourceType `json:"sourceResourceType,omitempty"` - // description of the governanceRule + // Description of the governance rule Description *string `json:"description,omitempty"` + // Excluded scopes, filter out the descendants of the scope (on management scopes) + ExcludedScopes []*string `json:"excludedScopes,omitempty"` + // The email notifications settings for the governance rule, states whether to disable notifications for mangers and owners GovernanceEmailNotification *GovernanceRuleEmailNotification `json:"governanceEmailNotification,omitempty"` + // Defines whether the rule is management scope rule (master connector as a single scope or management scope) + IncludeMemberScopes *bool `json:"includeMemberScopes,omitempty"` + // Defines whether the rule is active/inactive IsDisabled *bool `json:"isDisabled,omitempty"` // Defines whether there is a grace period on the governance rule IsGracePeriod *bool `json:"isGracePeriod,omitempty"` + // The governance rule metadata + Metadata *GovernanceRuleMetadata `json:"metadata,omitempty"` + // Governance rule remediation timeframe - this is the time that will affect on the grace-period duration e.g. 7.00:00:00 // - means 7 days RemediationTimeframe *string `json:"remediationTimeframe,omitempty"` + + // READ-ONLY; The tenantId (GUID) + TenantID *string `json:"tenantId,omitempty" azure:"ro"` } -// GovernanceRulesClientBeginRuleIDExecuteSingleSecurityConnectorOptions contains the optional parameters for the GovernanceRulesClient.BeginRuleIDExecuteSingleSecurityConnector -// method. -type GovernanceRulesClientBeginRuleIDExecuteSingleSecurityConnectorOptions struct { - // GovernanceRule over a subscription scope - ExecuteGovernanceRuleParams *ExecuteGovernanceRuleParams +// GovernanceRulesClientBeginDeleteOptions contains the optional parameters for the GovernanceRulesClient.BeginDelete method. +type GovernanceRulesClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// GovernanceRulesClientBeginRuleIDExecuteSingleSubscriptionOptions contains the optional parameters for the GovernanceRulesClient.BeginRuleIDExecuteSingleSubscription -// method. -type GovernanceRulesClientBeginRuleIDExecuteSingleSubscriptionOptions struct { - // GovernanceRule over a subscription scope +// GovernanceRulesClientBeginExecuteOptions contains the optional parameters for the GovernanceRulesClient.BeginExecute method. +type GovernanceRulesClientBeginExecuteOptions struct { + // Execute governance rule over a given scope ExecuteGovernanceRuleParams *ExecuteGovernanceRuleParams // Resumes the LRO from the provided token. ResumeToken string @@ -4255,13 +4554,19 @@ type GovernanceRulesClientCreateOrUpdateOptions struct { // placeholder for future optional parameters } -// GovernanceRulesClientDeleteOptions contains the optional parameters for the GovernanceRulesClient.Delete method. -type GovernanceRulesClientDeleteOptions struct { +// GovernanceRulesClientGetOptions contains the optional parameters for the GovernanceRulesClient.Get method. +type GovernanceRulesClientGetOptions struct { // placeholder for future optional parameters } -// GovernanceRulesClientGetOptions contains the optional parameters for the GovernanceRulesClient.Get method. -type GovernanceRulesClientGetOptions struct { +// GovernanceRulesClientListOptions contains the optional parameters for the GovernanceRulesClient.NewListPager method. +type GovernanceRulesClientListOptions struct { + // placeholder for future optional parameters +} + +// GovernanceRulesClientOperationResultsOptions contains the optional parameters for the GovernanceRulesClient.OperationResults +// method. +type GovernanceRulesClientOperationResultsOptions struct { // placeholder for future optional parameters } @@ -4443,6 +4748,73 @@ func (h *HTTPD2CMessagesNotInAllowedRange) GetTimeWindowCustomAlertRule() *TimeW } } +// HealthDataClassification - The classification of the health report +type HealthDataClassification struct { + // The component describes the name of the agent/service that scans the issue + Component *string `json:"component,omitempty"` + + // The scenario describes the health scenario issue of the component + Scenario *string `json:"scenario,omitempty"` + + // The resource scope of the health report + Scope *ScopeName `json:"scope,omitempty"` +} + +// HealthReport - The health report resource +type HealthReport struct { + // Properties of a health report + Properties *HealthReportProperties `json:"properties,omitempty"` + + // READ-ONLY; Resource Id + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Resource type + Type *string `json:"type,omitempty" azure:"ro"` +} + +// HealthReportClientGetOptions contains the optional parameters for the HealthReportClient.Get method. +type HealthReportClientGetOptions struct { + // placeholder for future optional parameters +} + +// HealthReportProperties - Describes properties of the health report +type HealthReportProperties struct { + // The affected defenders plans by unhealthy report + AffectedDefendersPlans []*string `json:"affectedDefendersPlans,omitempty"` + + // The environment details of the resource + EnvironmentDetails *EnvironmentDetails `json:"environmentDetails,omitempty"` + + // The classification of the health report + HealthDataClassification *HealthDataClassification `json:"healthDataClassification,omitempty"` + + // A collection of the issues in the report + Issues []*Issue `json:"issues,omitempty"` + + // The resource details of the health report + ResourceDetails *ResourceDetailsAutoGenerated `json:"resourceDetails,omitempty"` + + // The status of the health report + Status *StatusAutoGenerated `json:"status,omitempty"` +} + +// HealthReportsClientListOptions contains the optional parameters for the HealthReportsClient.NewListPager method. +type HealthReportsClientListOptions struct { + // placeholder for future optional parameters +} + +// HealthReportsList - Page of health reports list +type HealthReportsList struct { + // READ-ONLY; The URI to fetch the next page + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Collection of health reports in this page + Value []*HealthReport `json:"value,omitempty" azure:"ro"` +} + // HybridComputeSettingsProperties - Settings for hybrid compute management type HybridComputeSettingsProperties struct { // REQUIRED; Whether or not to automatically install Azure Arc (hybrid compute) agents on machines @@ -4465,6 +4837,18 @@ type HybridComputeSettingsProperties struct { HybridComputeProvisioningState *HybridComputeProvisioningState `json:"hybridComputeProvisioningState,omitempty" azure:"ro"` } +// Identity for the resource. +type Identity struct { + // The identity type. + Type *string `json:"type,omitempty"` + + // READ-ONLY; The principal ID of resource identity. + PrincipalID *string `json:"principalId,omitempty" azure:"ro"` + + // READ-ONLY; The tenant ID of resource. + TenantID *string `json:"tenantId,omitempty" azure:"ro"` +} + // InformationProtectionAwsOffering - The information protection for AWS offering type InformationProtectionAwsOffering struct { // REQUIRED; The type of the security offering. @@ -5044,6 +5428,31 @@ type IotSecuritySolutionsAnalyticsRecommendationClientListOptions struct { Top *int32 } +// Issue - The issue that caused the resource to by unhealthy +type Issue struct { + // REQUIRED; The unique issue key + IssueKey *string `json:"issueKey,omitempty"` + + // Additional data for the given issue. The additional data depends on the issue type + IssueAdditionalData map[string]*string `json:"issueAdditionalData,omitempty"` + + // The issue description + IssueDescription *string `json:"issueDescription,omitempty"` + + // The issue name + IssueName *string `json:"issueName,omitempty"` + + // The remediation script to solve this issue + RemediationScript *string `json:"remediationScript,omitempty"` + + // Human readable description of what you should do to mitigate this health issue + RemediationSteps *string `json:"remediationSteps,omitempty"` + + // The affected security values that MDC offers that will be affected by the issue, for example: recommendations, alerts, + // etc + SecurityValues []*string `json:"securityValues,omitempty"` +} + // JitNetworkAccessPoliciesClientCreateOrUpdateOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.CreateOrUpdate // method. type JitNetworkAccessPoliciesClientCreateOrUpdateOptions struct { @@ -5708,11 +6117,67 @@ type OperationList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } +// OperationResultAutoGenerated - Long run operation status of governance rule over a given scope +type OperationResultAutoGenerated struct { + // READ-ONLY; The status of the long run operation result of governance rule + Status *OperationResult `json:"status,omitempty" azure:"ro"` +} + +// OperationStatus - A status describing the success/failure of the extension's enablement/disablement operation. +type OperationStatus struct { + // The operation status code. + Code *Code `json:"code,omitempty"` + + // Additional information regarding the success/failure of the operation. + Message *string `json:"message,omitempty"` +} + // OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters } +// Operator - Security operator under a given subscription and pricing +type Operator struct { + // Identity for the resource. + Identity *Identity `json:"identity,omitempty"` + + // READ-ONLY; Resource Id + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Resource type + Type *string `json:"type,omitempty" azure:"ro"` +} + +// OperatorList - List of SecurityOperator response. +type OperatorList struct { + // REQUIRED; List of SecurityOperator configurations + Value []*Operator `json:"value,omitempty"` +} + +// OperatorsClientCreateOrUpdateOptions contains the optional parameters for the OperatorsClient.CreateOrUpdate method. +type OperatorsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// OperatorsClientDeleteOptions contains the optional parameters for the OperatorsClient.Delete method. +type OperatorsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// OperatorsClientGetOptions contains the optional parameters for the OperatorsClient.Get method. +type OperatorsClientGetOptions struct { + // placeholder for future optional parameters +} + +// OperatorsClientListOptions contains the optional parameters for the OperatorsClient.List method. +type OperatorsClientListOptions struct { + // placeholder for future optional parameters +} + // PathRecommendation - Represents a path that is recommended to be allowed and its properties type PathRecommendation struct { // The recommendation action of the machine or rule @@ -5739,9 +6204,8 @@ type PathRecommendation struct { Usernames []*UserRecommendation `json:"usernames,omitempty"` } -// Pricing - Microsoft Defender for Cloud 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. +// Pricing - Microsoft Defender for Cloud is provided in two pricing tiers: free and standard. The standard tier offers advanced +// security capabilities, while the free tier offers basic security features. type Pricing struct { // Pricing data Properties *PricingProperties `json:"properties,omitempty"` @@ -5764,11 +6228,14 @@ type PricingList struct { // PricingProperties - Pricing properties for the relevant scope type PricingProperties struct { - // REQUIRED; The pricing tier value. Microsoft Defender for Cloud 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. + // REQUIRED; The pricing tier value. Microsoft Defender for Cloud is provided in two pricing tiers: free and standard. The + // standard tier offers advanced security capabilities, while the free tier offers basic + // security features. PricingTier *PricingTier `json:"pricingTier,omitempty"` + // Optional. List of extensions offered under a plan. + Extensions []*Extension `json:"extensions,omitempty"` + // The sub-plan selected for a Standard pricing configuration, when more than one sub-plan is available. Each sub-plan enables // a set of security features. When not specified, full plan is applied. SubPlan *string `json:"subPlan,omitempty"` @@ -5776,6 +6243,10 @@ type PricingProperties struct { // READ-ONLY; Optional. True if the plan is deprecated. If there are replacing plans they will appear in replacedBy property Deprecated *bool `json:"deprecated,omitempty" azure:"ro"` + // READ-ONLY; Optional. If pricingTier is Standard then this property holds the date of the last time the pricingTier was + // set to Standard, when available (e.g 2023-03-01T12:42:42.1921106Z). + EnablementTime *time.Time `json:"enablementTime,omitempty" azure:"ro"` + // READ-ONLY; The duration left for the subscriptions free trial period - in ISO 8601 format (e.g. P3Y6M4DT12H30M5S). FreeTrialRemainingTime *string `json:"freeTrialRemainingTime,omitempty" azure:"ro"` @@ -6205,6 +6676,18 @@ type ResourceDetails struct { // GetResourceDetails implements the ResourceDetailsClassification interface for type ResourceDetails. func (r *ResourceDetails) GetResourceDetails() *ResourceDetails { return r } +// ResourceDetailsAutoGenerated - The resource details of the health report +type ResourceDetailsAutoGenerated struct { + // The status of the health report + Source *Source `json:"source,omitempty"` + + // READ-ONLY; The id of the connector + ConnectorID *string `json:"connectorId,omitempty" azure:"ro"` + + // READ-ONLY; The azure id of the resource + ID *string `json:"id,omitempty" azure:"ro"` +} + // ResourceIdentifierClassification provides polymorphic access to related types. // Call the interface's GetResourceIdentifier() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: @@ -6392,6 +6875,9 @@ type ScanProperties struct { // Baseline created for this database, and has one or more rules. IsBaselineApplied *bool `json:"isBaselineApplied,omitempty"` + // Last scan time. + LastScanTime *time.Time `json:"lastScanTime,omitempty"` + // The number of failed rules with low severity. LowSeverityFailedRulesCount *int32 `json:"lowSeverityFailedRulesCount,omitempty"` @@ -7012,6 +7498,18 @@ type SolutionsReferenceDataProperties struct { Template *string `json:"template,omitempty"` } +// StatusAutoGenerated - The status of the health report +type StatusAutoGenerated struct { + // The status of the health report + Code *StatusName `json:"code,omitempty"` + + // READ-ONLY; The date of when the resource of the health report was scanned in the first time + FirstEvaluationDate *time.Time `json:"firstEvaluationDate,omitempty" azure:"ro"` + + // READ-ONLY; The date of when the status of the health report was changed in the last time + StatusChangeDate *time.Time `json:"statusChangeDate,omitempty" azure:"ro"` +} + // SubAssessment - Security sub-assessment on a resource type SubAssessment struct { // Describes properties of an sub-assessment. @@ -7099,13 +7597,6 @@ type SubAssessmentsClientListOptions struct { // placeholder for future optional parameters } -// SubscriptionGovernanceRulesExecuteStatusClientBeginGetOptions contains the optional parameters for the SubscriptionGovernanceRulesExecuteStatusClient.BeginGet -// method. -type SubscriptionGovernanceRulesExecuteStatusClientBeginGetOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - type SuppressionAlertsScope struct { // REQUIRED; All the conditions inside need to be true in order to suppress the alert AllOf []*ScopeElement `json:"allOf,omitempty"` diff --git a/sdk/resourcemanager/security/armsecurity/models_serde.go b/sdk/resourcemanager/security/armsecurity/models_serde.go index 9379bde20147..852af7d8d86d 100644 --- a/sdk/resourcemanager/security/armsecurity/models_serde.go +++ b/sdk/resourcemanager/security/armsecurity/models_serde.go @@ -146,6 +146,107 @@ func (a *AADSolutionProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type APICollectionProperties. +func (a APICollectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalData", a.AdditionalData) + populate(objectMap, "displayName", a.DisplayName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APICollectionProperties. +func (a *APICollectionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalData": + err = unpopulate(val, "AdditionalData", &a.AdditionalData) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type APICollectionResponse. +func (a APICollectionResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APICollectionResponse. +func (a *APICollectionResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type APICollectionResponseList. +func (a APICollectionResponseList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APICollectionResponseList. +func (a *APICollectionResponseList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ActiveConnectionsNotInAllowedRange. func (a ActiveConnectionsNotInAllowedRange) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3204,8 +3305,10 @@ func (a *AwsCredsAuthenticationDetailsProperties) UnmarshalJSON(data []byte) err // MarshalJSON implements the json.Marshaller interface for type AwsEnvironmentData. func (a AwsEnvironmentData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "accountName", a.AccountName) objectMap["environmentType"] = EnvironmentTypeAwsAccount populate(objectMap, "organizationalData", a.OrganizationalData) + populate(objectMap, "regions", a.Regions) return json.Marshal(objectMap) } @@ -3218,12 +3321,18 @@ func (a *AwsEnvironmentData) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "accountName": + err = unpopulate(val, "AccountName", &a.AccountName) + delete(rawMsg, key) case "environmentType": err = unpopulate(val, "EnvironmentType", &a.EnvironmentType) delete(rawMsg, key) case "organizationalData": a.OrganizationalData, err = unmarshalAwsOrganizationalDataClassification(val) delete(rawMsg, key) + case "regions": + err = unpopulate(val, "Regions", &a.Regions) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -4876,6 +4985,37 @@ func (c *CspmMonitorGcpOfferingNativeCloudConnection) UnmarshalJSON(data []byte) return nil } +// MarshalJSON implements the json.Marshaller interface for type CspmMonitorGitLabOffering. +func (c CspmMonitorGitLabOffering) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", c.Description) + objectMap["offeringType"] = OfferingTypeCspmMonitorGitLab + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CspmMonitorGitLabOffering. +func (c *CspmMonitorGitLabOffering) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "offeringType": + err = unpopulate(val, "OfferingType", &c.OfferingType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type CspmMonitorGithubOffering. func (c CspmMonitorGithubOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5401,6 +5541,8 @@ func (d *DataExportSettings) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DefenderCspmAwsOffering. func (d DefenderCspmAwsOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "dataSensitivityDiscovery", d.DataSensitivityDiscovery) + populate(objectMap, "databasesDspm", d.DatabasesDspm) populate(objectMap, "description", d.Description) objectMap["offeringType"] = OfferingTypeDefenderCspmAws populate(objectMap, "vmScanners", d.VMScanners) @@ -5416,6 +5558,12 @@ func (d *DefenderCspmAwsOffering) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "dataSensitivityDiscovery": + err = unpopulate(val, "DataSensitivityDiscovery", &d.DataSensitivityDiscovery) + delete(rawMsg, key) + case "databasesDspm": + err = unpopulate(val, "DatabasesDspm", &d.DatabasesDspm) + delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &d.Description) delete(rawMsg, key) @@ -5433,6 +5581,68 @@ func (d *DefenderCspmAwsOffering) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DefenderCspmAwsOfferingDataSensitivityDiscovery. +func (d DefenderCspmAwsOfferingDataSensitivityDiscovery) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cloudRoleArn", d.CloudRoleArn) + populate(objectMap, "enabled", d.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmAwsOfferingDataSensitivityDiscovery. +func (d *DefenderCspmAwsOfferingDataSensitivityDiscovery) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cloudRoleArn": + err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DefenderCspmAwsOfferingDatabasesDspm. +func (d DefenderCspmAwsOfferingDatabasesDspm) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cloudRoleArn", d.CloudRoleArn) + populate(objectMap, "enabled", d.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmAwsOfferingDatabasesDspm. +func (d *DefenderCspmAwsOfferingDatabasesDspm) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cloudRoleArn": + err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DefenderCspmAwsOfferingVMScanners. func (d DefenderCspmAwsOfferingVMScanners) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5534,6 +5744,7 @@ func (d *DefenderCspmGcpOffering) UnmarshalJSON(data []byte) error { func (d DefenderFoDatabasesAwsOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "arcAutoProvisioning", d.ArcAutoProvisioning) + populate(objectMap, "databasesDspm", d.DatabasesDspm) populate(objectMap, "description", d.Description) objectMap["offeringType"] = OfferingTypeDefenderForDatabasesAws populate(objectMap, "rds", d.Rds) @@ -5552,6 +5763,9 @@ func (d *DefenderFoDatabasesAwsOffering) UnmarshalJSON(data []byte) error { case "arcAutoProvisioning": err = unpopulate(val, "ArcAutoProvisioning", &d.ArcAutoProvisioning) delete(rawMsg, key) + case "databasesDspm": + err = unpopulate(val, "DatabasesDspm", &d.DatabasesDspm) + delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &d.Description) delete(rawMsg, key) @@ -5573,12 +5787,78 @@ func (d *DefenderFoDatabasesAwsOffering) UnmarshalJSON(data []byte) error { func (d DefenderFoDatabasesAwsOfferingArcAutoProvisioning) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) + populate(objectMap, "configuration", d.Configuration) populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } // UnmarshalJSON implements the json.Unmarshaller interface for type DefenderFoDatabasesAwsOfferingArcAutoProvisioning. func (d *DefenderFoDatabasesAwsOfferingArcAutoProvisioning) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "cloudRoleArn": + err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) + delete(rawMsg, key) + case "configuration": + err = unpopulate(val, "Configuration", &d.Configuration) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration. +func (d DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "privateLinkScope", d.PrivateLinkScope) + populate(objectMap, "proxy", d.Proxy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration. +func (d *DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "privateLinkScope": + err = unpopulate(val, "PrivateLinkScope", &d.PrivateLinkScope) + delete(rawMsg, key) + case "proxy": + err = unpopulate(val, "Proxy", &d.Proxy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DefenderFoDatabasesAwsOfferingDatabasesDspm. +func (d DefenderFoDatabasesAwsOfferingDatabasesDspm) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cloudRoleArn", d.CloudRoleArn) + populate(objectMap, "enabled", d.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderFoDatabasesAwsOfferingDatabasesDspm. +func (d *DefenderFoDatabasesAwsOfferingDatabasesDspm) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -6019,6 +6299,7 @@ func (d *DefenderForDatabasesGcpOffering) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DefenderForDatabasesGcpOfferingArcAutoProvisioning. func (d DefenderForDatabasesGcpOfferingArcAutoProvisioning) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "configuration", d.Configuration) populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } @@ -6032,6 +6313,9 @@ func (d *DefenderForDatabasesGcpOfferingArcAutoProvisioning) UnmarshalJSON(data for key, val := range rawMsg { var err error switch key { + case "configuration": + err = unpopulate(val, "Configuration", &d.Configuration) + delete(rawMsg, key) case "enabled": err = unpopulate(val, "Enabled", &d.Enabled) delete(rawMsg, key) @@ -6043,6 +6327,37 @@ func (d *DefenderForDatabasesGcpOfferingArcAutoProvisioning) UnmarshalJSON(data return nil } +// MarshalJSON implements the json.Marshaller interface for type DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration. +func (d DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "privateLinkScope", d.PrivateLinkScope) + populate(objectMap, "proxy", d.Proxy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration. +func (d *DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "privateLinkScope": + err = unpopulate(val, "PrivateLinkScope", &d.PrivateLinkScope) + delete(rawMsg, key) + case "proxy": + err = unpopulate(val, "Proxy", &d.Proxy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning. func (d DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -6105,16 +6420,47 @@ func (d *DefenderForDevOpsAzureDevOpsOffering) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForDevOpsGithubOffering. -func (d DefenderForDevOpsGithubOffering) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForDevOpsGitLabOffering. +func (d DefenderForDevOpsGitLabOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "description", d.Description) - objectMap["offeringType"] = OfferingTypeDefenderForDevOpsGithub + objectMap["offeringType"] = OfferingTypeDefenderForDevOpsGitLab return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForDevOpsGithubOffering. -func (d *DefenderForDevOpsGithubOffering) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForDevOpsGitLabOffering. +func (d *DefenderForDevOpsGitLabOffering) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "offeringType": + err = unpopulate(val, "OfferingType", &d.OfferingType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DefenderForDevOpsGithubOffering. +func (d DefenderForDevOpsGithubOffering) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", d.Description) + objectMap["offeringType"] = OfferingTypeDefenderForDevOpsGithub + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForDevOpsGithubOffering. +func (d *DefenderForDevOpsGithubOffering) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -6195,6 +6541,7 @@ func (d *DefenderForServersAwsOffering) UnmarshalJSON(data []byte) error { func (d DefenderForServersAwsOfferingArcAutoProvisioning) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) + populate(objectMap, "configuration", d.Configuration) populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } @@ -6211,6 +6558,9 @@ func (d *DefenderForServersAwsOfferingArcAutoProvisioning) UnmarshalJSON(data [] case "cloudRoleArn": err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) delete(rawMsg, key) + case "configuration": + err = unpopulate(val, "Configuration", &d.Configuration) + delete(rawMsg, key) case "enabled": err = unpopulate(val, "Enabled", &d.Enabled) delete(rawMsg, key) @@ -6222,6 +6572,37 @@ func (d *DefenderForServersAwsOfferingArcAutoProvisioning) UnmarshalJSON(data [] return nil } +// MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingArcAutoProvisioningConfiguration. +func (d DefenderForServersAwsOfferingArcAutoProvisioningConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "privateLinkScope", d.PrivateLinkScope) + populate(objectMap, "proxy", d.Proxy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersAwsOfferingArcAutoProvisioningConfiguration. +func (d *DefenderForServersAwsOfferingArcAutoProvisioningConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "privateLinkScope": + err = unpopulate(val, "PrivateLinkScope", &d.PrivateLinkScope) + delete(rawMsg, key) + case "proxy": + err = unpopulate(val, "Proxy", &d.Proxy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingDefenderForServers. func (d DefenderForServersAwsOfferingDefenderForServers) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -6440,6 +6821,7 @@ func (d DefenderForServersGcpOffering) MarshalJSON() ([]byte, error) { populate(objectMap, "mdeAutoProvisioning", d.MdeAutoProvisioning) objectMap["offeringType"] = OfferingTypeDefenderForServersGcp populate(objectMap, "subPlan", d.SubPlan) + populate(objectMap, "vmScanners", d.VMScanners) populate(objectMap, "vaAutoProvisioning", d.VaAutoProvisioning) return json.Marshal(objectMap) } @@ -6471,6 +6853,9 @@ func (d *DefenderForServersGcpOffering) UnmarshalJSON(data []byte) error { case "subPlan": err = unpopulate(val, "SubPlan", &d.SubPlan) delete(rawMsg, key) + case "vmScanners": + err = unpopulate(val, "VMScanners", &d.VMScanners) + delete(rawMsg, key) case "vaAutoProvisioning": err = unpopulate(val, "VaAutoProvisioning", &d.VaAutoProvisioning) delete(rawMsg, key) @@ -6485,6 +6870,7 @@ func (d *DefenderForServersGcpOffering) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingArcAutoProvisioning. func (d DefenderForServersGcpOfferingArcAutoProvisioning) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "configuration", d.Configuration) populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } @@ -6498,6 +6884,9 @@ func (d *DefenderForServersGcpOfferingArcAutoProvisioning) UnmarshalJSON(data [] for key, val := range rawMsg { var err error switch key { + case "configuration": + err = unpopulate(val, "Configuration", &d.Configuration) + delete(rawMsg, key) case "enabled": err = unpopulate(val, "Enabled", &d.Enabled) delete(rawMsg, key) @@ -6509,6 +6898,37 @@ func (d *DefenderForServersGcpOfferingArcAutoProvisioning) UnmarshalJSON(data [] return nil } +// MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingArcAutoProvisioningConfiguration. +func (d DefenderForServersGcpOfferingArcAutoProvisioningConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "privateLinkScope", d.PrivateLinkScope) + populate(objectMap, "proxy", d.Proxy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersGcpOfferingArcAutoProvisioningConfiguration. +func (d *DefenderForServersGcpOfferingArcAutoProvisioningConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "privateLinkScope": + err = unpopulate(val, "PrivateLinkScope", &d.PrivateLinkScope) + delete(rawMsg, key) + case "proxy": + err = unpopulate(val, "Proxy", &d.Proxy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingDefenderForServers. func (d DefenderForServersGcpOfferingDefenderForServers) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -6598,6 +7018,68 @@ func (d *DefenderForServersGcpOfferingSubPlan) UnmarshalJSON(data []byte) error return nil } +// MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingVMScanners. +func (d DefenderForServersGcpOfferingVMScanners) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "configuration", d.Configuration) + populate(objectMap, "enabled", d.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersGcpOfferingVMScanners. +func (d *DefenderForServersGcpOfferingVMScanners) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "configuration": + err = unpopulate(val, "Configuration", &d.Configuration) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingVMScannersConfiguration. +func (d DefenderForServersGcpOfferingVMScannersConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "exclusionTags", d.ExclusionTags) + populate(objectMap, "scanningMode", d.ScanningMode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersGcpOfferingVMScannersConfiguration. +func (d *DefenderForServersGcpOfferingVMScannersConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "exclusionTags": + err = unpopulate(val, "ExclusionTags", &d.ExclusionTags) + delete(rawMsg, key) + case "scanningMode": + err = unpopulate(val, "ScanningMode", &d.ScanningMode) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingVaAutoProvisioning. func (d DefenderForServersGcpOfferingVaAutoProvisioning) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -7061,6 +7543,49 @@ func (e *EnvironmentData) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type EnvironmentDetails. +func (e EnvironmentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "environmentHierarchyId", e.EnvironmentHierarchyID) + populate(objectMap, "nativeResourceId", e.NativeResourceID) + populate(objectMap, "organizationalHierarchyId", e.OrganizationalHierarchyID) + populate(objectMap, "subscriptionId", e.SubscriptionID) + populate(objectMap, "tenantId", e.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentDetails. +func (e *EnvironmentDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "environmentHierarchyId": + err = unpopulate(val, "EnvironmentHierarchyID", &e.EnvironmentHierarchyID) + delete(rawMsg, key) + case "nativeResourceId": + err = unpopulate(val, "NativeResourceID", &e.NativeResourceID) + delete(rawMsg, key) + case "organizationalHierarchyId": + err = unpopulate(val, "OrganizationalHierarchyID", &e.OrganizationalHierarchyID) + delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &e.SubscriptionID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &e.TenantID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -7092,6 +7617,146 @@ func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorDetailAutoGenerated. +func (e ErrorDetailAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetailAutoGenerated. +func (e *ErrorDetailAutoGenerated) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. +func (e *ErrorResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &e.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponseAutoGenerated. +func (e ErrorResponseAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseAutoGenerated. +func (e *ErrorResponseAutoGenerated) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &e.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ExecuteGovernanceRuleParams. func (e ExecuteGovernanceRuleParams) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -7119,15 +7784,18 @@ func (e *ExecuteGovernanceRuleParams) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ExecuteRuleStatus. -func (e ExecuteRuleStatus) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Extension. +func (e Extension) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "operationId", e.OperationID) + populate(objectMap, "additionalExtensionProperties", e.AdditionalExtensionProperties) + populate(objectMap, "isEnabled", e.IsEnabled) + populate(objectMap, "name", e.Name) + populate(objectMap, "operationStatus", e.OperationStatus) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExecuteRuleStatus. -func (e *ExecuteRuleStatus) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Extension. +func (e *Extension) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -7135,8 +7803,17 @@ func (e *ExecuteRuleStatus) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "operationId": - err = unpopulate(val, "OperationID", &e.OperationID) + case "additionalExtensionProperties": + err = unpopulate(val, "AdditionalExtensionProperties", &e.AdditionalExtensionProperties) + delete(rawMsg, key) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &e.IsEnabled) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "operationStatus": + err = unpopulate(val, "OperationStatus", &e.OperationStatus) delete(rawMsg, key) } if err != nil { @@ -7545,6 +8222,7 @@ func (g GcpOrganizationalDataOrganization) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "excludedProjectNumbers", g.ExcludedProjectNumbers) objectMap["organizationMembershipType"] = OrganizationMembershipTypeOrganization + populate(objectMap, "organizationName", g.OrganizationName) populate(objectMap, "serviceAccountEmailAddress", g.ServiceAccountEmailAddress) populate(objectMap, "workloadIdentityProviderId", g.WorkloadIdentityProviderID) return json.Marshal(objectMap) @@ -7565,6 +8243,9 @@ func (g *GcpOrganizationalDataOrganization) UnmarshalJSON(data []byte) error { case "organizationMembershipType": err = unpopulate(val, "OrganizationMembershipType", &g.OrganizationMembershipType) delete(rawMsg, key) + case "organizationName": + err = unpopulate(val, "OrganizationName", &g.OrganizationName) + delete(rawMsg, key) case "serviceAccountEmailAddress": err = unpopulate(val, "ServiceAccountEmailAddress", &g.ServiceAccountEmailAddress) delete(rawMsg, key) @@ -7583,6 +8264,7 @@ func (g *GcpOrganizationalDataOrganization) UnmarshalJSON(data []byte) error { func (g GcpProjectDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "projectId", g.ProjectID) + populate(objectMap, "projectName", g.ProjectName) populate(objectMap, "projectNumber", g.ProjectNumber) populate(objectMap, "workloadIdentityPoolId", g.WorkloadIdentityPoolID) return json.Marshal(objectMap) @@ -7600,6 +8282,9 @@ func (g *GcpProjectDetails) UnmarshalJSON(data []byte) error { case "projectId": err = unpopulate(val, "ProjectID", &g.ProjectID) delete(rawMsg, key) + case "projectName": + err = unpopulate(val, "ProjectName", &g.ProjectName) + delete(rawMsg, key) case "projectNumber": err = unpopulate(val, "ProjectNumber", &g.ProjectNumber) delete(rawMsg, key) @@ -7676,6 +8361,33 @@ func (g *GithubScopeEnvironmentData) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type GitlabScopeEnvironmentData. +func (g GitlabScopeEnvironmentData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["environmentType"] = EnvironmentTypeGitlabScope + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GitlabScopeEnvironmentData. +func (g *GitlabScopeEnvironmentData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "environmentType": + err = unpopulate(val, "EnvironmentType", &g.EnvironmentType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type GovernanceAssignment. func (g GovernanceAssignment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -7960,6 +8672,45 @@ func (g *GovernanceRuleList) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type GovernanceRuleMetadata. +func (g GovernanceRuleMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "createdBy", g.CreatedBy) + populateTimeRFC3339(objectMap, "createdOn", g.CreatedOn) + populate(objectMap, "updatedBy", g.UpdatedBy) + populateTimeRFC3339(objectMap, "updatedOn", g.UpdatedOn) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GovernanceRuleMetadata. +func (g *GovernanceRuleMetadata) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdBy": + err = unpopulate(val, "CreatedBy", &g.CreatedBy) + delete(rawMsg, key) + case "createdOn": + err = unpopulateTimeRFC3339(val, "CreatedOn", &g.CreatedOn) + delete(rawMsg, key) + case "updatedBy": + err = unpopulate(val, "UpdatedBy", &g.UpdatedBy) + delete(rawMsg, key) + case "updatedOn": + err = unpopulateTimeRFC3339(val, "UpdatedOn", &g.UpdatedOn) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type GovernanceRuleOwnerSource. func (g GovernanceRuleOwnerSource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -7997,14 +8748,18 @@ func (g GovernanceRuleProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "conditionSets", g.ConditionSets) populate(objectMap, "description", g.Description) populate(objectMap, "displayName", g.DisplayName) + populate(objectMap, "excludedScopes", g.ExcludedScopes) populate(objectMap, "governanceEmailNotification", g.GovernanceEmailNotification) + populate(objectMap, "includeMemberScopes", g.IncludeMemberScopes) populate(objectMap, "isDisabled", g.IsDisabled) populate(objectMap, "isGracePeriod", g.IsGracePeriod) + populate(objectMap, "metadata", g.Metadata) populate(objectMap, "ownerSource", g.OwnerSource) populate(objectMap, "remediationTimeframe", g.RemediationTimeframe) populate(objectMap, "rulePriority", g.RulePriority) populate(objectMap, "ruleType", g.RuleType) populate(objectMap, "sourceResourceType", g.SourceResourceType) + populate(objectMap, "tenantId", g.TenantID) return json.Marshal(objectMap) } @@ -8026,15 +8781,24 @@ func (g *GovernanceRuleProperties) UnmarshalJSON(data []byte) error { case "displayName": err = unpopulate(val, "DisplayName", &g.DisplayName) delete(rawMsg, key) + case "excludedScopes": + err = unpopulate(val, "ExcludedScopes", &g.ExcludedScopes) + delete(rawMsg, key) case "governanceEmailNotification": err = unpopulate(val, "GovernanceEmailNotification", &g.GovernanceEmailNotification) delete(rawMsg, key) + case "includeMemberScopes": + err = unpopulate(val, "IncludeMemberScopes", &g.IncludeMemberScopes) + delete(rawMsg, key) case "isDisabled": err = unpopulate(val, "IsDisabled", &g.IsDisabled) delete(rawMsg, key) case "isGracePeriod": err = unpopulate(val, "IsGracePeriod", &g.IsGracePeriod) delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &g.Metadata) + delete(rawMsg, key) case "ownerSource": err = unpopulate(val, "OwnerSource", &g.OwnerSource) delete(rawMsg, key) @@ -8050,6 +8814,9 @@ func (g *GovernanceRuleProperties) UnmarshalJSON(data []byte) error { case "sourceResourceType": err = unpopulate(val, "SourceResourceType", &g.SourceResourceType) delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &g.TenantID) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) @@ -8131,26 +8898,198 @@ func (h *HTTPC2DRejectedMessagesNotInAllowedRange) UnmarshalJSON(data []byte) er for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &h.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &h.DisplayName) + case "description": + err = unpopulate(val, "Description", &h.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &h.DisplayName) + delete(rawMsg, key) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &h.IsEnabled) + delete(rawMsg, key) + case "maxThreshold": + err = unpopulate(val, "MaxThreshold", &h.MaxThreshold) + delete(rawMsg, key) + case "minThreshold": + err = unpopulate(val, "MinThreshold", &h.MinThreshold) + delete(rawMsg, key) + case "ruleType": + err = unpopulate(val, "RuleType", &h.RuleType) + delete(rawMsg, key) + case "timeWindowSize": + err = unpopulate(val, "TimeWindowSize", &h.TimeWindowSize) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HTTPD2CMessagesNotInAllowedRange. +func (h HTTPD2CMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", h.Description) + populate(objectMap, "displayName", h.DisplayName) + populate(objectMap, "isEnabled", h.IsEnabled) + populate(objectMap, "maxThreshold", h.MaxThreshold) + populate(objectMap, "minThreshold", h.MinThreshold) + objectMap["ruleType"] = "HttpD2CMessagesNotInAllowedRange" + populate(objectMap, "timeWindowSize", h.TimeWindowSize) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPD2CMessagesNotInAllowedRange. +func (h *HTTPD2CMessagesNotInAllowedRange) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &h.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &h.DisplayName) + delete(rawMsg, key) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &h.IsEnabled) + delete(rawMsg, key) + case "maxThreshold": + err = unpopulate(val, "MaxThreshold", &h.MaxThreshold) + delete(rawMsg, key) + case "minThreshold": + err = unpopulate(val, "MinThreshold", &h.MinThreshold) + delete(rawMsg, key) + case "ruleType": + err = unpopulate(val, "RuleType", &h.RuleType) + delete(rawMsg, key) + case "timeWindowSize": + err = unpopulate(val, "TimeWindowSize", &h.TimeWindowSize) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HealthDataClassification. +func (h HealthDataClassification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "component", h.Component) + populate(objectMap, "scenario", h.Scenario) + populate(objectMap, "scope", h.Scope) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HealthDataClassification. +func (h *HealthDataClassification) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "component": + err = unpopulate(val, "Component", &h.Component) + delete(rawMsg, key) + case "scenario": + err = unpopulate(val, "Scenario", &h.Scenario) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &h.Scope) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HealthReport. +func (h HealthReport) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", h.ID) + populate(objectMap, "name", h.Name) + populate(objectMap, "properties", h.Properties) + populate(objectMap, "type", h.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HealthReport. +func (h *HealthReport) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &h.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &h.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &h.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &h.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HealthReportProperties. +func (h HealthReportProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "affectedDefendersPlans", h.AffectedDefendersPlans) + populate(objectMap, "environmentDetails", h.EnvironmentDetails) + populate(objectMap, "healthDataClassification", h.HealthDataClassification) + populate(objectMap, "issues", h.Issues) + populate(objectMap, "resourceDetails", h.ResourceDetails) + populate(objectMap, "status", h.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HealthReportProperties. +func (h *HealthReportProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "affectedDefendersPlans": + err = unpopulate(val, "AffectedDefendersPlans", &h.AffectedDefendersPlans) delete(rawMsg, key) - case "isEnabled": - err = unpopulate(val, "IsEnabled", &h.IsEnabled) + case "environmentDetails": + err = unpopulate(val, "EnvironmentDetails", &h.EnvironmentDetails) delete(rawMsg, key) - case "maxThreshold": - err = unpopulate(val, "MaxThreshold", &h.MaxThreshold) + case "healthDataClassification": + err = unpopulate(val, "HealthDataClassification", &h.HealthDataClassification) delete(rawMsg, key) - case "minThreshold": - err = unpopulate(val, "MinThreshold", &h.MinThreshold) + case "issues": + err = unpopulate(val, "Issues", &h.Issues) delete(rawMsg, key) - case "ruleType": - err = unpopulate(val, "RuleType", &h.RuleType) + case "resourceDetails": + err = unpopulate(val, "ResourceDetails", &h.ResourceDetails) delete(rawMsg, key) - case "timeWindowSize": - err = unpopulate(val, "TimeWindowSize", &h.TimeWindowSize) + case "status": + err = unpopulate(val, "Status", &h.Status) delete(rawMsg, key) } if err != nil { @@ -8160,21 +9099,16 @@ func (h *HTTPC2DRejectedMessagesNotInAllowedRange) UnmarshalJSON(data []byte) er return nil } -// MarshalJSON implements the json.Marshaller interface for type HTTPD2CMessagesNotInAllowedRange. -func (h HTTPD2CMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type HealthReportsList. +func (h HealthReportsList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", h.Description) - populate(objectMap, "displayName", h.DisplayName) - populate(objectMap, "isEnabled", h.IsEnabled) - populate(objectMap, "maxThreshold", h.MaxThreshold) - populate(objectMap, "minThreshold", h.MinThreshold) - objectMap["ruleType"] = "HttpD2CMessagesNotInAllowedRange" - populate(objectMap, "timeWindowSize", h.TimeWindowSize) + populate(objectMap, "nextLink", h.NextLink) + populate(objectMap, "value", h.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPD2CMessagesNotInAllowedRange. -func (h *HTTPD2CMessagesNotInAllowedRange) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type HealthReportsList. +func (h *HealthReportsList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", h, err) @@ -8182,26 +9116,11 @@ func (h *HTTPD2CMessagesNotInAllowedRange) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &h.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &h.DisplayName) - delete(rawMsg, key) - case "isEnabled": - err = unpopulate(val, "IsEnabled", &h.IsEnabled) - delete(rawMsg, key) - case "maxThreshold": - err = unpopulate(val, "MaxThreshold", &h.MaxThreshold) - delete(rawMsg, key) - case "minThreshold": - err = unpopulate(val, "MinThreshold", &h.MinThreshold) - delete(rawMsg, key) - case "ruleType": - err = unpopulate(val, "RuleType", &h.RuleType) + case "nextLink": + err = unpopulate(val, "NextLink", &h.NextLink) delete(rawMsg, key) - case "timeWindowSize": - err = unpopulate(val, "TimeWindowSize", &h.TimeWindowSize) + case "value": + err = unpopulate(val, "Value", &h.Value) delete(rawMsg, key) } if err != nil { @@ -8258,6 +9177,41 @@ func (h *HybridComputeSettingsProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type Identity. +func (i Identity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "principalId", i.PrincipalID) + populate(objectMap, "tenantId", i.TenantID) + objectMap["type"] = "SystemAssigned" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Identity. +func (i *Identity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &i.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &i.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type InformationProtectionAwsOffering. func (i InformationProtectionAwsOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -9401,6 +10355,57 @@ func (i *IoTSeverityMetrics) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type Issue. +func (i Issue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "issueAdditionalData", i.IssueAdditionalData) + populate(objectMap, "issueDescription", i.IssueDescription) + populate(objectMap, "issueKey", i.IssueKey) + populate(objectMap, "issueName", i.IssueName) + populate(objectMap, "remediationScript", i.RemediationScript) + populate(objectMap, "remediationSteps", i.RemediationSteps) + populate(objectMap, "securityValues", i.SecurityValues) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Issue. +func (i *Issue) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "issueAdditionalData": + err = unpopulate(val, "IssueAdditionalData", &i.IssueAdditionalData) + delete(rawMsg, key) + case "issueDescription": + err = unpopulate(val, "IssueDescription", &i.IssueDescription) + delete(rawMsg, key) + case "issueKey": + err = unpopulate(val, "IssueKey", &i.IssueKey) + delete(rawMsg, key) + case "issueName": + err = unpopulate(val, "IssueName", &i.IssueName) + delete(rawMsg, key) + case "remediationScript": + err = unpopulate(val, "RemediationScript", &i.RemediationScript) + delete(rawMsg, key) + case "remediationSteps": + err = unpopulate(val, "RemediationSteps", &i.RemediationSteps) + delete(rawMsg, key) + case "securityValues": + err = unpopulate(val, "SecurityValues", &i.SecurityValues) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type JitNetworkAccessPoliciesList. func (j JitNetworkAccessPoliciesList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -10446,6 +11451,130 @@ func (o *OperationList) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type OperationResultAutoGenerated. +func (o OperationResultAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "status", o.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultAutoGenerated. +func (o *OperationResultAutoGenerated) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "status": + err = unpopulate(val, "Status", &o.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationStatus. +func (o OperationStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", o.Code) + populate(objectMap, "message", o.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatus. +func (o *OperationStatus) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &o.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &o.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Operator. +func (o Operator) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", o.ID) + populate(objectMap, "identity", o.Identity) + populate(objectMap, "name", o.Name) + populate(objectMap, "type", o.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operator. +func (o *Operator) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &o.Identity) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &o.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperatorList. +func (o OperatorList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperatorList. +func (o *OperatorList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type PathRecommendation. func (p PathRecommendation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -10575,6 +11704,8 @@ func (p *PricingList) UnmarshalJSON(data []byte) error { func (p PricingProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "deprecated", p.Deprecated) + populateTimeRFC3339(objectMap, "enablementTime", p.EnablementTime) + populate(objectMap, "extensions", p.Extensions) populate(objectMap, "freeTrialRemainingTime", p.FreeTrialRemainingTime) populate(objectMap, "pricingTier", p.PricingTier) populate(objectMap, "replacedBy", p.ReplacedBy) @@ -10594,6 +11725,12 @@ func (p *PricingProperties) UnmarshalJSON(data []byte) error { case "deprecated": err = unpopulate(val, "Deprecated", &p.Deprecated) delete(rawMsg, key) + case "enablementTime": + err = unpopulateTimeRFC3339(val, "EnablementTime", &p.EnablementTime) + delete(rawMsg, key) + case "extensions": + err = unpopulate(val, "Extensions", &p.Extensions) + delete(rawMsg, key) case "freeTrialRemainingTime": err = unpopulate(val, "FreeTrialRemainingTime", &p.FreeTrialRemainingTime) delete(rawMsg, key) @@ -11374,6 +12511,41 @@ func (r *ResourceDetails) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ResourceDetailsAutoGenerated. +func (r ResourceDetailsAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectorId", r.ConnectorID) + populate(objectMap, "id", r.ID) + populate(objectMap, "source", r.Source) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceDetailsAutoGenerated. +func (r *ResourceDetailsAutoGenerated) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "connectorId": + err = unpopulate(val, "ConnectorID", &r.ConnectorID) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &r.Source) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ResourceIdentifier. func (r ResourceIdentifier) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -11680,6 +12852,7 @@ func (s ScanProperties) MarshalJSON() ([]byte, error) { populateTimeRFC3339(objectMap, "endTime", s.EndTime) populate(objectMap, "highSeverityFailedRulesCount", s.HighSeverityFailedRulesCount) populate(objectMap, "isBaselineApplied", s.IsBaselineApplied) + populateTimeRFC3339(objectMap, "lastScanTime", s.LastScanTime) populate(objectMap, "lowSeverityFailedRulesCount", s.LowSeverityFailedRulesCount) populate(objectMap, "mediumSeverityFailedRulesCount", s.MediumSeverityFailedRulesCount) populate(objectMap, "sqlVersion", s.SQLVersion) @@ -11714,6 +12887,9 @@ func (s *ScanProperties) UnmarshalJSON(data []byte) error { case "isBaselineApplied": err = unpopulate(val, "IsBaselineApplied", &s.IsBaselineApplied) delete(rawMsg, key) + case "lastScanTime": + err = unpopulateTimeRFC3339(val, "LastScanTime", &s.LastScanTime) + delete(rawMsg, key) case "lowSeverityFailedRulesCount": err = unpopulate(val, "LowSeverityFailedRulesCount", &s.LowSeverityFailedRulesCount) delete(rawMsg, key) @@ -13029,6 +14205,41 @@ func (s *SolutionsReferenceDataProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type StatusAutoGenerated. +func (s StatusAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", s.Code) + populateTimeRFC3339(objectMap, "firstEvaluationDate", s.FirstEvaluationDate) + populateTimeRFC3339(objectMap, "statusChangeDate", s.StatusChangeDate) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StatusAutoGenerated. +func (s *StatusAutoGenerated) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &s.Code) + delete(rawMsg, key) + case "firstEvaluationDate": + err = unpopulateTimeRFC3339(val, "FirstEvaluationDate", &s.FirstEvaluationDate) + delete(rawMsg, key) + case "statusChangeDate": + err = unpopulateTimeRFC3339(val, "StatusChangeDate", &s.StatusChangeDate) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type SubAssessment. func (s SubAssessment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/security/armsecurity/operators_client.go b/sdk/resourcemanager/security/armsecurity/operators_client.go new file mode 100644 index 000000000000..18e00bde10d7 --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/operators_client.go @@ -0,0 +1,260 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armsecurity + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// OperatorsClient contains the methods for the SecurityOperators group. +// Don't use this type directly, use NewOperatorsClient() instead. +type OperatorsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewOperatorsClient creates a new instance of OperatorsClient with the specified values. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewOperatorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OperatorsClient, error) { + cl, err := arm.NewClient(moduleName+".OperatorsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &OperatorsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates Microsoft Defender for Cloud security operator on the given scope. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01-preview +// - pricingName - name of the pricing configuration +// - securityOperatorName - name of the securityOperator +// - options - OperatorsClientCreateOrUpdateOptions contains the optional parameters for the OperatorsClient.CreateOrUpdate +// method. +func (client *OperatorsClient) CreateOrUpdate(ctx context.Context, pricingName string, securityOperatorName string, options *OperatorsClientCreateOrUpdateOptions) (OperatorsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, pricingName, securityOperatorName, options) + if err != nil { + return OperatorsClientCreateOrUpdateResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return OperatorsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OperatorsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *OperatorsClient) createOrUpdateCreateRequest(ctx context.Context, pricingName string, securityOperatorName string, options *OperatorsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators/{securityOperatorName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if pricingName == "" { + return nil, errors.New("parameter pricingName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{pricingName}", url.PathEscape(pricingName)) + if securityOperatorName == "" { + return nil, errors.New("parameter securityOperatorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityOperatorName}", url.PathEscape(securityOperatorName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *OperatorsClient) createOrUpdateHandleResponse(resp *http.Response) (OperatorsClientCreateOrUpdateResponse, error) { + result := OperatorsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Operator); err != nil { + return OperatorsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete Microsoft Defender for Cloud securityOperator in the subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01-preview +// - pricingName - name of the pricing configuration +// - securityOperatorName - name of the securityOperator +// - options - OperatorsClientDeleteOptions contains the optional parameters for the OperatorsClient.Delete method. +func (client *OperatorsClient) Delete(ctx context.Context, pricingName string, securityOperatorName string, options *OperatorsClientDeleteOptions) (OperatorsClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, pricingName, securityOperatorName, options) + if err != nil { + return OperatorsClientDeleteResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return OperatorsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return OperatorsClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return OperatorsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *OperatorsClient) deleteCreateRequest(ctx context.Context, pricingName string, securityOperatorName string, options *OperatorsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators/{securityOperatorName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if pricingName == "" { + return nil, errors.New("parameter pricingName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{pricingName}", url.PathEscape(pricingName)) + if securityOperatorName == "" { + return nil, errors.New("parameter securityOperatorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityOperatorName}", url.PathEscape(securityOperatorName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a specific security operator for the requested scope. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01-preview +// - pricingName - name of the pricing configuration +// - securityOperatorName - name of the securityOperator +// - options - OperatorsClientGetOptions contains the optional parameters for the OperatorsClient.Get method. +func (client *OperatorsClient) Get(ctx context.Context, pricingName string, securityOperatorName string, options *OperatorsClientGetOptions) (OperatorsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, pricingName, securityOperatorName, options) + if err != nil { + return OperatorsClientGetResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return OperatorsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OperatorsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *OperatorsClient) getCreateRequest(ctx context.Context, pricingName string, securityOperatorName string, options *OperatorsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators/{securityOperatorName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if pricingName == "" { + return nil, errors.New("parameter pricingName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{pricingName}", url.PathEscape(pricingName)) + if securityOperatorName == "" { + return nil, errors.New("parameter securityOperatorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityOperatorName}", url.PathEscape(securityOperatorName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *OperatorsClient) getHandleResponse(resp *http.Response) (OperatorsClientGetResponse, error) { + result := OperatorsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Operator); err != nil { + return OperatorsClientGetResponse{}, err + } + return result, nil +} + +// List - Lists Microsoft Defender for Cloud securityOperators in the subscription. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-01-01-preview +// - pricingName - name of the pricing configuration +// - options - OperatorsClientListOptions contains the optional parameters for the OperatorsClient.List method. +func (client *OperatorsClient) List(ctx context.Context, pricingName string, options *OperatorsClientListOptions) (OperatorsClientListResponse, error) { + req, err := client.listCreateRequest(ctx, pricingName, options) + if err != nil { + return OperatorsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return OperatorsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return OperatorsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) +} + +// listCreateRequest creates the List request. +func (client *OperatorsClient) listCreateRequest(ctx context.Context, pricingName string, options *OperatorsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if pricingName == "" { + return nil, errors.New("parameter pricingName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{pricingName}", url.PathEscape(pricingName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *OperatorsClient) listHandleResponse(resp *http.Response) (OperatorsClientListResponse, error) { + result := OperatorsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OperatorList); err != nil { + return OperatorsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/polymorphic_helpers.go b/sdk/resourcemanager/security/armsecurity/polymorphic_helpers.go index 47c247b3bf3c..fd445fd35bcd 100644 --- a/sdk/resourcemanager/security/armsecurity/polymorphic_helpers.go +++ b/sdk/resourcemanager/security/armsecurity/polymorphic_helpers.go @@ -193,6 +193,8 @@ func unmarshalCloudOfferingClassification(rawMsg json.RawMessage) (CloudOffering b = &CspmMonitorAzureDevOpsOffering{} case string(OfferingTypeCspmMonitorGcp): b = &CspmMonitorGcpOffering{} + case string(OfferingTypeCspmMonitorGitLab): + b = &CspmMonitorGitLabOffering{} case string(OfferingTypeCspmMonitorGithub): b = &CspmMonitorGithubOffering{} case string(OfferingTypeDefenderCspmAws): @@ -209,6 +211,8 @@ func unmarshalCloudOfferingClassification(rawMsg json.RawMessage) (CloudOffering b = &DefenderForDatabasesGcpOffering{} case string(OfferingTypeDefenderForDevOpsAzureDevOps): b = &DefenderForDevOpsAzureDevOpsOffering{} + case string(OfferingTypeDefenderForDevOpsGitLab): + b = &DefenderForDevOpsGitLabOffering{} case string(OfferingTypeDefenderForDevOpsGithub): b = &DefenderForDevOpsGithubOffering{} case string(OfferingTypeDefenderForServersAws): @@ -260,6 +264,8 @@ func unmarshalEnvironmentDataClassification(rawMsg json.RawMessage) (Environment b = &GcpProjectEnvironmentData{} case string(EnvironmentTypeGithubScope): b = &GithubScopeEnvironmentData{} + case string(EnvironmentTypeGitlabScope): + b = &GitlabScopeEnvironmentData{} default: b = &EnvironmentData{} } diff --git a/sdk/resourcemanager/security/armsecurity/pricings_client.go b/sdk/resourcemanager/security/armsecurity/pricings_client.go index 50d5bf643b9c..2c5bada66914 100644 --- a/sdk/resourcemanager/security/armsecurity/pricings_client.go +++ b/sdk/resourcemanager/security/armsecurity/pricings_client.go @@ -47,7 +47,7 @@ func NewPricingsClient(subscriptionID string, credential azcore.TokenCredential, // Get - Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-01 +// Generated from API version 2023-01-01 // - pricingName - name of the pricing configuration // - options - PricingsClientGetOptions contains the optional parameters for the PricingsClient.Get method. func (client *PricingsClient) Get(ctx context.Context, pricingName string, options *PricingsClientGetOptions) (PricingsClientGetResponse, error) { @@ -81,7 +81,7 @@ func (client *PricingsClient) getCreateRequest(ctx context.Context, pricingName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -99,7 +99,7 @@ func (client *PricingsClient) getHandleResponse(resp *http.Response) (PricingsCl // List - Lists Microsoft Defender for Cloud pricing configurations in the subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-01 +// Generated from API version 2023-01-01 // - options - PricingsClientListOptions contains the optional parameters for the PricingsClient.List method. func (client *PricingsClient) List(ctx context.Context, options *PricingsClientListOptions) (PricingsClientListResponse, error) { req, err := client.listCreateRequest(ctx, options) @@ -128,7 +128,7 @@ func (client *PricingsClient) listCreateRequest(ctx context.Context, options *Pr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -146,7 +146,7 @@ func (client *PricingsClient) listHandleResponse(resp *http.Response) (PricingsC // Update - Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-03-01 +// Generated from API version 2023-01-01 // - pricingName - name of the pricing configuration // - pricing - Pricing object // - options - PricingsClientUpdateOptions contains the optional parameters for the PricingsClient.Update method. @@ -181,7 +181,7 @@ func (client *PricingsClient) updateCreateRequest(ctx context.Context, pricingNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-03-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, pricing) diff --git a/sdk/resourcemanager/security/armsecurity/pricings_client_example_test.go b/sdk/resourcemanager/security/armsecurity/pricings_client_example_test.go deleted file mode 100644 index 7df953fbec8f..000000000000 --- a/sdk/resourcemanager/security/armsecurity/pricings_client_example_test.go +++ /dev/null @@ -1,223 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2022-03-01/examples/Pricings/ListPricings_example.json -func ExamplePricingsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPricingsClient().List(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PricingList = armsecurity.PricingList{ - // Value: []*armsecurity.Pricing{ - // { - // Name: to.Ptr("VirtualMachines"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/VirtualMachines"), - // Properties: &armsecurity.PricingProperties{ - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // SubPlan: to.Ptr("P2"), - // }, - // }, - // { - // Name: to.Ptr("SqlServers"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/SqlServers"), - // Properties: &armsecurity.PricingProperties{ - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // }, - // }, - // { - // Name: to.Ptr("AppServices"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/AppServices"), - // Properties: &armsecurity.PricingProperties{ - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierFree), - // }, - // }, - // { - // Name: to.Ptr("StorageAccounts"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/StorageAccounts"), - // Properties: &armsecurity.PricingProperties{ - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // SubPlan: to.Ptr("PerStorageAccount"), - // }, - // }, - // { - // Name: to.Ptr("SqlServerVirtualMachines"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/SqlServerVirtualMachines"), - // Properties: &armsecurity.PricingProperties{ - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // }, - // }, - // { - // Name: to.Ptr("KubernetesService"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/KubernetesService"), - // Properties: &armsecurity.PricingProperties{ - // Deprecated: to.Ptr(true), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierFree), - // ReplacedBy: []*string{ - // to.Ptr("Containers")}, - // }, - // }, - // { - // Name: to.Ptr("ContainerRegistry"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/ContainerRegistry"), - // Properties: &armsecurity.PricingProperties{ - // Deprecated: to.Ptr(true), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierFree), - // ReplacedBy: []*string{ - // to.Ptr("Containers")}, - // }, - // }, - // { - // Name: to.Ptr("KeyVaults"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/KeyVaults"), - // Properties: &armsecurity.PricingProperties{ - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // }, - // }, - // { - // Name: to.Ptr("Dns"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/Dns"), - // Properties: &armsecurity.PricingProperties{ - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // }, - // }, - // { - // Name: to.Ptr("Arm"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/Arm"), - // Properties: &armsecurity.PricingProperties{ - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // }, - // }, - // { - // Name: to.Ptr("OpenSourceRelationalDatabases"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/OpenSourceRelationalDatabases"), - // Properties: &armsecurity.PricingProperties{ - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierFree), - // }, - // }, - // { - // Name: to.Ptr("Containers"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/Containers"), - // Properties: &armsecurity.PricingProperties{ - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2022-03-01/examples/Pricings/GetPricingByName_example.json -func ExamplePricingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPricingsClient().Get(ctx, "VirtualMachines", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Pricing = armsecurity.Pricing{ - // Name: to.Ptr("VirtualMachines"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/VirtualMachines"), - // Properties: &armsecurity.PricingProperties{ - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // SubPlan: to.Ptr("P1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2022-03-01/examples/Pricings/PutPricingByName_example.json -func ExamplePricingsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPricingsClient().Update(ctx, "VirtualMachines", armsecurity.Pricing{ - Properties: &armsecurity.PricingProperties{ - PricingTier: to.Ptr(armsecurity.PricingTierStandard), - SubPlan: to.Ptr("P2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Pricing = armsecurity.Pricing{ - // Name: to.Ptr("VirtualMachines"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/VirtualMachines"), - // Properties: &armsecurity.PricingProperties{ - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // SubPlan: to.Ptr("P2"), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/regulatorycomplianceassessments_client_example_test.go b/sdk/resourcemanager/security/armsecurity/regulatorycomplianceassessments_client_example_test.go deleted file mode 100644 index 7bc1511a282a..000000000000 --- a/sdk/resourcemanager/security/armsecurity/regulatorycomplianceassessments_client_example_test.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceAssessmentList_example.json -func ExampleRegulatoryComplianceAssessmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRegulatoryComplianceAssessmentsClient().NewListPager("PCI-DSS-3.2", "1.1", &armsecurity.RegulatoryComplianceAssessmentsClientListOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RegulatoryComplianceAssessmentList = armsecurity.RegulatoryComplianceAssessmentList{ - // Value: []*armsecurity.RegulatoryComplianceAssessment{ - // { - // Name: to.Ptr("968548cb-02b3-8cd2-11f8-0cf64ab1a347"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceAssessment"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/PCI-DSS-3.2/regulatoryComplianceControls/1.1/regulatoryComplianceAssessments/968548cb-02b3-8cd2-11f8-0cf64ab1a347"), - // Properties: &armsecurity.RegulatoryComplianceAssessmentProperties{ - // Description: to.Ptr("Troubleshoot missing scan data on your machines"), - // AssessmentDetailsLink: to.Ptr("https://management.azure.com/subscriptions/a27e854a-8578-4395-8eaf-6fc7849f3050/providers/Microsoft.Security/securityStatuses/968548cb-02b3-8cd2-11f8-0cf64ab1a347"), - // AssessmentType: to.Ptr("Assessment"), - // FailedResources: to.Ptr[int32](4), - // PassedResources: to.Ptr[int32](7), - // SkippedResources: to.Ptr[int32](0), - // State: to.Ptr(armsecurity.StateFailed), - // }, - // }, - // { - // Name: to.Ptr("3bcd234d-c9c7-c2a2-89e0-c01f419c1a8a"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceAssessment"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/PCI-DSS-3.2/regulatoryComplianceControls/2/regulatoryComplianceAssessments/3bcd234d-c9c7-c2a2-89e0-c01f419c1a8a"), - // Properties: &armsecurity.RegulatoryComplianceAssessmentProperties{ - // Description: to.Ptr("Resolve endpoint protection health issues on your machines"), - // AssessmentDetailsLink: to.Ptr("https://management.azure.com/subscriptions/a27e854a-8578-4395-8eaf-6fc7849f3050/providers/Microsoft.Security/securityStatuses/3bcd234d-c9c7-c2a2-89e0-c01f419c1a8a"), - // AssessmentType: to.Ptr("Assessment"), - // FailedResources: to.Ptr[int32](0), - // PassedResources: to.Ptr[int32](0), - // SkippedResources: to.Ptr[int32](10), - // State: to.Ptr(armsecurity.StateSkipped), - // }, - // }, - // { - // Name: to.Ptr("d1db3318-01ff-16de-29eb-28b344515626"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceAssessment"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/PCI-DSS-3.2/regulatoryComplianceControls/2.1/regulatoryComplianceAssessments/d1db3318-01ff-16de-29eb-28b344515626"), - // Properties: &armsecurity.RegulatoryComplianceAssessmentProperties{ - // Description: to.Ptr("Install monitoring agent on your machines"), - // AssessmentDetailsLink: to.Ptr("https://management.azure.com/subscriptions/a27e854a-8578-4395-8eaf-6fc7849f3050/providers/Microsoft.Security/securityStatuses/d1db3318-01ff-16de-29eb-28b344515626"), - // AssessmentType: to.Ptr("Assessment"), - // FailedResources: to.Ptr[int32](0), - // PassedResources: to.Ptr[int32](8), - // SkippedResources: to.Ptr[int32](0), - // State: to.Ptr(armsecurity.StatePassed), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceAssessment_example.json -func ExampleRegulatoryComplianceAssessmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegulatoryComplianceAssessmentsClient().Get(ctx, "PCI-DSS-3.2", "1.1", "968548cb-02b3-8cd2-11f8-0cf64ab1a347", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RegulatoryComplianceAssessment = armsecurity.RegulatoryComplianceAssessment{ - // Name: to.Ptr("968548cb-02b3-8cd2-11f8-0cf64ab1a347"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceAssessment"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/PCI-DSS-3.2/regulatoryComplianceControls/1.1/regulatoryComplianceAssessments/968548cb-02b3-8cd2-11f8-0cf64ab1a347"), - // Properties: &armsecurity.RegulatoryComplianceAssessmentProperties{ - // Description: to.Ptr("Troubleshoot missing scan data on your machines"), - // AssessmentDetailsLink: to.Ptr("https://management.azure.com/subscriptions/a27e854a-8578-4395-8eaf-6fc7849f3050/providers/Microsoft.Security/securityStatuses/968548cb-02b3-8cd2-11f8-0cf64ab1a347"), - // AssessmentType: to.Ptr("Assessment"), - // FailedResources: to.Ptr[int32](4), - // PassedResources: to.Ptr[int32](7), - // SkippedResources: to.Ptr[int32](0), - // State: to.Ptr(armsecurity.StateFailed), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/regulatorycompliancecontrols_client_example_test.go b/sdk/resourcemanager/security/armsecurity/regulatorycompliancecontrols_client_example_test.go deleted file mode 100644 index 12453f07e9ad..000000000000 --- a/sdk/resourcemanager/security/armsecurity/regulatorycompliancecontrols_client_example_test.go +++ /dev/null @@ -1,114 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceControlList_example.json -func ExampleRegulatoryComplianceControlsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRegulatoryComplianceControlsClient().NewListPager("PCI-DSS-3.2", &armsecurity.RegulatoryComplianceControlsClientListOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RegulatoryComplianceControlList = armsecurity.RegulatoryComplianceControlList{ - // Value: []*armsecurity.RegulatoryComplianceControl{ - // { - // Name: to.Ptr("1.1"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceControl"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/PCI-DSS-3.2/regulatoryComplianceControls/1.1"), - // Properties: &armsecurity.RegulatoryComplianceControlProperties{ - // Description: to.Ptr("Common Criteria Related to Organization and Management."), - // FailedAssessments: to.Ptr[int32](4), - // PassedAssessments: to.Ptr[int32](7), - // SkippedAssessments: to.Ptr[int32](0), - // State: to.Ptr(armsecurity.StateFailed), - // }, - // }, - // { - // Name: to.Ptr("2"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceControl"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/PCI-DSS-3.2/regulatoryComplianceControls/2"), - // Properties: &armsecurity.RegulatoryComplianceControlProperties{ - // Description: to.Ptr("Confidential information is protected during the system design, development, testing, implementation, and change processes in accordance with confidentiality commitments and requirements."), - // FailedAssessments: to.Ptr[int32](0), - // PassedAssessments: to.Ptr[int32](0), - // SkippedAssessments: to.Ptr[int32](10), - // State: to.Ptr(armsecurity.StateSkipped), - // }, - // }, - // { - // Name: to.Ptr("2.1"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceControl"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/PCI-DSS-3.2/regulatoryComplianceControls/2.1"), - // Properties: &armsecurity.RegulatoryComplianceControlProperties{ - // Description: to.Ptr("Changes to confidentiality commitments and requirements are communicated to internal and external users, vendors, and other third parties whose products and services are included in the system."), - // FailedAssessments: to.Ptr[int32](0), - // PassedAssessments: to.Ptr[int32](0), - // SkippedAssessments: to.Ptr[int32](0), - // State: to.Ptr(armsecurity.StateUnsupported), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceControl_example.json -func ExampleRegulatoryComplianceControlsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegulatoryComplianceControlsClient().Get(ctx, "PCI-DSS-3.2", "1.1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RegulatoryComplianceControl = armsecurity.RegulatoryComplianceControl{ - // Name: to.Ptr("1.1"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceControl"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/PCI-DSS-3.2/regulatoryComplianceControls/1.1"), - // Properties: &armsecurity.RegulatoryComplianceControlProperties{ - // Description: to.Ptr("Common Criteria Related to Organization and Management"), - // FailedAssessments: to.Ptr[int32](4), - // PassedAssessments: to.Ptr[int32](7), - // SkippedAssessments: to.Ptr[int32](0), - // State: to.Ptr(armsecurity.StateFailed), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/regulatorycompliancestandards_client_example_test.go b/sdk/resourcemanager/security/armsecurity/regulatorycompliancestandards_client_example_test.go deleted file mode 100644 index f641f1606071..000000000000 --- a/sdk/resourcemanager/security/armsecurity/regulatorycompliancestandards_client_example_test.go +++ /dev/null @@ -1,126 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceStandardList_example.json -func ExampleRegulatoryComplianceStandardsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRegulatoryComplianceStandardsClient().NewListPager(&armsecurity.RegulatoryComplianceStandardsClientListOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RegulatoryComplianceStandardList = armsecurity.RegulatoryComplianceStandardList{ - // Value: []*armsecurity.RegulatoryComplianceStandard{ - // { - // Name: to.Ptr("PCI-DSS-3.2"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceStandard"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/PCI-DSS-3.2"), - // Properties: &armsecurity.RegulatoryComplianceStandardProperties{ - // FailedControls: to.Ptr[int32](4), - // PassedControls: to.Ptr[int32](7), - // SkippedControls: to.Ptr[int32](0), - // State: to.Ptr(armsecurity.StateFailed), - // UnsupportedControls: to.Ptr[int32](0), - // }, - // }, - // { - // Name: to.Ptr("ISO-27001"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceStandard"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/ISO-27001"), - // Properties: &armsecurity.RegulatoryComplianceStandardProperties{ - // FailedControls: to.Ptr[int32](0), - // PassedControls: to.Ptr[int32](0), - // SkippedControls: to.Ptr[int32](10), - // State: to.Ptr(armsecurity.StateSkipped), - // UnsupportedControls: to.Ptr[int32](0), - // }, - // }, - // { - // Name: to.Ptr("AZURE-CIS"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceStandard"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/AZURE-CIS"), - // Properties: &armsecurity.RegulatoryComplianceStandardProperties{ - // FailedControls: to.Ptr[int32](0), - // PassedControls: to.Ptr[int32](0), - // SkippedControls: to.Ptr[int32](0), - // State: to.Ptr(armsecurity.StateUnsupported), - // UnsupportedControls: to.Ptr[int32](0), - // }, - // }, - // { - // Name: to.Ptr("SOC-TSP"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceStandard"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/SOC-TSP"), - // Properties: &armsecurity.RegulatoryComplianceStandardProperties{ - // FailedControls: to.Ptr[int32](0), - // PassedControls: to.Ptr[int32](15), - // SkippedControls: to.Ptr[int32](0), - // State: to.Ptr(armsecurity.StatePassed), - // UnsupportedControls: to.Ptr[int32](0), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceStandard_example.json -func ExampleRegulatoryComplianceStandardsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegulatoryComplianceStandardsClient().Get(ctx, "PCI-DSS-3.2", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RegulatoryComplianceStandard = armsecurity.RegulatoryComplianceStandard{ - // Name: to.Ptr("PCI-DSS-3.2"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceStandard"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/PCI-DSS-3.2"), - // Properties: &armsecurity.RegulatoryComplianceStandardProperties{ - // FailedControls: to.Ptr[int32](4), - // PassedControls: to.Ptr[int32](7), - // SkippedControls: to.Ptr[int32](0), - // State: to.Ptr(armsecurity.StateFailed), - // UnsupportedControls: to.Ptr[int32](0), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/response_types.go b/sdk/resourcemanager/security/armsecurity/response_types.go index a4141f6de86e..7ce9652a001c 100644 --- a/sdk/resourcemanager/security/armsecurity/response_types.go +++ b/sdk/resourcemanager/security/armsecurity/response_types.go @@ -9,6 +9,26 @@ package armsecurity +// APICollectionClientGetResponse contains the response from method APICollectionClient.Get. +type APICollectionClientGetResponse struct { + APICollectionResponse +} + +// APICollectionClientListResponse contains the response from method APICollectionClient.NewListPager. +type APICollectionClientListResponse struct { + APICollectionResponseList +} + +// APICollectionOffboardingClientDeleteResponse contains the response from method APICollectionOffboardingClient.Delete. +type APICollectionOffboardingClientDeleteResponse struct { + // placeholder for future response values +} + +// APICollectionOnboardingClientCreateResponse contains the response from method APICollectionOnboardingClient.Create. +type APICollectionOnboardingClientCreateResponse struct { + APICollectionResponse +} + // AccountConnectorsClientCreateOrUpdateResponse contains the response from method AccountConnectorsClient.CreateOrUpdate. type AccountConnectorsClientCreateOrUpdateResponse struct { ConnectorSetting @@ -339,31 +359,6 @@ type ConnectorApplicationsClientListResponse struct { ApplicationsList } -// ConnectorGovernanceRuleClientListResponse contains the response from method ConnectorGovernanceRuleClient.NewListPager. -type ConnectorGovernanceRuleClientListResponse struct { - GovernanceRuleList -} - -// ConnectorGovernanceRulesClientCreateOrUpdateResponse contains the response from method ConnectorGovernanceRulesClient.CreateOrUpdate. -type ConnectorGovernanceRulesClientCreateOrUpdateResponse struct { - GovernanceRule -} - -// ConnectorGovernanceRulesClientDeleteResponse contains the response from method ConnectorGovernanceRulesClient.Delete. -type ConnectorGovernanceRulesClientDeleteResponse struct { - // placeholder for future response values -} - -// ConnectorGovernanceRulesClientGetResponse contains the response from method ConnectorGovernanceRulesClient.Get. -type ConnectorGovernanceRulesClientGetResponse struct { - GovernanceRule -} - -// ConnectorGovernanceRulesExecuteStatusClientGetResponse contains the response from method ConnectorGovernanceRulesExecuteStatusClient.BeginGet. -type ConnectorGovernanceRulesExecuteStatusClientGetResponse struct { - ExecuteRuleStatus -} - // ConnectorsClientCreateOrUpdateResponse contains the response from method ConnectorsClient.CreateOrUpdate. type ConnectorsClientCreateOrUpdateResponse struct { Connector @@ -534,34 +529,46 @@ type GovernanceAssignmentsClientListResponse struct { GovernanceAssignmentsList } -// GovernanceRuleClientListResponse contains the response from method GovernanceRuleClient.NewListPager. -type GovernanceRuleClientListResponse struct { - GovernanceRuleList -} - // GovernanceRulesClientCreateOrUpdateResponse contains the response from method GovernanceRulesClient.CreateOrUpdate. type GovernanceRulesClientCreateOrUpdateResponse struct { GovernanceRule } -// GovernanceRulesClientDeleteResponse contains the response from method GovernanceRulesClient.Delete. +// GovernanceRulesClientDeleteResponse contains the response from method GovernanceRulesClient.BeginDelete. type GovernanceRulesClientDeleteResponse struct { // placeholder for future response values } +// GovernanceRulesClientExecuteResponse contains the response from method GovernanceRulesClient.BeginExecute. +type GovernanceRulesClientExecuteResponse struct { + // placeholder for future response values +} + // GovernanceRulesClientGetResponse contains the response from method GovernanceRulesClient.Get. type GovernanceRulesClientGetResponse struct { GovernanceRule } -// GovernanceRulesClientRuleIDExecuteSingleSecurityConnectorResponse contains the response from method GovernanceRulesClient.BeginRuleIDExecuteSingleSecurityConnector. -type GovernanceRulesClientRuleIDExecuteSingleSecurityConnectorResponse struct { - // placeholder for future response values +// GovernanceRulesClientListResponse contains the response from method GovernanceRulesClient.NewListPager. +type GovernanceRulesClientListResponse struct { + GovernanceRuleList } -// GovernanceRulesClientRuleIDExecuteSingleSubscriptionResponse contains the response from method GovernanceRulesClient.BeginRuleIDExecuteSingleSubscription. -type GovernanceRulesClientRuleIDExecuteSingleSubscriptionResponse struct { - // placeholder for future response values +// GovernanceRulesClientOperationResultsResponse contains the response from method GovernanceRulesClient.OperationResults. +type GovernanceRulesClientOperationResultsResponse struct { + OperationResultAutoGenerated + // Location contains the information returned from the location header response. + Location *string +} + +// HealthReportClientGetResponse contains the response from method HealthReportClient.Get. +type HealthReportClientGetResponse struct { + HealthReport +} + +// HealthReportsClientListResponse contains the response from method HealthReportsClient.NewListPager. +type HealthReportsClientListResponse struct { + HealthReportsList } // InformationProtectionPoliciesClientCreateOrUpdateResponse contains the response from method InformationProtectionPoliciesClient.CreateOrUpdate. @@ -739,6 +746,26 @@ type OperationsClientListResponse struct { OperationList } +// OperatorsClientCreateOrUpdateResponse contains the response from method OperatorsClient.CreateOrUpdate. +type OperatorsClientCreateOrUpdateResponse struct { + Operator +} + +// OperatorsClientDeleteResponse contains the response from method OperatorsClient.Delete. +type OperatorsClientDeleteResponse struct { + // placeholder for future response values +} + +// OperatorsClientGetResponse contains the response from method OperatorsClient.Get. +type OperatorsClientGetResponse struct { + Operator +} + +// OperatorsClientListResponse contains the response from method OperatorsClient.List. +type OperatorsClientListResponse struct { + OperatorList +} + // PricingsClientGetResponse contains the response from method PricingsClient.Get. type PricingsClientGetResponse struct { Pricing @@ -964,11 +991,6 @@ type SubAssessmentsClientListResponse struct { SubAssessmentList } -// SubscriptionGovernanceRulesExecuteStatusClientGetResponse contains the response from method SubscriptionGovernanceRulesExecuteStatusClient.BeginGet. -type SubscriptionGovernanceRulesExecuteStatusClientGetResponse struct { - ExecuteRuleStatus -} - // TasksClientGetResourceGroupLevelTaskResponse contains the response from method TasksClient.GetResourceGroupLevelTask. type TasksClientGetResourceGroupLevelTaskResponse struct { Task diff --git a/sdk/resourcemanager/security/armsecurity/securescorecontroldefinitions_client_example_test.go b/sdk/resourcemanager/security/armsecurity/securescorecontroldefinitions_client_example_test.go deleted file mode 100644 index 2c5c6859670d..000000000000 --- a/sdk/resourcemanager/security/armsecurity/securescorecontroldefinitions_client_example_test.go +++ /dev/null @@ -1,183 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScoreControlDefinitions/ListSecureScoreControlDefinitions_example.json -func ExampleSecureScoreControlDefinitionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecureScoreControlDefinitionsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SecureScoreControlDefinitionList = armsecurity.SecureScoreControlDefinitionList{ - // Value: []*armsecurity.SecureScoreControlDefinitionItem{ - // { - // Name: to.Ptr("a9909064-42b4-4d34-8143-275477afe18b"), - // Type: to.Ptr("Microsoft.Security/SecureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/SecureScoreControlDefinitions/a9909064-42b4-4d34-8143-275477afe18b"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // Description: to.Ptr("This control contains recommendations regarding DDoS attack prevention"), - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/e3de1cc0-f4dd-3b34-e496-8b5381ba2d70"), - // }}, - // DisplayName: to.Ptr("Protect applications against DDoS attacks"), - // MaxScore: to.Ptr[int32](2), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // { - // Name: to.Ptr("a000c66f-6da2-4f9d-826d-2364347d2588"), - // Type: to.Ptr("Microsoft.Security/SecureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/SecureScoreControlDefinitions/a000c66f-6da2-4f9d-826d-2364347d2588"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // Description: to.Ptr("This control contains recommendations regarding enabling adaptive application control"), - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/35f45c95-27cf-4e52-891f-8390d1de5828"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/d1db3318-01ff-16de-29eb-28b344515626"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/e7ee30c4-bac9-2966-54bd-2023a4282872"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8e2b96ff-3de2-289b-b5c1-3b9921a3441e"), - // }}, - // DisplayName: to.Ptr("Apply adaptive application control"), - // MaxScore: to.Ptr[int32](3), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScoreControlDefinitions/ListSecureScoreControlDefinitions_subscription_example.json -func ExampleSecureScoreControlDefinitionsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecureScoreControlDefinitionsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SecureScoreControlDefinitionList = armsecurity.SecureScoreControlDefinitionList{ - // Value: []*armsecurity.SecureScoreControlDefinitionItem{ - // { - // Name: to.Ptr("a9909064-42b4-4d34-8143-275477afe18b"), - // Type: to.Ptr("Microsoft.Security/SecureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/SecureScoreControlDefinitions/a9909064-42b4-4d34-8143-275477afe18b"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // Description: to.Ptr("This control contains recommendations regarding DDoS attack prevention"), - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/e3de1cc0-f4dd-3b34-e496-8b5381ba2d70"), - // }}, - // DisplayName: to.Ptr("Protect applications against DDoS attacks"), - // MaxScore: to.Ptr[int32](2), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // { - // Name: to.Ptr("34a42fb3-e6db-409c-b56b-7b1db6b8aee0"), - // Type: to.Ptr("Microsoft.Security/SecureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/SecureScoreControlDefinitions/34a42fb3-e6db-409c-b56b-7b1db6b8aee0"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // Description: to.Ptr("This control contains recommendations regarding MFA"), - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/151e82c5-5341-a74b-1eb0-bc38d2c84bb5"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/57e98606-6b1e-6193-0e3d-fe621387c16b"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/94290b00-4d0c-d7b4-7cea-064a9554e681"), - // }}, - // DisplayName: to.Ptr("Enable MFA"), - // MaxScore: to.Ptr[int32](10), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // { - // Name: to.Ptr("a000c66f-6da2-4f9d-826d-2364347d2588"), - // Type: to.Ptr("Microsoft.Security/SecureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/SecureScoreControlDefinitions/a000c66f-6da2-4f9d-826d-2364347d2588"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // Description: to.Ptr("This control contains recommendations regarding enabling adaptive application control"), - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/35f45c95-27cf-4e52-891f-8390d1de5828"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/d1db3318-01ff-16de-29eb-28b344515626"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/e7ee30c4-bac9-2966-54bd-2023a4282872"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8e2b96ff-3de2-289b-b5c1-3b9921a3441e"), - // }}, - // DisplayName: to.Ptr("Apply adaptive application control"), - // MaxScore: to.Ptr[int32](3), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/securescorecontrols_client_example_test.go b/sdk/resourcemanager/security/armsecurity/securescorecontrols_client_example_test.go deleted file mode 100644 index fce87ec0f2b3..000000000000 --- a/sdk/resourcemanager/security/armsecurity/securescorecontrols_client_example_test.go +++ /dev/null @@ -1,1594 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScoreControlsForName_builtin_example.json -func ExampleSecureScoreControlsClient_NewListBySecureScorePager_getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiative() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecureScoreControlsClient().NewListBySecureScorePager("ascScore", &armsecurity.SecureScoreControlsClientListBySecureScoreOptions{Expand: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SecureScoreControlList = armsecurity.SecureScoreControlList{ - // Value: []*armsecurity.SecureScoreControlDetails{ - // { - // Name: to.Ptr("a9909064-42b4-4d34-8143-275477afe18b"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/a9909064-42b4-4d34-8143-275477afe18b"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Protect applications against DDoS attacks"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](1), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](0), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](0), - // }, - // }, - // { - // Name: to.Ptr("34a42fb3-e6db-409c-b56b-7b1db6b8aee0"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/34a42fb3-e6db-409c-b56b-7b1db6b8aee0"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Enable MFA"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](10), - // Max: to.Ptr[int32](10), - // Percentage: to.Ptr[float64](1), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("76763537-9feb-42d3-b4f4-78c01117be80"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/76763537-9feb-42d3-b4f4-78c01117be80"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Implement security best practices"), - // HealthyResourceCount: to.Ptr[int32](7), - // NotApplicableResourceCount: to.Ptr[int32](1), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](0), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](7), - // }, - // }, - // { - // Name: to.Ptr("4db8d6cf-075b-4149-a813-da09ca2ae120"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/4db8d6cf-075b-4149-a813-da09ca2ae120"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Enable Advanced Threat Protection"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](0), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("27b24961-75ba-4fe4-8909-97286d5dd5ee"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/27b24961-75ba-4fe4-8909-97286d5dd5ee"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Enable auditing and logging"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0.2), - // Max: to.Ptr[int32](1), - // Percentage: to.Ptr[float64](0.2), - // }, - // UnhealthyResourceCount: to.Ptr[int32](4), - // Weight: to.Ptr[int64](5), - // }, - // }, - // { - // Name: to.Ptr("2d85f639-0bea-4a4a-b6c6-608952a1414a"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/2d85f639-0bea-4a4a-b6c6-608952a1414a"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Manage access and permissions"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](2), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](0.5), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](2), - // }, - // }, - // { - // Name: to.Ptr("99fc8df2-e0f5-40f8-9415-a7f7ca948b5a"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/99fc8df2-e0f5-40f8-9415-a7f7ca948b5a"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Remediate security configurations"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("12136bd9-dc24-44f2-9587-7be3af6aac14"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/12136bd9-dc24-44f2-9587-7be3af6aac14"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Enable endpoint protection"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](2), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("61702b76-1fab-41f2-bcbc-50b7870dcf38"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/61702b76-1fab-41f2-bcbc-50b7870dcf38"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Apply system updates"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](6), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("0e55495e-034f-4abc-8293-767229250176"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/0e55495e-034f-4abc-8293-767229250176"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Encrypt data in transit"), - // HealthyResourceCount: to.Ptr[int32](5), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](3.33), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](0.8325), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](6), - // }, - // }, - // { - // Name: to.Ptr("f9d5432b-8f7b-45e9-b90c-e214a30f6a02"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/f9d5432b-8f7b-45e9-b90c-e214a30f6a02"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Restrict unauthorized network access"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](4), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](1), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("8fd574ec-43cf-426e-a439-a67cbaf2d564"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/8fd574ec-43cf-426e-a439-a67cbaf2d564"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Enable encryption at rest"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](4), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](1), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](1), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScoreControlsForNameWithExpand_builtin_example.json -func ExampleSecureScoreControlsClient_NewListBySecureScorePager_getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiativeWithTheExpandParameter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecureScoreControlsClient().NewListBySecureScorePager("ascScore", &armsecurity.SecureScoreControlsClientListBySecureScoreOptions{Expand: to.Ptr(armsecurity.ExpandControlsEnumDefinition)}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SecureScoreControlList = armsecurity.SecureScoreControlList{ - // Value: []*armsecurity.SecureScoreControlDetails{ - // { - // Name: to.Ptr("a9909064-42b4-4d34-8143-275477afe18b"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/a9909064-42b4-4d34-8143-275477afe18b"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // Definition: &armsecurity.SecureScoreControlDefinitionItem{ - // Name: to.Ptr("a9909064-42b4-4d34-8143-275477afe18b"), - // Type: to.Ptr("Microsoft.Security/secureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/secureScoreControlDefinitions/a9909064-42b4-4d34-8143-275477afe18b"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/e3de1cc0-f4dd-3b34-e496-8b5381ba2d70"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/08e628db-e2ed-4793-bc91-d13e684401c3"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/405c9ae6-49f9-46c4-8873-a86690f27818"), - // }}, - // DisplayName: to.Ptr("Protect applications against DDoS attacks"), - // MaxScore: to.Ptr[int32](2), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // DisplayName: to.Ptr("Protect applications against DDoS attacks"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](1), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](0), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](0), - // }, - // }, - // { - // Name: to.Ptr("34a42fb3-e6db-409c-b56b-7b1db6b8aee0"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/34a42fb3-e6db-409c-b56b-7b1db6b8aee0"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // Definition: &armsecurity.SecureScoreControlDefinitionItem{ - // Name: to.Ptr("34a42fb3-e6db-409c-b56b-7b1db6b8aee0"), - // Type: to.Ptr("Microsoft.Security/secureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/secureScoreControlDefinitions/34a42fb3-e6db-409c-b56b-7b1db6b8aee0"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/94290b00-4d0c-d7b4-7cea-064a9554e681"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/57e98606-6b1e-6193-0e3d-fe621387c16b"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/1f24d55a-df0f-4772-9090-4629c2d6bfff"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8e3d9ac0-a248-4276-a437-304c6cd1443b"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8d7a6128-c8f2-43df-b422-7877346f9ddb"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/dbfc99e3-e648-4c3b-bd32-995e6268430d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/4a946e22-47e8-443d-8761-b25620b4a1e1"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a7c8fa46-526d-4bf6-b8b3-17fa01310fd8"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/20f6c761-4dd7-4f27-9e37-6db8471486ef"), - // }}, - // DisplayName: to.Ptr("Enable MFA"), - // MaxScore: to.Ptr[int32](10), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // DisplayName: to.Ptr("Enable MFA"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](10), - // Max: to.Ptr[int32](10), - // Percentage: to.Ptr[float64](1), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("76763537-9feb-42d3-b4f4-78c01117be80"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/76763537-9feb-42d3-b4f4-78c01117be80"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // Definition: &armsecurity.SecureScoreControlDefinitionItem{ - // Name: to.Ptr("76763537-9feb-42d3-b4f4-78c01117be80"), - // Type: to.Ptr("Microsoft.Security/secureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/secureScoreControlDefinitions/76763537-9feb-42d3-b4f4-78c01117be80"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/151e82c5-5341-a74b-1eb0-bc38d2c84bb5"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a8c6a4ad-d51e-88fe-2979-d3ee3c864f8b"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/6f90a6d6-d4d6-0794-0ec1-98fa77878c2e"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a9341235-9389-42f0-a0bf-9bfb57960d44"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/45d313c3-3fca-5040-035f-d61928366d31"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/f0553104-cfdb-65e6-759c-002812e38500"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/47bb383c-8e25-95f0-c2aa-437add1d87d3"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/12018f4f-3d10-999b-e4c4-86ec25be08a1"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/eade5b56-eefd-444f-95c8-23f29e5d93cb"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/ebe970fe-9c27-4dd7-a165-1e943d565e10"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/f7010359-8d21-4598-a9f2-c3e81a17141e"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/24d8af06-d441-40b4-a49c-311421aa9f58"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8c3e93d3-0276-4d06-b20a-9a9f3012742c"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/9172da4e-9571-6e33-2b5b-d742847f3be7"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/093c685b-56dd-13a3-8ed5-887a001837a2"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/64b8637e-4e1d-76a9-0fc9-c1e487a97ed8"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/fe02b3b7-a722-d4d6-6731-6493776203a6"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/57f36d21-69e3-4b0f-a66c-18629d1b736d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/6c99f570-2ce7-46bc-8175-cde013df43bc"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/22489c48-27d1-4e40-9420-4303ad9cffef"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/fc84abc0-eee6-4758-8372-a7681965ca44"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/726cde3e-02f8-4041-8935-727f2be19ba7"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a2bb3a1b-4a09-4cf7-9e79-c438687e2c2f"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/664c6a0b-5cd2-4140-aaff-a94241c07afd"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/3af5de46-fda8-4b6e-90f1-6565187d7c48"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a9a59ebb-5d6f-42f5-92a1-036fd0fd1879"), - // }}, - // DisplayName: to.Ptr("Implement security best practices"), - // MaxScore: to.Ptr[int32](0), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // DisplayName: to.Ptr("Implement security best practices"), - // HealthyResourceCount: to.Ptr[int32](7), - // NotApplicableResourceCount: to.Ptr[int32](1), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](0), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](7), - // }, - // }, - // { - // Name: to.Ptr("4db8d6cf-075b-4149-a813-da09ca2ae120"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/4db8d6cf-075b-4149-a813-da09ca2ae120"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // Definition: &armsecurity.SecureScoreControlDefinitionItem{ - // Name: to.Ptr("4db8d6cf-075b-4149-a813-da09ca2ae120"), - // Type: to.Ptr("Microsoft.Security/secureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/secureScoreControlDefinitions/4db8d6cf-075b-4149-a813-da09ca2ae120"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/56a6e81f-7413-4f72-9a1b-aaeeaa87c872"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/0876ef51-fee7-449d-ba1e-f2662c7e43c6"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/58d72d9d-0310-4792-9a3b-6dd111093cdb"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/6ac66a74-761f-4a59-928a-d373eea3f028"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/1be22853-8ed1-4005-9907-ddad64cb1417"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/86ea1a79-29d3-4eac-a9f4-3541ace4e718"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/53572822-d3fc-4363-bfb9-248645841612"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/b1af52e4-e968-4e2b-b6d0-6736c9651f0a"), - // }}, - // DisplayName: to.Ptr("Enable Advanced Threat Protection"), - // MaxScore: to.Ptr[int32](0), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // DisplayName: to.Ptr("Enable Advanced Threat Protection"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](0), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("27b24961-75ba-4fe4-8909-97286d5dd5ee"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/27b24961-75ba-4fe4-8909-97286d5dd5ee"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // Definition: &armsecurity.SecureScoreControlDefinitionItem{ - // Name: to.Ptr("27b24961-75ba-4fe4-8909-97286d5dd5ee"), - // Type: to.Ptr("Microsoft.Security/secureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/secureScoreControlDefinitions/27b24961-75ba-4fe4-8909-97286d5dd5ee"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/94208a8b-16e8-4e5b-abbd-4e81c9d02bee"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/c6dad669-efd7-cd72-61c5-289935607791"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/77785808-ce86-4e40-b45f-19110a547397"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/32771b45-220c-1a8b-584e-fdd5a2584a66"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/f11b27f2-8c49-5bb4-eff5-e1e5384bf95e"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/f19ab7d9-5ff2-f8fd-ab3b-0bf95dcb6889"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/ad5bbaeb-7632-5edf-f1c2-752075831ce8"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/dea5192e-1bb3-101b-b70c-4646546f5e1e"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/1597605a-0faf-5860-eb74-462ae2e9fc21"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/91387f44-7e43-4ecc-55f0-46f5adee3dd5"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/961eb649-3ea9-f8c2-6595-88e9a3aeedeb"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/88bbc99c-e5af-ddd7-6105-6150b2bfa519"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/22438e3c-73c8-40af-a083-10c980c63aa2"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/5720f1a6-6061-4768-9c0d-2000a6041744"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/dbfc99e3-e648-4c3b-bd32-995e6268430d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/30c69b23-a9a2-4729-aca6-f21adacfff66"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a9ac48d8-8dd7-42b9-9752-b1fa70ea5dd9"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/00261067-76a8-4ebb-b5fc-becc81067bee"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/83ca4867-58c1-45d6-b6b6-dbf226512891"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a269cbdb-86e8-431c-9ff2-f0ea491174d8"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/5ea59e47-093b-446f-9765-5b0ec4c9da61"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/011397ca-1366-4bcc-b85a-7a5e3df2e80b"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/c62371bc-f6a7-4915-b5b5-14288682cf79"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/293ba336-7312-42fc-a59d-836e4e678b17"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/0b547a38-2c0d-47e1-b9a2-a59fccc140db"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/7d0ad86f-f43b-4889-b2f7-09d91bd1407b"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/b20558b6-de31-480c-8aa0-e920d62b9764"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/022efc2d-5119-480b-a203-e151b6b2645c"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/3ee7608e-f0e7-4c26-8921-5ae46c4e99df"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/33765629-073d-49eb-bab4-64bdf8ac90da"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/9c054f50-823f-45ab-839e-9df4eb7c2f11"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/f61e15f3-4bcf-4d2e-8f06-32237cabe0a0"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/cdb3af55-2abf-476b-aac7-5cfec366a4dd"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/bc26b0d4-a1d7-4665-9d44-efc205ae73f0"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/3812e247-34f2-4f06-a312-89a8fe51fa37"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/f0f8405a-5ecc-4314-808e-083e030d6163"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/c23e0eec-eee4-4632-b1c2-6c884c3c963b"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/7ce5a01f-e94b-438a-8b72-fa02c076f11a"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/46e4e0ed-106d-405e-b1a9-ca34c8f7d31f"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/b1294b0d-9b2e-4e1b-9f67-77a75fb10a65"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/0b86a67f-bde5-4c91-b10c-4102033b8692"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/3d55e4b1-ecdb-4eaf-9e3f-b00a764182bd"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a7c8fa46-526d-4bf6-b8b3-17fa01310fd8"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/20f6c761-4dd7-4f27-9e37-6db8471486ef"), - // }}, - // DisplayName: to.Ptr("Enable auditing and logging"), - // MaxScore: to.Ptr[int32](1), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // DisplayName: to.Ptr("Enable auditing and logging"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0.2), - // Max: to.Ptr[int32](1), - // Percentage: to.Ptr[float64](0.2), - // }, - // UnhealthyResourceCount: to.Ptr[int32](4), - // Weight: to.Ptr[int64](5), - // }, - // }, - // { - // Name: to.Ptr("2d85f639-0bea-4a4a-b6c6-608952a1414a"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/2d85f639-0bea-4a4a-b6c6-608952a1414a"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // Definition: &armsecurity.SecureScoreControlDefinitionItem{ - // Name: to.Ptr("2d85f639-0bea-4a4a-b6c6-608952a1414a"), - // Type: to.Ptr("Microsoft.Security/secureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/secureScoreControlDefinitions/2d85f639-0bea-4a4a-b6c6-608952a1414a"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/c3b6ae71-f1f0-31b4-e6c1-d5951285d03d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/04e7147b-0deb-9796-2e5c-0336343ceb3d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/e52064aa-6853-e252-a11e-dffc675689c2"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/00c6d40b-e990-6acf-d4f3-471e747a27c4"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/2c79b4af-f830-b61e-92b9-63dfa30f16e4"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/b0fdc63a-38e7-4bab-a7c4-2c2665abbaa9"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/03afeb6f-7634-adb3-0a01-803b0b9cb611"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/9d07b7e6-2986-4964-a76c-b2689604e212"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/08e628db-e2ed-4793-bc91-d13e684401c3"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/5d90913f-a1c5-4429-ad54-2c6c17fb3c73"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/582c14e9-48c1-4b25-ab93-91bdeaf9120c"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8a10942a-02ca-483f-81ae-2260ea7808cc"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/9b8eac17-6b11-4b94-9bb4-18c81aee7123"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/554ba13c-d7d4-4530-88ce-94cf11a670ce"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/66a1d478-4d24-42d4-8eca-dcdab6532a18"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/b396f112-a462-4813-a93f-80bc90041e4d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/5425052d-cc0d-4424-af71-050311f99634"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/09cb7d54-db05-4d31-97f3-9bbfe1dff610"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/01fb1ad4-303b-4789-abf2-c024c4a76523"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/0de072b9-6515-4985-842e-0318047bb85b"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8c3f474a-234e-442f-92b3-2a45e37f7eee"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/c55461af-4923-4fbb-b270-40d5e5f4c0ff"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/bbdc4999-1462-4d46-853b-2f8c6ca1c682"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/9e1f12d0-cb3d-4e1c-a468-6bc3d934c99d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/fd5d38f6-340e-4bd2-88f2-e1314c3c07a9"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/0384d5b7-5def-4130-b7b5-db7da7e63276"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/dbfc99e3-e648-4c3b-bd32-995e6268430d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/0ad39832-f031-4fdd-885e-c6cce85ac77c"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/90191798-da1b-40dd-aa9c-1c0eafb1ba87"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/ddced3c8-a5e2-4dc4-b0fe-1331c77fc9c4"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/52f83ea2-6871-45c3-8b26-13566e966638"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/79b4eb34-c06e-49bf-883d-5352a21a962f"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/5723400d-5b2a-45f1-99ee-837986866318"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/76e8881d-f18e-4e1b-b01d-376d0260e066"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/0eaf40a8-5673-4b33-8457-a31d85882233"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/5a235918-41a2-4bd0-8ab0-00a596e9d6a8"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/3ff38dcd-92e2-4b67-8765-35bb0174a4c7"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/1ff4501b-2109-4ef6-ba9d-e824a96d63d0"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/f493084a-d3c4-4886-8cf2-3c815aeef901"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a7c8fa46-526d-4bf6-b8b3-17fa01310fd8"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/20f6c761-4dd7-4f27-9e37-6db8471486ef"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/11c95609-3553-430d-b788-fd41cde8b2db"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/27d6f0e9-b4d5-468b-ae7e-03d5473fd864"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/f0debc84-981c-4a0d-924d-aa4bd7d55fef"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/9b795646-9130-41a4-90b7-df9eae2437c8"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/802c0637-5a8c-4c98-abd7-7c96d89d6010"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/43dc2a2e-ce69-4d42-923e-ab7d136f2cfe"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/2acd365d-e8b5-4094-bce4-244b7c51d67c"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/51fd8bb1-0db4-bbf1-7e2b-cfcba7eb66a6"), - // }}, - // DisplayName: to.Ptr("Manage access and permissions"), - // MaxScore: to.Ptr[int32](4), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // DisplayName: to.Ptr("Manage access and permissions"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](2), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](0.5), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](2), - // }, - // }, - // { - // Name: to.Ptr("99fc8df2-e0f5-40f8-9415-a7f7ca948b5a"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/99fc8df2-e0f5-40f8-9415-a7f7ca948b5a"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // Definition: &armsecurity.SecureScoreControlDefinitionItem{ - // Name: to.Ptr("99fc8df2-e0f5-40f8-9415-a7f7ca948b5a"), - // Type: to.Ptr("Microsoft.Security/secureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/secureScoreControlDefinitions/99fc8df2-e0f5-40f8-9415-a7f7ca948b5a"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/d1db3318-01ff-16de-29eb-28b344515626"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/e7ee30c4-bac9-2966-54bd-2023a4282872"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/27ac71b1-75c5-41c2-adc2-858f5db45b08"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/720a3e77-0b9a-4fa9-98b6-ddf0fd7e32c1"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8e2b96ff-3de2-289b-b5c1-3b9921a3441e"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/181ac480-f7c4-544b-9865-11b8ffe87f47"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8c3d9ad0-3639-4686-9cd2-2b2ab2609bda"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/0677209d-e675-2c6f-e91a-54cef2878663"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a3eee263-aa01-4b52-a7c0-0094578ef48f"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/45cfe080-ceb1-a91e-9743-71551ed24e94"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8941d121-f740-35f6-952c-6561d2b38d36"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/0396b18c-41aa-489c-affd-4ee5d1714a59"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/fa924a53-0837-4296-9bf7-18ce7dd68593"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/9e1789cd-7b61-42db-ba12-7268283ba466"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/233da9cd-11bf-463a-8aa7-4c81b9e788d1"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/c4131c22-1ecc-4beb-9961-d90108bd975f"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/d74d2738-2485-4103-9919-69c7e63776ec"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/5f65e47f-7a00-4bf3-acae-90ee441ee876"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/bc85a7ee-7f43-47ab-8736-4faaec9346b5"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/08e628db-e2ed-4793-bc91-d13e684401c3"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/86f91051-9d6a-47c3-a07f-bd14cb214b45"), - // }}, - // DisplayName: to.Ptr("Remediate security configurations"), - // MaxScore: to.Ptr[int32](4), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // DisplayName: to.Ptr("Remediate security configurations"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("12136bd9-dc24-44f2-9587-7be3af6aac14"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/12136bd9-dc24-44f2-9587-7be3af6aac14"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // Definition: &armsecurity.SecureScoreControlDefinitionItem{ - // Name: to.Ptr("12136bd9-dc24-44f2-9587-7be3af6aac14"), - // Type: to.Ptr("Microsoft.Security/secureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/secureScoreControlDefinitions/12136bd9-dc24-44f2-9587-7be3af6aac14"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/d1db3318-01ff-16de-29eb-28b344515626"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/e7ee30c4-bac9-2966-54bd-2023a4282872"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/27ac71b1-75c5-41c2-adc2-858f5db45b08"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/720a3e77-0b9a-4fa9-98b6-ddf0fd7e32c1"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8e2b96ff-3de2-289b-b5c1-3b9921a3441e"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/83f577bd-a1b6-b7e1-0891-12ca19d1e6df"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/4fb67663-9ab9-475d-b026-8c544cced439"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/383cf3bc-fdf9-4a02-120a-3e7e36c6bfee"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/3bcd234d-c9c7-c2a2-89e0-c01f419c1a8a"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/37a3689a-818e-4a0e-82ac-b1392b9bb000"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/45cfe080-ceb1-a91e-9743-71551ed24e94"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/21300918-b2e3-0346-785f-c77ff57d243b"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/e71020c2-860c-3235-cd39-04f3f8c936d2"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/bc85a7ee-7f43-47ab-8736-4faaec9346b5"), - // }}, - // DisplayName: to.Ptr("Enable endpoint protection"), - // MaxScore: to.Ptr[int32](2), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // DisplayName: to.Ptr("Enable endpoint protection"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](2), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("61702b76-1fab-41f2-bcbc-50b7870dcf38"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/61702b76-1fab-41f2-bcbc-50b7870dcf38"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // Definition: &armsecurity.SecureScoreControlDefinitionItem{ - // Name: to.Ptr("61702b76-1fab-41f2-bcbc-50b7870dcf38"), - // Type: to.Ptr("Microsoft.Security/secureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/secureScoreControlDefinitions/61702b76-1fab-41f2-bcbc-50b7870dcf38"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/d1db3318-01ff-16de-29eb-28b344515626"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/e7ee30c4-bac9-2966-54bd-2023a4282872"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/27ac71b1-75c5-41c2-adc2-858f5db45b08"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/720a3e77-0b9a-4fa9-98b6-ddf0fd7e32c1"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8e2b96ff-3de2-289b-b5c1-3b9921a3441e"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/4ab6e3c5-74dd-8b35-9ab9-f61b30875b27"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/f2805ebc-abc2-4aac-a8d6-35664c479971"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/c0f5316d-5ac5-9218-b77a-b96e16ccfd66"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/45cfe080-ceb1-a91e-9743-71551ed24e94"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/bd20bd91-aaf1-7f14-b6e4-866de2f43146"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8bc390da-9eb6-938d-25ed-44a35d9bcc9d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/22e18b64-4576-41e6-8972-0eb28c9af0c8"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/bc85a7ee-7f43-47ab-8736-4faaec9346b5"), - // }}, - // DisplayName: to.Ptr("Apply system updates"), - // MaxScore: to.Ptr[int32](6), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // DisplayName: to.Ptr("Apply system updates"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](6), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("0e55495e-034f-4abc-8293-767229250176"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/0e55495e-034f-4abc-8293-767229250176"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // Definition: &armsecurity.SecureScoreControlDefinitionItem{ - // Name: to.Ptr("0e55495e-034f-4abc-8293-767229250176"), - // Type: to.Ptr("Microsoft.Security/secureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/secureScoreControlDefinitions/0e55495e-034f-4abc-8293-767229250176"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/1b351b29-41ca-6df5-946c-c190a56be5fe"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/cb0acdc6-0846-fd48-debe-9905af151b6d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/bf82a334-13b6-ca57-ea75-096fc2ffce50"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/35b25be2-d08a-e340-45ed-f08a95d804fc"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/1c5de8e1-f68d-6a17-e0d2-ec259c42768c"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a3ebc80a-847b-46d5-a37d-8dca5e6947df"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/c28a89d9-7cf4-439b-a8c4-ad4e769f68ee"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/2acc27c6-5fdb-405e-9080-cb66b850c8f5"), - // }}, - // DisplayName: to.Ptr("Encrypt data in transit"), - // MaxScore: to.Ptr[int32](4), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // DisplayName: to.Ptr("Encrypt data in transit"), - // HealthyResourceCount: to.Ptr[int32](5), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](3.33), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](0.8325), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](6), - // }, - // }, - // { - // Name: to.Ptr("f9d5432b-8f7b-45e9-b90c-e214a30f6a02"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/f9d5432b-8f7b-45e9-b90c-e214a30f6a02"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // Definition: &armsecurity.SecureScoreControlDefinitionItem{ - // Name: to.Ptr("f9d5432b-8f7b-45e9-b90c-e214a30f6a02"), - // Type: to.Ptr("Microsoft.Security/secureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/secureScoreControlDefinitions/f9d5432b-8f7b-45e9-b90c-e214a30f6a02"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/483f12ed-ae23-447e-a2de-a67a10db4353"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/3b20e985-f71f-483b-b078-f30d73936d43"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/f9f0eed0-f143-47bf-b856-671ea2eeed62"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/1a2b5b4c-f80d-46e7-ac81-b51a9fb363de"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/c3b51c94-588b-426b-a892-24696f9e54cc"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/e40df93c-7a7c-1b0a-c787-9987ceb98e54"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/7b3d4796-9400-2904-692b-4a5ede7f0a1e"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/df4d1739-47f0-60c7-1706-3731fea6ab03"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/1a36f14a-8bd8-45f5-abe5-eef88d76ab5b"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/beb62be3-5e78-49bd-ac5f-099250ef3c7c"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/ba975338-f956-41e7-a9f2-7614832d382d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/d5a8d84a-9ad0-42e2-80e0-d38e3d46028a"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/5a3d6cdd-8eb3-46d2-ba11-d24a0d47fe65"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/d8326952-60bb-40fb-b33f-51e662708a88"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/08e628db-e2ed-4793-bc91-d13e684401c3"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/5f88450f-9546-4b78-a181-a2d9162bb441"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/add45209-73f6-4fa5-a5a5-74a451b07fbe"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/dbfc99e3-e648-4c3b-bd32-995e6268430d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/b3473ed6-78c0-40d5-b5f0-674e98924952"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/9dd55566-33b9-4c07-a959-14794ce02355"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/ad0b04b9-eaf9-49f8-b85e-724f9520e760"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/ece6ec5d-a862-4e22-a8db-271661216018"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/e40b679a-f44e-4366-87dd-7693e16a2128"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/0bdcd23c-4ff2-4077-aa14-eb6950bfbdd8"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/1f386f4e-449e-41e8-b829-a2fe01086ae1"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/2f6c8a5a-9407-467c-8082-0ad4ab915d77"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/3b1713ec-feb3-4b32-b5b0-251acff0a84a"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/049f1551-438b-444e-8904-a3c3afbcb43e"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/684307e9-62a8-4f2a-887a-4b90de5e4b98"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/0327f9da-f758-4d69-8903-55448b8cf70e"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/cc637123-c11e-40ee-adf8-93c0876481f4"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a7c8fa46-526d-4bf6-b8b3-17fa01310fd8"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/20f6c761-4dd7-4f27-9e37-6db8471486ef"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/ebc68898-5c0f-4353-a426-4a5f1e737b12"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/f67fb4ed-d481-44d7-91e5-efadf504f74a"), - // }}, - // DisplayName: to.Ptr("Restrict unauthorized network access"), - // MaxScore: to.Ptr[int32](4), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // DisplayName: to.Ptr("Restrict unauthorized network access"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](4), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](1), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("8fd574ec-43cf-426e-a439-a67cbaf2d564"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/8fd574ec-43cf-426e-a439-a67cbaf2d564"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // Definition: &armsecurity.SecureScoreControlDefinitionItem{ - // Name: to.Ptr("8fd574ec-43cf-426e-a439-a67cbaf2d564"), - // Type: to.Ptr("Microsoft.Security/secureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/secureScoreControlDefinitions/8fd574ec-43cf-426e-a439-a67cbaf2d564"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/d57a4221-a804-52ca-3dea-768284f06bb7"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/651967bf-044e-4bde-8376-3e08e0600105"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/b12bc79e-4f12-44db-acda-571820191ddc"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/7f04fc0c-4a3d-5c7e-ce19-666cb871b510"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/dbfc99e3-e648-4c3b-bd32-995e6268430d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/c01fab9f-bde1-4ba5-9d35-7de51f31c2d3"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/23b514bd-2afc-4a3e-8d3d-f4327118eee9"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/3053474d-4fab-4603-8d18-2a6dfd09f782"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/6be98232-0100-474a-b33d-ba9c1a747f70"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a7c8fa46-526d-4bf6-b8b3-17fa01310fd8"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/20f6c761-4dd7-4f27-9e37-6db8471486ef"), - // }}, - // DisplayName: to.Ptr("Enable encryption at rest"), - // MaxScore: to.Ptr[int32](4), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // DisplayName: to.Ptr("Enable encryption at rest"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](4), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](1), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](1), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScoreControls_example.json -func ExampleSecureScoreControlsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecureScoreControlsClient().NewListPager(&armsecurity.SecureScoreControlsClientListOptions{Expand: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SecureScoreControlList = armsecurity.SecureScoreControlList{ - // Value: []*armsecurity.SecureScoreControlDetails{ - // { - // Name: to.Ptr("a9909064-42b4-4d34-8143-275477afe18b"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/a9909064-42b4-4d34-8143-275477afe18b"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Protect applications against DDoS attacks"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](1), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](0), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](0), - // }, - // }, - // { - // Name: to.Ptr("34a42fb3-e6db-409c-b56b-7b1db6b8aee0"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/34a42fb3-e6db-409c-b56b-7b1db6b8aee0"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Enable MFA"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](10), - // Max: to.Ptr[int32](10), - // Percentage: to.Ptr[float64](1), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("76763537-9feb-42d3-b4f4-78c01117be80"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/76763537-9feb-42d3-b4f4-78c01117be80"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Implement security best practices"), - // HealthyResourceCount: to.Ptr[int32](7), - // NotApplicableResourceCount: to.Ptr[int32](1), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](0), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](7), - // }, - // }, - // { - // Name: to.Ptr("4db8d6cf-075b-4149-a813-da09ca2ae120"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/4db8d6cf-075b-4149-a813-da09ca2ae120"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Enable Advanced Threat Protection"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](0), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("27b24961-75ba-4fe4-8909-97286d5dd5ee"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/27b24961-75ba-4fe4-8909-97286d5dd5ee"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Enable auditing and logging"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0.2), - // Max: to.Ptr[int32](1), - // Percentage: to.Ptr[float64](0.2), - // }, - // UnhealthyResourceCount: to.Ptr[int32](4), - // Weight: to.Ptr[int64](5), - // }, - // }, - // { - // Name: to.Ptr("2d85f639-0bea-4a4a-b6c6-608952a1414a"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/2d85f639-0bea-4a4a-b6c6-608952a1414a"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Manage access and permissions"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](2), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](0.5), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](2), - // }, - // }, - // { - // Name: to.Ptr("99fc8df2-e0f5-40f8-9415-a7f7ca948b5a"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/99fc8df2-e0f5-40f8-9415-a7f7ca948b5a"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Remediate security configurations"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("12136bd9-dc24-44f2-9587-7be3af6aac14"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/12136bd9-dc24-44f2-9587-7be3af6aac14"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Enable endpoint protection"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](2), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("61702b76-1fab-41f2-bcbc-50b7870dcf38"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/61702b76-1fab-41f2-bcbc-50b7870dcf38"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Apply system updates"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](6), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("0e55495e-034f-4abc-8293-767229250176"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/0e55495e-034f-4abc-8293-767229250176"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Encrypt data in transit"), - // HealthyResourceCount: to.Ptr[int32](5), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](3.33), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](0.8325), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](6), - // }, - // }, - // { - // Name: to.Ptr("f9d5432b-8f7b-45e9-b90c-e214a30f6a02"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/f9d5432b-8f7b-45e9-b90c-e214a30f6a02"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Restrict unauthorized network access"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](4), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](1), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("8fd574ec-43cf-426e-a439-a67cbaf2d564"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/8fd574ec-43cf-426e-a439-a67cbaf2d564"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Enable encryption at rest"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](4), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](1), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](1), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/securescores_client_example_test.go b/sdk/resourcemanager/security/armsecurity/securescores_client_example_test.go deleted file mode 100644 index 7121e855e812..000000000000 --- a/sdk/resourcemanager/security/armsecurity/securescores_client_example_test.go +++ /dev/null @@ -1,94 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScores_example.json -func ExampleSecureScoresClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecureScoresClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SecureScoresList = armsecurity.SecureScoresList{ - // Value: []*armsecurity.SecureScoreItem{ - // { - // Name: to.Ptr("ascScore"), - // Type: to.Ptr("Microsoft.Security/secureScores"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore"), - // Properties: &armsecurity.SecureScoreItemProperties{ - // DisplayName: to.Ptr("ASC score"), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](23.53), - // Max: to.Ptr[int32](39), - // Percentage: to.Ptr[float64](0.6033), - // }, - // Weight: to.Ptr[int64](67), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/GetSecureScoresSingle_example.json -func ExampleSecureScoresClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSecureScoresClient().Get(ctx, "ascScore", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SecureScoreItem = armsecurity.SecureScoreItem{ - // Name: to.Ptr("ascScore"), - // Type: to.Ptr("Microsoft.Security/secureScores"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore"), - // Properties: &armsecurity.SecureScoreItemProperties{ - // DisplayName: to.Ptr("ASC score"), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](23.53), - // Max: to.Ptr[int32](39), - // Percentage: to.Ptr[float64](0.6033), - // }, - // Weight: to.Ptr[int64](67), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessment_client_example_test.go b/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessment_client_example_test.go deleted file mode 100644 index 75decd8b0cdf..000000000000 --- a/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessment_client_example_test.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/ListByExtendedResourceServerVulnerabilityAssessments_example.json -func ExampleServerVulnerabilityAssessmentClient_ListByExtendedResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerVulnerabilityAssessmentClient().ListByExtendedResource(ctx, "rg1", "Microsoft.Compute", "virtualMachines", "vm1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerVulnerabilityAssessmentsList = armsecurity.ServerVulnerabilityAssessmentsList{ - // Value: []*armsecurity.ServerVulnerabilityAssessment{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/serverVulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Security/serverVulnerabilityAssessments/default"), - // Properties: &armsecurity.ServerVulnerabilityAssessmentProperties{ - // ProvisioningState: to.Ptr(armsecurity.ServerVulnerabilityAssessmentPropertiesProvisioningStateSucceeded), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/GetServerVulnerabilityAssessments_example.json -func ExampleServerVulnerabilityAssessmentClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerVulnerabilityAssessmentClient().Get(ctx, "rg1", "Microsoft.Compute", "virtualMachines", "vm1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerVulnerabilityAssessment = armsecurity.ServerVulnerabilityAssessment{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/serverVulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Security/serverVulnerabilityAssessments/default"), - // Properties: &armsecurity.ServerVulnerabilityAssessmentProperties{ - // ProvisioningState: to.Ptr(armsecurity.ServerVulnerabilityAssessmentPropertiesProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/CreateServerVulnerabilityAssessments_example.json -func ExampleServerVulnerabilityAssessmentClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewServerVulnerabilityAssessmentClient().CreateOrUpdate(ctx, "rg1", "Microsoft.Compute", "virtualMachines", "vm1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/DeleteServerVulnerabilityAssessments_example.json -func ExampleServerVulnerabilityAssessmentClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerVulnerabilityAssessmentClient().BeginDelete(ctx, "rg1", "Microsoft.Compute", "virtualMachines", "vm1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/settings_client_example_test.go b/sdk/resourcemanager/security/armsecurity/settings_client_example_test.go deleted file mode 100644 index e527580b86c8..000000000000 --- a/sdk/resourcemanager/security/armsecurity/settings_client_example_test.go +++ /dev/null @@ -1,159 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSettings_example.json -func ExampleSettingsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSettingsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SettingsList = armsecurity.SettingsList{ - // Value: []armsecurity.SettingClassification{ - // &armsecurity.DataExportSettings{ - // Name: to.Ptr("MCAS"), - // Type: to.Ptr("Microsoft.Security/settings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/MCAS"), - // Kind: to.Ptr(armsecurity.SettingKindDataExportSettings), - // Properties: &armsecurity.DataExportSettingProperties{ - // Enabled: to.Ptr(true), - // }, - // }, - // &armsecurity.DataExportSettings{ - // Name: to.Ptr("WDATP"), - // Type: to.Ptr("Microsoft.Security/settings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/WDATP"), - // Kind: to.Ptr(armsecurity.SettingKindDataExportSettings), - // Properties: &armsecurity.DataExportSettingProperties{ - // Enabled: to.Ptr(false), - // }, - // }, - // &armsecurity.DataExportSettings{ - // Name: to.Ptr("WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW"), - // Type: to.Ptr("Microsoft.Security/settings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW"), - // Kind: to.Ptr(armsecurity.SettingKindDataExportSettings), - // Properties: &armsecurity.DataExportSettingProperties{ - // Enabled: to.Ptr(false), - // }, - // }, - // &armsecurity.DataExportSettings{ - // Name: to.Ptr("WDATP_UNIFIED_SOLUTION"), - // Type: to.Ptr("Microsoft.Security/settings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/WDATP_UNIFIED_SOLUTION"), - // Kind: to.Ptr(armsecurity.SettingKindDataExportSettings), - // Properties: &armsecurity.DataExportSettingProperties{ - // Enabled: to.Ptr(false), - // }, - // }, - // &armsecurity.AlertSyncSettings{ - // Name: to.Ptr("Sentinel"), - // Type: to.Ptr("Microsoft.Security/settings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/Sentinel"), - // Kind: to.Ptr(armsecurity.SettingKindAlertSyncSettings), - // Properties: &armsecurity.AlertSyncSettingProperties{ - // Enabled: to.Ptr(false), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSetting_example.json -func ExampleSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSettingsClient().Get(ctx, armsecurity.SettingNameMCAS, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armsecurity.SettingsClientGetResponse{ - // SettingClassification: &armsecurity.DataExportSettings{ - // Name: to.Ptr("MCAS"), - // Type: to.Ptr("Microsoft.Security/settings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/MCAS"), - // Kind: to.Ptr(armsecurity.SettingKindDataExportSettings), - // Properties: &armsecurity.DataExportSettingProperties{ - // Enabled: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/UpdateSetting_example.json -func ExampleSettingsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSettingsClient().Update(ctx, armsecurity.SettingNameMCAS, &armsecurity.DataExportSettings{ - Kind: to.Ptr(armsecurity.SettingKindDataExportSettings), - Properties: &armsecurity.DataExportSettingProperties{ - Enabled: to.Ptr(true), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armsecurity.SettingsClientUpdateResponse{ - // SettingClassification: &armsecurity.DataExportSettings{ - // Name: to.Ptr("MCAS"), - // Type: to.Ptr("Microsoft.Security/settings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/MCAS"), - // Kind: to.Ptr(armsecurity.SettingKindDataExportSettings), - // Properties: &armsecurity.DataExportSettingProperties{ - // Enabled: to.Ptr(true), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/softwareinventories_client_example_test.go b/sdk/resourcemanager/security/armsecurity/softwareinventories_client_example_test.go deleted file mode 100644 index d6f35c067492..000000000000 --- a/sdk/resourcemanager/security/armsecurity/softwareinventories_client_example_test.go +++ /dev/null @@ -1,169 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/SoftwareInventories/ListByExtendedResourceSoftwareInventories_example.json -func ExampleSoftwareInventoriesClient_NewListByExtendedResourcePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSoftwareInventoriesClient().NewListByExtendedResourcePager("EITAN-TESTS", "Microsoft.Compute", "virtualMachines", "Eitan-Test1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SoftwaresList = armsecurity.SoftwaresList{ - // Value: []*armsecurity.Software{ - // { - // Name: to.Ptr("outlook_16.0.10371.20060"), - // Type: to.Ptr("Microsoft.Security/softwareInventories"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/EITAN-TESTS/providers/Microsoft.Compute/virtualMachines/Eitan-Test1/providers/Microsoft.Security/softwareInventories/outlook_16.0.10371.20060"), - // Properties: &armsecurity.SoftwareProperties{ - // DeviceID: to.Ptr("7bd19ed6b07553e52a2844451bcec68d25963a53"), - // EndOfSupportStatus: to.Ptr(armsecurity.EndOfSupportStatusNone), - // FirstSeenAt: to.Ptr("2021-01-26 15:48:56"), - // NumberOfKnownVulnerabilities: to.Ptr[int32](0), - // OSPlatform: to.Ptr("Windows10"), - // SoftwareName: to.Ptr("outlook"), - // Vendor: to.Ptr("microsoft"), - // Version: to.Ptr("16.0.10371.20060"), - // }, - // }, - // { - // Name: to.Ptr("windows_10_10.0.19042.746"), - // Type: to.Ptr("Microsoft.Security/softwareInventories"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/EITAN-TESTS/providers/Microsoft.Compute/virtualMachines/Eitan-Test1/providers/Microsoft.Security/softwareInventories/windows_10_10.0.19042.746"), - // Properties: &armsecurity.SoftwareProperties{ - // DeviceID: to.Ptr("7bd19ed6b07553e52a2844451bcec68d25963a53"), - // EndOfSupportStatus: to.Ptr(armsecurity.EndOfSupportStatusNone), - // FirstSeenAt: to.Ptr("2021-01-26 15:51:19"), - // NumberOfKnownVulnerabilities: to.Ptr[int32](26), - // OSPlatform: to.Ptr("Windows10"), - // SoftwareName: to.Ptr("windows_10"), - // Vendor: to.Ptr("microsoft"), - // Version: to.Ptr("10.0.19042.746"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/SoftwareInventories/ListBySubscriptionSoftwareInventories_example.json -func ExampleSoftwareInventoriesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSoftwareInventoriesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SoftwaresList = armsecurity.SoftwaresList{ - // Value: []*armsecurity.Software{ - // { - // Name: to.Ptr("outlook_16.0.10371.20060"), - // Type: to.Ptr("Microsoft.Security/softwareInventories"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/EITAN-TESTS/providers/Microsoft.Compute/virtualMachines/Eitan-Test1/providers/Microsoft.Security/softwareInventories/outlook_16.0.10371.20060"), - // Properties: &armsecurity.SoftwareProperties{ - // DeviceID: to.Ptr("7bd19ed6b07553e52a2844451bcec68d25963a53"), - // EndOfSupportStatus: to.Ptr(armsecurity.EndOfSupportStatusNone), - // FirstSeenAt: to.Ptr("2021-01-26 15:48:56"), - // NumberOfKnownVulnerabilities: to.Ptr[int32](0), - // OSPlatform: to.Ptr("Windows10"), - // SoftwareName: to.Ptr("outlook"), - // Vendor: to.Ptr("microsoft"), - // Version: to.Ptr("16.0.10371.20060"), - // }, - // }, - // { - // Name: to.Ptr("windows_10_10.0.19042.746"), - // Type: to.Ptr("Microsoft.Security/softwareInventories"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/EITAN-TESTS/providers/Microsoft.Compute/virtualMachines/Eitan-Test2/providers/Microsoft.Security/softwareInventories/windows_10_10.0.19042.746"), - // Properties: &armsecurity.SoftwareProperties{ - // DeviceID: to.Ptr("7bd19ed6b07553e52a2844451bcec68d25963a53"), - // EndOfSupportStatus: to.Ptr(armsecurity.EndOfSupportStatusNone), - // FirstSeenAt: to.Ptr("2021-01-26 15:51:19"), - // NumberOfKnownVulnerabilities: to.Ptr[int32](26), - // OSPlatform: to.Ptr("Windows10"), - // SoftwareName: to.Ptr("windows_10"), - // Vendor: to.Ptr("microsoft"), - // Version: to.Ptr("10.0.19042.746"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/SoftwareInventories/GetSoftware_example.json -func ExampleSoftwareInventoriesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSoftwareInventoriesClient().Get(ctx, "EITAN-TESTS", "Microsoft.Compute", "virtualMachines", "Eitan-Test1", "outlook_16.0.10371.20060", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Software = armsecurity.Software{ - // Name: to.Ptr("outlook_16.0.10371.20060"), - // Type: to.Ptr("Microsoft.Security/softwareInventories"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/EITAN-TESTS/providers/Microsoft.Compute/virtualMachines/Eitan-Test1/providers/Microsoft.Security/softwareInventories/outlook_16.0.10371.20060"), - // Properties: &armsecurity.SoftwareProperties{ - // DeviceID: to.Ptr("7bd19ed6b07553e52a2844451bcec68d25963a53"), - // EndOfSupportStatus: to.Ptr(armsecurity.EndOfSupportStatusNone), - // FirstSeenAt: to.Ptr("2021-01-26 15:48:56"), - // NumberOfKnownVulnerabilities: to.Ptr[int32](0), - // OSPlatform: to.Ptr("Windows10"), - // SoftwareName: to.Ptr("outlook"), - // Vendor: to.Ptr("microsoft"), - // Version: to.Ptr("16.0.10371.20060"), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/solutions_client_example_test.go b/sdk/resourcemanager/security/armsecurity/solutions_client_example_test.go deleted file mode 100644 index 0a3e9bb2bfb8..000000000000 --- a/sdk/resourcemanager/security/armsecurity/solutions_client_example_test.go +++ /dev/null @@ -1,102 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutions/GetSecuritySolutionsSubscription_example.json -func ExampleSolutionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSolutionsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SolutionList = armsecurity.SolutionList{ - // Value: []*armsecurity.Solution{ - // { - // Location: to.Ptr("eastus"), - // Name: to.Ptr("MySaasWaf"), - // Type: to.Ptr("Microsoft.Security/locations/securitySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/centralus/securitySolutions/SaasWaf"), - // Properties: &armsecurity.SolutionProperties{ - // ProtectionStatus: to.Ptr("Good"), - // ProvisioningState: to.Ptr(armsecurity.ProvisioningStateSucceeded), - // SecurityFamily: to.Ptr(armsecurity.SecurityFamilySaasWaf), - // Template: to.Ptr("microsoft/ApplicationGateway-ARM"), - // }, - // }, - // { - // Location: to.Ptr("eastus2"), - // Name: to.Ptr("MyVA"), - // Type: to.Ptr("Microsoft.Security/locations/securitySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg2/providers/Microsoft.Security/locations/centralus/securitySolutions/MyVA"), - // Properties: &armsecurity.SolutionProperties{ - // ProtectionStatus: to.Ptr("Good"), - // ProvisioningState: to.Ptr(armsecurity.ProvisioningStateSucceeded), - // SecurityFamily: to.Ptr(armsecurity.SecurityFamilyVa), - // Template: to.Ptr("qualys.qualysAgent"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutions/GetSecuritySolutionsResourceGroupLocation_example.json -func ExampleSolutionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSolutionsClient().Get(ctx, "myRg2", "centralus", "paloalto7", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Solution = armsecurity.Solution{ - // Location: to.Ptr("eastus2"), - // Name: to.Ptr("MyVA"), - // Type: to.Ptr("Microsoft.Security/locations/securitySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg2/providers/Microsoft.Security/locations/centralus/securitySolutions/paloalto7"), - // Properties: &armsecurity.SolutionProperties{ - // ProtectionStatus: to.Ptr("Good"), - // ProvisioningState: to.Ptr(armsecurity.ProvisioningStateSucceeded), - // SecurityFamily: to.Ptr(armsecurity.SecurityFamilyNgfw), - // Template: to.Ptr("paloalto.paloaltofw"), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/solutionsreferencedata_client_example_test.go b/sdk/resourcemanager/security/armsecurity/solutionsreferencedata_client_example_test.go deleted file mode 100644 index afa224e48e1b..000000000000 --- a/sdk/resourcemanager/security/armsecurity/solutionsreferencedata_client_example_test.go +++ /dev/null @@ -1,120 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutionsReferenceData/GetSecuritySolutionsReferenceDataSubscription_example.json -func ExampleSolutionsReferenceDataClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSolutionsReferenceDataClient().List(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SolutionsReferenceDataList = armsecurity.SolutionsReferenceDataList{ - // Value: []*armsecurity.SolutionsReferenceData{ - // { - // Name: to.Ptr("microsoft.ApplicationGateway-ARM"), - // Type: to.Ptr("Microsoft.Security/locations/securitySolutionsReferenceData"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/westcentralus/securitySolutionsReferenceData/microsoft.ApplicationGateway-ARM"), - // Properties: &armsecurity.SolutionsReferenceDataProperties{ - // AlertVendorName: to.Ptr("Microsoft"), - // PackageInfoURL: to.Ptr("www.azure.com"), - // ProductName: to.Ptr("Web Application Firewall"), - // Publisher: to.Ptr("microsoft"), - // PublisherDisplayName: to.Ptr("Microsoft Inc."), - // SecurityFamily: to.Ptr(armsecurity.SecurityFamilySaasWaf), - // Template: to.Ptr("microsoft/ApplicationGateway-ARM"), - // }, - // }, - // { - // Name: to.Ptr("qualys.qualysAgent"), - // Type: to.Ptr("Microsoft.Security/locations/SecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/westcentralus/securitySolutionsReferenceData/qualys.qualysAgent"), - // Properties: &armsecurity.SolutionsReferenceDataProperties{ - // AlertVendorName: to.Ptr("Qualys VA"), - // PackageInfoURL: to.Ptr("http://www.qualys.com/"), - // ProductName: to.Ptr("Vulnerability Assessment"), - // Publisher: to.Ptr("qualys"), - // PublisherDisplayName: to.Ptr("Qualys, Inc."), - // SecurityFamily: to.Ptr(armsecurity.SecurityFamilyVa), - // Template: to.Ptr("qualys/qualysAgent"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutionsReferenceData/GetSecuritySolutionsReferenceDataSubscriptionLocation_example.json -func ExampleSolutionsReferenceDataClient_ListByHomeRegion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSolutionsReferenceDataClient().ListByHomeRegion(ctx, "westcentralus", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SolutionsReferenceDataList = armsecurity.SolutionsReferenceDataList{ - // Value: []*armsecurity.SolutionsReferenceData{ - // { - // Name: to.Ptr("microsoft.ApplicationGateway-ARM"), - // Type: to.Ptr("Microsoft.Security/locations/securitySolutionsReferenceData"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/westcentralus/securitySolutionsReferenceData/microsoft.ApplicationGateway-ARM"), - // Properties: &armsecurity.SolutionsReferenceDataProperties{ - // AlertVendorName: to.Ptr("Microsoft"), - // PackageInfoURL: to.Ptr("www.azure.com"), - // ProductName: to.Ptr("Web Application Firewall"), - // Publisher: to.Ptr("microsoft"), - // PublisherDisplayName: to.Ptr("Microsoft Inc."), - // SecurityFamily: to.Ptr(armsecurity.SecurityFamilySaasWaf), - // Template: to.Ptr("microsoft/ApplicationGateway-ARM"), - // }, - // }, - // { - // Name: to.Ptr("qualys.qualysAgent"), - // Type: to.Ptr("Microsoft.Security/locations/SecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/westcentralus/securitySolutionsReferenceData/qualys.qualysAgent"), - // Properties: &armsecurity.SolutionsReferenceDataProperties{ - // AlertVendorName: to.Ptr("Qualys VA"), - // PackageInfoURL: to.Ptr("http://www.qualys.com/"), - // ProductName: to.Ptr("Vulnerability Assessment"), - // Publisher: to.Ptr("qualys"), - // PublisherDisplayName: to.Ptr("Qualys, Inc."), - // SecurityFamily: to.Ptr(armsecurity.SecurityFamilyVa), - // Template: to.Ptr("qualys/qualysAgent"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentbaselinerules_client.go b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentbaselinerules_client.go index 7d3a69c3b8bb..a2e6df1c9587 100644 --- a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentbaselinerules_client.go +++ b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentbaselinerules_client.go @@ -44,7 +44,7 @@ func NewSQLVulnerabilityAssessmentBaselineRulesClient(credential azcore.TokenCre // Add - Add a list of baseline rules. Will overwrite any previously existing results (for all rules). // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-07-01-preview +// Generated from API version 2023-02-01-preview // - workspaceID - The workspace Id. // - resourceID - The identifier of the resource. // - options - SQLVulnerabilityAssessmentBaselineRulesClientAddOptions contains the optional parameters for the SQLVulnerabilityAssessmentBaselineRulesClient.Add @@ -74,7 +74,7 @@ func (client *SQLVulnerabilityAssessmentBaselineRulesClient) addCreateRequest(ct } reqQP := req.Raw().URL.Query() reqQP.Set("workspaceId", workspaceID) - reqQP.Set("api-version", "2020-07-01-preview") + reqQP.Set("api-version", "2023-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { @@ -95,7 +95,7 @@ func (client *SQLVulnerabilityAssessmentBaselineRulesClient) addHandleResponse(r // CreateOrUpdate - Creates a Baseline for a rule in a database. Will overwrite any previously existing results. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-07-01-preview +// Generated from API version 2023-02-01-preview // - ruleID - The rule Id. // - workspaceID - The workspace Id. // - resourceID - The identifier of the resource. @@ -130,7 +130,7 @@ func (client *SQLVulnerabilityAssessmentBaselineRulesClient) createOrUpdateCreat } reqQP := req.Raw().URL.Query() reqQP.Set("workspaceId", workspaceID) - reqQP.Set("api-version", "2020-07-01-preview") + reqQP.Set("api-version", "2023-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { @@ -151,7 +151,7 @@ func (client *SQLVulnerabilityAssessmentBaselineRulesClient) createOrUpdateHandl // Delete - Deletes a rule from the Baseline of a given database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-07-01-preview +// Generated from API version 2023-02-01-preview // - ruleID - The rule Id. // - workspaceID - The workspace Id. // - resourceID - The identifier of the resource. @@ -186,7 +186,7 @@ func (client *SQLVulnerabilityAssessmentBaselineRulesClient) deleteCreateRequest } reqQP := req.Raw().URL.Query() reqQP.Set("workspaceId", workspaceID) - reqQP.Set("api-version", "2020-07-01-preview") + reqQP.Set("api-version", "2023-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -195,7 +195,7 @@ func (client *SQLVulnerabilityAssessmentBaselineRulesClient) deleteCreateRequest // Get - Gets the results for a given rule in the Baseline. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-07-01-preview +// Generated from API version 2023-02-01-preview // - ruleID - The rule Id. // - workspaceID - The workspace Id. // - resourceID - The identifier of the resource. @@ -230,7 +230,7 @@ func (client *SQLVulnerabilityAssessmentBaselineRulesClient) getCreateRequest(ct } reqQP := req.Raw().URL.Query() reqQP.Set("workspaceId", workspaceID) - reqQP.Set("api-version", "2020-07-01-preview") + reqQP.Set("api-version", "2023-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,7 +248,7 @@ func (client *SQLVulnerabilityAssessmentBaselineRulesClient) getHandleResponse(r // List - Gets the results for all rules in the Baseline. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-07-01-preview +// Generated from API version 2023-02-01-preview // - workspaceID - The workspace Id. // - resourceID - The identifier of the resource. // - options - SQLVulnerabilityAssessmentBaselineRulesClientListOptions contains the optional parameters for the SQLVulnerabilityAssessmentBaselineRulesClient.List @@ -278,7 +278,7 @@ func (client *SQLVulnerabilityAssessmentBaselineRulesClient) listCreateRequest(c } reqQP := req.Raw().URL.Query() reqQP.Set("workspaceId", workspaceID) - reqQP.Set("api-version", "2020-07-01-preview") + reqQP.Set("api-version", "2023-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentbaselinerules_client_example_test.go b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentbaselinerules_client_example_test.go deleted file mode 100644 index f7dca1d32b68..000000000000 --- a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentbaselinerules_client_example_test.go +++ /dev/null @@ -1,320 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Put.json -func ExampleSQLVulnerabilityAssessmentBaselineRulesClient_CreateOrUpdate_createABaseline() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentBaselineRulesClient().CreateOrUpdate(ctx, "VA1234", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", &armsecurity.SQLVulnerabilityAssessmentBaselineRulesClientCreateOrUpdateOptions{Body: &armsecurity.RuleResultsInput{ - LatestScan: to.Ptr(false), - Results: [][]*string{ - { - to.Ptr("userA"), - to.Ptr("SELECT")}, - { - to.Ptr("userB"), - to.Ptr("SELECT")}}, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RuleResults = armsecurity.RuleResults{ - // Name: to.Ptr("VA1234"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/baselineRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/VA1234"), - // Properties: &armsecurity.RuleResultsProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("userA"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userB"), - // to.Ptr("SELECT")}}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_PutLatest.json -func ExampleSQLVulnerabilityAssessmentBaselineRulesClient_CreateOrUpdate_createABaselineUsingTheLatestScanResults() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentBaselineRulesClient().CreateOrUpdate(ctx, "VA1234", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", &armsecurity.SQLVulnerabilityAssessmentBaselineRulesClientCreateOrUpdateOptions{Body: &armsecurity.RuleResultsInput{ - LatestScan: to.Ptr(true), - Results: [][]*string{}, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RuleResults = armsecurity.RuleResults{ - // Name: to.Ptr("VA1234"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/baselineRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/VA1234"), - // Properties: &armsecurity.RuleResultsProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("userA"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userB"), - // to.Ptr("SELECT")}}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Get.json -func ExampleSQLVulnerabilityAssessmentBaselineRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentBaselineRulesClient().Get(ctx, "VA1234", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RuleResults = armsecurity.RuleResults{ - // Name: to.Ptr("VA1234"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/baselineRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/VA1234"), - // Properties: &armsecurity.RuleResultsProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("userA"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userB"), - // to.Ptr("SELECT")}}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Delete.json -func ExampleSQLVulnerabilityAssessmentBaselineRulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewSQLVulnerabilityAssessmentBaselineRulesClient().Delete(ctx, "VA1234", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_List.json -func ExampleSQLVulnerabilityAssessmentBaselineRulesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentBaselineRulesClient().List(ctx, "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RulesResults = armsecurity.RulesResults{ - // Value: []*armsecurity.RuleResults{ - // { - // Name: to.Ptr("VA1234"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/baselineRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/VA1234"), - // Properties: &armsecurity.RuleResultsProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("userA"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userB"), - // to.Ptr("SELECT")}}, - // }, - // }, - // { - // Name: to.Ptr("VA5678"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/baselineRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/VA5678"), - // Properties: &armsecurity.RuleResultsProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Add.json -func ExampleSQLVulnerabilityAssessmentBaselineRulesClient_Add_createABaselineForAllRules() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentBaselineRulesClient().Add(ctx, "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", &armsecurity.SQLVulnerabilityAssessmentBaselineRulesClientAddOptions{Body: &armsecurity.RulesResultsInput{ - LatestScan: to.Ptr(false), - Results: map[string][][]*string{ - "VA1234": { - { - to.Ptr("userA"), - to.Ptr("SELECT")}, - { - to.Ptr("userB"), - to.Ptr("SELECT")}}, - "VA5678": { - { - to.Ptr("Test"), - to.Ptr("0.0.0.0"), - to.Ptr("125.125.125.125")}}, - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RulesResults = armsecurity.RulesResults{ - // Value: []*armsecurity.RuleResults{ - // { - // Name: to.Ptr("VA1234"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/baselineRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/VA1234"), - // Properties: &armsecurity.RuleResultsProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("userA"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userB"), - // to.Ptr("SELECT")}}, - // }, - // }, - // { - // Name: to.Ptr("VA5678"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/baselineRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/VA5678"), - // Properties: &armsecurity.RuleResultsProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_AddLatest.json -func ExampleSQLVulnerabilityAssessmentBaselineRulesClient_Add_createABaselineForAllRulesUsingTheLatestScanResults() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentBaselineRulesClient().Add(ctx, "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", &armsecurity.SQLVulnerabilityAssessmentBaselineRulesClientAddOptions{Body: &armsecurity.RulesResultsInput{ - LatestScan: to.Ptr(true), - Results: map[string][][]*string{}, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RulesResults = armsecurity.RulesResults{ - // Value: []*armsecurity.RuleResults{ - // { - // Name: to.Ptr("VA1234"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/baselineRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/VA1234"), - // Properties: &armsecurity.RuleResultsProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("userA"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userB"), - // to.Ptr("SELECT")}}, - // }, - // }, - // { - // Name: to.Ptr("VA5678"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/baselineRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/VA5678"), - // Properties: &armsecurity.RuleResultsProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscanresults_client.go b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscanresults_client.go index 761cedbb2bb4..22855d050c2f 100644 --- a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscanresults_client.go +++ b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscanresults_client.go @@ -44,7 +44,7 @@ func NewSQLVulnerabilityAssessmentScanResultsClient(credential azcore.TokenCrede // Get - Gets the scan results of a single rule in a scan record. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-07-01-preview +// Generated from API version 2023-02-01-preview // - scanID - The scan Id. Type 'latest' to get the scan results for the latest scan. // - scanResultID - The rule Id of the results. // - workspaceID - The workspace Id. @@ -84,7 +84,7 @@ func (client *SQLVulnerabilityAssessmentScanResultsClient) getCreateRequest(ctx } reqQP := req.Raw().URL.Query() reqQP.Set("workspaceId", workspaceID) - reqQP.Set("api-version", "2020-07-01-preview") + reqQP.Set("api-version", "2023-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -102,7 +102,7 @@ func (client *SQLVulnerabilityAssessmentScanResultsClient) getHandleResponse(res // List - Gets a list of scan results for a single scan record. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-07-01-preview +// Generated from API version 2023-02-01-preview // - scanID - The scan Id. Type 'latest' to get the scan results for the latest scan. // - workspaceID - The workspace Id. // - resourceID - The identifier of the resource. @@ -137,7 +137,7 @@ func (client *SQLVulnerabilityAssessmentScanResultsClient) listCreateRequest(ctx } reqQP := req.Raw().URL.Query() reqQP.Set("workspaceId", workspaceID) - reqQP.Set("api-version", "2020-07-01-preview") + reqQP.Set("api-version", "2023-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscanresults_client_example_test.go b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscanresults_client_example_test.go deleted file mode 100644 index f59cb9c1fce4..000000000000 --- a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscanresults_client_example_test.go +++ /dev/null @@ -1,410 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_Get.json -func ExampleSQLVulnerabilityAssessmentScanResultsClient_Get_getScanDetailsOfAScanRecord() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentScanResultsClient().Get(ctx, "Scheduled-20200623", "VA2063", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScanResult = armsecurity.ScanResult{ - // Name: to.Ptr("VA2063"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/scans/scanResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/Scheduled-20200623/scanResults/VA2063"), - // Properties: &armsecurity.ScanResultProperties{ - // BaselineAdjustedResult: &armsecurity.BaselineAdjustedResult{ - // Baseline: &armsecurity.Baseline{ - // ExpectedResults: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // UpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T12:49:41.027771+00:00"); return t}()), - // }, - // ResultsNotInBaseline: [][]*string{ - // }, - // ResultsOnlyInBaseline: [][]*string{ - // }, - // Status: to.Ptr(armsecurity.RuleStatusNonFinding), - // }, - // IsTrimmed: to.Ptr(false), - // QueryResults: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // Remediation: &armsecurity.Remediation{ - // Description: to.Ptr("Remove server firewall rules that grant excessive access"), - // Automated: to.Ptr(false), - // PortalLink: to.Ptr("ReviewServerFirewallRules"), - // Scripts: []*string{ - // to.Ptr("EXECUTE sp_delete_firewall_rule N'Test';")}, - // }, - // RuleID: to.Ptr("VA2063"), - // RuleMetadata: &armsecurity.VaRule{ - // Description: to.Ptr("The Azure SQL server-level firewall helps protect your server by preventing all access to your databases until you specify which IP addresses have permission. Server-level firewall rules grant access to all databases that belong to the server based on the originating IP address of each request.\n\nServer-level firewall rules can only be created and managed through Transact-SQL as well as through the Azure portal or PowerShell. For more details please see: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-firewall-configure\n\nThis check verifies that server-level firewall rules do not grant excessive access."), - // BenchmarkReferences: []*armsecurity.BenchmarkReference{ - // }, - // Category: to.Ptr("SurfaceAreaReduction"), - // QueryCheck: &armsecurity.QueryCheck{ - // ColumnNames: []*string{ - // to.Ptr("Firewall Rule Name"), - // to.Ptr("Start Address"), - // to.Ptr("End Address")}, - // ExpectedResult: [][]*string{ - // }, - // Query: to.Ptr("SELECT name\n ,start_ip_address\n ,end_ip_address\nFROM sys.firewall_rules\nWHERE ( \n (CONVERT(bigint, parsename(end_ip_address, 1)) +\n CONVERT(bigint, parsename(end_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(end_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(end_ip_address, 4)) * 16777216 ) \n - \n (CONVERT(bigint, parsename(start_ip_address, 1)) +\n CONVERT(bigint, parsename(start_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(start_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(start_ip_address, 4)) * 16777216 )\n ) > 255;"), - // }, - // Rationale: to.Ptr("Often, administrators add rules that grant excessive access as part of a troubleshooting process � to eliminate the firewall as the source of a problem, they simply create a rule that allows all traffic to pass to the affected server.\n\nGranting excessive access using server firewall rules is a clear security concern, as it violates the principle of least privilege by allowing unnecessary access to your databases. In fact, it's the equivalent of placing the server outside of the firewall."), - // RuleID: to.Ptr("VA2063"), - // RuleType: to.Ptr(armsecurity.RuleTypeNegativeList), - // Severity: to.Ptr(armsecurity.RuleSeverityHigh), - // Title: to.Ptr("Server-level firewall rules should not grant excessive access"), - // }, - // Status: to.Ptr(armsecurity.RuleStatusFinding), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_GetLatest.json -func ExampleSQLVulnerabilityAssessmentScanResultsClient_Get_getScanDetailsOfTheLatestScanRecord() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentScanResultsClient().Get(ctx, "latest", "VA2063", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScanResult = armsecurity.ScanResult{ - // Name: to.Ptr("VA2063"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/scans/scanResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/Scheduled-20200623/scanResults/VA2063"), - // Properties: &armsecurity.ScanResultProperties{ - // BaselineAdjustedResult: &armsecurity.BaselineAdjustedResult{ - // Baseline: &armsecurity.Baseline{ - // ExpectedResults: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // UpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T12:49:41.027771+00:00"); return t}()), - // }, - // ResultsNotInBaseline: [][]*string{ - // }, - // ResultsOnlyInBaseline: [][]*string{ - // }, - // Status: to.Ptr(armsecurity.RuleStatusNonFinding), - // }, - // IsTrimmed: to.Ptr(false), - // QueryResults: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // Remediation: &armsecurity.Remediation{ - // Description: to.Ptr("Remove server firewall rules that grant excessive access"), - // Automated: to.Ptr(false), - // PortalLink: to.Ptr("ReviewServerFirewallRules"), - // Scripts: []*string{ - // to.Ptr("EXECUTE sp_delete_firewall_rule N'Test';")}, - // }, - // RuleID: to.Ptr("VA2063"), - // RuleMetadata: &armsecurity.VaRule{ - // Description: to.Ptr("The Azure SQL server-level firewall helps protect your server by preventing all access to your databases until you specify which IP addresses have permission. Server-level firewall rules grant access to all databases that belong to the server based on the originating IP address of each request.\n\nServer-level firewall rules can only be created and managed through Transact-SQL as well as through the Azure portal or PowerShell. For more details please see: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-firewall-configure\n\nThis check verifies that server-level firewall rules do not grant excessive access."), - // BenchmarkReferences: []*armsecurity.BenchmarkReference{ - // }, - // Category: to.Ptr("SurfaceAreaReduction"), - // QueryCheck: &armsecurity.QueryCheck{ - // ColumnNames: []*string{ - // to.Ptr("Firewall Rule Name"), - // to.Ptr("Start Address"), - // to.Ptr("End Address")}, - // ExpectedResult: [][]*string{ - // }, - // Query: to.Ptr("SELECT name\n ,start_ip_address\n ,end_ip_address\nFROM sys.firewall_rules\nWHERE ( \n (CONVERT(bigint, parsename(end_ip_address, 1)) +\n CONVERT(bigint, parsename(end_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(end_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(end_ip_address, 4)) * 16777216 ) \n - \n (CONVERT(bigint, parsename(start_ip_address, 1)) +\n CONVERT(bigint, parsename(start_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(start_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(start_ip_address, 4)) * 16777216 )\n ) > 255;"), - // }, - // Rationale: to.Ptr("Often, administrators add rules that grant excessive access as part of a troubleshooting process � to eliminate the firewall as the source of a problem, they simply create a rule that allows all traffic to pass to the affected server.\n\nGranting excessive access using server firewall rules is a clear security concern, as it violates the principle of least privilege by allowing unnecessary access to your databases. In fact, it's the equivalent of placing the server outside of the firewall."), - // RuleID: to.Ptr("VA2063"), - // RuleType: to.Ptr(armsecurity.RuleTypeNegativeList), - // Severity: to.Ptr(armsecurity.RuleSeverityHigh), - // Title: to.Ptr("Server-level firewall rules should not grant excessive access"), - // }, - // Status: to.Ptr(armsecurity.RuleStatusFinding), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_List.json -func ExampleSQLVulnerabilityAssessmentScanResultsClient_List_listScanResults() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentScanResultsClient().List(ctx, "Scheduled-20200623", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScanResults = armsecurity.ScanResults{ - // Value: []*armsecurity.ScanResult{ - // { - // Name: to.Ptr("VA2062"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/scans/scanResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/Scheduled-20200623/scanResults/VA2062"), - // Properties: &armsecurity.ScanResultProperties{ - // IsTrimmed: to.Ptr(false), - // QueryResults: [][]*string{ - // }, - // Remediation: &armsecurity.Remediation{ - // Description: to.Ptr("Remove database firewall rules that grant excessive access"), - // Automated: to.Ptr(false), - // PortalLink: to.Ptr(""), - // Scripts: []*string{ - // }, - // }, - // RuleID: to.Ptr("VA2062"), - // RuleMetadata: &armsecurity.VaRule{ - // Description: to.Ptr("The Azure SQL Database-level firewall helps protect your data by preventing all access to your database until you specify which IP addresses have permission. Database-level firewall rules grant access to the specific database based on the originating IP address of each request.\n\nDatabase-level firewall rules for master and user databases can only be created and managed through Transact-SQL (unlike server-level firewall rules which can also be created and managed using the Azure portal or PowerShell). For more details please see: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-firewall-configure\n\nThis check verifies that database-level firewall rules do not grant excessive access."), - // BenchmarkReferences: []*armsecurity.BenchmarkReference{ - // }, - // Category: to.Ptr("SurfaceAreaReduction"), - // QueryCheck: &armsecurity.QueryCheck{ - // ColumnNames: []*string{ - // to.Ptr("Firewall Rule Name"), - // to.Ptr("Start Address"), - // to.Ptr("End Address")}, - // ExpectedResult: [][]*string{ - // }, - // Query: to.Ptr("SELECT name\n ,start_ip_address\n ,end_ip_address\nFROM sys.database_firewall_rules\nWHERE ( \n (CONVERT(bigint, parsename(end_ip_address, 1)) +\n CONVERT(bigint, parsename(end_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(end_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(end_ip_address, 4)) * 16777216 ) \n - \n (CONVERT(bigint, parsename(start_ip_address, 1)) +\n CONVERT(bigint, parsename(start_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(start_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(start_ip_address, 4)) * 16777216 )\n ) > 255;"), - // }, - // Rationale: to.Ptr("Often, administrators add rules that grant excessive access as part of a troubleshooting process - to eliminate the firewall as the source of a problem, they simply create a rule that allows all traffic to pass to the affected database.\n\nGranting excessive access using database firewall rules is a clear security concern, as it violates the principle of least privilege by allowing unnecessary access to your database. In fact, it's the equivalent of placing the database outside of the firewall."), - // RuleID: to.Ptr("VA2062"), - // RuleType: to.Ptr(armsecurity.RuleTypeNegativeList), - // Severity: to.Ptr(armsecurity.RuleSeverityHigh), - // Title: to.Ptr("Database-level firewall rules should not grant excessive access"), - // }, - // Status: to.Ptr(armsecurity.RuleStatusNonFinding), - // }, - // }, - // { - // Name: to.Ptr("VA2063"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/scans/scanResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/Scheduled-20200623/scanResults/VA2063"), - // Properties: &armsecurity.ScanResultProperties{ - // BaselineAdjustedResult: &armsecurity.BaselineAdjustedResult{ - // Baseline: &armsecurity.Baseline{ - // ExpectedResults: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // UpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T12:49:41.027771+00:00"); return t}()), - // }, - // ResultsNotInBaseline: [][]*string{ - // }, - // ResultsOnlyInBaseline: [][]*string{ - // }, - // Status: to.Ptr(armsecurity.RuleStatusNonFinding), - // }, - // IsTrimmed: to.Ptr(false), - // QueryResults: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // Remediation: &armsecurity.Remediation{ - // Description: to.Ptr("Remove server firewall rules that grant excessive access"), - // Automated: to.Ptr(false), - // PortalLink: to.Ptr("ReviewServerFirewallRules"), - // Scripts: []*string{ - // to.Ptr("EXECUTE sp_delete_firewall_rule N'Test';")}, - // }, - // RuleID: to.Ptr("VA2063"), - // RuleMetadata: &armsecurity.VaRule{ - // Description: to.Ptr("The Azure SQL server-level firewall helps protect your server by preventing all access to your databases until you specify which IP addresses have permission. Server-level firewall rules grant access to all databases that belong to the server based on the originating IP address of each request.\n\nServer-level firewall rules can only be created and managed through Transact-SQL as well as through the Azure portal or PowerShell. For more details please see: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-firewall-configure\n\nThis check verifies that server-level firewall rules do not grant excessive access."), - // BenchmarkReferences: []*armsecurity.BenchmarkReference{ - // }, - // Category: to.Ptr("SurfaceAreaReduction"), - // QueryCheck: &armsecurity.QueryCheck{ - // ColumnNames: []*string{ - // to.Ptr("Firewall Rule Name"), - // to.Ptr("Start Address"), - // to.Ptr("End Address")}, - // ExpectedResult: [][]*string{ - // }, - // Query: to.Ptr("SELECT name\n ,start_ip_address\n ,end_ip_address\nFROM sys.firewall_rules\nWHERE ( \n (CONVERT(bigint, parsename(end_ip_address, 1)) +\n CONVERT(bigint, parsename(end_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(end_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(end_ip_address, 4)) * 16777216 ) \n - \n (CONVERT(bigint, parsename(start_ip_address, 1)) +\n CONVERT(bigint, parsename(start_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(start_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(start_ip_address, 4)) * 16777216 )\n ) > 255;"), - // }, - // Rationale: to.Ptr("Often, administrators add rules that grant excessive access as part of a troubleshooting process � to eliminate the firewall as the source of a problem, they simply create a rule that allows all traffic to pass to the affected server.\n\nGranting excessive access using server firewall rules is a clear security concern, as it violates the principle of least privilege by allowing unnecessary access to your databases. In fact, it's the equivalent of placing the server outside of the firewall."), - // RuleID: to.Ptr("VA2063"), - // RuleType: to.Ptr(armsecurity.RuleTypeNegativeList), - // Severity: to.Ptr(armsecurity.RuleSeverityHigh), - // Title: to.Ptr("Server-level firewall rules should not grant excessive access"), - // }, - // Status: to.Ptr(armsecurity.RuleStatusFinding), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_ListLatest.json -func ExampleSQLVulnerabilityAssessmentScanResultsClient_List_listScanResultsOfTheLatestScan() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentScanResultsClient().List(ctx, "latest", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScanResults = armsecurity.ScanResults{ - // Value: []*armsecurity.ScanResult{ - // { - // Name: to.Ptr("VA2062"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/scans/scanResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/Scheduled-20200623/scanResults/VA2062"), - // Properties: &armsecurity.ScanResultProperties{ - // IsTrimmed: to.Ptr(false), - // QueryResults: [][]*string{ - // }, - // Remediation: &armsecurity.Remediation{ - // Description: to.Ptr("Remove database firewall rules that grant excessive access"), - // Automated: to.Ptr(false), - // PortalLink: to.Ptr(""), - // Scripts: []*string{ - // }, - // }, - // RuleID: to.Ptr("VA2062"), - // RuleMetadata: &armsecurity.VaRule{ - // Description: to.Ptr("The Azure SQL Database-level firewall helps protect your data by preventing all access to your database until you specify which IP addresses have permission. Database-level firewall rules grant access to the specific database based on the originating IP address of each request.\n\nDatabase-level firewall rules for master and user databases can only be created and managed through Transact-SQL (unlike server-level firewall rules which can also be created and managed using the Azure portal or PowerShell). For more details please see: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-firewall-configure\n\nThis check verifies that database-level firewall rules do not grant excessive access."), - // BenchmarkReferences: []*armsecurity.BenchmarkReference{ - // }, - // Category: to.Ptr("SurfaceAreaReduction"), - // QueryCheck: &armsecurity.QueryCheck{ - // ColumnNames: []*string{ - // to.Ptr("Firewall Rule Name"), - // to.Ptr("Start Address"), - // to.Ptr("End Address")}, - // ExpectedResult: [][]*string{ - // }, - // Query: to.Ptr("SELECT name\n ,start_ip_address\n ,end_ip_address\nFROM sys.database_firewall_rules\nWHERE ( \n (CONVERT(bigint, parsename(end_ip_address, 1)) +\n CONVERT(bigint, parsename(end_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(end_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(end_ip_address, 4)) * 16777216 ) \n - \n (CONVERT(bigint, parsename(start_ip_address, 1)) +\n CONVERT(bigint, parsename(start_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(start_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(start_ip_address, 4)) * 16777216 )\n ) > 255;"), - // }, - // Rationale: to.Ptr("Often, administrators add rules that grant excessive access as part of a troubleshooting process - to eliminate the firewall as the source of a problem, they simply create a rule that allows all traffic to pass to the affected database.\n\nGranting excessive access using database firewall rules is a clear security concern, as it violates the principle of least privilege by allowing unnecessary access to your database. In fact, it's the equivalent of placing the database outside of the firewall."), - // RuleID: to.Ptr("VA2062"), - // RuleType: to.Ptr(armsecurity.RuleTypeNegativeList), - // Severity: to.Ptr(armsecurity.RuleSeverityHigh), - // Title: to.Ptr("Database-level firewall rules should not grant excessive access"), - // }, - // Status: to.Ptr(armsecurity.RuleStatusNonFinding), - // }, - // }, - // { - // Name: to.Ptr("VA2063"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/scans/scanResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/Scheduled-20200623/scanResults/VA2063"), - // Properties: &armsecurity.ScanResultProperties{ - // BaselineAdjustedResult: &armsecurity.BaselineAdjustedResult{ - // Baseline: &armsecurity.Baseline{ - // ExpectedResults: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // UpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T12:49:41.027771+00:00"); return t}()), - // }, - // ResultsNotInBaseline: [][]*string{ - // }, - // ResultsOnlyInBaseline: [][]*string{ - // }, - // Status: to.Ptr(armsecurity.RuleStatusNonFinding), - // }, - // IsTrimmed: to.Ptr(false), - // QueryResults: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // Remediation: &armsecurity.Remediation{ - // Description: to.Ptr("Remove server firewall rules that grant excessive access"), - // Automated: to.Ptr(false), - // PortalLink: to.Ptr("ReviewServerFirewallRules"), - // Scripts: []*string{ - // to.Ptr("EXECUTE sp_delete_firewall_rule N'Test';")}, - // }, - // RuleID: to.Ptr("VA2063"), - // RuleMetadata: &armsecurity.VaRule{ - // Description: to.Ptr("The Azure SQL server-level firewall helps protect your server by preventing all access to your databases until you specify which IP addresses have permission. Server-level firewall rules grant access to all databases that belong to the server based on the originating IP address of each request.\n\nServer-level firewall rules can only be created and managed through Transact-SQL as well as through the Azure portal or PowerShell. For more details please see: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-firewall-configure\n\nThis check verifies that server-level firewall rules do not grant excessive access."), - // BenchmarkReferences: []*armsecurity.BenchmarkReference{ - // }, - // Category: to.Ptr("SurfaceAreaReduction"), - // QueryCheck: &armsecurity.QueryCheck{ - // ColumnNames: []*string{ - // to.Ptr("Firewall Rule Name"), - // to.Ptr("Start Address"), - // to.Ptr("End Address")}, - // ExpectedResult: [][]*string{ - // }, - // Query: to.Ptr("SELECT name\n ,start_ip_address\n ,end_ip_address\nFROM sys.firewall_rules\nWHERE ( \n (CONVERT(bigint, parsename(end_ip_address, 1)) +\n CONVERT(bigint, parsename(end_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(end_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(end_ip_address, 4)) * 16777216 ) \n - \n (CONVERT(bigint, parsename(start_ip_address, 1)) +\n CONVERT(bigint, parsename(start_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(start_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(start_ip_address, 4)) * 16777216 )\n ) > 255;"), - // }, - // Rationale: to.Ptr("Often, administrators add rules that grant excessive access as part of a troubleshooting process � to eliminate the firewall as the source of a problem, they simply create a rule that allows all traffic to pass to the affected server.\n\nGranting excessive access using server firewall rules is a clear security concern, as it violates the principle of least privilege by allowing unnecessary access to your databases. In fact, it's the equivalent of placing the server outside of the firewall."), - // RuleID: to.Ptr("VA2063"), - // RuleType: to.Ptr(armsecurity.RuleTypeNegativeList), - // Severity: to.Ptr(armsecurity.RuleSeverityHigh), - // Title: to.Ptr("Server-level firewall rules should not grant excessive access"), - // }, - // Status: to.Ptr(armsecurity.RuleStatusFinding), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client.go b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client.go index 901d71a327fc..94d0329fa054 100644 --- a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client.go +++ b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client.go @@ -44,7 +44,7 @@ func NewSQLVulnerabilityAssessmentScansClient(credential azcore.TokenCredential, // Get - Gets the scan details of a single scan record. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-07-01-preview +// Generated from API version 2023-02-01-preview // - scanID - The scan Id. Type 'latest' to get the scan record for the latest scan. // - workspaceID - The workspace Id. // - resourceID - The identifier of the resource. @@ -79,7 +79,7 @@ func (client *SQLVulnerabilityAssessmentScansClient) getCreateRequest(ctx contex } reqQP := req.Raw().URL.Query() reqQP.Set("workspaceId", workspaceID) - reqQP.Set("api-version", "2020-07-01-preview") + reqQP.Set("api-version", "2023-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -97,7 +97,7 @@ func (client *SQLVulnerabilityAssessmentScansClient) getHandleResponse(resp *htt // List - Gets a list of scan records. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2020-07-01-preview +// Generated from API version 2023-02-01-preview // - workspaceID - The workspace Id. // - resourceID - The identifier of the resource. // - options - SQLVulnerabilityAssessmentScansClientListOptions contains the optional parameters for the SQLVulnerabilityAssessmentScansClient.List @@ -127,7 +127,7 @@ func (client *SQLVulnerabilityAssessmentScansClient) listCreateRequest(ctx conte } reqQP := req.Raw().URL.Query() reqQP.Set("workspaceId", workspaceID) - reqQP.Set("api-version", "2020-07-01-preview") + reqQP.Set("api-version", "2023-02-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client_example_test.go b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client_example_test.go deleted file mode 100644 index ee6b4be85b26..000000000000 --- a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client_example_test.go +++ /dev/null @@ -1,165 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_Get.json -func ExampleSQLVulnerabilityAssessmentScansClient_Get_getScanDetailsOfAScanRecord() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentScansClient().Get(ctx, "Scheduled-20200623", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Scan = armsecurity.Scan{ - // Name: to.Ptr("Scheduled-20200623"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/Scheduled-20200623"), - // Properties: &armsecurity.ScanProperties{ - // Database: to.Ptr("master"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.7236217Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](3), - // IsBaselineApplied: to.Ptr(false), - // LowSeverityFailedRulesCount: to.Ptr[int32](1), - // MediumSeverityFailedRulesCount: to.Ptr[int32](2), - // Server: to.Ptr("server1"), - // SQLVersion: to.Ptr("15.0.2000"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.6455136+00:00"); return t}()), - // State: to.Ptr(armsecurity.ScanStateFailed), - // TotalFailedRulesCount: to.Ptr[int32](6), - // TotalPassedRulesCount: to.Ptr[int32](20), - // TotalRulesCount: to.Ptr[int32](26), - // TriggerType: to.Ptr(armsecurity.ScanTriggerTypeRecurring), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_GetLatest.json -func ExampleSQLVulnerabilityAssessmentScansClient_Get_getScanDetailsOfTheLatestScanRecord() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentScansClient().Get(ctx, "latest", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Scan = armsecurity.Scan{ - // Name: to.Ptr("Scheduled-20200623"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/Scheduled-20200623"), - // Properties: &armsecurity.ScanProperties{ - // Database: to.Ptr("master"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.7236217Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](3), - // IsBaselineApplied: to.Ptr(false), - // LowSeverityFailedRulesCount: to.Ptr[int32](1), - // MediumSeverityFailedRulesCount: to.Ptr[int32](2), - // Server: to.Ptr("server1"), - // SQLVersion: to.Ptr("15.0.2000"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.6455136+00:00"); return t}()), - // State: to.Ptr(armsecurity.ScanStateFailed), - // TotalFailedRulesCount: to.Ptr[int32](6), - // TotalPassedRulesCount: to.Ptr[int32](20), - // TotalRulesCount: to.Ptr[int32](26), - // TriggerType: to.Ptr(armsecurity.ScanTriggerTypeRecurring), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_List.json -func ExampleSQLVulnerabilityAssessmentScansClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentScansClient().List(ctx, "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Scans = armsecurity.Scans{ - // Value: []*armsecurity.Scan{ - // { - // Name: to.Ptr("Scheduled-20200225"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/Scheduled-20200225"), - // Properties: &armsecurity.ScanProperties{ - // Database: to.Ptr("master"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-25T11:38:07.8606151Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](3), - // IsBaselineApplied: to.Ptr(false), - // LowSeverityFailedRulesCount: to.Ptr[int32](1), - // MediumSeverityFailedRulesCount: to.Ptr[int32](2), - // Server: to.Ptr("server1"), - // SQLVersion: to.Ptr("15.0.2000"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-25T11:34:29.1399864Z"); return t}()), - // State: to.Ptr(armsecurity.ScanStateFailed), - // TotalFailedRulesCount: to.Ptr[int32](6), - // TotalPassedRulesCount: to.Ptr[int32](20), - // TotalRulesCount: to.Ptr[int32](26), - // TriggerType: to.Ptr(armsecurity.ScanTriggerTypeRecurring), - // }, - // }, - // { - // Name: to.Ptr("scan_20200226_113429"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/scan_20200226_113429"), - // Properties: &armsecurity.ScanProperties{ - // Database: to.Ptr("master"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-26T11:38:07.8606151Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](0), - // IsBaselineApplied: to.Ptr(true), - // LowSeverityFailedRulesCount: to.Ptr[int32](0), - // MediumSeverityFailedRulesCount: to.Ptr[int32](0), - // Server: to.Ptr("server1"), - // SQLVersion: to.Ptr("15.0.2000"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-26T11:34:29.1399864Z"); return t}()), - // State: to.Ptr(armsecurity.ScanStatePassed), - // TotalFailedRulesCount: to.Ptr[int32](0), - // TotalPassedRulesCount: to.Ptr[int32](26), - // TotalRulesCount: to.Ptr[int32](26), - // TriggerType: to.Ptr(armsecurity.ScanTriggerTypeOnDemand), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/subassessments_client_example_test.go b/sdk/resourcemanager/security/armsecurity/subassessments_client_example_test.go deleted file mode 100644 index 727020871444..000000000000 --- a/sdk/resourcemanager/security/armsecurity/subassessments_client_example_test.go +++ /dev/null @@ -1,225 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/ListSubscriptionSubAssessments_example.json -func ExampleSubAssessmentsClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSubAssessmentsClient().NewListAllPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SubAssessmentList = armsecurity.SubAssessmentList{ - // Value: []*armsecurity.SubAssessment{ - // { - // Name: to.Ptr("8c98f353-8b41-4e77-979b-6adeecd5d168"), - // Type: to.Ptr("Microsoft.Security/assessments/subAssessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.ContainerRegistry/registries/myRegistry/providers/Microsoft.Security/assessments/dbd0cb49-b563-45e7-9724-889e799fa648/subAssessments/8c98f353-8b41-4e77-979b-6adeecd5d168"), - // Properties: &armsecurity.SubAssessmentProperties{ - // Description: to.Ptr("The backdoor 'Back Orifice' was detected on this system. The presence of this backdoor indicates that your system has already been compromised. Unauthorized users can access your host at any time. Unauthorized users can take complete control of the host and manipulate data. They can steal the data or even wipe out the host."), - // AdditionalData: &armsecurity.ContainerRegistryVulnerabilityProperties{ - // AssessedResourceType: to.Ptr(armsecurity.AssessedResourceTypeContainerRegistryVulnerability), - // Type: to.Ptr("Vulnerability"), - // Cve: []*armsecurity.CVE{ - // { - // Link: to.Ptr("http://contoso.com"), - // Title: to.Ptr("CVE-2019-12345"), - // }}, - // Cvss: map[string]*armsecurity.CVSS{ - // "2.0": &armsecurity.CVSS{ - // Base: to.Ptr[float32](10), - // }, - // "3.0": &armsecurity.CVSS{ - // Base: to.Ptr[float32](10), - // }, - // }, - // ImageDigest: to.Ptr("c186fc44-3154-4ce2-ba18-b719d895c3b0"), - // Patchable: to.Ptr(true), - // PublishedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.0000000Z"); return t}()), - // RepositoryName: to.Ptr("myRepo"), - // VendorReferences: []*armsecurity.VendorReference{ - // { - // Link: to.Ptr("http://contoso.com"), - // Title: to.Ptr("Reference_1"), - // }}, - // }, - // Category: to.Ptr("Backdoors and trojan horses"), - // DisplayName: to.Ptr("'Back Orifice' Backdoor"), - // ID: to.Ptr("1001"), - // Impact: to.Ptr("3"), - // Remediation: to.Ptr("Use a recent anti-virus program to remove this backdoor and check your system regularly with anti-virus software."), - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("repositories/asc/msi-connector/images/sha256:877a6f2a212c44021281f80cb1f4c73a09dce4e99a8cb8efcc03f7ce3c877a6f"), - // }, - // Status: &armsecurity.SubAssessmentStatus{ - // Description: to.Ptr("The resource is unhealthy"), - // Cause: to.Ptr(""), - // Code: to.Ptr(armsecurity.SubAssessmentStatusCodeUnhealthy), - // Severity: to.Ptr(armsecurity.SeverityHigh), - // }, - // TimeGenerated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-23T12:20:08.7644808Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("8fbe5054-e97c-3a7a-fda7-c8308ca8d3cf"), - // Type: to.Ptr("Microsoft.Security/assessments/subAssessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/ascdemoRG/providers/Microsoft.Sql/servers/sqlserver1demo/providers/Microsoft.Security/assessments/82e20e14-edc5-4373-bfc4-f13121257c37/subassessments/8fbe5054-e97c-3a7a-fda7-c8308ca8d3cf"), - // Properties: &armsecurity.SubAssessmentProperties{ - // Description: to.Ptr("The Azure SQL Database-level firewall helps protect your data by preventing all access to your database until you specify which IP addresses have permission. Database-level firewall rules grant access to the specific database based on the originating IP address of each request.\n\nDatabase-level firewall rules for master"), - // AdditionalData: &armsecurity.SQLServerVulnerabilityProperties{ - // AssessedResourceType: to.Ptr(armsecurity.AssessedResourceTypeSQLServerVulnerability), - // Type: to.Ptr("AzureDatabase"), - // Query: to.Ptr("SELECT name\n ,start_ip_address\n ,end_ip_address\nFROM sys.database_firewall_rules"), - // }, - // Category: to.Ptr("SurfaceAreaReduction"), - // DisplayName: to.Ptr("Database-level firewall rules should be tracked and maintained at a strict minimum"), - // ID: to.Ptr("VA2064"), - // Impact: to.Ptr("Firewall rules should be strictly configured to allow access only to client computers that have a valid need to connect to the database. Any superfluous entries in the firewall may pose a threat by allowing an unauthorized source access to your database."), - // Remediation: to.Ptr("Evaluate each of the database-level firewall rules. Remove any rules that grant unnecessary access and set the rest as a baseline. Deviations from the baseline will be identified and brought to your attention in subsequent scans."), - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("/subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/ascdemoRG/providers/Microsoft.Sql/servers/sqlserver1demo/databases/database1"), - // }, - // Status: &armsecurity.SubAssessmentStatus{ - // Cause: to.Ptr("Unknown"), - // Code: to.Ptr(armsecurity.SubAssessmentStatusCodeHealthy), - // Severity: to.Ptr(armsecurity.SeverityHigh), - // }, - // TimeGenerated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-23T12:20:08.7644808Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/ListSubAssessments_example.json -func ExampleSubAssessmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSubAssessmentsClient().NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "82e20e14-edc5-4373-bfc4-f13121257c37", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SubAssessmentList = armsecurity.SubAssessmentList{ - // Value: []*armsecurity.SubAssessment{ - // { - // Name: to.Ptr("8fbe5054-e97c-3a7a-fda7-c8308ca8d3cf"), - // Type: to.Ptr("Microsoft.Security/assessments/subAssessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/ascdemoRG/providers/Microsoft.Sql/servers/sqlserver1demo/providers/Microsoft.Security/assessments/82e20e14-edc5-4373-bfc4-f13121257c37/subassessments/8fbe5054-e97c-3a7a-fda7-c8308ca8d3cf"), - // Properties: &armsecurity.SubAssessmentProperties{ - // Description: to.Ptr("The Azure SQL Database-level firewall helps protect your data by preventing all access to your database until you specify which IP addresses have permission. Database-level firewall rules grant access to the specific database based on the originating IP address of each request.\n\nDatabase-level firewall rules for master"), - // AdditionalData: &armsecurity.SQLServerVulnerabilityProperties{ - // AssessedResourceType: to.Ptr(armsecurity.AssessedResourceTypeSQLServerVulnerability), - // Type: to.Ptr("AzureDatabase"), - // Query: to.Ptr("SELECT name\n ,start_ip_address\n ,end_ip_address\nFROM sys.database_firewall_rules"), - // }, - // Category: to.Ptr("SurfaceAreaReduction"), - // DisplayName: to.Ptr("Database-level firewall rules should be tracked and maintained at a strict minimum"), - // ID: to.Ptr("VA2064"), - // Impact: to.Ptr("Firewall rules should be strictly configured to allow access only to client computers that have a valid need to connect to the database. Any superfluous entries in the firewall may pose a threat by allowing an unauthorized source access to your database."), - // Remediation: to.Ptr("Evaluate each of the database-level firewall rules. Remove any rules that grant unnecessary access and set the rest as a baseline. Deviations from the baseline will be identified and brought to your attention in subsequent scans."), - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("/subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/ascdemoRG/providers/Microsoft.Sql/servers/sqlserver1demo/databases/database1"), - // }, - // Status: &armsecurity.SubAssessmentStatus{ - // Cause: to.Ptr("Unknown"), - // Code: to.Ptr(armsecurity.SubAssessmentStatusCodeHealthy), - // Severity: to.Ptr(armsecurity.SeverityHigh), - // }, - // TimeGenerated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-23T12:20:08.7644808Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/GetSubAssessment_example.json -func ExampleSubAssessmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSubAssessmentsClient().Get(ctx, "subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/DEMORG/providers/Microsoft.Compute/virtualMachines/vm2", "1195afff-c881-495e-9bc5-1486211ae03f", "95f7da9c-a2a4-1322-0758-fcd24ef09b85", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SubAssessment = armsecurity.SubAssessment{ - // Name: to.Ptr("95f7da9c-a2a4-1322-0758-fcd24ef09b85"), - // Type: to.Ptr("Microsoft.Security/assessments/subAssessments"), - // ID: to.Ptr("/subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/DEMORG/providers/Microsoft.Compute/virtualMachines/vm2/providers/Microsoft.Security/assessments/1195afff-c881-495e-9bc5-1486211ae03f/subassessments/95f7da9c-a2a4-1322-0758-fcd24ef09b85"), - // Properties: &armsecurity.SubAssessmentProperties{ - // Description: to.Ptr("PuTTY ssh_agent_channel_data Function Integer Overflow Vulnerability"), - // AdditionalData: &armsecurity.AdditionalData{ - // AssessedResourceType: to.Ptr(armsecurity.AssessedResourceTypeServerVulnerability), - // }, - // Category: to.Ptr("Local"), - // DisplayName: to.Ptr("PuTTY ssh_agent_channel_data Function Integer Overflow Vulnerability"), - // ID: to.Ptr("370361"), - // Impact: to.Ptr("Successful exploitation could allow remote attackers to have unspecified impact via a large length value in an agent protocol message."), - // Remediation: to.Ptr("Customers are advised to upgrade toPuTTY 0.68 or later version in order to remediate this vulnerability."), - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("/subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/DEMORG/providers/Microsoft.Compute/virtualMachines/vm2"), - // }, - // Status: &armsecurity.SubAssessmentStatus{ - // Code: to.Ptr(armsecurity.SubAssessmentStatusCodeUnhealthy), - // Severity: to.Ptr(armsecurity.SeverityMedium), - // }, - // TimeGenerated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-02-02T12:36:50.779Z"); return t}()), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/subscriptiongovernancerulesexecutestatus_client.go b/sdk/resourcemanager/security/armsecurity/subscriptiongovernancerulesexecutestatus_client.go deleted file mode 100644 index 3c5f0595efaa..000000000000 --- a/sdk/resourcemanager/security/armsecurity/subscriptiongovernancerulesexecutestatus_client.go +++ /dev/null @@ -1,110 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// SubscriptionGovernanceRulesExecuteStatusClient contains the methods for the SubscriptionGovernanceRulesExecuteStatus group. -// Don't use this type directly, use NewSubscriptionGovernanceRulesExecuteStatusClient() instead. -type SubscriptionGovernanceRulesExecuteStatusClient struct { - internal *arm.Client - subscriptionID string -} - -// NewSubscriptionGovernanceRulesExecuteStatusClient creates a new instance of SubscriptionGovernanceRulesExecuteStatusClient with the specified values. -// - subscriptionID - Azure subscription ID -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewSubscriptionGovernanceRulesExecuteStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SubscriptionGovernanceRulesExecuteStatusClient, error) { - cl, err := arm.NewClient(moduleName+".SubscriptionGovernanceRulesExecuteStatusClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &SubscriptionGovernanceRulesExecuteStatusClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginGet - Get a specific governanceRule execution status for the requested scope by ruleId and operationId -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-01-01-preview -// - ruleID - The security GovernanceRule key - unique key for the standard GovernanceRule -// - operationID - The security GovernanceRule execution key - unique key for the execution of GovernanceRule -// - options - SubscriptionGovernanceRulesExecuteStatusClientBeginGetOptions contains the optional parameters for the SubscriptionGovernanceRulesExecuteStatusClient.BeginGet -// method. -func (client *SubscriptionGovernanceRulesExecuteStatusClient) BeginGet(ctx context.Context, ruleID string, operationID string, options *SubscriptionGovernanceRulesExecuteStatusClientBeginGetOptions) (*runtime.Poller[SubscriptionGovernanceRulesExecuteStatusClientGetResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.get(ctx, ruleID, operationID, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[SubscriptionGovernanceRulesExecuteStatusClientGetResponse](resp, client.internal.Pipeline(), nil) - } else { - return runtime.NewPollerFromResumeToken[SubscriptionGovernanceRulesExecuteStatusClientGetResponse](options.ResumeToken, client.internal.Pipeline(), nil) - } -} - -// Get - Get a specific governanceRule execution status for the requested scope by ruleId and operationId -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-01-01-preview -func (client *SubscriptionGovernanceRulesExecuteStatusClient) get(ctx context.Context, ruleID string, operationID string, options *SubscriptionGovernanceRulesExecuteStatusClientBeginGetOptions) (*http.Response, error) { - req, err := client.getCreateRequest(ctx, ruleID, operationID, options) - if err != nil { - return nil, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getCreateRequest creates the Get request. -func (client *SubscriptionGovernanceRulesExecuteStatusClient) getCreateRequest(ctx context.Context, ruleID string, operationID string, options *SubscriptionGovernanceRulesExecuteStatusClientBeginGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if ruleID == "" { - return nil, errors.New("parameter ruleID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) - if operationID == "" { - return nil, errors.New("parameter operationID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} diff --git a/sdk/resourcemanager/security/armsecurity/subscriptiongovernancerulesexecutestatus_client_example_test.go b/sdk/resourcemanager/security/armsecurity/subscriptiongovernancerulesexecutestatus_client_example_test.go deleted file mode 100644 index c4823a4aca5f..000000000000 --- a/sdk/resourcemanager/security/armsecurity/subscriptiongovernancerulesexecutestatus_client_example_test.go +++ /dev/null @@ -1,45 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRuleExecuteStatus_example.json -func ExampleSubscriptionGovernanceRulesExecuteStatusClient_BeginGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewSubscriptionGovernanceRulesExecuteStatusClient().BeginGet(ctx, "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExecuteRuleStatus = armsecurity.ExecuteRuleStatus{ - // OperationID: to.Ptr("58b33f4f-c8c7-4b01-99cc-d437db4d40dd"), - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/tasks_client_example_test.go b/sdk/resourcemanager/security/armsecurity/tasks_client_example_test.go deleted file mode 100644 index 8a950fae111c..000000000000 --- a/sdk/resourcemanager/security/armsecurity/tasks_client_example_test.go +++ /dev/null @@ -1,337 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTasksSubscription_example.json -func ExampleTasksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTasksClient().NewListPager(&armsecurity.TasksClientListOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TaskList = armsecurity.TaskList{ - // Value: []*armsecurity.Task{ - // { - // Name: to.Ptr("62609ee7-d0a5-8616-9fe4-1df5cca7758d"), - // Type: to.Ptr("Microsoft.Security/locations/tasks"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/westeurope/tasks/62609ee7-d0a5-8616-9fe4-1df5cca7758d"), - // Properties: &armsecurity.TaskProperties{ - // CreationTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-05T10:42:03.9935508Z"); return t}()), - // LastStateChangeTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-05T10:42:03.9935508Z"); return t}()), - // SecurityTaskParameters: &armsecurity.TaskParameters{ - // AdditionalProperties: map[string]any{ - // "location": "uksouth", - // "resourceGroup": "myRg", - // "resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/default", - // "resourceName": "default", - // "resourceParent": "vnet1", - // "resourceType": "Subnet", - // "uniqueKey": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/default", - // }, - // Name: to.Ptr("NetworkSecurityGroupMissingOnSubnet"), - // }, - // State: to.Ptr("Active"), - // SubState: to.Ptr("NA"), - // }, - // }, - // { - // Name: to.Ptr("d55b4dc0-779c-c66c-33e5-d7bce24c4222"), - // Type: to.Ptr("Microsoft.Security/locations/tasks"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Security/locations/westeurope/tasks/d55b4dc0-779c-c66c-33e5-d7bce24c4222"), - // Properties: &armsecurity.TaskProperties{ - // CreationTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-02T11:41:27.0541014Z"); return t}()), - // LastStateChangeTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-02T11:41:27.0541014Z"); return t}()), - // SecurityTaskParameters: &armsecurity.TaskParameters{ - // AdditionalProperties: map[string]any{ - // "isDataDiskEncrypted": false, - // "isOsDiskEncrypted": false, - // "resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "severity": "High", - // "uniqueKey": "EncryptionOnVmTaskParameters_/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "vmId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "vmName": "vm1", - // }, - // Name: to.Ptr("EncryptionOnVm"), - // }, - // State: to.Ptr("Active"), - // SubState: to.Ptr("NA"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTasksSubscriptionLocation_example.json -func ExampleTasksClient_NewListByHomeRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTasksClient().NewListByHomeRegionPager("westeurope", &armsecurity.TasksClientListByHomeRegionOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TaskList = armsecurity.TaskList{ - // Value: []*armsecurity.Task{ - // { - // Name: to.Ptr("62609ee7-d0a5-8616-9fe4-1df5cca7758d"), - // Type: to.Ptr("Microsoft.Security/locations/tasks"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/westeurope/tasks/62609ee7-d0a5-8616-9fe4-1df5cca7758d"), - // Properties: &armsecurity.TaskProperties{ - // CreationTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-05T10:42:03.9935508Z"); return t}()), - // LastStateChangeTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-05T10:42:03.9935508Z"); return t}()), - // SecurityTaskParameters: &armsecurity.TaskParameters{ - // AdditionalProperties: map[string]any{ - // "location": "uksouth", - // "resourceGroup": "myRg", - // "resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/default", - // "resourceName": "default", - // "resourceParent": "vnet1", - // "resourceType": "Subnet", - // "uniqueKey": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/default", - // }, - // Name: to.Ptr("NetworkSecurityGroupMissingOnSubnet"), - // }, - // State: to.Ptr("Active"), - // SubState: to.Ptr("NA"), - // }, - // }, - // { - // Name: to.Ptr("d55b4dc0-779c-c66c-33e5-d7bce24c4222"), - // Type: to.Ptr("Microsoft.Security/locations/tasks"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Security/locations/westeurope/tasks/d55b4dc0-779c-c66c-33e5-d7bce24c4222"), - // Properties: &armsecurity.TaskProperties{ - // CreationTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-02T11:41:27.0541014Z"); return t}()), - // LastStateChangeTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-02T11:41:27.0541014Z"); return t}()), - // SecurityTaskParameters: &armsecurity.TaskParameters{ - // AdditionalProperties: map[string]any{ - // "isDataDiskEncrypted": false, - // "isOsDiskEncrypted": false, - // "resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "severity": "High", - // "uniqueKey": "EncryptionOnVmTaskParameters_/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "vmId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "vmName": "vm1", - // }, - // Name: to.Ptr("EncryptionOnVm"), - // }, - // State: to.Ptr("Active"), - // SubState: to.Ptr("NA"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTaskSubscriptionLocation_example.json -func ExampleTasksClient_GetSubscriptionLevelTask() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTasksClient().GetSubscriptionLevelTask(ctx, "westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Task = armsecurity.Task{ - // Name: to.Ptr("62609ee7-d0a5-8616-9fe4-1df5cca7758d"), - // Type: to.Ptr("Microsoft.Security/locations/tasks"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/westeurope/tasks/62609ee7-d0a5-8616-9fe4-1df5cca7758d"), - // Properties: &armsecurity.TaskProperties{ - // CreationTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-05T10:42:03.9935508Z"); return t}()), - // LastStateChangeTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-05T10:42:03.9935508Z"); return t}()), - // SecurityTaskParameters: &armsecurity.TaskParameters{ - // AdditionalProperties: map[string]any{ - // "location": "uksouth", - // "resourceGroup": "myRg", - // "resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/default", - // "resourceName": "default", - // "resourceParent": "vnet1", - // "resourceType": "Subnet", - // "uniqueKey": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/default", - // }, - // Name: to.Ptr("NetworkSecurityGroupMissingOnSubnet"), - // }, - // State: to.Ptr("Active"), - // SubState: to.Ptr("NA"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/UpdateTaskSubscriptionLocation_example.json -func ExampleTasksClient_UpdateSubscriptionLevelTaskState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewTasksClient().UpdateSubscriptionLevelTaskState(ctx, "westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", armsecurity.TaskUpdateActionTypeDismiss, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTasksResourceGroupLocation_example.json -func ExampleTasksClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTasksClient().NewListByResourceGroupPager("myRg", "westeurope", &armsecurity.TasksClientListByResourceGroupOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TaskList = armsecurity.TaskList{ - // Value: []*armsecurity.Task{ - // { - // Name: to.Ptr("d55b4dc0-779c-c66c-33e5-d7bce24c4222"), - // Type: to.Ptr("Microsoft.Security/locations/tasks"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Security/locations/westeurope/tasks/d55b4dc0-779c-c66c-33e5-d7bce24c4222"), - // Properties: &armsecurity.TaskProperties{ - // CreationTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-02T11:41:27.0541014Z"); return t}()), - // LastStateChangeTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-02T11:41:27.0541014Z"); return t}()), - // SecurityTaskParameters: &armsecurity.TaskParameters{ - // AdditionalProperties: map[string]any{ - // "isDataDiskEncrypted": false, - // "isOsDiskEncrypted": false, - // "resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "severity": "High", - // "uniqueKey": "EncryptionOnVmTaskParameters_/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "vmId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "vmName": "vm1", - // }, - // Name: to.Ptr("EncryptionOnVm"), - // }, - // State: to.Ptr("Active"), - // SubState: to.Ptr("NA"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTaskResourceGroupLocation_example.json -func ExampleTasksClient_GetResourceGroupLevelTask() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTasksClient().GetResourceGroupLevelTask(ctx, "myRg", "westeurope", "d55b4dc0-779c-c66c-33e5-d7bce24c4222", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Task = armsecurity.Task{ - // Name: to.Ptr("d55b4dc0-779c-c66c-33e5-d7bce24c4222"), - // Type: to.Ptr("Microsoft.Security/locations/tasks"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Security/locations/westeurope/tasks/d55b4dc0-779c-c66c-33e5-d7bce24c4222"), - // Properties: &armsecurity.TaskProperties{ - // CreationTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-02T11:41:27.0541014Z"); return t}()), - // LastStateChangeTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-02T11:41:27.0541014Z"); return t}()), - // SecurityTaskParameters: &armsecurity.TaskParameters{ - // AdditionalProperties: map[string]any{ - // "isDataDiskEncrypted": false, - // "isOsDiskEncrypted": false, - // "resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "severity": "High", - // "uniqueKey": "EncryptionOnVmTaskParameters_/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "vmId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "vmName": "vm1", - // }, - // Name: to.Ptr("EncryptionOnVm"), - // }, - // State: to.Ptr("Active"), - // SubState: to.Ptr("NA"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/UpdateTaskResourceGroupLocation_example.json -func ExampleTasksClient_UpdateResourceGroupLevelTaskState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewTasksClient().UpdateResourceGroupLevelTaskState(ctx, "myRg", "westeurope", "d55b4dc0-779c-c66c-33e5-d7bce24c4222", armsecurity.TaskUpdateActionTypeDismiss, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/topology_client_example_test.go b/sdk/resourcemanager/security/armsecurity/topology_client_example_test.go deleted file mode 100644 index 9ed95c940400..000000000000 --- a/sdk/resourcemanager/security/armsecurity/topology_client_example_test.go +++ /dev/null @@ -1,204 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/GetTopologySubscription_example.json -func ExampleTopologyClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTopologyClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TopologyList = armsecurity.TopologyList{ - // Value: []*armsecurity.TopologyResource{ - // { - // Location: to.Ptr("westus"), - // Name: to.Ptr("vnets"), - // Type: to.Ptr("Microsoft.Security/locations/topologies"), - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Security/locations/centralus/topologies/vnets"), - // Properties: &armsecurity.TopologyResourceProperties{ - // CalculatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-07-10T13:56:10.5755270Z"); return t}()), - // TopologyResources: []*armsecurity.TopologySingleResource{ - // { - // Children: []*armsecurity.TopologySingleResourceChild{ - // { - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet"), - // }}, - // Location: to.Ptr("westus"), - // NetworkZones: to.Ptr("Internal"), - // RecommendationsExist: to.Ptr(false), - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet"), - // Severity: to.Ptr("Healthy"), - // TopologyScore: to.Ptr[int32](0), - // }}, - // }, - // }, - // { - // Location: to.Ptr("westus"), - // Name: to.Ptr("subnets"), - // Type: to.Ptr("Microsoft.Security/locations/topologies"), - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Security/locations/centralus/topologies/subnets"), - // Properties: &armsecurity.TopologyResourceProperties{ - // CalculatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-07-10T13:56:10.5755270Z"); return t}()), - // TopologyResources: []*armsecurity.TopologySingleResource{ - // { - // Location: to.Ptr("westus"), - // NetworkZones: to.Ptr("Internal"), - // Parents: []*armsecurity.TopologySingleResourceParent{ - // { - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet"), - // }}, - // RecommendationsExist: to.Ptr(false), - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet"), - // Severity: to.Ptr("Healthy"), - // TopologyScore: to.Ptr[int32](5), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/GetTopologySubscriptionLocation_example.json -func ExampleTopologyClient_NewListByHomeRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTopologyClient().NewListByHomeRegionPager("centralus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TopologyList = armsecurity.TopologyList{ - // Value: []*armsecurity.TopologyResource{ - // { - // Location: to.Ptr("westus"), - // Name: to.Ptr("vnets"), - // Type: to.Ptr("Microsoft.Security/locations/topologies"), - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Security/locations/centralus/topologies/vnets"), - // Properties: &armsecurity.TopologyResourceProperties{ - // CalculatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-07-10T13:56:10.5755270Z"); return t}()), - // TopologyResources: []*armsecurity.TopologySingleResource{ - // { - // Children: []*armsecurity.TopologySingleResourceChild{ - // { - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet"), - // }}, - // Location: to.Ptr("westus"), - // NetworkZones: to.Ptr("Internal"), - // RecommendationsExist: to.Ptr(false), - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet"), - // Severity: to.Ptr("Healthy"), - // TopologyScore: to.Ptr[int32](0), - // }}, - // }, - // }, - // { - // Location: to.Ptr("westus"), - // Name: to.Ptr("subnets"), - // Type: to.Ptr("Microsoft.Security/locations/topologies"), - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Security/locations/centralus/topologies/subnets"), - // Properties: &armsecurity.TopologyResourceProperties{ - // CalculatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-07-10T13:56:10.5755270Z"); return t}()), - // TopologyResources: []*armsecurity.TopologySingleResource{ - // { - // Location: to.Ptr("westus"), - // NetworkZones: to.Ptr("Internal"), - // Parents: []*armsecurity.TopologySingleResourceParent{ - // { - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet"), - // }}, - // RecommendationsExist: to.Ptr(false), - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet"), - // Severity: to.Ptr("Healthy"), - // TopologyScore: to.Ptr[int32](5), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/GetTopology_example.json -func ExampleTopologyClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTopologyClient().Get(ctx, "myservers", "centralus", "vnets", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TopologyResource = armsecurity.TopologyResource{ - // Location: to.Ptr("westus"), - // Name: to.Ptr("vnets"), - // Type: to.Ptr("Microsoft.Security/locations/topologies"), - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Security/locations/centralus/topologies/vnets"), - // Properties: &armsecurity.TopologyResourceProperties{ - // CalculatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-07-10T13:56:10.5755270Z"); return t}()), - // TopologyResources: []*armsecurity.TopologySingleResource{ - // { - // Children: []*armsecurity.TopologySingleResourceChild{ - // { - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet"), - // }}, - // Location: to.Ptr("westus"), - // NetworkZones: to.Ptr("InternetFacing"), - // RecommendationsExist: to.Ptr(false), - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet"), - // Severity: to.Ptr("Healthy"), - // TopologyScore: to.Ptr[int32](0), - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/workspacesettings_client_example_test.go b/sdk/resourcemanager/security/armsecurity/workspacesettings_client_example_test.go deleted file mode 100644 index e662c7e7e1d6..000000000000 --- a/sdk/resourcemanager/security/armsecurity/workspacesettings_client_example_test.go +++ /dev/null @@ -1,184 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/GetWorkspaceSettings_example.json -func ExampleWorkspaceSettingsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkspaceSettingsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkspaceSettingList = armsecurity.WorkspaceSettingList{ - // Value: []*armsecurity.WorkspaceSetting{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/workspaceSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/workspaceSettings/default"), - // Properties: &armsecurity.WorkspaceSettingProperties{ - // Scope: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // WorkspaceID: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // }, - // { - // Name: to.Ptr("myRg"), - // Type: to.Ptr("Microsoft.Security/workspaceSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Security/workspaceSettings/myRg"), - // Properties: &armsecurity.WorkspaceSettingProperties{ - // Scope: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg"), - // WorkspaceID: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myOtherRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace2"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/GetWorkspaceSetting_example.json -func ExampleWorkspaceSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspaceSettingsClient().Get(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkspaceSetting = armsecurity.WorkspaceSetting{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/workspaceSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/workspaceSettings/default"), - // Properties: &armsecurity.WorkspaceSettingProperties{ - // Scope: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // WorkspaceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/CreateWorkspaceSetting_example.json -func ExampleWorkspaceSettingsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspaceSettingsClient().Create(ctx, "default", armsecurity.WorkspaceSetting{ - Name: to.Ptr("default"), - Type: to.Ptr("Microsoft.Security/workspaceSettings"), - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/workspaceSettings/default"), - Properties: &armsecurity.WorkspaceSettingProperties{ - Scope: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - WorkspaceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkspaceSetting = armsecurity.WorkspaceSetting{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/workspaceSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/workspaceSettings/default"), - // Properties: &armsecurity.WorkspaceSettingProperties{ - // Scope: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // WorkspaceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/UpdateWorkspaceSetting_example.json -func ExampleWorkspaceSettingsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspaceSettingsClient().Update(ctx, "default", armsecurity.WorkspaceSetting{ - Name: to.Ptr("default"), - Type: to.Ptr("Microsoft.Security/workspaceSettings"), - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/workspaceSettings/default"), - Properties: &armsecurity.WorkspaceSettingProperties{ - WorkspaceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkspaceSetting = armsecurity.WorkspaceSetting{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/workspaceSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/workspaceSettings/default"), - // Properties: &armsecurity.WorkspaceSettingProperties{ - // Scope: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // WorkspaceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/DeleteWorkspaceSetting_example.json -func ExampleWorkspaceSettingsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewWorkspaceSettingsClient().Delete(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -}