diff --git a/sdk/resourcemanager/security/armsecurity/CHANGELOG.md b/sdk/resourcemanager/security/armsecurity/CHANGELOG.md index f1c4ad9a4be0..db04e436925c 100644 --- a/sdk/resourcemanager/security/armsecurity/CHANGELOG.md +++ b/sdk/resourcemanager/security/armsecurity/CHANGELOG.md @@ -1,5 +1,72 @@ # Release History +## 0.9.0 (2022-11-03) +### Breaking Changes + +- Type of `ContactProperties.AlertNotifications` has been changed from `*AlertNotifications` to `*ContactPropertiesAlertNotifications` +- Type of `DefenderForServersAwsOfferingVMScannersConfiguration.ExclusionTags` has been changed from `interface{}` to `map[string]*string` +- Const `AlertsToAdminsOff` has been removed +- Const `AlertNotificationsOn` has been removed +- Const `AlertNotificationsOff` has been removed +- Const `AlertsToAdminsOn` has been removed +- Type alias `AlertNotifications` has been removed +- Type alias `AlertsToAdmins` has been removed +- Function `PossibleAlertNotificationsValues` has been removed +- Function `*AWSEnvironmentData.GetEnvironmentData` has been removed +- Function `*ContactsClient.Update` has been removed +- Function `PossibleAlertsToAdminsValues` has been removed +- Struct `AWSEnvironmentData` has been removed +- Struct `ContactsClientUpdateOptions` has been removed +- Struct `ContactsClientUpdateResponse` has been removed +- Struct `DefenderFoDatabasesAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata` has been removed +- Struct `DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration` has been removed +- Struct `DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata` has been removed +- Struct `DefenderForServersGcpOfferingArcAutoProvisioningConfiguration` has been removed +- Field `Configuration` of struct `DefenderForServersGcpOfferingArcAutoProvisioning` has been removed +- Field `ServicePrincipalSecretMetadata` of struct `DefenderForServersAwsOfferingArcAutoProvisioning` has been removed +- Field `Configuration` of struct `DefenderForDatabasesGcpOfferingArcAutoProvisioning` has been removed +- Field `AlertsToAdmins` of struct `ContactProperties` has been removed +- Field `Email` of struct `ContactProperties` has been removed +- Field `ServicePrincipalSecretMetadata` of struct `DefenderFoDatabasesAwsOfferingArcAutoProvisioning` has been removed + +### Features Added + +- New const `ApplicationConditionOperatorEquals` +- New const `OfferingTypeDefenderForDevOpsAzureDevOps` +- New const `RolesAccountAdmin` +- New const `RolesServiceAdmin` +- New const `RolesContributor` +- New const `MinimalSeverityHigh` +- New const `RolesOwner` +- New const `OfferingTypeDefenderCspmAws` +- New const `MinimalSeverityLow` +- New const `OfferingTypeDefenderForDevOpsGithub` +- New const `OfferingTypeDefenderCspmGcp` +- New const `MinimalSeverityMedium` +- New type alias `MinimalSeverity` +- New type alias `Roles` +- New function `PossibleMinimalSeverityValues() []MinimalSeverity` +- New function `*AwsEnvironmentData.GetEnvironmentData() *EnvironmentData` +- New function `*DefenderCspmAwsOffering.GetCloudOffering() *CloudOffering` +- New function `*DefenderForDevOpsGithubOffering.GetCloudOffering() *CloudOffering` +- New function `*DefenderCspmGcpOffering.GetCloudOffering() *CloudOffering` +- New function `PossibleRolesValues() []Roles` +- New function `*DefenderForDevOpsAzureDevOpsOffering.GetCloudOffering() *CloudOffering` +- New struct `AwsEnvironmentData` +- New struct `ContactPropertiesAlertNotifications` +- New struct `ContactPropertiesNotificationsByRole` +- New struct `DefenderCspmAwsOffering` +- New struct `DefenderCspmAwsOfferingVMScanners` +- New struct `DefenderCspmAwsOfferingVMScannersConfiguration` +- New struct `DefenderCspmGcpOffering` +- New struct `DefenderFoDatabasesAwsOfferingRds` +- New struct `DefenderForDevOpsAzureDevOpsOffering` +- New struct `DefenderForDevOpsGithubOffering` +- New field `Emails` in struct `ContactProperties` +- New field `NotificationsByRole` in struct `ContactProperties` +- New field `Rds` in struct `DefenderFoDatabasesAwsOffering` + + ## 0.8.0 (2022-09-13) ### Breaking Changes 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 472e11b3c208..000000000000 --- a/sdk/resourcemanager/security/armsecurity/accountconnectors_client_example_test.go +++ /dev/null @@ -1,197 +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. - -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/tree/main/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() - client, err := armsecurity.NewAccountConnectorsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAccountConnectorsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "aws_dev1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAccountConnectorsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAccountConnectorsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAccountConnectorsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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\nMQM9Zgrug0UndPmiUwKOcJSU4PlmlTpHEV4vA6JfA4bvphy9m1jxO5qWeah5yym2\n6FP5BRIDF98kFrDnSXJjajwgLCQ+MypFQXyax6XkxDxuKXbng1bv7eZDjqazIChk\nm0y14X0s0jnWc+AX8vfeSf7d+EsGdVinEwR1aAawEQKBgQDqDB0qxcIQ1oI1Kww8\n9vXefTiuWsf47F+fJ/DIOEbiRfE8IdCgmOABvcqJIoxW/DFMBEdLCcx73Km7pOmd\nKg1ddScnaO8cOj2v/Ub+fAqVrA4ki4ViYP0A7/Nogga3Jr/x3ey5bitrIfFImteS\nCgBHBzZvoQpvO4lB2tKVgo2P9wKBgQC5sgTEq4sasRGSAY6lIoJno0I8w28a/16D\nes60XQeY1ger8uTGwlT02v/u/arDUmRLPClpujXq6gK29KvtRCHy7JkpGbqW2bZs\nPFKKWR7Tk3XPKYyjv94AIi5/xoFeDhS4lpAvy3Z5tQhYS6wqWKvT6yZQ3kM+Hfxs\npHgvu3mU7QKBgQC9/E1k3hj1cBtMK4CIsHPPQljTd4+iacYJPPPAo6YuoVX8WPqw\nksgrwbN59Fh1d8xQh5yTtgWOegYx8uFMGcm1lpbM7+pBQKm4hWGuzGQPMRZd5f/F\nZzOZIi61I+9tlv/yxxIVR+/ozCm/pSneO04UWi9/F/uPZYW6tnWAtfRR6wKBgGsZ\n8MQaCK4JaI/klAhMghgSQnbXZXKVzUZaA3Rln6cX8u7KtgapOOTMlwaZie8Dy1LV\nTTFstAJcm9o3/h1nyYjZy3C4JTUyNpPwqs6enjf7edxVI4eidwFutZD+xcigqHTa\naikW2atSrZB3fMIjyF7+5meH+hKOqvNiXOty3qn1AoGAZuVxYQy5FVq3YZxzr3Aa\nAm0ShoXTF6QYIbsaUiUGoa/NlHcw9V/lj4AqBRbxbaYMD+hz2J/od9cb268eJKY8\n3b6MvaUqdNhNnWodJXLhgtmGEHDKmTppz2JSTx/tVzCfhFdcOC79StZvcKLhtoFQ\n+/3lEw6NCIXzm5E4+dtJG4k=\n-----END PRIVATE 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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAccountConnectorsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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 baec5716dc12..000000000000 --- a/sdk/resourcemanager/security/armsecurity/adaptiveapplicationcontrols_client_example_test.go +++ /dev/null @@ -1,186 +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. - -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/tree/main/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() - client, err := armsecurity.NewAdaptiveApplicationControlsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, &armsecurity.AdaptiveApplicationControlsClientListOptions{IncludePathRecommendations: to.Ptr(true), - Summary: to.Ptr(false), - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAdaptiveApplicationControlsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "centralus", "ERELGROUP1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAdaptiveApplicationControlsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAdaptiveApplicationControlsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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 44fde258e75b..000000000000 --- a/sdk/resourcemanager/security/armsecurity/adaptivenetworkhardenings_client_example_test.go +++ /dev/null @@ -1,106 +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. - -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/tree/main/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() - client, err := armsecurity.NewAdaptiveNetworkHardeningsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByExtendedResourcePager("rg1", "Microsoft.Compute", "virtualMachines", "vm1", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAdaptiveNetworkHardeningsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "rg1", "Microsoft.Compute", "virtualMachines", "vm1", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAdaptiveNetworkHardeningsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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 b699a5751cfe..000000000000 --- a/sdk/resourcemanager/security/armsecurity/advancedthreatprotection_client_example_test.go +++ /dev/null @@ -1,63 +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. - -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/tree/main/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() - client, err := armsecurity.NewAdvancedThreatProtectionClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAdvancedThreatProtectionClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} 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 e50f67dd567e..000000000000 --- a/sdk/resourcemanager/security/armsecurity/alerts_client_example_test.go +++ /dev/null @@ -1,323 +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. - -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/tree/main/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() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("myRg1", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListSubscriptionLevelByRegionPager("westeurope", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListResourceGroupLevelByRegionPager("westeurope", "myRg1", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetSubscriptionLevel(ctx, "westeurope", "2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetResourceGroupLevel(ctx, "myRg1", "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/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() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/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() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/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() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/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() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/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() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/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() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/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() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/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() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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 54fa9616bbfc..000000000000 --- a/sdk/resourcemanager/security/armsecurity/alertssuppressionrules_client_example_test.go +++ /dev/null @@ -1,149 +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. - -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/tree/main/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() - client, err := armsecurity.NewAlertsSuppressionRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(&armsecurity.AlertsSuppressionRulesClientListOptions{AlertType: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAlertsSuppressionRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(&armsecurity.AlertsSuppressionRulesClientListOptions{AlertType: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAlertsSuppressionRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "dismissIpAnomalyAlerts", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAlertsSuppressionRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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]interface{}{ - "in": []interface{}{ - "104.215.95.187", - "52.164.206.56", - }, - }, - Field: to.Ptr("entities.ip.address"), - }, - { - AdditionalProperties: map[string]interface{}{ - "contains": "POWERSHELL.EXE", - }, - Field: to.Ptr("entities.process.commandline"), - }}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAlertsSuppressionRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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 00a316323c4a..000000000000 --- a/sdk/resourcemanager/security/armsecurity/allowedconnections_client_example_test.go +++ /dev/null @@ -1,84 +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. - -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/tree/main/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() - client, err := armsecurity.NewAllowedConnectionsClient("3eeab341-f466-499c-a8be-85427e154bad", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAllowedConnectionsClient("3eeab341-f466-499c-a8be-85427e154bad", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByHomeRegionPager("centralus", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAllowedConnectionsClient("3eeab341-f466-499c-a8be-85427e154bad", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myResourceGroup", "centralus", armsecurity.ConnectionTypeInternal, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} 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 0b14d808a1a2..000000000000 --- a/sdk/resourcemanager/security/armsecurity/application_client_example_test.go +++ /dev/null @@ -1,89 +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. - -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/tree/main/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() - client, err := armsecurity.NewApplicationClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewApplicationClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", armsecurity.Application{ - Properties: &armsecurity.ApplicationProperties{ - Description: to.Ptr("An application on critical recommendations"), - ConditionSets: []interface{}{ - map[string]interface{}{ - "conditions": []interface{}{ - map[string]interface{}{ - "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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewApplicationClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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 d652401fa85e..000000000000 --- a/sdk/resourcemanager/security/armsecurity/applications_client_example_test.go +++ /dev/null @@ -1,41 +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. - -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/tree/main/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() - client, err := armsecurity.NewApplicationsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} 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 f9f558d04999..000000000000 --- a/sdk/resourcemanager/security/armsecurity/assessments_client_example_test.go +++ /dev/null @@ -1,125 +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. - -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/tree/main/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() - client, err := armsecurity.NewAssessmentsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAssessmentsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAssessmentsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAssessmentsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAssessmentsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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 79906f8b6dee..000000000000 --- a/sdk/resourcemanager/security/armsecurity/assessmentsmetadata_client_example_test.go +++ /dev/null @@ -1,156 +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. - -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/tree/main/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() - client, err := armsecurity.NewAssessmentsMetadataClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAssessmentsMetadataClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "21300918-b2e3-0346-785f-c77ff57d243b", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAssessmentsMetadataClient("0980887d-03d6-408c-9566-532f3456804e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAssessmentsMetadataClient("0980887d-03d6-408c-9566-532f3456804e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetInSubscription(ctx, "21300918-b2e3-0346-785f-c77ff57d243b", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAssessmentsMetadataClient("0980887d-03d6-408c-9566-532f3456804e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAssessmentsMetadataClient("0980887d-03d6-408c-9566-532f3456804e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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 4f4642ddcbad..000000000000 --- a/sdk/resourcemanager/security/armsecurity/automations_client_example_test.go +++ /dev/null @@ -1,299 +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. - -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/tree/main/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() - client, err := armsecurity.NewAutomationsClient("a5caac9c-5c04-49af-b3d0-e204f40345d5", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAutomationsClient("a5caac9c-5c04-49af-b3d0-e204f40345d5", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("exampleResourceGroup", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAutomationsClient("a5caac9c-5c04-49af-b3d0-e204f40345d5", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "exampleResourceGroup", "exampleAutomation", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAutomationsClient("a5caac9c-5c04-49af-b3d0-e204f40345d5", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAutomationsClient("a5caac9c-5c04-49af-b3d0-e204f40345d5", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAutomationsClient("a5caac9c-5c04-49af-b3d0-e204f40345d5", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAutomationsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/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() - client, err := armsecurity.NewAutomationsClient("a5caac9c-5c04-49af-b3d0-e204f40345d5", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} 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 672174227791..000000000000 --- a/sdk/resourcemanager/security/armsecurity/autoprovisioningsettings_client_example_test.go +++ /dev/null @@ -1,87 +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. - -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/tree/main/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() - client, err := armsecurity.NewAutoProvisioningSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAutoProvisioningSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewAutoProvisioningSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/autorest.md b/sdk/resourcemanager/security/armsecurity/autorest.md index 548e65b81ae3..4fdb31cd0c7d 100644 --- a/sdk/resourcemanager/security/armsecurity/autorest.md +++ b/sdk/resourcemanager/security/armsecurity/autorest.md @@ -4,12 +4,11 @@ ``` yaml azure-arm: true -tag: package-composite-v3 require: -- https://github.com/Azure/azure-rest-api-specs/blob/6080bb1fc0e219b72ed3c85966b54334e22e9980/specification/security/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/6080bb1fc0e219b72ed3c85966b54334e22e9980/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.8.0 +module-version: 0.9.0 modelerfour: lenient-model-deduplication: true ``` \ No newline at end of file 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 cf3f0ae0e018..000000000000 --- a/sdk/resourcemanager/security/armsecurity/complianceresults_client_example_test.go +++ /dev/null @@ -1,60 +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. - -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/tree/main/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() - client, err := armsecurity.NewComplianceResultsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewComplianceResultsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "DesignateMoreThanOneOwner", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} 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 3d845b0484d9..000000000000 --- a/sdk/resourcemanager/security/armsecurity/compliances_client_example_test.go +++ /dev/null @@ -1,60 +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. - -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/tree/main/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() - client, err := armsecurity.NewCompliancesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewCompliancesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "2018-01-01Z", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} 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 55e790113bc9..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectorapplication_client_example_test.go +++ /dev/null @@ -1,89 +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. - -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/tree/main/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() - client, err := armsecurity.NewConnectorApplicationClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewConnectorApplicationClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", armsecurity.Application{ - Properties: &armsecurity.ApplicationProperties{ - Description: to.Ptr("An application on critical GCP recommendations"), - ConditionSets: []interface{}{ - map[string]interface{}{ - "conditions": []interface{}{ - map[string]interface{}{ - "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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewConnectorApplicationClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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 8275aaff3b2c..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectorapplications_client_example_test.go +++ /dev/null @@ -1,41 +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. - -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/tree/main/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() - client, err := armsecurity.NewConnectorApplicationsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("gcpResourceGroup", "gcpconnector", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} 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 c76ebbe2b505..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectorgovernancerule_client_example_test.go +++ /dev/null @@ -1,41 +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. - -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/tree/main/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() - client, err := armsecurity.NewConnectorGovernanceRuleClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("gcpResourceGroup", "gcpconnector", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} 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 03efeb59a645..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectorgovernancerules_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. - -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/tree/main/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() - client, err := armsecurity.NewConnectorGovernanceRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewConnectorGovernanceRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", armsecurity.GovernanceRule{ - Properties: &armsecurity.GovernanceRuleProperties{ - Description: to.Ptr("A rule on critical GCP recommendations"), - ConditionSets: []interface{}{ - map[string]interface{}{ - "conditions": []interface{}{ - map[string]interface{}{ - "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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewConnectorGovernanceRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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_example_test.go b/sdk/resourcemanager/security/armsecurity/connectorgovernancerulesexecutestatus_client_example_test.go deleted file mode 100644 index cdc322f86875..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectorgovernancerulesexecutestatus_client_example_test.go +++ /dev/null @@ -1,40 +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. - -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/tree/main/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() - client, err := armsecurity.NewConnectorGovernanceRulesExecuteStatusClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/connectors_client.go b/sdk/resourcemanager/security/armsecurity/connectors_client.go index 07ff74cabaff..8a435d88f991 100644 --- a/sdk/resourcemanager/security/armsecurity/connectors_client.go +++ b/sdk/resourcemanager/security/armsecurity/connectors_client.go @@ -58,7 +58,7 @@ func NewConnectorsClient(subscriptionID string, credential azcore.TokenCredentia // CreateOrUpdate - Creates or updates a security connector. If a security connector is already created and a subsequent request // 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-05-01-preview +// Generated from API version 2022-08-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 @@ -99,7 +99,7 @@ func (client *ConnectorsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, securityConnector) @@ -116,7 +116,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-05-01-preview +// Generated from API version 2022-08-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. @@ -155,7 +155,7 @@ func (client *ConnectorsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -163,7 +163,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-05-01-preview +// Generated from API version 2022-08-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. @@ -202,7 +202,7 @@ func (client *ConnectorsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -219,7 +219,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-05-01-preview +// Generated from API version 2022-08-01-preview // options - ConnectorsClientListOptions contains the optional parameters for the ConnectorsClient.List method. func (client *ConnectorsClient) NewListPager(options *ConnectorsClientListOptions) *runtime.Pager[ConnectorsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ConnectorsClientListResponse]{ @@ -261,7 +261,7 @@ func (client *ConnectorsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -278,7 +278,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-05-01-preview +// Generated from API version 2022-08-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.ListByResourceGroup // method. @@ -326,7 +326,7 @@ func (client *ConnectorsClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -343,7 +343,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-05-01-preview +// Generated from API version 2022-08-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 @@ -383,7 +383,7 @@ func (client *ConnectorsClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-05-01-preview") + reqQP.Set("api-version", "2022-08-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 7707c47db4cd..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectors_client_example_test.go +++ /dev/null @@ -1,176 +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. - -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/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-05-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() - client, err := armsecurity.NewConnectorsClient("a5caac9c-5c04-49af-b3d0-e204f40345d5", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-05-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() - client, err := armsecurity.NewConnectorsClient("a5caac9c-5c04-49af-b3d0-e204f40345d5", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("exampleResourceGroup", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-05-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() - client, err := armsecurity.NewConnectorsClient("a5caac9c-5c04-49af-b3d0-e204f40345d5", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "exampleResourceGroup", "exampleSecurityConnectorName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-05-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() - client, err := armsecurity.NewConnectorsClient("a5caac9c-5c04-49af-b3d0-e204f40345d5", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-05-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() - client, err := armsecurity.NewConnectorsClient("a5caac9c-5c04-49af-b3d0-e204f40345d5", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-05-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() - client, err := armsecurity.NewConnectorsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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 acb6b502af18..8f1ef25f8fc1 100644 --- a/sdk/resourcemanager/security/armsecurity/constants.go +++ b/sdk/resourcemanager/security/armsecurity/constants.go @@ -11,7 +11,7 @@ package armsecurity const ( moduleName = "armsecurity" - moduleVersion = "v0.8.0" + moduleVersion = "v0.9.0" ) // AADConnectivityState - The connectivity state of the external AAD solution @@ -104,24 +104,6 @@ func PossibleAdditionalWorkspaceTypeValues() []AdditionalWorkspaceType { } } -// AlertNotifications - Whether to send security alerts notifications to the security contact -type AlertNotifications string - -const ( - // AlertNotificationsOff - Don't get notifications on new alerts - AlertNotificationsOff AlertNotifications = "Off" - // AlertNotificationsOn - Get notifications on new alerts - AlertNotificationsOn AlertNotifications = "On" -) - -// PossibleAlertNotificationsValues returns the possible values for the AlertNotifications const type. -func PossibleAlertNotificationsValues() []AlertNotifications { - return []AlertNotifications{ - AlertNotificationsOff, - AlertNotificationsOn, - } -} - // AlertSeverity - The risk level of the threat that was detected. Learn more: https://docs.microsoft.com/en-us/azure/security-center/security-center-alerts-overview#how-are-alerts-classified. type AlertSeverity string @@ -170,24 +152,6 @@ func PossibleAlertStatusValues() []AlertStatus { } } -// AlertsToAdmins - Whether to send security alerts notifications to subscription admins -type AlertsToAdmins string - -const ( - // AlertsToAdminsOff - Don't send notification on new alerts to the subscription's admins - AlertsToAdminsOff AlertsToAdmins = "Off" - // AlertsToAdminsOn - Send notification on new alerts to the subscription's admins - AlertsToAdminsOn AlertsToAdmins = "On" -) - -// PossibleAlertsToAdminsValues returns the possible values for the AlertsToAdmins const type. -func PossibleAlertsToAdminsValues() []AlertsToAdmins { - return []AlertsToAdmins{ - AlertsToAdminsOff, - AlertsToAdminsOn, - } -} - // ApplicationConditionOperator - The application Condition's Operator, for example Contains for id or In for list of possible // IDs, see examples type ApplicationConditionOperator string @@ -196,6 +160,8 @@ const ( // ApplicationConditionOperatorContains - Checks that the string value of the data defined in Property contains the given // value ApplicationConditionOperatorContains ApplicationConditionOperator = "Contains" + // ApplicationConditionOperatorEquals - Checks that the string value of the data defined in Property equals the given value + ApplicationConditionOperatorEquals ApplicationConditionOperator = "Equals" // ApplicationConditionOperatorIn - Checks that the string value of the data defined in Property equals any of the given values // (exact fit) ApplicationConditionOperatorIn ApplicationConditionOperator = "In" @@ -205,6 +171,7 @@ const ( func PossibleApplicationConditionOperatorValues() []ApplicationConditionOperator { return []ApplicationConditionOperator{ ApplicationConditionOperatorContains, + ApplicationConditionOperatorEquals, ApplicationConditionOperatorIn, } } @@ -949,21 +916,46 @@ func PossibleKindValues() []Kind { } } +// MinimalSeverity - Defines the minimal alert severity which will be sent as email notifications +type MinimalSeverity string + +const ( + // MinimalSeverityHigh - Get notifications on new alerts with High severity + MinimalSeverityHigh MinimalSeverity = "High" + // MinimalSeverityLow - Don't get notifications on new alerts with low, medium or high severity + MinimalSeverityLow MinimalSeverity = "Low" + // MinimalSeverityMedium - Get notifications on new alerts with medium or high severity + MinimalSeverityMedium MinimalSeverity = "Medium" +) + +// PossibleMinimalSeverityValues returns the possible values for the MinimalSeverity const type. +func PossibleMinimalSeverityValues() []MinimalSeverity { + return []MinimalSeverity{ + MinimalSeverityHigh, + MinimalSeverityLow, + MinimalSeverityMedium, + } +} + // OfferingType - The type of the security offering. type OfferingType string const ( - OfferingTypeCspmMonitorAws OfferingType = "CspmMonitorAws" - OfferingTypeCspmMonitorAzureDevOps OfferingType = "CspmMonitorAzureDevOps" - OfferingTypeCspmMonitorGcp OfferingType = "CspmMonitorGcp" - OfferingTypeCspmMonitorGithub OfferingType = "CspmMonitorGithub" - OfferingTypeDefenderForContainersAws OfferingType = "DefenderForContainersAws" - OfferingTypeDefenderForContainersGcp OfferingType = "DefenderForContainersGcp" - OfferingTypeDefenderForDatabasesAws OfferingType = "DefenderForDatabasesAws" - OfferingTypeDefenderForDatabasesGcp OfferingType = "DefenderForDatabasesGcp" - OfferingTypeDefenderForServersAws OfferingType = "DefenderForServersAws" - OfferingTypeDefenderForServersGcp OfferingType = "DefenderForServersGcp" - OfferingTypeInformationProtectionAws OfferingType = "InformationProtectionAws" + OfferingTypeCspmMonitorAws OfferingType = "CspmMonitorAws" + OfferingTypeCspmMonitorAzureDevOps OfferingType = "CspmMonitorAzureDevOps" + OfferingTypeCspmMonitorGcp OfferingType = "CspmMonitorGcp" + OfferingTypeCspmMonitorGithub OfferingType = "CspmMonitorGithub" + OfferingTypeDefenderCspmAws OfferingType = "DefenderCspmAws" + OfferingTypeDefenderCspmGcp OfferingType = "DefenderCspmGcp" + OfferingTypeDefenderForContainersAws OfferingType = "DefenderForContainersAws" + OfferingTypeDefenderForContainersGcp OfferingType = "DefenderForContainersGcp" + OfferingTypeDefenderForDatabasesAws OfferingType = "DefenderForDatabasesAws" + OfferingTypeDefenderForDatabasesGcp OfferingType = "DefenderForDatabasesGcp" + OfferingTypeDefenderForDevOpsAzureDevOps OfferingType = "DefenderForDevOpsAzureDevOps" + OfferingTypeDefenderForDevOpsGithub OfferingType = "DefenderForDevOpsGithub" + OfferingTypeDefenderForServersAws OfferingType = "DefenderForServersAws" + OfferingTypeDefenderForServersGcp OfferingType = "DefenderForServersGcp" + OfferingTypeInformationProtectionAws OfferingType = "InformationProtectionAws" ) // PossibleOfferingTypeValues returns the possible values for the OfferingType const type. @@ -973,10 +965,14 @@ func PossibleOfferingTypeValues() []OfferingType { OfferingTypeCspmMonitorAzureDevOps, OfferingTypeCspmMonitorGcp, OfferingTypeCspmMonitorGithub, + OfferingTypeDefenderCspmAws, + OfferingTypeDefenderCspmGcp, OfferingTypeDefenderForContainersAws, OfferingTypeDefenderForContainersGcp, OfferingTypeDefenderForDatabasesAws, OfferingTypeDefenderForDatabasesGcp, + OfferingTypeDefenderForDevOpsAzureDevOps, + OfferingTypeDefenderForDevOpsGithub, OfferingTypeDefenderForServersAws, OfferingTypeDefenderForServersGcp, OfferingTypeInformationProtectionAws, @@ -1348,6 +1344,30 @@ func PossibleResourceStatusValues() []ResourceStatus { } } +// Roles - A possible role to configure sending security notification alerts to +type Roles string + +const ( + // RolesAccountAdmin - If enabled, send notification on new alerts to the account admins + RolesAccountAdmin Roles = "AccountAdmin" + // RolesContributor - If enabled, send notification on new alerts to the subscription contributors + RolesContributor Roles = "Contributor" + // RolesOwner - If enabled, send notification on new alerts to the subscription owners + RolesOwner Roles = "Owner" + // RolesServiceAdmin - If enabled, send notification on new alerts to the service admins + RolesServiceAdmin Roles = "ServiceAdmin" +) + +// PossibleRolesValues returns the possible values for the Roles const type. +func PossibleRolesValues() []Roles { + return []Roles{ + RolesAccountAdmin, + RolesContributor, + RolesOwner, + RolesServiceAdmin, + } +} + // RuleSeverity - The rule severity. type RuleSeverity string diff --git a/sdk/resourcemanager/security/armsecurity/contacts_client.go b/sdk/resourcemanager/security/armsecurity/contacts_client.go index 04e1d7e427de..c5a1de914b3f 100644 --- a/sdk/resourcemanager/security/armsecurity/contacts_client.go +++ b/sdk/resourcemanager/security/armsecurity/contacts_client.go @@ -55,9 +55,9 @@ func NewContactsClient(subscriptionID string, credential azcore.TokenCredential, return client, nil } -// Create - Security contact configurations for the subscription +// Create - Create security contact configurations for the subscription // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2017-08-01-preview +// Generated from API version 2020-01-01-preview // securityContactName - Name of the security contact object // securityContact - Security contact object // options - ContactsClientCreateOptions contains the optional parameters for the ContactsClient.Create method. @@ -70,7 +70,7 @@ func (client *ContactsClient) Create(ctx context.Context, securityContactName st if err != nil { return ContactsClientCreateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { return ContactsClientCreateResponse{}, runtime.NewResponseError(resp) } return client.createHandleResponse(resp) @@ -92,7 +92,7 @@ func (client *ContactsClient) createCreateRequest(ctx context.Context, securityC return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-08-01-preview") + reqQP.Set("api-version", "2020-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, securityContact) @@ -107,9 +107,9 @@ func (client *ContactsClient) createHandleResponse(resp *http.Response) (Contact return result, nil } -// Delete - Security contact configurations for the subscription +// Delete - Delete security contact configurations for the subscription // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2017-08-01-preview +// Generated from API version 2020-01-01-preview // securityContactName - Name of the security contact object // options - ContactsClientDeleteOptions contains the optional parameters for the ContactsClient.Delete method. func (client *ContactsClient) Delete(ctx context.Context, securityContactName string, options *ContactsClientDeleteOptions) (ContactsClientDeleteResponse, error) { @@ -121,7 +121,7 @@ func (client *ContactsClient) Delete(ctx context.Context, securityContactName st if err != nil { return ContactsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return ContactsClientDeleteResponse{}, runtime.NewResponseError(resp) } return ContactsClientDeleteResponse{}, nil @@ -143,15 +143,15 @@ func (client *ContactsClient) deleteCreateRequest(ctx context.Context, securityC return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-08-01-preview") + reqQP.Set("api-version", "2020-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// Get - Security contact configurations for the subscription +// Get - Get Default Security contact configurations for the subscription // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2017-08-01-preview +// Generated from API version 2020-01-01-preview // securityContactName - Name of the security contact object // options - ContactsClientGetOptions contains the optional parameters for the ContactsClient.Get method. func (client *ContactsClient) Get(ctx context.Context, securityContactName string, options *ContactsClientGetOptions) (ContactsClientGetResponse, error) { @@ -185,7 +185,7 @@ func (client *ContactsClient) getCreateRequest(ctx context.Context, securityCont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-08-01-preview") + reqQP.Set("api-version", "2020-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -200,8 +200,8 @@ func (client *ContactsClient) getHandleResponse(resp *http.Response) (ContactsCl return result, nil } -// NewListPager - Security contact configurations for the subscription -// Generated from API version 2017-08-01-preview +// NewListPager - List all security contact configurations for the subscription +// Generated from API version 2020-01-01-preview // options - ContactsClientListOptions contains the optional parameters for the ContactsClient.List method. func (client *ContactsClient) NewListPager(options *ContactsClientListOptions) *runtime.Pager[ContactsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ContactsClientListResponse]{ @@ -243,7 +243,7 @@ func (client *ContactsClient) listCreateRequest(ctx context.Context, options *Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-08-01-preview") + reqQP.Set("api-version", "2020-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -257,55 +257,3 @@ func (client *ContactsClient) listHandleResponse(resp *http.Response) (ContactsC } return result, nil } - -// Update - Security contact configurations for the subscription -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2017-08-01-preview -// securityContactName - Name of the security contact object -// securityContact - Security contact object -// options - ContactsClientUpdateOptions contains the optional parameters for the ContactsClient.Update method. -func (client *ContactsClient) Update(ctx context.Context, securityContactName string, securityContact Contact, options *ContactsClientUpdateOptions) (ContactsClientUpdateResponse, error) { - req, err := client.updateCreateRequest(ctx, securityContactName, securityContact, options) - if err != nil { - return ContactsClientUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ContactsClientUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ContactsClientUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.updateHandleResponse(resp) -} - -// updateCreateRequest creates the Update request. -func (client *ContactsClient) updateCreateRequest(ctx context.Context, securityContactName string, securityContact Contact, options *ContactsClientUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if securityContactName == "" { - return nil, errors.New("parameter securityContactName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{securityContactName}", url.PathEscape(securityContactName)) - req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2017-08-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, securityContact) -} - -// updateHandleResponse handles the Update response. -func (client *ContactsClient) updateHandleResponse(resp *http.Response) (ContactsClientUpdateResponse, error) { - result := ContactsClientUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.Contact); err != nil { - return ContactsClientUpdateResponse{}, err - } - return result, nil -} 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 5099c94fe572..000000000000 --- a/sdk/resourcemanager/security/armsecurity/contacts_client_example_test.go +++ /dev/null @@ -1,231 +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. - -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/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/GetSecurityContactsSubscription_full_example.json -func ExampleContactsClient_NewListPager_updateSecurityContactDataFull() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewContactsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/GetSecurityContactsSubscription_min_example.json -func ExampleContactsClient_NewListPager_updateSecurityContactDataMinimal() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewContactsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/GetSecurityContact_full_example.json -func ExampleContactsClient_Get_getSecurityContactDataFull() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewContactsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "default1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/GetSecurityContact_min_example.json -func ExampleContactsClient_Get_getSecurityContactDataMinimal() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewContactsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "default2", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/CreateSecurityContact_full_example.json -func ExampleContactsClient_Create_createSecurityContactDataFull() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewContactsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, "default1", armsecurity.Contact{ - Name: to.Ptr("default1"), - Type: to.Ptr("Microsoft.Security/securityContacts"), - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/securityContacts/default1"), - Properties: &armsecurity.ContactProperties{ - AlertNotifications: to.Ptr(armsecurity.AlertNotificationsOn), - AlertsToAdmins: to.Ptr(armsecurity.AlertsToAdminsOn), - Email: to.Ptr("john@contoso.com"), - Phone: to.Ptr("(214)275-4038"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/CreateSecurityContact_min_example.json -func ExampleContactsClient_Create_createSecurityContactDataMinimal() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewContactsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, "default2", armsecurity.Contact{ - Name: to.Ptr("default2"), - Type: to.Ptr("Microsoft.Security/securityContacts"), - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/securityContacts/default2"), - Properties: &armsecurity.ContactProperties{ - AlertNotifications: to.Ptr(armsecurity.AlertNotificationsOn), - AlertsToAdmins: to.Ptr(armsecurity.AlertsToAdminsOn), - Email: to.Ptr("chen@contoso.com"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2017-08-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() - client, err := armsecurity.NewContactsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "default1", 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/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/UpdateSecurityContact_full_example.json -func ExampleContactsClient_Update_updateSecurityContactDataFull() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewContactsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "john", armsecurity.Contact{ - Name: to.Ptr("default1"), - Type: to.Ptr("Microsoft.Security/securityContacts"), - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/securityContacts/default1"), - Properties: &armsecurity.ContactProperties{ - AlertNotifications: to.Ptr(armsecurity.AlertNotificationsOn), - Phone: to.Ptr("(214)275-4038"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/SecurityContacts/UpdateSecurityContact_min_example.json -func ExampleContactsClient_Update_updateSecurityContactDataMinimal() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewContactsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "default2", armsecurity.Contact{ - Name: to.Ptr("default2"), - Type: to.Ptr("Microsoft.Security/securityContacts"), - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/securityContacts/default2"), - Properties: &armsecurity.ContactProperties{ - AlertNotifications: to.Ptr(armsecurity.AlertNotificationsOn), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} 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 c23b5581ce1a..000000000000 --- a/sdk/resourcemanager/security/armsecurity/customassessmentautomations_client_example_test.go +++ /dev/null @@ -1,130 +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. - -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/tree/main/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() - client, err := armsecurity.NewCustomAssessmentAutomationsClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "TestResourceGroup", "MyCustomAssessmentAutomation", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewCustomAssessmentAutomationsClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewCustomAssessmentAutomationsClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/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() - client, err := armsecurity.NewCustomAssessmentAutomationsClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("TestResourceGroup", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewCustomAssessmentAutomationsClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} 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 bb836af261f7..000000000000 --- a/sdk/resourcemanager/security/armsecurity/customentitystoreassignments_client_example_test.go +++ /dev/null @@ -1,125 +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. - -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/tree/main/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() - client, err := armsecurity.NewCustomEntityStoreAssignmentsClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewCustomEntityStoreAssignmentsClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewCustomEntityStoreAssignmentsClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/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() - client, err := armsecurity.NewCustomEntityStoreAssignmentsClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("TestResourceGroup", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewCustomEntityStoreAssignmentsClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} 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 5f0d6a23eda5..000000000000 --- a/sdk/resourcemanager/security/armsecurity/devicesecuritygroups_client_example_test.go +++ /dev/null @@ -1,108 +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. - -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/tree/main/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() - client, err := armsecurity.NewDeviceSecurityGroupsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewDeviceSecurityGroupsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewDeviceSecurityGroupsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewDeviceSecurityGroupsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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 36927b810e3f..000000000000 --- a/sdk/resourcemanager/security/armsecurity/discoveredsecuritysolutions_client_example_test.go +++ /dev/null @@ -1,84 +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. - -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/tree/main/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() - client, err := armsecurity.NewDiscoveredSecuritySolutionsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewDiscoveredSecuritySolutionsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByHomeRegionPager("centralus", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewDiscoveredSecuritySolutionsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myRg2", "centralus", "paloalto7", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} 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 ac257b74a868..000000000000 --- a/sdk/resourcemanager/security/armsecurity/externalsecuritysolutions_client_example_test.go +++ /dev/null @@ -1,84 +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. - -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/tree/main/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() - client, err := armsecurity.NewExternalSecuritySolutionsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewExternalSecuritySolutionsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByHomeRegionPager("centralus", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewExternalSecuritySolutionsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/go.mod b/sdk/resourcemanager/security/armsecurity/go.mod index 17263ce743aa..84a93b93dce3 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.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // 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 8828b17b1853..3afb578030a5 100644 --- a/sdk/resourcemanager/security/armsecurity/go.sum +++ b/sdk/resourcemanager/security/armsecurity/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0 h1:QkAcEIAKbNL4KoFr4SathZPhDhF4mVwpBMFlYjyAqy8= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.1.0/go.mod h1:bhXu1AjYL+wutSL/kpSq6s7733q2Rb0yuot9Zgfqa/0= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1 h1:BWe8a+f/t+7KY7zH2mqygeUD0t8hNFXe08p1Pb3/jKE= -github.com/AzureAD/microsoft-authentication-library-for-go v0.5.1/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= 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 v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/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/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +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.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -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_example_test.go b/sdk/resourcemanager/security/armsecurity/governanceassignments_client_example_test.go deleted file mode 100644 index fa60f7b5d251..000000000000 --- a/sdk/resourcemanager/security/armsecurity/governanceassignments_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. - -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/tree/main/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() - client, err := armsecurity.NewGovernanceAssignmentsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd", "6b9421dd-5555-2251-9b3d-2be58e2f82cd", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewGovernanceAssignmentsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewGovernanceAssignmentsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewGovernanceAssignmentsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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_example_test.go b/sdk/resourcemanager/security/armsecurity/governancerule_client_example_test.go deleted file mode 100644 index 989a01b64165..000000000000 --- a/sdk/resourcemanager/security/armsecurity/governancerule_client_example_test.go +++ /dev/null @@ -1,41 +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. - -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/tree/main/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() - client, err := armsecurity.NewGovernanceRuleClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} 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 44f38d51d6bf..000000000000 --- a/sdk/resourcemanager/security/armsecurity/governancerules_client_example_test.go +++ /dev/null @@ -1,144 +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. - -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/tree/main/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() - client, err := armsecurity.NewGovernanceRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewGovernanceRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", armsecurity.GovernanceRule{ - Properties: &armsecurity.GovernanceRuleProperties{ - Description: to.Ptr("A rule on critical recommendations"), - ConditionSets: []interface{}{ - map[string]interface{}{ - "conditions": []interface{}{ - map[string]interface{}{ - "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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewGovernanceRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/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() - client, err := armsecurity.NewGovernanceRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/tree/main/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() - client, err := armsecurity.NewGovernanceRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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/informationprotectionpolicies_client_example_test.go b/sdk/resourcemanager/security/armsecurity/informationprotectionpolicies_client_example_test.go deleted file mode 100644 index 4348e8472f64..000000000000 --- a/sdk/resourcemanager/security/armsecurity/informationprotectionpolicies_client_example_test.go +++ /dev/null @@ -1,147 +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. - -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/tree/main/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() - client, err := armsecurity.NewInformationProtectionPoliciesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewInformationProtectionPoliciesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewInformationProtectionPoliciesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewInformationProtectionPoliciesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} 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 fef619cca476..000000000000 --- a/sdk/resourcemanager/security/armsecurity/ingestionsettings_client_example_test.go +++ /dev/null @@ -1,134 +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. - -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/tree/main/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() - client, err := armsecurity.NewIngestionSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewIngestionSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewIngestionSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, "default", armsecurity.IngestionSetting{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewIngestionSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/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() - client, err := armsecurity.NewIngestionSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListTokens(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewIngestionSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListConnectionStrings(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} 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 92836e277000..000000000000 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolution_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. - -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/tree/main/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() - client, err := armsecurity.NewIotSecuritySolutionClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.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() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewIotSecuritySolutionClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(&armsecurity.IotSecuritySolutionClientListBySubscriptionOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewIotSecuritySolutionClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("MyGroup", &armsecurity.IotSecuritySolutionClientListByResourceGroupOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewIotSecuritySolutionClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.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() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewIotSecuritySolutionClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "MyGroup", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewIotSecuritySolutionClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewIotSecuritySolutionClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewIotSecuritySolutionClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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 9fc80ba63653..000000000000 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionanalytics_client_example_test.go +++ /dev/null @@ -1,55 +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. - -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/tree/main/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() - client, err := armsecurity.NewIotSecuritySolutionAnalyticsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, "MyGroup", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewIotSecuritySolutionAnalyticsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "MyGroup", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} 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 1e56d218641b..000000000000 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsaggregatedalert_client_example_test.go +++ /dev/null @@ -1,77 +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. - -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/tree/main/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() - client, err := armsecurity.NewIotSecuritySolutionsAnalyticsAggregatedAlertClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("MyGroup", "default", &armsecurity.IotSecuritySolutionsAnalyticsAggregatedAlertClientListOptions{Top: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewIotSecuritySolutionsAnalyticsAggregatedAlertClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "MyGroup", "default", "IoT_Bruteforce_Fail/2019-02-02", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewIotSecuritySolutionsAnalyticsAggregatedAlertClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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 92f697e736ff..000000000000 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsrecommendation_client_example_test.go +++ /dev/null @@ -1,60 +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. - -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/tree/main/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() - client, err := armsecurity.NewIotSecuritySolutionsAnalyticsRecommendationClient("075423e9-7d33-4166-8bdf-3920b04e3735", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "IoTEdgeResources", "default", "OpenPortsOnDevice", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewIotSecuritySolutionsAnalyticsRecommendationClient("075423e9-7d33-4166-8bdf-3920b04e3735", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("IoTEdgeResources", "default", &armsecurity.IotSecuritySolutionsAnalyticsRecommendationClientListOptions{Top: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} 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 29949c27585c..000000000000 --- a/sdk/resourcemanager/security/armsecurity/jitnetworkaccesspolicies_client_example_test.go +++ /dev/null @@ -1,242 +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. - -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/tree/main/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() - client, err := armsecurity.NewJitNetworkAccessPoliciesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewJitNetworkAccessPoliciesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByRegionPager("westeurope", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewJitNetworkAccessPoliciesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("myRg1", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewJitNetworkAccessPoliciesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupAndRegionPager("myRg1", "westeurope", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewJitNetworkAccessPoliciesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myRg1", "westeurope", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewJitNetworkAccessPoliciesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewJitNetworkAccessPoliciesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/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() - client, err := armsecurity.NewJitNetworkAccessPoliciesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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 b5f32795ffc7..000000000000 --- a/sdk/resourcemanager/security/armsecurity/locations_client_example_test.go +++ /dev/null @@ -1,60 +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. - -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/tree/main/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() - client, err := armsecurity.NewLocationsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewLocationsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "centralus", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} 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 027cd0fdb7ae..000000000000 --- a/sdk/resourcemanager/security/armsecurity/mdeonboardings_client_example_test.go +++ /dev/null @@ -1,55 +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. - -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/tree/main/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() - client, err := armsecurity.NewMdeOnboardingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewMdeOnboardingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/models.go b/sdk/resourcemanager/security/armsecurity/models.go index 5f38636d2de4..a1f8693ad4e3 100644 --- a/sdk/resourcemanager/security/armsecurity/models.go +++ b/sdk/resourcemanager/security/armsecurity/models.go @@ -52,22 +52,6 @@ type AADSolutionProperties struct { Workspace *ConnectedWorkspace `json:"workspace,omitempty"` } -// 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"` -} - -// GetEnvironmentData implements the EnvironmentDataClassification interface for type AWSEnvironmentData. -func (a *AWSEnvironmentData) GetEnvironmentData() *EnvironmentData { - return &EnvironmentData{ - EnvironmentType: a.EnvironmentType, - } -} - // AccountConnectorsClientCreateOrUpdateOptions contains the optional parameters for the AccountConnectorsClient.CreateOrUpdate // method. type AccountConnectorsClientCreateOrUpdateOptions struct { @@ -1848,6 +1832,22 @@ func (a *AwsCredsAuthenticationDetailsProperties) GetAuthenticationDetailsProper } } +// 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"` +} + +// GetEnvironmentData implements the EnvironmentDataClassification interface for type AwsEnvironmentData. +func (a *AwsEnvironmentData) GetEnvironmentData() *EnvironmentData { + return &EnvironmentData{ + EnvironmentType: a.EnvironmentType, + } +} + // AwsOrganizationalDataClassification provides polymorphic access to related types. // Call the interface's GetAwsOrganizationalData() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: @@ -2045,7 +2045,8 @@ type CefSolutionProperties struct { // 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, -// - *DefenderFoDatabasesAwsOffering, *DefenderForContainersAwsOffering, *DefenderForContainersGcpOffering, *DefenderForDatabasesGcpOffering, +// - *DefenderCspmAwsOffering, *DefenderCspmGcpOffering, *DefenderFoDatabasesAwsOffering, *DefenderForContainersAwsOffering, +// - *DefenderForContainersGcpOffering, *DefenderForDatabasesGcpOffering, *DefenderForDevOpsAzureDevOpsOffering, *DefenderForDevOpsGithubOffering, // - *DefenderForServersAwsOffering, *DefenderForServersGcpOffering, *InformationProtectionAwsOffering type CloudOfferingClassification interface { // GetCloudOffering returns the CloudOffering content of the underlying type. @@ -2492,7 +2493,7 @@ type ConnectorsList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// Contact details for security issues +// Contact details and configurations for notifications coming from Microsoft Defender for Cloud. type Contact struct { // Security contact data Properties *ContactProperties `json:"properties,omitempty"` @@ -2516,21 +2517,43 @@ type ContactList struct { Value []*Contact `json:"value,omitempty" azure:"ro"` } -// ContactProperties - describes security contact properties +// ContactProperties - Describes security contact properties type ContactProperties struct { - // REQUIRED; Whether to send security alerts notifications to the security contact - AlertNotifications *AlertNotifications `json:"alertNotifications,omitempty"` + // Defines whether to send email notifications about new security alerts + AlertNotifications *ContactPropertiesAlertNotifications `json:"alertNotifications,omitempty"` - // REQUIRED; Whether to send security alerts notifications to subscription admins - AlertsToAdmins *AlertsToAdmins `json:"alertsToAdmins,omitempty"` + // List of email addresses which will get notifications from Microsoft Defender for Cloud by the configurations defined in + // this security contact. + Emails *string `json:"emails,omitempty"` - // REQUIRED; The email of this security contact - Email *string `json:"email,omitempty"` + // Defines whether to send email notifications from Microsoft Defender for Cloud to persons with specific RBAC roles on the + // subscription. + NotificationsByRole *ContactPropertiesNotificationsByRole `json:"notificationsByRole,omitempty"` - // The phone number of this security contact + // The security contact's phone number Phone *string `json:"phone,omitempty"` } +// ContactPropertiesAlertNotifications - Defines whether to send email notifications about new security alerts +type ContactPropertiesAlertNotifications struct { + // Defines the minimal alert severity which will be sent as email notifications + MinimalSeverity *MinimalSeverity `json:"minimalSeverity,omitempty"` + + // Defines if email notifications will be sent about new security alerts + State *State `json:"state,omitempty"` +} + +// ContactPropertiesNotificationsByRole - Defines whether to send email notifications from Microsoft Defender for Cloud to +// persons with specific RBAC roles on the subscription. +type ContactPropertiesNotificationsByRole struct { + // Defines which RBAC roles will get email notifications from Microsoft Defender for Cloud. List of allowed RBAC roles: + Roles []*Roles `json:"roles,omitempty"` + + // Defines whether to send email notifications from AMicrosoft Defender for Cloud to persons with specific RBAC roles on the + // subscription. + State *State `json:"state,omitempty"` +} + // ContactsClientCreateOptions contains the optional parameters for the ContactsClient.Create method. type ContactsClientCreateOptions struct { // placeholder for future optional parameters @@ -2551,11 +2574,6 @@ type ContactsClientListOptions struct { // placeholder for future optional parameters } -// ContactsClientUpdateOptions contains the optional parameters for the ContactsClient.Update method. -type ContactsClientUpdateOptions struct { - // placeholder for future optional parameters -} - // ContainerRegistryVulnerabilityProperties - Additional context fields for container registry Vulnerability assessment type ContainerRegistryVulnerabilityProperties struct { // REQUIRED; Sub-assessment resource type @@ -2944,6 +2962,64 @@ func (d *DataExportSettings) GetSetting() *Setting { } } +// 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 for Server VM scanning configuration + VMScanners *DefenderCspmAwsOfferingVMScanners `json:"vmScanners,omitempty"` + + // READ-ONLY; The offering description. + Description *string `json:"description,omitempty" azure:"ro"` +} + +// GetCloudOffering implements the CloudOfferingClassification interface for type DefenderCspmAwsOffering. +func (d *DefenderCspmAwsOffering) GetCloudOffering() *CloudOffering { + return &CloudOffering{ + OfferingType: d.OfferingType, + Description: d.Description, + } +} + +// DefenderCspmAwsOfferingVMScanners - The Microsoft Defender for Server VM scanning configuration +type DefenderCspmAwsOfferingVMScanners struct { + // configuration for Microsoft Defender for Server VM scanning + Configuration *DefenderCspmAwsOfferingVMScannersConfiguration `json:"configuration,omitempty"` + + // Is Microsoft Defender for Server VM scanning enabled + Enabled *bool `json:"enabled,omitempty"` +} + +// DefenderCspmAwsOfferingVMScannersConfiguration - configuration for Microsoft Defender for Server VM scanning +type DefenderCspmAwsOfferingVMScannersConfiguration struct { + // The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` + + // VM tags that indicates 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"` +} + +// DefenderCspmGcpOffering - The CSPM P1 for GCP offering +type DefenderCspmGcpOffering 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 DefenderCspmGcpOffering. +func (d *DefenderCspmGcpOffering) GetCloudOffering() *CloudOffering { + return &CloudOffering{ + OfferingType: d.OfferingType, + Description: d.Description, + } +} + // DefenderFoDatabasesAwsOffering - The Defender for Databases AWS offering type DefenderFoDatabasesAwsOffering struct { // REQUIRED; The type of the security offering. @@ -2952,6 +3028,9 @@ type DefenderFoDatabasesAwsOffering struct { // The ARC autoprovisioning configuration ArcAutoProvisioning *DefenderFoDatabasesAwsOfferingArcAutoProvisioning `json:"arcAutoProvisioning,omitempty"` + // The RDS configuration + Rds *DefenderFoDatabasesAwsOfferingRds `json:"rds,omitempty"` + // READ-ONLY; The offering description. Description *string `json:"description,omitempty" azure:"ro"` } @@ -2971,22 +3050,15 @@ type DefenderFoDatabasesAwsOfferingArcAutoProvisioning struct { // Is arc auto provisioning enabled Enabled *bool `json:"enabled,omitempty"` - - // Metadata of Service Principal secret for autoprovisioning - ServicePrincipalSecretMetadata *DefenderFoDatabasesAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata `json:"servicePrincipalSecretMetadata,omitempty"` } -// DefenderFoDatabasesAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata - Metadata of Service Principal secret -// for autoprovisioning -type DefenderFoDatabasesAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata struct { - // expiration date of service principal secret - ExpiryDate *time.Time `json:"expiryDate,omitempty"` - - // name of secret resource in parameter store - ParameterNameInStore *string `json:"parameterNameInStore,omitempty"` +// DefenderFoDatabasesAwsOfferingRds - The RDS configuration +type DefenderFoDatabasesAwsOfferingRds struct { + // The cloud role ARN in AWS for this feature + CloudRoleArn *string `json:"cloudRoleArn,omitempty"` - // region of parameter store where secret is kept - ParameterStoreRegion *string `json:"parameterStoreRegion,omitempty"` + // Is RDS protection enabled + Enabled *bool `json:"enabled,omitempty"` } // DefenderForContainersAwsOffering - The Defender for Containers AWS offering @@ -3147,22 +3219,10 @@ func (d *DefenderForDatabasesGcpOffering) GetCloudOffering() *CloudOffering { // DefenderForDatabasesGcpOfferingArcAutoProvisioning - The ARC autoprovisioning configuration type DefenderForDatabasesGcpOfferingArcAutoProvisioning struct { - // Configuration for ARC autoprovisioning - Configuration *DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration `json:"configuration,omitempty"` - // Is arc auto provisioning enabled Enabled *bool `json:"enabled,omitempty"` } -// DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration - Configuration for ARC autoprovisioning -type DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration struct { - // The agent onboarding service account numeric id - AgentOnboardingServiceAccountNumericID *string `json:"agentOnboardingServiceAccountNumericId,omitempty"` - - // The Azure service principal client id for agent onboarding - ClientID *string `json:"clientId,omitempty"` -} - // DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning - The native cloud connection configuration type DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning struct { // The service account email address in GCP for this offering @@ -3172,6 +3232,40 @@ type DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning stru WorkloadIdentityProviderID *string `json:"workloadIdentityProviderId,omitempty"` } +// DefenderForDevOpsAzureDevOpsOffering - The Defender for DevOps for Azure DevOps offering +type DefenderForDevOpsAzureDevOpsOffering 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 DefenderForDevOpsAzureDevOpsOffering. +func (d *DefenderForDevOpsAzureDevOpsOffering) 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. + OfferingType *OfferingType `json:"offeringType,omitempty"` + + // READ-ONLY; The offering description. + Description *string `json:"description,omitempty" azure:"ro"` +} + +// GetCloudOffering implements the CloudOfferingClassification interface for type DefenderForDevOpsGithubOffering. +func (d *DefenderForDevOpsGithubOffering) GetCloudOffering() *CloudOffering { + return &CloudOffering{ + OfferingType: d.OfferingType, + Description: d.Description, + } +} + // DefenderForServersAwsOffering - The Defender for Servers AWS offering type DefenderForServersAwsOffering struct { // REQUIRED; The type of the security offering. @@ -3214,22 +3308,6 @@ type DefenderForServersAwsOfferingArcAutoProvisioning struct { // Is arc auto provisioning enabled Enabled *bool `json:"enabled,omitempty"` - - // Metadata of Service Principal secret for autoprovisioning - ServicePrincipalSecretMetadata *DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata `json:"servicePrincipalSecretMetadata,omitempty"` -} - -// DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata - Metadata of Service Principal secret for -// autoprovisioning -type DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata struct { - // expiration date of service principal secret - ExpiryDate *string `json:"expiryDate,omitempty"` - - // name of secret resource in parameter store - ParameterNameInStore *string `json:"parameterNameInStore,omitempty"` - - // region of parameter store where secret is kept - ParameterStoreRegion *string `json:"parameterStoreRegion,omitempty"` } // DefenderForServersAwsOfferingDefenderForServers - The Defender for servers connection configuration @@ -3268,7 +3346,7 @@ type DefenderForServersAwsOfferingVMScannersConfiguration struct { CloudRoleArn *string `json:"cloudRoleArn,omitempty"` // VM tags that indicates that VM should not be scanned - ExclusionTags interface{} `json:"exclusionTags,omitempty"` + ExclusionTags map[string]*string `json:"exclusionTags,omitempty"` // The scanning mode for the vm scan. ScanningMode *ScanningMode `json:"scanningMode,omitempty"` @@ -3323,22 +3401,10 @@ func (d *DefenderForServersGcpOffering) GetCloudOffering() *CloudOffering { // DefenderForServersGcpOfferingArcAutoProvisioning - The ARC autoprovisioning configuration type DefenderForServersGcpOfferingArcAutoProvisioning struct { - // Configuration for ARC autoprovisioning - Configuration *DefenderForServersGcpOfferingArcAutoProvisioningConfiguration `json:"configuration,omitempty"` - // Is arc auto provisioning enabled Enabled *bool `json:"enabled,omitempty"` } -// DefenderForServersGcpOfferingArcAutoProvisioningConfiguration - Configuration for ARC autoprovisioning -type DefenderForServersGcpOfferingArcAutoProvisioningConfiguration struct { - // The agent onboarding service account numeric id - AgentOnboardingServiceAccountNumericID *string `json:"agentOnboardingServiceAccountNumericId,omitempty"` - - // The Azure service principal client id for agent onboarding - ClientID *string `json:"clientId,omitempty"` -} - // DefenderForServersGcpOfferingDefenderForServers - The Defender for servers connection configuration type DefenderForServersGcpOfferingDefenderForServers struct { // The service account email address in GCP for this feature @@ -3613,7 +3679,7 @@ 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 type EnvironmentDataClassification interface { // GetEnvironmentData returns the EnvironmentData content of the underlying type. GetEnvironmentData() *EnvironmentData diff --git a/sdk/resourcemanager/security/armsecurity/models_serde.go b/sdk/resourcemanager/security/armsecurity/models_serde.go index e1268e5f6374..7712659e0a20 100644 --- a/sdk/resourcemanager/security/armsecurity/models_serde.go +++ b/sdk/resourcemanager/security/armsecurity/models_serde.go @@ -146,37 +146,6 @@ func (a *AADSolutionProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AWSEnvironmentData. -func (a AWSEnvironmentData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["environmentType"] = EnvironmentTypeAwsAccount - populate(objectMap, "organizationalData", a.OrganizationalData) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AWSEnvironmentData. -func (a *AWSEnvironmentData) 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 "environmentType": - err = unpopulate(val, "EnvironmentType", &a.EnvironmentType) - delete(rawMsg, key) - case "organizationalData": - a.OrganizationalData, err = unmarshalAwsOrganizationalDataClassification(val) - 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]interface{}) @@ -3232,6 +3201,37 @@ func (a *AwsCredsAuthenticationDetailsProperties) UnmarshalJSON(data []byte) err return nil } +// MarshalJSON implements the json.Marshaller interface for type AwsEnvironmentData. +func (a AwsEnvironmentData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["environmentType"] = EnvironmentTypeAwsAccount + populate(objectMap, "organizationalData", a.OrganizationalData) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AwsEnvironmentData. +func (a *AwsEnvironmentData) 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 "environmentType": + err = unpopulate(val, "EnvironmentType", &a.EnvironmentType) + delete(rawMsg, key) + case "organizationalData": + a.OrganizationalData, err = unmarshalAwsOrganizationalDataClassification(val) + 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 AwsOrganizationalData. func (a AwsOrganizationalData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -4561,8 +4561,8 @@ func (c *ContactList) UnmarshalJSON(data []byte) error { func (c ContactProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "alertNotifications", c.AlertNotifications) - populate(objectMap, "alertsToAdmins", c.AlertsToAdmins) - populate(objectMap, "email", c.Email) + populate(objectMap, "emails", c.Emails) + populate(objectMap, "notificationsByRole", c.NotificationsByRole) populate(objectMap, "phone", c.Phone) return json.Marshal(objectMap) } @@ -4579,11 +4579,11 @@ func (c *ContactProperties) UnmarshalJSON(data []byte) error { case "alertNotifications": err = unpopulate(val, "AlertNotifications", &c.AlertNotifications) delete(rawMsg, key) - case "alertsToAdmins": - err = unpopulate(val, "AlertsToAdmins", &c.AlertsToAdmins) + case "emails": + err = unpopulate(val, "Emails", &c.Emails) delete(rawMsg, key) - case "email": - err = unpopulate(val, "Email", &c.Email) + case "notificationsByRole": + err = unpopulate(val, "NotificationsByRole", &c.NotificationsByRole) delete(rawMsg, key) case "phone": err = unpopulate(val, "Phone", &c.Phone) @@ -4596,6 +4596,68 @@ func (c *ContactProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ContactPropertiesAlertNotifications. +func (c ContactPropertiesAlertNotifications) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "minimalSeverity", c.MinimalSeverity) + populate(objectMap, "state", c.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContactPropertiesAlertNotifications. +func (c *ContactPropertiesAlertNotifications) 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 "minimalSeverity": + err = unpopulate(val, "MinimalSeverity", &c.MinimalSeverity) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &c.State) + 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 ContactPropertiesNotificationsByRole. +func (c ContactPropertiesNotificationsByRole) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "roles", c.Roles) + populate(objectMap, "state", c.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContactPropertiesNotificationsByRole. +func (c *ContactPropertiesNotificationsByRole) 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 "roles": + err = unpopulate(val, "Roles", &c.Roles) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &c.State) + 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 ContainerRegistryVulnerabilityProperties. func (c ContainerRegistryVulnerabilityProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) @@ -5336,12 +5398,145 @@ func (d *DataExportSettings) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DefenderCspmAwsOffering. +func (d DefenderCspmAwsOffering) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", d.Description) + objectMap["offeringType"] = OfferingTypeDefenderCspmAws + populate(objectMap, "vmScanners", d.VMScanners) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmAwsOffering. +func (d *DefenderCspmAwsOffering) 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) + case "vmScanners": + err = unpopulate(val, "VMScanners", &d.VMScanners) + 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]interface{}) + populate(objectMap, "configuration", d.Configuration) + populate(objectMap, "enabled", d.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmAwsOfferingVMScanners. +func (d *DefenderCspmAwsOfferingVMScanners) 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 DefenderCspmAwsOfferingVMScannersConfiguration. +func (d DefenderCspmAwsOfferingVMScannersConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "cloudRoleArn", d.CloudRoleArn) + populate(objectMap, "exclusionTags", d.ExclusionTags) + populate(objectMap, "scanningMode", d.ScanningMode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmAwsOfferingVMScannersConfiguration. +func (d *DefenderCspmAwsOfferingVMScannersConfiguration) 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 "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 DefenderCspmGcpOffering. +func (d DefenderCspmGcpOffering) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", d.Description) + objectMap["offeringType"] = OfferingTypeDefenderCspmGcp + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmGcpOffering. +func (d *DefenderCspmGcpOffering) 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 DefenderFoDatabasesAwsOffering. func (d DefenderFoDatabasesAwsOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "arcAutoProvisioning", d.ArcAutoProvisioning) populate(objectMap, "description", d.Description) objectMap["offeringType"] = OfferingTypeDefenderForDatabasesAws + populate(objectMap, "rds", d.Rds) return json.Marshal(objectMap) } @@ -5363,6 +5558,9 @@ func (d *DefenderFoDatabasesAwsOffering) UnmarshalJSON(data []byte) error { case "offeringType": err = unpopulate(val, "OfferingType", &d.OfferingType) delete(rawMsg, key) + case "rds": + err = unpopulate(val, "Rds", &d.Rds) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -5376,7 +5574,6 @@ func (d DefenderFoDatabasesAwsOfferingArcAutoProvisioning) MarshalJSON() ([]byte objectMap := make(map[string]interface{}) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) populate(objectMap, "enabled", d.Enabled) - populate(objectMap, "servicePrincipalSecretMetadata", d.ServicePrincipalSecretMetadata) return json.Marshal(objectMap) } @@ -5395,9 +5592,6 @@ func (d *DefenderFoDatabasesAwsOfferingArcAutoProvisioning) UnmarshalJSON(data [ case "enabled": err = unpopulate(val, "Enabled", &d.Enabled) delete(rawMsg, key) - case "servicePrincipalSecretMetadata": - err = unpopulate(val, "ServicePrincipalSecretMetadata", &d.ServicePrincipalSecretMetadata) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -5406,17 +5600,16 @@ func (d *DefenderFoDatabasesAwsOfferingArcAutoProvisioning) UnmarshalJSON(data [ return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderFoDatabasesAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata. -func (d DefenderFoDatabasesAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderFoDatabasesAwsOfferingRds. +func (d DefenderFoDatabasesAwsOfferingRds) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "expiryDate", d.ExpiryDate) - populate(objectMap, "parameterNameInStore", d.ParameterNameInStore) - populate(objectMap, "parameterStoreRegion", d.ParameterStoreRegion) + populate(objectMap, "cloudRoleArn", d.CloudRoleArn) + populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderFoDatabasesAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata. -func (d *DefenderFoDatabasesAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderFoDatabasesAwsOfferingRds. +func (d *DefenderFoDatabasesAwsOfferingRds) 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) @@ -5424,14 +5617,11 @@ func (d *DefenderFoDatabasesAwsOfferingArcAutoProvisioningServicePrincipalSecret for key, val := range rawMsg { var err error switch key { - case "expiryDate": - err = unpopulateTimeRFC3339(val, "ExpiryDate", &d.ExpiryDate) - delete(rawMsg, key) - case "parameterNameInStore": - err = unpopulate(val, "ParameterNameInStore", &d.ParameterNameInStore) + case "cloudRoleArn": + err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) delete(rawMsg, key) - case "parameterStoreRegion": - err = unpopulate(val, "ParameterStoreRegion", &d.ParameterStoreRegion) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) delete(rawMsg, key) } if err != nil { @@ -5829,7 +6019,6 @@ 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]interface{}) - populate(objectMap, "configuration", d.Configuration) populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } @@ -5843,9 +6032,6 @@ 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) @@ -5857,16 +6043,16 @@ func (d *DefenderForDatabasesGcpOfferingArcAutoProvisioning) UnmarshalJSON(data return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration. -func (d DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning. +func (d DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "agentOnboardingServiceAccountNumericId", d.AgentOnboardingServiceAccountNumericID) - populate(objectMap, "clientId", d.ClientID) + populate(objectMap, "serviceAccountEmailAddress", d.ServiceAccountEmailAddress) + populate(objectMap, "workloadIdentityProviderId", d.WorkloadIdentityProviderID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration. -func (d *DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning. +func (d *DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning) 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) @@ -5874,11 +6060,11 @@ func (d *DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration) Unmars for key, val := range rawMsg { var err error switch key { - case "agentOnboardingServiceAccountNumericId": - err = unpopulate(val, "AgentOnboardingServiceAccountNumericID", &d.AgentOnboardingServiceAccountNumericID) + case "serviceAccountEmailAddress": + err = unpopulate(val, "ServiceAccountEmailAddress", &d.ServiceAccountEmailAddress) delete(rawMsg, key) - case "clientId": - err = unpopulate(val, "ClientID", &d.ClientID) + case "workloadIdentityProviderId": + err = unpopulate(val, "WorkloadIdentityProviderID", &d.WorkloadIdentityProviderID) delete(rawMsg, key) } if err != nil { @@ -5888,16 +6074,16 @@ func (d *DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration) Unmars return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning. -func (d DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForDevOpsAzureDevOpsOffering. +func (d DefenderForDevOpsAzureDevOpsOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - populate(objectMap, "serviceAccountEmailAddress", d.ServiceAccountEmailAddress) - populate(objectMap, "workloadIdentityProviderId", d.WorkloadIdentityProviderID) + populate(objectMap, "description", d.Description) + objectMap["offeringType"] = OfferingTypeDefenderForDevOpsAzureDevOps return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning. -func (d *DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForDevOpsAzureDevOpsOffering. +func (d *DefenderForDevOpsAzureDevOpsOffering) 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) @@ -5905,11 +6091,42 @@ func (d *DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning) for key, val := range rawMsg { var err error switch key { - case "serviceAccountEmailAddress": - err = unpopulate(val, "ServiceAccountEmailAddress", &d.ServiceAccountEmailAddress) + case "description": + err = unpopulate(val, "Description", &d.Description) delete(rawMsg, key) - case "workloadIdentityProviderId": - err = unpopulate(val, "WorkloadIdentityProviderID", &d.WorkloadIdentityProviderID) + 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]interface{}) + 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) + } + 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 { @@ -5979,7 +6196,6 @@ func (d DefenderForServersAwsOfferingArcAutoProvisioning) MarshalJSON() ([]byte, objectMap := make(map[string]interface{}) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) populate(objectMap, "enabled", d.Enabled) - populate(objectMap, "servicePrincipalSecretMetadata", d.ServicePrincipalSecretMetadata) return json.Marshal(objectMap) } @@ -5998,44 +6214,6 @@ func (d *DefenderForServersAwsOfferingArcAutoProvisioning) UnmarshalJSON(data [] case "enabled": err = unpopulate(val, "Enabled", &d.Enabled) delete(rawMsg, key) - case "servicePrincipalSecretMetadata": - err = unpopulate(val, "ServicePrincipalSecretMetadata", &d.ServicePrincipalSecretMetadata) - 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 DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata. -func (d DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "expiryDate", d.ExpiryDate) - populate(objectMap, "parameterNameInStore", d.ParameterNameInStore) - populate(objectMap, "parameterStoreRegion", d.ParameterStoreRegion) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata. -func (d *DefenderForServersAwsOfferingArcAutoProvisioningServicePrincipalSecretMetadata) 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 "expiryDate": - err = unpopulate(val, "ExpiryDate", &d.ExpiryDate) - delete(rawMsg, key) - case "parameterNameInStore": - err = unpopulate(val, "ParameterNameInStore", &d.ParameterNameInStore) - delete(rawMsg, key) - case "parameterStoreRegion": - err = unpopulate(val, "ParameterStoreRegion", &d.ParameterStoreRegion) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -6164,7 +6342,7 @@ func (d *DefenderForServersAwsOfferingVMScanners) UnmarshalJSON(data []byte) err func (d DefenderForServersAwsOfferingVMScannersConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) - populate(objectMap, "exclusionTags", &d.ExclusionTags) + populate(objectMap, "exclusionTags", d.ExclusionTags) populate(objectMap, "scanningMode", d.ScanningMode) return json.Marshal(objectMap) } @@ -6307,7 +6485,6 @@ 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]interface{}) - populate(objectMap, "configuration", d.Configuration) populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } @@ -6321,9 +6498,6 @@ 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) @@ -6335,37 +6509,6 @@ 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]interface{}) - populate(objectMap, "agentOnboardingServiceAccountNumericId", d.AgentOnboardingServiceAccountNumericID) - populate(objectMap, "clientId", d.ClientID) - 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 "agentOnboardingServiceAccountNumericId": - err = unpopulate(val, "AgentOnboardingServiceAccountNumericID", &d.AgentOnboardingServiceAccountNumericID) - delete(rawMsg, key) - case "clientId": - err = unpopulate(val, "ClientID", &d.ClientID) - 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]interface{}) diff --git a/sdk/resourcemanager/security/armsecurity/polymorphic_helpers.go b/sdk/resourcemanager/security/armsecurity/polymorphic_helpers.go index 98ba8838666b..705cbc0ecb57 100644 --- a/sdk/resourcemanager/security/armsecurity/polymorphic_helpers.go +++ b/sdk/resourcemanager/security/armsecurity/polymorphic_helpers.go @@ -195,6 +195,10 @@ func unmarshalCloudOfferingClassification(rawMsg json.RawMessage) (CloudOffering b = &CspmMonitorGcpOffering{} case string(OfferingTypeCspmMonitorGithub): b = &CspmMonitorGithubOffering{} + case string(OfferingTypeDefenderCspmAws): + b = &DefenderCspmAwsOffering{} + case string(OfferingTypeDefenderCspmGcp): + b = &DefenderCspmGcpOffering{} case string(OfferingTypeDefenderForContainersAws): b = &DefenderForContainersAwsOffering{} case string(OfferingTypeDefenderForContainersGcp): @@ -203,6 +207,10 @@ func unmarshalCloudOfferingClassification(rawMsg json.RawMessage) (CloudOffering b = &DefenderFoDatabasesAwsOffering{} case string(OfferingTypeDefenderForDatabasesGcp): b = &DefenderForDatabasesGcpOffering{} + case string(OfferingTypeDefenderForDevOpsAzureDevOps): + b = &DefenderForDevOpsAzureDevOpsOffering{} + case string(OfferingTypeDefenderForDevOpsGithub): + b = &DefenderForDevOpsGithubOffering{} case string(OfferingTypeDefenderForServersAws): b = &DefenderForServersAwsOffering{} case string(OfferingTypeDefenderForServersGcp): @@ -245,7 +253,7 @@ func unmarshalEnvironmentDataClassification(rawMsg json.RawMessage) (Environment var b EnvironmentDataClassification switch m["environmentType"] { case string(EnvironmentTypeAwsAccount): - b = &AWSEnvironmentData{} + b = &AwsEnvironmentData{} case string(EnvironmentTypeAzureDevOpsScope): b = &AzureDevOpsScopeEnvironmentData{} case string(EnvironmentTypeGcpProject): 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 48a67c84d2dc..000000000000 --- a/sdk/resourcemanager/security/armsecurity/pricings_client_example_test.go +++ /dev/null @@ -1,80 +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. - -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/tree/main/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() - client, err := armsecurity.NewPricingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewPricingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "VirtualMachines", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewPricingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} 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 287f3054f602..000000000000 --- a/sdk/resourcemanager/security/armsecurity/regulatorycomplianceassessments_client_example_test.go +++ /dev/null @@ -1,60 +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. - -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/tree/main/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() - client, err := armsecurity.NewRegulatoryComplianceAssessmentsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("PCI-DSS-3.2", "1.1", &armsecurity.RegulatoryComplianceAssessmentsClientListOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewRegulatoryComplianceAssessmentsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} 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 4143eaa4df38..000000000000 --- a/sdk/resourcemanager/security/armsecurity/regulatorycompliancecontrols_client_example_test.go +++ /dev/null @@ -1,60 +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. - -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/tree/main/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() - client, err := armsecurity.NewRegulatoryComplianceControlsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("PCI-DSS-3.2", &armsecurity.RegulatoryComplianceControlsClientListOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewRegulatoryComplianceControlsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "PCI-DSS-3.2", "1.1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} 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 1836d96f28aa..000000000000 --- a/sdk/resourcemanager/security/armsecurity/regulatorycompliancestandards_client_example_test.go +++ /dev/null @@ -1,60 +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. - -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/tree/main/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() - client, err := armsecurity.NewRegulatoryComplianceStandardsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(&armsecurity.RegulatoryComplianceStandardsClientListOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewRegulatoryComplianceStandardsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "PCI-DSS-3.2", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/response_types.go b/sdk/resourcemanager/security/armsecurity/response_types.go index 67b8c82edc1b..963f079a26de 100644 --- a/sdk/resourcemanager/security/armsecurity/response_types.go +++ b/sdk/resourcemanager/security/armsecurity/response_types.go @@ -414,11 +414,6 @@ type ContactsClientListResponse struct { ContactList } -// ContactsClientUpdateResponse contains the response from method ContactsClient.Update. -type ContactsClientUpdateResponse struct { - Contact -} - // CustomAssessmentAutomationsClientCreateResponse contains the response from method CustomAssessmentAutomationsClient.Create. type CustomAssessmentAutomationsClientCreateResponse struct { CustomAssessmentAutomation 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 3e0d0f8a5be8..000000000000 --- a/sdk/resourcemanager/security/armsecurity/securescorecontroldefinitions_client_example_test.go +++ /dev/null @@ -1,65 +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. - -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/tree/main/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() - client, err := armsecurity.NewSecureScoreControlDefinitionsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewSecureScoreControlDefinitionsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} 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 dc9e31d12808..000000000000 --- a/sdk/resourcemanager/security/armsecurity/securescorecontrols_client_example_test.go +++ /dev/null @@ -1,90 +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. - -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/tree/main/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() - client, err := armsecurity.NewSecureScoreControlsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySecureScorePager("ascScore", &armsecurity.SecureScoreControlsClientListBySecureScoreOptions{Expand: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewSecureScoreControlsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySecureScorePager("ascScore", &armsecurity.SecureScoreControlsClientListBySecureScoreOptions{Expand: to.Ptr(armsecurity.ExpandControlsEnumDefinition)}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewSecureScoreControlsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(&armsecurity.SecureScoreControlsClientListOptions{Expand: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} 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 506ee95f68e9..000000000000 --- a/sdk/resourcemanager/security/armsecurity/securescores_client_example_test.go +++ /dev/null @@ -1,60 +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. - -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/tree/main/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() - client, err := armsecurity.NewSecureScoresClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewSecureScoresClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "ascScore", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} 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 7c6c55f75211..000000000000 --- a/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessment_client_example_test.go +++ /dev/null @@ -1,93 +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. - -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/tree/main/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() - client, err := armsecurity.NewServerVulnerabilityAssessmentClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByExtendedResource(ctx, "rg1", "Microsoft.Compute", "virtualMachines", "vm1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewServerVulnerabilityAssessmentClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "rg1", "Microsoft.Compute", "virtualMachines", "vm1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewServerVulnerabilityAssessmentClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/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() - client, err := armsecurity.NewServerVulnerabilityAssessmentClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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 eec48c963490..000000000000 --- a/sdk/resourcemanager/security/armsecurity/settings_client_example_test.go +++ /dev/null @@ -1,85 +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. - -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/tree/main/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() - client, err := armsecurity.NewSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, armsecurity.SettingNameMCAS, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} 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 25c35cd53566..000000000000 --- a/sdk/resourcemanager/security/armsecurity/softwareinventories_client_example_test.go +++ /dev/null @@ -1,84 +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. - -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/tree/main/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() - client, err := armsecurity.NewSoftwareInventoriesClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByExtendedResourcePager("EITAN-TESTS", "Microsoft.Compute", "virtualMachines", "Eitan-Test1", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewSoftwareInventoriesClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewSoftwareInventoriesClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} 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 f80710a69410..000000000000 --- a/sdk/resourcemanager/security/armsecurity/solutions_client_example_test.go +++ /dev/null @@ -1,60 +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. - -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/tree/main/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() - client, err := armsecurity.NewSolutionsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewSolutionsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myRg2", "centralus", "paloalto7", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} 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 6549edb6a3cc..000000000000 --- a/sdk/resourcemanager/security/armsecurity/solutionsreferencedata_client_example_test.go +++ /dev/null @@ -1,55 +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. - -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/tree/main/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() - client, err := armsecurity.NewSolutionsReferenceDataClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewSolutionsReferenceDataClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByHomeRegion(ctx, "westcentralus", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} 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 2a22b9400044..000000000000 --- a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentbaselinerules_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. - -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/tree/main/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() - client, err := armsecurity.NewSQLVulnerabilityAssessmentBaselineRulesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewSQLVulnerabilityAssessmentBaselineRulesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewSQLVulnerabilityAssessmentBaselineRulesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewSQLVulnerabilityAssessmentBaselineRulesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/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() - client, err := armsecurity.NewSQLVulnerabilityAssessmentBaselineRulesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewSQLVulnerabilityAssessmentBaselineRulesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewSQLVulnerabilityAssessmentBaselineRulesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} 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 4dd6cf8aa996..000000000000 --- a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscanresults_client_example_test.go +++ /dev/null @@ -1,93 +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. - -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/tree/main/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() - client, err := armsecurity.NewSQLVulnerabilityAssessmentScanResultsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewSQLVulnerabilityAssessmentScanResultsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewSQLVulnerabilityAssessmentScanResultsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewSQLVulnerabilityAssessmentScanResultsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} 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 abfbbb717cf4..000000000000 --- a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client_example_test.go +++ /dev/null @@ -1,74 +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. - -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/tree/main/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() - client, err := armsecurity.NewSQLVulnerabilityAssessmentScansClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewSQLVulnerabilityAssessmentScansClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewSQLVulnerabilityAssessmentScansClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} 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 eed818e3d0d0..000000000000 --- a/sdk/resourcemanager/security/armsecurity/subassessments_client_example_test.go +++ /dev/null @@ -1,84 +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. - -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/tree/main/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() - client, err := armsecurity.NewSubAssessmentsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListAllPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewSubAssessmentsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "82e20e14-edc5-4373-bfc4-f13121257c37", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewSubAssessmentsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} 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 a064c657c0dd..000000000000 --- a/sdk/resourcemanager/security/armsecurity/subscriptiongovernancerulesexecutestatus_client_example_test.go +++ /dev/null @@ -1,40 +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. - -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/tree/main/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() - client, err := armsecurity.NewSubscriptionGovernanceRulesExecuteStatusClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.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) - } - // TODO: use response item - _ = res -} 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 ac7b1ad7073a..000000000000 --- a/sdk/resourcemanager/security/armsecurity/tasks_client_example_test.go +++ /dev/null @@ -1,161 +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. - -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/tree/main/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() - client, err := armsecurity.NewTasksClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(&armsecurity.TasksClientListOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewTasksClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByHomeRegionPager("westeurope", &armsecurity.TasksClientListByHomeRegionOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewTasksClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetSubscriptionLevelTask(ctx, "westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewTasksClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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/tree/main/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() - client, err := armsecurity.NewTasksClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("myRg", "westeurope", &armsecurity.TasksClientListByResourceGroupOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewTasksClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetResourceGroupLevelTask(ctx, "myRg", "westeurope", "d55b4dc0-779c-c66c-33e5-d7bce24c4222", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewTasksClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.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 9403d4bcdcfa..000000000000 --- a/sdk/resourcemanager/security/armsecurity/topology_client_example_test.go +++ /dev/null @@ -1,84 +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. - -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/tree/main/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() - client, err := armsecurity.NewTopologyClient("3eeab341-f466-499c-a8be-85427e154bad", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewTopologyClient("3eeab341-f466-499c-a8be-85427e154bad", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByHomeRegionPager("centralus", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewTopologyClient("3eeab341-f466-499c-a8be-85427e154bad", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myservers", "centralus", "vnets", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} 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 8801d9cb6368..000000000000 --- a/sdk/resourcemanager/security/armsecurity/workspacesettings_client_example_test.go +++ /dev/null @@ -1,131 +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. - -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/tree/main/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() - client, err := armsecurity.NewWorkspaceSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewWorkspaceSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewWorkspaceSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewWorkspaceSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/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() - client, err := armsecurity.NewWorkspaceSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -}