diff --git a/sdk/resourcemanager/security/armsecurity/CHANGELOG.md b/sdk/resourcemanager/security/armsecurity/CHANGELOG.md index 14793702fc7a..a02e0f994a61 100644 --- a/sdk/resourcemanager/security/armsecurity/CHANGELOG.md +++ b/sdk/resourcemanager/security/armsecurity/CHANGELOG.md @@ -1,5 +1,154 @@ # Release History +## 0.15.0 (2025-05-05) +### Breaking Changes + +- Function `*DefenderForStorageClient.Create` parameter(s) have been changed from `(context.Context, string, SettingName, DefenderForStorageSetting, *DefenderForStorageClientCreateOptions)` to `(context.Context, string, SettingNameAutoGenerated, DefenderForStorageSetting, *DefenderForStorageClientCreateOptions)` +- Function `*DefenderForStorageClient.Get` parameter(s) have been changed from `(context.Context, string, SettingName, *DefenderForStorageClientGetOptions)` to `(context.Context, string, SettingNameAutoGenerated, *DefenderForStorageClientGetOptions)` +- Function `*SettingsClient.Get` parameter(s) have been changed from `(context.Context, SettingNameAutoGenerated, *SettingsClientGetOptions)` to `(context.Context, SettingName, *SettingsClientGetOptions)` +- Function `*SettingsClient.Update` parameter(s) have been changed from `(context.Context, SettingNameAutoGenerated, SettingClassification, *SettingsClientUpdateOptions)` to `(context.Context, SettingName, SettingClassification, *SettingsClientUpdateOptions)` +- Type of `Extension.OperationStatus` has been changed from `*OperationStatusAutoGenerated` to `*OperationStatus` +- Type of `MalwareScanningProperties.OperationStatus` has been changed from `*OperationStatus` to `*OperationStatusAutoGenerated` +- Type of `Operation.Origin` has been changed from `*string` to `*Origin` +- Type of `OperationStatus.Code` has been changed from `*string` to `*Code` +- Type of `OperationStatusAutoGenerated.Code` has been changed from `*Code` to `*string` +- Type of `OperationStatusResult.Error` has been changed from `*ErrorDetailAutoGenerated` to `*ErrorDetailAutoGenerated2` +- Type of `SensitiveDataDiscoveryProperties.OperationStatus` has been changed from `*OperationStatus` to `*OperationStatusAutoGenerated` +- `SettingNameCurrent` from enum `SettingName` has been removed +- `SettingNameAutoGeneratedMCAS`, `SettingNameAutoGeneratedSentinel`, `SettingNameAutoGeneratedWDATP`, `SettingNameAutoGeneratedWDATPEXCLUDELINUXPUBLICPREVIEW`, `SettingNameAutoGeneratedWDATPUNIFIEDSOLUTION` from enum `SettingNameAutoGenerated` has been removed +- Enum `AdaptiveApplicationControlIssue` has been removed +- Enum `ConfigurationStatus` has been removed +- Enum `Direction` has been removed +- Enum `EnforcementMode` has been removed +- Enum `EnforcementSupport` has been removed +- Enum `FileType` has been removed +- Enum `RecommendationAction` has been removed +- Enum `RecommendationStatus` has been removed +- Enum `SourceSystem` has been removed +- Enum `TransportProtocol` has been removed +- Function `NewAdaptiveApplicationControlsClient` has been removed +- Function `*AdaptiveApplicationControlsClient.Delete` has been removed +- Function `*AdaptiveApplicationControlsClient.Get` has been removed +- Function `*AdaptiveApplicationControlsClient.List` has been removed +- Function `*AdaptiveApplicationControlsClient.Put` has been removed +- Function `NewAdaptiveNetworkHardeningsClient` has been removed +- Function `*AdaptiveNetworkHardeningsClient.BeginEnforce` has been removed +- Function `*AdaptiveNetworkHardeningsClient.Get` has been removed +- Function `*AdaptiveNetworkHardeningsClient.NewListByExtendedResourcePager` has been removed +- Function `*ClientFactory.NewAdaptiveApplicationControlsClient` has been removed +- Function `*ClientFactory.NewAdaptiveNetworkHardeningsClient` has been removed +- Struct `AdaptiveApplicationControlGroup` has been removed +- Struct `AdaptiveApplicationControlGroupData` has been removed +- Struct `AdaptiveApplicationControlGroups` has been removed +- Struct `AdaptiveApplicationControlIssueSummary` has been removed +- Struct `AdaptiveNetworkHardening` has been removed +- Struct `AdaptiveNetworkHardeningEnforceRequest` has been removed +- Struct `AdaptiveNetworkHardeningProperties` has been removed +- Struct `AdaptiveNetworkHardeningsList` has been removed +- Struct `EffectiveNetworkSecurityGroups` has been removed +- Struct `OperationList` has been removed +- Struct `PathRecommendation` has been removed +- Struct `ProtectionMode` has been removed +- Struct `PublisherInfo` has been removed +- Struct `Rule` has been removed +- Struct `UserRecommendation` has been removed +- Struct `VMRecommendation` has been removed +- Field `OperationList` of struct `OperationsClientListResponse` has been removed +- Field `SystemData` of struct `ResourceAutoGenerated2` has been removed + +### Features Added + +- New value `ActionTypeInternal` added to enum type `ActionType` +- New value `CloudNameDockerHub`, `CloudNameJFrog` added to enum type `CloudName` +- New value `EnvironmentTypeDockerHubOrganization`, `EnvironmentTypeJFrogArtifactory` added to enum type `EnvironmentType` +- New value `OfferingTypeCspmMonitorDockerHub`, `OfferingTypeCspmMonitorJFrog`, `OfferingTypeDefenderCspmDockerHub`, `OfferingTypeDefenderCspmJFrog`, `OfferingTypeDefenderForContainersDockerHub`, `OfferingTypeDefenderForContainersJFrog` added to enum type `OfferingType` +- New value `SettingNameMCAS`, `SettingNameSentinel`, `SettingNameWDATP`, `SettingNameWDATPEXCLUDELINUXPUBLICPREVIEW`, `SettingNameWDATPUNIFIEDSOLUTION` added to enum type `SettingName` +- New value `SettingNameAutoGeneratedCurrent` added to enum type `SettingNameAutoGenerated` +- New enum type `AgentlessEnablement` with values `AgentlessEnablementDisabled`, `AgentlessEnablementEnabled`, `AgentlessEnablementNotApplicable` +- New enum type `AttestationComplianceState` with values `AttestationComplianceStateCompliant`, `AttestationComplianceStateNonCompliant`, `AttestationComplianceStateUnknown` +- New enum type `Effect` with values `EffectAttest`, `EffectAudit`, `EffectExempt` +- New enum type `ExemptionCategory` with values `ExemptionCategoryMitigated`, `ExemptionCategoryWaiver` +- New enum type `InventoryKind` with values `InventoryKindAzureDevOpsOrganization`, `InventoryKindAzureDevOpsProject`, `InventoryKindAzureDevOpsRepository`, `InventoryKindGitHubOwner`, `InventoryKindGitHubRepository` +- New enum type `InventoryListKind` with values `InventoryListKindExclusion`, `InventoryListKindInclusion` +- New enum type `Origin` with values `OriginSystem`, `OriginUser`, `OriginUserSystem` +- New enum type `RecommendationSupportedClouds` with values `RecommendationSupportedCloudsAWS`, `RecommendationSupportedCloudsAzure`, `RecommendationSupportedCloudsGCP` +- New enum type `SecurityIssue` with values `SecurityIssueAnonymousAccess`, `SecurityIssueBestPractices`, `SecurityIssueExcessivePermissions`, `SecurityIssueNetworkExposure`, `SecurityIssueTrafficEncryption`, `SecurityIssueVulnerability` +- New enum type `StandardSupportedCloud` with values `StandardSupportedCloudAWS`, `StandardSupportedCloudAzure`, `StandardSupportedCloudGCP` +- New enum type `StandardType` with values `StandardTypeCompliance`, `StandardTypeCustom`, `StandardTypeDefault` +- New function `*AccessTokenAuthentication.GetAuthentication() *Authentication` +- New function `*Authentication.GetAuthentication() *Authentication` +- New function `*ClientFactory.NewCustomRecommendationsClient() *CustomRecommendationsClient` +- New function `*ClientFactory.NewStandardAssignmentsClient() *StandardAssignmentsClient` +- New function `*ClientFactory.NewStandardsClient() *StandardsClient` +- New function `*CspmMonitorDockerHubOffering.GetCloudOffering() *CloudOffering` +- New function `*CspmMonitorJFrogOffering.GetCloudOffering() *CloudOffering` +- New function `NewCustomRecommendationsClient(azcore.TokenCredential, *arm.ClientOptions) (*CustomRecommendationsClient, error)` +- New function `*CustomRecommendationsClient.CreateOrUpdate(context.Context, string, string, CustomRecommendation, *CustomRecommendationsClientCreateOrUpdateOptions) (CustomRecommendationsClientCreateOrUpdateResponse, error)` +- New function `*CustomRecommendationsClient.Delete(context.Context, string, string, *CustomRecommendationsClientDeleteOptions) (CustomRecommendationsClientDeleteResponse, error)` +- New function `*CustomRecommendationsClient.Get(context.Context, string, string, *CustomRecommendationsClientGetOptions) (CustomRecommendationsClientGetResponse, error)` +- New function `*CustomRecommendationsClient.NewListPager(string, *CustomRecommendationsClientListOptions) *runtime.Pager[CustomRecommendationsClientListResponse]` +- New function `*DefenderCspmDockerHubOffering.GetCloudOffering() *CloudOffering` +- New function `*DefenderCspmJFrogOffering.GetCloudOffering() *CloudOffering` +- New function `*DefenderForContainersDockerHubOffering.GetCloudOffering() *CloudOffering` +- New function `*DefenderForContainersJFrogOffering.GetCloudOffering() *CloudOffering` +- New function `*DefenderForStorageClient.CancelMalwareScan(context.Context, string, SettingNameAutoGenerated, string, *DefenderForStorageClientCancelMalwareScanOptions) (DefenderForStorageClientCancelMalwareScanResponse, error)` +- New function `*DefenderForStorageClient.GetMalwareScan(context.Context, string, SettingNameAutoGenerated, string, *DefenderForStorageClientGetMalwareScanOptions) (DefenderForStorageClientGetMalwareScanResponse, error)` +- New function `*DefenderForStorageClient.StartMalwareScan(context.Context, string, SettingNameAutoGenerated, *DefenderForStorageClientStartMalwareScanOptions) (DefenderForStorageClientStartMalwareScanResponse, error)` +- New function `*DockerHubEnvironmentData.GetEnvironmentData() *EnvironmentData` +- New function `*JFrogEnvironmentData.GetEnvironmentData() *EnvironmentData` +- New function `NewStandardAssignmentsClient(azcore.TokenCredential, *arm.ClientOptions) (*StandardAssignmentsClient, error)` +- New function `*StandardAssignmentsClient.Create(context.Context, string, string, StandardAssignment, *StandardAssignmentsClientCreateOptions) (StandardAssignmentsClientCreateResponse, error)` +- New function `*StandardAssignmentsClient.Delete(context.Context, string, string, *StandardAssignmentsClientDeleteOptions) (StandardAssignmentsClientDeleteResponse, error)` +- New function `*StandardAssignmentsClient.Get(context.Context, string, string, *StandardAssignmentsClientGetOptions) (StandardAssignmentsClientGetResponse, error)` +- New function `*StandardAssignmentsClient.NewListPager(string, *StandardAssignmentsClientListOptions) *runtime.Pager[StandardAssignmentsClientListResponse]` +- New function `NewStandardsClient(azcore.TokenCredential, *arm.ClientOptions) (*StandardsClient, error)` +- New function `*StandardsClient.CreateOrUpdate(context.Context, string, string, Standard, *StandardsClientCreateOrUpdateOptions) (StandardsClientCreateOrUpdateResponse, error)` +- New function `*StandardsClient.Delete(context.Context, string, string, *StandardsClientDeleteOptions) (StandardsClientDeleteResponse, error)` +- New function `*StandardsClient.Get(context.Context, string, string, *StandardsClientGetOptions) (StandardsClientGetResponse, error)` +- New function `*StandardsClient.NewListPager(string, *StandardsClientListOptions) *runtime.Pager[StandardsClientListResponse]` +- New struct `AccessTokenAuthentication` +- New struct `AgentlessConfiguration` +- New struct `AssignedAssessmentItem` +- New struct `AssignedStandardItem` +- New struct `AttestationEvidence` +- New struct `BlobsScanSummary` +- New struct `CspmMonitorDockerHubOffering` +- New struct `CspmMonitorJFrogOffering` +- New struct `CustomRecommendation` +- New struct `CustomRecommendationProperties` +- New struct `CustomRecommendationsList` +- New struct `DefenderCspmDockerHubOffering` +- New struct `DefenderCspmJFrogOffering` +- New struct `DefenderCspmJFrogOfferingMdcContainersImageAssessment` +- New struct `DefenderForContainersDockerHubOffering` +- New struct `DefenderForContainersJFrogOffering` +- New struct `DevOpsCapability` +- New struct `DockerHubEnvironmentData` +- New struct `ErrorDetailAutoGenerated2` +- New struct `ErrorResponseAutoGenerated2` +- New struct `InventoryList` +- New struct `JFrogEnvironmentData` +- New struct `MalwareScan` +- New struct `MalwareScanProperties` +- New struct `OperationListResult` +- New struct `PartialAssessmentProperties` +- New struct `ScanSummary` +- New struct `Standard` +- New struct `StandardAssignment` +- New struct `StandardAssignmentMetadata` +- New struct `StandardAssignmentProperties` +- New struct `StandardAssignmentPropertiesAttestationData` +- New struct `StandardAssignmentPropertiesExemptionData` +- New struct `StandardAssignmentsList` +- New struct `StandardList` +- New struct `StandardMetadata` +- New struct `StandardProperties` +- New field `AgentlessConfiguration`, `Capabilities` in struct `DevOpsConfigurationProperties` +- New field `ActionType`, `IsDataAction` in struct `Operation` +- New anonymous field `OperationListResult` in struct `OperationsClientListResponse` +- New field `SystemData` in struct `ResourceAutoGenerated` + + ## 0.14.0 (2024-04-04) ### Breaking Changes diff --git a/sdk/resourcemanager/security/armsecurity/accountconnectors_client.go b/sdk/resourcemanager/security/armsecurity/accountconnectors_client.go index 9b3053548fe5..3f992106aa9c 100644 --- a/sdk/resourcemanager/security/armsecurity/accountconnectors_client.go +++ b/sdk/resourcemanager/security/armsecurity/accountconnectors_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -76,7 +73,7 @@ func (client *AccountConnectorsClient) CreateOrUpdate(ctx context.Context, conne } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AccountConnectorsClient) createOrUpdateCreateRequest(ctx context.Context, connectorName string, connectorSetting ConnectorSetting, options *AccountConnectorsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *AccountConnectorsClient) createOrUpdateCreateRequest(ctx context.Context, connectorName string, connectorSetting ConnectorSetting, _ *AccountConnectorsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -138,7 +135,7 @@ func (client *AccountConnectorsClient) Delete(ctx context.Context, connectorName } // deleteCreateRequest creates the Delete request. -func (client *AccountConnectorsClient) deleteCreateRequest(ctx context.Context, connectorName string, options *AccountConnectorsClientDeleteOptions) (*policy.Request, error) { +func (client *AccountConnectorsClient) deleteCreateRequest(ctx context.Context, connectorName string, _ *AccountConnectorsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -188,7 +185,7 @@ func (client *AccountConnectorsClient) Get(ctx context.Context, connectorName st } // getCreateRequest creates the Get request. -func (client *AccountConnectorsClient) getCreateRequest(ctx context.Context, connectorName string, options *AccountConnectorsClientGetOptions) (*policy.Request, error) { +func (client *AccountConnectorsClient) getCreateRequest(ctx context.Context, connectorName string, _ *AccountConnectorsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors/{connectorName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -247,7 +244,7 @@ func (client *AccountConnectorsClient) NewListPager(options *AccountConnectorsCl } // listCreateRequest creates the List request. -func (client *AccountConnectorsClient) listCreateRequest(ctx context.Context, options *AccountConnectorsClientListOptions) (*policy.Request, error) { +func (client *AccountConnectorsClient) listCreateRequest(ctx context.Context, _ *AccountConnectorsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/connectors" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 aeb9a45efc72..000000000000 --- a/sdk/resourcemanager/security/armsecurity/accountconnectors_client_example_test.go +++ /dev/null @@ -1,421 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/GetListConnectorSubscription_example.json -func ExampleAccountConnectorsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAccountConnectorsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ConnectorSettingList = armsecurity.ConnectorSettingList{ - // Value: []*armsecurity.ConnectorSetting{ - // { - // Name: to.Ptr("aws_dev1"), - // Type: to.Ptr("Microsoft.Security/connectors"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/connectors/aws_dev1"), - // Properties: &armsecurity.ConnectorSettingProperties{ - // AuthenticationDetails: &armsecurity.AwsCredsAuthenticationDetailsProperties{ - // AuthenticationProvisioningState: to.Ptr(armsecurity.AuthenticationProvisioningStateValid), - // AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeAwsCreds), - // GrantedPermissions: []*armsecurity.PermissionProperty{ - // to.Ptr(armsecurity.PermissionPropertyAWSAWSSecurityHubReadOnlyAccess), - // to.Ptr(armsecurity.PermissionPropertyAWSSecurityAudit), - // to.Ptr(armsecurity.PermissionPropertyAWSAmazonSSMAutomationRole)}, - // AccountID: to.Ptr("922315681122"), - // AwsAccessKeyID: to.Ptr(""), - // AwsSecretAccessKey: to.Ptr(""), - // }, - // HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - // AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - // HybridComputeProvisioningState: to.Ptr(armsecurity.HybridComputeProvisioningStateValid), - // ProxyServer: &armsecurity.ProxyServerProperties{ - // IP: to.Ptr("287.221.107.152"), - // Port: to.Ptr("34"), - // }, - // Region: to.Ptr("West US 2"), - // ResourceGroupName: to.Ptr("AwsConnectorRG"), - // ServicePrincipal: &armsecurity.ServicePrincipalProperties{ - // ApplicationID: to.Ptr("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1"), - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("aws_dev2"), - // Type: to.Ptr("Microsoft.Security/connectors"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/connectors/aws_dev2"), - // Properties: &armsecurity.ConnectorSettingProperties{ - // AuthenticationDetails: &armsecurity.AwAssumeRoleAuthenticationDetailsProperties{ - // AuthenticationProvisioningState: to.Ptr(armsecurity.AuthenticationProvisioningStateValid), - // AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeAwsAssumeRole), - // GrantedPermissions: []*armsecurity.PermissionProperty{ - // to.Ptr(armsecurity.PermissionPropertyAWSAWSSecurityHubReadOnlyAccess), - // to.Ptr(armsecurity.PermissionPropertyAWSSecurityAudit), - // to.Ptr(armsecurity.PermissionPropertyAWSAmazonSSMAutomationRole)}, - // AccountID: to.Ptr("81231569658"), - // AwsAssumeRoleArn: to.Ptr("arn:aws:iam::81231569658:role/AscConnector"), - // AwsExternalID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }, - // HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - // AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - // HybridComputeProvisioningState: to.Ptr(armsecurity.HybridComputeProvisioningStateValid), - // ProxyServer: &armsecurity.ProxyServerProperties{ - // IP: to.Ptr("167.210.187.160"), - // Port: to.Ptr("34"), - // }, - // Region: to.Ptr("West US 2"), - // ResourceGroupName: to.Ptr("AwsConnectorRG"), - // ServicePrincipal: &armsecurity.ServicePrincipalProperties{ - // ApplicationID: to.Ptr("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1"), - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("gcp_dev"), - // Type: to.Ptr("Microsoft.Security/connectors"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/connectors/gcp_dev"), - // Properties: &armsecurity.ConnectorSettingProperties{ - // AuthenticationDetails: &armsecurity.GcpCredentialsDetailsProperties{ - // AuthenticationProvisioningState: to.Ptr(armsecurity.AuthenticationProvisioningStateValid), - // AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeGcpCredentials), - // GrantedPermissions: []*armsecurity.PermissionProperty{ - // to.Ptr(armsecurity.PermissionPropertyGCPSecurityCenterAdminViewer)}, - // Type: to.Ptr(""), - // AuthProviderX509CertURL: to.Ptr(""), - // AuthURI: to.Ptr(""), - // ClientEmail: to.Ptr(""), - // ClientID: to.Ptr(""), - // ClientX509CertURL: to.Ptr(""), - // OrganizationID: to.Ptr("AscDemoOrg"), - // PrivateKey: to.Ptr(""), - // PrivateKeyID: to.Ptr(""), - // ProjectID: to.Ptr(""), - // TokenURI: to.Ptr(""), - // }, - // HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - // AutoProvision: to.Ptr(armsecurity.AutoProvisionOff), - // HybridComputeProvisioningState: to.Ptr(armsecurity.HybridComputeProvisioningStateInvalid), - // Region: to.Ptr(""), - // ResourceGroupName: to.Ptr(""), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/GetConnectorSubscription_example.json -func ExampleAccountConnectorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccountConnectorsClient().Get(ctx, "aws_dev1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectorSetting = armsecurity.ConnectorSetting{ - // Name: to.Ptr("aws_dev1"), - // Type: to.Ptr("Microsoft.Security/connectors"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/connectors/aws_dev1"), - // Properties: &armsecurity.ConnectorSettingProperties{ - // AuthenticationDetails: &armsecurity.AwsCredsAuthenticationDetailsProperties{ - // AuthenticationProvisioningState: to.Ptr(armsecurity.AuthenticationProvisioningStateValid), - // AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeAwsCreds), - // GrantedPermissions: []*armsecurity.PermissionProperty{ - // to.Ptr(armsecurity.PermissionPropertyAWSAWSSecurityHubReadOnlyAccess), - // to.Ptr(armsecurity.PermissionPropertyAWSSecurityAudit), - // to.Ptr(armsecurity.PermissionPropertyAWSAmazonSSMAutomationRole)}, - // AccountID: to.Ptr("922315681122"), - // AwsAccessKeyID: to.Ptr(""), - // AwsSecretAccessKey: to.Ptr(""), - // }, - // HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - // AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - // HybridComputeProvisioningState: to.Ptr(armsecurity.HybridComputeProvisioningStateValid), - // ProxyServer: &armsecurity.ProxyServerProperties{ - // IP: to.Ptr("287.221.107.152"), - // Port: to.Ptr("34"), - // }, - // Region: to.Ptr("West US 2"), - // ResourceGroupName: to.Ptr("AwsConnectorRG"), - // ServicePrincipal: &armsecurity.ServicePrincipalProperties{ - // ApplicationID: to.Ptr("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/CreateUpdateAwsAssumeRoleConnectorSubscription_example.json -func ExampleAccountConnectorsClient_CreateOrUpdate_awsAssumeRoleCreateACloudAccountConnectorForASubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccountConnectorsClient().CreateOrUpdate(ctx, "aws_dev2", armsecurity.ConnectorSetting{ - Properties: &armsecurity.ConnectorSettingProperties{ - AuthenticationDetails: &armsecurity.AwAssumeRoleAuthenticationDetailsProperties{ - AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeAwsAssumeRole), - AwsAssumeRoleArn: to.Ptr("arn:aws:iam::81231569658:role/AscConnector"), - AwsExternalID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - }, - HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - ProxyServer: &armsecurity.ProxyServerProperties{ - IP: to.Ptr("167.220.197.140"), - Port: to.Ptr("34"), - }, - Region: to.Ptr("West US 2"), - ResourceGroupName: to.Ptr("AwsConnectorRG"), - ServicePrincipal: &armsecurity.ServicePrincipalProperties{ - ApplicationID: to.Ptr("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1"), - Secret: to.Ptr(""), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectorSetting = armsecurity.ConnectorSetting{ - // Name: to.Ptr("aws_dev2"), - // Type: to.Ptr("Microsoft.Security/connectors"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/connectors/aws_dev2"), - // Properties: &armsecurity.ConnectorSettingProperties{ - // AuthenticationDetails: &armsecurity.AwAssumeRoleAuthenticationDetailsProperties{ - // AuthenticationProvisioningState: to.Ptr(armsecurity.AuthenticationProvisioningStateValid), - // AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeAwsAssumeRole), - // GrantedPermissions: []*armsecurity.PermissionProperty{ - // to.Ptr(armsecurity.PermissionPropertyAWSAWSSecurityHubReadOnlyAccess), - // to.Ptr(armsecurity.PermissionPropertyAWSSecurityAudit), - // to.Ptr(armsecurity.PermissionPropertyAWSAmazonSSMAutomationRole)}, - // AccountID: to.Ptr("81231569658"), - // AwsAssumeRoleArn: to.Ptr("arn:aws:iam::81231569658:role/AscConnector"), - // AwsExternalID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }, - // HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - // AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - // HybridComputeProvisioningState: to.Ptr(armsecurity.HybridComputeProvisioningStateValid), - // ProxyServer: &armsecurity.ProxyServerProperties{ - // IP: to.Ptr("167.220.197.140"), - // Port: to.Ptr("34"), - // }, - // Region: to.Ptr("West US 2"), - // ResourceGroupName: to.Ptr("AwsConnectorRG"), - // ServicePrincipal: &armsecurity.ServicePrincipalProperties{ - // ApplicationID: to.Ptr("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/CreateUpdateAwsCredConnectorSubscription_example.json -func ExampleAccountConnectorsClient_CreateOrUpdate_awsCredCreateACloudAccountConnectorForASubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccountConnectorsClient().CreateOrUpdate(ctx, "aws_dev1", armsecurity.ConnectorSetting{ - Properties: &armsecurity.ConnectorSettingProperties{ - AuthenticationDetails: &armsecurity.AwsCredsAuthenticationDetailsProperties{ - AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeAwsCreds), - AwsAccessKeyID: to.Ptr(""), - AwsSecretAccessKey: to.Ptr(""), - }, - HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - ProxyServer: &armsecurity.ProxyServerProperties{ - IP: to.Ptr("167.220.197.140"), - Port: to.Ptr("34"), - }, - Region: to.Ptr("West US 2"), - ResourceGroupName: to.Ptr("AwsConnectorRG"), - ServicePrincipal: &armsecurity.ServicePrincipalProperties{ - ApplicationID: to.Ptr("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1"), - Secret: to.Ptr(""), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectorSetting = armsecurity.ConnectorSetting{ - // Name: to.Ptr("aws_dev1"), - // Type: to.Ptr("Microsoft.Security/connectors"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/connectors/aws_dev1"), - // Properties: &armsecurity.ConnectorSettingProperties{ - // AuthenticationDetails: &armsecurity.AwsCredsAuthenticationDetailsProperties{ - // AuthenticationProvisioningState: to.Ptr(armsecurity.AuthenticationProvisioningStateValid), - // AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeAwsCreds), - // GrantedPermissions: []*armsecurity.PermissionProperty{ - // to.Ptr(armsecurity.PermissionPropertyAWSAWSSecurityHubReadOnlyAccess), - // to.Ptr(armsecurity.PermissionPropertyAWSSecurityAudit), - // to.Ptr(armsecurity.PermissionPropertyAWSAmazonSSMAutomationRole)}, - // AccountID: to.Ptr("922315681122"), - // AwsAccessKeyID: to.Ptr(""), - // AwsSecretAccessKey: to.Ptr(""), - // }, - // HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - // AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - // HybridComputeProvisioningState: to.Ptr(armsecurity.HybridComputeProvisioningStateValid), - // ProxyServer: &armsecurity.ProxyServerProperties{ - // IP: to.Ptr("287.221.107.152"), - // Port: to.Ptr("34"), - // }, - // Region: to.Ptr("West US 2"), - // ResourceGroupName: to.Ptr("AwsConnectorRG"), - // ServicePrincipal: &armsecurity.ServicePrincipalProperties{ - // ApplicationID: to.Ptr("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/CreateUpdateGcpCredentialsConnectorSubscription_example.json -func ExampleAccountConnectorsClient_CreateOrUpdate_gcpCredentialsCreateACloudAccountConnectorForASubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccountConnectorsClient().CreateOrUpdate(ctx, "gcp_dev", armsecurity.ConnectorSetting{ - Properties: &armsecurity.ConnectorSettingProperties{ - AuthenticationDetails: &armsecurity.GcpCredentialsDetailsProperties{ - AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeGcpCredentials), - Type: to.Ptr("service_account"), - AuthProviderX509CertURL: to.Ptr("https://www.googleapis.com/oauth2/v1/certs"), - AuthURI: to.Ptr("https://accounts.google.com/o/oauth2/auth"), - ClientEmail: to.Ptr("asc-135@asc-project-1234.iam.gserviceaccount.com"), - ClientID: to.Ptr("105889053725632919854"), - ClientX509CertURL: to.Ptr("https://www.googleapis.com/robot/v1/metadata/x509/asc-135%40asc-project-1234.iam.gserviceaccount.com"), - OrganizationID: to.Ptr("AscDemoOrg"), - PrivateKey: to.Ptr("******"), - PrivateKeyID: to.Ptr("6efg587hra2568as34d22326b044cc20dc2af"), - ProjectID: to.Ptr("asc-project-1234"), - TokenURI: to.Ptr("https://oauth2.googleapis.com/token"), - }, - HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - AutoProvision: to.Ptr(armsecurity.AutoProvisionOff), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectorSetting = armsecurity.ConnectorSetting{ - // Name: to.Ptr("gcp_dev"), - // Type: to.Ptr("Microsoft.Security/connectors"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/connectors/gcp_dev"), - // Properties: &armsecurity.ConnectorSettingProperties{ - // AuthenticationDetails: &armsecurity.GcpCredentialsDetailsProperties{ - // AuthenticationProvisioningState: to.Ptr(armsecurity.AuthenticationProvisioningStateValid), - // AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeGcpCredentials), - // GrantedPermissions: []*armsecurity.PermissionProperty{ - // to.Ptr(armsecurity.PermissionPropertyGCPSecurityCenterAdminViewer)}, - // Type: to.Ptr(""), - // AuthProviderX509CertURL: to.Ptr(""), - // AuthURI: to.Ptr(""), - // ClientEmail: to.Ptr(""), - // ClientID: to.Ptr(""), - // ClientX509CertURL: to.Ptr(""), - // OrganizationID: to.Ptr("AscDemoOrg"), - // PrivateKey: to.Ptr(""), - // PrivateKeyID: to.Ptr(""), - // ProjectID: to.Ptr(""), - // TokenURI: to.Ptr(""), - // }, - // HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - // AutoProvision: to.Ptr(armsecurity.AutoProvisionOff), - // HybridComputeProvisioningState: to.Ptr(armsecurity.HybridComputeProvisioningStateInvalid), - // Region: to.Ptr(""), - // ResourceGroupName: to.Ptr(""), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/DeleteConnectorSubscription_example.json -func ExampleAccountConnectorsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAccountConnectorsClient().Delete(ctx, "aws_dev1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/adaptiveapplicationcontrols_client.go b/sdk/resourcemanager/security/armsecurity/adaptiveapplicationcontrols_client.go deleted file mode 100644 index 196d6d28c6d5..000000000000 --- a/sdk/resourcemanager/security/armsecurity/adaptiveapplicationcontrols_client.go +++ /dev/null @@ -1,294 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strconv" - "strings" -) - -// AdaptiveApplicationControlsClient contains the methods for the AdaptiveApplicationControls group. -// Don't use this type directly, use NewAdaptiveApplicationControlsClient() instead. -type AdaptiveApplicationControlsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewAdaptiveApplicationControlsClient creates a new instance of AdaptiveApplicationControlsClient with the specified values. -// - subscriptionID - Azure subscription ID -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewAdaptiveApplicationControlsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AdaptiveApplicationControlsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &AdaptiveApplicationControlsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Delete - Delete an application control machine group -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2020-01-01 -// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// - groupName - Name of an application control machine group -// - options - AdaptiveApplicationControlsClientDeleteOptions contains the optional parameters for the AdaptiveApplicationControlsClient.Delete -// method. -func (client *AdaptiveApplicationControlsClient) Delete(ctx context.Context, ascLocation string, groupName string, options *AdaptiveApplicationControlsClientDeleteOptions) (AdaptiveApplicationControlsClientDeleteResponse, error) { - var err error - const operationName = "AdaptiveApplicationControlsClient.Delete" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.deleteCreateRequest(ctx, ascLocation, groupName, options) - if err != nil { - return AdaptiveApplicationControlsClientDeleteResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AdaptiveApplicationControlsClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - err = runtime.NewResponseError(httpResp) - return AdaptiveApplicationControlsClientDeleteResponse{}, err - } - return AdaptiveApplicationControlsClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *AdaptiveApplicationControlsClient) deleteCreateRequest(ctx context.Context, ascLocation string, groupName string, options *AdaptiveApplicationControlsClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if ascLocation == "" { - return nil, errors.New("parameter ascLocation cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ascLocation}", url.PathEscape(ascLocation)) - if groupName == "" { - return nil, errors.New("parameter groupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{groupName}", url.PathEscape(groupName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Gets an application control VM/server group. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2020-01-01 -// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// - groupName - Name of an application control machine group -// - options - AdaptiveApplicationControlsClientGetOptions contains the optional parameters for the AdaptiveApplicationControlsClient.Get -// method. -func (client *AdaptiveApplicationControlsClient) Get(ctx context.Context, ascLocation string, groupName string, options *AdaptiveApplicationControlsClientGetOptions) (AdaptiveApplicationControlsClientGetResponse, error) { - var err error - const operationName = "AdaptiveApplicationControlsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, ascLocation, groupName, options) - if err != nil { - return AdaptiveApplicationControlsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AdaptiveApplicationControlsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return AdaptiveApplicationControlsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *AdaptiveApplicationControlsClient) getCreateRequest(ctx context.Context, ascLocation string, groupName string, options *AdaptiveApplicationControlsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if ascLocation == "" { - return nil, errors.New("parameter ascLocation cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ascLocation}", url.PathEscape(ascLocation)) - if groupName == "" { - return nil, errors.New("parameter groupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{groupName}", url.PathEscape(groupName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *AdaptiveApplicationControlsClient) getHandleResponse(resp *http.Response) (AdaptiveApplicationControlsClientGetResponse, error) { - result := AdaptiveApplicationControlsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AdaptiveApplicationControlGroup); err != nil { - return AdaptiveApplicationControlsClientGetResponse{}, err - } - return result, nil -} - -// List - Gets a list of application control machine groups for the subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2020-01-01 -// - options - AdaptiveApplicationControlsClientListOptions contains the optional parameters for the AdaptiveApplicationControlsClient.List -// method. -func (client *AdaptiveApplicationControlsClient) List(ctx context.Context, options *AdaptiveApplicationControlsClientListOptions) (AdaptiveApplicationControlsClientListResponse, error) { - var err error - const operationName = "AdaptiveApplicationControlsClient.List" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.listCreateRequest(ctx, options) - if err != nil { - return AdaptiveApplicationControlsClientListResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AdaptiveApplicationControlsClientListResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return AdaptiveApplicationControlsClientListResponse{}, err - } - resp, err := client.listHandleResponse(httpResp) - return resp, err -} - -// listCreateRequest creates the List request. -func (client *AdaptiveApplicationControlsClient) listCreateRequest(ctx context.Context, options *AdaptiveApplicationControlsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applicationWhitelistings" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-01-01") - if options != nil && options.IncludePathRecommendations != nil { - reqQP.Set("includePathRecommendations", strconv.FormatBool(*options.IncludePathRecommendations)) - } - if options != nil && options.Summary != nil { - reqQP.Set("summary", strconv.FormatBool(*options.Summary)) - } - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *AdaptiveApplicationControlsClient) listHandleResponse(resp *http.Response) (AdaptiveApplicationControlsClientListResponse, error) { - result := AdaptiveApplicationControlsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AdaptiveApplicationControlGroups); err != nil { - return AdaptiveApplicationControlsClientListResponse{}, err - } - return result, nil -} - -// Put - Update an application control machine group -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2020-01-01 -// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// - groupName - Name of an application control machine group -// - options - AdaptiveApplicationControlsClientPutOptions contains the optional parameters for the AdaptiveApplicationControlsClient.Put -// method. -func (client *AdaptiveApplicationControlsClient) Put(ctx context.Context, ascLocation string, groupName string, body AdaptiveApplicationControlGroup, options *AdaptiveApplicationControlsClientPutOptions) (AdaptiveApplicationControlsClientPutResponse, error) { - var err error - const operationName = "AdaptiveApplicationControlsClient.Put" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.putCreateRequest(ctx, ascLocation, groupName, body, options) - if err != nil { - return AdaptiveApplicationControlsClientPutResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AdaptiveApplicationControlsClientPutResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return AdaptiveApplicationControlsClientPutResponse{}, err - } - resp, err := client.putHandleResponse(httpResp) - return resp, err -} - -// putCreateRequest creates the Put request. -func (client *AdaptiveApplicationControlsClient) putCreateRequest(ctx context.Context, ascLocation string, groupName string, body AdaptiveApplicationControlGroup, options *AdaptiveApplicationControlsClientPutOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if ascLocation == "" { - return nil, errors.New("parameter ascLocation cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ascLocation}", url.PathEscape(ascLocation)) - if groupName == "" { - return nil, errors.New("parameter groupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{groupName}", url.PathEscape(groupName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, body); err != nil { - return nil, err - } - return req, nil -} - -// putHandleResponse handles the Put response. -func (client *AdaptiveApplicationControlsClient) putHandleResponse(resp *http.Response) (AdaptiveApplicationControlsClientPutResponse, error) { - result := AdaptiveApplicationControlsClientPutResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AdaptiveApplicationControlGroup); err != nil { - return AdaptiveApplicationControlsClientPutResponse{}, err - } - return result, nil -} 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 f43524fe2cb7..000000000000 --- a/sdk/resourcemanager/security/armsecurity/adaptiveapplicationcontrols_client_example_test.go +++ /dev/null @@ -1,1321 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/GetAdaptiveApplicationControlsSubscription_example.json -func ExampleAdaptiveApplicationControlsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdaptiveApplicationControlsClient().List(ctx, &armsecurity.AdaptiveApplicationControlsClientListOptions{IncludePathRecommendations: to.Ptr(true), - Summary: to.Ptr(false), - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AdaptiveApplicationControlGroups = armsecurity.AdaptiveApplicationControlGroups{ - // Value: []*armsecurity.AdaptiveApplicationControlGroup{ - // { - // Location: to.Ptr("centralus"), - // Name: to.Ptr("AMIT-VA"), - // Type: to.Ptr("Microsoft.Security/applicationWhitelistings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/centralus/applicationWhitelistings/AMIT-VA"), - // Properties: &armsecurity.AdaptiveApplicationControlGroupData{ - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementMode: to.Ptr(armsecurity.EnforcementModeAudit), - // Issues: []*armsecurity.AdaptiveApplicationControlIssueSummary{ - // }, - // PathRecommendations: []*armsecurity.PathRecommendation{ - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("C:\\Windows\\SoftwareDistribution\\Download\\Install\\Windows-KB890830-x64-V5.53-delta.exe"), - // Action: to.Ptr(armsecurity.RecommendationActionRemove), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusNoStatus), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // UserSids: []*string{ - // to.Ptr("S-1-5-18")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("LOCAL SYSTEM"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("C:\\WindowsAzure\\GuestAgent_2.7.1198.822\\CollectGuestLogs.exe"), - // Action: to.Ptr(armsecurity.RecommendationActionRemove), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusNoStatus), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // UserSids: []*string{ - // to.Ptr("S-1-5-18")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("LOCAL SYSTEM"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("PublisherSignature")), - // Path: to.Ptr("C:\\Windows\\System32\\wbem\\WmiPrvSE.exe"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("*"), - // PublisherName: to.Ptr("O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-5-18"), - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("Everyone"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("%OSDRIVE%\\WINDOWSAZURE\\SECAGENT\\WASECAGENTPROV.EXE"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("Everyone"), - // }}, - // }}, - // ProtectionMode: &armsecurity.ProtectionMode{ - // Exe: to.Ptr(armsecurity.EnforcementModeAudit), - // Msi: to.Ptr(armsecurity.EnforcementModeAudit), - // Script: to.Ptr(armsecurity.EnforcementModeNone), - // }, - // RecommendationStatus: to.Ptr(armsecurity.RecommendationStatusRecommended), - // SourceSystem: to.Ptr(armsecurity.SourceSystemAzureAppLocker), - // VMRecommendations: []*armsecurity.VMRecommendation{ - // { - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportSupported), - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/erelh-dsc/providers/microsoft.compute/virtualmachines/erelh-14011"), - // }, - // { - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportSupported), - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/amit-va/providers/microsoft.compute/virtualmachines/ream-test"), - // }, - // { - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportSupported), - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/v-arrikl-scheduledapps/providers/microsoft.compute/virtualmachines/v-arrikl-14060"), - // }}, - // }, - // }, - // { - // Location: to.Ptr("centralus"), - // Name: to.Ptr("ERELGROUP1"), - // Type: to.Ptr("Microsoft.Security/applicationWhitelistings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/centralus/applicationWhitelistings/ERELGROUP1"), - // Properties: &armsecurity.AdaptiveApplicationControlGroupData{ - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementMode: to.Ptr(armsecurity.EnforcementModeAudit), - // Issues: []*armsecurity.AdaptiveApplicationControlIssueSummary{ - // }, - // PathRecommendations: []*armsecurity.PathRecommendation{ - // { - // Type: to.Ptr(armsecurity.RecommendationType("PublisherSignature")), - // Path: to.Ptr("[Exe] O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US\\*\\*\\0.0.0.0"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("*"), - // PublisherName: to.Ptr("O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("Everyone"), - // }}, - // }}, - // ProtectionMode: &armsecurity.ProtectionMode{ - // Exe: to.Ptr(armsecurity.EnforcementModeAudit), - // Msi: to.Ptr(armsecurity.EnforcementModeNone), - // Script: to.Ptr(armsecurity.EnforcementModeNone), - // }, - // RecommendationStatus: to.Ptr(armsecurity.RecommendationStatusRecommended), - // SourceSystem: to.Ptr(armsecurity.SourceSystemAzureAppLocker), - // VMRecommendations: []*armsecurity.VMRecommendation{ - // { - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportNotSupported), - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/erelh-stable/providers/microsoft.compute/virtualmachines/erelh-16090"), - // }}, - // }, - // }, - // { - // Location: to.Ptr("centralus"), - // Name: to.Ptr("GROUP1"), - // Type: to.Ptr("Microsoft.Security/applicationWhitelistings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/centralus/applicationWhitelistings/GROUP1"), - // Properties: &armsecurity.AdaptiveApplicationControlGroupData{ - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementMode: to.Ptr(armsecurity.EnforcementModeAudit), - // Issues: []*armsecurity.AdaptiveApplicationControlIssueSummary{ - // }, - // PathRecommendations: []*armsecurity.PathRecommendation{ - // { - // Type: to.Ptr(armsecurity.RecommendationType("PublisherSignature")), - // Path: to.Ptr("[Exe] O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US\\*\\*\\0.0.0.0"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("*"), - // PublisherName: to.Ptr("O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("Everyone"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("ProductSignature")), - // Path: to.Ptr("%OSDRIVE%\\WINDOWSAZURE\\SECAGENT\\WASECAGENTPROV.EXE"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("MICROSOFT® COREXT"), - // PublisherName: to.Ptr("CN=MICROSOFT AZURE DEPENDENCY CODE SIGN"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("NT AUTHORITY\\SYSTEM"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("PublisherSignature")), - // Path: to.Ptr("%PROGRAMFILES%\\RAPID7\\INSIGHT AGENT\\COMPONENTS\\INSIGHT_AGENT\\2.6.7.9\\GET_PROXY.EXE"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("*"), - // PublisherName: to.Ptr("O=RAPID7 LLC, L=BOSTON, S=MASSACHUSETTS, C=US"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("NT AUTHORITY\\SYSTEM"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("ProductSignature")), - // Path: to.Ptr("%PROGRAMFILES%\\GOOGLE\\CHROME\\APPLICATION\\CHROME.EXE"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("GOOGLE CHROME"), - // PublisherName: to.Ptr("O=GOOGLE LLC, L=MOUNTAIN VIEW, S=CA, C=US"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("NT AUTHORITY\\SYSTEM"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("ProductSignature")), - // Path: to.Ptr("O=GOOGLE INC, L=MOUNTAIN VIEW, S=CALIFORNIA, C=US\\GOOGLE UPDATE\\*\\0.0.0.0"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("GOOGLE UPDATE"), - // PublisherName: to.Ptr("O=GOOGLE INC, L=MOUNTAIN VIEW, S=CALIFORNIA, C=US"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("NT AUTHORITY\\SYSTEM"), - // }}, - // }}, - // ProtectionMode: &armsecurity.ProtectionMode{ - // Exe: to.Ptr(armsecurity.EnforcementModeAudit), - // Msi: to.Ptr(armsecurity.EnforcementModeNone), - // Script: to.Ptr(armsecurity.EnforcementModeNone), - // }, - // RecommendationStatus: to.Ptr(armsecurity.RecommendationStatusRecommended), - // SourceSystem: to.Ptr(armsecurity.SourceSystemAzureAppLocker), - // VMRecommendations: []*armsecurity.VMRecommendation{ - // { - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportSupported), - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/talk-va/providers/microsoft.compute/virtualmachines/tal-win-vm"), - // }, - // { - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportSupported), - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/talk-va/providers/microsoft.compute/virtualmachines/tal-win-vm-jit"), - // }, - // { - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportSupported), - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/myresourcegroup/providers/microsoft.compute/virtualmachines/myvmweb"), - // }, - // { - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportSupported), - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/v-arrikl-scheduledapps/providers/microsoft.compute/virtualmachines/v-arrikl-14061"), - // }}, - // }, - // }, - // { - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("GROUP1"), - // Type: to.Ptr("Microsoft.Security/applicationWhitelistings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/westeurope/applicationWhitelistings/GROUP1"), - // Properties: &armsecurity.AdaptiveApplicationControlGroupData{ - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementMode: to.Ptr(armsecurity.EnforcementModeAudit), - // Issues: []*armsecurity.AdaptiveApplicationControlIssueSummary{ - // { - // Issue: to.Ptr(armsecurity.AdaptiveApplicationControlIssueExecutableViolationsAudited), - // NumberOfVMs: to.Ptr[float32](1), - // }}, - // PathRecommendations: []*armsecurity.PathRecommendation{ - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/sbin/init"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/sbin/upstart-udev-bridge"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/lib/systemd/systemd-udevd"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/sbin/upstart-socket-bridge"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/sbin/dhclient"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/bin/python3.4"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/sbin/upstart-file-bridge"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/bin/dbus-daemon"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("messagebus"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/lib/systemd/systemd-logind"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/sbin/getty"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/sbin/atd"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/sbin/cron"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/sbin/acpid"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/sbin/sshd"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/lib/linux-lts-xenial-tools-4.4.0-103/hv_vss_daemon"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/lib/linux-lts-xenial-tools-4.4.0-103/hv_kvp_daemon"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/sbin/nscd"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("unscd"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/sbin/ntpd"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("ntp"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/opt/microsoft/auoms/bin/auomscollect"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/opt/omi/bin/omiserver"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/opt/omi/bin/omiengine"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("omi"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/opt/omi/bin/omiagent"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/sbin/rsyslogd"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("syslog"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/bin/python2.7"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }, - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("omsagent"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/opt/microsoft/omsagent/ruby/bin/ruby"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("omsagent"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/opt/microsoft/auoms/bin/auoms"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/local/qualys/cloud-agent/bin/qualys-cloud-agent"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/bin/dash"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("omsagent"), - // }, - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/bin/sleep"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("omsagent"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/opt/dsc/bin/dsc_host"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(false), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("omsagent"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/bin/sudo"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(false), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/bin/bash"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(false), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/bin/apt-get"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(false), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/lib/apt/methods/http"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(false), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/lib/apt/methods/gpgv"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(false), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/lib/apt/methods/copy"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(false), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("root"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/usr/bin/pgrep"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("omsagent"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("/opt/microsoft/omsconfig/bin/omsconsistencyinvoker"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(false), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExecutable), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("omsagent"), - // }}, - // }}, - // ProtectionMode: &armsecurity.ProtectionMode{ - // Executable: to.Ptr(armsecurity.EnforcementModeAudit), - // }, - // RecommendationStatus: to.Ptr(armsecurity.RecommendationStatusRecommended), - // SourceSystem: to.Ptr(armsecurity.SourceSystemAzureAuditD), - // VMRecommendations: []*armsecurity.VMRecommendation{ - // { - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportUnknown), - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/nic-no-pip/providers/microsoft.compute/virtualmachines/nic-no-pip-vm"), - // }}, - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/GetAdaptiveApplicationControlsGroup_example.json -func ExampleAdaptiveApplicationControlsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdaptiveApplicationControlsClient().Get(ctx, "centralus", "ERELGROUP1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AdaptiveApplicationControlGroup = armsecurity.AdaptiveApplicationControlGroup{ - // Location: to.Ptr("centralus"), - // Name: to.Ptr("ERELGROUP1"), - // Type: to.Ptr("Microsoft.Security/applicationWhitelistings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/centralus/applicationWhitelistings/ERELGROUP1"), - // Properties: &armsecurity.AdaptiveApplicationControlGroupData{ - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementMode: to.Ptr(armsecurity.EnforcementModeAudit), - // Issues: []*armsecurity.AdaptiveApplicationControlIssueSummary{ - // }, - // PathRecommendations: []*armsecurity.PathRecommendation{ - // { - // Type: to.Ptr(armsecurity.RecommendationType("PublisherSignature")), - // Path: to.Ptr("[Exe] O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US\\*\\*\\0.0.0.0"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("*"), - // PublisherName: to.Ptr("O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("Everyone"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("ProductSignature")), - // Path: to.Ptr("%OSDRIVE%\\WINDOWSAZURE\\SECAGENT\\WASECAGENTPROV.EXE"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("MICROSOFT® COREXT"), - // PublisherName: to.Ptr("CN=MICROSOFT AZURE DEPENDENCY CODE SIGN"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("NT AUTHORITY\\SYSTEM"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("PublisherSignature")), - // Path: to.Ptr("%OSDRIVE%\\WINDOWSAZURE\\PACKAGES_201973_7415\\COLLECTGUESTLOGS.EXE"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("*"), - // PublisherName: to.Ptr("CN=MICROSOFT AZURE DEPENDENCY CODE SIGN"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("NT AUTHORITY\\SYSTEM"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("C:\\directory\\file.exe"), - // Action: to.Ptr(armsecurity.RecommendationActionAdd), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("Everyone"), - // }}, - // }}, - // ProtectionMode: &armsecurity.ProtectionMode{ - // Exe: to.Ptr(armsecurity.EnforcementModeAudit), - // Msi: to.Ptr(armsecurity.EnforcementModeAudit), - // Script: to.Ptr(armsecurity.EnforcementModeNone), - // }, - // RecommendationStatus: to.Ptr(armsecurity.RecommendationStatusRecommended), - // SourceSystem: to.Ptr(armsecurity.SourceSystemAzureAppLocker), - // VMRecommendations: []*armsecurity.VMRecommendation{ - // { - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportSupported), - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/erelh-stable/providers/microsoft.compute/virtualmachines/erelh-16090"), - // }, - // { - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportSupported), - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/matanvs/providers/microsoft.compute/virtualmachines/matanvs19"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/PutAdaptiveApplicationControls_example.json -func ExampleAdaptiveApplicationControlsClient_Put() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdaptiveApplicationControlsClient().Put(ctx, "centralus", "ERELGROUP1", armsecurity.AdaptiveApplicationControlGroup{ - Properties: &armsecurity.AdaptiveApplicationControlGroupData{ - EnforcementMode: to.Ptr(armsecurity.EnforcementModeAudit), - PathRecommendations: []*armsecurity.PathRecommendation{ - { - Type: to.Ptr(armsecurity.RecommendationType("PublisherSignature")), - Path: to.Ptr("[Exe] O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US\\*\\*\\0.0.0.0"), - Action: to.Ptr(armsecurity.RecommendationActionRecommended), - Common: to.Ptr(true), - ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - FileType: to.Ptr(armsecurity.FileTypeExe), - PublisherInfo: &armsecurity.PublisherInfo{ - BinaryName: to.Ptr("*"), - ProductName: to.Ptr("*"), - PublisherName: to.Ptr("O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US"), - Version: to.Ptr("0.0.0.0"), - }, - UserSids: []*string{ - to.Ptr("S-1-1-0")}, - Usernames: []*armsecurity.UserRecommendation{ - { - RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - Username: to.Ptr("Everyone"), - }}, - }, - { - Type: to.Ptr(armsecurity.RecommendationType("ProductSignature")), - Path: to.Ptr("%OSDRIVE%\\WINDOWSAZURE\\SECAGENT\\WASECAGENTPROV.EXE"), - Action: to.Ptr(armsecurity.RecommendationActionRecommended), - Common: to.Ptr(true), - ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - FileType: to.Ptr(armsecurity.FileTypeExe), - PublisherInfo: &armsecurity.PublisherInfo{ - BinaryName: to.Ptr("*"), - ProductName: to.Ptr("MICROSOFT® COREXT"), - PublisherName: to.Ptr("CN=MICROSOFT AZURE DEPENDENCY CODE SIGN"), - Version: to.Ptr("0.0.0.0"), - }, - UserSids: []*string{ - to.Ptr("S-1-1-0")}, - Usernames: []*armsecurity.UserRecommendation{ - { - RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - Username: to.Ptr("NT AUTHORITY\\SYSTEM"), - }}, - }, - { - Type: to.Ptr(armsecurity.RecommendationType("PublisherSignature")), - Path: to.Ptr("%OSDRIVE%\\WINDOWSAZURE\\PACKAGES_201973_7415\\COLLECTGUESTLOGS.EXE"), - Action: to.Ptr(armsecurity.RecommendationActionRecommended), - Common: to.Ptr(true), - ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - FileType: to.Ptr(armsecurity.FileTypeExe), - PublisherInfo: &armsecurity.PublisherInfo{ - BinaryName: to.Ptr("*"), - ProductName: to.Ptr("*"), - PublisherName: to.Ptr("CN=MICROSOFT AZURE DEPENDENCY CODE SIGN"), - Version: to.Ptr("0.0.0.0"), - }, - UserSids: []*string{ - to.Ptr("S-1-1-0")}, - Usernames: []*armsecurity.UserRecommendation{ - { - RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - Username: to.Ptr("NT AUTHORITY\\SYSTEM"), - }}, - }, - { - Type: to.Ptr(armsecurity.RecommendationType("File")), - Path: to.Ptr("C:\\directory\\file.exe"), - Action: to.Ptr(armsecurity.RecommendationActionAdd), - Common: to.Ptr(true), - }}, - ProtectionMode: &armsecurity.ProtectionMode{ - Exe: to.Ptr(armsecurity.EnforcementModeAudit), - Msi: to.Ptr(armsecurity.EnforcementModeNone), - Script: to.Ptr(armsecurity.EnforcementModeNone), - }, - VMRecommendations: []*armsecurity.VMRecommendation{ - { - ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportSupported), - RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/erelh-stable/providers/microsoft.compute/virtualmachines/erelh-16090"), - }, - { - ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportSupported), - RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/matanvs/providers/microsoft.compute/virtualmachines/matanvs19"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AdaptiveApplicationControlGroup = armsecurity.AdaptiveApplicationControlGroup{ - // Location: to.Ptr("centralus"), - // Name: to.Ptr("ERELGROUP1"), - // Type: to.Ptr("Microsoft.Security/applicationWhitelistings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/centralus/applicationWhitelistings/ERELGROUP1"), - // Properties: &armsecurity.AdaptiveApplicationControlGroupData{ - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusInProgress), - // EnforcementMode: to.Ptr(armsecurity.EnforcementModeAudit), - // Issues: []*armsecurity.AdaptiveApplicationControlIssueSummary{ - // }, - // PathRecommendations: []*armsecurity.PathRecommendation{ - // { - // Type: to.Ptr(armsecurity.RecommendationType("PublisherSignature")), - // Path: to.Ptr("[Exe] O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US\\*\\*\\0.0.0.0"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("*"), - // PublisherName: to.Ptr("O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("Everyone"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("ProductSignature")), - // Path: to.Ptr("%OSDRIVE%\\WINDOWSAZURE\\SECAGENT\\WASECAGENTPROV.EXE"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("MICROSOFT® COREXT"), - // PublisherName: to.Ptr("CN=MICROSOFT AZURE DEPENDENCY CODE SIGN"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("NT AUTHORITY\\SYSTEM"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("PublisherSignature")), - // Path: to.Ptr("%OSDRIVE%\\WINDOWSAZURE\\PACKAGES_201973_7415\\COLLECTGUESTLOGS.EXE"), - // Action: to.Ptr(armsecurity.RecommendationActionRecommended), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // PublisherInfo: &armsecurity.PublisherInfo{ - // BinaryName: to.Ptr("*"), - // ProductName: to.Ptr("*"), - // PublisherName: to.Ptr("CN=MICROSOFT AZURE DEPENDENCY CODE SIGN"), - // Version: to.Ptr("0.0.0.0"), - // }, - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("NT AUTHORITY\\SYSTEM"), - // }}, - // }, - // { - // Type: to.Ptr(armsecurity.RecommendationType("File")), - // Path: to.Ptr("C:\\directory\\file.exe"), - // Action: to.Ptr(armsecurity.RecommendationActionAdd), - // Common: to.Ptr(true), - // ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusNotConfigured), - // FileType: to.Ptr(armsecurity.FileTypeExe), - // UserSids: []*string{ - // to.Ptr("S-1-1-0")}, - // Usernames: []*armsecurity.UserRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // Username: to.Ptr("Everyone"), - // }}, - // }}, - // ProtectionMode: &armsecurity.ProtectionMode{ - // Exe: to.Ptr(armsecurity.EnforcementModeAudit), - // Msi: to.Ptr(armsecurity.EnforcementModeNone), - // Script: to.Ptr(armsecurity.EnforcementModeNone), - // }, - // RecommendationStatus: to.Ptr(armsecurity.RecommendationStatusRecommended), - // SourceSystem: to.Ptr(armsecurity.SourceSystemAzureAppLocker), - // VMRecommendations: []*armsecurity.VMRecommendation{ - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/erelh-stable/providers/microsoft.compute/virtualmachines/erelh-16090"), - // }, - // { - // RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - // ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/matanvs/providers/microsoft.compute/virtualmachines/matanvs19"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/DeleteAdaptiveApplicationControls_example.json -func ExampleAdaptiveApplicationControlsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAdaptiveApplicationControlsClient().Delete(ctx, "centralus", "GROUP1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/adaptivenetworkhardenings_client.go b/sdk/resourcemanager/security/armsecurity/adaptivenetworkhardenings_client.go deleted file mode 100644 index b87d48496e1f..000000000000 --- a/sdk/resourcemanager/security/armsecurity/adaptivenetworkhardenings_client.go +++ /dev/null @@ -1,294 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// AdaptiveNetworkHardeningsClient contains the methods for the AdaptiveNetworkHardenings group. -// Don't use this type directly, use NewAdaptiveNetworkHardeningsClient() instead. -type AdaptiveNetworkHardeningsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewAdaptiveNetworkHardeningsClient creates a new instance of AdaptiveNetworkHardeningsClient with the specified values. -// - subscriptionID - Azure subscription ID -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewAdaptiveNetworkHardeningsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AdaptiveNetworkHardeningsClient, error) { - cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &AdaptiveNetworkHardeningsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// BeginEnforce - Enforces the given rules on the NSG(s) listed in the request -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2020-01-01 -// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// - resourceNamespace - The Namespace of the resource. -// - resourceType - The type of the resource. -// - resourceName - Name of the resource. -// - adaptiveNetworkHardeningResourceName - The name of the Adaptive Network Hardening resource. -// - options - AdaptiveNetworkHardeningsClientBeginEnforceOptions contains the optional parameters for the AdaptiveNetworkHardeningsClient.BeginEnforce -// method. -func (client *AdaptiveNetworkHardeningsClient) BeginEnforce(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, adaptiveNetworkHardeningResourceName string, body AdaptiveNetworkHardeningEnforceRequest, options *AdaptiveNetworkHardeningsClientBeginEnforceOptions) (*runtime.Poller[AdaptiveNetworkHardeningsClientEnforceResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.enforce(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, body, options) - if err != nil { - return nil, err - } - poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AdaptiveNetworkHardeningsClientEnforceResponse]{ - Tracer: client.internal.Tracer(), - }) - return poller, err - } else { - return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[AdaptiveNetworkHardeningsClientEnforceResponse]{ - Tracer: client.internal.Tracer(), - }) - } -} - -// Enforce - Enforces the given rules on the NSG(s) listed in the request -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2020-01-01 -func (client *AdaptiveNetworkHardeningsClient) enforce(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, adaptiveNetworkHardeningResourceName string, body AdaptiveNetworkHardeningEnforceRequest, options *AdaptiveNetworkHardeningsClientBeginEnforceOptions) (*http.Response, error) { - var err error - const operationName = "AdaptiveNetworkHardeningsClient.BeginEnforce" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.enforceCreateRequest(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, body, options) - if err != nil { - return nil, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { - err = runtime.NewResponseError(httpResp) - return nil, err - } - return httpResp, nil -} - -// enforceCreateRequest creates the Enforce request. -func (client *AdaptiveNetworkHardeningsClient) enforceCreateRequest(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, adaptiveNetworkHardeningResourceName string, body AdaptiveNetworkHardeningEnforceRequest, options *AdaptiveNetworkHardeningsClientBeginEnforceOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}/{adaptiveNetworkHardeningEnforceAction}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if resourceNamespace == "" { - return nil, errors.New("parameter resourceNamespace cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceNamespace}", url.PathEscape(resourceNamespace)) - if resourceType == "" { - return nil, errors.New("parameter resourceType cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceType}", url.PathEscape(resourceType)) - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - if adaptiveNetworkHardeningResourceName == "" { - return nil, errors.New("parameter adaptiveNetworkHardeningResourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{adaptiveNetworkHardeningResourceName}", url.PathEscape(adaptiveNetworkHardeningResourceName)) - urlPath = strings.ReplaceAll(urlPath, "{adaptiveNetworkHardeningEnforceAction}", url.PathEscape("enforce")) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - if err := runtime.MarshalAsJSON(req, body); err != nil { - return nil, err - } - return req, nil -} - -// Get - Gets a single Adaptive Network Hardening resource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2020-01-01 -// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// - resourceNamespace - The Namespace of the resource. -// - resourceType - The type of the resource. -// - resourceName - Name of the resource. -// - adaptiveNetworkHardeningResourceName - The name of the Adaptive Network Hardening resource. -// - options - AdaptiveNetworkHardeningsClientGetOptions contains the optional parameters for the AdaptiveNetworkHardeningsClient.Get -// method. -func (client *AdaptiveNetworkHardeningsClient) Get(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, adaptiveNetworkHardeningResourceName string, options *AdaptiveNetworkHardeningsClientGetOptions) (AdaptiveNetworkHardeningsClientGetResponse, error) { - var err error - const operationName = "AdaptiveNetworkHardeningsClient.Get" - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) - ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) - defer func() { endSpan(err) }() - req, err := client.getCreateRequest(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, options) - if err != nil { - return AdaptiveNetworkHardeningsClientGetResponse{}, err - } - httpResp, err := client.internal.Pipeline().Do(req) - if err != nil { - return AdaptiveNetworkHardeningsClientGetResponse{}, err - } - if !runtime.HasStatusCode(httpResp, http.StatusOK) { - err = runtime.NewResponseError(httpResp) - return AdaptiveNetworkHardeningsClientGetResponse{}, err - } - resp, err := client.getHandleResponse(httpResp) - return resp, err -} - -// getCreateRequest creates the Get request. -func (client *AdaptiveNetworkHardeningsClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, adaptiveNetworkHardeningResourceName string, options *AdaptiveNetworkHardeningsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if resourceNamespace == "" { - return nil, errors.New("parameter resourceNamespace cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceNamespace}", url.PathEscape(resourceNamespace)) - if resourceType == "" { - return nil, errors.New("parameter resourceType cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceType}", url.PathEscape(resourceType)) - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - if adaptiveNetworkHardeningResourceName == "" { - return nil, errors.New("parameter adaptiveNetworkHardeningResourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{adaptiveNetworkHardeningResourceName}", url.PathEscape(adaptiveNetworkHardeningResourceName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *AdaptiveNetworkHardeningsClient) getHandleResponse(resp *http.Response) (AdaptiveNetworkHardeningsClientGetResponse, error) { - result := AdaptiveNetworkHardeningsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AdaptiveNetworkHardening); err != nil { - return AdaptiveNetworkHardeningsClientGetResponse{}, err - } - return result, nil -} - -// NewListByExtendedResourcePager - Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. -// -// Generated from API version 2020-01-01 -// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// - resourceNamespace - The Namespace of the resource. -// - resourceType - The type of the resource. -// - resourceName - Name of the resource. -// - options - AdaptiveNetworkHardeningsClientListByExtendedResourceOptions contains the optional parameters for the AdaptiveNetworkHardeningsClient.NewListByExtendedResourcePager -// method. -func (client *AdaptiveNetworkHardeningsClient) NewListByExtendedResourcePager(resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, options *AdaptiveNetworkHardeningsClientListByExtendedResourceOptions) *runtime.Pager[AdaptiveNetworkHardeningsClientListByExtendedResourceResponse] { - return runtime.NewPager(runtime.PagingHandler[AdaptiveNetworkHardeningsClientListByExtendedResourceResponse]{ - More: func(page AdaptiveNetworkHardeningsClientListByExtendedResourceResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *AdaptiveNetworkHardeningsClientListByExtendedResourceResponse) (AdaptiveNetworkHardeningsClientListByExtendedResourceResponse, error) { - ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "AdaptiveNetworkHardeningsClient.NewListByExtendedResourcePager") - nextLink := "" - if page != nil { - nextLink = *page.NextLink - } - resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { - return client.listByExtendedResourceCreateRequest(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, options) - }, nil) - if err != nil { - return AdaptiveNetworkHardeningsClientListByExtendedResourceResponse{}, err - } - return client.listByExtendedResourceHandleResponse(resp) - }, - Tracer: client.internal.Tracer(), - }) -} - -// listByExtendedResourceCreateRequest creates the ListByExtendedResource request. -func (client *AdaptiveNetworkHardeningsClient) listByExtendedResourceCreateRequest(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, options *AdaptiveNetworkHardeningsClientListByExtendedResourceOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if resourceNamespace == "" { - return nil, errors.New("parameter resourceNamespace cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceNamespace}", url.PathEscape(resourceNamespace)) - if resourceType == "" { - return nil, errors.New("parameter resourceType cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceType}", url.PathEscape(resourceType)) - if resourceName == "" { - return nil, errors.New("parameter resourceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceName}", url.PathEscape(resourceName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-01-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByExtendedResourceHandleResponse handles the ListByExtendedResource response. -func (client *AdaptiveNetworkHardeningsClient) listByExtendedResourceHandleResponse(resp *http.Response) (AdaptiveNetworkHardeningsClientListByExtendedResourceResponse, error) { - result := AdaptiveNetworkHardeningsClientListByExtendedResourceResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.AdaptiveNetworkHardeningsList); err != nil { - return AdaptiveNetworkHardeningsClientListByExtendedResourceResponse{}, err - } - return result, nil -} 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 8c4ac51cfa91..000000000000 --- a/sdk/resourcemanager/security/armsecurity/adaptivenetworkhardenings_client_example_test.go +++ /dev/null @@ -1,194 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/ListByExtendedResourceAdaptiveNetworkHardenings_example.json -func ExampleAdaptiveNetworkHardeningsClient_NewListByExtendedResourcePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAdaptiveNetworkHardeningsClient().NewListByExtendedResourcePager("rg1", "Microsoft.Compute", "virtualMachines", "vm1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AdaptiveNetworkHardeningsList = armsecurity.AdaptiveNetworkHardeningsList{ - // Value: []*armsecurity.AdaptiveNetworkHardening{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/adaptiveNetworkHardenings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Security/adaptiveNetworkHardenings/default"), - // Properties: &armsecurity.AdaptiveNetworkHardeningProperties{ - // EffectiveNetworkSecurityGroups: []*armsecurity.EffectiveNetworkSecurityGroups{ - // { - // NetworkInterface: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/rg1/providers/Microsoft.Network/networkInterfaces/nic1"), - // NetworkSecurityGroups: []*string{ - // to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nicNsg"), - // to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/subnetNsg")}, - // }, - // { - // NetworkInterface: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/rg1/providers/Microsoft.Network/networkInterfaces/nic2"), - // NetworkSecurityGroups: []*string{ - // to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nicNsg2")}, - // }}, - // Rules: []*armsecurity.Rule{ - // { - // Name: to.Ptr("rule1"), - // DestinationPort: to.Ptr[int32](3389), - // Direction: to.Ptr(armsecurity.DirectionInbound), - // IPAddresses: []*string{ - // to.Ptr("100.10.1.1"), - // to.Ptr("200.20.2.2"), - // to.Ptr("81.199.3.0/24")}, - // Protocols: []*armsecurity.TransportProtocol{ - // to.Ptr(armsecurity.TransportProtocolTCP)}, - // }, - // { - // Name: to.Ptr("rule2"), - // DestinationPort: to.Ptr[int32](22), - // Direction: to.Ptr(armsecurity.DirectionInbound), - // IPAddresses: []*string{ - // }, - // Protocols: []*armsecurity.TransportProtocol{ - // to.Ptr(armsecurity.TransportProtocolTCP)}, - // }}, - // RulesCalculationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-15T00:00:00.000Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/GetAdaptiveNetworkHardening_example.json -func ExampleAdaptiveNetworkHardeningsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdaptiveNetworkHardeningsClient().Get(ctx, "rg1", "Microsoft.Compute", "virtualMachines", "vm1", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AdaptiveNetworkHardening = armsecurity.AdaptiveNetworkHardening{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/adaptiveNetworkHardenings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Security/adaptiveNetworkHardenings/default"), - // Properties: &armsecurity.AdaptiveNetworkHardeningProperties{ - // EffectiveNetworkSecurityGroups: []*armsecurity.EffectiveNetworkSecurityGroups{ - // { - // NetworkInterface: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/rg1/providers/Microsoft.Network/networkInterfaces/nic1"), - // NetworkSecurityGroups: []*string{ - // to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nicNsg"), - // to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/subnetNsg")}, - // }, - // { - // NetworkInterface: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/rg2/providers/Microsoft.Network/networkInterfaces/nic2"), - // NetworkSecurityGroups: []*string{ - // to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nicNsg")}, - // }}, - // Rules: []*armsecurity.Rule{ - // { - // Name: to.Ptr("rule1"), - // DestinationPort: to.Ptr[int32](3389), - // Direction: to.Ptr(armsecurity.DirectionInbound), - // IPAddresses: []*string{ - // to.Ptr("100.10.1.1"), - // to.Ptr("200.20.2.2"), - // to.Ptr("81.199.3.0/24")}, - // Protocols: []*armsecurity.TransportProtocol{ - // to.Ptr(armsecurity.TransportProtocolTCP)}, - // }, - // { - // Name: to.Ptr("rule2"), - // DestinationPort: to.Ptr[int32](22), - // Direction: to.Ptr(armsecurity.DirectionInbound), - // IPAddresses: []*string{ - // }, - // Protocols: []*armsecurity.TransportProtocol{ - // to.Ptr(armsecurity.TransportProtocolTCP)}, - // }}, - // RulesCalculationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-15T00:00:00.000Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/EnforceAdaptiveNetworkHardeningRules_example.json -func ExampleAdaptiveNetworkHardeningsClient_BeginEnforce() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAdaptiveNetworkHardeningsClient().BeginEnforce(ctx, "rg1", "Microsoft.Compute", "virtualMachines", "vm1", "default", armsecurity.AdaptiveNetworkHardeningEnforceRequest{ - NetworkSecurityGroups: []*string{ - to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg2")}, - Rules: []*armsecurity.Rule{ - { - Name: to.Ptr("rule1"), - DestinationPort: to.Ptr[int32](3389), - Direction: to.Ptr(armsecurity.DirectionInbound), - IPAddresses: []*string{ - to.Ptr("100.10.1.1"), - to.Ptr("200.20.2.2"), - to.Ptr("81.199.3.0/24")}, - Protocols: []*armsecurity.TransportProtocol{ - to.Ptr(armsecurity.TransportProtocolTCP)}, - }, - { - Name: to.Ptr("rule2"), - DestinationPort: to.Ptr[int32](22), - Direction: to.Ptr(armsecurity.DirectionInbound), - IPAddresses: []*string{}, - Protocols: []*armsecurity.TransportProtocol{ - to.Ptr(armsecurity.TransportProtocolTCP)}, - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/advancedthreatprotection_client.go b/sdk/resourcemanager/security/armsecurity/advancedthreatprotection_client.go index d261fee89336..88dc939a19c6 100644 --- a/sdk/resourcemanager/security/armsecurity/advancedthreatprotection_client.go +++ b/sdk/resourcemanager/security/armsecurity/advancedthreatprotection_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -70,7 +67,7 @@ func (client *AdvancedThreatProtectionClient) Create(ctx context.Context, resour } // createCreateRequest creates the Create request. -func (client *AdvancedThreatProtectionClient) createCreateRequest(ctx context.Context, resourceID string, advancedThreatProtectionSetting AdvancedThreatProtectionSetting, options *AdvancedThreatProtectionClientCreateOptions) (*policy.Request, error) { +func (client *AdvancedThreatProtectionClient) createCreateRequest(ctx context.Context, resourceID string, advancedThreatProtectionSetting AdvancedThreatProtectionSetting, _ *AdvancedThreatProtectionClientCreateOptions) (*policy.Request, error) { urlPath := "/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}" urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID) urlPath = strings.ReplaceAll(urlPath, "{settingName}", url.PathEscape("current")) @@ -127,7 +124,7 @@ func (client *AdvancedThreatProtectionClient) Get(ctx context.Context, resourceI } // getCreateRequest creates the Get request. -func (client *AdvancedThreatProtectionClient) getCreateRequest(ctx context.Context, resourceID string, options *AdvancedThreatProtectionClientGetOptions) (*policy.Request, error) { +func (client *AdvancedThreatProtectionClient) getCreateRequest(ctx context.Context, resourceID string, _ *AdvancedThreatProtectionClientGetOptions) (*policy.Request, error) { urlPath := "/{resourceId}/providers/Microsoft.Security/advancedThreatProtectionSettings/{settingName}" urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID) urlPath = strings.ReplaceAll(urlPath, "{settingName}", url.PathEscape("current")) 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 a02426283d28..000000000000 --- a/sdk/resourcemanager/security/armsecurity/advancedthreatprotection_client_example_test.go +++ /dev/null @@ -1,82 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/AdvancedThreatProtection/GetAdvancedThreatProtectionSettings_example.json -func ExampleAdvancedThreatProtectionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdvancedThreatProtectionClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AdvancedThreatProtectionSetting = armsecurity.AdvancedThreatProtectionSetting{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Security/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/advancedThreatProtectionSettings/current"), - // Properties: &armsecurity.AdvancedThreatProtectionProperties{ - // IsEnabled: to.Ptr(true), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/AdvancedThreatProtection/PutAdvancedThreatProtectionSettings_example.json -func ExampleAdvancedThreatProtectionClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdvancedThreatProtectionClient().Create(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", armsecurity.AdvancedThreatProtectionSetting{ - Name: to.Ptr("current"), - Type: to.Ptr("Microsoft.Security/advancedThreatProtectionSettings"), - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/advancedThreatProtectionSettings/current"), - Properties: &armsecurity.AdvancedThreatProtectionProperties{ - IsEnabled: to.Ptr(true), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AdvancedThreatProtectionSetting = armsecurity.AdvancedThreatProtectionSetting{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Security/advancedThreatProtectionSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/advancedThreatProtectionSettings/current"), - // Properties: &armsecurity.AdvancedThreatProtectionProperties{ - // IsEnabled: to.Ptr(true), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/alerts_client.go b/sdk/resourcemanager/security/armsecurity/alerts_client.go index 59fd173fbef7..d57896253105 100644 --- a/sdk/resourcemanager/security/armsecurity/alerts_client.go +++ b/sdk/resourcemanager/security/armsecurity/alerts_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -75,7 +72,7 @@ func (client *AlertsClient) GetResourceGroupLevel(ctx context.Context, resourceG } // getResourceGroupLevelCreateRequest creates the GetResourceGroupLevel request. -func (client *AlertsClient) getResourceGroupLevelCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, alertName string, options *AlertsClientGetResourceGroupLevelOptions) (*policy.Request, error) { +func (client *AlertsClient) getResourceGroupLevelCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, alertName string, _ *AlertsClientGetResourceGroupLevelOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -144,7 +141,7 @@ func (client *AlertsClient) GetSubscriptionLevel(ctx context.Context, ascLocatio } // getSubscriptionLevelCreateRequest creates the GetSubscriptionLevel request. -func (client *AlertsClient) getSubscriptionLevelCreateRequest(ctx context.Context, ascLocation string, alertName string, options *AlertsClientGetSubscriptionLevelOptions) (*policy.Request, error) { +func (client *AlertsClient) getSubscriptionLevelCreateRequest(ctx context.Context, ascLocation string, alertName string, _ *AlertsClientGetSubscriptionLevelOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -206,7 +203,7 @@ func (client *AlertsClient) NewListPager(options *AlertsClientListOptions) *runt } // listCreateRequest creates the List request. -func (client *AlertsClient) listCreateRequest(ctx context.Context, options *AlertsClientListOptions) (*policy.Request, error) { +func (client *AlertsClient) listCreateRequest(ctx context.Context, _ *AlertsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alerts" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -262,7 +259,7 @@ func (client *AlertsClient) NewListByResourceGroupPager(resourceGroupName string } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *AlertsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *AlertsClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *AlertsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *AlertsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/alerts" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -324,7 +321,7 @@ func (client *AlertsClient) NewListResourceGroupLevelByRegionPager(ascLocation s } // listResourceGroupLevelByRegionCreateRequest creates the ListResourceGroupLevelByRegion request. -func (client *AlertsClient) listResourceGroupLevelByRegionCreateRequest(ctx context.Context, ascLocation string, resourceGroupName string, options *AlertsClientListResourceGroupLevelByRegionOptions) (*policy.Request, error) { +func (client *AlertsClient) listResourceGroupLevelByRegionCreateRequest(ctx context.Context, ascLocation string, resourceGroupName string, _ *AlertsClientListResourceGroupLevelByRegionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -389,7 +386,7 @@ func (client *AlertsClient) NewListSubscriptionLevelByRegionPager(ascLocation st } // listSubscriptionLevelByRegionCreateRequest creates the ListSubscriptionLevelByRegion request. -func (client *AlertsClient) listSubscriptionLevelByRegionCreateRequest(ctx context.Context, ascLocation string, options *AlertsClientListSubscriptionLevelByRegionOptions) (*policy.Request, error) { +func (client *AlertsClient) listSubscriptionLevelByRegionCreateRequest(ctx context.Context, ascLocation string, _ *AlertsClientListSubscriptionLevelByRegionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -470,7 +467,7 @@ func (client *AlertsClient) simulate(ctx context.Context, ascLocation string, al } // simulateCreateRequest creates the Simulate request. -func (client *AlertsClient) simulateCreateRequest(ctx context.Context, ascLocation string, alertSimulatorRequestBody AlertSimulatorRequestBody, options *AlertsClientBeginSimulateOptions) (*policy.Request, error) { +func (client *AlertsClient) simulateCreateRequest(ctx context.Context, ascLocation string, alertSimulatorRequestBody AlertSimulatorRequestBody, _ *AlertsClientBeginSimulateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/default/simulate" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -525,7 +522,7 @@ func (client *AlertsClient) UpdateResourceGroupLevelStateToActivate(ctx context. } // updateResourceGroupLevelStateToActivateCreateRequest creates the UpdateResourceGroupLevelStateToActivate request. -func (client *AlertsClient) updateResourceGroupLevelStateToActivateCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, alertName string, options *AlertsClientUpdateResourceGroupLevelStateToActivateOptions) (*policy.Request, error) { +func (client *AlertsClient) updateResourceGroupLevelStateToActivateCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, alertName string, _ *AlertsClientUpdateResourceGroupLevelStateToActivateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -585,7 +582,7 @@ func (client *AlertsClient) UpdateResourceGroupLevelStateToDismiss(ctx context.C } // updateResourceGroupLevelStateToDismissCreateRequest creates the UpdateResourceGroupLevelStateToDismiss request. -func (client *AlertsClient) updateResourceGroupLevelStateToDismissCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, alertName string, options *AlertsClientUpdateResourceGroupLevelStateToDismissOptions) (*policy.Request, error) { +func (client *AlertsClient) updateResourceGroupLevelStateToDismissCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, alertName string, _ *AlertsClientUpdateResourceGroupLevelStateToDismissOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -645,7 +642,7 @@ func (client *AlertsClient) UpdateResourceGroupLevelStateToInProgress(ctx contex } // updateResourceGroupLevelStateToInProgressCreateRequest creates the UpdateResourceGroupLevelStateToInProgress request. -func (client *AlertsClient) updateResourceGroupLevelStateToInProgressCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, alertName string, options *AlertsClientUpdateResourceGroupLevelStateToInProgressOptions) (*policy.Request, error) { +func (client *AlertsClient) updateResourceGroupLevelStateToInProgressCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, alertName string, _ *AlertsClientUpdateResourceGroupLevelStateToInProgressOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/inProgress" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -705,7 +702,7 @@ func (client *AlertsClient) UpdateResourceGroupLevelStateToResolve(ctx context.C } // updateResourceGroupLevelStateToResolveCreateRequest creates the UpdateResourceGroupLevelStateToResolve request. -func (client *AlertsClient) updateResourceGroupLevelStateToResolveCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, alertName string, options *AlertsClientUpdateResourceGroupLevelStateToResolveOptions) (*policy.Request, error) { +func (client *AlertsClient) updateResourceGroupLevelStateToResolveCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, alertName string, _ *AlertsClientUpdateResourceGroupLevelStateToResolveOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -764,7 +761,7 @@ func (client *AlertsClient) UpdateSubscriptionLevelStateToActivate(ctx context.C } // updateSubscriptionLevelStateToActivateCreateRequest creates the UpdateSubscriptionLevelStateToActivate request. -func (client *AlertsClient) updateSubscriptionLevelStateToActivateCreateRequest(ctx context.Context, ascLocation string, alertName string, options *AlertsClientUpdateSubscriptionLevelStateToActivateOptions) (*policy.Request, error) { +func (client *AlertsClient) updateSubscriptionLevelStateToActivateCreateRequest(ctx context.Context, ascLocation string, alertName string, _ *AlertsClientUpdateSubscriptionLevelStateToActivateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -819,7 +816,7 @@ func (client *AlertsClient) UpdateSubscriptionLevelStateToDismiss(ctx context.Co } // updateSubscriptionLevelStateToDismissCreateRequest creates the UpdateSubscriptionLevelStateToDismiss request. -func (client *AlertsClient) updateSubscriptionLevelStateToDismissCreateRequest(ctx context.Context, ascLocation string, alertName string, options *AlertsClientUpdateSubscriptionLevelStateToDismissOptions) (*policy.Request, error) { +func (client *AlertsClient) updateSubscriptionLevelStateToDismissCreateRequest(ctx context.Context, ascLocation string, alertName string, _ *AlertsClientUpdateSubscriptionLevelStateToDismissOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -874,7 +871,7 @@ func (client *AlertsClient) UpdateSubscriptionLevelStateToInProgress(ctx context } // updateSubscriptionLevelStateToInProgressCreateRequest creates the UpdateSubscriptionLevelStateToInProgress request. -func (client *AlertsClient) updateSubscriptionLevelStateToInProgressCreateRequest(ctx context.Context, ascLocation string, alertName string, options *AlertsClientUpdateSubscriptionLevelStateToInProgressOptions) (*policy.Request, error) { +func (client *AlertsClient) updateSubscriptionLevelStateToInProgressCreateRequest(ctx context.Context, ascLocation string, alertName string, _ *AlertsClientUpdateSubscriptionLevelStateToInProgressOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/inProgress" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -929,7 +926,7 @@ func (client *AlertsClient) UpdateSubscriptionLevelStateToResolve(ctx context.Co } // updateSubscriptionLevelStateToResolveCreateRequest creates the UpdateSubscriptionLevelStateToResolve request. -func (client *AlertsClient) updateSubscriptionLevelStateToResolveCreateRequest(ctx context.Context, ascLocation string, alertName string, options *AlertsClientUpdateSubscriptionLevelStateToResolveOptions) (*policy.Request, error) { +func (client *AlertsClient) updateSubscriptionLevelStateToResolveCreateRequest(ctx context.Context, ascLocation string, alertName string, _ *AlertsClientUpdateSubscriptionLevelStateToResolveOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/resolve" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 26568f8a556d..000000000000 --- a/sdk/resourcemanager/security/armsecurity/alerts_client_example_test.go +++ /dev/null @@ -1,1464 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertsSubscription_example.json -func ExampleAlertsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAlertsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AlertList = armsecurity.AlertList{ - // Value: []*armsecurity.Alert{ - // { - // Name: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Type: to.Ptr("Microsoft.Security/Locations/alerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/alerts/2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA"), - // Properties: &armsecurity.AlertProperties{ - // Description: to.Ptr("This is a test alert generated by Azure Security Center. No further action is needed."), - // AlertDisplayName: to.Ptr("Azure Security Center test alert (not a threat)"), - // AlertType: to.Ptr("VM_EICAR"), - // AlertURI: to.Ptr("https://portal.azure.com/#blade/Microsoft_Azure_Security/AlertBlade/alertId/2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a/subscriptionId/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroup/myRg1/referencedFrom/alertDeepLink/location/westeurope"), - // CompromisedEntity: to.Ptr("vm1"), - // CorrelationKey: to.Ptr("kso0LFWxzCll5tqrk5hmrBJ+MY1BX806W6q6+0s9Lk="), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.000Z"); return t}()), - // Entities: []*armsecurity.AlertEntity{ - // { - // AdditionalProperties: map[string]any{ - // "address": "192.0.2.1", - // "location": map[string]any{ - // "asn": float64(6584), - // "city": "sonning", - // "countryCode": "gb", - // "latitude": float64(51.468), - // "longitude": float64(-0.909), - // "state": "wokingham", - // }, - // }, - // Type: to.Ptr("ip"), - // }}, - // ExtendedLinks: []map[string]*string{ - // map[string]*string{ - // "Category": to.Ptr("threat_reports"), - // "Href": to.Ptr("https://contoso.com/reports/DisplayReport"), - // "Label": to.Ptr("Report: RDP Brute Forcing"), - // "Type": to.Ptr("webLink"), - // }}, - // ExtendedProperties: map[string]*string{ - // "Property1": to.Ptr("Property1 information"), - // }, - // Intent: to.Ptr(armsecurity.IntentExecution), - // IsIncident: to.Ptr(true), - // ProcessingEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.920Z"); return t}()), - // ProductComponentName: to.Ptr("testName"), - // ProductName: to.Ptr("Azure Security Center"), - // RemediationSteps: []*string{ - // to.Ptr("No further action is needed.")}, - // ResourceIdentifiers: []armsecurity.ResourceIdentifierClassification{ - // &armsecurity.AzureResourceIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeAzureResource), - // AzureResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // &armsecurity.LogAnalyticsIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeLogAnalytics), - // AgentID: to.Ptr("75724a01-f021-4aa8-9ec2-329792373e6e"), - // WorkspaceID: to.Ptr("f419f624-acad-4d89-b86d-f62fa387f019"), - // WorkspaceResourceGroup: to.Ptr("myRg1"), - // WorkspaceSubscriptionID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }}, - // Severity: to.Ptr(armsecurity.AlertSeverityHigh), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.000Z"); return t}()), - // Status: to.Ptr(armsecurity.AlertStatusActive), - // SubTechniques: []*string{ - // to.Ptr("T1059.001"), - // to.Ptr("T1059.006"), - // to.Ptr("T1053.002")}, - // SupportingEvidence: &armsecurity.AlertPropertiesSupportingEvidence{ - // AdditionalProperties: map[string]any{ - // "columns": []any{ - // "Date", - // "Activity", - // "User", - // "TestedText", - // "TestedValue", - // }, - // "rows": []any{ - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser2", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser3", - // "true", - // true, - // }, - // }, - // "title": "Investigate activity test", - // }, - // Type: to.Ptr("tabularEvidences"), - // }, - // SystemAlertID: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Techniques: []*string{ - // to.Ptr("T1059"), - // to.Ptr("T1053"), - // to.Ptr("T1072")}, - // TimeGeneratedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.000Z"); return t}()), - // VendorName: to.Ptr("Microsoft"), - // Version: to.Ptr("2022-01-01"), - // }, - // }, - // { - // Name: to.Ptr("2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22"), - // Type: to.Ptr("Microsoft.Security/Locations/alerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg2/providers/Microsoft.Security/locations/westeurope/alerts/2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22"), - // Properties: &armsecurity.AlertProperties{ - // Description: to.Ptr("The process ‘c:\\users\\contosoUser\\scrsave.scr’ was observed executing from an uncommon location. Files with the .scr extensions are screen saver files and are normally reside and execute from the Windows system directory."), - // AlertDisplayName: to.Ptr("Suspicious Screensaver process executed"), - // AlertType: to.Ptr("VM_SuspiciousScreenSaver"), - // AlertURI: to.Ptr("https://portal.azure.com/#blade/Microsoft_Azure_Security/AlertBlade/alertId/2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a/subscriptionId/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroup/myRg1/referencedFrom/alertDeepLink/location/westeurope"), - // CompromisedEntity: to.Ptr("vm2"), - // CorrelationKey: to.Ptr("4hno6LF0xzCl5tqrk4nrBW+MY1BX816W6q6+0srk4"), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T13:51:45.004Z"); return t}()), - // Entities: []*armsecurity.AlertEntity{ - // { - // AdditionalProperties: map[string]any{ - // "OsVersion": nil, - // "azureID": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/myRg2/providers/microsoft.compute/virtualmachines/vm2", - // "dnsDomain": "", - // "hostName": "vm2", - // "netBiosName": "vm2", - // "ntDomain": "", - // "omsAgentID": "45b44640-3b94-4892-a28c-4a5cae27065a", - // "operatingSystem": "Unknown", - // }, - // Type: to.Ptr("host"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "name": "contosoUser", - // "logonId": "0x61450d87", - // "ntDomain": "vm2", - // "sid": "S-1-5-21-2144575486-8928446540-5163864319-500", - // }, - // Type: to.Ptr("account"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "name": "cmd.exe", - // "directory": "c:\\windows\\system32", - // }, - // Type: to.Ptr("file"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "processId": "0x3c44", - // }, - // Type: to.Ptr("process"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "name": "scrsave.scr", - // "directory": "c:\\users\\contosoUser", - // }, - // Type: to.Ptr("file"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "commandLine": "c:\\users\\contosoUser\\scrsave.scr", - // "creationTimeUtc": "2018-05-07T13:51:45.0045913Z", - // "processId": "0x4aec", - // }, - // Type: to.Ptr("process"), - // }}, - // ExtendedLinks: []map[string]*string{ - // map[string]*string{ - // "Category": to.Ptr("threat_reports"), - // "Href": to.Ptr("https://contoso.com/reports/DisplayReport"), - // "Label": to.Ptr("Report: RDP Brute Forcing"), - // "Type": to.Ptr("webLink"), - // }}, - // ExtendedProperties: map[string]*string{ - // "account logon id": to.Ptr("0x61450d87"), - // "command line": to.Ptr("c:\\users\\contosoUser\\scrsave.scr"), - // "domain name": to.Ptr("vm2"), - // "parent process": to.Ptr("cmd.exe"), - // "parent process id": to.Ptr("0x3c44"), - // "process id": to.Ptr("0x4aec"), - // "process name": to.Ptr("c:\\users\\contosoUser\\scrsave.scr"), - // "resourceType": to.Ptr("Virtual Machine"), - // "user SID": to.Ptr("S-1-5-21-2144575486-8928446540-5163864319-500"), - // "user name": to.Ptr("vm2\\contosoUser"), - // }, - // Intent: to.Ptr(armsecurity.IntentExecution), - // IsIncident: to.Ptr(true), - // ProcessingEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T13:51:48.981Z"); return t}()), - // ProductComponentName: to.Ptr("testName2"), - // ProductName: to.Ptr("Azure Security Center"), - // RemediationSteps: []*string{ - // to.Ptr("1. Run Process Explorer and try to identify unknown running processes (see https://technet.microsoft.com/en-us/sysinternals/bb896653.aspx)"), - // to.Ptr("2. Make sure the machine is completely updated and has an updated anti-malware application installed"), - // to.Ptr("3. Run a full anti-malware scan and verify that the threat was removed"), - // to.Ptr("4. Install and run Microsoft’s Malicious Software Removal Tool (see https://www.microsoft.com/en-us/download/malicious-software-removal-tool-details.aspx)"), - // to.Ptr("5. Run Microsoft’s Autoruns utility and try to identify unknown applications that are configured to run at login (see https://technet.microsoft.com/en-us/sysinternals/bb963902.aspx)"), - // to.Ptr("6. Escalate the alert to the information security team")}, - // ResourceIdentifiers: []armsecurity.ResourceIdentifierClassification{ - // &armsecurity.AzureResourceIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeAzureResource), - // AzureResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // &armsecurity.LogAnalyticsIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeLogAnalytics), - // AgentID: to.Ptr("75724a01-f021-4aa8-9ec2-329792373e6e"), - // WorkspaceID: to.Ptr("f419f624-acad-4d89-b86d-f62fa387f019"), - // WorkspaceResourceGroup: to.Ptr("myRg1"), - // WorkspaceSubscriptionID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }}, - // Severity: to.Ptr(armsecurity.AlertSeverityMedium), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T13:51:45.004Z"); return t}()), - // Status: to.Ptr(armsecurity.AlertStatusActive), - // SubTechniques: []*string{ - // to.Ptr("T1059.001"), - // to.Ptr("T1059.006"), - // to.Ptr("T1053.002")}, - // SupportingEvidence: &armsecurity.AlertPropertiesSupportingEvidence{ - // AdditionalProperties: map[string]any{ - // "supportingEvidenceList": []any{ - // map[string]any{ - // "type": "nestedList", - // "evidenceElements":[]any{ - // map[string]any{ - // "type": "evidenceElement", - // "innerElements": nil, - // "text":map[string]any{ - // "arguments":map[string]any{ - // "domainName":map[string]any{ - // "type": "string", - // "value": "domainName", - // }, - // "sensitiveEnumerationTypes":map[string]any{ - // "type": "string[]", - // "value":[]any{ - // "UseDesKey", - // }, - // }, - // }, - // "fallback": "Actor enumerated UseDesKey on domain1.test.local", - // "localizationKey": "AATP_ALERTS_LDAP_SENSITIVE_ATTRIBUTE_RECONNAISSANCE_SECURITY_ALERT_EVIDENCE_ENUMERATION_DETAIL_A7C00BD7", - // }, - // }, - // }, - // }, - // map[string]any{ - // "type": "tabularEvidences", - // "columns":[]any{ - // "Date", - // "Activity", - // "User", - // "TestedText", - // "TestedValue", - // }, - // "rows":[]any{ - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser2", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser3", - // "true", - // true, - // }, - // }, - // "title": "Investigate activity test", - // }, - // }, - // }, - // Type: to.Ptr("supportingEvidenceList"), - // }, - // SystemAlertID: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Techniques: []*string{ - // to.Ptr("T1059"), - // to.Ptr("T1053"), - // to.Ptr("T1072")}, - // TimeGeneratedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T13:51:48.381Z"); return t}()), - // VendorName: to.Ptr("Microsoft"), - // Version: to.Ptr("2022-01-01"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertsResourceGroup_example.json -func ExampleAlertsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAlertsClient().NewListByResourceGroupPager("myRg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AlertList = armsecurity.AlertList{ - // Value: []*armsecurity.Alert{ - // { - // Name: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Type: to.Ptr("Microsoft.Security/Locations/alerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/alerts/2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA"), - // Properties: &armsecurity.AlertProperties{ - // Description: to.Ptr("This is a test alert generated by Azure Security Center. No further action is needed."), - // AlertDisplayName: to.Ptr("Azure Security Center test alert (not a threat)"), - // AlertType: to.Ptr("VM_EICAR"), - // AlertURI: to.Ptr("https://portal.azure.com/#blade/Microsoft_Azure_Security/AlertBlade/alertId/2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a/subscriptionId/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroup/myRg1/referencedFrom/alertDeepLink/location/westeurope"), - // CompromisedEntity: to.Ptr("vm1"), - // CorrelationKey: to.Ptr("kso0LFWxzCll5tqrk5hmrBJ+MY1BX806W6q6+0s9Lk="), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.000Z"); return t}()), - // Entities: []*armsecurity.AlertEntity{ - // { - // AdditionalProperties: map[string]any{ - // "address": "192.0.2.1", - // "location": map[string]any{ - // "asn": float64(6584), - // "city": "sonning", - // "countryCode": "gb", - // "latitude": float64(51.468), - // "longitude": float64(-0.909), - // "state": "wokingham", - // }, - // }, - // Type: to.Ptr("ip"), - // }}, - // ExtendedLinks: []map[string]*string{ - // map[string]*string{ - // "Category": to.Ptr("threat_reports"), - // "Href": to.Ptr("https://contoso.com/reports/DisplayReport"), - // "Label": to.Ptr("Report: RDP Brute Forcing"), - // "Type": to.Ptr("webLink"), - // }}, - // ExtendedProperties: map[string]*string{ - // "Property1": to.Ptr("Property1 information"), - // }, - // Intent: to.Ptr(armsecurity.IntentExecution), - // IsIncident: to.Ptr(true), - // ProcessingEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.920Z"); return t}()), - // ProductComponentName: to.Ptr("testName"), - // ProductName: to.Ptr("Azure Security Center"), - // RemediationSteps: []*string{ - // to.Ptr("No further action is needed.")}, - // ResourceIdentifiers: []armsecurity.ResourceIdentifierClassification{ - // &armsecurity.AzureResourceIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeAzureResource), - // AzureResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // &armsecurity.LogAnalyticsIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeLogAnalytics), - // AgentID: to.Ptr("75724a01-f021-4aa8-9ec2-329792373e6e"), - // WorkspaceID: to.Ptr("f419f624-acad-4d89-b86d-f62fa387f019"), - // WorkspaceResourceGroup: to.Ptr("myRg1"), - // WorkspaceSubscriptionID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }}, - // Severity: to.Ptr(armsecurity.AlertSeverityHigh), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.000Z"); return t}()), - // Status: to.Ptr(armsecurity.AlertStatusActive), - // SubTechniques: []*string{ - // to.Ptr("T1059.001"), - // to.Ptr("T1059.006"), - // to.Ptr("T1053.002")}, - // SupportingEvidence: &armsecurity.AlertPropertiesSupportingEvidence{ - // AdditionalProperties: map[string]any{ - // "supportingEvidenceList": []any{ - // map[string]any{ - // "type": "nestedList", - // "evidenceElements":[]any{ - // map[string]any{ - // "type": "evidenceElement", - // "innerElements": nil, - // "text":map[string]any{ - // "arguments":map[string]any{ - // "domainName":map[string]any{ - // "type": "string", - // "value": "domainName", - // }, - // "sensitiveEnumerationTypes":map[string]any{ - // "type": "string[]", - // "value":[]any{ - // "UseDesKey", - // }, - // }, - // }, - // "fallback": "Actor enumerated UseDesKey on domain1.test.local", - // "localizationKey": "AATP_ALERTS_LDAP_SENSITIVE_ATTRIBUTE_RECONNAISSANCE_SECURITY_ALERT_EVIDENCE_ENUMERATION_DETAIL_A7C00BD7", - // }, - // }, - // }, - // }, - // map[string]any{ - // "type": "tabularEvidences", - // "columns":[]any{ - // "Date", - // "Activity", - // "User", - // "TestedText", - // "TestedValue", - // }, - // "rows":[]any{ - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser2", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser3", - // "true", - // true, - // }, - // }, - // "title": "Investigate activity test", - // }, - // }, - // }, - // Type: to.Ptr("supportingEvidenceList"), - // }, - // SystemAlertID: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Techniques: []*string{ - // to.Ptr("T1059"), - // to.Ptr("T1053"), - // to.Ptr("T1072")}, - // TimeGeneratedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.000Z"); return t}()), - // VendorName: to.Ptr("Microsoft"), - // Version: to.Ptr("2022-01-01"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertsSubscriptionsLocation_example.json -func ExampleAlertsClient_NewListSubscriptionLevelByRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAlertsClient().NewListSubscriptionLevelByRegionPager("westeurope", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AlertList = armsecurity.AlertList{ - // Value: []*armsecurity.Alert{ - // { - // Name: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Type: to.Ptr("Microsoft.Security/Locations/alerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/alerts/2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA"), - // Properties: &armsecurity.AlertProperties{ - // Description: to.Ptr("This is a test alert generated by Azure Security Center. No further action is needed."), - // AlertDisplayName: to.Ptr("Azure Security Center test alert (not a threat)"), - // AlertType: to.Ptr("VM_EICAR"), - // AlertURI: to.Ptr("https://portal.azure.com/#blade/Microsoft_Azure_Security/AlertBlade/alertId/2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a/subscriptionId/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroup/myRg1/referencedFrom/alertDeepLink/location/westeurope"), - // CompromisedEntity: to.Ptr("vm1"), - // CorrelationKey: to.Ptr("kso0LFWxzCll5tqrk5hmrBJ+MY1BX806W6q6+0s9Lk="), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.000Z"); return t}()), - // Entities: []*armsecurity.AlertEntity{ - // { - // AdditionalProperties: map[string]any{ - // "address": "192.0.2.1", - // "location": map[string]any{ - // "asn": float64(6584), - // "city": "sonning", - // "countryCode": "gb", - // "latitude": float64(51.468), - // "longitude": float64(-0.909), - // "state": "wokingham", - // }, - // }, - // Type: to.Ptr("ip"), - // }}, - // ExtendedLinks: []map[string]*string{ - // map[string]*string{ - // "Category": to.Ptr("threat_reports"), - // "Href": to.Ptr("https://contoso.com/reports/DisplayReport"), - // "Label": to.Ptr("Report: RDP Brute Forcing"), - // "Type": to.Ptr("webLink"), - // }}, - // ExtendedProperties: map[string]*string{ - // "Property1": to.Ptr("Property1 information"), - // }, - // Intent: to.Ptr(armsecurity.IntentExecution), - // IsIncident: to.Ptr(true), - // ProcessingEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.920Z"); return t}()), - // ProductComponentName: to.Ptr("testName"), - // ProductName: to.Ptr("Azure Security Center"), - // RemediationSteps: []*string{ - // to.Ptr("No further action is needed.")}, - // ResourceIdentifiers: []armsecurity.ResourceIdentifierClassification{ - // &armsecurity.AzureResourceIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeAzureResource), - // AzureResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // &armsecurity.LogAnalyticsIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeLogAnalytics), - // AgentID: to.Ptr("75724a01-f021-4aa8-9ec2-329792373e6e"), - // WorkspaceID: to.Ptr("f419f624-acad-4d89-b86d-f62fa387f019"), - // WorkspaceResourceGroup: to.Ptr("myRg1"), - // WorkspaceSubscriptionID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }}, - // Severity: to.Ptr(armsecurity.AlertSeverityHigh), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.000Z"); return t}()), - // Status: to.Ptr(armsecurity.AlertStatusActive), - // SubTechniques: []*string{ - // to.Ptr("T1059.001"), - // to.Ptr("T1059.006"), - // to.Ptr("T1053.002")}, - // SupportingEvidence: &armsecurity.AlertPropertiesSupportingEvidence{ - // AdditionalProperties: map[string]any{ - // "columns": []any{ - // "Date", - // "Activity", - // "User", - // "TestedText", - // "TestedValue", - // }, - // "rows": []any{ - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser2", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser3", - // "true", - // true, - // }, - // }, - // "title": "Investigate activity test", - // }, - // Type: to.Ptr("tabularEvidences"), - // }, - // SystemAlertID: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Techniques: []*string{ - // to.Ptr("T1059"), - // to.Ptr("T1053"), - // to.Ptr("T1072")}, - // TimeGeneratedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.000Z"); return t}()), - // VendorName: to.Ptr("Microsoft"), - // Version: to.Ptr("2022-01-01"), - // }, - // }, - // { - // Name: to.Ptr("2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22"), - // Type: to.Ptr("Microsoft.Security/Locations/alerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg2/providers/Microsoft.Security/locations/westeurope/alerts/2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22"), - // Properties: &armsecurity.AlertProperties{ - // Description: to.Ptr("The process ‘c:\\users\\contosoUser\\scrsave.scr’ was observed executing from an uncommon location. Files with the .scr extensions are screen saver files and are normally reside and execute from the Windows system directory."), - // AlertDisplayName: to.Ptr("Suspicious Screensaver process executed"), - // AlertType: to.Ptr("VM_SuspiciousScreenSaver"), - // AlertURI: to.Ptr("https://portal.azure.com/#blade/Microsoft_Azure_Security/AlertBlade/alertId/2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a/subscriptionId/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroup/myRg1/referencedFrom/alertDeepLink/location/westeurope"), - // CompromisedEntity: to.Ptr("vm2"), - // CorrelationKey: to.Ptr("4hno6LF0xzCl5tqrk4nrBW+MY1BX816W6q6+0srk4"), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T13:51:45.004Z"); return t}()), - // Entities: []*armsecurity.AlertEntity{ - // { - // AdditionalProperties: map[string]any{ - // "OsVersion": nil, - // "azureID": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/myRg2/providers/microsoft.compute/virtualmachines/vm2", - // "dnsDomain": "", - // "hostName": "vm2", - // "netBiosName": "vm2", - // "ntDomain": "", - // "omsAgentID": "45b44640-3b94-4892-a28c-4a5cae27065a", - // "operatingSystem": "Unknown", - // }, - // Type: to.Ptr("host"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "name": "contosoUser", - // "logonId": "0x61450d87", - // "ntDomain": "vm2", - // "sid": "S-1-5-21-2144575486-8928446540-5163864319-500", - // }, - // Type: to.Ptr("account"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "name": "cmd.exe", - // "directory": "c:\\windows\\system32", - // }, - // Type: to.Ptr("file"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "processId": "0x3c44", - // }, - // Type: to.Ptr("process"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "name": "scrsave.scr", - // "directory": "c:\\users\\contosoUser", - // }, - // Type: to.Ptr("file"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "commandLine": "c:\\users\\contosoUser\\scrsave.scr", - // "creationTimeUtc": "2018-05-07T13:51:45.0045913Z", - // "processId": "0x4aec", - // }, - // Type: to.Ptr("process"), - // }}, - // ExtendedLinks: []map[string]*string{ - // map[string]*string{ - // "Category": to.Ptr("threat_reports"), - // "Href": to.Ptr("https://contoso.com/reports/DisplayReport"), - // "Label": to.Ptr("Report: RDP Brute Forcing"), - // "Type": to.Ptr("webLink"), - // }}, - // ExtendedProperties: map[string]*string{ - // "account logon id": to.Ptr("0x61450d87"), - // "command line": to.Ptr("c:\\users\\contosoUser\\scrsave.scr"), - // "domainName": to.Ptr("vm2"), - // "parent process": to.Ptr("cmd.exe"), - // "parent process id": to.Ptr("0x3c44"), - // "process id": to.Ptr("0x4aec"), - // "processName": to.Ptr("c:\\users\\contosoUser\\scrsave.scr"), - // "resourceType": to.Ptr("Virtual Machine"), - // "user SID": to.Ptr("S-1-5-21-2144575486-8928446540-5163864319-500"), - // "userName": to.Ptr("vm2\\contosoUser"), - // }, - // Intent: to.Ptr(armsecurity.IntentExecution), - // IsIncident: to.Ptr(true), - // ProcessingEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T13:51:48.981Z"); return t}()), - // ProductComponentName: to.Ptr("testName2"), - // ProductName: to.Ptr("Azure Security Center"), - // RemediationSteps: []*string{ - // to.Ptr("1. Run Process Explorer and try to identify unknown running processes (see https://technet.microsoft.com/en-us/sysinternals/bb896653.aspx)"), - // to.Ptr("2. Make sure the machine is completely updated and has an updated anti-malware application installed"), - // to.Ptr("3. Run a full anti-malware scan and verify that the threat was removed"), - // to.Ptr("4. Install and run Microsoft’s Malicious Software Removal Tool (see https://www.microsoft.com/en-us/download/malicious-software-removal-tool-details.aspx)"), - // to.Ptr("5. Run Microsoft’s Autoruns utility and try to identify unknown applications that are configured to run at login (see https://technet.microsoft.com/en-us/sysinternals/bb963902.aspx)"), - // to.Ptr("6. Escalate the alert to the information security team")}, - // ResourceIdentifiers: []armsecurity.ResourceIdentifierClassification{ - // &armsecurity.AzureResourceIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeAzureResource), - // AzureResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // &armsecurity.LogAnalyticsIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeLogAnalytics), - // AgentID: to.Ptr("75724a01-f021-4aa8-9ec2-329792373e6e"), - // WorkspaceID: to.Ptr("f419f624-acad-4d89-b86d-f62fa387f019"), - // WorkspaceResourceGroup: to.Ptr("myRg1"), - // WorkspaceSubscriptionID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }}, - // Severity: to.Ptr(armsecurity.AlertSeverityMedium), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T13:51:45.004Z"); return t}()), - // Status: to.Ptr(armsecurity.AlertStatusActive), - // SubTechniques: []*string{ - // to.Ptr("T1059.001"), - // to.Ptr("T1059.006"), - // to.Ptr("T1053.002")}, - // SupportingEvidence: &armsecurity.AlertPropertiesSupportingEvidence{ - // AdditionalProperties: map[string]any{ - // "supportingEvidenceList": []any{ - // map[string]any{ - // "type": "nestedList", - // "evidenceElements":[]any{ - // map[string]any{ - // "type": "evidenceElement", - // "innerElements": nil, - // "text":map[string]any{ - // "arguments":map[string]any{ - // "domainName":map[string]any{ - // "type": "string", - // "value": "domainName", - // }, - // "sensitiveEnumerationTypes":map[string]any{ - // "type": "string[]", - // "value":[]any{ - // "UseDesKey", - // }, - // }, - // }, - // "fallback": "Actor enumerated UseDesKey on domain1.test.local", - // "localizationKey": "AATP_ALERTS_LDAP_SENSITIVE_ATTRIBUTE_RECONNAISSANCE_SECURITY_ALERT_EVIDENCE_ENUMERATION_DETAIL_A7C00BD7", - // }, - // }, - // }, - // }, - // map[string]any{ - // "type": "tabularEvidences", - // "columns":[]any{ - // "Date", - // "Activity", - // "User", - // "TestedText", - // "TestedValue", - // }, - // "rows":[]any{ - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser2", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser3", - // "true", - // true, - // }, - // }, - // "title": "Investigate activity test", - // }, - // }, - // }, - // Type: to.Ptr("supportingEvidenceList"), - // }, - // SystemAlertID: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Techniques: []*string{ - // to.Ptr("T1059"), - // to.Ptr("T1053"), - // to.Ptr("T1072")}, - // TimeGeneratedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T13:51:48.381Z"); return t}()), - // VendorName: to.Ptr("Microsoft"), - // Version: to.Ptr("2022-01-01"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertsResourceGroupLocation_example.json -func ExampleAlertsClient_NewListResourceGroupLevelByRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAlertsClient().NewListResourceGroupLevelByRegionPager("westeurope", "myRg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AlertList = armsecurity.AlertList{ - // Value: []*armsecurity.Alert{ - // { - // Name: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Type: to.Ptr("Microsoft.Security/Locations/alerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/alerts/2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA"), - // Properties: &armsecurity.AlertProperties{ - // Description: to.Ptr("This is a test alert generated by Azure Security Center. No further action is needed."), - // AlertDisplayName: to.Ptr("Azure Security Center test alert (not a threat)"), - // AlertType: to.Ptr("VM_EICAR"), - // AlertURI: to.Ptr("https://portal.azure.com/#blade/Microsoft_Azure_Security/AlertBlade/alertId/2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a/subscriptionId/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroup/myRg1/referencedFrom/alertDeepLink/location/westeurope"), - // CompromisedEntity: to.Ptr("vm1"), - // CorrelationKey: to.Ptr("kso0LFWxzCll5tqrk5hmrBJ+MY1BX806W6q6+0s9Lk="), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.000Z"); return t}()), - // Entities: []*armsecurity.AlertEntity{ - // { - // AdditionalProperties: map[string]any{ - // "address": "192.0.2.1", - // "location": map[string]any{ - // "asn": float64(6584), - // "city": "sonning", - // "countryCode": "gb", - // "latitude": float64(51.468), - // "longitude": float64(-0.909), - // "state": "wokingham", - // }, - // }, - // Type: to.Ptr("ip"), - // }}, - // ExtendedLinks: []map[string]*string{ - // map[string]*string{ - // "Category": to.Ptr("threat_reports"), - // "Href": to.Ptr("https://contoso.com/reports/DisplayReport"), - // "Label": to.Ptr("Report: RDP Brute Forcing"), - // "Type": to.Ptr("webLink"), - // }}, - // ExtendedProperties: map[string]*string{ - // "Property1": to.Ptr("Property1 information"), - // }, - // Intent: to.Ptr(armsecurity.IntentExecution), - // IsIncident: to.Ptr(true), - // ProcessingEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.920Z"); return t}()), - // ProductComponentName: to.Ptr("testName"), - // ProductName: to.Ptr("Azure Security Center"), - // RemediationSteps: []*string{ - // to.Ptr("No further action is needed.")}, - // ResourceIdentifiers: []armsecurity.ResourceIdentifierClassification{ - // &armsecurity.AzureResourceIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeAzureResource), - // AzureResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // &armsecurity.LogAnalyticsIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeLogAnalytics), - // AgentID: to.Ptr("75724a01-f021-4aa8-9ec2-329792373e6e"), - // WorkspaceID: to.Ptr("f419f624-acad-4d89-b86d-f62fa387f019"), - // WorkspaceResourceGroup: to.Ptr("myRg1"), - // WorkspaceSubscriptionID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }}, - // Severity: to.Ptr(armsecurity.AlertSeverityHigh), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.000Z"); return t}()), - // Status: to.Ptr(armsecurity.AlertStatusActive), - // SubTechniques: []*string{ - // to.Ptr("T1059.001"), - // to.Ptr("T1059.006"), - // to.Ptr("T1053.002")}, - // SupportingEvidence: &armsecurity.AlertPropertiesSupportingEvidence{ - // AdditionalProperties: map[string]any{ - // "supportingEvidenceList": []any{ - // map[string]any{ - // "type": "nestedList", - // "evidenceElements":[]any{ - // map[string]any{ - // "type": "evidenceElement", - // "innerElements": nil, - // "text":map[string]any{ - // "arguments":map[string]any{ - // "domainName":map[string]any{ - // "type": "string", - // "value": "domainName", - // }, - // "sensitiveEnumerationTypes":map[string]any{ - // "type": "string[]", - // "value":[]any{ - // "UseDesKey", - // }, - // }, - // }, - // "fallback": "Actor enumerated UseDesKey on domain1.test.local", - // "localizationKey": "AATP_ALERTS_LDAP_SENSITIVE_ATTRIBUTE_RECONNAISSANCE_SECURITY_ALERT_EVIDENCE_ENUMERATION_DETAIL_A7C00BD7", - // }, - // }, - // }, - // }, - // map[string]any{ - // "type": "tabularEvidences", - // "columns":[]any{ - // "Date", - // "Activity", - // "User", - // "TestedText", - // "TestedValue", - // }, - // "rows":[]any{ - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser2", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser3", - // "true", - // true, - // }, - // }, - // "title": "Investigate activity test", - // }, - // }, - // }, - // Type: to.Ptr("supportingEvidenceList"), - // }, - // SystemAlertID: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Techniques: []*string{ - // to.Ptr("T1059"), - // to.Ptr("T1053"), - // to.Ptr("T1072")}, - // TimeGeneratedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.000Z"); return t}()), - // VendorName: to.Ptr("Microsoft"), - // Version: to.Ptr("2022-01-01"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertSubscriptionLocation_example.json -func ExampleAlertsClient_GetSubscriptionLevel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAlertsClient().GetSubscriptionLevel(ctx, "westeurope", "2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Alert = armsecurity.Alert{ - // Name: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Type: to.Ptr("Microsoft.Security/Locations/alerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/alerts/2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA"), - // Properties: &armsecurity.AlertProperties{ - // Description: to.Ptr("This is a test alert generated by Azure Security Center. No further action is needed."), - // AlertDisplayName: to.Ptr("Azure Security Center test alert (not a threat)"), - // AlertType: to.Ptr("VM_EICAR"), - // AlertURI: to.Ptr("https://portal.azure.com/#blade/Microsoft_Azure_Security/AlertBlade/alertId/2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a/subscriptionId/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroup/myRg1/referencedFrom/alertDeepLink/location/westeurope"), - // CompromisedEntity: to.Ptr("vm1"), - // CorrelationKey: to.Ptr("kso0LFWxzCll5tqrk5hmrBJ+MY1BX806W6q6+0s9Lk="), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.000Z"); return t}()), - // Entities: []*armsecurity.AlertEntity{ - // { - // AdditionalProperties: map[string]any{ - // "address": "192.0.2.1", - // "location": map[string]any{ - // "asn": float64(6584), - // "city": "sonning", - // "countryCode": "gb", - // "latitude": float64(51.468), - // "longitude": float64(-0.909), - // "state": "wokingham", - // }, - // }, - // Type: to.Ptr("ip"), - // }}, - // ExtendedLinks: []map[string]*string{ - // map[string]*string{ - // "Category": to.Ptr("threat_reports"), - // "Href": to.Ptr("https://contoso.com/reports/DisplayReport"), - // "Label": to.Ptr("Report: RDP Brute Forcing"), - // "Type": to.Ptr("webLink"), - // }}, - // ExtendedProperties: map[string]*string{ - // "Property1": to.Ptr("Property1 information"), - // }, - // Intent: to.Ptr(armsecurity.IntentExecution), - // IsIncident: to.Ptr(true), - // ProcessingEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.920Z"); return t}()), - // ProductComponentName: to.Ptr("testName"), - // ProductName: to.Ptr("Azure Security Center"), - // RemediationSteps: []*string{ - // to.Ptr("No further action is needed.")}, - // ResourceIdentifiers: []armsecurity.ResourceIdentifierClassification{ - // &armsecurity.AzureResourceIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeAzureResource), - // AzureResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // &armsecurity.LogAnalyticsIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeLogAnalytics), - // AgentID: to.Ptr("75724a01-f021-4aa8-9ec2-329792373e6e"), - // WorkspaceID: to.Ptr("f419f624-acad-4d89-b86d-f62fa387f019"), - // WorkspaceResourceGroup: to.Ptr("myRg1"), - // WorkspaceSubscriptionID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }}, - // Severity: to.Ptr(armsecurity.AlertSeverityHigh), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.000Z"); return t}()), - // Status: to.Ptr(armsecurity.AlertStatusActive), - // SubTechniques: []*string{ - // to.Ptr("T1059.001"), - // to.Ptr("T1059.006"), - // to.Ptr("T1053.002")}, - // SupportingEvidence: &armsecurity.AlertPropertiesSupportingEvidence{ - // AdditionalProperties: map[string]any{ - // "columns": []any{ - // "Date", - // "Activity", - // "User", - // "TestedText", - // "TestedValue", - // }, - // "rows": []any{ - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser2", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser3", - // "true", - // true, - // }, - // }, - // "title": "Investigate activity test", - // }, - // Type: to.Ptr("tabularEvidences"), - // }, - // SystemAlertID: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Techniques: []*string{ - // to.Ptr("T1059"), - // to.Ptr("T1053"), - // to.Ptr("T1072")}, - // TimeGeneratedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.000Z"); return t}()), - // VendorName: to.Ptr("Microsoft"), - // Version: to.Ptr("2022-01-01"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertResourceGroupLocation_example.json -func ExampleAlertsClient_GetResourceGroupLevel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAlertsClient().GetResourceGroupLevel(ctx, "myRg1", "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Alert = armsecurity.Alert{ - // Name: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Type: to.Ptr("Microsoft.Security/Locations/alerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/alerts/2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA"), - // Properties: &armsecurity.AlertProperties{ - // Description: to.Ptr("This is a test alert generated by Azure Security Center. No further action is needed."), - // AlertDisplayName: to.Ptr("Azure Security Center test alert (not a threat)"), - // AlertType: to.Ptr("VM_EICAR"), - // AlertURI: to.Ptr("https://portal.azure.com/#blade/Microsoft_Azure_Security/AlertBlade/alertId/2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a/subscriptionId/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroup/myRg1/referencedFrom/alertDeepLink/location/westeurope"), - // CompromisedEntity: to.Ptr("vm1"), - // CorrelationKey: to.Ptr("kso0LFWxzCll5tqrk5hmrBJ+MY1BX806W6q6+0s9Lk="), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.000Z"); return t}()), - // Entities: []*armsecurity.AlertEntity{ - // { - // AdditionalProperties: map[string]any{ - // "address": "192.0.2.1", - // "location": map[string]any{ - // "asn": float64(6584), - // "city": "sonning", - // "countryCode": "gb", - // "latitude": float64(51.468), - // "longitude": float64(-0.909), - // "state": "wokingham", - // }, - // }, - // Type: to.Ptr("ip"), - // }}, - // ExtendedLinks: []map[string]*string{ - // map[string]*string{ - // "Category": to.Ptr("threat_reports"), - // "Href": to.Ptr("https://contoso.com/reports/DisplayReport"), - // "Label": to.Ptr("Report: RDP Brute Forcing"), - // "Type": to.Ptr("webLink"), - // }}, - // ExtendedProperties: map[string]*string{ - // "Property1": to.Ptr("Property1 information"), - // }, - // Intent: to.Ptr(armsecurity.IntentExecution), - // IsIncident: to.Ptr(true), - // ProcessingEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.920Z"); return t}()), - // ProductComponentName: to.Ptr("testName"), - // ProductName: to.Ptr("Azure Security Center"), - // RemediationSteps: []*string{ - // to.Ptr("No further action is needed.")}, - // ResourceIdentifiers: []armsecurity.ResourceIdentifierClassification{ - // &armsecurity.AzureResourceIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeAzureResource), - // AzureResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // &armsecurity.LogAnalyticsIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeLogAnalytics), - // AgentID: to.Ptr("75724a01-f021-4aa8-9ec2-329792373e6e"), - // WorkspaceID: to.Ptr("f419f624-acad-4d89-b86d-f62fa387f019"), - // WorkspaceResourceGroup: to.Ptr("myRg1"), - // WorkspaceSubscriptionID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }}, - // Severity: to.Ptr(armsecurity.AlertSeverityHigh), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.000Z"); return t}()), - // Status: to.Ptr(armsecurity.AlertStatusActive), - // SubTechniques: []*string{ - // to.Ptr("T1059.001"), - // to.Ptr("T1059.006"), - // to.Ptr("T1053.002")}, - // SupportingEvidence: &armsecurity.AlertPropertiesSupportingEvidence{ - // AdditionalProperties: map[string]any{ - // "supportingEvidenceList": []any{ - // map[string]any{ - // "type": "nestedList", - // "evidenceElements":[]any{ - // map[string]any{ - // "type": "evidenceElement", - // "innerElements": nil, - // "text":map[string]any{ - // "arguments":map[string]any{ - // "domainName":map[string]any{ - // "type": "string", - // "value": "domainName", - // }, - // "sensitiveEnumerationTypes":map[string]any{ - // "type": "string[]", - // "value":[]any{ - // "UseDesKey", - // }, - // }, - // }, - // "fallback": "Actor enumerated UseDesKey on domain1.test.local", - // "localizationKey": "AATP_ALERTS_LDAP_SENSITIVE_ATTRIBUTE_RECONNAISSANCE_SECURITY_ALERT_EVIDENCE_ENUMERATION_DETAIL_A7C00BD7", - // }, - // }, - // }, - // }, - // map[string]any{ - // "type": "tabularEvidences", - // "columns":[]any{ - // "Date", - // "Activity", - // "User", - // "TestedText", - // "TestedValue", - // }, - // "rows":[]any{ - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser2", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser3", - // "true", - // true, - // }, - // }, - // "title": "Investigate activity test", - // }, - // }, - // }, - // Type: to.Ptr("supportingEvidenceList"), - // }, - // SystemAlertID: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Techniques: []*string{ - // to.Ptr("T1059"), - // to.Ptr("T1053"), - // to.Ptr("T1072")}, - // TimeGeneratedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.000Z"); return t}()), - // VendorName: to.Ptr("Microsoft"), - // Version: to.Ptr("2022-01-01"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_dismiss_example.json -func ExampleAlertsClient_UpdateSubscriptionLevelStateToDismiss() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAlertsClient().UpdateSubscriptionLevelStateToDismiss(ctx, "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_resolve_example.json -func ExampleAlertsClient_UpdateSubscriptionLevelStateToResolve() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAlertsClient().UpdateSubscriptionLevelStateToResolve(ctx, "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_activate_example.json -func ExampleAlertsClient_UpdateSubscriptionLevelStateToActivate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAlertsClient().UpdateSubscriptionLevelStateToActivate(ctx, "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_inProgress_example.json -func ExampleAlertsClient_UpdateSubscriptionLevelStateToInProgress() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAlertsClient().UpdateSubscriptionLevelStateToInProgress(ctx, "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_resolve_example.json -func ExampleAlertsClient_UpdateResourceGroupLevelStateToResolve() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAlertsClient().UpdateResourceGroupLevelStateToResolve(ctx, "myRg2", "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_dismiss_example.json -func ExampleAlertsClient_UpdateResourceGroupLevelStateToDismiss() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAlertsClient().UpdateResourceGroupLevelStateToDismiss(ctx, "myRg2", "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_activate_example.json -func ExampleAlertsClient_UpdateResourceGroupLevelStateToActivate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAlertsClient().UpdateResourceGroupLevelStateToActivate(ctx, "myRg2", "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_inProgress_example.json -func ExampleAlertsClient_UpdateResourceGroupLevelStateToInProgress() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAlertsClient().UpdateResourceGroupLevelStateToInProgress(ctx, "myRg2", "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/SimulateAlerts_example.json -func ExampleAlertsClient_BeginSimulate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAlertsClient().BeginSimulate(ctx, "centralus", armsecurity.AlertSimulatorRequestBody{ - Properties: &armsecurity.AlertSimulatorBundlesRequestProperties{ - Kind: to.Ptr(armsecurity.KindBundles), - Bundles: []*armsecurity.BundleType{ - to.Ptr(armsecurity.BundleTypeAppServices), - to.Ptr(armsecurity.BundleTypeDNS), - to.Ptr(armsecurity.BundleTypeKeyVaults), - to.Ptr(armsecurity.BundleTypeKubernetesService), - to.Ptr(armsecurity.BundleTypeResourceManager), - to.Ptr(armsecurity.BundleTypeSQLServers), - to.Ptr(armsecurity.BundleTypeStorageAccounts), - to.Ptr(armsecurity.BundleTypeVirtualMachines), - to.Ptr(armsecurity.BundleTypeCosmosDbs)}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/alertssuppressionrules_client.go b/sdk/resourcemanager/security/armsecurity/alertssuppressionrules_client.go index 478faa61daa1..27445c434c44 100644 --- a/sdk/resourcemanager/security/armsecurity/alertssuppressionrules_client.go +++ b/sdk/resourcemanager/security/armsecurity/alertssuppressionrules_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -72,7 +69,7 @@ func (client *AlertsSuppressionRulesClient) Delete(ctx context.Context, alertsSu } // deleteCreateRequest creates the Delete request. -func (client *AlertsSuppressionRulesClient) deleteCreateRequest(ctx context.Context, alertsSuppressionRuleName string, options *AlertsSuppressionRulesClientDeleteOptions) (*policy.Request, error) { +func (client *AlertsSuppressionRulesClient) deleteCreateRequest(ctx context.Context, alertsSuppressionRuleName string, _ *AlertsSuppressionRulesClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -123,7 +120,7 @@ func (client *AlertsSuppressionRulesClient) Get(ctx context.Context, alertsSuppr } // getCreateRequest creates the Get request. -func (client *AlertsSuppressionRulesClient) getCreateRequest(ctx context.Context, alertsSuppressionRuleName string, options *AlertsSuppressionRulesClientGetOptions) (*policy.Request, error) { +func (client *AlertsSuppressionRulesClient) getCreateRequest(ctx context.Context, alertsSuppressionRuleName string, _ *AlertsSuppressionRulesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -242,7 +239,7 @@ func (client *AlertsSuppressionRulesClient) Update(ctx context.Context, alertsSu } // updateCreateRequest creates the Update request. -func (client *AlertsSuppressionRulesClient) updateCreateRequest(ctx context.Context, alertsSuppressionRuleName string, alertsSuppressionRule AlertsSuppressionRule, options *AlertsSuppressionRulesClientUpdateOptions) (*policy.Request, error) { +func (client *AlertsSuppressionRulesClient) updateCreateRequest(ctx context.Context, alertsSuppressionRuleName string, alertsSuppressionRule AlertsSuppressionRule, _ *AlertsSuppressionRulesClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 c61df7bebd86..000000000000 --- a/sdk/resourcemanager/security/armsecurity/alertssuppressionrules_client_example_test.go +++ /dev/null @@ -1,296 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRulesWithAlertType_example.json -func ExampleAlertsSuppressionRulesClient_NewListPager_getSuppressionAlertRuleForSubscriptionFilteredByAlertType() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAlertsSuppressionRulesClient().NewListPager(&armsecurity.AlertsSuppressionRulesClientListOptions{AlertType: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AlertsSuppressionRulesList = armsecurity.AlertsSuppressionRulesList{ - // Value: []*armsecurity.AlertsSuppressionRule{ - // { - // Name: to.Ptr("dismissIpAnomalyAlerts"), - // Type: to.Ptr("Microsoft.Security/alertsSuppressionRules"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/alertsSuppressionRules/dismissIpAnomalyAlerts"), - // Properties: &armsecurity.AlertsSuppressionRuleProperties{ - // AlertType: to.Ptr("IpAnomaly"), - // Comment: to.Ptr("Test VM"), - // ExpirationDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T19:50:47.083Z"); return t}()), - // LastModifiedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-31T19:50:47.083Z"); return t}()), - // Reason: to.Ptr("FalsePositive"), - // State: to.Ptr(armsecurity.RuleStateEnabled), - // SuppressionAlertsScope: &armsecurity.SuppressionAlertsScope{ - // AllOf: []*armsecurity.ScopeElement{ - // { - // AdditionalProperties: map[string]any{ - // "in": []any{ - // "104.215.95.187", - // "52.164.206.56", - // }, - // }, - // Field: to.Ptr("entities.ip.address"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "contains": "POWERSHELL.EXE", - // }, - // Field: to.Ptr("entities.process.commandline"), - // }}, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRules_example.json -func ExampleAlertsSuppressionRulesClient_NewListPager_getSuppressionRulesForSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAlertsSuppressionRulesClient().NewListPager(&armsecurity.AlertsSuppressionRulesClientListOptions{AlertType: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AlertsSuppressionRulesList = armsecurity.AlertsSuppressionRulesList{ - // Value: []*armsecurity.AlertsSuppressionRule{ - // { - // Name: to.Ptr("dismissIpAnomalyAlerts"), - // Type: to.Ptr("Microsoft.Security/alertsSuppressionRules"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/alertsSuppressionRules/dismissIpAnomalyAlerts"), - // Properties: &armsecurity.AlertsSuppressionRuleProperties{ - // AlertType: to.Ptr("IpAnomaly"), - // Comment: to.Ptr("Test VM"), - // ExpirationDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T19:50:47.083Z"); return t}()), - // LastModifiedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-31T19:50:47.083Z"); return t}()), - // Reason: to.Ptr("FalsePositive"), - // State: to.Ptr(armsecurity.RuleStateEnabled), - // SuppressionAlertsScope: &armsecurity.SuppressionAlertsScope{ - // AllOf: []*armsecurity.ScopeElement{ - // { - // AdditionalProperties: map[string]any{ - // "in": []any{ - // "104.215.95.187", - // "52.164.206.56", - // }, - // }, - // Field: to.Ptr("entities.ip.address"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "contains": "POWERSHELL.EXE", - // }, - // Field: to.Ptr("entities.process.commandline"), - // }}, - // }, - // }, - // }, - // { - // Name: to.Ptr("dismissDataExfiltrationAnomalyAlertsOnTestVMs"), - // Type: to.Ptr("Microsoft.Security/alertsSuppressionRules"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/alertsSuppressionRules/dismissDataExfiltrationAnomalyAlertsOnTestVMs"), - // Properties: &armsecurity.AlertsSuppressionRuleProperties{ - // AlertType: to.Ptr("DataExfiltrationAnomaly"), - // ExpirationDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T19:50:47.083Z"); return t}()), - // LastModifiedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-31T19:50:47.083Z"); return t}()), - // Reason: to.Ptr("FalsePositive"), - // State: to.Ptr(armsecurity.RuleStateEnabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRule_example.json -func ExampleAlertsSuppressionRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAlertsSuppressionRulesClient().Get(ctx, "dismissIpAnomalyAlerts", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AlertsSuppressionRule = armsecurity.AlertsSuppressionRule{ - // Name: to.Ptr("dismissIpAnomalyAlerts"), - // Type: to.Ptr("Microsoft.Security/alertsSuppressionRules"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/alertsSuppressionRules/dismissIpAnomalyAlerts"), - // Properties: &armsecurity.AlertsSuppressionRuleProperties{ - // AlertType: to.Ptr("IpAnomaly"), - // Comment: to.Ptr("Test VM"), - // ExpirationDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T19:50:47.083Z"); return t}()), - // LastModifiedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-31T19:50:47.083Z"); return t}()), - // Reason: to.Ptr("FalsePositive"), - // State: to.Ptr(armsecurity.RuleStateEnabled), - // SuppressionAlertsScope: &armsecurity.SuppressionAlertsScope{ - // AllOf: []*armsecurity.ScopeElement{ - // { - // AdditionalProperties: map[string]any{ - // "in": []any{ - // "104.215.95.187", - // "52.164.206.56", - // }, - // }, - // Field: to.Ptr("entities.ip.address"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "contains": "POWERSHELL.EXE", - // }, - // Field: to.Ptr("entities.process.commandline"), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/PutAlertsSuppressionRule_example.json -func ExampleAlertsSuppressionRulesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAlertsSuppressionRulesClient().Update(ctx, "dismissIpAnomalyAlerts", armsecurity.AlertsSuppressionRule{ - Properties: &armsecurity.AlertsSuppressionRuleProperties{ - AlertType: to.Ptr("IpAnomaly"), - Comment: to.Ptr("Test VM"), - ExpirationDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T19:50:47.083Z"); return t }()), - Reason: to.Ptr("FalsePositive"), - State: to.Ptr(armsecurity.RuleStateEnabled), - SuppressionAlertsScope: &armsecurity.SuppressionAlertsScope{ - AllOf: []*armsecurity.ScopeElement{ - { - AdditionalProperties: map[string]any{ - "in": []any{ - "104.215.95.187", - "52.164.206.56", - }, - }, - Field: to.Ptr("entities.ip.address"), - }, - { - AdditionalProperties: map[string]any{ - "contains": "POWERSHELL.EXE", - }, - Field: to.Ptr("entities.process.commandline"), - }}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AlertsSuppressionRule = armsecurity.AlertsSuppressionRule{ - // Name: to.Ptr("dismissIpAnomalyAlerts"), - // Type: to.Ptr("Microsoft.Security/alertsSuppressionRules"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/alertsSuppressionRules/dismissIpAnomalyAlerts"), - // Properties: &armsecurity.AlertsSuppressionRuleProperties{ - // AlertType: to.Ptr("IpAnomaly"), - // Comment: to.Ptr("Test VM"), - // ExpirationDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T19:50:47.083Z"); return t}()), - // LastModifiedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-31T19:50:47.083Z"); return t}()), - // Reason: to.Ptr("FalsePositive"), - // State: to.Ptr(armsecurity.RuleStateEnabled), - // SuppressionAlertsScope: &armsecurity.SuppressionAlertsScope{ - // AllOf: []*armsecurity.ScopeElement{ - // { - // AdditionalProperties: map[string]any{ - // "in": []any{ - // "104.215.95.187", - // "52.164.206.56", - // }, - // }, - // Field: to.Ptr("entities.ip.address"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "contains": "POWERSHELL.EXE", - // }, - // Field: to.Ptr("entities.process.commandline"), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/DeleteAlertsSuppressionRule_example.json -func ExampleAlertsSuppressionRulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAlertsSuppressionRulesClient().Delete(ctx, "dismissIpAnomalyAlerts", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/allowedconnections_client.go b/sdk/resourcemanager/security/armsecurity/allowedconnections_client.go index e8a5dfa34664..429e669384ed 100644 --- a/sdk/resourcemanager/security/armsecurity/allowedconnections_client.go +++ b/sdk/resourcemanager/security/armsecurity/allowedconnections_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -74,7 +71,7 @@ func (client *AllowedConnectionsClient) Get(ctx context.Context, resourceGroupNa } // getCreateRequest creates the Get request. -func (client *AllowedConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, connectionType ConnectionType, options *AllowedConnectionsClientGetOptions) (*policy.Request, error) { +func (client *AllowedConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, connectionType ConnectionType, _ *AllowedConnectionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections/{connectionType}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -141,7 +138,7 @@ func (client *AllowedConnectionsClient) NewListPager(options *AllowedConnections } // listCreateRequest creates the List request. -func (client *AllowedConnectionsClient) listCreateRequest(ctx context.Context, options *AllowedConnectionsClientListOptions) (*policy.Request, error) { +func (client *AllowedConnectionsClient) listCreateRequest(ctx context.Context, _ *AllowedConnectionsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/allowedConnections" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -197,7 +194,7 @@ func (client *AllowedConnectionsClient) NewListByHomeRegionPager(ascLocation str } // listByHomeRegionCreateRequest creates the ListByHomeRegion request. -func (client *AllowedConnectionsClient) listByHomeRegionCreateRequest(ctx context.Context, ascLocation string, options *AllowedConnectionsClientListByHomeRegionOptions) (*policy.Request, error) { +func (client *AllowedConnectionsClient) listByHomeRegionCreateRequest(ctx context.Context, ascLocation string, _ *AllowedConnectionsClientListByHomeRegionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/allowedConnections" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 6e42bc216fb7..000000000000 --- a/sdk/resourcemanager/security/armsecurity/allowedconnections_client_example_test.go +++ /dev/null @@ -1,235 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/GetAllowedConnectionsSubscription_example.json -func ExampleAllowedConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAllowedConnectionsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AllowedConnectionsList = armsecurity.AllowedConnectionsList{ - // Value: []*armsecurity.AllowedConnectionsResource{ - // { - // Location: to.Ptr("centralus"), - // Name: to.Ptr("Internal"), - // Type: to.Ptr("Microsoft.Security/locations/allowedConnections"), - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Security/locations/centralus/allowedConnections/Internal"), - // Properties: &armsecurity.AllowedConnectionsResourceProperties{ - // CalculatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-06T14:55:32.351Z"); return t}()), - // ConnectableResources: []*armsecurity.ConnectableResource{ - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // }, - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // }, - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine3"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // }, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // }, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/GetAllowedConnectionsSubscriptionLocation_example.json -func ExampleAllowedConnectionsClient_NewListByHomeRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAllowedConnectionsClient().NewListByHomeRegionPager("centralus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AllowedConnectionsList = armsecurity.AllowedConnectionsList{ - // Value: []*armsecurity.AllowedConnectionsResource{ - // { - // Location: to.Ptr("centralus"), - // Name: to.Ptr("Internal"), - // Type: to.Ptr("Microsoft.Security/locations/allowedConnections"), - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Security/locations/centralus/allowedConnections/Internal"), - // Properties: &armsecurity.AllowedConnectionsResourceProperties{ - // CalculatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-06T14:55:32.351Z"); return t}()), - // ConnectableResources: []*armsecurity.ConnectableResource{ - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // }, - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // }, - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine3"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // }, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // }, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/GetAllowedConnections_example.json -func ExampleAllowedConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAllowedConnectionsClient().Get(ctx, "myResourceGroup", "centralus", armsecurity.ConnectionTypeInternal, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AllowedConnectionsResource = armsecurity.AllowedConnectionsResource{ - // Location: to.Ptr("centralus"), - // Name: to.Ptr("Internal"), - // Type: to.Ptr("Microsoft.Security/locations/allowedConnections"), - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Security/locations/centralus/allowedConnections/Internal"), - // Properties: &armsecurity.AllowedConnectionsResourceProperties{ - // CalculatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-06T14:55:32.351Z"); return t}()), - // ConnectableResources: []*armsecurity.ConnectableResource{ - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // }, - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // }, - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine3"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // }, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // }, - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/apicollections_client.go b/sdk/resourcemanager/security/armsecurity/apicollections_client.go index dc063450326f..5496b1c955dc 100644 --- a/sdk/resourcemanager/security/armsecurity/apicollections_client.go +++ b/sdk/resourcemanager/security/armsecurity/apicollections_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -78,7 +75,7 @@ func (client *APICollectionsClient) GetByAzureAPIManagementService(ctx context.C } // getByAzureAPIManagementServiceCreateRequest creates the GetByAzureAPIManagementService request. -func (client *APICollectionsClient) getByAzureAPIManagementServiceCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APICollectionsClientGetByAzureAPIManagementServiceOptions) (*policy.Request, error) { +func (client *APICollectionsClient) getByAzureAPIManagementServiceCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, _ *APICollectionsClientGetByAzureAPIManagementServiceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -150,7 +147,7 @@ func (client *APICollectionsClient) NewListByAzureAPIManagementServicePager(reso } // listByAzureAPIManagementServiceCreateRequest creates the ListByAzureAPIManagementService request. -func (client *APICollectionsClient) listByAzureAPIManagementServiceCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *APICollectionsClientListByAzureAPIManagementServiceOptions) (*policy.Request, error) { +func (client *APICollectionsClient) listByAzureAPIManagementServiceCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, _ *APICollectionsClientListByAzureAPIManagementServiceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -215,7 +212,7 @@ func (client *APICollectionsClient) NewListByResourceGroupPager(resourceGroupNam } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *APICollectionsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *APICollectionsClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *APICollectionsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *APICollectionsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/apiCollections" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -275,7 +272,7 @@ func (client *APICollectionsClient) NewListBySubscriptionPager(options *APIColle } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *APICollectionsClient) listBySubscriptionCreateRequest(ctx context.Context, options *APICollectionsClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *APICollectionsClient) listBySubscriptionCreateRequest(ctx context.Context, _ *APICollectionsClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/apiCollections" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -334,7 +331,7 @@ func (client *APICollectionsClient) OffboardAzureAPIManagementAPI(ctx context.Co } // offboardAzureAPIManagementAPICreateRequest creates the OffboardAzureAPIManagementAPI request. -func (client *APICollectionsClient) offboardAzureAPIManagementAPICreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APICollectionsClientOffboardAzureAPIManagementAPIOptions) (*policy.Request, error) { +func (client *APICollectionsClient) offboardAzureAPIManagementAPICreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, _ *APICollectionsClientOffboardAzureAPIManagementAPIOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -421,7 +418,7 @@ func (client *APICollectionsClient) onboardAzureAPIManagementAPI(ctx context.Con } // onboardAzureAPIManagementAPICreateRequest creates the OnboardAzureAPIManagementAPI request. -func (client *APICollectionsClient) onboardAzureAPIManagementAPICreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APICollectionsClientBeginOnboardAzureAPIManagementAPIOptions) (*policy.Request, error) { +func (client *APICollectionsClient) onboardAzureAPIManagementAPICreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, _ *APICollectionsClientBeginOnboardAzureAPIManagementAPIOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") diff --git a/sdk/resourcemanager/security/armsecurity/apicollections_client_example_test.go b/sdk/resourcemanager/security/armsecurity/apicollections_client_example_test.go deleted file mode 100644 index 62799527aeb9..000000000000 --- a/sdk/resourcemanager/security/armsecurity/apicollections_client_example_test.go +++ /dev/null @@ -1,248 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/examples/ApiCollections/APICollections_ListBySubscription_example.json -func ExampleAPICollectionsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAPICollectionsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.APICollectionList = armsecurity.APICollectionList{ - // Value: []*armsecurity.APICollection{ - // { - // Name: to.Ptr("echo-api"), - // Type: to.Ptr("Microsoft.Security/apiCollections"), - // ID: to.Ptr("/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/providers/Microsoft.Security/apiCollections/echo-api"), - // Properties: &armsecurity.APICollectionProperties{ - // BaseURL: to.Ptr("https://apimservice1.azure-api.net/echo"), - // DiscoveredVia: to.Ptr("/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"), - // DisplayName: to.Ptr("Echo API"), - // NumberOfAPIEndpoints: to.Ptr[int64](6), - // NumberOfAPIEndpointsWithSensitiveDataExposed: to.Ptr[int64](1), - // NumberOfExternalAPIEndpoints: to.Ptr[int64](3), - // NumberOfInactiveAPIEndpoints: to.Ptr[int64](3), - // NumberOfUnauthenticatedAPIEndpoints: to.Ptr[int64](1), - // ProvisioningState: to.Ptr(armsecurity.ProvisioningStateSucceeded), - // SensitivityLabel: to.Ptr("Highly Confidential"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/examples/ApiCollections/APICollections_ListByResourceGroup_example.json -func ExampleAPICollectionsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAPICollectionsClient().NewListByResourceGroupPager("rg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.APICollectionList = armsecurity.APICollectionList{ - // Value: []*armsecurity.APICollection{ - // { - // Name: to.Ptr("echo-api"), - // Type: to.Ptr("Microsoft.Security/apiCollections"), - // ID: to.Ptr("/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/providers/Microsoft.Security/apiCollections/echo-api"), - // Properties: &armsecurity.APICollectionProperties{ - // BaseURL: to.Ptr("https://apimservice1.azure-api.net/echo"), - // DiscoveredVia: to.Ptr("/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"), - // DisplayName: to.Ptr("Echo API"), - // NumberOfAPIEndpoints: to.Ptr[int64](6), - // NumberOfAPIEndpointsWithSensitiveDataExposed: to.Ptr[int64](1), - // NumberOfExternalAPIEndpoints: to.Ptr[int64](3), - // NumberOfInactiveAPIEndpoints: to.Ptr[int64](3), - // NumberOfUnauthenticatedAPIEndpoints: to.Ptr[int64](1), - // ProvisioningState: to.Ptr(armsecurity.ProvisioningStateSucceeded), - // SensitivityLabel: to.Ptr("Highly Confidential"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/examples/ApiCollections/APICollections_ListByAzureApiManagementService_example.json -func ExampleAPICollectionsClient_NewListByAzureAPIManagementServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAPICollectionsClient().NewListByAzureAPIManagementServicePager("rg1", "apimService1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.APICollectionList = armsecurity.APICollectionList{ - // Value: []*armsecurity.APICollection{ - // { - // Name: to.Ptr("echo-api"), - // Type: to.Ptr("Microsoft.Security/apiCollections"), - // ID: to.Ptr("/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/providers/Microsoft.Security/apiCollections/echo-api"), - // Properties: &armsecurity.APICollectionProperties{ - // BaseURL: to.Ptr("https://apimservice1.azure-api.net/echo"), - // DiscoveredVia: to.Ptr("/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"), - // DisplayName: to.Ptr("Echo API"), - // NumberOfAPIEndpoints: to.Ptr[int64](6), - // NumberOfAPIEndpointsWithSensitiveDataExposed: to.Ptr[int64](1), - // NumberOfExternalAPIEndpoints: to.Ptr[int64](3), - // NumberOfInactiveAPIEndpoints: to.Ptr[int64](3), - // NumberOfUnauthenticatedAPIEndpoints: to.Ptr[int64](1), - // ProvisioningState: to.Ptr(armsecurity.ProvisioningStateSucceeded), - // SensitivityLabel: to.Ptr("Highly Confidential"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/examples/ApiCollections/APICollections_GetByAzureApiManagementService_example.json -func ExampleAPICollectionsClient_GetByAzureAPIManagementService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAPICollectionsClient().GetByAzureAPIManagementService(ctx, "rg1", "apimService1", "echo-api", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.APICollection = armsecurity.APICollection{ - // Name: to.Ptr("echo-api"), - // Type: to.Ptr("Microsoft.Security/apiCollections"), - // ID: to.Ptr("/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/providers/Microsoft.Security/apiCollections/echo-api"), - // Properties: &armsecurity.APICollectionProperties{ - // BaseURL: to.Ptr("https://apimservice1.azure-api.net/echo"), - // DiscoveredVia: to.Ptr("/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"), - // DisplayName: to.Ptr("Echo API"), - // NumberOfAPIEndpoints: to.Ptr[int64](6), - // NumberOfAPIEndpointsWithSensitiveDataExposed: to.Ptr[int64](1), - // NumberOfExternalAPIEndpoints: to.Ptr[int64](3), - // NumberOfInactiveAPIEndpoints: to.Ptr[int64](3), - // NumberOfUnauthenticatedAPIEndpoints: to.Ptr[int64](1), - // ProvisioningState: to.Ptr(armsecurity.ProvisioningStateSucceeded), - // SensitivityLabel: to.Ptr("Highly Confidential"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/examples/ApiCollections/APICollections_OnboardAzureApiManagementApi_example.json -func ExampleAPICollectionsClient_BeginOnboardAzureAPIManagementAPI() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAPICollectionsClient().BeginOnboardAzureAPIManagementAPI(ctx, "rg1", "apimService1", "echo-api", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.APICollection = armsecurity.APICollection{ - // Name: to.Ptr("echo-api"), - // Type: to.Ptr("Microsoft.Security/apiCollections"), - // ID: to.Ptr("/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/providers/Microsoft.Security/apiCollections/echo-api"), - // Properties: &armsecurity.APICollectionProperties{ - // BaseURL: to.Ptr("https://apimservice1.azure-api.net/echo"), - // DiscoveredVia: to.Ptr("/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1"), - // DisplayName: to.Ptr("Echo API"), - // NumberOfAPIEndpoints: to.Ptr[int64](6), - // NumberOfAPIEndpointsWithSensitiveDataExposed: to.Ptr[int64](1), - // NumberOfExternalAPIEndpoints: to.Ptr[int64](3), - // NumberOfInactiveAPIEndpoints: to.Ptr[int64](3), - // NumberOfUnauthenticatedAPIEndpoints: to.Ptr[int64](1), - // ProvisioningState: to.Ptr(armsecurity.ProvisioningStateSucceeded), - // SensitivityLabel: to.Ptr("Highly Confidential"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2023-11-15/examples/ApiCollections/APICollections_OffboardAzureApiManagementApi_example.json -func ExampleAPICollectionsClient_OffboardAzureAPIManagementAPI() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAPICollectionsClient().OffboardAzureAPIManagementAPI(ctx, "rg1", "apimService1", "echo-api", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/application_client.go b/sdk/resourcemanager/security/armsecurity/application_client.go index 39255287bbe5..c16bb326c3e4 100644 --- a/sdk/resourcemanager/security/armsecurity/application_client.go +++ b/sdk/resourcemanager/security/armsecurity/application_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -74,7 +71,7 @@ func (client *ApplicationClient) CreateOrUpdate(ctx context.Context, application } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ApplicationClient) createOrUpdateCreateRequest(ctx context.Context, applicationID string, application Application, options *ApplicationClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ApplicationClient) createOrUpdateCreateRequest(ctx context.Context, applicationID string, application Application, _ *ApplicationClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -135,7 +132,7 @@ func (client *ApplicationClient) Delete(ctx context.Context, applicationID strin } // deleteCreateRequest creates the Delete request. -func (client *ApplicationClient) deleteCreateRequest(ctx context.Context, applicationID string, options *ApplicationClientDeleteOptions) (*policy.Request, error) { +func (client *ApplicationClient) deleteCreateRequest(ctx context.Context, applicationID string, _ *ApplicationClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -184,7 +181,7 @@ func (client *ApplicationClient) Get(ctx context.Context, applicationID string, } // getCreateRequest creates the Get request. -func (client *ApplicationClient) getCreateRequest(ctx context.Context, applicationID string, options *ApplicationClientGetOptions) (*policy.Request, error) { +func (client *ApplicationClient) getCreateRequest(ctx context.Context, applicationID string, _ *ApplicationClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications/{applicationId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 4bb74e526f85..000000000000 --- a/sdk/resourcemanager/security/armsecurity/application_client_example_test.go +++ /dev/null @@ -1,132 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/GetApplication_example.json -func ExampleApplicationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationClient().Get(ctx, "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Application = armsecurity.Application{ - // Name: to.Ptr("ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Type: to.Ptr("Microsoft.Security/applications"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/applications/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.ApplicationProperties{ - // Description: to.Ptr("An application on critical recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "contains", - // "property": "$.Id", - // "value": "-bil-", - // }, - // }, - // }}, - // DisplayName: to.Ptr("Admin's application"), - // SourceResourceType: to.Ptr(armsecurity.ApplicationSourceResourceTypeAssessments), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/PutApplication_example.json -func ExampleApplicationClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewApplicationClient().CreateOrUpdate(ctx, "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", armsecurity.Application{ - Properties: &armsecurity.ApplicationProperties{ - Description: to.Ptr("An application on critical recommendations"), - ConditionSets: []any{ - map[string]any{ - "conditions": []any{ - map[string]any{ - "operator": "contains", - "property": "$.Id", - "value": "-bil-", - }, - }, - }}, - DisplayName: to.Ptr("Admin's application"), - SourceResourceType: to.Ptr(armsecurity.ApplicationSourceResourceTypeAssessments), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Application = armsecurity.Application{ - // Name: to.Ptr("1f3afdf9-d0c9-4c3d-847f-89da613e70a8"), - // Type: to.Ptr("Microsoft.Security/applications"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/applications/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.ApplicationProperties{ - // Description: to.Ptr("An application on critical recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "contains", - // "property": "$.Id", - // "value": "-dev-", - // }, - // }, - // }}, - // DisplayName: to.Ptr("Admin's application"), - // SourceResourceType: to.Ptr(armsecurity.ApplicationSourceResourceTypeAssessments), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/DeleteApplication_example.json -func ExampleApplicationClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewApplicationClient().Delete(ctx, "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/applications_client.go b/sdk/resourcemanager/security/armsecurity/applications_client.go index 73f3c8418b4d..9aad56a119c2 100644 --- a/sdk/resourcemanager/security/armsecurity/applications_client.go +++ b/sdk/resourcemanager/security/armsecurity/applications_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -71,7 +68,7 @@ func (client *ApplicationsClient) NewListPager(options *ApplicationsClientListOp } // listCreateRequest creates the List request. -func (client *ApplicationsClient) listCreateRequest(ctx context.Context, options *ApplicationsClientListOptions) (*policy.Request, error) { +func (client *ApplicationsClient) listCreateRequest(ctx context.Context, _ *ApplicationsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/applications" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 1e76532c1ee2..000000000000 --- a/sdk/resourcemanager/security/armsecurity/applications_client_example_test.go +++ /dev/null @@ -1,86 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ListBySubscriptionApplications_example.json -func ExampleApplicationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewApplicationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ApplicationsList = armsecurity.ApplicationsList{ - // Value: []*armsecurity.Application{ - // { - // Name: to.Ptr("ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Type: to.Ptr("Microsoft.Security/applications"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/applications/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.ApplicationProperties{ - // Description: to.Ptr("An application on critical recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "contains", - // "property": "$.Id", - // "value": "-bil-", - // }, - // }, - // }}, - // DisplayName: to.Ptr("Admin's application"), - // SourceResourceType: to.Ptr(armsecurity.ApplicationSourceResourceTypeAssessments), - // }, - // }, - // { - // Name: to.Ptr("4106f43c-6d82-4fc8-a92c-dcfe50799d1d"), - // Type: to.Ptr("Microsoft.Security/applications"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/applications/4106f43c-6d82-4fc8-a92c-dcfe50799d1d"), - // Properties: &armsecurity.ApplicationProperties{ - // Description: to.Ptr("An application on critical recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "contains", - // "property": "$.Id", - // "value": "-prod-", - // }, - // }, - // }}, - // DisplayName: to.Ptr("Admin's application"), - // SourceResourceType: to.Ptr(armsecurity.ApplicationSourceResourceTypeAssessments), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/assessments_client.go b/sdk/resourcemanager/security/armsecurity/assessments_client.go index 740ee2b00d1e..9b037a3d2b1d 100644 --- a/sdk/resourcemanager/security/armsecurity/assessments_client.go +++ b/sdk/resourcemanager/security/armsecurity/assessments_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -73,7 +70,7 @@ func (client *AssessmentsClient) CreateOrUpdate(ctx context.Context, resourceID } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AssessmentsClient) createOrUpdateCreateRequest(ctx context.Context, resourceID string, assessmentName string, assessment Assessment, options *AssessmentsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *AssessmentsClient) createOrUpdateCreateRequest(ctx context.Context, resourceID string, assessmentName string, assessment Assessment, _ *AssessmentsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}" urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID) if assessmentName == "" { @@ -133,7 +130,7 @@ func (client *AssessmentsClient) Delete(ctx context.Context, resourceID string, } // deleteCreateRequest creates the Delete request. -func (client *AssessmentsClient) deleteCreateRequest(ctx context.Context, resourceID string, assessmentName string, options *AssessmentsClientDeleteOptions) (*policy.Request, error) { +func (client *AssessmentsClient) deleteCreateRequest(ctx context.Context, resourceID string, assessmentName string, _ *AssessmentsClientDeleteOptions) (*policy.Request, error) { urlPath := "/{resourceId}/providers/Microsoft.Security/assessments/{assessmentName}" urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID) if assessmentName == "" { @@ -241,7 +238,7 @@ func (client *AssessmentsClient) NewListPager(scope string, options *Assessments } // listCreateRequest creates the List request. -func (client *AssessmentsClient) listCreateRequest(ctx context.Context, scope string, options *AssessmentsClientListOptions) (*policy.Request, error) { +func (client *AssessmentsClient) listCreateRequest(ctx context.Context, scope string, _ *AssessmentsClientListOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/assessments" urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) 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 280f41610951..000000000000 --- a/sdk/resourcemanager/security/armsecurity/assessments_client_example_test.go +++ /dev/null @@ -1,234 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/ListAssessments_example.json -func ExampleAssessmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAssessmentsClient().NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AssessmentList = armsecurity.AssessmentList{ - // Value: []*armsecurity.AssessmentResponse{ - // { - // Name: to.Ptr("21300918-b2e3-0346-785f-c77ff57d243b"), - // Type: to.Ptr("Microsoft.Security/assessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/providers/Microsoft.Security/assessments/21300918-b2e3-0346-785f-c77ff57d243b"), - // Properties: &armsecurity.AssessmentPropertiesResponse{ - // DisplayName: to.Ptr("Install endpoint protection solution on virtual machine scale sets"), - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1"), - // }, - // Status: &armsecurity.AssessmentStatusResponse{ - // Code: to.Ptr(armsecurity.AssessmentStatusCodeHealthy), - // FirstEvaluationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-12T09:07:18.675Z"); return t}()), - // StatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-12T09:07:18.675Z"); return t}()), - // }, - // }, - // }, - // { - // Name: to.Ptr("21300918-b2e3-0346-785f-c77ff57d243b"), - // Type: to.Ptr("Microsoft.Security/assessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2/providers/Microsoft.Security/assessments/21300918-b2e3-0346-785f-c77ff57d243b"), - // Properties: &armsecurity.AssessmentPropertiesResponse{ - // AdditionalData: map[string]*string{ - // "linkedWorkspaceId": to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myLaWorkspace"), - // }, - // DisplayName: to.Ptr("Install endpoint protection solution on virtual machine scale sets"), - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2"), - // }, - // Status: &armsecurity.AssessmentStatusResponse{ - // Description: to.Ptr("The effective policy for the assessment was evaluated to off - use Microsoft.Authorization/policyAssignments to turn this assessment on"), - // Cause: to.Ptr("OffByPolicy"), - // Code: to.Ptr(armsecurity.AssessmentStatusCodeNotApplicable), - // FirstEvaluationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-12T09:07:18.675Z"); return t}()), - // StatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-12T09:07:18.675Z"); return t}()), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/GetAssessment_example.json -func ExampleAssessmentsClient_Get_getSecurityRecommendationTaskFromSecurityDataLocation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAssessmentsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", "21300918-b2e3-0346-785f-c77ff57d243b", &armsecurity.AssessmentsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AssessmentResponse = armsecurity.AssessmentResponse{ - // Name: to.Ptr("21300918-b2e3-0346-785f-c77ff57d243b"), - // Type: to.Ptr("Microsoft.Security/assessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2/providers/Microsoft.Security/assessments/21300918-b2e3-0346-785f-c77ff57d243b"), - // Properties: &armsecurity.AssessmentPropertiesResponse{ - // AdditionalData: map[string]*string{ - // "linkedWorkspaceId": to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myLaWorkspace"), - // }, - // DisplayName: to.Ptr("Install endpoint protection solution on virtual machine scale sets"), - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2"), - // }, - // Status: &armsecurity.AssessmentStatusResponse{ - // Description: to.Ptr("The effective policy for the assessment was evaluated to off - use Microsoft.Authorization/policyAssignments to turn this assessment on"), - // Cause: to.Ptr("OffByPolicy"), - // Code: to.Ptr(armsecurity.AssessmentStatusCodeNotApplicable), - // FirstEvaluationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-12T09:07:18.675Z"); return t}()), - // StatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-12T09:07:18.675Z"); return t}()), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/GetAssessmentWithExpand_example.json -func ExampleAssessmentsClient_Get_getSecurityRecommendationTaskFromSecurityDataLocationWithExpandParameter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAssessmentsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", "21300918-b2e3-0346-785f-c77ff57d243b", &armsecurity.AssessmentsClientGetOptions{Expand: to.Ptr(armsecurity.ExpandEnumLinks)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AssessmentResponse = armsecurity.AssessmentResponse{ - // Name: to.Ptr("21300918-b2e3-0346-785f-c77ff57d243b"), - // Type: to.Ptr("Microsoft.Security/assessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2/providers/Microsoft.Security/assessments/21300918-b2e3-0346-785f-c77ff57d243b"), - // Properties: &armsecurity.AssessmentPropertiesResponse{ - // AdditionalData: map[string]*string{ - // "linkedWorkspaceId": to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myLaWorkspace"), - // }, - // DisplayName: to.Ptr("Install endpoint protection solution on virtual machine scale sets"), - // Links: &armsecurity.AssessmentLinks{ - // AzurePortalURI: to.Ptr("https://www.portal.azure.com/?fea#blade/Microsoft_Azure_Security/RecommendationsBlade/assessmentKey/21300918-b2e3-0346-785f-c77ff57d243b"), - // }, - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2"), - // }, - // Status: &armsecurity.AssessmentStatusResponse{ - // Description: to.Ptr("The effective policy for the assessment was evaluated to off - use Microsoft.Authorization/policyAssignments to turn this assessment on"), - // Cause: to.Ptr("OffByPolicy"), - // Code: to.Ptr(armsecurity.AssessmentStatusCodeNotApplicable), - // FirstEvaluationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-12T09:07:18.675Z"); return t}()), - // StatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-12T09:07:18.675Z"); return t}()), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/PutAssessment_example.json -func ExampleAssessmentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAssessmentsClient().CreateOrUpdate(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", "8bb8be0a-6010-4789-812f-e4d661c4ed0e", armsecurity.Assessment{ - Properties: &armsecurity.AssessmentProperties{ - ResourceDetails: &armsecurity.AzureResourceDetails{ - Source: to.Ptr(armsecurity.SourceAzure), - }, - Status: &armsecurity.AssessmentStatus{ - Code: to.Ptr(armsecurity.AssessmentStatusCodeHealthy), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AssessmentResponse = armsecurity.AssessmentResponse{ - // Name: to.Ptr("8bb8be0a-6010-4789-812f-e4d661c4ed0e"), - // Type: to.Ptr("Microsoft.Security/assessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/providers/Microsoft.Security/assessments/8bb8be0a-6010-4789-812f-e4d661c4ed0e"), - // Properties: &armsecurity.AssessmentPropertiesResponse{ - // DisplayName: to.Ptr("Install internal agent on VM"), - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/providers/Microsoft.Security/assessments/8bb8be0a-6010-4789-812f-e4d661c4ed0e"), - // }, - // Status: &armsecurity.AssessmentStatusResponse{ - // Code: to.Ptr(armsecurity.AssessmentStatusCodeHealthy), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/DeleteAssessment_example.json -func ExampleAssessmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAssessmentsClient().Delete(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", "8bb8be0a-6010-4789-812f-e4d661c4ed0e", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/assessmentsmetadata_client.go b/sdk/resourcemanager/security/armsecurity/assessmentsmetadata_client.go index 3359687a5aac..c4bb09be6d0e 100644 --- a/sdk/resourcemanager/security/armsecurity/assessmentsmetadata_client.go +++ b/sdk/resourcemanager/security/armsecurity/assessmentsmetadata_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -74,7 +71,7 @@ func (client *AssessmentsMetadataClient) CreateInSubscription(ctx context.Contex } // createInSubscriptionCreateRequest creates the CreateInSubscription request. -func (client *AssessmentsMetadataClient) createInSubscriptionCreateRequest(ctx context.Context, assessmentMetadataName string, assessmentMetadata AssessmentMetadataResponse, options *AssessmentsMetadataClientCreateInSubscriptionOptions) (*policy.Request, error) { +func (client *AssessmentsMetadataClient) createInSubscriptionCreateRequest(ctx context.Context, assessmentMetadataName string, assessmentMetadata AssessmentMetadataResponse, _ *AssessmentsMetadataClientCreateInSubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}" if assessmentMetadataName == "" { return nil, errors.New("parameter assessmentMetadataName cannot be empty") @@ -137,7 +134,7 @@ func (client *AssessmentsMetadataClient) DeleteInSubscription(ctx context.Contex } // deleteInSubscriptionCreateRequest creates the DeleteInSubscription request. -func (client *AssessmentsMetadataClient) deleteInSubscriptionCreateRequest(ctx context.Context, assessmentMetadataName string, options *AssessmentsMetadataClientDeleteInSubscriptionOptions) (*policy.Request, error) { +func (client *AssessmentsMetadataClient) deleteInSubscriptionCreateRequest(ctx context.Context, assessmentMetadataName string, _ *AssessmentsMetadataClientDeleteInSubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}" if assessmentMetadataName == "" { return nil, errors.New("parameter assessmentMetadataName cannot be empty") @@ -187,7 +184,7 @@ func (client *AssessmentsMetadataClient) Get(ctx context.Context, assessmentMeta } // getCreateRequest creates the Get request. -func (client *AssessmentsMetadataClient) getCreateRequest(ctx context.Context, assessmentMetadataName string, options *AssessmentsMetadataClientGetOptions) (*policy.Request, error) { +func (client *AssessmentsMetadataClient) getCreateRequest(ctx context.Context, assessmentMetadataName string, _ *AssessmentsMetadataClientGetOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}" if assessmentMetadataName == "" { return nil, errors.New("parameter assessmentMetadataName cannot be empty") @@ -243,7 +240,7 @@ func (client *AssessmentsMetadataClient) GetInSubscription(ctx context.Context, } // getInSubscriptionCreateRequest creates the GetInSubscription request. -func (client *AssessmentsMetadataClient) getInSubscriptionCreateRequest(ctx context.Context, assessmentMetadataName string, options *AssessmentsMetadataClientGetInSubscriptionOptions) (*policy.Request, error) { +func (client *AssessmentsMetadataClient) getInSubscriptionCreateRequest(ctx context.Context, assessmentMetadataName string, _ *AssessmentsMetadataClientGetInSubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}" if assessmentMetadataName == "" { return nil, errors.New("parameter assessmentMetadataName cannot be empty") @@ -302,7 +299,7 @@ func (client *AssessmentsMetadataClient) NewListPager(options *AssessmentsMetada } // listCreateRequest creates the List request. -func (client *AssessmentsMetadataClient) listCreateRequest(ctx context.Context, options *AssessmentsMetadataClientListOptions) (*policy.Request, error) { +func (client *AssessmentsMetadataClient) listCreateRequest(ctx context.Context, _ *AssessmentsMetadataClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Security/assessmentMetadata" req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { @@ -353,7 +350,7 @@ func (client *AssessmentsMetadataClient) NewListBySubscriptionPager(options *Ass } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *AssessmentsMetadataClient) listBySubscriptionCreateRequest(ctx context.Context, options *AssessmentsMetadataClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *AssessmentsMetadataClient) listBySubscriptionCreateRequest(ctx context.Context, _ *AssessmentsMetadataClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 652c74707a8a..000000000000 --- a/sdk/resourcemanager/security/armsecurity/assessmentsmetadata_client_example_test.go +++ /dev/null @@ -1,418 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/ListAssessmentsMetadata_example.json -func ExampleAssessmentsMetadataClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAssessmentsMetadataClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AssessmentMetadataResponseList = armsecurity.AssessmentMetadataResponseList{ - // Value: []*armsecurity.AssessmentMetadataResponse{ - // { - // Name: to.Ptr("21300918-b2e3-0346-785f-c77ff57d243b"), - // Type: to.Ptr("Microsoft.Security/assessmentMetadata"), - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/21300918-b2e3-0346-785f-c77ff57d243b"), - // Properties: &armsecurity.AssessmentMetadataPropertiesResponse{ - // Description: to.Ptr("Install an endpoint protection solution on your virtual machines scale sets, to protect them from threats and vulnerabilities."), - // AssessmentType: to.Ptr(armsecurity.AssessmentTypeBuiltIn), - // Categories: []*armsecurity.Categories{ - // to.Ptr(armsecurity.CategoriesCompute)}, - // DisplayName: to.Ptr("Install endpoint protection solution on virtual machine scale sets"), - // ImplementationEffort: to.Ptr(armsecurity.ImplementationEffortLow), - // PolicyDefinitionID: to.Ptr("/providers/Microsoft.Authorization/policyDefinitions/26a828e1-e88f-464e-bbb3-c134a282b9de"), - // RemediationDescription: to.Ptr("To install an endpoint protection solution: 1. Follow the instructions in How do I turn on antimalware in my virtual machine scale set"), - // Severity: to.Ptr(armsecurity.SeverityMedium), - // Threats: []*armsecurity.Threats{ - // to.Ptr(armsecurity.ThreatsDataExfiltration), - // to.Ptr(armsecurity.ThreatsDataSpillage), - // to.Ptr(armsecurity.ThreatsMaliciousInsider)}, - // UserImpact: to.Ptr(armsecurity.UserImpactLow), - // PlannedDeprecationDate: to.Ptr("03/2022"), - // PublishDates: &armsecurity.AssessmentMetadataPropertiesResponsePublishDates{ - // GA: to.Ptr("06/01/2021"), - // Public: to.Ptr("06/01/2021"), - // }, - // Tactics: []*armsecurity.Tactics{ - // to.Ptr(armsecurity.TacticsCredentialAccess), - // to.Ptr(armsecurity.TacticsPersistence), - // to.Ptr(armsecurity.TacticsExecution), - // to.Ptr(armsecurity.TacticsDefenseEvasion), - // to.Ptr(armsecurity.TacticsCollection), - // to.Ptr(armsecurity.TacticsDiscovery), - // to.Ptr(armsecurity.TacticsPrivilegeEscalation)}, - // Techniques: []*armsecurity.Techniques{ - // to.Ptr(armsecurity.TechniquesObfuscatedFilesOrInformation), - // to.Ptr(armsecurity.TechniquesIngressToolTransfer), - // to.Ptr(armsecurity.TechniquesPhishing), - // to.Ptr(armsecurity.TechniquesUserExecution)}, - // }, - // }, - // { - // Name: to.Ptr("bc303248-3d14-44c2-96a0-55f5c326b5fe"), - // Type: to.Ptr("Microsoft.Security/assessmentMetadata"), - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/bc303248-3d14-44c2-96a0-55f5c326b5fe"), - // Properties: &armsecurity.AssessmentMetadataPropertiesResponse{ - // Description: to.Ptr("Open remote management ports expose your VM to a high level of risk from internet-based attacks that attempt to brute force credentials to gain admin access to the machine."), - // AssessmentType: to.Ptr(armsecurity.AssessmentTypeCustomPolicy), - // Categories: []*armsecurity.Categories{ - // to.Ptr(armsecurity.CategoriesNetworking)}, - // DisplayName: to.Ptr("Close management ports on your virtual machines"), - // ImplementationEffort: to.Ptr(armsecurity.ImplementationEffortLow), - // PolicyDefinitionID: to.Ptr("/providers/Microsoft.Authorization/policyDefinitions/22730e10-96f6-4aac-ad84-9383d35b5917"), - // Preview: to.Ptr(true), - // RemediationDescription: to.Ptr("We recommend that you edit the inbound rules of the below virtual machines to restrict access to specific source ranges.
To restrict the access to your virtual machines: 1. Click on a VM from the list below 2. At the 'Networking' blade, click on each of the rules that allow management ports (e.g. RDP-3389, WINRM-5985, SSH-22) 3. Change the 'Action' property to 'Deny' 4. Click 'Save'"), - // Severity: to.Ptr(armsecurity.SeverityMedium), - // Threats: []*armsecurity.Threats{ - // to.Ptr(armsecurity.ThreatsDataExfiltration), - // to.Ptr(armsecurity.ThreatsDataSpillage), - // to.Ptr(armsecurity.ThreatsMaliciousInsider)}, - // UserImpact: to.Ptr(armsecurity.UserImpactHigh), - // PublishDates: &armsecurity.AssessmentMetadataPropertiesResponsePublishDates{ - // GA: to.Ptr("06/01/2021"), - // Public: to.Ptr("06/01/2021"), - // }, - // }, - // }, - // { - // Name: to.Ptr("ca039e75-a276-4175-aebc-bcd41e4b14b7"), - // Type: to.Ptr("Microsoft.Security/assessmentMetadata"), - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/ca039e75-a276-4175-aebc-bcd41e4b14b7"), - // Properties: &armsecurity.AssessmentMetadataPropertiesResponse{ - // Description: to.Ptr("Assessment that my organization created to view our security assessment in Azure Security Center"), - // AssessmentType: to.Ptr(armsecurity.AssessmentTypeCustomerManaged), - // Categories: []*armsecurity.Categories{ - // to.Ptr(armsecurity.CategoriesCompute)}, - // DisplayName: to.Ptr("My organization security assessment"), - // ImplementationEffort: to.Ptr(armsecurity.ImplementationEffortLow), - // RemediationDescription: to.Ptr("Fix it with these remediation instructions"), - // Severity: to.Ptr(armsecurity.SeverityMedium), - // Threats: []*armsecurity.Threats{ - // }, - // UserImpact: to.Ptr(armsecurity.UserImpactLow), - // PublishDates: &armsecurity.AssessmentMetadataPropertiesResponsePublishDates{ - // GA: to.Ptr("06/01/2021"), - // Public: to.Ptr("06/01/2021"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/GetAssessmentsMetadata_example.json -func ExampleAssessmentsMetadataClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAssessmentsMetadataClient().Get(ctx, "21300918-b2e3-0346-785f-c77ff57d243b", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AssessmentMetadataResponse = armsecurity.AssessmentMetadataResponse{ - // Name: to.Ptr("21300918-b2e3-0346-785f-c77ff57d243b"), - // Type: to.Ptr("Microsoft.Security/assessmentMetadata"), - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/21300918-b2e3-0346-785f-c77ff57d243b"), - // Properties: &armsecurity.AssessmentMetadataPropertiesResponse{ - // Description: to.Ptr("Install an endpoint protection solution on your virtual machines scale sets, to protect them from threats and vulnerabilities."), - // AssessmentType: to.Ptr(armsecurity.AssessmentTypeBuiltIn), - // Categories: []*armsecurity.Categories{ - // to.Ptr(armsecurity.CategoriesCompute)}, - // DisplayName: to.Ptr("Install endpoint protection solution on virtual machine scale sets"), - // ImplementationEffort: to.Ptr(armsecurity.ImplementationEffortLow), - // PolicyDefinitionID: to.Ptr("/providers/Microsoft.Authorization/policyDefinitions/26a828e1-e88f-464e-bbb3-c134a282b9de"), - // RemediationDescription: to.Ptr("To install an endpoint protection solution: 1. Follow the instructions in How do I turn on antimalware in my virtual machine scale set"), - // Severity: to.Ptr(armsecurity.SeverityMedium), - // Threats: []*armsecurity.Threats{ - // to.Ptr(armsecurity.ThreatsDataExfiltration), - // to.Ptr(armsecurity.ThreatsDataSpillage), - // to.Ptr(armsecurity.ThreatsMaliciousInsider)}, - // UserImpact: to.Ptr(armsecurity.UserImpactLow), - // PlannedDeprecationDate: to.Ptr("03/2022"), - // PublishDates: &armsecurity.AssessmentMetadataPropertiesResponsePublishDates{ - // GA: to.Ptr("06/01/2021"), - // Public: to.Ptr("06/01/2021"), - // }, - // Tactics: []*armsecurity.Tactics{ - // to.Ptr(armsecurity.TacticsCredentialAccess), - // to.Ptr(armsecurity.TacticsPersistence), - // to.Ptr(armsecurity.TacticsExecution), - // to.Ptr(armsecurity.TacticsDefenseEvasion), - // to.Ptr(armsecurity.TacticsCollection), - // to.Ptr(armsecurity.TacticsDiscovery), - // to.Ptr(armsecurity.TacticsPrivilegeEscalation)}, - // Techniques: []*armsecurity.Techniques{ - // to.Ptr(armsecurity.TechniquesObfuscatedFilesOrInformation), - // to.Ptr(armsecurity.TechniquesIngressToolTransfer), - // to.Ptr(armsecurity.TechniquesPhishing), - // to.Ptr(armsecurity.TechniquesUserExecution)}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/ListAssessmentsMetadata_subscription_example.json -func ExampleAssessmentsMetadataClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAssessmentsMetadataClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AssessmentMetadataResponseList = armsecurity.AssessmentMetadataResponseList{ - // Value: []*armsecurity.AssessmentMetadataResponse{ - // { - // Name: to.Ptr("21300918-b2e3-0346-785f-c77ff57d243b"), - // Type: to.Ptr("Microsoft.Security/assessmentMetadata"), - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/21300918-b2e3-0346-785f-c77ff57d243b"), - // Properties: &armsecurity.AssessmentMetadataPropertiesResponse{ - // Description: to.Ptr("Install an endpoint protection solution on your virtual machines scale sets, to protect them from threats and vulnerabilities."), - // AssessmentType: to.Ptr(armsecurity.AssessmentTypeBuiltIn), - // Categories: []*armsecurity.Categories{ - // to.Ptr(armsecurity.CategoriesCompute)}, - // DisplayName: to.Ptr("Install endpoint protection solution on virtual machine scale sets"), - // ImplementationEffort: to.Ptr(armsecurity.ImplementationEffortLow), - // PolicyDefinitionID: to.Ptr("/providers/Microsoft.Authorization/policyDefinitions/26a828e1-e88f-464e-bbb3-c134a282b9de"), - // RemediationDescription: to.Ptr("To install an endpoint protection solution: 1. Follow the instructions in How do I turn on antimalware in my virtual machine scale set"), - // Severity: to.Ptr(armsecurity.SeverityMedium), - // Threats: []*armsecurity.Threats{ - // to.Ptr(armsecurity.ThreatsDataExfiltration), - // to.Ptr(armsecurity.ThreatsDataSpillage), - // to.Ptr(armsecurity.ThreatsMaliciousInsider)}, - // UserImpact: to.Ptr(armsecurity.UserImpactLow), - // PlannedDeprecationDate: to.Ptr("03/2022"), - // PublishDates: &armsecurity.AssessmentMetadataPropertiesResponsePublishDates{ - // GA: to.Ptr("06/01/2021"), - // Public: to.Ptr("06/01/2021"), - // }, - // Tactics: []*armsecurity.Tactics{ - // to.Ptr(armsecurity.TacticsCredentialAccess), - // to.Ptr(armsecurity.TacticsPersistence), - // to.Ptr(armsecurity.TacticsExecution), - // to.Ptr(armsecurity.TacticsDefenseEvasion), - // to.Ptr(armsecurity.TacticsCollection), - // to.Ptr(armsecurity.TacticsDiscovery), - // to.Ptr(armsecurity.TacticsPrivilegeEscalation)}, - // Techniques: []*armsecurity.Techniques{ - // to.Ptr(armsecurity.TechniquesObfuscatedFilesOrInformation), - // to.Ptr(armsecurity.TechniquesIngressToolTransfer), - // to.Ptr(armsecurity.TechniquesPhishing), - // to.Ptr(armsecurity.TechniquesUserExecution)}, - // }, - // }, - // { - // Name: to.Ptr("bc303248-3d14-44c2-96a0-55f5c326b5fe"), - // Type: to.Ptr("Microsoft.Security/assessmentMetadata"), - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/bc303248-3d14-44c2-96a0-55f5c326b5fe"), - // Properties: &armsecurity.AssessmentMetadataPropertiesResponse{ - // Description: to.Ptr("Open remote management ports expose your VM to a high level of risk from internet-based attacks that attempt to brute force credentials to gain admin access to the machine."), - // AssessmentType: to.Ptr(armsecurity.AssessmentTypeCustomPolicy), - // Categories: []*armsecurity.Categories{ - // to.Ptr(armsecurity.CategoriesNetworking)}, - // DisplayName: to.Ptr("Close management ports on your virtual machines"), - // ImplementationEffort: to.Ptr(armsecurity.ImplementationEffortLow), - // PolicyDefinitionID: to.Ptr("/providers/Microsoft.Authorization/policyDefinitions/22730e10-96f6-4aac-ad84-9383d35b5917"), - // Preview: to.Ptr(true), - // RemediationDescription: to.Ptr("We recommend that you edit the inbound rules of the below virtual machines to restrict access to specific source ranges.
To restrict the access to your virtual machines: 1. Click on a VM from the list below 2. At the 'Networking' blade, click on each of the rules that allow management ports (e.g. RDP-3389, WINRM-5985, SSH-22) 3. Change the 'Action' property to 'Deny' 4. Click 'Save'"), - // Severity: to.Ptr(armsecurity.SeverityMedium), - // Threats: []*armsecurity.Threats{ - // to.Ptr(armsecurity.ThreatsDataExfiltration), - // to.Ptr(armsecurity.ThreatsDataSpillage), - // to.Ptr(armsecurity.ThreatsMaliciousInsider)}, - // UserImpact: to.Ptr(armsecurity.UserImpactHigh), - // PublishDates: &armsecurity.AssessmentMetadataPropertiesResponsePublishDates{ - // GA: to.Ptr("06/01/2021"), - // Public: to.Ptr("06/01/2021"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/GetAssessmentsMetadata_subscription_example.json -func ExampleAssessmentsMetadataClient_GetInSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAssessmentsMetadataClient().GetInSubscription(ctx, "21300918-b2e3-0346-785f-c77ff57d243b", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AssessmentMetadataResponse = armsecurity.AssessmentMetadataResponse{ - // Name: to.Ptr("21300918-b2e3-0346-785f-c77ff57d243b"), - // Type: to.Ptr("Microsoft.Security/assessmentMetadata"), - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/21300918-b2e3-0346-785f-c77ff57d243b"), - // Properties: &armsecurity.AssessmentMetadataPropertiesResponse{ - // Description: to.Ptr("Install an endpoint protection solution on your virtual machines scale sets, to protect them from threats and vulnerabilities."), - // AssessmentType: to.Ptr(armsecurity.AssessmentTypeBuiltIn), - // Categories: []*armsecurity.Categories{ - // to.Ptr(armsecurity.CategoriesCompute)}, - // DisplayName: to.Ptr("Install endpoint protection solution on virtual machine scale sets"), - // ImplementationEffort: to.Ptr(armsecurity.ImplementationEffortLow), - // PolicyDefinitionID: to.Ptr("/providers/Microsoft.Authorization/policyDefinitions/26a828e1-e88f-464e-bbb3-c134a282b9de"), - // RemediationDescription: to.Ptr("To install an endpoint protection solution: 1. Follow the instructions in How do I turn on antimalware in my virtual machine scale set"), - // Severity: to.Ptr(armsecurity.SeverityMedium), - // Threats: []*armsecurity.Threats{ - // to.Ptr(armsecurity.ThreatsDataExfiltration), - // to.Ptr(armsecurity.ThreatsDataSpillage), - // to.Ptr(armsecurity.ThreatsMaliciousInsider)}, - // UserImpact: to.Ptr(armsecurity.UserImpactLow), - // PlannedDeprecationDate: to.Ptr("03/2022"), - // PublishDates: &armsecurity.AssessmentMetadataPropertiesResponsePublishDates{ - // GA: to.Ptr("06/01/2021"), - // Public: to.Ptr("06/01/2021"), - // }, - // Tactics: []*armsecurity.Tactics{ - // to.Ptr(armsecurity.TacticsCredentialAccess), - // to.Ptr(armsecurity.TacticsPersistence), - // to.Ptr(armsecurity.TacticsExecution), - // to.Ptr(armsecurity.TacticsDefenseEvasion), - // to.Ptr(armsecurity.TacticsCollection), - // to.Ptr(armsecurity.TacticsDiscovery), - // to.Ptr(armsecurity.TacticsPrivilegeEscalation)}, - // Techniques: []*armsecurity.Techniques{ - // to.Ptr(armsecurity.TechniquesObfuscatedFilesOrInformation), - // to.Ptr(armsecurity.TechniquesIngressToolTransfer), - // to.Ptr(armsecurity.TechniquesPhishing), - // to.Ptr(armsecurity.TechniquesUserExecution)}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/CreateAssessmentsMetadata_subscription_example.json -func ExampleAssessmentsMetadataClient_CreateInSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAssessmentsMetadataClient().CreateInSubscription(ctx, "ca039e75-a276-4175-aebc-bcd41e4b14b7", armsecurity.AssessmentMetadataResponse{ - Properties: &armsecurity.AssessmentMetadataPropertiesResponse{ - Description: to.Ptr("Install an endpoint protection solution on your virtual machines scale sets, to protect them from threats and vulnerabilities."), - AssessmentType: to.Ptr(armsecurity.AssessmentTypeCustomerManaged), - Categories: []*armsecurity.Categories{ - to.Ptr(armsecurity.CategoriesCompute)}, - DisplayName: to.Ptr("Install endpoint protection solution on virtual machine scale sets"), - ImplementationEffort: to.Ptr(armsecurity.ImplementationEffortLow), - RemediationDescription: to.Ptr("To install an endpoint protection solution: 1. Follow the instructions in How do I turn on antimalware in my virtual machine scale set"), - Severity: to.Ptr(armsecurity.SeverityMedium), - Threats: []*armsecurity.Threats{ - to.Ptr(armsecurity.ThreatsDataExfiltration), - to.Ptr(armsecurity.ThreatsDataSpillage), - to.Ptr(armsecurity.ThreatsMaliciousInsider)}, - UserImpact: to.Ptr(armsecurity.UserImpactLow), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AssessmentMetadataResponse = armsecurity.AssessmentMetadataResponse{ - // Name: to.Ptr("ca039e75-a276-4175-aebc-bcd41e4b14b7"), - // Type: to.Ptr("Microsoft.Security/assessmentMetadata"), - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/ca039e75-a276-4175-aebc-bcd41e4b14b7"), - // Properties: &armsecurity.AssessmentMetadataPropertiesResponse{ - // Description: to.Ptr("Assessment that my organization created to view our security assessment in Azure Security Center"), - // AssessmentType: to.Ptr(armsecurity.AssessmentTypeCustomerManaged), - // Categories: []*armsecurity.Categories{ - // to.Ptr(armsecurity.CategoriesCompute)}, - // DisplayName: to.Ptr("My organization security assessment"), - // ImplementationEffort: to.Ptr(armsecurity.ImplementationEffortLow), - // RemediationDescription: to.Ptr("Fix it with these remediation instructions"), - // Severity: to.Ptr(armsecurity.SeverityMedium), - // Threats: []*armsecurity.Threats{ - // to.Ptr(armsecurity.ThreatsDataExfiltration), - // to.Ptr(armsecurity.ThreatsDataSpillage), - // to.Ptr(armsecurity.ThreatsMaliciousInsider)}, - // UserImpact: to.Ptr(armsecurity.UserImpactLow), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/DeleteAssessmentsMetadata_subscription_example.json -func ExampleAssessmentsMetadataClient_DeleteInSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAssessmentsMetadataClient().DeleteInSubscription(ctx, "ca039e75-a276-4175-aebc-bcd41e4b14b7", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/automations_client.go b/sdk/resourcemanager/security/armsecurity/automations_client.go index fe5afc6269c5..2783aaecdc32 100644 --- a/sdk/resourcemanager/security/armsecurity/automations_client.go +++ b/sdk/resourcemanager/security/armsecurity/automations_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -76,7 +73,7 @@ func (client *AutomationsClient) CreateOrUpdate(ctx context.Context, resourceGro } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AutomationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, automationName string, automation Automation, options *AutomationsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *AutomationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, automationName string, automation Automation, _ *AutomationsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -142,7 +139,7 @@ func (client *AutomationsClient) Delete(ctx context.Context, resourceGroupName s } // deleteCreateRequest creates the Delete request. -func (client *AutomationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, automationName string, options *AutomationsClientDeleteOptions) (*policy.Request, error) { +func (client *AutomationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, automationName string, _ *AutomationsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -197,7 +194,7 @@ func (client *AutomationsClient) Get(ctx context.Context, resourceGroupName stri } // getCreateRequest creates the Get request. -func (client *AutomationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, automationName string, options *AutomationsClientGetOptions) (*policy.Request, error) { +func (client *AutomationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, automationName string, _ *AutomationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -260,7 +257,7 @@ func (client *AutomationsClient) NewListPager(options *AutomationsClientListOpti } // listCreateRequest creates the List request. -func (client *AutomationsClient) listCreateRequest(ctx context.Context, options *AutomationsClientListOptions) (*policy.Request, error) { +func (client *AutomationsClient) listCreateRequest(ctx context.Context, _ *AutomationsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/automations" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -317,7 +314,7 @@ func (client *AutomationsClient) NewListByResourceGroupPager(resourceGroupName s } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *AutomationsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *AutomationsClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *AutomationsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *AutomationsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -378,7 +375,7 @@ func (client *AutomationsClient) Update(ctx context.Context, resourceGroupName s } // updateCreateRequest creates the Update request. -func (client *AutomationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, automationName string, automation AutomationUpdateModel, options *AutomationsClientUpdateOptions) (*policy.Request, error) { +func (client *AutomationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, automationName string, automation AutomationUpdateModel, _ *AutomationsClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -446,7 +443,7 @@ func (client *AutomationsClient) Validate(ctx context.Context, resourceGroupName } // validateCreateRequest creates the Validate request. -func (client *AutomationsClient) validateCreateRequest(ctx context.Context, resourceGroupName string, automationName string, automation Automation, options *AutomationsClientValidateOptions) (*policy.Request, error) { +func (client *AutomationsClient) validateCreateRequest(ctx context.Context, resourceGroupName string, automationName string, automation Automation, _ *AutomationsClientValidateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/automations/{automationName}/validate" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 e1991d1c767b..000000000000 --- a/sdk/resourcemanager/security/armsecurity/automations_client_example_test.go +++ /dev/null @@ -1,602 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/GetAutomationsSubscription_example.json -func ExampleAutomationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAutomationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AutomationList = armsecurity.AutomationList{ - // Value: []*armsecurity.Automation{ - // { - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Name: to.Ptr("exampleAutomation"), - // Type: to.Ptr("Microsoft.Security/automations"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/automations/exampleAutomation"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.AutomationProperties{ - // Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment"), - // Actions: []armsecurity.AutomationActionClassification{ - // &armsecurity.AutomationActionLogicApp{ - // ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - // LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - // }}, - // IsEnabled: to.Ptr(true), - // Scopes: []*armsecurity.AutomationScope{ - // { - // Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - // ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - // }}, - // Sources: []*armsecurity.AutomationSource{ - // { - // EventSource: to.Ptr(armsecurity.EventSourceAssessments), - // RuleSets: []*armsecurity.AutomationRuleSet{ - // { - // Rules: []*armsecurity.AutomationTriggeringRule{ - // { - // ExpectedValue: to.Ptr("customAssessment"), - // Operator: to.Ptr(armsecurity.OperatorEquals), - // PropertyJPath: to.Ptr("$.Entity.AssessmentType"), - // PropertyType: to.Ptr(armsecurity.PropertyTypeString), - // }}, - // }}, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/GetAutomationsResourceGroup_example.json -func ExampleAutomationsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAutomationsClient().NewListByResourceGroupPager("exampleResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AutomationList = armsecurity.AutomationList{ - // Value: []*armsecurity.Automation{ - // { - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Name: to.Ptr("exampleAutomation"), - // Type: to.Ptr("Microsoft.Security/automations"), - // ID: to.Ptr("/subscriptions/e4272367-5645-4c4e-9c67-3b74b59a6982/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/automations/exampleAutomation"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.AutomationProperties{ - // Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment"), - // Actions: []armsecurity.AutomationActionClassification{ - // &armsecurity.AutomationActionLogicApp{ - // ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - // LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - // }}, - // IsEnabled: to.Ptr(true), - // Scopes: []*armsecurity.AutomationScope{ - // { - // Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - // ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - // }}, - // Sources: []*armsecurity.AutomationSource{ - // { - // EventSource: to.Ptr(armsecurity.EventSourceAssessments), - // RuleSets: []*armsecurity.AutomationRuleSet{ - // { - // Rules: []*armsecurity.AutomationTriggeringRule{ - // { - // ExpectedValue: to.Ptr("customAssessment"), - // Operator: to.Ptr(armsecurity.OperatorEquals), - // PropertyJPath: to.Ptr("$.Entity.AssessmentType"), - // PropertyType: to.Ptr(armsecurity.PropertyTypeString), - // }}, - // }}, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/GetAutomationResourceGroup_example.json -func ExampleAutomationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutomationsClient().Get(ctx, "exampleResourceGroup", "exampleAutomation", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Automation = armsecurity.Automation{ - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Name: to.Ptr("exampleAutomation"), - // Type: to.Ptr("Microsoft.Security/automations"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/automations/exampleAutomation"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.AutomationProperties{ - // Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment"), - // Actions: []armsecurity.AutomationActionClassification{ - // &armsecurity.AutomationActionLogicApp{ - // ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - // LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - // }}, - // IsEnabled: to.Ptr(true), - // Scopes: []*armsecurity.AutomationScope{ - // { - // Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - // ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - // }}, - // Sources: []*armsecurity.AutomationSource{ - // { - // EventSource: to.Ptr(armsecurity.EventSourceAssessments), - // RuleSets: []*armsecurity.AutomationRuleSet{ - // { - // Rules: []*armsecurity.AutomationTriggeringRule{ - // { - // ExpectedValue: to.Ptr("customAssessment"), - // Operator: to.Ptr(armsecurity.OperatorEquals), - // PropertyJPath: to.Ptr("$.Entity.AssessmentType"), - // PropertyType: to.Ptr(armsecurity.PropertyTypeString), - // }}, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/PutAutomationAllAssessments_example.json -func ExampleAutomationsClient_CreateOrUpdate_createOrUpdateASecurityAutomationForAllAssessmentsIncludingAllSeverities() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutomationsClient().CreateOrUpdate(ctx, "exampleResourceGroup", "exampleAutomation", armsecurity.Automation{ - Location: to.Ptr("Central US"), - Etag: to.Ptr("etag value (must be supplied for update)"), - Tags: map[string]*string{}, - Properties: &armsecurity.AutomationProperties{ - Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment"), - Actions: []armsecurity.AutomationActionClassification{ - &armsecurity.AutomationActionLogicApp{ - ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - URI: to.Ptr("https://exampleTriggerUri1.com"), - }}, - IsEnabled: to.Ptr(true), - Scopes: []*armsecurity.AutomationScope{ - { - Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - }}, - Sources: []*armsecurity.AutomationSource{ - { - EventSource: to.Ptr(armsecurity.EventSourceAssessments), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Automation = armsecurity.Automation{ - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("new etag value"), - // Name: to.Ptr("exampleAutomation"), - // Type: to.Ptr("Microsoft.Security/automations"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/automations/exampleAutomation"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.AutomationProperties{ - // Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment"), - // Actions: []armsecurity.AutomationActionClassification{ - // &armsecurity.AutomationActionLogicApp{ - // ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - // LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - // }}, - // IsEnabled: to.Ptr(true), - // Scopes: []*armsecurity.AutomationScope{ - // { - // Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - // ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - // }}, - // Sources: []*armsecurity.AutomationSource{ - // { - // EventSource: to.Ptr(armsecurity.EventSourceAssessments), - // RuleSets: []*armsecurity.AutomationRuleSet{ - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/PutAutomationHighSeverityAssessments_example.json -func ExampleAutomationsClient_CreateOrUpdate_createOrUpdateASecurityAutomationForAllHighSeverityAssessments() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutomationsClient().CreateOrUpdate(ctx, "exampleResourceGroup", "exampleAutomation", armsecurity.Automation{ - Location: to.Ptr("Central US"), - Etag: to.Ptr("etag value (must be supplied for update)"), - Tags: map[string]*string{}, - Properties: &armsecurity.AutomationProperties{ - Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any high severity security assessment"), - Actions: []armsecurity.AutomationActionClassification{ - &armsecurity.AutomationActionLogicApp{ - ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - URI: to.Ptr("https://exampleTriggerUri1.com"), - }}, - IsEnabled: to.Ptr(true), - Scopes: []*armsecurity.AutomationScope{ - { - Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - }}, - Sources: []*armsecurity.AutomationSource{ - { - EventSource: to.Ptr(armsecurity.EventSourceAssessments), - RuleSets: []*armsecurity.AutomationRuleSet{ - { - Rules: []*armsecurity.AutomationTriggeringRule{ - { - ExpectedValue: to.Ptr("High"), - Operator: to.Ptr(armsecurity.OperatorEquals), - PropertyJPath: to.Ptr("properties.metadata.severity"), - PropertyType: to.Ptr(armsecurity.PropertyTypeString), - }}, - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Automation = armsecurity.Automation{ - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("new etag value"), - // Name: to.Ptr("exampleAutomation"), - // Type: to.Ptr("Microsoft.Security/automations"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/automations/exampleAutomation"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.AutomationProperties{ - // Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any high severity security assessment"), - // Actions: []armsecurity.AutomationActionClassification{ - // &armsecurity.AutomationActionLogicApp{ - // ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - // LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - // }}, - // IsEnabled: to.Ptr(true), - // Scopes: []*armsecurity.AutomationScope{ - // { - // Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - // ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - // }}, - // Sources: []*armsecurity.AutomationSource{ - // { - // EventSource: to.Ptr(armsecurity.EventSourceAssessments), - // RuleSets: []*armsecurity.AutomationRuleSet{ - // { - // Rules: []*armsecurity.AutomationTriggeringRule{ - // { - // ExpectedValue: to.Ptr("High"), - // Operator: to.Ptr(armsecurity.OperatorEquals), - // PropertyJPath: to.Ptr("properties.metadata.severity"), - // PropertyType: to.Ptr(armsecurity.PropertyTypeString), - // }}, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/PutDisableAutomation_example.json -func ExampleAutomationsClient_CreateOrUpdate_disableOrEnableASecurityAutomation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutomationsClient().CreateOrUpdate(ctx, "exampleResourceGroup", "exampleAutomation", armsecurity.Automation{ - Location: to.Ptr("Central US"), - Etag: to.Ptr("etag value (must be supplied for update)"), - Tags: map[string]*string{}, - Properties: &armsecurity.AutomationProperties{ - Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment"), - Actions: []armsecurity.AutomationActionClassification{ - &armsecurity.AutomationActionLogicApp{ - ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - URI: to.Ptr("https://exampleTriggerUri1.com"), - }}, - IsEnabled: to.Ptr(false), - Scopes: []*armsecurity.AutomationScope{ - { - Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - }}, - Sources: []*armsecurity.AutomationSource{ - { - EventSource: to.Ptr(armsecurity.EventSourceAssessments), - RuleSets: []*armsecurity.AutomationRuleSet{ - { - Rules: []*armsecurity.AutomationTriggeringRule{ - { - ExpectedValue: to.Ptr("customAssessment"), - Operator: to.Ptr(armsecurity.OperatorEquals), - PropertyJPath: to.Ptr("$.Entity.AssessmentType"), - PropertyType: to.Ptr(armsecurity.PropertyTypeString), - }}, - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Automation = armsecurity.Automation{ - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("new etag value"), - // Name: to.Ptr("exampleAutomation"), - // Type: to.Ptr("Microsoft.Security/automations"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/automations/exampleAutomation"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.AutomationProperties{ - // Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment"), - // Actions: []armsecurity.AutomationActionClassification{ - // &armsecurity.AutomationActionLogicApp{ - // ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - // LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - // }}, - // IsEnabled: to.Ptr(false), - // Scopes: []*armsecurity.AutomationScope{ - // { - // Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - // ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - // }}, - // Sources: []*armsecurity.AutomationSource{ - // { - // EventSource: to.Ptr(armsecurity.EventSourceAssessments), - // RuleSets: []*armsecurity.AutomationRuleSet{ - // { - // Rules: []*armsecurity.AutomationTriggeringRule{ - // { - // ExpectedValue: to.Ptr("customAssessment"), - // Operator: to.Ptr(armsecurity.OperatorEquals), - // PropertyJPath: to.Ptr("$.Entity.AssessmentType"), - // PropertyType: to.Ptr(armsecurity.PropertyTypeString), - // }}, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/PatchAutomation_example.json -func ExampleAutomationsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutomationsClient().Update(ctx, "exampleResourceGroup", "exampleAutomation", armsecurity.AutomationUpdateModel{ - Tags: map[string]*string{ - "Example": to.Ptr("exampleTag"), - }, - 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"), - }}, - Scopes: []*armsecurity.AutomationScope{ - { - Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - }}, - Sources: []*armsecurity.AutomationSource{ - { - EventSource: to.Ptr(armsecurity.EventSourceAssessments), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Automation = armsecurity.Automation{ - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("new etag value"), - // Name: to.Ptr("exampleAutomation"), - // Type: to.Ptr("Microsoft.Security/automations"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/automations/exampleAutomation"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.AutomationProperties{ - // Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment"), - // Actions: []armsecurity.AutomationActionClassification{ - // &armsecurity.AutomationActionLogicApp{ - // ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - // LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - // }}, - // IsEnabled: to.Ptr(true), - // Scopes: []*armsecurity.AutomationScope{ - // { - // Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - // ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - // }}, - // Sources: []*armsecurity.AutomationSource{ - // { - // EventSource: to.Ptr(armsecurity.EventSourceAssessments), - // RuleSets: []*armsecurity.AutomationRuleSet{ - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/DeleteAutomation_example.json -func ExampleAutomationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAutomationsClient().Delete(ctx, "myRg", "myAutomationName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/Automations/ValidateAutomation_example.json -func ExampleAutomationsClient_Validate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutomationsClient().Validate(ctx, "exampleResourceGroup", "exampleAutomation", armsecurity.Automation{ - Location: to.Ptr("Central US"), - Tags: map[string]*string{}, - Properties: &armsecurity.AutomationProperties{ - Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment"), - Actions: []armsecurity.AutomationActionClassification{ - &armsecurity.AutomationActionLogicApp{ - ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - URI: to.Ptr("https://exampleTriggerUri1.com"), - }}, - IsEnabled: to.Ptr(true), - Scopes: []*armsecurity.AutomationScope{ - { - Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - }}, - Sources: []*armsecurity.AutomationSource{ - { - EventSource: to.Ptr(armsecurity.EventSourceAssessments), - RuleSets: []*armsecurity.AutomationRuleSet{ - { - Rules: []*armsecurity.AutomationTriggeringRule{ - { - ExpectedValue: to.Ptr("customAssessment"), - Operator: to.Ptr(armsecurity.OperatorEquals), - PropertyJPath: to.Ptr("$.Entity.AssessmentType"), - PropertyType: to.Ptr(armsecurity.PropertyTypeString), - }}, - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutomationValidationStatus = armsecurity.AutomationValidationStatus{ - // IsValid: to.Ptr(true), - // Message: to.Ptr("Validation Successful"), - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/autoprovisioningsettings_client.go b/sdk/resourcemanager/security/armsecurity/autoprovisioningsettings_client.go index dab47f9d11ee..47b7c5d8cebc 100644 --- a/sdk/resourcemanager/security/armsecurity/autoprovisioningsettings_client.go +++ b/sdk/resourcemanager/security/armsecurity/autoprovisioningsettings_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -74,7 +71,7 @@ func (client *AutoProvisioningSettingsClient) Create(ctx context.Context, settin } // createCreateRequest creates the Create request. -func (client *AutoProvisioningSettingsClient) createCreateRequest(ctx context.Context, settingName string, setting AutoProvisioningSetting, options *AutoProvisioningSettingsClientCreateOptions) (*policy.Request, error) { +func (client *AutoProvisioningSettingsClient) createCreateRequest(ctx context.Context, settingName string, setting AutoProvisioningSetting, _ *AutoProvisioningSettingsClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -137,7 +134,7 @@ func (client *AutoProvisioningSettingsClient) Get(ctx context.Context, settingNa } // getCreateRequest creates the Get request. -func (client *AutoProvisioningSettingsClient) getCreateRequest(ctx context.Context, settingName string, options *AutoProvisioningSettingsClientGetOptions) (*policy.Request, error) { +func (client *AutoProvisioningSettingsClient) getCreateRequest(ctx context.Context, settingName string, _ *AutoProvisioningSettingsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings/{settingName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -196,7 +193,7 @@ func (client *AutoProvisioningSettingsClient) NewListPager(options *AutoProvisio } // listCreateRequest creates the List request. -func (client *AutoProvisioningSettingsClient) listCreateRequest(ctx context.Context, options *AutoProvisioningSettingsClientListOptions) (*policy.Request, error) { +func (client *AutoProvisioningSettingsClient) listCreateRequest(ctx context.Context, _ *AutoProvisioningSettingsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/autoProvisioningSettings" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 933c72c870d9..000000000000 --- a/sdk/resourcemanager/security/armsecurity/autoprovisioningsettings_client_example_test.go +++ /dev/null @@ -1,118 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/AutoProvisioningSettings/GetAutoProvisioningSettingsSubscription_example.json -func ExampleAutoProvisioningSettingsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAutoProvisioningSettingsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AutoProvisioningSettingList = armsecurity.AutoProvisioningSettingList{ - // Value: []*armsecurity.AutoProvisioningSetting{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/autoProvisioningSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/autoProvisioningSettings/default"), - // Properties: &armsecurity.AutoProvisioningSettingProperties{ - // AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/AutoProvisioningSettings/GetAutoProvisioningSettingSubscription_example.json -func ExampleAutoProvisioningSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutoProvisioningSettingsClient().Get(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutoProvisioningSetting = armsecurity.AutoProvisioningSetting{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/autoProvisioningSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/autoProvisioningSettings/default"), - // Properties: &armsecurity.AutoProvisioningSettingProperties{ - // AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/AutoProvisioningSettings/CreateAutoProvisioningSettingsSubscription_example.json -func ExampleAutoProvisioningSettingsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutoProvisioningSettingsClient().Create(ctx, "default", armsecurity.AutoProvisioningSetting{ - Name: to.Ptr("default"), - Type: to.Ptr("Microsoft.Security/autoProvisioningSettings"), - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/autoProvisioningSettings/default"), - Properties: &armsecurity.AutoProvisioningSettingProperties{ - AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutoProvisioningSetting = armsecurity.AutoProvisioningSetting{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/autoProvisioningSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/autoProvisioningSettings/default"), - // Properties: &armsecurity.AutoProvisioningSettingProperties{ - // AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/autorest.md b/sdk/resourcemanager/security/armsecurity/autorest.md index 110930e58447..fc7c22380037 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/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/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.14.0 +module-version: 0.15.0 directive: - from: externalSecuritySolutions.json where: $.definitions['ExternalSecuritySolutionKind'] diff --git a/sdk/resourcemanager/security/armsecurity/azuredevopsorgs_client.go b/sdk/resourcemanager/security/armsecurity/azuredevopsorgs_client.go index 49e3fb64c318..6602e09eafa2 100644 --- a/sdk/resourcemanager/security/armsecurity/azuredevopsorgs_client.go +++ b/sdk/resourcemanager/security/armsecurity/azuredevopsorgs_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewAzureDevOpsOrgsClient(subscriptionID string, credential azcore.TokenCred // BeginCreateOrUpdate - Creates or updates monitored Azure DevOps organization details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - orgName - The Azure DevOps organization name. @@ -74,7 +71,7 @@ func (client *AzureDevOpsOrgsClient) BeginCreateOrUpdate(ctx context.Context, re // CreateOrUpdate - Creates or updates monitored Azure DevOps organization details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 func (client *AzureDevOpsOrgsClient) createOrUpdate(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, azureDevOpsOrg AzureDevOpsOrg, options *AzureDevOpsOrgsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "AzureDevOpsOrgsClient.BeginCreateOrUpdate" @@ -97,7 +94,7 @@ func (client *AzureDevOpsOrgsClient) createOrUpdate(ctx context.Context, resourc } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AzureDevOpsOrgsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, azureDevOpsOrg AzureDevOpsOrg, options *AzureDevOpsOrgsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *AzureDevOpsOrgsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, azureDevOpsOrg AzureDevOpsOrg, _ *AzureDevOpsOrgsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -120,7 +117,7 @@ func (client *AzureDevOpsOrgsClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, azureDevOpsOrg); err != nil { @@ -132,7 +129,7 @@ func (client *AzureDevOpsOrgsClient) createOrUpdateCreateRequest(ctx context.Con // Get - Returns a monitored Azure DevOps organization resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - orgName - The Azure DevOps organization name. @@ -160,7 +157,7 @@ func (client *AzureDevOpsOrgsClient) Get(ctx context.Context, resourceGroupName } // getCreateRequest creates the Get request. -func (client *AzureDevOpsOrgsClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, options *AzureDevOpsOrgsClientGetOptions) (*policy.Request, error) { +func (client *AzureDevOpsOrgsClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, _ *AzureDevOpsOrgsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -183,7 +180,7 @@ func (client *AzureDevOpsOrgsClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -200,7 +197,7 @@ func (client *AzureDevOpsOrgsClient) getHandleResponse(resp *http.Response) (Azu // NewListPager - Returns a list of Azure DevOps organizations onboarded to the connector. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - options - AzureDevOpsOrgsClientListOptions contains the optional parameters for the AzureDevOpsOrgsClient.NewListPager @@ -229,7 +226,7 @@ func (client *AzureDevOpsOrgsClient) NewListPager(resourceGroupName string, secu } // listCreateRequest creates the List request. -func (client *AzureDevOpsOrgsClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, options *AzureDevOpsOrgsClientListOptions) (*policy.Request, error) { +func (client *AzureDevOpsOrgsClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, _ *AzureDevOpsOrgsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -248,7 +245,7 @@ func (client *AzureDevOpsOrgsClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -266,7 +263,7 @@ func (client *AzureDevOpsOrgsClient) listHandleResponse(resp *http.Response) (Az // ListAvailable - Returns a list of all Azure DevOps organizations accessible by the user token consumed by the connector. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - options - AzureDevOpsOrgsClientListAvailableOptions contains the optional parameters for the AzureDevOpsOrgsClient.ListAvailable @@ -294,7 +291,7 @@ func (client *AzureDevOpsOrgsClient) ListAvailable(ctx context.Context, resource } // listAvailableCreateRequest creates the ListAvailable request. -func (client *AzureDevOpsOrgsClient) listAvailableCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, options *AzureDevOpsOrgsClientListAvailableOptions) (*policy.Request, error) { +func (client *AzureDevOpsOrgsClient) listAvailableCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, _ *AzureDevOpsOrgsClientListAvailableOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/listAvailableAzureDevOpsOrgs" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -313,7 +310,7 @@ func (client *AzureDevOpsOrgsClient) listAvailableCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,7 +328,7 @@ func (client *AzureDevOpsOrgsClient) listAvailableHandleResponse(resp *http.Resp // BeginUpdate - Updates monitored Azure DevOps organization details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - orgName - The Azure DevOps organization name. @@ -359,7 +356,7 @@ func (client *AzureDevOpsOrgsClient) BeginUpdate(ctx context.Context, resourceGr // Update - Updates monitored Azure DevOps organization details. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 func (client *AzureDevOpsOrgsClient) update(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, azureDevOpsOrg AzureDevOpsOrg, options *AzureDevOpsOrgsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "AzureDevOpsOrgsClient.BeginUpdate" @@ -382,7 +379,7 @@ func (client *AzureDevOpsOrgsClient) update(ctx context.Context, resourceGroupNa } // updateCreateRequest creates the Update request. -func (client *AzureDevOpsOrgsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, azureDevOpsOrg AzureDevOpsOrg, options *AzureDevOpsOrgsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *AzureDevOpsOrgsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, azureDevOpsOrg AzureDevOpsOrg, _ *AzureDevOpsOrgsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -405,7 +402,7 @@ func (client *AzureDevOpsOrgsClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, azureDevOpsOrg); err != nil { diff --git a/sdk/resourcemanager/security/armsecurity/azuredevopsorgs_client_example_test.go b/sdk/resourcemanager/security/armsecurity/azuredevopsorgs_client_example_test.go deleted file mode 100644 index c3d16d9fc989..000000000000 --- a/sdk/resourcemanager/security/armsecurity/azuredevopsorgs_client_example_test.go +++ /dev/null @@ -1,235 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListAvailableAzureDevOpsOrgs_example.json -func ExampleAzureDevOpsOrgsClient_ListAvailable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAzureDevOpsOrgsClient().ListAvailable(ctx, "myRg", "mySecurityConnectorName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureDevOpsOrgListResponse = armsecurity.AzureDevOpsOrgListResponse{ - // Value: []*armsecurity.AzureDevOpsOrg{ - // { - // Name: to.Ptr("myAzDevOpsOrg"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/azureDevOpsOrgs"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/azureDevOpsOrgs/myAzDevOpsOrg"), - // Properties: &armsecurity.AzureDevOpsOrgProperties{ - // ActionableRemediation: &armsecurity.ActionableRemediation{ - // State: to.Ptr(armsecurity.ActionableRemediationStateEnabled), - // }, - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboarded), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("anotherOrg"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/azureDevOpsOrgs"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/azureDevOpsOrgs/anotherOrg"), - // Properties: &armsecurity.AzureDevOpsOrgProperties{ - // ActionableRemediation: &armsecurity.ActionableRemediation{ - // State: to.Ptr(armsecurity.ActionableRemediationStateEnabled), - // }, - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboardedByOtherConnector), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("notOnboardedOrg"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/azureDevOpsOrgs"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/azureDevOpsOrgs/notOnboardedOrg"), - // Properties: &armsecurity.AzureDevOpsOrgProperties{ - // ActionableRemediation: &armsecurity.ActionableRemediation{ - // State: to.Ptr(armsecurity.ActionableRemediationStateNone), - // }, - // OnboardingState: to.Ptr(armsecurity.OnboardingStateNotOnboarded), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListAzureDevOpsOrgs_example.json -func ExampleAzureDevOpsOrgsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAzureDevOpsOrgsClient().NewListPager("myRg", "mySecurityConnectorName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AzureDevOpsOrgListResponse = armsecurity.AzureDevOpsOrgListResponse{ - // Value: []*armsecurity.AzureDevOpsOrg{ - // { - // Name: to.Ptr("myAzDevOpsOrg"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/azureDevOpsOrgs"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/azureDevOpsOrgs/myAzDevOpsOrg"), - // Properties: &armsecurity.AzureDevOpsOrgProperties{ - // ActionableRemediation: &armsecurity.ActionableRemediation{ - // State: to.Ptr(armsecurity.ActionableRemediationStateEnabled), - // }, - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboarded), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetAzureDevOpsOrgs_example.json -func ExampleAzureDevOpsOrgsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAzureDevOpsOrgsClient().Get(ctx, "myRg", "mySecurityConnectorName", "myAzDevOpsOrg", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureDevOpsOrg = armsecurity.AzureDevOpsOrg{ - // Name: to.Ptr("myAzDevOpsOrg"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/azureDevOpsOrgs"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/azureDevOpsOrgs/myAzDevOpsOrg"), - // Properties: &armsecurity.AzureDevOpsOrgProperties{ - // ActionableRemediation: &armsecurity.ActionableRemediation{ - // State: to.Ptr(armsecurity.ActionableRemediationStateEnabled), - // }, - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboarded), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/CreateOrUpdateAzureDevOpsOrgs_example.json -func ExampleAzureDevOpsOrgsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAzureDevOpsOrgsClient().BeginCreateOrUpdate(ctx, "myRg", "mySecurityConnectorName", "myAzDevOpsOrg", armsecurity.AzureDevOpsOrg{ - Properties: &armsecurity.AzureDevOpsOrgProperties{ - ActionableRemediation: &armsecurity.ActionableRemediation{ - State: to.Ptr(armsecurity.ActionableRemediationStateEnabled), - }, - OnboardingState: to.Ptr(armsecurity.OnboardingStateNotApplicable), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureDevOpsOrg = armsecurity.AzureDevOpsOrg{ - // Name: to.Ptr("myAzDevOpsOrg"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/azureDevOpsOrgs"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/azureDevOpsOrgs/myAzDevOpsOrg"), - // Properties: &armsecurity.AzureDevOpsOrgProperties{ - // ActionableRemediation: &armsecurity.ActionableRemediation{ - // State: to.Ptr(armsecurity.ActionableRemediationStateEnabled), - // }, - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboarded), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/UpdateAzureDevOpsOrgs_example.json -func ExampleAzureDevOpsOrgsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAzureDevOpsOrgsClient().BeginUpdate(ctx, "myRg", "mySecurityConnectorName", "myAzDevOpsOrg", armsecurity.AzureDevOpsOrg{ - Properties: &armsecurity.AzureDevOpsOrgProperties{ - ActionableRemediation: &armsecurity.ActionableRemediation{ - State: to.Ptr(armsecurity.ActionableRemediationStateEnabled), - }, - OnboardingState: to.Ptr(armsecurity.OnboardingStateNotApplicable), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureDevOpsOrg = armsecurity.AzureDevOpsOrg{ - // Name: to.Ptr("myAzDevOpsOrg"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/azureDevOpsOrgs"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/azureDevOpsOrgs/myAzDevOpsOrg"), - // Properties: &armsecurity.AzureDevOpsOrgProperties{ - // ActionableRemediation: &armsecurity.ActionableRemediation{ - // State: to.Ptr(armsecurity.ActionableRemediationStateEnabled), - // }, - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboarded), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/azuredevopsprojects_client.go b/sdk/resourcemanager/security/armsecurity/azuredevopsprojects_client.go index 1f7451f44487..e9be44f1f001 100644 --- a/sdk/resourcemanager/security/armsecurity/azuredevopsprojects_client.go +++ b/sdk/resourcemanager/security/armsecurity/azuredevopsprojects_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewAzureDevOpsProjectsClient(subscriptionID string, credential azcore.Token // BeginCreateOrUpdate - Creates or updates a monitored Azure DevOps project resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - orgName - The Azure DevOps organization name. @@ -75,7 +72,7 @@ func (client *AzureDevOpsProjectsClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Creates or updates a monitored Azure DevOps project resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 func (client *AzureDevOpsProjectsClient) createOrUpdate(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, projectName string, azureDevOpsProject AzureDevOpsProject, options *AzureDevOpsProjectsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "AzureDevOpsProjectsClient.BeginCreateOrUpdate" @@ -98,7 +95,7 @@ func (client *AzureDevOpsProjectsClient) createOrUpdate(ctx context.Context, res } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AzureDevOpsProjectsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, projectName string, azureDevOpsProject AzureDevOpsProject, options *AzureDevOpsProjectsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *AzureDevOpsProjectsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, projectName string, azureDevOpsProject AzureDevOpsProject, _ *AzureDevOpsProjectsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -125,7 +122,7 @@ func (client *AzureDevOpsProjectsClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, azureDevOpsProject); err != nil { @@ -137,7 +134,7 @@ func (client *AzureDevOpsProjectsClient) createOrUpdateCreateRequest(ctx context // Get - Returns a monitored Azure DevOps project resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - orgName - The Azure DevOps organization name. @@ -166,7 +163,7 @@ func (client *AzureDevOpsProjectsClient) Get(ctx context.Context, resourceGroupN } // getCreateRequest creates the Get request. -func (client *AzureDevOpsProjectsClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, projectName string, options *AzureDevOpsProjectsClientGetOptions) (*policy.Request, error) { +func (client *AzureDevOpsProjectsClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, projectName string, _ *AzureDevOpsProjectsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -193,7 +190,7 @@ func (client *AzureDevOpsProjectsClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -210,7 +207,7 @@ func (client *AzureDevOpsProjectsClient) getHandleResponse(resp *http.Response) // NewListPager - Returns a list of Azure DevOps projects onboarded to the connector. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - orgName - The Azure DevOps organization name. @@ -240,7 +237,7 @@ func (client *AzureDevOpsProjectsClient) NewListPager(resourceGroupName string, } // listCreateRequest creates the List request. -func (client *AzureDevOpsProjectsClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, options *AzureDevOpsProjectsClientListOptions) (*policy.Request, error) { +func (client *AzureDevOpsProjectsClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, _ *AzureDevOpsProjectsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -263,7 +260,7 @@ func (client *AzureDevOpsProjectsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,7 +278,7 @@ func (client *AzureDevOpsProjectsClient) listHandleResponse(resp *http.Response) // BeginUpdate - Updates a monitored Azure DevOps project resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - orgName - The Azure DevOps organization name. @@ -310,7 +307,7 @@ func (client *AzureDevOpsProjectsClient) BeginUpdate(ctx context.Context, resour // Update - Updates a monitored Azure DevOps project resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 func (client *AzureDevOpsProjectsClient) update(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, projectName string, azureDevOpsProject AzureDevOpsProject, options *AzureDevOpsProjectsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "AzureDevOpsProjectsClient.BeginUpdate" @@ -333,7 +330,7 @@ func (client *AzureDevOpsProjectsClient) update(ctx context.Context, resourceGro } // updateCreateRequest creates the Update request. -func (client *AzureDevOpsProjectsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, projectName string, azureDevOpsProject AzureDevOpsProject, options *AzureDevOpsProjectsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *AzureDevOpsProjectsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, projectName string, azureDevOpsProject AzureDevOpsProject, _ *AzureDevOpsProjectsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -360,7 +357,7 @@ func (client *AzureDevOpsProjectsClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, azureDevOpsProject); err != nil { diff --git a/sdk/resourcemanager/security/armsecurity/azuredevopsprojects_client_example_test.go b/sdk/resourcemanager/security/armsecurity/azuredevopsprojects_client_example_test.go deleted file mode 100644 index 67af938543b5..000000000000 --- a/sdk/resourcemanager/security/armsecurity/azuredevopsprojects_client_example_test.go +++ /dev/null @@ -1,185 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListAzureDevOpsProjects_example.json -func ExampleAzureDevOpsProjectsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAzureDevOpsProjectsClient().NewListPager("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AzureDevOpsProjectListResponse = armsecurity.AzureDevOpsProjectListResponse{ - // Value: []*armsecurity.AzureDevOpsProject{ - // { - // Name: to.Ptr("myAzDevOpsProject"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/azureDevOpsOrgs/projects"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/azureDevOpsOrgs/myAzDevOpsOrg/projects/myAzDevOpsProject"), - // Properties: &armsecurity.AzureDevOpsProjectProperties{ - // ActionableRemediation: &armsecurity.ActionableRemediation{ - // State: to.Ptr(armsecurity.ActionableRemediationStateEnabled), - // }, - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboarded), - // ParentOrgName: to.Ptr("myAzDevOpsOrg"), - // ProjectID: to.Ptr("9ebbed8f-a9cc-405f-a647-b235e22179de"), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetAzureDevOpsProjects_example.json -func ExampleAzureDevOpsProjectsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAzureDevOpsProjectsClient().Get(ctx, "myRg", "mySecurityConnectorName", "myAzDevOpsOrg", "myAzDevOpsProject", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureDevOpsProject = armsecurity.AzureDevOpsProject{ - // Name: to.Ptr("myAzDevOpsProject"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/azureDevOpsOrgs/projects"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/azureDevOpsOrgs/myAzDevOpsOrg/projects/myAzDevOpsProject"), - // Properties: &armsecurity.AzureDevOpsProjectProperties{ - // ActionableRemediation: &armsecurity.ActionableRemediation{ - // State: to.Ptr(armsecurity.ActionableRemediationStateEnabled), - // }, - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboarded), - // ParentOrgName: to.Ptr("myAzDevOpsOrg"), - // ProjectID: to.Ptr("9ebbed8f-a9cc-405f-a647-b235e22179de"), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/CreateOrUpdateAzureDevOpsProjects_example.json -func ExampleAzureDevOpsProjectsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAzureDevOpsProjectsClient().BeginCreateOrUpdate(ctx, "myRg", "mySecurityConnectorName", "myAzDevOpsOrg", "myAzDevOpsProject", armsecurity.AzureDevOpsProject{ - Properties: &armsecurity.AzureDevOpsProjectProperties{ - ActionableRemediation: &armsecurity.ActionableRemediation{ - State: to.Ptr(armsecurity.ActionableRemediationStateEnabled), - }, - OnboardingState: to.Ptr(armsecurity.OnboardingStateNotApplicable), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureDevOpsProject = armsecurity.AzureDevOpsProject{ - // Name: to.Ptr("myAzDevOpsProject"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/azureDevOpsOrgs/projects"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/azureDevOpsOrgs/myAzDevOpsOrg/projects/myAzDevOpsProject"), - // Properties: &armsecurity.AzureDevOpsProjectProperties{ - // ActionableRemediation: &armsecurity.ActionableRemediation{ - // State: to.Ptr(armsecurity.ActionableRemediationStateEnabled), - // }, - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboarded), - // ParentOrgName: to.Ptr("myAzDevOpsOrg"), - // ProjectID: to.Ptr("9ebbed8f-a9cc-405f-a647-b235e22179de"), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/UpdateAzureDevOpsProjects_example.json -func ExampleAzureDevOpsProjectsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAzureDevOpsProjectsClient().BeginUpdate(ctx, "myRg", "mySecurityConnectorName", "myAzDevOpsOrg", "myAzDevOpsProject", armsecurity.AzureDevOpsProject{ - Properties: &armsecurity.AzureDevOpsProjectProperties{ - ActionableRemediation: &armsecurity.ActionableRemediation{ - State: to.Ptr(armsecurity.ActionableRemediationStateEnabled), - }, - OnboardingState: to.Ptr(armsecurity.OnboardingStateNotApplicable), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureDevOpsProject = armsecurity.AzureDevOpsProject{ - // Name: to.Ptr("myAzDevOpsProject"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/azureDevOpsOrgs/projects"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/azureDevOpsOrgs/myAzDevOpsOrg/projects/myAzDevOpsProject"), - // Properties: &armsecurity.AzureDevOpsProjectProperties{ - // ActionableRemediation: &armsecurity.ActionableRemediation{ - // State: to.Ptr(armsecurity.ActionableRemediationStateEnabled), - // }, - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboarded), - // ParentOrgName: to.Ptr("myAzDevOpsOrg"), - // ProjectID: to.Ptr("9ebbed8f-a9cc-405f-a647-b235e22179de"), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/azuredevopsrepos_client.go b/sdk/resourcemanager/security/armsecurity/azuredevopsrepos_client.go index be73e1f4adde..129c827ce44f 100644 --- a/sdk/resourcemanager/security/armsecurity/azuredevopsrepos_client.go +++ b/sdk/resourcemanager/security/armsecurity/azuredevopsrepos_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewAzureDevOpsReposClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Creates or updates a monitored Azure DevOps repository resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - orgName - The Azure DevOps organization name. @@ -76,7 +73,7 @@ func (client *AzureDevOpsReposClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Creates or updates a monitored Azure DevOps repository resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 func (client *AzureDevOpsReposClient) createOrUpdate(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, projectName string, repoName string, azureDevOpsRepository AzureDevOpsRepository, options *AzureDevOpsReposClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "AzureDevOpsReposClient.BeginCreateOrUpdate" @@ -99,7 +96,7 @@ func (client *AzureDevOpsReposClient) createOrUpdate(ctx context.Context, resour } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *AzureDevOpsReposClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, projectName string, repoName string, azureDevOpsRepository AzureDevOpsRepository, options *AzureDevOpsReposClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *AzureDevOpsReposClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, projectName string, repoName string, azureDevOpsRepository AzureDevOpsRepository, _ *AzureDevOpsReposClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}/repos/{repoName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -130,7 +127,7 @@ func (client *AzureDevOpsReposClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, azureDevOpsRepository); err != nil { @@ -142,7 +139,7 @@ func (client *AzureDevOpsReposClient) createOrUpdateCreateRequest(ctx context.Co // Get - Returns a monitored Azure DevOps repository resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - orgName - The Azure DevOps organization name. @@ -172,7 +169,7 @@ func (client *AzureDevOpsReposClient) Get(ctx context.Context, resourceGroupName } // getCreateRequest creates the Get request. -func (client *AzureDevOpsReposClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, projectName string, repoName string, options *AzureDevOpsReposClientGetOptions) (*policy.Request, error) { +func (client *AzureDevOpsReposClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, projectName string, repoName string, _ *AzureDevOpsReposClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}/repos/{repoName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -203,7 +200,7 @@ func (client *AzureDevOpsReposClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -220,7 +217,7 @@ func (client *AzureDevOpsReposClient) getHandleResponse(resp *http.Response) (Az // NewListPager - Returns a list of Azure DevOps repositories onboarded to the connector. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - orgName - The Azure DevOps organization name. @@ -251,7 +248,7 @@ func (client *AzureDevOpsReposClient) NewListPager(resourceGroupName string, sec } // listCreateRequest creates the List request. -func (client *AzureDevOpsReposClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, projectName string, options *AzureDevOpsReposClientListOptions) (*policy.Request, error) { +func (client *AzureDevOpsReposClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, projectName string, _ *AzureDevOpsReposClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}/repos" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -278,7 +275,7 @@ func (client *AzureDevOpsReposClient) listCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -296,7 +293,7 @@ func (client *AzureDevOpsReposClient) listHandleResponse(resp *http.Response) (A // BeginUpdate - Updates a monitored Azure DevOps repository resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - orgName - The Azure DevOps organization name. @@ -326,7 +323,7 @@ func (client *AzureDevOpsReposClient) BeginUpdate(ctx context.Context, resourceG // Update - Updates a monitored Azure DevOps repository resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 func (client *AzureDevOpsReposClient) update(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, projectName string, repoName string, azureDevOpsRepository AzureDevOpsRepository, options *AzureDevOpsReposClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "AzureDevOpsReposClient.BeginUpdate" @@ -349,7 +346,7 @@ func (client *AzureDevOpsReposClient) update(ctx context.Context, resourceGroupN } // updateCreateRequest creates the Update request. -func (client *AzureDevOpsReposClient) updateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, projectName string, repoName string, azureDevOpsRepository AzureDevOpsRepository, options *AzureDevOpsReposClientBeginUpdateOptions) (*policy.Request, error) { +func (client *AzureDevOpsReposClient) updateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, projectName string, repoName string, azureDevOpsRepository AzureDevOpsRepository, _ *AzureDevOpsReposClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/azureDevOpsOrgs/{orgName}/projects/{projectName}/repos/{repoName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -380,7 +377,7 @@ func (client *AzureDevOpsReposClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, azureDevOpsRepository); err != nil { diff --git a/sdk/resourcemanager/security/armsecurity/azuredevopsrepos_client_example_test.go b/sdk/resourcemanager/security/armsecurity/azuredevopsrepos_client_example_test.go deleted file mode 100644 index 86fa647a942f..000000000000 --- a/sdk/resourcemanager/security/armsecurity/azuredevopsrepos_client_example_test.go +++ /dev/null @@ -1,189 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListAzureDevOpsRepos_example.json -func ExampleAzureDevOpsReposClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAzureDevOpsReposClient().NewListPager("myRg", "mySecurityConnectorName", "myAzDevOpsOrg", "myAzDevOpsProject", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AzureDevOpsRepositoryListResponse = armsecurity.AzureDevOpsRepositoryListResponse{ - // Value: []*armsecurity.AzureDevOpsRepository{ - // { - // Name: to.Ptr("myAzDevOpsRepo"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/azureDevOpsOrgs/projects/repos"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/azureDevOpsOrgs/myAzDevOpsOrg/projects/myAzDevOpsProject/repos/myAzDevOpsRepo"), - // Properties: &armsecurity.AzureDevOpsRepositoryProperties{ - // ActionableRemediation: &armsecurity.ActionableRemediation{ - // State: to.Ptr(armsecurity.ActionableRemediationStateEnabled), - // }, - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboarded), - // ParentOrgName: to.Ptr("myAzDevOpsOrg"), - // ParentProjectName: to.Ptr("myAzDevOpsProject"), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // RepoID: to.Ptr("cb64ab91-c9ba-46df-b44c-c769358bccdf"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetAzureDevOpsRepos_example.json -func ExampleAzureDevOpsReposClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAzureDevOpsReposClient().Get(ctx, "myRg", "mySecurityConnectorName", "myAzDevOpsOrg", "myAzDevOpsProject", "myAzDevOpsRepo", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureDevOpsRepository = armsecurity.AzureDevOpsRepository{ - // Name: to.Ptr("myAzDevOpsRepo"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/azureDevOpsOrgs/projects/repos"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/azureDevOpsOrgs/myAzDevOpsOrg/projects/myAzDevOpsProject/repos/myAzDevOpsRepo"), - // Properties: &armsecurity.AzureDevOpsRepositoryProperties{ - // ActionableRemediation: &armsecurity.ActionableRemediation{ - // State: to.Ptr(armsecurity.ActionableRemediationStateEnabled), - // }, - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboarded), - // ParentOrgName: to.Ptr("myAzDevOpsOrg"), - // ParentProjectName: to.Ptr("myAzDevOpsProject"), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // RepoID: to.Ptr("cb64ab91-c9ba-46df-b44c-c769358bccdf"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/CreateOrUpdateAzureDevOpsRepos_example.json -func ExampleAzureDevOpsReposClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAzureDevOpsReposClient().BeginCreateOrUpdate(ctx, "myRg", "mySecurityConnectorName", "myAzDevOpsOrg", "myAzDevOpsProject", "myAzDevOpsRepo", armsecurity.AzureDevOpsRepository{ - Properties: &armsecurity.AzureDevOpsRepositoryProperties{ - ActionableRemediation: &armsecurity.ActionableRemediation{ - State: to.Ptr(armsecurity.ActionableRemediationStateEnabled), - }, - OnboardingState: to.Ptr(armsecurity.OnboardingStateNotApplicable), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureDevOpsRepository = armsecurity.AzureDevOpsRepository{ - // Name: to.Ptr("myAzDevOpsRepo"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/azureDevOpsOrgs/projects/repos"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/azureDevOpsOrgs/myAzDevOpsOrg/projects/myAzDevOpsProject/repos/myAzDevOpsRepo"), - // Properties: &armsecurity.AzureDevOpsRepositoryProperties{ - // ActionableRemediation: &armsecurity.ActionableRemediation{ - // State: to.Ptr(armsecurity.ActionableRemediationStateEnabled), - // }, - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboarded), - // ParentOrgName: to.Ptr("myAzDevOpsOrg"), - // ParentProjectName: to.Ptr("myAzDevOpsProject"), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // RepoID: to.Ptr("cb64ab91-c9ba-46df-b44c-c769358bccdf"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/UpdateAzureDevOpsRepos_example.json -func ExampleAzureDevOpsReposClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewAzureDevOpsReposClient().BeginUpdate(ctx, "myRg", "mySecurityConnectorName", "myAzDevOpsOrg", "myAzDevOpsProject", "myAzDevOpsRepo", armsecurity.AzureDevOpsRepository{ - Properties: &armsecurity.AzureDevOpsRepositoryProperties{ - ActionableRemediation: &armsecurity.ActionableRemediation{ - State: to.Ptr(armsecurity.ActionableRemediationStateEnabled), - }, - OnboardingState: to.Ptr(armsecurity.OnboardingStateNotApplicable), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureDevOpsRepository = armsecurity.AzureDevOpsRepository{ - // Name: to.Ptr("myAzDevOpsRepo"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/azureDevOpsOrgs/projects/repos"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/azureDevOpsOrgs/myAzDevOpsOrg/projects/myAzDevOpsProject/repos/myAzDevOpsRepo"), - // Properties: &armsecurity.AzureDevOpsRepositoryProperties{ - // ActionableRemediation: &armsecurity.ActionableRemediation{ - // State: to.Ptr(armsecurity.ActionableRemediationStateEnabled), - // }, - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboarded), - // ParentOrgName: to.Ptr("myAzDevOpsOrg"), - // ParentProjectName: to.Ptr("myAzDevOpsProject"), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // RepoID: to.Ptr("cb64ab91-c9ba-46df-b44c-c769358bccdf"), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/client_factory.go b/sdk/resourcemanager/security/armsecurity/client_factory.go index 53440ccda54d..1b76eb421a09 100644 --- a/sdk/resourcemanager/security/armsecurity/client_factory.go +++ b/sdk/resourcemanager/security/armsecurity/client_factory.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -52,22 +49,6 @@ func (c *ClientFactory) NewAccountConnectorsClient() *AccountConnectorsClient { } } -// NewAdaptiveApplicationControlsClient creates a new instance of AdaptiveApplicationControlsClient. -func (c *ClientFactory) NewAdaptiveApplicationControlsClient() *AdaptiveApplicationControlsClient { - return &AdaptiveApplicationControlsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - -// NewAdaptiveNetworkHardeningsClient creates a new instance of AdaptiveNetworkHardeningsClient. -func (c *ClientFactory) NewAdaptiveNetworkHardeningsClient() *AdaptiveNetworkHardeningsClient { - return &AdaptiveNetworkHardeningsClient{ - subscriptionID: c.subscriptionID, - internal: c.internal, - } -} - // NewAdvancedThreatProtectionClient creates a new instance of AdvancedThreatProtectionClient. func (c *ClientFactory) NewAdvancedThreatProtectionClient() *AdvancedThreatProtectionClient { return &AdvancedThreatProtectionClient{ @@ -232,6 +213,13 @@ func (c *ClientFactory) NewCustomEntityStoreAssignmentsClient() *CustomEntitySto } } +// NewCustomRecommendationsClient creates a new instance of CustomRecommendationsClient. +func (c *ClientFactory) NewCustomRecommendationsClient() *CustomRecommendationsClient { + return &CustomRecommendationsClient{ + internal: c.internal, + } +} + // NewDefenderForStorageClient creates a new instance of DefenderForStorageClient. func (c *ClientFactory) NewDefenderForStorageClient() *DefenderForStorageClient { return &DefenderForStorageClient{ @@ -548,6 +536,20 @@ func (c *ClientFactory) NewSolutionsReferenceDataClient() *SolutionsReferenceDat } } +// NewStandardAssignmentsClient creates a new instance of StandardAssignmentsClient. +func (c *ClientFactory) NewStandardAssignmentsClient() *StandardAssignmentsClient { + return &StandardAssignmentsClient{ + internal: c.internal, + } +} + +// NewStandardsClient creates a new instance of StandardsClient. +func (c *ClientFactory) NewStandardsClient() *StandardsClient { + return &StandardsClient{ + internal: c.internal, + } +} + // NewSubAssessmentsClient creates a new instance of SubAssessmentsClient. func (c *ClientFactory) NewSubAssessmentsClient() *SubAssessmentsClient { return &SubAssessmentsClient{ diff --git a/sdk/resourcemanager/security/armsecurity/complianceresults_client.go b/sdk/resourcemanager/security/armsecurity/complianceresults_client.go index 8939dd56b750..1ae83151a15c 100644 --- a/sdk/resourcemanager/security/armsecurity/complianceresults_client.go +++ b/sdk/resourcemanager/security/armsecurity/complianceresults_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -70,7 +67,7 @@ func (client *ComplianceResultsClient) Get(ctx context.Context, resourceID strin } // getCreateRequest creates the Get request. -func (client *ComplianceResultsClient) getCreateRequest(ctx context.Context, resourceID string, complianceResultName string, options *ComplianceResultsClientGetOptions) (*policy.Request, error) { +func (client *ComplianceResultsClient) getCreateRequest(ctx context.Context, resourceID string, complianceResultName string, _ *ComplianceResultsClientGetOptions) (*policy.Request, error) { urlPath := "/{resourceId}/providers/Microsoft.Security/complianceResults/{complianceResultName}" urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID) if complianceResultName == "" { @@ -128,7 +125,7 @@ func (client *ComplianceResultsClient) NewListPager(scope string, options *Compl } // listCreateRequest creates the List request. -func (client *ComplianceResultsClient) listCreateRequest(ctx context.Context, scope string, options *ComplianceResultsClientListOptions) (*policy.Request, error) { +func (client *ComplianceResultsClient) listCreateRequest(ctx context.Context, scope string, _ *ComplianceResultsClientListOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/complianceResults" urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) 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 57870a0841e1..000000000000 --- a/sdk/resourcemanager/security/armsecurity/complianceresults_client_example_test.go +++ /dev/null @@ -1,98 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2017-08-01/examples/ComplianceResults/ListComplianceResults_example.json -func ExampleComplianceResultsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewComplianceResultsClient().NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ComplianceResultList = armsecurity.ComplianceResultList{ - // Value: []*armsecurity.ComplianceResult{ - // { - // Name: to.Ptr("DesignateMoreThanOneOwner"), - // Type: to.Ptr("Microsoft.Security/complianceResults"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/complianceResults/DesignateMoreThanOneOwner"), - // Properties: &armsecurity.ComplianceResultProperties{ - // ResourceStatus: to.Ptr(armsecurity.ResourceStatusHealthy), - // }, - // }, - // { - // Name: to.Ptr("RemoveExternalAccountsWithReadPermissions"), - // Type: to.Ptr("Microsoft.Security/complianceResults"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/complianceResults/RemoveExternalAccountsWithReadPermissions"), - // Properties: &armsecurity.ComplianceResultProperties{ - // ResourceStatus: to.Ptr(armsecurity.ResourceStatusNotHealthy), - // }, - // }, - // { - // Name: to.Ptr("RemoveDeprecatedAccounts"), - // Type: to.Ptr("Microsoft.Security/complianceResults"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/complianceResults/RemoveDeprecatedAccounts"), - // Properties: &armsecurity.ComplianceResultProperties{ - // ResourceStatus: to.Ptr(armsecurity.ResourceStatusHealthy), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2017-08-01/examples/ComplianceResults/GetComplianceResults_example.json -func ExampleComplianceResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewComplianceResultsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "DesignateMoreThanOneOwner", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ComplianceResult = armsecurity.ComplianceResult{ - // Name: to.Ptr("DesignateMoreThanOneOwner"), - // Type: to.Ptr("Microsoft.Security/complianceResults"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/complianceResults/DesignateMoreThanOneOwner"), - // Properties: &armsecurity.ComplianceResultProperties{ - // ResourceStatus: to.Ptr(armsecurity.ResourceStatusHealthy), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/compliances_client.go b/sdk/resourcemanager/security/armsecurity/compliances_client.go index 7700a00189c5..a1816b41c780 100644 --- a/sdk/resourcemanager/security/armsecurity/compliances_client.go +++ b/sdk/resourcemanager/security/armsecurity/compliances_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -71,7 +68,7 @@ func (client *CompliancesClient) Get(ctx context.Context, scope string, complian } // getCreateRequest creates the Get request. -func (client *CompliancesClient) getCreateRequest(ctx context.Context, scope string, complianceName string, options *CompliancesClientGetOptions) (*policy.Request, error) { +func (client *CompliancesClient) getCreateRequest(ctx context.Context, scope string, complianceName string, _ *CompliancesClientGetOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/compliances/{complianceName}" urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) if complianceName == "" { @@ -128,7 +125,7 @@ func (client *CompliancesClient) NewListPager(scope string, options *Compliances } // listCreateRequest creates the List request. -func (client *CompliancesClient) listCreateRequest(ctx context.Context, scope string, options *CompliancesClientListOptions) (*policy.Request, error) { +func (client *CompliancesClient) listCreateRequest(ctx context.Context, scope string, _ *CompliancesClientListOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/compliances" urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) 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 e244299c34fe..000000000000 --- a/sdk/resourcemanager/security/armsecurity/compliances_client_example_test.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/Compliances/GetCompliances_example.json -func ExampleCompliancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCompliancesClient().NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ComplianceList = armsecurity.ComplianceList{ - // Value: []*armsecurity.Compliance{ - // { - // Name: to.Ptr("2018-01-01Z"), - // Type: to.Ptr("Microsoft.Security/compliances"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/compliances/2018-01-01Z"), - // Properties: &armsecurity.ComplianceProperties{ - // AssessmentResult: []*armsecurity.ComplianceSegment{ - // { - // Percentage: to.Ptr[float64](77.77777777777779), - // SegmentType: to.Ptr("Compliant"), - // }}, - // AssessmentTimestampUTCDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // ResourceCount: to.Ptr[int32](18), - // }, - // }, - // { - // Name: to.Ptr("2018-01-02Z"), - // Type: to.Ptr("Microsoft.Security/compliances"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/compliances/2018-01-02Z"), - // Properties: &armsecurity.ComplianceProperties{ - // AssessmentResult: []*armsecurity.ComplianceSegment{ - // { - // Percentage: to.Ptr[float64](94.44444444444444), - // SegmentType: to.Ptr("Compliant"), - // }}, - // AssessmentTimestampUTCDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-02T00:00:00.000Z"); return t}()), - // ResourceCount: to.Ptr[int32](18), - // }, - // }, - // { - // Name: to.Ptr("2018-01-03Z"), - // Type: to.Ptr("Microsoft.Security/compliances"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/compliances/2018-01-03Z"), - // Properties: &armsecurity.ComplianceProperties{ - // AssessmentResult: []*armsecurity.ComplianceSegment{ - // { - // Percentage: to.Ptr[float64](100), - // SegmentType: to.Ptr("Compliant"), - // }}, - // AssessmentTimestampUTCDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-03T00:00:00.000Z"); return t}()), - // ResourceCount: to.Ptr[int32](18), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/Compliances/GetCompliance_example.json -func ExampleCompliancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCompliancesClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "2018-01-01Z", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Compliance = armsecurity.Compliance{ - // Name: to.Ptr("2018-01-01Z"), - // Type: to.Ptr("Microsoft.Security/compliances"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/compliances/2018-01-01Z"), - // Properties: &armsecurity.ComplianceProperties{ - // AssessmentResult: []*armsecurity.ComplianceSegment{ - // { - // Percentage: to.Ptr[float64](77.77777777777779), - // SegmentType: to.Ptr("Compliant"), - // }}, - // AssessmentTimestampUTCDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // ResourceCount: to.Ptr[int32](18), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/connectorapplication_client.go b/sdk/resourcemanager/security/armsecurity/connectorapplication_client.go index 4a1cb5501d5f..7e1e634a37c0 100644 --- a/sdk/resourcemanager/security/armsecurity/connectorapplication_client.go +++ b/sdk/resourcemanager/security/armsecurity/connectorapplication_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -76,7 +73,7 @@ func (client *ConnectorApplicationClient) CreateOrUpdate(ctx context.Context, re } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ConnectorApplicationClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, applicationID string, application Application, options *ConnectorApplicationClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ConnectorApplicationClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, applicationID string, application Application, _ *ConnectorApplicationClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -148,7 +145,7 @@ func (client *ConnectorApplicationClient) Delete(ctx context.Context, resourceGr } // deleteCreateRequest creates the Delete request. -func (client *ConnectorApplicationClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, applicationID string, options *ConnectorApplicationClientDeleteOptions) (*policy.Request, error) { +func (client *ConnectorApplicationClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, applicationID string, _ *ConnectorApplicationClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -208,7 +205,7 @@ func (client *ConnectorApplicationClient) Get(ctx context.Context, resourceGroup } // getCreateRequest creates the Get request. -func (client *ConnectorApplicationClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, applicationID string, options *ConnectorApplicationClientGetOptions) (*policy.Request, error) { +func (client *ConnectorApplicationClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, applicationID string, _ *ConnectorApplicationClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications/{applicationId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 fdc1c97b55cf..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectorapplication_client_example_test.go +++ /dev/null @@ -1,132 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/GetSecurityConnectorApplication_example.json -func ExampleConnectorApplicationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectorApplicationClient().Get(ctx, "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Application = armsecurity.Application{ - // Name: to.Ptr("ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Type: to.Ptr("Microsoft.Security/applications"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector/providers/Microsoft.Security/applications/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.ApplicationProperties{ - // Description: to.Ptr("An application on critical GCP recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "contains", - // "property": "$.Id", - // "value": "-bil-", - // }, - // }, - // }}, - // DisplayName: to.Ptr("GCP Admin's application"), - // SourceResourceType: to.Ptr(armsecurity.ApplicationSourceResourceTypeAssessments), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/PutSecurityConnectorApplication_example.json -func ExampleConnectorApplicationClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectorApplicationClient().CreateOrUpdate(ctx, "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", armsecurity.Application{ - Properties: &armsecurity.ApplicationProperties{ - Description: to.Ptr("An application on critical GCP recommendations"), - ConditionSets: []any{ - map[string]any{ - "conditions": []any{ - map[string]any{ - "operator": "contains", - "property": "$.Id", - "value": "-prod-", - }, - }, - }}, - DisplayName: to.Ptr("GCP Admin's application"), - SourceResourceType: to.Ptr(armsecurity.ApplicationSourceResourceTypeAssessments), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Application = armsecurity.Application{ - // Name: to.Ptr("1f3afdf9-d0c9-4c3d-847f-89da613e70a8"), - // Type: to.Ptr("Microsoft.Security/applications"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector/providers/Microsoft.Security/applications/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.ApplicationProperties{ - // Description: to.Ptr("An application on critical GCP recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "contains", - // "property": "$.Id", - // "value": "-bil-", - // }, - // }, - // }}, - // DisplayName: to.Ptr("GCP Admin's application"), - // SourceResourceType: to.Ptr(armsecurity.ApplicationSourceResourceTypeAssessments), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/DeleteSecurityConnectorApplication_example.json -func ExampleConnectorApplicationClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewConnectorApplicationClient().Delete(ctx, "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/connectorapplications_client.go b/sdk/resourcemanager/security/armsecurity/connectorapplications_client.go index afd889de2344..59afef99af99 100644 --- a/sdk/resourcemanager/security/armsecurity/connectorapplications_client.go +++ b/sdk/resourcemanager/security/armsecurity/connectorapplications_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -74,7 +71,7 @@ func (client *ConnectorApplicationsClient) NewListPager(resourceGroupName string } // listCreateRequest creates the List request. -func (client *ConnectorApplicationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, options *ConnectorApplicationsClientListOptions) (*policy.Request, error) { +func (client *ConnectorApplicationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, _ *ConnectorApplicationsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/applications" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 830bd48f5681..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectorapplications_client_example_test.go +++ /dev/null @@ -1,86 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ListBySecurityConnectorApplications_example.json -func ExampleConnectorApplicationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConnectorApplicationsClient().NewListPager("gcpResourceGroup", "gcpconnector", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ApplicationsList = armsecurity.ApplicationsList{ - // Value: []*armsecurity.Application{ - // { - // Name: to.Ptr("ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Type: to.Ptr("Microsoft.Security/applications"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector/providers/Microsoft.Security/applications/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.ApplicationProperties{ - // Description: to.Ptr("An application on critical GCP recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "contains", - // "property": "$.Id", - // "value": "-bil-", - // }, - // }, - // }}, - // DisplayName: to.Ptr("Admin's GCP application"), - // SourceResourceType: to.Ptr(armsecurity.ApplicationSourceResourceTypeAssessments), - // }, - // }, - // { - // Name: to.Ptr("4106f43c-6d82-4fc8-a92c-dcfe50799d1d"), - // Type: to.Ptr("Microsoft.Security/applications"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector/providers/Microsoft.Security/applications/4106f43c-6d82-4fc8-a92c-dcfe50799d1d"), - // Properties: &armsecurity.ApplicationProperties{ - // Description: to.Ptr("An application on critical GCP recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "contains", - // "property": "$.Id", - // "value": "-prod-", - // }, - // }, - // }}, - // DisplayName: to.Ptr("GCP Admin's application"), - // SourceResourceType: to.Ptr(armsecurity.ApplicationSourceResourceTypeAssessments), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/connectors_client.go b/sdk/resourcemanager/security/armsecurity/connectors_client.go index faf0ddbf424c..4213e8faba30 100644 --- a/sdk/resourcemanager/security/armsecurity/connectors_client.go +++ b/sdk/resourcemanager/security/armsecurity/connectors_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -47,7 +44,7 @@ func NewConnectorsClient(subscriptionID string, credential azcore.TokenCredentia // is issued for the same security connector id, then it will be updated. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2024-03-01-preview +// Generated from API version 2024-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 @@ -76,7 +73,7 @@ func (client *ConnectorsClient) CreateOrUpdate(ctx context.Context, resourceGrou } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ConnectorsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, securityConnector Connector, options *ConnectorsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ConnectorsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, securityConnector Connector, _ *ConnectorsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -95,7 +92,7 @@ func (client *ConnectorsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01-preview") + reqQP.Set("api-version", "2024-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, securityConnector); err != nil { @@ -116,7 +113,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 2024-03-01-preview +// Generated from API version 2024-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. @@ -142,7 +139,7 @@ func (client *ConnectorsClient) Delete(ctx context.Context, resourceGroupName st } // deleteCreateRequest creates the Delete request. -func (client *ConnectorsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, options *ConnectorsClientDeleteOptions) (*policy.Request, error) { +func (client *ConnectorsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, _ *ConnectorsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -161,7 +158,7 @@ func (client *ConnectorsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01-preview") + reqQP.Set("api-version", "2024-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -170,7 +167,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 2024-03-01-preview +// Generated from API version 2024-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. @@ -197,7 +194,7 @@ func (client *ConnectorsClient) Get(ctx context.Context, resourceGroupName strin } // getCreateRequest creates the Get request. -func (client *ConnectorsClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, options *ConnectorsClientGetOptions) (*policy.Request, error) { +func (client *ConnectorsClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, _ *ConnectorsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -216,7 +213,7 @@ func (client *ConnectorsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01-preview") + reqQP.Set("api-version", "2024-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,7 +231,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 2024-03-01-preview +// Generated from API version 2024-08-01-preview // - options - ConnectorsClientListOptions contains the optional parameters for the ConnectorsClient.NewListPager method. func (client *ConnectorsClient) NewListPager(options *ConnectorsClientListOptions) *runtime.Pager[ConnectorsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ConnectorsClientListResponse]{ @@ -260,7 +257,7 @@ func (client *ConnectorsClient) NewListPager(options *ConnectorsClientListOption } // listCreateRequest creates the List request. -func (client *ConnectorsClient) listCreateRequest(ctx context.Context, options *ConnectorsClientListOptions) (*policy.Request, error) { +func (client *ConnectorsClient) listCreateRequest(ctx context.Context, _ *ConnectorsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityConnectors" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -271,7 +268,7 @@ func (client *ConnectorsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01-preview") + reqQP.Set("api-version", "2024-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -289,7 +286,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 2024-03-01-preview +// Generated from API version 2024-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.NewListByResourceGroupPager // method. @@ -317,7 +314,7 @@ func (client *ConnectorsClient) NewListByResourceGroupPager(resourceGroupName st } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *ConnectorsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *ConnectorsClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *ConnectorsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *ConnectorsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -332,7 +329,7 @@ func (client *ConnectorsClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01-preview") + reqQP.Set("api-version", "2024-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -350,7 +347,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 2024-03-01-preview +// Generated from API version 2024-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 @@ -378,7 +375,7 @@ func (client *ConnectorsClient) Update(ctx context.Context, resourceGroupName st } // updateCreateRequest creates the Update request. -func (client *ConnectorsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, securityConnector Connector, options *ConnectorsClientUpdateOptions) (*policy.Request, error) { +func (client *ConnectorsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, securityConnector Connector, _ *ConnectorsClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -397,7 +394,7 @@ func (client *ConnectorsClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2024-03-01-preview") + reqQP.Set("api-version", "2024-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, securityConnector); err != nil { 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 561926048bf1..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectors_client_example_test.go +++ /dev/null @@ -1,564 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2024-03-01-preview/examples/SecurityConnectors/GetSecurityConnectorsSubscription_example.json -func ExampleConnectorsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConnectorsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ConnectorsList = armsecurity.ConnectorsList{ - // Value: []*armsecurity.Connector{ - // { - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("exampleSecurityConnectorAws"), - // Type: to.Ptr("Microsoft.Security/securityConnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup1/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorAws"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.AwsEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeAwsAccount), - // ScanInterval: to.Ptr[int64](4), - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameAWS), - // HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorAwsOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorAws), - // NativeCloudConnection: &armsecurity.CspmMonitorAwsOfferingNativeCloudConnection{ - // CloudRoleArn: to.Ptr("arn:aws:iam::00000000:role/ASCMonitor"), - // }, - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("exampleSecurityConnectorAwsOrganization"), - // Type: to.Ptr("Microsoft.Security/securityConnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup2/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorAwsOrganization"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.AwsEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeAwsAccount), - // OrganizationalData: &armsecurity.AwsOrganizationalDataMaster{ - // OrganizationMembershipType: to.Ptr(armsecurity.OrganizationMembershipTypeOrganization), - // ExcludedAccountIDs: []*string{ - // to.Ptr("excludedAccountIdExample")}, - // StacksetName: to.Ptr("myStackSetName"), - // }, - // ScanInterval: to.Ptr[int64](4), - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameAWS), - // HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorAwsOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorAws), - // NativeCloudConnection: &armsecurity.CspmMonitorAwsOfferingNativeCloudConnection{ - // CloudRoleArn: to.Ptr("arn:aws:iam::00000000:role/ASCMonitor"), - // }, - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("githubTest"), - // Type: to.Ptr("Microsoft.Security/securityconnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup3/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorGithub"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.GithubScopeEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeGithubScope), - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameGithub), - // HierarchyIdentifier: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup3/providers/Microsoft.SecurityDevops/githubConnectors/exampleGithubConnector"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorGithubOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorGithub), - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("AzureDevOpsTest"), - // Type: to.Ptr("Microsoft.Security/securityconnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup3/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorAzureDevOpsConnectors"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.GithubScopeEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeGithubScope), - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameGithub), - // HierarchyIdentifier: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup3/providers/Microsoft.SecurityDevops/azureDevOpsConnectors/exampleAzureDevOpsConnector"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorGithubOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorGithub), - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("exampleSecurityConnectorGcp"), - // Type: to.Ptr("Microsoft.Security/securityConnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup3/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorGcp"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.GcpProjectEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeGcpProject), - // ProjectDetails: &armsecurity.GcpProjectDetails{ - // ProjectID: to.Ptr("My-0GCP-Project"), - // ProjectNumber: to.Ptr("exampleHierarchyId"), - // WorkloadIdentityPoolID: to.Ptr("6c78da41157548d3b1d8b3c72effdf8c"), - // }, - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameGCP), - // HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorGcpOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorGcp), - // NativeCloudConnection: &armsecurity.CspmMonitorGcpOfferingNativeCloudConnection{ - // ServiceAccountEmailAddress: to.Ptr("capm@projectName.com"), - // WorkloadIdentityProviderID: to.Ptr("My workload identity provider Id"), - // }, - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2024-03-01-preview/examples/SecurityConnectors/GetSecurityConnectorsResourceGroup_example.json -func ExampleConnectorsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewConnectorsClient().NewListByResourceGroupPager("exampleResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ConnectorsList = armsecurity.ConnectorsList{ - // Value: []*armsecurity.Connector{ - // { - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("exampleSecurityConnectorAws"), - // Type: to.Ptr("Microsoft.Security/securityConnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorAws"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.AwsEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeAwsAccount), - // ScanInterval: to.Ptr[int64](4), - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameAWS), - // HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorAwsOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorAws), - // NativeCloudConnection: &armsecurity.CspmMonitorAwsOfferingNativeCloudConnection{ - // CloudRoleArn: to.Ptr("arn:aws:iam::00000000:role/ASCMonitor"), - // }, - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("exampleSecurityConnectorAwsOrganization"), - // Type: to.Ptr("Microsoft.Security/securityConnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorAwsOrganization"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.AwsEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeAwsAccount), - // OrganizationalData: &armsecurity.AwsOrganizationalDataMaster{ - // OrganizationMembershipType: to.Ptr(armsecurity.OrganizationMembershipTypeOrganization), - // ExcludedAccountIDs: []*string{ - // to.Ptr("excludedAccountIdExample")}, - // StacksetName: to.Ptr("myStackSetName"), - // }, - // ScanInterval: to.Ptr[int64](4), - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameAWS), - // HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorAwsOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorAws), - // NativeCloudConnection: &armsecurity.CspmMonitorAwsOfferingNativeCloudConnection{ - // CloudRoleArn: to.Ptr("arn:aws:iam::00000000:role/ASCMonitor"), - // }, - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("exampleSecurityConnectorGcp"), - // Type: to.Ptr("Microsoft.Security/securityConnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorGcp"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.GcpProjectEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeGcpProject), - // ProjectDetails: &armsecurity.GcpProjectDetails{ - // ProjectID: to.Ptr("My-0GCP-Project"), - // ProjectNumber: to.Ptr("exampleHierarchyId"), - // WorkloadIdentityPoolID: to.Ptr("My-workload-identity-federation-pool-id"), - // }, - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameGCP), - // HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorGcpOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorGcp), - // NativeCloudConnection: &armsecurity.CspmMonitorGcpOfferingNativeCloudConnection{ - // ServiceAccountEmailAddress: to.Ptr("capm@projectName.com"), - // WorkloadIdentityProviderID: to.Ptr("My workload identity provider Id"), - // }, - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2024-03-01-preview/examples/SecurityConnectors/GetSecurityConnectorSingleResource_example.json -func ExampleConnectorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectorsClient().Get(ctx, "exampleResourceGroup", "exampleSecurityConnectorName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Connector = armsecurity.Connector{ - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("exampleSecurityConnectorName"), - // Type: to.Ptr("Microsoft.Security/securityConnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorName"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.AwsEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeAwsAccount), - // ScanInterval: to.Ptr[int64](4), - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameAWS), - // HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorAwsOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorAws), - // NativeCloudConnection: &armsecurity.CspmMonitorAwsOfferingNativeCloudConnection{ - // CloudRoleArn: to.Ptr("arn:aws:iam::00000000:role/ASCMonitor"), - // }, - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2024-03-01-preview/examples/SecurityConnectors/PutSecurityConnector_example.json -func ExampleConnectorsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectorsClient().CreateOrUpdate(ctx, "exampleResourceGroup", "exampleSecurityConnectorName", armsecurity.Connector{ - Location: to.Ptr("Central US"), - Etag: to.Ptr("etag value (must be supplied for update)"), - Tags: map[string]*string{}, - Properties: &armsecurity.ConnectorProperties{ - EnvironmentData: &armsecurity.AwsEnvironmentData{ - EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeAwsAccount), - ScanInterval: to.Ptr[int64](4), - }, - EnvironmentName: to.Ptr(armsecurity.CloudNameAWS), - HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - Offerings: []armsecurity.CloudOfferingClassification{ - &armsecurity.CspmMonitorAwsOffering{ - OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorAws), - NativeCloudConnection: &armsecurity.CspmMonitorAwsOfferingNativeCloudConnection{ - CloudRoleArn: to.Ptr("arn:aws:iam::00000000:role/ASCMonitor"), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Connector = armsecurity.Connector{ - // Location: to.Ptr("Central US"), - // Etag: to.Ptr(""), - // Kind: to.Ptr(""), - // Name: to.Ptr("exampleSecurityConnectorName"), - // Type: to.Ptr("Microsoft.Security/securityConnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorName"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.AwsEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeAwsAccount), - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameAWS), - // HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorAwsOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorAws), - // NativeCloudConnection: &armsecurity.CspmMonitorAwsOfferingNativeCloudConnection{ - // CloudRoleArn: to.Ptr("arn:aws:iam::00000000:role/ASCMonitor"), - // }, - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2024-03-01-preview/examples/SecurityConnectors/PatchSecurityConnector_example.json -func ExampleConnectorsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewConnectorsClient().Update(ctx, "exampleResourceGroup", "exampleSecurityConnectorName", armsecurity.Connector{ - Location: to.Ptr("Central US"), - Etag: to.Ptr("etag value (must be supplied for update)"), - Tags: map[string]*string{}, - Properties: &armsecurity.ConnectorProperties{ - EnvironmentData: &armsecurity.AwsEnvironmentData{ - EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeAwsAccount), - }, - EnvironmentName: to.Ptr(armsecurity.CloudNameAWS), - HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - Offerings: []armsecurity.CloudOfferingClassification{ - &armsecurity.CspmMonitorAwsOffering{ - OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorAws), - NativeCloudConnection: &armsecurity.CspmMonitorAwsOfferingNativeCloudConnection{ - CloudRoleArn: to.Ptr("arn:aws:iam::00000000:role/ASCMonitor"), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Connector = armsecurity.Connector{ - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("exampleSecurityConnectorName"), - // Type: to.Ptr("Microsoft.Security/securityConnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorName"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.AwsEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeAwsAccount), - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameAWS), - // HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorAwsOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorAws), - // NativeCloudConnection: &armsecurity.CspmMonitorAwsOfferingNativeCloudConnection{ - // CloudRoleArn: to.Ptr("arn:aws:iam::00000000:role/ASCMonitor"), - // }, - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2024-03-01-preview/examples/SecurityConnectors/DeleteSecurityConnector_example.json -func ExampleConnectorsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewConnectorsClient().Delete(ctx, "myRg", "mySecurityConnectorName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/constants.go b/sdk/resourcemanager/security/armsecurity/constants.go index cdae18a27aae..d78b472087f2 100644 --- a/sdk/resourcemanager/security/armsecurity/constants.go +++ b/sdk/resourcemanager/security/armsecurity/constants.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -10,7 +7,7 @@ package armsecurity const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" - moduleVersion = "v0.14.0" + moduleVersion = "v0.15.0" ) // AADConnectivityState - The connectivity state of the external AAD solution @@ -31,11 +28,12 @@ func PossibleAADConnectivityStateValues() []AADConnectivityState { } } -// ActionType - The type of the action that will be triggered by the Automation +// ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. type ActionType string const ( ActionTypeEventHub ActionType = "EventHub" + ActionTypeInternal ActionType = "Internal" ActionTypeLogicApp ActionType = "LogicApp" ActionTypeWorkspace ActionType = "Workspace" ) @@ -44,6 +42,7 @@ const ( func PossibleActionTypeValues() []ActionType { return []ActionType{ ActionTypeEventHub, + ActionTypeInternal, ActionTypeLogicApp, ActionTypeWorkspace, } @@ -68,30 +67,6 @@ func PossibleActionableRemediationStateValues() []ActionableRemediationState { } } -// AdaptiveApplicationControlIssue - An alert that machines within a group can have -type AdaptiveApplicationControlIssue string - -const ( - AdaptiveApplicationControlIssueExecutableViolationsAudited AdaptiveApplicationControlIssue = "ExecutableViolationsAudited" - AdaptiveApplicationControlIssueMsiAndScriptViolationsAudited AdaptiveApplicationControlIssue = "MsiAndScriptViolationsAudited" - AdaptiveApplicationControlIssueMsiAndScriptViolationsBlocked AdaptiveApplicationControlIssue = "MsiAndScriptViolationsBlocked" - AdaptiveApplicationControlIssueRulesViolatedManually AdaptiveApplicationControlIssue = "RulesViolatedManually" - AdaptiveApplicationControlIssueViolationsAudited AdaptiveApplicationControlIssue = "ViolationsAudited" - AdaptiveApplicationControlIssueViolationsBlocked AdaptiveApplicationControlIssue = "ViolationsBlocked" -) - -// PossibleAdaptiveApplicationControlIssueValues returns the possible values for the AdaptiveApplicationControlIssue const type. -func PossibleAdaptiveApplicationControlIssueValues() []AdaptiveApplicationControlIssue { - return []AdaptiveApplicationControlIssue{ - AdaptiveApplicationControlIssueExecutableViolationsAudited, - AdaptiveApplicationControlIssueMsiAndScriptViolationsAudited, - AdaptiveApplicationControlIssueMsiAndScriptViolationsBlocked, - AdaptiveApplicationControlIssueRulesViolatedManually, - AdaptiveApplicationControlIssueViolationsAudited, - AdaptiveApplicationControlIssueViolationsBlocked, - } -} - // AdditionalWorkspaceDataType - Data types sent to workspace. type AdditionalWorkspaceDataType string @@ -122,6 +97,24 @@ func PossibleAdditionalWorkspaceTypeValues() []AdditionalWorkspaceType { } } +// AgentlessEnablement - Agentless Enablement states. +type AgentlessEnablement string + +const ( + AgentlessEnablementDisabled AgentlessEnablement = "Disabled" + AgentlessEnablementEnabled AgentlessEnablement = "Enabled" + AgentlessEnablementNotApplicable AgentlessEnablement = "NotApplicable" +) + +// PossibleAgentlessEnablementValues returns the possible values for the AgentlessEnablement const type. +func PossibleAgentlessEnablementValues() []AgentlessEnablement { + return []AgentlessEnablement{ + AgentlessEnablementDisabled, + AgentlessEnablementEnabled, + AgentlessEnablementNotApplicable, + } +} + // 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 @@ -293,6 +286,24 @@ func PossibleAssessmentTypeValues() []AssessmentType { } } +// AttestationComplianceState - Attest category of this assignment +type AttestationComplianceState string + +const ( + AttestationComplianceStateCompliant AttestationComplianceState = "compliant" + AttestationComplianceStateNonCompliant AttestationComplianceState = "nonCompliant" + AttestationComplianceStateUnknown AttestationComplianceState = "unknown" +) + +// PossibleAttestationComplianceStateValues returns the possible values for the AttestationComplianceState const type. +func PossibleAttestationComplianceStateValues() []AttestationComplianceState { + return []AttestationComplianceState{ + AttestationComplianceStateCompliant, + AttestationComplianceStateNonCompliant, + AttestationComplianceStateUnknown, + } +} + // AuthenticationProvisioningState - State of the multi-cloud connector type AuthenticationProvisioningState string @@ -434,9 +445,11 @@ const ( CloudNameAWS CloudName = "AWS" CloudNameAzure CloudName = "Azure" CloudNameAzureDevOps CloudName = "AzureDevOps" + CloudNameDockerHub CloudName = "DockerHub" CloudNameGCP CloudName = "GCP" CloudNameGitLab CloudName = "GitLab" CloudNameGithub CloudName = "Github" + CloudNameJFrog CloudName = "JFrog" ) // PossibleCloudNameValues returns the possible values for the CloudName const type. @@ -445,9 +458,11 @@ func PossibleCloudNameValues() []CloudName { CloudNameAWS, CloudNameAzure, CloudNameAzureDevOps, + CloudNameDockerHub, CloudNameGCP, CloudNameGitLab, CloudNameGithub, + CloudNameJFrog, } } @@ -469,28 +484,6 @@ func PossibleCodeValues() []Code { } } -// ConfigurationStatus - The configuration status of the machines group or machine or rule -type ConfigurationStatus string - -const ( - ConfigurationStatusConfigured ConfigurationStatus = "Configured" - ConfigurationStatusFailed ConfigurationStatus = "Failed" - ConfigurationStatusInProgress ConfigurationStatus = "InProgress" - ConfigurationStatusNoStatus ConfigurationStatus = "NoStatus" - ConfigurationStatusNotConfigured ConfigurationStatus = "NotConfigured" -) - -// PossibleConfigurationStatusValues returns the possible values for the ConfigurationStatus const type. -func PossibleConfigurationStatusValues() []ConfigurationStatus { - return []ConfigurationStatus{ - ConfigurationStatusConfigured, - ConfigurationStatusFailed, - ConfigurationStatusInProgress, - ConfigurationStatusNoStatus, - ConfigurationStatusNotConfigured, - } -} - type ConnectionType string const ( @@ -603,19 +596,21 @@ func PossibleDevOpsProvisioningStateValues() []DevOpsProvisioningState { } } -// Direction - The rule's direction -type Direction string +// Effect - Expected effect of this assignment (Audit/Exempt/Attest) +type Effect string const ( - DirectionInbound Direction = "Inbound" - DirectionOutbound Direction = "Outbound" + EffectAttest Effect = "Attest" + EffectAudit Effect = "Audit" + EffectExempt Effect = "Exempt" ) -// PossibleDirectionValues returns the possible values for the Direction const type. -func PossibleDirectionValues() []Direction { - return []Direction{ - DirectionInbound, - DirectionOutbound, +// PossibleEffectValues returns the possible values for the Effect const type. +func PossibleEffectValues() []Effect { + return []Effect{ + EffectAttest, + EffectAudit, + EffectExempt, } } @@ -663,51 +658,17 @@ func PossibleEnforceValues() []Enforce { } } -// EnforcementMode - The application control policy enforcement/protection mode of the machine group -type EnforcementMode string - -const ( - EnforcementModeAudit EnforcementMode = "Audit" - EnforcementModeEnforce EnforcementMode = "Enforce" - EnforcementModeNone EnforcementMode = "None" -) - -// PossibleEnforcementModeValues returns the possible values for the EnforcementMode const type. -func PossibleEnforcementModeValues() []EnforcementMode { - return []EnforcementMode{ - EnforcementModeAudit, - EnforcementModeEnforce, - EnforcementModeNone, - } -} - -// EnforcementSupport - The machine supportability of Enforce feature -type EnforcementSupport string - -const ( - EnforcementSupportNotSupported EnforcementSupport = "NotSupported" - EnforcementSupportSupported EnforcementSupport = "Supported" - EnforcementSupportUnknown EnforcementSupport = "Unknown" -) - -// PossibleEnforcementSupportValues returns the possible values for the EnforcementSupport const type. -func PossibleEnforcementSupportValues() []EnforcementSupport { - return []EnforcementSupport{ - EnforcementSupportNotSupported, - EnforcementSupportSupported, - EnforcementSupportUnknown, - } -} - // EnvironmentType - The type of the environment data. type EnvironmentType string const ( - EnvironmentTypeAwsAccount EnvironmentType = "AwsAccount" - EnvironmentTypeAzureDevOpsScope EnvironmentType = "AzureDevOpsScope" - EnvironmentTypeGcpProject EnvironmentType = "GcpProject" - EnvironmentTypeGithubScope EnvironmentType = "GithubScope" - EnvironmentTypeGitlabScope EnvironmentType = "GitlabScope" + EnvironmentTypeAwsAccount EnvironmentType = "AwsAccount" + EnvironmentTypeAzureDevOpsScope EnvironmentType = "AzureDevOpsScope" + EnvironmentTypeDockerHubOrganization EnvironmentType = "DockerHubOrganization" + EnvironmentTypeGcpProject EnvironmentType = "GcpProject" + EnvironmentTypeGithubScope EnvironmentType = "GithubScope" + EnvironmentTypeGitlabScope EnvironmentType = "GitlabScope" + EnvironmentTypeJFrogArtifactory EnvironmentType = "JFrogArtifactory" ) // PossibleEnvironmentTypeValues returns the possible values for the EnvironmentType const type. @@ -715,9 +676,11 @@ func PossibleEnvironmentTypeValues() []EnvironmentType { return []EnvironmentType{ EnvironmentTypeAwsAccount, EnvironmentTypeAzureDevOpsScope, + EnvironmentTypeDockerHubOrganization, EnvironmentTypeGcpProject, EnvironmentTypeGithubScope, EnvironmentTypeGitlabScope, + EnvironmentTypeJFrogArtifactory, } } @@ -759,6 +722,22 @@ func PossibleEventSourceValues() []EventSource { } } +// ExemptionCategory - Exemption category of this assignment +type ExemptionCategory string + +const ( + ExemptionCategoryMitigated ExemptionCategory = "mitigated" + ExemptionCategoryWaiver ExemptionCategory = "waiver" +) + +// PossibleExemptionCategoryValues returns the possible values for the ExemptionCategory const type. +func PossibleExemptionCategoryValues() []ExemptionCategory { + return []ExemptionCategory{ + ExemptionCategoryMitigated, + ExemptionCategoryWaiver, + } +} + type ExpandControlsEnum string const ( @@ -822,30 +801,6 @@ func PossibleExternalSecuritySolutionKindValues() []ExternalSecuritySolutionKind } } -// FileType - The type of the file (for Linux files - Executable is used) -type FileType string - -const ( - FileTypeDll FileType = "Dll" - FileTypeExe FileType = "Exe" - FileTypeExecutable FileType = "Executable" - FileTypeMsi FileType = "Msi" - FileTypeScript FileType = "Script" - FileTypeUnknown FileType = "Unknown" -) - -// PossibleFileTypeValues returns the possible values for the FileType const type. -func PossibleFileTypeValues() []FileType { - return []FileType{ - FileTypeDll, - FileTypeExe, - FileTypeExecutable, - FileTypeMsi, - FileTypeScript, - FileTypeUnknown, - } -} - // GovernanceRuleConditionOperator - The governance rule Condition's Operator, for example Equals for severity or In for list // of assessments, see examples type GovernanceRuleConditionOperator string @@ -1088,6 +1043,44 @@ func PossibleIntentValues() []Intent { } } +// InventoryKind - Types for inventory kind. +type InventoryKind string + +const ( + InventoryKindAzureDevOpsOrganization InventoryKind = "AzureDevOpsOrganization" + InventoryKindAzureDevOpsProject InventoryKind = "AzureDevOpsProject" + InventoryKindAzureDevOpsRepository InventoryKind = "AzureDevOpsRepository" + InventoryKindGitHubOwner InventoryKind = "GitHubOwner" + InventoryKindGitHubRepository InventoryKind = "GitHubRepository" +) + +// PossibleInventoryKindValues returns the possible values for the InventoryKind const type. +func PossibleInventoryKindValues() []InventoryKind { + return []InventoryKind{ + InventoryKindAzureDevOpsOrganization, + InventoryKindAzureDevOpsProject, + InventoryKindAzureDevOpsRepository, + InventoryKindGitHubOwner, + InventoryKindGitHubRepository, + } +} + +// InventoryListKind - Types for inventory list. +type InventoryListKind string + +const ( + InventoryListKindExclusion InventoryListKind = "Exclusion" + InventoryListKindInclusion InventoryListKind = "Inclusion" +) + +// PossibleInventoryListKindValues returns the possible values for the InventoryListKind const type. +func PossibleInventoryListKindValues() []InventoryListKind { + return []InventoryListKind{ + InventoryListKindExclusion, + InventoryListKindInclusion, + } +} + // IsEnabled - Indicates whether the extension is enabled. type IsEnabled string @@ -1190,19 +1183,25 @@ func PossibleMipIntegrationStatusValues() []MipIntegrationStatus { type OfferingType string const ( - OfferingTypeCspmMonitorAws OfferingType = "CspmMonitorAws" - OfferingTypeCspmMonitorAzureDevOps OfferingType = "CspmMonitorAzureDevOps" - OfferingTypeCspmMonitorGcp OfferingType = "CspmMonitorGcp" - OfferingTypeCspmMonitorGitLab OfferingType = "CspmMonitorGitLab" - OfferingTypeCspmMonitorGithub OfferingType = "CspmMonitorGithub" - OfferingTypeDefenderCspmAws OfferingType = "DefenderCspmAws" - OfferingTypeDefenderCspmGcp OfferingType = "DefenderCspmGcp" - OfferingTypeDefenderForContainersAws OfferingType = "DefenderForContainersAws" - OfferingTypeDefenderForContainersGcp OfferingType = "DefenderForContainersGcp" - OfferingTypeDefenderForDatabasesAws OfferingType = "DefenderForDatabasesAws" - OfferingTypeDefenderForDatabasesGcp OfferingType = "DefenderForDatabasesGcp" - OfferingTypeDefenderForServersAws OfferingType = "DefenderForServersAws" - OfferingTypeDefenderForServersGcp OfferingType = "DefenderForServersGcp" + OfferingTypeCspmMonitorAws OfferingType = "CspmMonitorAws" + OfferingTypeCspmMonitorAzureDevOps OfferingType = "CspmMonitorAzureDevOps" + OfferingTypeCspmMonitorDockerHub OfferingType = "CspmMonitorDockerHub" + OfferingTypeCspmMonitorGcp OfferingType = "CspmMonitorGcp" + OfferingTypeCspmMonitorGitLab OfferingType = "CspmMonitorGitLab" + OfferingTypeCspmMonitorGithub OfferingType = "CspmMonitorGithub" + OfferingTypeCspmMonitorJFrog OfferingType = "CspmMonitorJFrog" + OfferingTypeDefenderCspmAws OfferingType = "DefenderCspmAws" + OfferingTypeDefenderCspmDockerHub OfferingType = "DefenderCspmDockerHub" + OfferingTypeDefenderCspmGcp OfferingType = "DefenderCspmGcp" + OfferingTypeDefenderCspmJFrog OfferingType = "DefenderCspmJFrog" + OfferingTypeDefenderForContainersAws OfferingType = "DefenderForContainersAws" + OfferingTypeDefenderForContainersDockerHub OfferingType = "DefenderForContainersDockerHub" + OfferingTypeDefenderForContainersGcp OfferingType = "DefenderForContainersGcp" + OfferingTypeDefenderForContainersJFrog OfferingType = "DefenderForContainersJFrog" + OfferingTypeDefenderForDatabasesAws OfferingType = "DefenderForDatabasesAws" + OfferingTypeDefenderForDatabasesGcp OfferingType = "DefenderForDatabasesGcp" + OfferingTypeDefenderForServersAws OfferingType = "DefenderForServersAws" + OfferingTypeDefenderForServersGcp OfferingType = "DefenderForServersGcp" ) // PossibleOfferingTypeValues returns the possible values for the OfferingType const type. @@ -1210,13 +1209,19 @@ func PossibleOfferingTypeValues() []OfferingType { return []OfferingType{ OfferingTypeCspmMonitorAws, OfferingTypeCspmMonitorAzureDevOps, + OfferingTypeCspmMonitorDockerHub, OfferingTypeCspmMonitorGcp, OfferingTypeCspmMonitorGitLab, OfferingTypeCspmMonitorGithub, + OfferingTypeCspmMonitorJFrog, OfferingTypeDefenderCspmAws, + OfferingTypeDefenderCspmDockerHub, OfferingTypeDefenderCspmGcp, + OfferingTypeDefenderCspmJFrog, OfferingTypeDefenderForContainersAws, + OfferingTypeDefenderForContainersDockerHub, OfferingTypeDefenderForContainersGcp, + OfferingTypeDefenderForContainersJFrog, OfferingTypeDefenderForDatabasesAws, OfferingTypeDefenderForDatabasesGcp, OfferingTypeDefenderForServersAws, @@ -1324,6 +1329,25 @@ func PossibleOrganizationMembershipTypeValues() []OrganizationMembershipType { } } +// Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default +// value is "user,system" +type Origin string + +const ( + OriginSystem Origin = "system" + OriginUser Origin = "user" + OriginUserSystem Origin = "user,system" +) + +// PossibleOriginValues returns the possible values for the Origin const type. +func PossibleOriginValues() []Origin { + return []Origin{ + OriginSystem, + OriginUser, + OriginUserSystem, + } +} + // PermissionProperty - A permission detected in the cloud account. type PermissionProperty string @@ -1446,24 +1470,6 @@ func PossibleRankValues() []Rank { } } -// RecommendationAction - The recommendation action of the machine or rule -type RecommendationAction string - -const ( - RecommendationActionAdd RecommendationAction = "Add" - RecommendationActionRecommended RecommendationAction = "Recommended" - RecommendationActionRemove RecommendationAction = "Remove" -) - -// PossibleRecommendationActionValues returns the possible values for the RecommendationAction const type. -func PossibleRecommendationActionValues() []RecommendationAction { - return []RecommendationAction{ - RecommendationActionAdd, - RecommendationActionRecommended, - RecommendationActionRemove, - } -} - // RecommendationConfigStatus - Recommendation status. When the recommendation status is disabled recommendations are not // generated. type RecommendationConfigStatus string @@ -1481,23 +1487,21 @@ func PossibleRecommendationConfigStatusValues() []RecommendationConfigStatus { } } -// RecommendationStatus - The initial recommendation status of the machine group or machine -type RecommendationStatus string +// RecommendationSupportedClouds - The cloud that the recommendation is supported on. +type RecommendationSupportedClouds string const ( - RecommendationStatusNoStatus RecommendationStatus = "NoStatus" - RecommendationStatusNotAvailable RecommendationStatus = "NotAvailable" - RecommendationStatusNotRecommended RecommendationStatus = "NotRecommended" - RecommendationStatusRecommended RecommendationStatus = "Recommended" + RecommendationSupportedCloudsAWS RecommendationSupportedClouds = "AWS" + RecommendationSupportedCloudsAzure RecommendationSupportedClouds = "Azure" + RecommendationSupportedCloudsGCP RecommendationSupportedClouds = "GCP" ) -// PossibleRecommendationStatusValues returns the possible values for the RecommendationStatus const type. -func PossibleRecommendationStatusValues() []RecommendationStatus { - return []RecommendationStatus{ - RecommendationStatusNoStatus, - RecommendationStatusNotAvailable, - RecommendationStatusNotRecommended, - RecommendationStatusRecommended, +// PossibleRecommendationSupportedCloudsValues returns the possible values for the RecommendationSupportedClouds const type. +func PossibleRecommendationSupportedCloudsValues() []RecommendationSupportedClouds { + return []RecommendationSupportedClouds{ + RecommendationSupportedCloudsAWS, + RecommendationSupportedCloudsAzure, + RecommendationSupportedCloudsGCP, } } @@ -1891,6 +1895,30 @@ func PossibleSecurityFamilyValues() []SecurityFamily { } } +// SecurityIssue - The severity to relate to the assessments generated by this Recommendation. +type SecurityIssue string + +const ( + SecurityIssueAnonymousAccess SecurityIssue = "AnonymousAccess" + SecurityIssueBestPractices SecurityIssue = "BestPractices" + SecurityIssueExcessivePermissions SecurityIssue = "ExcessivePermissions" + SecurityIssueNetworkExposure SecurityIssue = "NetworkExposure" + SecurityIssueTrafficEncryption SecurityIssue = "TrafficEncryption" + SecurityIssueVulnerability SecurityIssue = "Vulnerability" +) + +// PossibleSecurityIssueValues returns the possible values for the SecurityIssue const type. +func PossibleSecurityIssueValues() []SecurityIssue { + return []SecurityIssue{ + SecurityIssueAnonymousAccess, + SecurityIssueBestPractices, + SecurityIssueExcessivePermissions, + SecurityIssueNetworkExposure, + SecurityIssueTrafficEncryption, + SecurityIssueVulnerability, + } +} + // SecuritySolutionStatus - Status of the IoT Security solution. type SecuritySolutionStatus string @@ -1995,35 +2023,35 @@ func PossibleSettingKindValues() []SettingKind { type SettingName string const ( - // SettingNameCurrent - Name of the Defender for Storage Settings name. - SettingNameCurrent SettingName = "current" + SettingNameMCAS SettingName = "MCAS" + SettingNameSentinel SettingName = "Sentinel" + SettingNameWDATP SettingName = "WDATP" + SettingNameWDATPEXCLUDELINUXPUBLICPREVIEW SettingName = "WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW" + SettingNameWDATPUNIFIEDSOLUTION SettingName = "WDATP_UNIFIED_SOLUTION" ) // PossibleSettingNameValues returns the possible values for the SettingName const type. func PossibleSettingNameValues() []SettingName { return []SettingName{ - SettingNameCurrent, + SettingNameMCAS, + SettingNameSentinel, + SettingNameWDATP, + SettingNameWDATPEXCLUDELINUXPUBLICPREVIEW, + SettingNameWDATPUNIFIEDSOLUTION, } } type SettingNameAutoGenerated string const ( - SettingNameAutoGeneratedMCAS SettingNameAutoGenerated = "MCAS" - SettingNameAutoGeneratedSentinel SettingNameAutoGenerated = "Sentinel" - SettingNameAutoGeneratedWDATP SettingNameAutoGenerated = "WDATP" - SettingNameAutoGeneratedWDATPEXCLUDELINUXPUBLICPREVIEW SettingNameAutoGenerated = "WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW" - SettingNameAutoGeneratedWDATPUNIFIEDSOLUTION SettingNameAutoGenerated = "WDATP_UNIFIED_SOLUTION" + // SettingNameAutoGeneratedCurrent - Name of the Defender for Storage Settings name. + SettingNameAutoGeneratedCurrent SettingNameAutoGenerated = "current" ) // PossibleSettingNameAutoGeneratedValues returns the possible values for the SettingNameAutoGenerated const type. func PossibleSettingNameAutoGeneratedValues() []SettingNameAutoGenerated { return []SettingNameAutoGenerated{ - SettingNameAutoGeneratedMCAS, - SettingNameAutoGeneratedSentinel, - SettingNameAutoGeneratedWDATP, - SettingNameAutoGeneratedWDATPEXCLUDELINUXPUBLICPREVIEW, - SettingNameAutoGeneratedWDATPUNIFIEDSOLUTION, + SettingNameAutoGeneratedCurrent, } } @@ -2084,28 +2112,6 @@ func PossibleSourceValues() []Source { } } -// SourceSystem - The source type of the machine group -type SourceSystem string - -const ( - SourceSystemAzureAppLocker SourceSystem = "Azure_AppLocker" - SourceSystemAzureAuditD SourceSystem = "Azure_AuditD" - SourceSystemNonAzureAppLocker SourceSystem = "NonAzure_AppLocker" - SourceSystemNonAzureAuditD SourceSystem = "NonAzure_AuditD" - SourceSystemNone SourceSystem = "None" -) - -// PossibleSourceSystemValues returns the possible values for the SourceSystem const type. -func PossibleSourceSystemValues() []SourceSystem { - return []SourceSystem{ - SourceSystemAzureAppLocker, - SourceSystemAzureAuditD, - SourceSystemNonAzureAppLocker, - SourceSystemNonAzureAuditD, - SourceSystemNone, - } -} - // SourceType - The source type that will trigger the notification type SourceType string @@ -2122,6 +2128,42 @@ func PossibleSourceTypeValues() []SourceType { } } +// StandardSupportedCloud - The cloud that the standard is supported on. +type StandardSupportedCloud string + +const ( + StandardSupportedCloudAWS StandardSupportedCloud = "AWS" + StandardSupportedCloudAzure StandardSupportedCloud = "Azure" + StandardSupportedCloudGCP StandardSupportedCloud = "GCP" +) + +// PossibleStandardSupportedCloudValues returns the possible values for the StandardSupportedCloud const type. +func PossibleStandardSupportedCloudValues() []StandardSupportedCloud { + return []StandardSupportedCloud{ + StandardSupportedCloudAWS, + StandardSupportedCloudAzure, + StandardSupportedCloudGCP, + } +} + +// StandardType - Standard type (Custom or Default or Compliance only currently) +type StandardType string + +const ( + StandardTypeCompliance StandardType = "Compliance" + StandardTypeCustom StandardType = "Custom" + StandardTypeDefault StandardType = "Default" +) + +// PossibleStandardTypeValues returns the possible values for the StandardType const type. +func PossibleStandardTypeValues() []StandardType { + return []StandardType{ + StandardTypeCompliance, + StandardTypeCustom, + StandardTypeDefault, + } +} + // State - Aggregative state based on the standard's supported controls states type State string @@ -2560,21 +2602,6 @@ func PossibleThreatsValues() []Threats { } } -type TransportProtocol string - -const ( - TransportProtocolTCP TransportProtocol = "TCP" - TransportProtocolUDP TransportProtocol = "UDP" -) - -// PossibleTransportProtocolValues returns the possible values for the TransportProtocol const type. -func PossibleTransportProtocolValues() []TransportProtocol { - return []TransportProtocol{ - TransportProtocolTCP, - TransportProtocolUDP, - } -} - // Type - The Vulnerability Assessment solution to be provisioned. Can be either 'TVM' or 'Qualys' type Type string diff --git a/sdk/resourcemanager/security/armsecurity/contacts_client.go b/sdk/resourcemanager/security/armsecurity/contacts_client.go index 03c84051afa5..ce9180b4db9e 100644 --- a/sdk/resourcemanager/security/armsecurity/contacts_client.go +++ b/sdk/resourcemanager/security/armsecurity/contacts_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -73,7 +70,7 @@ func (client *ContactsClient) Create(ctx context.Context, securityContactName Se } // createCreateRequest creates the Create request. -func (client *ContactsClient) createCreateRequest(ctx context.Context, securityContactName SecurityContactName, securityContact Contact, options *ContactsClientCreateOptions) (*policy.Request, error) { +func (client *ContactsClient) createCreateRequest(ctx context.Context, securityContactName SecurityContactName, securityContact Contact, _ *ContactsClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -134,7 +131,7 @@ func (client *ContactsClient) Delete(ctx context.Context, securityContactName Se } // deleteCreateRequest creates the Delete request. -func (client *ContactsClient) deleteCreateRequest(ctx context.Context, securityContactName SecurityContactName, options *ContactsClientDeleteOptions) (*policy.Request, error) { +func (client *ContactsClient) deleteCreateRequest(ctx context.Context, securityContactName SecurityContactName, _ *ContactsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -184,7 +181,7 @@ func (client *ContactsClient) Get(ctx context.Context, securityContactName Secur } // getCreateRequest creates the Get request. -func (client *ContactsClient) getCreateRequest(ctx context.Context, securityContactName SecurityContactName, options *ContactsClientGetOptions) (*policy.Request, error) { +func (client *ContactsClient) getCreateRequest(ctx context.Context, securityContactName SecurityContactName, _ *ContactsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts/{securityContactName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -242,7 +239,7 @@ func (client *ContactsClient) NewListPager(options *ContactsClientListOptions) * } // listCreateRequest creates the List request. -func (client *ContactsClient) listCreateRequest(ctx context.Context, options *ContactsClientListOptions) (*policy.Request, error) { +func (client *ContactsClient) listCreateRequest(ctx context.Context, _ *ContactsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securityContacts" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 962914508889..000000000000 --- a/sdk/resourcemanager/security/armsecurity/contacts_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. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/SecurityContacts/GetSecurityContactsSubscription_example.json -func ExampleContactsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewContactsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ContactList = armsecurity.ContactList{ - // Value: []*armsecurity.Contact{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/securityContact"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/securityContact/default"), - // Properties: &armsecurity.ContactProperties{ - // Emails: to.Ptr("john@contoso.com;Jane@contoso.com"), - // IsEnabled: to.Ptr(true), - // NotificationsByRole: &armsecurity.ContactPropertiesNotificationsByRole{ - // Roles: []*armsecurity.SecurityContactRole{ - // to.Ptr(armsecurity.SecurityContactRoleOwner), - // to.Ptr(armsecurity.SecurityContactRole("Admin"))}, - // State: to.Ptr(armsecurity.State("On")), - // }, - // NotificationsSources: []armsecurity.NotificationsSourceClassification{ - // &armsecurity.NotificationsSourceAttackPath{ - // SourceType: to.Ptr(armsecurity.SourceTypeAttackPath), - // MinimalRiskLevel: to.Ptr(armsecurity.MinimalRiskLevelCritical), - // }, - // &armsecurity.NotificationsSourceAlert{ - // SourceType: to.Ptr(armsecurity.SourceTypeAlert), - // MinimalSeverity: to.Ptr(armsecurity.MinimalSeverityMedium), - // }}, - // Phone: to.Ptr("(214)275-4038"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/SecurityContacts/GetSecurityContact_example.json -func ExampleContactsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewContactsClient().Get(ctx, armsecurity.SecurityContactNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Contact = armsecurity.Contact{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/securityContacts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/securityContacts/default"), - // Properties: &armsecurity.ContactProperties{ - // Emails: to.Ptr("john@contoso.com;jane@contoso.com"), - // IsEnabled: to.Ptr(true), - // NotificationsByRole: &armsecurity.ContactPropertiesNotificationsByRole{ - // Roles: []*armsecurity.SecurityContactRole{ - // to.Ptr(armsecurity.SecurityContactRoleOwner)}, - // State: to.Ptr(armsecurity.State("On")), - // }, - // NotificationsSources: []armsecurity.NotificationsSourceClassification{ - // &armsecurity.NotificationsSourceAttackPath{ - // SourceType: to.Ptr(armsecurity.SourceTypeAttackPath), - // MinimalRiskLevel: to.Ptr(armsecurity.MinimalRiskLevelCritical), - // }, - // &armsecurity.NotificationsSourceAlert{ - // SourceType: to.Ptr(armsecurity.SourceTypeAlert), - // MinimalSeverity: to.Ptr(armsecurity.MinimalSeverityMedium), - // }}, - // Phone: to.Ptr("(214)275-4038"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/SecurityContacts/CreateSecurityContact_example.json -func ExampleContactsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewContactsClient().Create(ctx, armsecurity.SecurityContactNameDefault, armsecurity.Contact{ - Properties: &armsecurity.ContactProperties{ - Emails: to.Ptr("john@contoso.com;jane@contoso.com"), - IsEnabled: to.Ptr(true), - NotificationsByRole: &armsecurity.ContactPropertiesNotificationsByRole{ - Roles: []*armsecurity.SecurityContactRole{ - to.Ptr(armsecurity.SecurityContactRoleOwner)}, - State: to.Ptr(armsecurity.State("On")), - }, - NotificationsSources: []armsecurity.NotificationsSourceClassification{ - &armsecurity.NotificationsSourceAttackPath{ - SourceType: to.Ptr(armsecurity.SourceTypeAttackPath), - MinimalRiskLevel: to.Ptr(armsecurity.MinimalRiskLevelCritical), - }, - &armsecurity.NotificationsSourceAlert{ - SourceType: to.Ptr(armsecurity.SourceTypeAlert), - MinimalSeverity: to.Ptr(armsecurity.MinimalSeverityMedium), - }}, - Phone: to.Ptr("(214)275-4038"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Contact = armsecurity.Contact{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/securityContact"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/securityContacts/default"), - // Properties: &armsecurity.ContactProperties{ - // Emails: to.Ptr("john@microsoft.com;jane@microsoft.com"), - // IsEnabled: to.Ptr(true), - // NotificationsByRole: &armsecurity.ContactPropertiesNotificationsByRole{ - // Roles: []*armsecurity.SecurityContactRole{ - // to.Ptr(armsecurity.SecurityContactRoleOwner)}, - // State: to.Ptr(armsecurity.State("On")), - // }, - // NotificationsSources: []armsecurity.NotificationsSourceClassification{ - // &armsecurity.NotificationsSourceAttackPath{ - // SourceType: to.Ptr(armsecurity.SourceTypeAttackPath), - // MinimalRiskLevel: to.Ptr(armsecurity.MinimalRiskLevelCritical), - // }, - // &armsecurity.NotificationsSourceAlert{ - // SourceType: to.Ptr(armsecurity.SourceTypeAlert), - // MinimalSeverity: to.Ptr(armsecurity.MinimalSeverityMedium), - // }}, - // Phone: to.Ptr("(214)275-4038"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-12-01-preview/examples/SecurityContacts/DeleteSecurityContact_example.json -func ExampleContactsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewContactsClient().Delete(ctx, armsecurity.SecurityContactNameDefault, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/customassessmentautomations_client.go b/sdk/resourcemanager/security/armsecurity/customassessmentautomations_client.go index 76b127c41a46..9d04be208563 100644 --- a/sdk/resourcemanager/security/armsecurity/customassessmentautomations_client.go +++ b/sdk/resourcemanager/security/armsecurity/customassessmentautomations_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -76,7 +73,7 @@ func (client *CustomAssessmentAutomationsClient) Create(ctx context.Context, res } // createCreateRequest creates the Create request. -func (client *CustomAssessmentAutomationsClient) createCreateRequest(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string, customAssessmentAutomationBody CustomAssessmentAutomationRequest, options *CustomAssessmentAutomationsClientCreateOptions) (*policy.Request, error) { +func (client *CustomAssessmentAutomationsClient) createCreateRequest(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string, customAssessmentAutomationBody CustomAssessmentAutomationRequest, _ *CustomAssessmentAutomationsClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -143,7 +140,7 @@ func (client *CustomAssessmentAutomationsClient) Delete(ctx context.Context, res } // deleteCreateRequest creates the Delete request. -func (client *CustomAssessmentAutomationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string, options *CustomAssessmentAutomationsClientDeleteOptions) (*policy.Request, error) { +func (client *CustomAssessmentAutomationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string, _ *CustomAssessmentAutomationsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -199,7 +196,7 @@ func (client *CustomAssessmentAutomationsClient) Get(ctx context.Context, resour } // getCreateRequest creates the Get request. -func (client *CustomAssessmentAutomationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string, options *CustomAssessmentAutomationsClientGetOptions) (*policy.Request, error) { +func (client *CustomAssessmentAutomationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string, _ *CustomAssessmentAutomationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations/{customAssessmentAutomationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -263,7 +260,7 @@ func (client *CustomAssessmentAutomationsClient) NewListByResourceGroupPager(res } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *CustomAssessmentAutomationsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *CustomAssessmentAutomationsClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *CustomAssessmentAutomationsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *CustomAssessmentAutomationsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customAssessmentAutomations" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -322,7 +319,7 @@ func (client *CustomAssessmentAutomationsClient) NewListBySubscriptionPager(opti } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *CustomAssessmentAutomationsClient) listBySubscriptionCreateRequest(ctx context.Context, options *CustomAssessmentAutomationsClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *CustomAssessmentAutomationsClient) listBySubscriptionCreateRequest(ctx context.Context, _ *CustomAssessmentAutomationsClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/customAssessmentAutomations" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 17c37faf746b..000000000000 --- a/sdk/resourcemanager/security/armsecurity/customassessmentautomations_client_example_test.go +++ /dev/null @@ -1,273 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationGet_example.json -func ExampleCustomAssessmentAutomationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCustomAssessmentAutomationsClient().Get(ctx, "TestResourceGroup", "MyCustomAssessmentAutomation", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomAssessmentAutomation = armsecurity.CustomAssessmentAutomation{ - // Name: to.Ptr("MyCustomAssessmentAutomation"), - // Type: to.Ptr("Microsoft.Security/customAssessmentAutomations"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/TestResourceGroup/providers/Microsoft.Security/customAssessmentAutomations/MyCustomAssessmentAutomation"), - // Properties: &armsecurity.CustomAssessmentAutomationProperties{ - // Description: to.Ptr("organization passwords policy"), - // AssessmentKey: to.Ptr("d5f442f7-7e77-4bcf-a450-a9c1b9a94eeb"), - // CompressedQuery: to.Ptr("DQAKAEkAYQBtAF8ARwByAG8AdQBwAA0ACgB8ACAAZQB4AHQAZQBuAGQAIABIAGUAYQBsAHQAaABTAHQAYQB0AHUAcwAgAD0AIABpAGYAZgAoAHQAbwBzAHQAcgBpAG4AZwAoAFIAZQBjAG8AcgBkAC4AVQBzAGUAcgBOAGEAbQBlACkAIABjAG8AbgB0AGEAaQBuAHMAIAAnAHUAcwBlAHIAJwAsACAAJwBVAE4ASABFAEEATABUAEgAWQAnACwAIAAnAEgARQBBAEwAVABIAFkAJwApAA0ACgA="), - // DisplayName: to.Ptr("Password Policy"), - // RemediationDescription: to.Ptr("Change password policy to..."), - // Severity: to.Ptr(armsecurity.SeverityEnumLow), - // SupportedCloud: to.Ptr(armsecurity.SupportedCloudEnumAWS), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationCreate_example.json -func ExampleCustomAssessmentAutomationsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCustomAssessmentAutomationsClient().Create(ctx, "TestResourceGroup", "MyCustomAssessmentAutomation", armsecurity.CustomAssessmentAutomationRequest{ - Properties: &armsecurity.CustomAssessmentAutomationRequestProperties{ - Description: to.Ptr("Data should be encrypted"), - CompressedQuery: to.Ptr("DQAKAEkAYQBtAF8ARwByAG8AdQBwAA0ACgB8ACAAZQB4AHQAZQBuAGQAIABIAGUAYQBsAHQAaABTAHQAYQB0AHUAcwAgAD0AIABpAGYAZgAoAHQAbwBzAHQAcgBpAG4AZwAoAFIAZQBjAG8AcgBkAC4AVQBzAGUAcgBOAGEAbQBlACkAIABjAG8AbgB0AGEAaQBuAHMAIAAnAHUAcwBlAHIAJwAsACAAJwBVAE4ASABFAEEATABUAEgAWQAnACwAIAAnAEgARQBBAEwAVABIAFkAJwApAA0ACgA="), - DisplayName: to.Ptr("Password Policy"), - RemediationDescription: to.Ptr("Encrypt store by..."), - Severity: to.Ptr(armsecurity.SeverityEnumMedium), - SupportedCloud: to.Ptr(armsecurity.SupportedCloudEnumAWS), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomAssessmentAutomation = armsecurity.CustomAssessmentAutomation{ - // Name: to.Ptr("33e7cc6e-a139-4723-a0e5-76993aee0771"), - // Type: to.Ptr("Microsoft.Security/customAssessmentAutomations"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/TestResourceGroup/providers/Microsoft.Security/customAssessmentAutomations/33e7cc6e-a139-4723-a0e5-76993aee0771"), - // Properties: &armsecurity.CustomAssessmentAutomationProperties{ - // Description: to.Ptr("organization passwords policy"), - // AssessmentKey: to.Ptr("d5f442f7-7e77-4bcf-a450-a9c1b9a94eeb"), - // CompressedQuery: to.Ptr("DQAKAEkAYQBtAF8ARwByAG8AdQBwAA0ACgB8ACAAZQB4AHQAZQBuAGQAIABIAGUAYQBsAHQAaABTAHQAYQB0AHUAcwAgAD0AIABpAGYAZgAoAHQAbwBzAHQAcgBpAG4AZwAoAFIAZQBjAG8AcgBkAC4AVQBzAGUAcgBOAGEAbQBlACkAIABjAG8AbgB0AGEAaQBuAHMAIAAnAHUAcwBlAHIAJwAsACAAJwBVAE4ASABFAEEATABUAEgAWQAnACwAIAAnAEgARQBBAEwAVABIAFkAJwApAA0ACgA="), - // DisplayName: to.Ptr("Password Policy"), - // RemediationDescription: to.Ptr("Change password policy to..."), - // Severity: to.Ptr(armsecurity.SeverityEnumMedium), - // SupportedCloud: to.Ptr(armsecurity.SupportedCloudEnumAWS), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationDelete_example.json -func ExampleCustomAssessmentAutomationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewCustomAssessmentAutomationsClient().Delete(ctx, "TestResourceGroup", "MyCustomAssessmentAutomation", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationListByResourceGroup_example.json -func ExampleCustomAssessmentAutomationsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCustomAssessmentAutomationsClient().NewListByResourceGroupPager("TestResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CustomAssessmentAutomationsListResult = armsecurity.CustomAssessmentAutomationsListResult{ - // Value: []*armsecurity.CustomAssessmentAutomation{ - // { - // Name: to.Ptr("MyCustomAssessmentAutomation1"), - // Type: to.Ptr("Microsoft.Security/customAssessmentAutomations"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/TestResourceGroup/providers/Microsoft.Security/customAssessmentAutomations/MyCustomAssessmentAutomation1"), - // Properties: &armsecurity.CustomAssessmentAutomationProperties{ - // Description: to.Ptr("organization passwords policy"), - // AssessmentKey: to.Ptr("d5f442f7-7e77-4bcf-a450-a9c1b9a94eeb"), - // CompressedQuery: to.Ptr("DQAKAEkAYQBtAF8ARwByAG8AdQBwAA0ACgB8ACAAZQB4AHQAZQBuAGQAIABIAGUAYQBsAHQAaABTAHQAYQB0AHUAcwAgAD0AIABpAGYAZgAoAHQAbwBzAHQAcgBpAG4AZwAoAFIAZQBjAG8AcgBkAC4AVQBzAGUAcgBOAGEAbQBlACkAIABjAG8AbgB0AGEAaQBuAHMAIAAnAHUAcwBlAHIAJwAsACAAJwBVAE4ASABFAEEATABUAEgAWQAnACwAIAAnAEgARQBBAEwAVABIAFkAJwApAA0ACgA="), - // DisplayName: to.Ptr("Password Policy"), - // RemediationDescription: to.Ptr("Change password policy to..."), - // Severity: to.Ptr(armsecurity.SeverityEnumMedium), - // SupportedCloud: to.Ptr(armsecurity.SupportedCloudEnumAWS), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("MyCustomAssessmentAutomation2"), - // Type: to.Ptr("Microsoft.Security/customAssessmentAutomations"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/TestResourceGroup/providers/Microsoft.Security/customAssessmentAutomations/MyCustomAssessmentAutomation2"), - // Properties: &armsecurity.CustomAssessmentAutomationProperties{ - // Description: to.Ptr("organization passwords policy"), - // AssessmentKey: to.Ptr("fc1dbcd0-502c-4eab-9312-4014cfc8ea56"), - // CompressedQuery: to.Ptr("DQAKAEkAYQBtAF8AUABhAHMAcwB3AG8AcgBkAFAAbwBsAGkAYwB5ACAADQAKAHwAIABlAHgAdABlAG4AZAAgAEgAZQBhAGwAdABoAFMAdABhAHQAdQBzACAAPQAgAGkAZgBmACgAdABvAGkAbgB0ACgAUgBlAGMAbwByAGQALgBNAGkAbgBpAG0AdQBtAFAAYQBzAHMAdwBvAHIAZABMAGUAbgBnAHQAaAApACAAPAAgADgALAAgACcAVQBOAEgARQBBAEwAVABIAFkAJwAsACAAJwBIAEUAQQBMAFQASABZACcAKQANAAoA"), - // DisplayName: to.Ptr("Password Policy"), - // RemediationDescription: to.Ptr("Change password policy to..."), - // Severity: to.Ptr(armsecurity.SeverityEnumLow), - // SupportedCloud: to.Ptr(armsecurity.SupportedCloudEnumAWS), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:01:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:01:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationListBySubscription_example.json -func ExampleCustomAssessmentAutomationsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCustomAssessmentAutomationsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CustomAssessmentAutomationsListResult = armsecurity.CustomAssessmentAutomationsListResult{ - // Value: []*armsecurity.CustomAssessmentAutomation{ - // { - // Name: to.Ptr("MyCustomAssessmentAutomation1"), - // Type: to.Ptr("Microsoft.Security/customAssessmentAutomations"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/TestResourceGroup/providers/Microsoft.Security/customAssessmentAutomations/MyCustomAssessmentAutomation1"), - // Properties: &armsecurity.CustomAssessmentAutomationProperties{ - // Description: to.Ptr("organization passwords policy"), - // AssessmentKey: to.Ptr("d5f442f7-7e77-4bcf-a450-a9c1b9a94eeb"), - // CompressedQuery: to.Ptr("DQAKAEkAYQBtAF8ARwByAG8AdQBwAA0ACgB8ACAAZQB4AHQAZQBuAGQAIABIAGUAYQBsAHQAaABTAHQAYQB0AHUAcwAgAD0AIABpAGYAZgAoAHQAbwBzAHQAcgBpAG4AZwAoAFIAZQBjAG8AcgBkAC4AVQBzAGUAcgBOAGEAbQBlACkAIABjAG8AbgB0AGEAaQBuAHMAIAAnAHUAcwBlAHIAJwAsACAAJwBVAE4ASABFAEEATABUAEgAWQAnACwAIAAnAEgARQBBAEwAVABIAFkAJwApAA0ACgA="), - // DisplayName: to.Ptr("Password Policy"), - // RemediationDescription: to.Ptr("Change password policy to..."), - // Severity: to.Ptr(armsecurity.SeverityEnumMedium), - // SupportedCloud: to.Ptr(armsecurity.SupportedCloudEnumAWS), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("MyCustomAssessmentAutomation2"), - // Type: to.Ptr("Microsoft.Security/customAssessmentAutomations"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/TestResourceGroup/providers/Microsoft.Security/customAssessmentAutomations/MyCustomAssessmentAutomation2"), - // Properties: &armsecurity.CustomAssessmentAutomationProperties{ - // Description: to.Ptr("organization passwords policy"), - // AssessmentKey: to.Ptr("fc1dbcd0-502c-4eab-9312-4014cfc8ea56"), - // CompressedQuery: to.Ptr("Q29tcHV0ZV9OZXR3b3JrCnwgZXh0ZW5kIEhlYWx0aFN0YXR1cyA9ICdVTkhFQUxUSFkn"), - // DisplayName: to.Ptr("Password Policy"), - // RemediationDescription: to.Ptr("Change password policy to..."), - // Severity: to.Ptr(armsecurity.SeverityEnumLow), - // SupportedCloud: to.Ptr(armsecurity.SupportedCloudEnumGCP), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:01:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:01:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/customentitystoreassignments_client.go b/sdk/resourcemanager/security/armsecurity/customentitystoreassignments_client.go index 6d45ef8849fc..80c903848bf0 100644 --- a/sdk/resourcemanager/security/armsecurity/customentitystoreassignments_client.go +++ b/sdk/resourcemanager/security/armsecurity/customentitystoreassignments_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -75,7 +72,7 @@ func (client *CustomEntityStoreAssignmentsClient) Create(ctx context.Context, re } // createCreateRequest creates the Create request. -func (client *CustomEntityStoreAssignmentsClient) createCreateRequest(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string, customEntityStoreAssignmentRequestBody CustomEntityStoreAssignmentRequest, options *CustomEntityStoreAssignmentsClientCreateOptions) (*policy.Request, error) { +func (client *CustomEntityStoreAssignmentsClient) createCreateRequest(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string, customEntityStoreAssignmentRequestBody CustomEntityStoreAssignmentRequest, _ *CustomEntityStoreAssignmentsClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -142,7 +139,7 @@ func (client *CustomEntityStoreAssignmentsClient) Delete(ctx context.Context, re } // deleteCreateRequest creates the Delete request. -func (client *CustomEntityStoreAssignmentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string, options *CustomEntityStoreAssignmentsClientDeleteOptions) (*policy.Request, error) { +func (client *CustomEntityStoreAssignmentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string, _ *CustomEntityStoreAssignmentsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -198,7 +195,7 @@ func (client *CustomEntityStoreAssignmentsClient) Get(ctx context.Context, resou } // getCreateRequest creates the Get request. -func (client *CustomEntityStoreAssignmentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string, options *CustomEntityStoreAssignmentsClientGetOptions) (*policy.Request, error) { +func (client *CustomEntityStoreAssignmentsClient) getCreateRequest(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string, _ *CustomEntityStoreAssignmentsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments/{customEntityStoreAssignmentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -262,7 +259,7 @@ func (client *CustomEntityStoreAssignmentsClient) NewListByResourceGroupPager(re } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *CustomEntityStoreAssignmentsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *CustomEntityStoreAssignmentsClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *CustomEntityStoreAssignmentsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *CustomEntityStoreAssignmentsClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Security/customEntityStoreAssignments" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -321,7 +318,7 @@ func (client *CustomEntityStoreAssignmentsClient) NewListBySubscriptionPager(opt } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *CustomEntityStoreAssignmentsClient) listBySubscriptionCreateRequest(ctx context.Context, options *CustomEntityStoreAssignmentsClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *CustomEntityStoreAssignmentsClient) listBySubscriptionCreateRequest(ctx context.Context, _ *CustomEntityStoreAssignmentsClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/customEntityStoreAssignments" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 f68451699d45..000000000000 --- a/sdk/resourcemanager/security/armsecurity/customentitystoreassignments_client_example_test.go +++ /dev/null @@ -1,230 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentGet_example.json -func ExampleCustomEntityStoreAssignmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCustomEntityStoreAssignmentsClient().Get(ctx, "TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomEntityStoreAssignment = armsecurity.CustomEntityStoreAssignment{ - // Name: to.Ptr("33e7cc6e-a139-4723-a0e5-76993aee0771"), - // Type: to.Ptr("Microsoft.Security/customEntityStoreAssignments"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/TestResourceGroup/providers/Microsoft.Security/customEntityStoreAssignments/33e7cc6e-a139-4723-a0e5-76993aee0771"), - // Properties: &armsecurity.CustomEntityStoreAssignmentProperties{ - // EntityStoreDatabaseLink: to.Ptr("https://dataexplorer.azure.com/clusters/securitydatastore.centralus/databases/DiscoveryAwsKedamari?query=H4sIAAAAAAAAAwtILC4uzy9KCcjPyUyu5OWqUShJzE5VMAQAlMJzABgAAAA="), - // Principal: to.Ptr("aaduser=f3923a3e-ad57-4752-b1a9-fbf3c8e5e082;72f988bf-86f1-41af-91ab-2d7cd011db47"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentCreate_example.json -func ExampleCustomEntityStoreAssignmentsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCustomEntityStoreAssignmentsClient().Create(ctx, "TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", armsecurity.CustomEntityStoreAssignmentRequest{ - Properties: &armsecurity.CustomEntityStoreAssignmentRequestProperties{ - Principal: to.Ptr("aaduser=f3923a3e-ad57-4752-b1a9-fbf3c8e5e082;72f988bf-86f1-41af-91ab-2d7cd011db47"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.CustomEntityStoreAssignment = armsecurity.CustomEntityStoreAssignment{ - // Name: to.Ptr("33e7cc6e-a139-4723-a0e5-76993aee0771"), - // Type: to.Ptr("Microsoft.Security/customEntityStoreAssignments"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/TestResourceGroup/providers/Microsoft.Security/customEntityStoreAssignments/33e7cc6e-a139-4723-a0e5-76993aee0771"), - // Properties: &armsecurity.CustomEntityStoreAssignmentProperties{ - // EntityStoreDatabaseLink: to.Ptr("https://dataexplorer.azure.com/clusters/securitydatastore.centralus/databases/DiscoveryAwsKedamari?query=H4sIAAAAAAAAAwtILC4uzy9KCcjPyUyu5OWqUShJzE5VMAQAlMJzABgAAAA="), - // Principal: to.Ptr("aaduser=f3923a3e-ad57-4752-b1a9-fbf3c8e5e082;72f988bf-86f1-41af-91ab-2d7cd011db47"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentDelete_example.json -func ExampleCustomEntityStoreAssignmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewCustomEntityStoreAssignmentsClient().Delete(ctx, "TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentListByResourceGroup_example.json -func ExampleCustomEntityStoreAssignmentsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCustomEntityStoreAssignmentsClient().NewListByResourceGroupPager("TestResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CustomEntityStoreAssignmentsListResult = armsecurity.CustomEntityStoreAssignmentsListResult{ - // Value: []*armsecurity.CustomEntityStoreAssignment{ - // { - // Name: to.Ptr("33e7cc6e-a139-4723-a0e5-76993aee0771"), - // Type: to.Ptr("Microsoft.Security/customEntityStoreAssignments"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/TestResourceGroup/providers/Microsoft.Security/customEntityStoreAssignments/33e7cc6e-a139-4723-a0e5-76993aee0771"), - // Properties: &armsecurity.CustomEntityStoreAssignmentProperties{ - // EntityStoreDatabaseLink: to.Ptr("https://dataexplorer.azure.com/clusters/securitydatastore.centralus/databases/DiscoveryAwsKedamari?query=H4sIAAAAAAAAAwtILC4uzy9KCcjPyUyu5OWqUShJzE5VMAQAlMJzABgAAAA="), - // Principal: to.Ptr("aaduser=f3923a3e-ad57-4752-b1a9-fbf3c8e5e082;72f988bf-86f1-41af-91ab-2d7cd011db47"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("a400695c-4728-d5cc-8e19-4b5a76f209df"), - // Type: to.Ptr("Microsoft.Security/customEntityStoreAssignments"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/TestResourceGroup/providers/Microsoft.Security/customEntityStoreAssignments/a400695c-4728-d5cc-8e19-4b5a76f209df"), - // Properties: &armsecurity.CustomEntityStoreAssignmentProperties{ - // EntityStoreDatabaseLink: to.Ptr("https://dataexplorer.azure.com/clusters/securitydatastore.centralus/databases/DiscoveryAwsKedamari?query=H4sIAAAAAAAAAwvIz8lMrgzKz0nlqlFIrShJzUtR8Cz2SE3MKcmoVLBVUE9LzClOVQcA1IFnficAAAA="), - // Principal: to.Ptr("aaduser=f6e2564c-f34a-9b61-416c-5e5e7e521118;72f988bf-86f1-41af-91ab-2d7cd011db47"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentListBySubscription_example.json -func ExampleCustomEntityStoreAssignmentsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCustomEntityStoreAssignmentsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.CustomEntityStoreAssignmentsListResult = armsecurity.CustomEntityStoreAssignmentsListResult{ - // Value: []*armsecurity.CustomEntityStoreAssignment{ - // { - // Name: to.Ptr("33e7cc6e-a139-4723-a0e5-76993aee0771"), - // Type: to.Ptr("Microsoft.Security/customEntityStoreAssignments"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/TestResourceGroup/providers/Microsoft.Security/customEntityStoreAssignments/33e7cc6e-a139-4723-a0e5-76993aee0771"), - // Properties: &armsecurity.CustomEntityStoreAssignmentProperties{ - // EntityStoreDatabaseLink: to.Ptr("https://dataexplorer.azure.com/clusters/securitydatastore.centralus/databases/DiscoveryAwsKedamari?query=H4sIAAAAAAAAAwtILC4uzy9KCcjPyUyu5OWqUShJzE5VMAQAlMJzABgAAAA="), - // Principal: to.Ptr("aaduser=f3923a3e-ad57-4752-b1a9-fbf3c8e5e082;72f988bf-86f1-41af-91ab-2d7cd011db47"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("a400695c-4728-d5cc-8e19-4b5a76f209df"), - // Type: to.Ptr("Microsoft.Security/customEntityStoreAssignments"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/TestResourceGroup/providers/Microsoft.Security/customEntityStoreAssignments/a400695c-4728-d5cc-8e19-4b5a76f209df"), - // Properties: &armsecurity.CustomEntityStoreAssignmentProperties{ - // EntityStoreDatabaseLink: to.Ptr("https://dataexplorer.azure.com/clusters/securitydatastore.centralus/databases/DiscoveryAwsKedamari?query=H4sIAAAAAAAAAwvIz8lMrgzKz0nlqlFIrShJzUtR8Cz2SE3MKcmoVLBVUE9LzClOVQcA1IFnficAAAA="), - // Principal: to.Ptr("aaduser=f6e2564c-f34a-9b61-416c-5e5e7e521118;72f988bf-86f1-41af-91ab-2d7cd011db47"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:01:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:01:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/customrecommendations_client.go b/sdk/resourcemanager/security/armsecurity/customrecommendations_client.go new file mode 100644 index 000000000000..6115b09986be --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/customrecommendations_client.go @@ -0,0 +1,283 @@ +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsecurity + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// CustomRecommendationsClient contains the methods for the CustomRecommendations group. +// Don't use this type directly, use NewCustomRecommendationsClient() instead. +type CustomRecommendationsClient struct { + internal *arm.Client +} + +// NewCustomRecommendationsClient creates a new instance of CustomRecommendationsClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewCustomRecommendationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*CustomRecommendationsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &CustomRecommendationsClient{ + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a custom recommendation over a given scope +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-08-01 +// - scope - The scope of the custom recommendation. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), +// subscription (format: +// 'subscriptions/{subscriptionId}'), or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - customRecommendationName - Name of the Custom Recommendation. +// - customRecommendationBody - Custom Recommendation body +// - options - CustomRecommendationsClientCreateOrUpdateOptions contains the optional parameters for the CustomRecommendationsClient.CreateOrUpdate +// method. +func (client *CustomRecommendationsClient) CreateOrUpdate(ctx context.Context, scope string, customRecommendationName string, customRecommendationBody CustomRecommendation, options *CustomRecommendationsClientCreateOrUpdateOptions) (CustomRecommendationsClientCreateOrUpdateResponse, error) { + var err error + const operationName = "CustomRecommendationsClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, scope, customRecommendationName, customRecommendationBody, options) + if err != nil { + return CustomRecommendationsClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CustomRecommendationsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return CustomRecommendationsClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *CustomRecommendationsClient) createOrUpdateCreateRequest(ctx context.Context, scope string, customRecommendationName string, customRecommendationBody CustomRecommendation, _ *CustomRecommendationsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/{scope}/providers/Microsoft.Security/customRecommendations/{customRecommendationName}" + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) + if customRecommendationName == "" { + return nil, errors.New("parameter customRecommendationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{customRecommendationName}", url.PathEscape(customRecommendationName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, customRecommendationBody); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *CustomRecommendationsClient) createOrUpdateHandleResponse(resp *http.Response) (CustomRecommendationsClientCreateOrUpdateResponse, error) { + result := CustomRecommendationsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CustomRecommendation); err != nil { + return CustomRecommendationsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete a custom recommendation over a given scope +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-08-01 +// - scope - The scope of the custom recommendation. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), +// subscription (format: +// 'subscriptions/{subscriptionId}'), or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - customRecommendationName - Name of the Custom Recommendation. +// - options - CustomRecommendationsClientDeleteOptions contains the optional parameters for the CustomRecommendationsClient.Delete +// method. +func (client *CustomRecommendationsClient) Delete(ctx context.Context, scope string, customRecommendationName string, options *CustomRecommendationsClientDeleteOptions) (CustomRecommendationsClientDeleteResponse, error) { + var err error + const operationName = "CustomRecommendationsClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, scope, customRecommendationName, options) + if err != nil { + return CustomRecommendationsClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CustomRecommendationsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return CustomRecommendationsClientDeleteResponse{}, err + } + return CustomRecommendationsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *CustomRecommendationsClient) deleteCreateRequest(ctx context.Context, scope string, customRecommendationName string, _ *CustomRecommendationsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/{scope}/providers/Microsoft.Security/customRecommendations/{customRecommendationName}" + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) + if customRecommendationName == "" { + return nil, errors.New("parameter customRecommendationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{customRecommendationName}", url.PathEscape(customRecommendationName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a specific custom recommendation for the requested scope by customRecommendationName +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-08-01 +// - scope - The scope of the custom recommendation. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), +// subscription (format: +// 'subscriptions/{subscriptionId}'), or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - customRecommendationName - Name of the Custom Recommendation. +// - options - CustomRecommendationsClientGetOptions contains the optional parameters for the CustomRecommendationsClient.Get +// method. +func (client *CustomRecommendationsClient) Get(ctx context.Context, scope string, customRecommendationName string, options *CustomRecommendationsClientGetOptions) (CustomRecommendationsClientGetResponse, error) { + var err error + const operationName = "CustomRecommendationsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, scope, customRecommendationName, options) + if err != nil { + return CustomRecommendationsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return CustomRecommendationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CustomRecommendationsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *CustomRecommendationsClient) getCreateRequest(ctx context.Context, scope string, customRecommendationName string, _ *CustomRecommendationsClientGetOptions) (*policy.Request, error) { + urlPath := "/{scope}/providers/Microsoft.Security/customRecommendations/{customRecommendationName}" + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) + if customRecommendationName == "" { + return nil, errors.New("parameter customRecommendationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{customRecommendationName}", url.PathEscape(customRecommendationName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *CustomRecommendationsClient) getHandleResponse(resp *http.Response) (CustomRecommendationsClientGetResponse, error) { + result := CustomRecommendationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CustomRecommendation); err != nil { + return CustomRecommendationsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Get a list of all relevant custom recommendations over a scope +// +// Generated from API version 2024-08-01 +// - scope - The scope of the custom recommendation. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), +// subscription (format: +// 'subscriptions/{subscriptionId}'), or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - options - CustomRecommendationsClientListOptions contains the optional parameters for the CustomRecommendationsClient.NewListPager +// method. +func (client *CustomRecommendationsClient) NewListPager(scope string, options *CustomRecommendationsClientListOptions) *runtime.Pager[CustomRecommendationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[CustomRecommendationsClientListResponse]{ + More: func(page CustomRecommendationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *CustomRecommendationsClientListResponse) (CustomRecommendationsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "CustomRecommendationsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, scope, options) + }, nil) + if err != nil { + return CustomRecommendationsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *CustomRecommendationsClient) listCreateRequest(ctx context.Context, scope string, _ *CustomRecommendationsClientListOptions) (*policy.Request, error) { + urlPath := "/{scope}/providers/Microsoft.Security/customRecommendations" + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *CustomRecommendationsClient) listHandleResponse(resp *http.Response) (CustomRecommendationsClientListResponse, error) { + result := CustomRecommendationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.CustomRecommendationsList); err != nil { + return CustomRecommendationsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/date_type.go b/sdk/resourcemanager/security/armsecurity/date_type.go index dc7c37d3a02a..2c727677519d 100644 --- a/sdk/resourcemanager/security/armsecurity/date_type.go +++ b/sdk/resourcemanager/security/armsecurity/date_type.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. diff --git a/sdk/resourcemanager/security/armsecurity/defenderforstorage_client.go b/sdk/resourcemanager/security/armsecurity/defenderforstorage_client.go index 3d11948729ac..9a23ee0d681a 100644 --- a/sdk/resourcemanager/security/armsecurity/defenderforstorage_client.go +++ b/sdk/resourcemanager/security/armsecurity/defenderforstorage_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -40,16 +37,79 @@ func NewDefenderForStorageClient(credential azcore.TokenCredential, options *arm return client, nil } +// CancelMalwareScan - Cancels a Defender for Storage malware scan for the specified storage account. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-01-01 +// - resourceID - The identifier of the resource. +// - settingName - Defender for Storage setting name. +// - scanID - The identifier of the scan. Can be either 'latest' or a GUID. +// - options - DefenderForStorageClientCancelMalwareScanOptions contains the optional parameters for the DefenderForStorageClient.CancelMalwareScan +// method. +func (client *DefenderForStorageClient) CancelMalwareScan(ctx context.Context, resourceID string, settingName SettingNameAutoGenerated, scanID string, options *DefenderForStorageClientCancelMalwareScanOptions) (DefenderForStorageClientCancelMalwareScanResponse, error) { + var err error + const operationName = "DefenderForStorageClient.CancelMalwareScan" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.cancelMalwareScanCreateRequest(ctx, resourceID, settingName, scanID, options) + if err != nil { + return DefenderForStorageClientCancelMalwareScanResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DefenderForStorageClientCancelMalwareScanResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DefenderForStorageClientCancelMalwareScanResponse{}, err + } + resp, err := client.cancelMalwareScanHandleResponse(httpResp) + return resp, err +} + +// cancelMalwareScanCreateRequest creates the CancelMalwareScan request. +func (client *DefenderForStorageClient) cancelMalwareScanCreateRequest(ctx context.Context, resourceID string, settingName SettingNameAutoGenerated, scanID string, _ *DefenderForStorageClientCancelMalwareScanOptions) (*policy.Request, error) { + urlPath := "/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}/malwareScans/{scanId}/cancelMalwareScan" + urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID) + if settingName == "" { + return nil, errors.New("parameter settingName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{settingName}", url.PathEscape(string(settingName))) + if scanID == "" { + return nil, errors.New("parameter scanID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scanId}", url.PathEscape(scanID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// cancelMalwareScanHandleResponse handles the CancelMalwareScan response. +func (client *DefenderForStorageClient) cancelMalwareScanHandleResponse(resp *http.Response) (DefenderForStorageClientCancelMalwareScanResponse, error) { + result := DefenderForStorageClientCancelMalwareScanResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MalwareScan); err != nil { + return DefenderForStorageClientCancelMalwareScanResponse{}, err + } + return result, nil +} + // Create - Creates or updates the Defender for Storage settings on a specified storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01-preview +// Generated from API version 2025-01-01 // - resourceID - The identifier of the resource. // - settingName - Defender for Storage setting name. // - defenderForStorageSetting - Defender for Storage Settings // - options - DefenderForStorageClientCreateOptions contains the optional parameters for the DefenderForStorageClient.Create // method. -func (client *DefenderForStorageClient) Create(ctx context.Context, resourceID string, settingName SettingName, defenderForStorageSetting DefenderForStorageSetting, options *DefenderForStorageClientCreateOptions) (DefenderForStorageClientCreateResponse, error) { +func (client *DefenderForStorageClient) Create(ctx context.Context, resourceID string, settingName SettingNameAutoGenerated, defenderForStorageSetting DefenderForStorageSetting, options *DefenderForStorageClientCreateOptions) (DefenderForStorageClientCreateResponse, error) { var err error const operationName = "DefenderForStorageClient.Create" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) @@ -72,7 +132,7 @@ func (client *DefenderForStorageClient) Create(ctx context.Context, resourceID s } // createCreateRequest creates the Create request. -func (client *DefenderForStorageClient) createCreateRequest(ctx context.Context, resourceID string, settingName SettingName, defenderForStorageSetting DefenderForStorageSetting, options *DefenderForStorageClientCreateOptions) (*policy.Request, error) { +func (client *DefenderForStorageClient) createCreateRequest(ctx context.Context, resourceID string, settingName SettingNameAutoGenerated, defenderForStorageSetting DefenderForStorageSetting, _ *DefenderForStorageClientCreateOptions) (*policy.Request, error) { urlPath := "/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}" urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID) if settingName == "" { @@ -84,7 +144,7 @@ func (client *DefenderForStorageClient) createCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, defenderForStorageSetting); err != nil { @@ -105,11 +165,11 @@ func (client *DefenderForStorageClient) createHandleResponse(resp *http.Response // Get - Gets the Defender for Storage settings for the specified storage account. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2022-12-01-preview +// Generated from API version 2025-01-01 // - resourceID - The identifier of the resource. // - settingName - Defender for Storage setting name. // - options - DefenderForStorageClientGetOptions contains the optional parameters for the DefenderForStorageClient.Get method. -func (client *DefenderForStorageClient) Get(ctx context.Context, resourceID string, settingName SettingName, options *DefenderForStorageClientGetOptions) (DefenderForStorageClientGetResponse, error) { +func (client *DefenderForStorageClient) Get(ctx context.Context, resourceID string, settingName SettingNameAutoGenerated, options *DefenderForStorageClientGetOptions) (DefenderForStorageClientGetResponse, error) { var err error const operationName = "DefenderForStorageClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) @@ -132,7 +192,7 @@ func (client *DefenderForStorageClient) Get(ctx context.Context, resourceID stri } // getCreateRequest creates the Get request. -func (client *DefenderForStorageClient) getCreateRequest(ctx context.Context, resourceID string, settingName SettingName, options *DefenderForStorageClientGetOptions) (*policy.Request, error) { +func (client *DefenderForStorageClient) getCreateRequest(ctx context.Context, resourceID string, settingName SettingNameAutoGenerated, _ *DefenderForStorageClientGetOptions) (*policy.Request, error) { urlPath := "/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}" urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID) if settingName == "" { @@ -144,7 +204,7 @@ func (client *DefenderForStorageClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-12-01-preview") + reqQP.Set("api-version", "2025-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -158,3 +218,124 @@ func (client *DefenderForStorageClient) getHandleResponse(resp *http.Response) ( } return result, nil } + +// GetMalwareScan - Gets the Defender for Storage malware scan for the specified storage resource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-01-01 +// - resourceID - The identifier of the resource. +// - settingName - Defender for Storage setting name. +// - scanID - The identifier of the scan. Can be either 'latest' or a GUID. +// - options - DefenderForStorageClientGetMalwareScanOptions contains the optional parameters for the DefenderForStorageClient.GetMalwareScan +// method. +func (client *DefenderForStorageClient) GetMalwareScan(ctx context.Context, resourceID string, settingName SettingNameAutoGenerated, scanID string, options *DefenderForStorageClientGetMalwareScanOptions) (DefenderForStorageClientGetMalwareScanResponse, error) { + var err error + const operationName = "DefenderForStorageClient.GetMalwareScan" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getMalwareScanCreateRequest(ctx, resourceID, settingName, scanID, options) + if err != nil { + return DefenderForStorageClientGetMalwareScanResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DefenderForStorageClientGetMalwareScanResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DefenderForStorageClientGetMalwareScanResponse{}, err + } + resp, err := client.getMalwareScanHandleResponse(httpResp) + return resp, err +} + +// getMalwareScanCreateRequest creates the GetMalwareScan request. +func (client *DefenderForStorageClient) getMalwareScanCreateRequest(ctx context.Context, resourceID string, settingName SettingNameAutoGenerated, scanID string, _ *DefenderForStorageClientGetMalwareScanOptions) (*policy.Request, error) { + urlPath := "/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}/malwareScans/{scanId}" + urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID) + if settingName == "" { + return nil, errors.New("parameter settingName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{settingName}", url.PathEscape(string(settingName))) + if scanID == "" { + return nil, errors.New("parameter scanID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scanId}", url.PathEscape(scanID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getMalwareScanHandleResponse handles the GetMalwareScan response. +func (client *DefenderForStorageClient) getMalwareScanHandleResponse(resp *http.Response) (DefenderForStorageClientGetMalwareScanResponse, error) { + result := DefenderForStorageClientGetMalwareScanResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MalwareScan); err != nil { + return DefenderForStorageClientGetMalwareScanResponse{}, err + } + return result, nil +} + +// StartMalwareScan - Initiate a Defender for Storage malware scan for the specified storage account. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-01-01 +// - resourceID - The identifier of the resource. +// - settingName - Defender for Storage setting name. +// - options - DefenderForStorageClientStartMalwareScanOptions contains the optional parameters for the DefenderForStorageClient.StartMalwareScan +// method. +func (client *DefenderForStorageClient) StartMalwareScan(ctx context.Context, resourceID string, settingName SettingNameAutoGenerated, options *DefenderForStorageClientStartMalwareScanOptions) (DefenderForStorageClientStartMalwareScanResponse, error) { + var err error + const operationName = "DefenderForStorageClient.StartMalwareScan" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.startMalwareScanCreateRequest(ctx, resourceID, settingName, options) + if err != nil { + return DefenderForStorageClientStartMalwareScanResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DefenderForStorageClientStartMalwareScanResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DefenderForStorageClientStartMalwareScanResponse{}, err + } + resp, err := client.startMalwareScanHandleResponse(httpResp) + return resp, err +} + +// startMalwareScanCreateRequest creates the StartMalwareScan request. +func (client *DefenderForStorageClient) startMalwareScanCreateRequest(ctx context.Context, resourceID string, settingName SettingNameAutoGenerated, _ *DefenderForStorageClientStartMalwareScanOptions) (*policy.Request, error) { + urlPath := "/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}/startMalwareScan" + urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID) + if settingName == "" { + return nil, errors.New("parameter settingName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{settingName}", url.PathEscape(string(settingName))) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-01-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// startMalwareScanHandleResponse handles the StartMalwareScan response. +func (client *DefenderForStorageClient) startMalwareScanHandleResponse(resp *http.Response) (DefenderForStorageClientStartMalwareScanResponse, error) { + result := DefenderForStorageClientStartMalwareScanResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MalwareScan); err != nil { + return DefenderForStorageClientStartMalwareScanResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/defenderforstorage_client_example_test.go b/sdk/resourcemanager/security/armsecurity/defenderforstorage_client_example_test.go deleted file mode 100644 index 5718ad3057fd..000000000000 --- a/sdk/resourcemanager/security/armsecurity/defenderforstorage_client_example_test.go +++ /dev/null @@ -1,118 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-12-01-preview/examples/DefenderForStorage/GetDefenderForStorageSettings_example.json -func ExampleDefenderForStorageClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDefenderForStorageClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", armsecurity.SettingNameCurrent, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DefenderForStorageSetting = armsecurity.DefenderForStorageSetting{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Security/defenderForStorageSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/defenderForStorageSettings/current"), - // Properties: &armsecurity.DefenderForStorageSettingProperties{ - // IsEnabled: to.Ptr(true), - // MalwareScanning: &armsecurity.MalwareScanningProperties{ - // OnUpload: &armsecurity.OnUploadProperties{ - // CapGBPerMonth: to.Ptr[int32](-1), - // IsEnabled: to.Ptr(true), - // }, - // ScanResultsEventGridTopicResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.EventGrid/topics/sampletopic"), - // }, - // OverrideSubscriptionLevelSettings: to.Ptr(true), - // SensitiveDataDiscovery: &armsecurity.SensitiveDataDiscoveryProperties{ - // IsEnabled: to.Ptr(false), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-12-01-preview/examples/DefenderForStorage/PutDefenderForStorageSettings_example.json -func ExampleDefenderForStorageClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDefenderForStorageClient().Create(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", armsecurity.SettingNameCurrent, armsecurity.DefenderForStorageSetting{ - Properties: &armsecurity.DefenderForStorageSettingProperties{ - IsEnabled: to.Ptr(true), - MalwareScanning: &armsecurity.MalwareScanningProperties{ - OnUpload: &armsecurity.OnUploadProperties{ - CapGBPerMonth: to.Ptr[int32](-1), - IsEnabled: to.Ptr(true), - }, - ScanResultsEventGridTopicResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.EventGrid/topics/sampletopic"), - }, - OverrideSubscriptionLevelSettings: to.Ptr(true), - SensitiveDataDiscovery: &armsecurity.SensitiveDataDiscoveryProperties{ - IsEnabled: to.Ptr(true), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DefenderForStorageSetting = armsecurity.DefenderForStorageSetting{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Security/defenderForStorageSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/defenderForStorageSettings/current"), - // Properties: &armsecurity.DefenderForStorageSettingProperties{ - // IsEnabled: to.Ptr(true), - // MalwareScanning: &armsecurity.MalwareScanningProperties{ - // OnUpload: &armsecurity.OnUploadProperties{ - // CapGBPerMonth: to.Ptr[int32](-1), - // IsEnabled: to.Ptr(true), - // }, - // OperationStatus: &armsecurity.OperationStatus{ - // Code: to.Ptr("Succeeded"), - // }, - // ScanResultsEventGridTopicResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.EventGrid/topics/sampletopic"), - // }, - // OverrideSubscriptionLevelSettings: to.Ptr(true), - // SensitiveDataDiscovery: &armsecurity.SensitiveDataDiscoveryProperties{ - // IsEnabled: to.Ptr(true), - // OperationStatus: &armsecurity.OperationStatus{ - // Code: to.Ptr("Succeeded"), - // }, - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/devicesecuritygroups_client.go b/sdk/resourcemanager/security/armsecurity/devicesecuritygroups_client.go index a40731ca039b..fd23f176e76a 100644 --- a/sdk/resourcemanager/security/armsecurity/devicesecuritygroups_client.go +++ b/sdk/resourcemanager/security/armsecurity/devicesecuritygroups_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -73,7 +70,7 @@ func (client *DeviceSecurityGroupsClient) CreateOrUpdate(ctx context.Context, re } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DeviceSecurityGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceID string, deviceSecurityGroupName string, deviceSecurityGroup DeviceSecurityGroup, options *DeviceSecurityGroupsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *DeviceSecurityGroupsClient) createOrUpdateCreateRequest(ctx context.Context, resourceID string, deviceSecurityGroupName string, deviceSecurityGroup DeviceSecurityGroup, _ *DeviceSecurityGroupsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}" urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID) if deviceSecurityGroupName == "" { @@ -134,7 +131,7 @@ func (client *DeviceSecurityGroupsClient) Delete(ctx context.Context, resourceID } // deleteCreateRequest creates the Delete request. -func (client *DeviceSecurityGroupsClient) deleteCreateRequest(ctx context.Context, resourceID string, deviceSecurityGroupName string, options *DeviceSecurityGroupsClientDeleteOptions) (*policy.Request, error) { +func (client *DeviceSecurityGroupsClient) deleteCreateRequest(ctx context.Context, resourceID string, deviceSecurityGroupName string, _ *DeviceSecurityGroupsClientDeleteOptions) (*policy.Request, error) { urlPath := "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}" urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID) if deviceSecurityGroupName == "" { @@ -184,7 +181,7 @@ func (client *DeviceSecurityGroupsClient) Get(ctx context.Context, resourceID st } // getCreateRequest creates the Get request. -func (client *DeviceSecurityGroupsClient) getCreateRequest(ctx context.Context, resourceID string, deviceSecurityGroupName string, options *DeviceSecurityGroupsClientGetOptions) (*policy.Request, error) { +func (client *DeviceSecurityGroupsClient) getCreateRequest(ctx context.Context, resourceID string, deviceSecurityGroupName string, _ *DeviceSecurityGroupsClientGetOptions) (*policy.Request, error) { urlPath := "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups/{deviceSecurityGroupName}" urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID) if deviceSecurityGroupName == "" { @@ -241,7 +238,7 @@ func (client *DeviceSecurityGroupsClient) NewListPager(resourceID string, option } // listCreateRequest creates the List request. -func (client *DeviceSecurityGroupsClient) listCreateRequest(ctx context.Context, resourceID string, options *DeviceSecurityGroupsClientListOptions) (*policy.Request, error) { +func (client *DeviceSecurityGroupsClient) listCreateRequest(ctx context.Context, resourceID string, _ *DeviceSecurityGroupsClientListOptions) (*policy.Request, error) { urlPath := "/{resourceId}/providers/Microsoft.Security/deviceSecurityGroups" urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) 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 f2a8921ffbc0..000000000000 --- a/sdk/resourcemanager/security/armsecurity/devicesecuritygroups_client_example_test.go +++ /dev/null @@ -1,664 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/ListDeviceSecurityGroups_example.json -func ExampleDeviceSecurityGroupsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDeviceSecurityGroupsClient().NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DeviceSecurityGroupList = armsecurity.DeviceSecurityGroupList{ - // Value: []*armsecurity.DeviceSecurityGroup{ - // { - // Name: to.Ptr("samplesecuritygroup"), - // Type: to.Ptr("Microsoft.Security/deviceSecurityGroups"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub/providers/Microsoft.Security/deviceSecurityGroups/samplesecuritygroup"), - // Properties: &armsecurity.DeviceSecurityGroupProperties{ - // AllowlistRules: []armsecurity.AllowlistCustomAlertRuleClassification{ - // &armsecurity.ConnectionToIPNotAllowed{ - // Description: to.Ptr("Get an alert when an outbound connection is created between your device and an ip that isn't allowed"), - // DisplayName: to.Ptr("Outbound connection to an ip that isn't allowed"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("ConnectionToIpNotAllowed"), - // ValueType: to.Ptr(armsecurity.ValueTypeIPCidr), - // AllowlistValues: []*string{ - // }, - // }, - // &armsecurity.LocalUserNotAllowed{ - // Description: to.Ptr("Get an alert when a local user that isn't allowed logins to the device"), - // DisplayName: to.Ptr("Login by a local user that isn't allowed"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("LocalUserNotAllowed"), - // ValueType: to.Ptr(armsecurity.ValueTypeString), - // AllowlistValues: []*string{ - // }, - // }, - // &armsecurity.ProcessNotAllowed{ - // Description: to.Ptr("Get an alert when a process that isn't allowed is executed"), - // DisplayName: to.Ptr("Execution of a process that isn't allowed"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("ProcessNotAllowed"), - // ValueType: to.Ptr(armsecurity.ValueTypeString), - // AllowlistValues: []*string{ - // }, - // }}, - // DenylistRules: []*armsecurity.DenylistCustomAlertRule{ - // }, - // ThresholdRules: []armsecurity.ThresholdCustomAlertRuleClassification{ - // }, - // TimeWindowRules: []armsecurity.TimeWindowCustomAlertRuleClassification{ - // &armsecurity.ActiveConnectionsNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of active connections of a device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of active connections is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("ActiveConnectionsNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.AmqpC2DMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (AMQP protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of cloud to device messages (AMQP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("AmqpC2DMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.MqttC2DMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (MQTT protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of cloud to device messages (MQTT protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("MqttC2DMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.HTTPC2DMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (HTTP protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of cloud to device messages (HTTP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("HttpC2DMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.AmqpC2DRejectedMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (AMQP protocol) that were rejected by the device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of rejected cloud to device messages (AMQP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("AmqpC2DRejectedMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.MqttC2DRejectedMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (MQTT protocol) that were rejected by the device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of rejected cloud to device messages (MQTT protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("MqttC2DRejectedMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.HTTPC2DRejectedMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (HTTP protocol) that were rejected by the device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of rejected cloud to device messages (HTTP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("HttpC2DRejectedMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.AmqpD2CMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of device to cloud messages (AMQP protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of device to cloud messages (AMQP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("AmqpD2CMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.MqttD2CMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of device to cloud messages (MQTT protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of device to cloud messages (MQTT protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("MqttD2CMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.HTTPD2CMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of device to cloud messages (HTTP protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of device to cloud messages (HTTP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("HttpD2CMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.DirectMethodInvokesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of direct method invokes in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of direct method invokes is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("DirectMethodInvokesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.FailedLocalLoginsNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of failed local logins on the device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of failed local logins is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("FailedLocalLoginsNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.FileUploadsNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of file uploads from the device to the cloud in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of file uploads is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("FileUploadsNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.QueuePurgesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of device queue purges in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of device queue purges is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("QueuePurgesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.TwinUpdatesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of twin updates (by the device or the service) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of twin updates is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("TwinUpdatesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.UnauthorizedOperationsNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number unauthorized operations in the time window is not in the allowed range. Unauthorized operations are operations that affect the device (or done by it) that fail because of an unauthorized error"), - // DisplayName: to.Ptr("Number of unauthorized operations is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("UnauthorizedOperationsNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/GetDeviceSecurityGroups_example.json -func ExampleDeviceSecurityGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDeviceSecurityGroupsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", "samplesecuritygroup", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DeviceSecurityGroup = armsecurity.DeviceSecurityGroup{ - // Name: to.Ptr("samplesecuritygroup"), - // Type: to.Ptr("Microsoft.Security/deviceSecurityGroups"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub/providers/Microsoft.Security/deviceSecurityGroups/samplesecuritygroup"), - // Properties: &armsecurity.DeviceSecurityGroupProperties{ - // AllowlistRules: []armsecurity.AllowlistCustomAlertRuleClassification{ - // &armsecurity.ConnectionToIPNotAllowed{ - // Description: to.Ptr("Get an alert when an outbound connection is created between your device and an ip that isn't allowed"), - // DisplayName: to.Ptr("Outbound connection to an ip that isn't allowed"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("ConnectionToIpNotAllowed"), - // ValueType: to.Ptr(armsecurity.ValueTypeIPCidr), - // AllowlistValues: []*string{ - // }, - // }, - // &armsecurity.LocalUserNotAllowed{ - // Description: to.Ptr("Get an alert when a local user that isn't allowed logins to the device"), - // DisplayName: to.Ptr("Login by a local user that isn't allowed"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("LocalUserNotAllowed"), - // ValueType: to.Ptr(armsecurity.ValueTypeString), - // AllowlistValues: []*string{ - // }, - // }, - // &armsecurity.ProcessNotAllowed{ - // Description: to.Ptr("Get an alert when a process that isn't allowed is executed"), - // DisplayName: to.Ptr("Execution of a process that isn't allowed"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("ProcessNotAllowed"), - // ValueType: to.Ptr(armsecurity.ValueTypeString), - // AllowlistValues: []*string{ - // }, - // }}, - // DenylistRules: []*armsecurity.DenylistCustomAlertRule{ - // }, - // ThresholdRules: []armsecurity.ThresholdCustomAlertRuleClassification{ - // }, - // TimeWindowRules: []armsecurity.TimeWindowCustomAlertRuleClassification{ - // &armsecurity.ActiveConnectionsNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of active connections of a device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of active connections is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("ActiveConnectionsNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.AmqpC2DMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (AMQP protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of cloud to device messages (AMQP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("AmqpC2DMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.MqttC2DMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (MQTT protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of cloud to device messages (MQTT protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("MqttC2DMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.HTTPC2DMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (HTTP protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of cloud to device messages (HTTP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("HttpC2DMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.AmqpC2DRejectedMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (AMQP protocol) that were rejected by the device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of rejected cloud to device messages (AMQP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("AmqpC2DRejectedMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.MqttC2DRejectedMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (MQTT protocol) that were rejected by the device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of rejected cloud to device messages (MQTT protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("MqttC2DRejectedMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.HTTPC2DRejectedMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (HTTP protocol) that were rejected by the device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of rejected cloud to device messages (HTTP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("HttpC2DRejectedMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.AmqpD2CMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of device to cloud messages (AMQP protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of device to cloud messages (AMQP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("AmqpD2CMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.MqttD2CMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of device to cloud messages (MQTT protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of device to cloud messages (MQTT protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("MqttD2CMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.HTTPD2CMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of device to cloud messages (HTTP protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of device to cloud messages (HTTP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("HttpD2CMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.DirectMethodInvokesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of direct method invokes in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of direct method invokes is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("DirectMethodInvokesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.FailedLocalLoginsNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of failed local logins on the device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of failed local logins is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("FailedLocalLoginsNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.FileUploadsNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of file uploads from the device to the cloud in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of file uploads is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("FileUploadsNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.QueuePurgesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of device queue purges in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of device queue purges is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("QueuePurgesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.TwinUpdatesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of twin updates (by the device or the service) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of twin updates is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("TwinUpdatesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.UnauthorizedOperationsNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number unauthorized operations in the time window is not in the allowed range. Unauthorized operations are operations that affect the device (or done by it) that fail because of an unauthorized error"), - // DisplayName: to.Ptr("Number of unauthorized operations is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("UnauthorizedOperationsNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/PutDeviceSecurityGroups_example.json -func ExampleDeviceSecurityGroupsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDeviceSecurityGroupsClient().CreateOrUpdate(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", "samplesecuritygroup", armsecurity.DeviceSecurityGroup{ - Properties: &armsecurity.DeviceSecurityGroupProperties{ - TimeWindowRules: []armsecurity.TimeWindowCustomAlertRuleClassification{ - &armsecurity.ActiveConnectionsNotInAllowedRange{ - IsEnabled: to.Ptr(true), - RuleType: to.Ptr("ActiveConnectionsNotInAllowedRange"), - MaxThreshold: to.Ptr[int32](30), - MinThreshold: to.Ptr[int32](0), - TimeWindowSize: to.Ptr("PT05M"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DeviceSecurityGroup = armsecurity.DeviceSecurityGroup{ - // Name: to.Ptr("samplesecuritygroup"), - // Type: to.Ptr("Microsoft.Security/deviceSecurityGroups"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub/providers/Microsoft.Security/deviceSecurityGroups/samplesecuritygroup"), - // Properties: &armsecurity.DeviceSecurityGroupProperties{ - // AllowlistRules: []armsecurity.AllowlistCustomAlertRuleClassification{ - // &armsecurity.ConnectionToIPNotAllowed{ - // Description: to.Ptr("Get an alert when an outbound connection is created between your device and an ip that isn't allowed"), - // DisplayName: to.Ptr("Outbound connection to an ip that isn't allowed"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("ConnectionToIpNotAllowed"), - // AllowlistValues: []*string{ - // }, - // }, - // &armsecurity.LocalUserNotAllowed{ - // Description: to.Ptr("Get an alert when a local user that isn't allowed logins to the device"), - // DisplayName: to.Ptr("Login by a local user that isn't allowed"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("LocalUserNotAllowed"), - // AllowlistValues: []*string{ - // }, - // }, - // &armsecurity.ProcessNotAllowed{ - // Description: to.Ptr("Get an alert when a process that isn't allowed is executed"), - // DisplayName: to.Ptr("Execution of a process that isn't allowed"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("ProcessNotAllowed"), - // AllowlistValues: []*string{ - // }, - // }}, - // DenylistRules: []*armsecurity.DenylistCustomAlertRule{ - // }, - // ThresholdRules: []armsecurity.ThresholdCustomAlertRuleClassification{ - // }, - // TimeWindowRules: []armsecurity.TimeWindowCustomAlertRuleClassification{ - // &armsecurity.ActiveConnectionsNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of active connections of a device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of active connections is not in allowed range"), - // IsEnabled: to.Ptr(true), - // RuleType: to.Ptr("ActiveConnectionsNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](30), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT05M"), - // }, - // &armsecurity.AmqpC2DMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (AMQP protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of cloud to device messages (AMQP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("AmqpC2DMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.MqttC2DMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (MQTT protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of cloud to device messages (MQTT protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("MqttC2DMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.HTTPC2DMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (HTTP protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of cloud to device messages (HTTP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("HttpC2DMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.AmqpC2DRejectedMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (AMQP protocol) that were rejected by the device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of rejected cloud to device messages (AMQP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("AmqpC2DRejectedMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.MqttC2DRejectedMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (MQTT protocol) that were rejected by the device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of rejected cloud to device messages (MQTT protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("MqttC2DRejectedMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.HTTPC2DRejectedMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of cloud to device messages (HTTP protocol) that were rejected by the device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of rejected cloud to device messages (HTTP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("HttpC2DRejectedMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.AmqpD2CMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of device to cloud messages (AMQP protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of device to cloud messages (AMQP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("AmqpD2CMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.MqttD2CMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of device to cloud messages (MQTT protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of device to cloud messages (MQTT protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("MqttD2CMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.HTTPD2CMessagesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of device to cloud messages (HTTP protocol) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of device to cloud messages (HTTP protocol) is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("HttpD2CMessagesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.DirectMethodInvokesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of direct method invokes in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of direct method invokes is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("DirectMethodInvokesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.FailedLocalLoginsNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of failed local logins on the device in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of failed local logins is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("FailedLocalLoginsNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.FileUploadsNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of file uploads from the device to the cloud in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of file uploads is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("FileUploadsNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.QueuePurgesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of device queue purges in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of device queue purges is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("QueuePurgesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.TwinUpdatesNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number of twin updates (by the device or the service) in the time window is not in the allowed range"), - // DisplayName: to.Ptr("Number of twin updates is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("TwinUpdatesNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }, - // &armsecurity.UnauthorizedOperationsNotInAllowedRange{ - // Description: to.Ptr("Get an alert when the number unauthorized operations in the time window is not in the allowed range. Unauthorized operations are operations that affect the device (or done by it) that fail because of an unauthorized error"), - // DisplayName: to.Ptr("Number of unauthorized operations is not in allowed range"), - // IsEnabled: to.Ptr(false), - // RuleType: to.Ptr("UnauthorizedOperationsNotInAllowedRange"), - // MaxThreshold: to.Ptr[int32](0), - // MinThreshold: to.Ptr[int32](0), - // TimeWindowSize: to.Ptr("PT15M"), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/DeleteDeviceSecurityGroups_example.json -func ExampleDeviceSecurityGroupsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewDeviceSecurityGroupsClient().Delete(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", "samplesecuritygroup", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/devopsconfigurations_client.go b/sdk/resourcemanager/security/armsecurity/devopsconfigurations_client.go index 9ef07d99c65b..39382ed802be 100644 --- a/sdk/resourcemanager/security/armsecurity/devopsconfigurations_client.go +++ b/sdk/resourcemanager/security/armsecurity/devopsconfigurations_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewDevOpsConfigurationsClient(subscriptionID string, credential azcore.Toke // BeginCreateOrUpdate - Creates or updates a DevOps Configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - devOpsConfiguration - The DevOps configuration resource payload. @@ -73,7 +70,7 @@ func (client *DevOpsConfigurationsClient) BeginCreateOrUpdate(ctx context.Contex // CreateOrUpdate - Creates or updates a DevOps Configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 func (client *DevOpsConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, securityConnectorName string, devOpsConfiguration DevOpsConfiguration, options *DevOpsConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "DevOpsConfigurationsClient.BeginCreateOrUpdate" @@ -96,7 +93,7 @@ func (client *DevOpsConfigurationsClient) createOrUpdate(ctx context.Context, re } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DevOpsConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, devOpsConfiguration DevOpsConfiguration, options *DevOpsConfigurationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *DevOpsConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, devOpsConfiguration DevOpsConfiguration, _ *DevOpsConfigurationsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -115,7 +112,7 @@ func (client *DevOpsConfigurationsClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, devOpsConfiguration); err != nil { @@ -127,7 +124,7 @@ func (client *DevOpsConfigurationsClient) createOrUpdateCreateRequest(ctx contex // BeginDelete - Deletes a DevOps Connector. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - options - DevOpsConfigurationsClientBeginDeleteOptions contains the optional parameters for the DevOpsConfigurationsClient.BeginDelete @@ -152,7 +149,7 @@ func (client *DevOpsConfigurationsClient) BeginDelete(ctx context.Context, resou // Delete - Deletes a DevOps Connector. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 func (client *DevOpsConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, securityConnectorName string, options *DevOpsConfigurationsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DevOpsConfigurationsClient.BeginDelete" @@ -175,7 +172,7 @@ func (client *DevOpsConfigurationsClient) deleteOperation(ctx context.Context, r } // deleteCreateRequest creates the Delete request. -func (client *DevOpsConfigurationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, options *DevOpsConfigurationsClientBeginDeleteOptions) (*policy.Request, error) { +func (client *DevOpsConfigurationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, _ *DevOpsConfigurationsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -194,7 +191,7 @@ func (client *DevOpsConfigurationsClient) deleteCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -203,7 +200,7 @@ func (client *DevOpsConfigurationsClient) deleteCreateRequest(ctx context.Contex // Get - Gets a DevOps Configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - options - DevOpsConfigurationsClientGetOptions contains the optional parameters for the DevOpsConfigurationsClient.Get @@ -231,7 +228,7 @@ func (client *DevOpsConfigurationsClient) Get(ctx context.Context, resourceGroup } // getCreateRequest creates the Get request. -func (client *DevOpsConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, options *DevOpsConfigurationsClientGetOptions) (*policy.Request, error) { +func (client *DevOpsConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, _ *DevOpsConfigurationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -250,7 +247,7 @@ func (client *DevOpsConfigurationsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -267,7 +264,7 @@ func (client *DevOpsConfigurationsClient) getHandleResponse(resp *http.Response) // NewListPager - List DevOps Configurations. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - options - DevOpsConfigurationsClientListOptions contains the optional parameters for the DevOpsConfigurationsClient.NewListPager @@ -296,7 +293,7 @@ func (client *DevOpsConfigurationsClient) NewListPager(resourceGroupName string, } // listCreateRequest creates the List request. -func (client *DevOpsConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, options *DevOpsConfigurationsClientListOptions) (*policy.Request, error) { +func (client *DevOpsConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, _ *DevOpsConfigurationsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -315,7 +312,7 @@ func (client *DevOpsConfigurationsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -333,7 +330,7 @@ func (client *DevOpsConfigurationsClient) listHandleResponse(resp *http.Response // BeginUpdate - Updates a DevOps Configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - devOpsConfiguration - The DevOps configuration resource payload. @@ -360,7 +357,7 @@ func (client *DevOpsConfigurationsClient) BeginUpdate(ctx context.Context, resou // Update - Updates a DevOps Configuration. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 func (client *DevOpsConfigurationsClient) update(ctx context.Context, resourceGroupName string, securityConnectorName string, devOpsConfiguration DevOpsConfiguration, options *DevOpsConfigurationsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "DevOpsConfigurationsClient.BeginUpdate" @@ -383,7 +380,7 @@ func (client *DevOpsConfigurationsClient) update(ctx context.Context, resourceGr } // updateCreateRequest creates the Update request. -func (client *DevOpsConfigurationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, devOpsConfiguration DevOpsConfiguration, options *DevOpsConfigurationsClientBeginUpdateOptions) (*policy.Request, error) { +func (client *DevOpsConfigurationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, devOpsConfiguration DevOpsConfiguration, _ *DevOpsConfigurationsClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -402,7 +399,7 @@ func (client *DevOpsConfigurationsClient) updateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, devOpsConfiguration); err != nil { diff --git a/sdk/resourcemanager/security/armsecurity/devopsconfigurations_client_example_test.go b/sdk/resourcemanager/security/armsecurity/devopsconfigurations_client_example_test.go deleted file mode 100644 index 8677e5c5dcda..000000000000 --- a/sdk/resourcemanager/security/armsecurity/devopsconfigurations_client_example_test.go +++ /dev/null @@ -1,269 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListDevOpsConfigurations_example.json -func ExampleDevOpsConfigurationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDevOpsConfigurationsClient().NewListPager("myRg", "mySecurityConnectorName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DevOpsConfigurationListResponse = armsecurity.DevOpsConfigurationListResponse{ - // Value: []*armsecurity.DevOpsConfiguration{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default"), - // Properties: &armsecurity.DevOpsConfigurationProperties{ - // AutoDiscovery: to.Ptr(armsecurity.AutoDiscoveryEnabled), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetDevOpsConfigurations_example.json -func ExampleDevOpsConfigurationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDevOpsConfigurationsClient().Get(ctx, "myRg", "mySecurityConnectorName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DevOpsConfiguration = armsecurity.DevOpsConfiguration{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default"), - // Properties: &armsecurity.DevOpsConfigurationProperties{ - // AutoDiscovery: to.Ptr(armsecurity.AutoDiscoveryEnabled), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/CreateOrUpdateDevOpsConfigurationsOnboardCurrentAndFuture_example.json -func ExampleDevOpsConfigurationsClient_BeginCreateOrUpdate_createOrUpdateDevOpsConfigurationsOnboardCurrentAndFuture() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDevOpsConfigurationsClient().BeginCreateOrUpdate(ctx, "myRg", "mySecurityConnectorName", armsecurity.DevOpsConfiguration{ - Properties: &armsecurity.DevOpsConfigurationProperties{ - Authorization: &armsecurity.Authorization{ - Code: to.Ptr("00000000000000000000"), - }, - AutoDiscovery: to.Ptr(armsecurity.AutoDiscoveryEnabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DevOpsConfiguration = armsecurity.DevOpsConfiguration{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default"), - // Properties: &armsecurity.DevOpsConfigurationProperties{ - // AutoDiscovery: to.Ptr(armsecurity.AutoDiscoveryEnabled), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/CreateOrUpdateDevOpsConfigurationsOnboardCurrentOnly_example.json -func ExampleDevOpsConfigurationsClient_BeginCreateOrUpdate_createOrUpdateDevOpsConfigurationsOnboardCurrentOnly() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDevOpsConfigurationsClient().BeginCreateOrUpdate(ctx, "myRg", "mySecurityConnectorName", armsecurity.DevOpsConfiguration{ - Properties: &armsecurity.DevOpsConfigurationProperties{ - Authorization: &armsecurity.Authorization{ - Code: to.Ptr("00000000000000000000"), - }, - AutoDiscovery: to.Ptr(armsecurity.AutoDiscoveryDisabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DevOpsConfiguration = armsecurity.DevOpsConfiguration{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default"), - // Properties: &armsecurity.DevOpsConfigurationProperties{ - // AutoDiscovery: to.Ptr(armsecurity.AutoDiscoveryDisabled), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/CreateOrUpdateDevOpsConfigurationsOnboardSelected_example.json -func ExampleDevOpsConfigurationsClient_BeginCreateOrUpdate_createOrUpdateDevOpsConfigurationsOnboardSelected() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDevOpsConfigurationsClient().BeginCreateOrUpdate(ctx, "myRg", "mySecurityConnectorName", armsecurity.DevOpsConfiguration{ - Properties: &armsecurity.DevOpsConfigurationProperties{ - Authorization: &armsecurity.Authorization{ - Code: to.Ptr("00000000000000000000"), - }, - AutoDiscovery: to.Ptr(armsecurity.AutoDiscoveryDisabled), - TopLevelInventoryList: []*string{ - to.Ptr("org1"), - to.Ptr("org2")}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DevOpsConfiguration = armsecurity.DevOpsConfiguration{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default"), - // Properties: &armsecurity.DevOpsConfigurationProperties{ - // AutoDiscovery: to.Ptr(armsecurity.AutoDiscoveryDisabled), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // TopLevelInventoryList: []*string{ - // to.Ptr("org1"), - // to.Ptr("org2")}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/UpdateDevOpsConfigurations_example.json -func ExampleDevOpsConfigurationsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDevOpsConfigurationsClient().BeginUpdate(ctx, "myRg", "mySecurityConnectorName", armsecurity.DevOpsConfiguration{ - Properties: &armsecurity.DevOpsConfigurationProperties{ - AutoDiscovery: to.Ptr(armsecurity.AutoDiscoveryEnabled), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DevOpsConfiguration = armsecurity.DevOpsConfiguration{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default"), - // Properties: &armsecurity.DevOpsConfigurationProperties{ - // AutoDiscovery: to.Ptr(armsecurity.AutoDiscoveryEnabled), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/DeleteDevOpsConfigurations_example.json -func ExampleDevOpsConfigurationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewDevOpsConfigurationsClient().BeginDelete(ctx, "myRg", "mySecurityConnectorName", 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/devopsoperationresults_client.go b/sdk/resourcemanager/security/armsecurity/devopsoperationresults_client.go index 2d04fc1b90be..aa3144f55c0f 100644 --- a/sdk/resourcemanager/security/armsecurity/devopsoperationresults_client.go +++ b/sdk/resourcemanager/security/armsecurity/devopsoperationresults_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewDevOpsOperationResultsClient(subscriptionID string, credential azcore.To // Get - Get devops long running operation result. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - operationResultID - The operation result Id. @@ -75,7 +72,7 @@ func (client *DevOpsOperationResultsClient) Get(ctx context.Context, resourceGro } // getCreateRequest creates the Get request. -func (client *DevOpsOperationResultsClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, operationResultID string, options *DevOpsOperationResultsClientGetOptions) (*policy.Request, error) { +func (client *DevOpsOperationResultsClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, operationResultID string, _ *DevOpsOperationResultsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/operationResults/{operationResultId}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -98,7 +95,7 @@ func (client *DevOpsOperationResultsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/security/armsecurity/devopsoperationresults_client_example_test.go b/sdk/resourcemanager/security/armsecurity/devopsoperationresults_client_example_test.go deleted file mode 100644 index fa9a6bf9944c..000000000000 --- a/sdk/resourcemanager/security/armsecurity/devopsoperationresults_client_example_test.go +++ /dev/null @@ -1,78 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetDevOpsOperationResultsFailed_example.json -func ExampleDevOpsOperationResultsClient_Get_getDevOpsOperationResultsFailed() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDevOpsOperationResultsClient().Get(ctx, "myRg", "mySecurityConnectorName", "8d4caace-e7b3-4b3e-af99-73f76829ebcf", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatusResult = armsecurity.OperationStatusResult{ - // Name: to.Ptr("8d4caace-e7b3-4b3e-af99-73f76829ebcf"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-21T03:25:15.000Z"); return t}()), - // Error: &armsecurity.ErrorDetailAutoGenerated{ - // Code: to.Ptr("TokenExchangeFailed"), - // Message: to.Ptr("AzureDevOps OAuth token exchange failed"), - // }, - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/operationResults/8d4caace-e7b3-4b3e-af99-73f76829ebcf?api-version=2023-09-01-preview"), - // PercentComplete: to.Ptr[float32](100), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-21T03:23:15.000Z"); return t}()), - // Status: to.Ptr("Failed"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetDevOpsOperationResultsSucceeded_example.json -func ExampleDevOpsOperationResultsClient_Get_getDevOpsOperationResultsSucceeded() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDevOpsOperationResultsClient().Get(ctx, "myRg", "mySecurityConnectorName", "4e826cf1-5c36-4808-a7d2-fb4f5170978b", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatusResult = armsecurity.OperationStatusResult{ - // Name: to.Ptr("4e826cf1-5c36-4808-a7d2-fb4f5170978b"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-21T03:25:15.000Z"); return t}()), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/operationResults/4e826cf1-5c36-4808-a7d2-fb4f5170978b?api-version=2023-09-01-preview"), - // PercentComplete: to.Ptr[float32](100), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-06-21T03:23:15.000Z"); return t}()), - // Status: to.Ptr("Succeeded"), - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/discoveredsecuritysolutions_client.go b/sdk/resourcemanager/security/armsecurity/discoveredsecuritysolutions_client.go index fe50ee9a9696..d74351fb3550 100644 --- a/sdk/resourcemanager/security/armsecurity/discoveredsecuritysolutions_client.go +++ b/sdk/resourcemanager/security/armsecurity/discoveredsecuritysolutions_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -75,7 +72,7 @@ func (client *DiscoveredSecuritySolutionsClient) Get(ctx context.Context, resour } // getCreateRequest creates the Get request. -func (client *DiscoveredSecuritySolutionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, discoveredSecuritySolutionName string, options *DiscoveredSecuritySolutionsClientGetOptions) (*policy.Request, error) { +func (client *DiscoveredSecuritySolutionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, discoveredSecuritySolutionName string, _ *DiscoveredSecuritySolutionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions/{discoveredSecuritySolutionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -142,7 +139,7 @@ func (client *DiscoveredSecuritySolutionsClient) NewListPager(options *Discovere } // listCreateRequest creates the List request. -func (client *DiscoveredSecuritySolutionsClient) listCreateRequest(ctx context.Context, options *DiscoveredSecuritySolutionsClientListOptions) (*policy.Request, error) { +func (client *DiscoveredSecuritySolutionsClient) listCreateRequest(ctx context.Context, _ *DiscoveredSecuritySolutionsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/discoveredSecuritySolutions" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -198,7 +195,7 @@ func (client *DiscoveredSecuritySolutionsClient) NewListByHomeRegionPager(ascLoc } // listByHomeRegionCreateRequest creates the ListByHomeRegion request. -func (client *DiscoveredSecuritySolutionsClient) listByHomeRegionCreateRequest(ctx context.Context, ascLocation string, options *DiscoveredSecuritySolutionsClientListByHomeRegionOptions) (*policy.Request, error) { +func (client *DiscoveredSecuritySolutionsClient) listByHomeRegionCreateRequest(ctx context.Context, ascLocation string, _ *DiscoveredSecuritySolutionsClientListByHomeRegionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/discoveredSecuritySolutions" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 883d1a77b207..000000000000 --- a/sdk/resourcemanager/security/armsecurity/discoveredsecuritysolutions_client_example_test.go +++ /dev/null @@ -1,154 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionsSubscription_example.json -func ExampleDiscoveredSecuritySolutionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDiscoveredSecuritySolutionsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DiscoveredSecuritySolutionList = armsecurity.DiscoveredSecuritySolutionList{ - // Value: []*armsecurity.DiscoveredSecuritySolution{ - // { - // Location: to.Ptr("eastus"), - // Name: to.Ptr("CP"), - // Type: to.Ptr("Microsoft.Security/locations/discoveredSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/centralus/discoveredSecuritySolutions/CP"), - // Properties: &armsecurity.DiscoveredSecuritySolutionProperties{ - // Offer: to.Ptr("cisco-asav"), - // Publisher: to.Ptr("cisco"), - // SecurityFamily: to.Ptr(armsecurity.SecurityFamilyNgfw), - // SKU: to.Ptr("asav-azure-byol"), - // }, - // }, - // { - // Location: to.Ptr("eastus2"), - // Name: to.Ptr("paloalto7"), - // Type: to.Ptr("Microsoft.Security/locations/discoveredSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg2/providers/Microsoft.Security/locations/centralus/discoveredSecuritySolutions/paloalto7"), - // Properties: &armsecurity.DiscoveredSecuritySolutionProperties{ - // Offer: to.Ptr("vmseries1"), - // Publisher: to.Ptr("paloaltonetworks"), - // SecurityFamily: to.Ptr(armsecurity.SecurityFamilyNgfw), - // SKU: to.Ptr("byol"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionsSubscriptionLocation_example.json -func ExampleDiscoveredSecuritySolutionsClient_NewListByHomeRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDiscoveredSecuritySolutionsClient().NewListByHomeRegionPager("centralus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DiscoveredSecuritySolutionList = armsecurity.DiscoveredSecuritySolutionList{ - // Value: []*armsecurity.DiscoveredSecuritySolution{ - // { - // Location: to.Ptr("eastus"), - // Name: to.Ptr("CP"), - // Type: to.Ptr("Microsoft.Security/locations/discoveredSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/centralus/discoveredSecuritySolutions/CP"), - // Properties: &armsecurity.DiscoveredSecuritySolutionProperties{ - // Offer: to.Ptr("cisco-asav"), - // Publisher: to.Ptr("cisco"), - // SecurityFamily: to.Ptr(armsecurity.SecurityFamilyNgfw), - // SKU: to.Ptr("asav-azure-byol"), - // }, - // }, - // { - // Location: to.Ptr("eastus2"), - // Name: to.Ptr("paloalto7"), - // Type: to.Ptr("Microsoft.Security/locations/discoveredSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg2/providers/Microsoft.Security/locations/centralus/discoveredSecuritySolutions/paloalto7"), - // Properties: &armsecurity.DiscoveredSecuritySolutionProperties{ - // Offer: to.Ptr("vmseries1"), - // Publisher: to.Ptr("paloaltonetworks"), - // SecurityFamily: to.Ptr(armsecurity.SecurityFamilyNgfw), - // SKU: to.Ptr("byol"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionResourceGroupLocation_example.json -func ExampleDiscoveredSecuritySolutionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewDiscoveredSecuritySolutionsClient().Get(ctx, "myRg2", "centralus", "paloalto7", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.DiscoveredSecuritySolution = armsecurity.DiscoveredSecuritySolution{ - // Location: to.Ptr("eastus2"), - // Name: to.Ptr("paloalto7"), - // Type: to.Ptr("Microsoft.Security/locations/discoveredSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg2/providers/Microsoft.Security/locations/centralus/discoveredSecuritySolutions/paloalto7"), - // Properties: &armsecurity.DiscoveredSecuritySolutionProperties{ - // Offer: to.Ptr("vmseries1"), - // Publisher: to.Ptr("paloaltonetworks"), - // SecurityFamily: to.Ptr(armsecurity.SecurityFamilyNgfw), - // SKU: to.Ptr("byol"), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/externalsecuritysolutions_client.go b/sdk/resourcemanager/security/armsecurity/externalsecuritysolutions_client.go index 800cbabf9cea..bf520cb65369 100644 --- a/sdk/resourcemanager/security/armsecurity/externalsecuritysolutions_client.go +++ b/sdk/resourcemanager/security/armsecurity/externalsecuritysolutions_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -75,7 +72,7 @@ func (client *ExternalSecuritySolutionsClient) Get(ctx context.Context, resource } // getCreateRequest creates the Get request. -func (client *ExternalSecuritySolutionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, externalSecuritySolutionsName string, options *ExternalSecuritySolutionsClientGetOptions) (*policy.Request, error) { +func (client *ExternalSecuritySolutionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, externalSecuritySolutionsName string, _ *ExternalSecuritySolutionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions/{externalSecuritySolutionsName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -142,7 +139,7 @@ func (client *ExternalSecuritySolutionsClient) NewListPager(options *ExternalSec } // listCreateRequest creates the List request. -func (client *ExternalSecuritySolutionsClient) listCreateRequest(ctx context.Context, options *ExternalSecuritySolutionsClientListOptions) (*policy.Request, error) { +func (client *ExternalSecuritySolutionsClient) listCreateRequest(ctx context.Context, _ *ExternalSecuritySolutionsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/externalSecuritySolutions" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -198,7 +195,7 @@ func (client *ExternalSecuritySolutionsClient) NewListByHomeRegionPager(ascLocat } // listByHomeRegionCreateRequest creates the ListByHomeRegion request. -func (client *ExternalSecuritySolutionsClient) listByHomeRegionCreateRequest(ctx context.Context, ascLocation string, options *ExternalSecuritySolutionsClientListByHomeRegionOptions) (*policy.Request, error) { +func (client *ExternalSecuritySolutionsClient) listByHomeRegionCreateRequest(ctx context.Context, ascLocation string, _ *ExternalSecuritySolutionsClientListByHomeRegionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/ExternalSecuritySolutions" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 ee0dc59d4e10..000000000000 --- a/sdk/resourcemanager/security/armsecurity/externalsecuritysolutions_client_example_test.go +++ /dev/null @@ -1,345 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolutionsSubscription_example.json -func ExampleExternalSecuritySolutionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExternalSecuritySolutionsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExternalSecuritySolutionList = armsecurity.ExternalSecuritySolutionList{ - // Value: []armsecurity.ExternalSecuritySolutionClassification{ - // &armsecurity.AADExternalSecuritySolution{ - // Location: to.Ptr("eastus"), - // Name: to.Ptr("aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/defaultresourcegroup-eus/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus"), - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Properties: &armsecurity.AADSolutionProperties{ - // DeviceType: to.Ptr("Azure Active Directory Identity Protection"), - // DeviceVendor: to.Ptr("Microsoft"), - // Workspace: &armsecurity.ConnectedWorkspace{ - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/defaultresourcegroup-eus/providers/Microsoft.OperationalInsights/workspaces/defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus"), - // }, - // AdditionalProperties: map[string]any{ - // "connectivityState": "Discovered", - // }, - // }, - // }, - // &armsecurity.AADExternalSecuritySolution{ - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-weu"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/defaultresourcegroup-weu/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-weu"), - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Properties: &armsecurity.AADSolutionProperties{ - // DeviceType: to.Ptr("Azure Active Directory Identity Protection"), - // DeviceVendor: to.Ptr("Microsoft"), - // Workspace: &armsecurity.ConnectedWorkspace{ - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/defaultresourcegroup-weu/providers/Microsoft.OperationalInsights/workspaces/defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-weu"), - // }, - // AdditionalProperties: map[string]any{ - // "connectivityState": "Discovered", - // }, - // }, - // }, - // &armsecurity.CefExternalSecuritySolution{ - // Location: to.Ptr("westcentralus"), - // Name: to.Ptr("cef_omsprd_barracudanetworks_waf_barracuda"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/unificationprod/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/cef_omsprd_barracudanetworks_waf_barracuda"), - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindCEF), - // Properties: &armsecurity.CefSolutionProperties{ - // DeviceType: to.Ptr("WAF"), - // DeviceVendor: to.Ptr("barracudanetworks"), - // Workspace: &armsecurity.ConnectedWorkspace{ - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/unificationprod/providers/Microsoft.OperationalInsights/workspaces/omsprd"), - // }, - // Hostname: to.Ptr("barracuda"), - // LastEventReceived: to.Ptr("2018-05-09T10:30:11.523Z"), - // }, - // }, - // &armsecurity.CefExternalSecuritySolution{ - // Location: to.Ptr("westcentralus"), - // Name: to.Ptr("cef_omsprd_virtualhoneypot_Microsoft_demovm20"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/unificationprod/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/cef_omsprd_virtualhoneypot_Microsoft_demovm20"), - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindCEF), - // Properties: &armsecurity.CefSolutionProperties{ - // DeviceType: to.Ptr("Microsoft"), - // DeviceVendor: to.Ptr("virtualHoneypot"), - // Workspace: &armsecurity.ConnectedWorkspace{ - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/unificationprod/providers/Microsoft.OperationalInsights/workspaces/omsprd"), - // }, - // Hostname: to.Ptr("demovm20"), - // LastEventReceived: to.Ptr("2018-05-08T15:42:22.57Z"), - // }, - // }, - // &armsecurity.CefExternalSecuritySolution{ - // Location: to.Ptr("westcentralus"), - // Name: to.Ptr("cef_omsprd_virtualhoneypot_Microsoft_demovm10"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/unificationprod/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/cef_omsprd_virtualhoneypot_Microsoft_demovm10"), - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindCEF), - // Properties: &armsecurity.CefSolutionProperties{ - // DeviceType: to.Ptr("Microsoft"), - // DeviceVendor: to.Ptr("virtualHoneypot"), - // Workspace: &armsecurity.ConnectedWorkspace{ - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/unificationprod/providers/Microsoft.OperationalInsights/workspaces/omsprd"), - // }, - // Hostname: to.Ptr("demovm10"), - // LastEventReceived: to.Ptr("2018-05-08T10:38:53.423Z"), - // }, - // }, - // &armsecurity.AADExternalSecuritySolution{ - // Location: to.Ptr("westcentralus"), - // Name: to.Ptr("aad_omsprd"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/unificationprod/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_omsprd"), - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Properties: &armsecurity.AADSolutionProperties{ - // DeviceType: to.Ptr("Azure Active Directory Identity Protection"), - // DeviceVendor: to.Ptr("Microsoft"), - // Workspace: &armsecurity.ConnectedWorkspace{ - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/unificationprod/providers/Microsoft.OperationalInsights/workspaces/omsprd"), - // }, - // AdditionalProperties: map[string]any{ - // "connectivityState": "Discovered", - // }, - // }, - // }, - // &armsecurity.AADExternalSecuritySolution{ - // Location: to.Ptr("japaneast"), - // Name: to.Ptr("aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-ejp"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/defaultresourcegroup-ejp/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-ejp"), - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Properties: &armsecurity.AADSolutionProperties{ - // DeviceType: to.Ptr("Azure Active Directory Identity Protection"), - // DeviceVendor: to.Ptr("Microsoft"), - // Workspace: &armsecurity.ConnectedWorkspace{ - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/defaultresourcegroup-ejp/providers/Microsoft.OperationalInsights/workspaces/defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-ejp"), - // }, - // AdditionalProperties: map[string]any{ - // "connectivityState": "Discovered", - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolutionsSubscriptionLocation_example.json -func ExampleExternalSecuritySolutionsClient_NewListByHomeRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExternalSecuritySolutionsClient().NewListByHomeRegionPager("centralus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExternalSecuritySolutionList = armsecurity.ExternalSecuritySolutionList{ - // Value: []armsecurity.ExternalSecuritySolutionClassification{ - // &armsecurity.AADExternalSecuritySolution{ - // Location: to.Ptr("eastus"), - // Name: to.Ptr("aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/defaultresourcegroup-eus/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus"), - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Properties: &armsecurity.AADSolutionProperties{ - // DeviceType: to.Ptr("Azure Active Directory Identity Protection"), - // DeviceVendor: to.Ptr("Microsoft"), - // Workspace: &armsecurity.ConnectedWorkspace{ - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/defaultresourcegroup-eus/providers/Microsoft.OperationalInsights/workspaces/defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus"), - // }, - // AdditionalProperties: map[string]any{ - // "connectivityState": "Discovered", - // }, - // }, - // }, - // &armsecurity.AADExternalSecuritySolution{ - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-weu"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/defaultresourcegroup-weu/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-weu"), - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Properties: &armsecurity.AADSolutionProperties{ - // DeviceType: to.Ptr("Azure Active Directory Identity Protection"), - // DeviceVendor: to.Ptr("Microsoft"), - // Workspace: &armsecurity.ConnectedWorkspace{ - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/defaultresourcegroup-weu/providers/Microsoft.OperationalInsights/workspaces/defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-weu"), - // }, - // AdditionalProperties: map[string]any{ - // "connectivityState": "Discovered", - // }, - // }, - // }, - // &armsecurity.CefExternalSecuritySolution{ - // Location: to.Ptr("westcentralus"), - // Name: to.Ptr("cef_omsprd_barracudanetworks_waf_barracuda"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/unificationprod/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/cef_omsprd_barracudanetworks_waf_barracuda"), - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindCEF), - // Properties: &armsecurity.CefSolutionProperties{ - // DeviceType: to.Ptr("WAF"), - // DeviceVendor: to.Ptr("barracudanetworks"), - // Workspace: &armsecurity.ConnectedWorkspace{ - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/unificationprod/providers/Microsoft.OperationalInsights/workspaces/omsprd"), - // }, - // Hostname: to.Ptr("barracuda"), - // LastEventReceived: to.Ptr("2018-05-09T10:30:11.523Z"), - // }, - // }, - // &armsecurity.CefExternalSecuritySolution{ - // Location: to.Ptr("westcentralus"), - // Name: to.Ptr("cef_omsprd_virtualhoneypot_Microsoft_demovm20"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/unificationprod/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/cef_omsprd_virtualhoneypot_Microsoft_demovm20"), - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindCEF), - // Properties: &armsecurity.CefSolutionProperties{ - // DeviceType: to.Ptr("Microsoft"), - // DeviceVendor: to.Ptr("virtualHoneypot"), - // Workspace: &armsecurity.ConnectedWorkspace{ - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/unificationprod/providers/Microsoft.OperationalInsights/workspaces/omsprd"), - // }, - // Hostname: to.Ptr("demovm20"), - // LastEventReceived: to.Ptr("2018-05-08T15:42:22.57Z"), - // }, - // }, - // &armsecurity.CefExternalSecuritySolution{ - // Location: to.Ptr("westcentralus"), - // Name: to.Ptr("cef_omsprd_virtualhoneypot_Microsoft_demovm10"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/unificationprod/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/cef_omsprd_virtualhoneypot_Microsoft_demovm10"), - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindCEF), - // Properties: &armsecurity.CefSolutionProperties{ - // DeviceType: to.Ptr("Microsoft"), - // DeviceVendor: to.Ptr("virtualHoneypot"), - // Workspace: &armsecurity.ConnectedWorkspace{ - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/unificationprod/providers/Microsoft.OperationalInsights/workspaces/omsprd"), - // }, - // Hostname: to.Ptr("demovm10"), - // LastEventReceived: to.Ptr("2018-05-08T10:38:53.423Z"), - // }, - // }, - // &armsecurity.AADExternalSecuritySolution{ - // Location: to.Ptr("westcentralus"), - // Name: to.Ptr("aad_omsprd"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/unificationprod/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_omsprd"), - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Properties: &armsecurity.AADSolutionProperties{ - // DeviceType: to.Ptr("Azure Active Directory Identity Protection"), - // DeviceVendor: to.Ptr("Microsoft"), - // Workspace: &armsecurity.ConnectedWorkspace{ - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/unificationprod/providers/Microsoft.OperationalInsights/workspaces/omsprd"), - // }, - // AdditionalProperties: map[string]any{ - // "connectivityState": "Discovered", - // }, - // }, - // }, - // &armsecurity.AADExternalSecuritySolution{ - // Location: to.Ptr("japaneast"), - // Name: to.Ptr("aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-ejp"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/defaultresourcegroup-ejp/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-ejp"), - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Properties: &armsecurity.AADSolutionProperties{ - // DeviceType: to.Ptr("Azure Active Directory Identity Protection"), - // DeviceVendor: to.Ptr("Microsoft"), - // Workspace: &armsecurity.ConnectedWorkspace{ - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/defaultresourcegroup-ejp/providers/Microsoft.OperationalInsights/workspaces/defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-ejp"), - // }, - // AdditionalProperties: map[string]any{ - // "connectivityState": "Discovered", - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolution_example.json -func ExampleExternalSecuritySolutionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExternalSecuritySolutionsClient().Get(ctx, "defaultresourcegroup-eus", "centralus", "aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armsecurity.ExternalSecuritySolutionsClientGetResponse{ - // ExternalSecuritySolutionClassification: &armsecurity.AADExternalSecuritySolution{ - // Location: to.Ptr("eastus"), - // Name: to.Ptr("aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/defaultresourcegroup-eus/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus"), - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Properties: &armsecurity.AADSolutionProperties{ - // DeviceType: to.Ptr("Azure Active Directory Identity Protection"), - // DeviceVendor: to.Ptr("Microsoft"), - // Workspace: &armsecurity.ConnectedWorkspace{ - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/defaultresourcegroup-eus/providers/Microsoft.OperationalInsights/workspaces/defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus"), - // }, - // AdditionalProperties: map[string]any{ - // "connectivityState": "Discovered", - // }, - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/fake/accountconnectors_server.go b/sdk/resourcemanager/security/armsecurity/fake/accountconnectors_server.go index 87a473ac847c..cd408b8b0c61 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/accountconnectors_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/accountconnectors_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -66,27 +63,46 @@ func (a *AccountConnectorsServerTransport) Do(req *http.Request) (*http.Response return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AccountConnectorsClient.CreateOrUpdate": - resp, err = a.dispatchCreateOrUpdate(req) - case "AccountConnectorsClient.Delete": - resp, err = a.dispatchDelete(req) - case "AccountConnectorsClient.Get": - resp, err = a.dispatchGet(req) - case "AccountConnectorsClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AccountConnectorsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if accountConnectorsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = accountConnectorsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AccountConnectorsClient.CreateOrUpdate": + res.resp, res.err = a.dispatchCreateOrUpdate(req) + case "AccountConnectorsClient.Delete": + res.resp, res.err = a.dispatchDelete(req) + case "AccountConnectorsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AccountConnectorsClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AccountConnectorsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -212,3 +228,9 @@ func (a *AccountConnectorsServerTransport) dispatchNewListPager(req *http.Reques } return resp, nil } + +// set this to conditionally intercept incoming requests to AccountConnectorsServerTransport +var accountConnectorsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/adaptiveapplicationcontrols_server.go b/sdk/resourcemanager/security/armsecurity/fake/adaptiveapplicationcontrols_server.go deleted file mode 100644 index 511ee65a3f4c..000000000000 --- a/sdk/resourcemanager/security/armsecurity/fake/adaptiveapplicationcontrols_server.go +++ /dev/null @@ -1,238 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" - "net/http" - "net/url" - "regexp" - "strconv" -) - -// AdaptiveApplicationControlsServer is a fake server for instances of the armsecurity.AdaptiveApplicationControlsClient type. -type AdaptiveApplicationControlsServer struct { - // Delete is the fake for method AdaptiveApplicationControlsClient.Delete - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent - Delete func(ctx context.Context, ascLocation string, groupName string, options *armsecurity.AdaptiveApplicationControlsClientDeleteOptions) (resp azfake.Responder[armsecurity.AdaptiveApplicationControlsClientDeleteResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method AdaptiveApplicationControlsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, ascLocation string, groupName string, options *armsecurity.AdaptiveApplicationControlsClientGetOptions) (resp azfake.Responder[armsecurity.AdaptiveApplicationControlsClientGetResponse], errResp azfake.ErrorResponder) - - // List is the fake for method AdaptiveApplicationControlsClient.List - // HTTP status codes to indicate success: http.StatusOK - List func(ctx context.Context, options *armsecurity.AdaptiveApplicationControlsClientListOptions) (resp azfake.Responder[armsecurity.AdaptiveApplicationControlsClientListResponse], errResp azfake.ErrorResponder) - - // Put is the fake for method AdaptiveApplicationControlsClient.Put - // HTTP status codes to indicate success: http.StatusOK - Put func(ctx context.Context, ascLocation string, groupName string, body armsecurity.AdaptiveApplicationControlGroup, options *armsecurity.AdaptiveApplicationControlsClientPutOptions) (resp azfake.Responder[armsecurity.AdaptiveApplicationControlsClientPutResponse], errResp azfake.ErrorResponder) -} - -// NewAdaptiveApplicationControlsServerTransport creates a new instance of AdaptiveApplicationControlsServerTransport with the provided implementation. -// The returned AdaptiveApplicationControlsServerTransport instance is connected to an instance of armsecurity.AdaptiveApplicationControlsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewAdaptiveApplicationControlsServerTransport(srv *AdaptiveApplicationControlsServer) *AdaptiveApplicationControlsServerTransport { - return &AdaptiveApplicationControlsServerTransport{srv: srv} -} - -// AdaptiveApplicationControlsServerTransport connects instances of armsecurity.AdaptiveApplicationControlsClient to instances of AdaptiveApplicationControlsServer. -// Don't use this type directly, use NewAdaptiveApplicationControlsServerTransport instead. -type AdaptiveApplicationControlsServerTransport struct { - srv *AdaptiveApplicationControlsServer -} - -// Do implements the policy.Transporter interface for AdaptiveApplicationControlsServerTransport. -func (a *AdaptiveApplicationControlsServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "AdaptiveApplicationControlsClient.Delete": - resp, err = a.dispatchDelete(req) - case "AdaptiveApplicationControlsClient.Get": - resp, err = a.dispatchGet(req) - case "AdaptiveApplicationControlsClient.List": - resp, err = a.dispatchList(req) - case "AdaptiveApplicationControlsClient.Put": - resp, err = a.dispatchPut(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (a *AdaptiveApplicationControlsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { - if a.srv.Delete == nil { - return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Security/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applicationWhitelistings/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - ascLocationParam, err := url.PathUnescape(matches[regex.SubexpIndex("ascLocation")]) - if err != nil { - return nil, err - } - groupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("groupName")]) - if err != nil { - return nil, err - } - respr, errRespr := a.srv.Delete(req.Context(), ascLocationParam, groupNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", respContent.HTTPStatus)} - } - resp, err := server.NewResponse(respContent, req, nil) - if err != nil { - return nil, err - } - return resp, nil -} - -func (a *AdaptiveApplicationControlsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if a.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Security/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applicationWhitelistings/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - ascLocationParam, err := url.PathUnescape(matches[regex.SubexpIndex("ascLocation")]) - if err != nil { - return nil, err - } - groupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("groupName")]) - if err != nil { - return nil, err - } - respr, errRespr := a.srv.Get(req.Context(), ascLocationParam, groupNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AdaptiveApplicationControlGroup, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (a *AdaptiveApplicationControlsServerTransport) dispatchList(req *http.Request) (*http.Response, error) { - if a.srv.List == nil { - return nil, &nonRetriableError{errors.New("fake for method List not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Security/applicationWhitelistings` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 1 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - qp := req.URL.Query() - includePathRecommendationsUnescaped, err := url.QueryUnescape(qp.Get("includePathRecommendations")) - if err != nil { - return nil, err - } - includePathRecommendationsParam, err := parseOptional(includePathRecommendationsUnescaped, strconv.ParseBool) - if err != nil { - return nil, err - } - summaryUnescaped, err := url.QueryUnescape(qp.Get("summary")) - if err != nil { - return nil, err - } - summaryParam, err := parseOptional(summaryUnescaped, strconv.ParseBool) - if err != nil { - return nil, err - } - var options *armsecurity.AdaptiveApplicationControlsClientListOptions - if includePathRecommendationsParam != nil || summaryParam != nil { - options = &armsecurity.AdaptiveApplicationControlsClientListOptions{ - IncludePathRecommendations: includePathRecommendationsParam, - Summary: summaryParam, - } - } - respr, errRespr := a.srv.List(req.Context(), options) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AdaptiveApplicationControlGroups, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (a *AdaptiveApplicationControlsServerTransport) dispatchPut(req *http.Request) (*http.Response, error) { - if a.srv.Put == nil { - return nil, &nonRetriableError{errors.New("fake for method Put not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Security/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applicationWhitelistings/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 3 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armsecurity.AdaptiveApplicationControlGroup](req) - if err != nil { - return nil, err - } - ascLocationParam, err := url.PathUnescape(matches[regex.SubexpIndex("ascLocation")]) - if err != nil { - return nil, err - } - groupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("groupName")]) - if err != nil { - return nil, err - } - respr, errRespr := a.srv.Put(req.Context(), ascLocationParam, groupNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AdaptiveApplicationControlGroup, req) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/sdk/resourcemanager/security/armsecurity/fake/adaptivenetworkhardenings_server.go b/sdk/resourcemanager/security/armsecurity/fake/adaptivenetworkhardenings_server.go deleted file mode 100644 index a89f90b1a236..000000000000 --- a/sdk/resourcemanager/security/armsecurity/fake/adaptivenetworkhardenings_server.go +++ /dev/null @@ -1,240 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "context" - "errors" - "fmt" - azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" - "net/http" - "net/url" - "regexp" -) - -// AdaptiveNetworkHardeningsServer is a fake server for instances of the armsecurity.AdaptiveNetworkHardeningsClient type. -type AdaptiveNetworkHardeningsServer struct { - // BeginEnforce is the fake for method AdaptiveNetworkHardeningsClient.BeginEnforce - // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted - BeginEnforce func(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, adaptiveNetworkHardeningResourceName string, body armsecurity.AdaptiveNetworkHardeningEnforceRequest, options *armsecurity.AdaptiveNetworkHardeningsClientBeginEnforceOptions) (resp azfake.PollerResponder[armsecurity.AdaptiveNetworkHardeningsClientEnforceResponse], errResp azfake.ErrorResponder) - - // Get is the fake for method AdaptiveNetworkHardeningsClient.Get - // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, adaptiveNetworkHardeningResourceName string, options *armsecurity.AdaptiveNetworkHardeningsClientGetOptions) (resp azfake.Responder[armsecurity.AdaptiveNetworkHardeningsClientGetResponse], errResp azfake.ErrorResponder) - - // NewListByExtendedResourcePager is the fake for method AdaptiveNetworkHardeningsClient.NewListByExtendedResourcePager - // HTTP status codes to indicate success: http.StatusOK - NewListByExtendedResourcePager func(resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, options *armsecurity.AdaptiveNetworkHardeningsClientListByExtendedResourceOptions) (resp azfake.PagerResponder[armsecurity.AdaptiveNetworkHardeningsClientListByExtendedResourceResponse]) -} - -// NewAdaptiveNetworkHardeningsServerTransport creates a new instance of AdaptiveNetworkHardeningsServerTransport with the provided implementation. -// The returned AdaptiveNetworkHardeningsServerTransport instance is connected to an instance of armsecurity.AdaptiveNetworkHardeningsClient via the -// azcore.ClientOptions.Transporter field in the client's constructor parameters. -func NewAdaptiveNetworkHardeningsServerTransport(srv *AdaptiveNetworkHardeningsServer) *AdaptiveNetworkHardeningsServerTransport { - return &AdaptiveNetworkHardeningsServerTransport{ - srv: srv, - beginEnforce: newTracker[azfake.PollerResponder[armsecurity.AdaptiveNetworkHardeningsClientEnforceResponse]](), - newListByExtendedResourcePager: newTracker[azfake.PagerResponder[armsecurity.AdaptiveNetworkHardeningsClientListByExtendedResourceResponse]](), - } -} - -// AdaptiveNetworkHardeningsServerTransport connects instances of armsecurity.AdaptiveNetworkHardeningsClient to instances of AdaptiveNetworkHardeningsServer. -// Don't use this type directly, use NewAdaptiveNetworkHardeningsServerTransport instead. -type AdaptiveNetworkHardeningsServerTransport struct { - srv *AdaptiveNetworkHardeningsServer - beginEnforce *tracker[azfake.PollerResponder[armsecurity.AdaptiveNetworkHardeningsClientEnforceResponse]] - newListByExtendedResourcePager *tracker[azfake.PagerResponder[armsecurity.AdaptiveNetworkHardeningsClientListByExtendedResourceResponse]] -} - -// Do implements the policy.Transporter interface for AdaptiveNetworkHardeningsServerTransport. -func (a *AdaptiveNetworkHardeningsServerTransport) Do(req *http.Request) (*http.Response, error) { - rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) - method, ok := rawMethod.(string) - if !ok { - return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} - } - - var resp *http.Response - var err error - - switch method { - case "AdaptiveNetworkHardeningsClient.BeginEnforce": - resp, err = a.dispatchBeginEnforce(req) - case "AdaptiveNetworkHardeningsClient.Get": - resp, err = a.dispatchGet(req) - case "AdaptiveNetworkHardeningsClient.NewListByExtendedResourcePager": - resp, err = a.dispatchNewListByExtendedResourcePager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } - - if err != nil { - return nil, err - } - - return resp, nil -} - -func (a *AdaptiveNetworkHardeningsServerTransport) dispatchBeginEnforce(req *http.Request) (*http.Response, error) { - if a.srv.BeginEnforce == nil { - return nil, &nonRetriableError{errors.New("fake for method BeginEnforce not implemented")} - } - beginEnforce := a.beginEnforce.get(req) - if beginEnforce == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Security/adaptiveNetworkHardenings/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 6 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - body, err := server.UnmarshalRequestAsJSON[armsecurity.AdaptiveNetworkHardeningEnforceRequest](req) - if err != nil { - return nil, err - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNamespaceParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceNamespace")]) - if err != nil { - return nil, err - } - resourceTypeParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceType")]) - if err != nil { - return nil, err - } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - adaptiveNetworkHardeningResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("adaptiveNetworkHardeningResourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := a.srv.BeginEnforce(req.Context(), resourceGroupNameParam, resourceNamespaceParam, resourceTypeParam, resourceNameParam, adaptiveNetworkHardeningResourceNameParam, body, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - beginEnforce = &respr - a.beginEnforce.add(req, beginEnforce) - } - - resp, err := server.PollerResponderNext(beginEnforce, req) - if err != nil { - return nil, err - } - - if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { - a.beginEnforce.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} - } - if !server.PollerResponderMore(beginEnforce) { - a.beginEnforce.remove(req) - } - - return resp, nil -} - -func (a *AdaptiveNetworkHardeningsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { - if a.srv.Get == nil { - return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} - } - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Security/adaptiveNetworkHardenings/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 6 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNamespaceParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceNamespace")]) - if err != nil { - return nil, err - } - resourceTypeParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceType")]) - if err != nil { - return nil, err - } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - adaptiveNetworkHardeningResourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("adaptiveNetworkHardeningResourceName")]) - if err != nil { - return nil, err - } - respr, errRespr := a.srv.Get(req.Context(), resourceGroupNameParam, resourceNamespaceParam, resourceTypeParam, resourceNameParam, adaptiveNetworkHardeningResourceNameParam, nil) - if respErr := server.GetError(errRespr, req); respErr != nil { - return nil, respErr - } - respContent := server.GetResponseContent(respr) - if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} - } - resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AdaptiveNetworkHardening, req) - if err != nil { - return nil, err - } - return resp, nil -} - -func (a *AdaptiveNetworkHardeningsServerTransport) dispatchNewListByExtendedResourcePager(req *http.Request) (*http.Response, error) { - if a.srv.NewListByExtendedResourcePager == nil { - return nil, &nonRetriableError{errors.New("fake for method NewListByExtendedResourcePager not implemented")} - } - newListByExtendedResourcePager := a.newListByExtendedResourcePager.get(req) - if newListByExtendedResourcePager == nil { - const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Security/adaptiveNetworkHardenings` - regex := regexp.MustCompile(regexStr) - matches := regex.FindStringSubmatch(req.URL.EscapedPath()) - if matches == nil || len(matches) < 5 { - return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) - } - resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) - if err != nil { - return nil, err - } - resourceNamespaceParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceNamespace")]) - if err != nil { - return nil, err - } - resourceTypeParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceType")]) - if err != nil { - return nil, err - } - resourceNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceName")]) - if err != nil { - return nil, err - } - resp := a.srv.NewListByExtendedResourcePager(resourceGroupNameParam, resourceNamespaceParam, resourceTypeParam, resourceNameParam, nil) - newListByExtendedResourcePager = &resp - a.newListByExtendedResourcePager.add(req, newListByExtendedResourcePager) - server.PagerResponderInjectNextLinks(newListByExtendedResourcePager, req, func(page *armsecurity.AdaptiveNetworkHardeningsClientListByExtendedResourceResponse, createLink func() string) { - page.NextLink = to.Ptr(createLink()) - }) - } - resp, err := server.PagerResponderNext(newListByExtendedResourcePager, req) - if err != nil { - return nil, err - } - if !contains([]int{http.StatusOK}, resp.StatusCode) { - a.newListByExtendedResourcePager.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} - } - if !server.PagerResponderMore(newListByExtendedResourcePager) { - a.newListByExtendedResourcePager.remove(req) - } - return resp, nil -} diff --git a/sdk/resourcemanager/security/armsecurity/fake/advancedthreatprotection_server.go b/sdk/resourcemanager/security/armsecurity/fake/advancedthreatprotection_server.go index eaa6e04bc4c3..e848095b3e35 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/advancedthreatprotection_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/advancedthreatprotection_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -53,23 +50,42 @@ func (a *AdvancedThreatProtectionServerTransport) Do(req *http.Request) (*http.R return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AdvancedThreatProtectionClient.Create": - resp, err = a.dispatchCreate(req) - case "AdvancedThreatProtectionClient.Get": - resp, err = a.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AdvancedThreatProtectionServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if advancedThreatProtectionServerTransportInterceptor != nil { + res.resp, res.err, intercepted = advancedThreatProtectionServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AdvancedThreatProtectionClient.Create": + res.resp, res.err = a.dispatchCreate(req) + case "AdvancedThreatProtectionClient.Get": + res.resp, res.err = a.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AdvancedThreatProtectionServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { @@ -133,3 +149,9 @@ func (a *AdvancedThreatProtectionServerTransport) dispatchGet(req *http.Request) } return resp, nil } + +// set this to conditionally intercept incoming requests to AdvancedThreatProtectionServerTransport +var advancedThreatProtectionServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/alerts_server.go b/sdk/resourcemanager/security/armsecurity/fake/alerts_server.go index 79ebfa4b7148..7136248bbae2 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/alerts_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/alerts_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -49,7 +46,7 @@ type AlertsServer struct { NewListSubscriptionLevelByRegionPager func(ascLocation string, options *armsecurity.AlertsClientListSubscriptionLevelByRegionOptions) (resp azfake.PagerResponder[armsecurity.AlertsClientListSubscriptionLevelByRegionResponse]) // BeginSimulate is the fake for method AlertsClient.BeginSimulate - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginSimulate func(ctx context.Context, ascLocation string, alertSimulatorRequestBody armsecurity.AlertSimulatorRequestBody, options *armsecurity.AlertsClientBeginSimulateOptions) (resp azfake.PollerResponder[armsecurity.AlertsClientSimulateResponse], errResp azfake.ErrorResponder) // UpdateResourceGroupLevelStateToActivate is the fake for method AlertsClient.UpdateResourceGroupLevelStateToActivate @@ -118,49 +115,68 @@ func (a *AlertsServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "AlertsClient.GetResourceGroupLevel": - resp, err = a.dispatchGetResourceGroupLevel(req) - case "AlertsClient.GetSubscriptionLevel": - resp, err = a.dispatchGetSubscriptionLevel(req) - case "AlertsClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - case "AlertsClient.NewListByResourceGroupPager": - resp, err = a.dispatchNewListByResourceGroupPager(req) - case "AlertsClient.NewListResourceGroupLevelByRegionPager": - resp, err = a.dispatchNewListResourceGroupLevelByRegionPager(req) - case "AlertsClient.NewListSubscriptionLevelByRegionPager": - resp, err = a.dispatchNewListSubscriptionLevelByRegionPager(req) - case "AlertsClient.BeginSimulate": - resp, err = a.dispatchBeginSimulate(req) - case "AlertsClient.UpdateResourceGroupLevelStateToActivate": - resp, err = a.dispatchUpdateResourceGroupLevelStateToActivate(req) - case "AlertsClient.UpdateResourceGroupLevelStateToDismiss": - resp, err = a.dispatchUpdateResourceGroupLevelStateToDismiss(req) - case "AlertsClient.UpdateResourceGroupLevelStateToInProgress": - resp, err = a.dispatchUpdateResourceGroupLevelStateToInProgress(req) - case "AlertsClient.UpdateResourceGroupLevelStateToResolve": - resp, err = a.dispatchUpdateResourceGroupLevelStateToResolve(req) - case "AlertsClient.UpdateSubscriptionLevelStateToActivate": - resp, err = a.dispatchUpdateSubscriptionLevelStateToActivate(req) - case "AlertsClient.UpdateSubscriptionLevelStateToDismiss": - resp, err = a.dispatchUpdateSubscriptionLevelStateToDismiss(req) - case "AlertsClient.UpdateSubscriptionLevelStateToInProgress": - resp, err = a.dispatchUpdateSubscriptionLevelStateToInProgress(req) - case "AlertsClient.UpdateSubscriptionLevelStateToResolve": - resp, err = a.dispatchUpdateSubscriptionLevelStateToResolve(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return a.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err - } +func (a *AlertsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - return resp, nil + go func() { + var intercepted bool + var res result + if alertsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = alertsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AlertsClient.GetResourceGroupLevel": + res.resp, res.err = a.dispatchGetResourceGroupLevel(req) + case "AlertsClient.GetSubscriptionLevel": + res.resp, res.err = a.dispatchGetSubscriptionLevel(req) + case "AlertsClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + case "AlertsClient.NewListByResourceGroupPager": + res.resp, res.err = a.dispatchNewListByResourceGroupPager(req) + case "AlertsClient.NewListResourceGroupLevelByRegionPager": + res.resp, res.err = a.dispatchNewListResourceGroupLevelByRegionPager(req) + case "AlertsClient.NewListSubscriptionLevelByRegionPager": + res.resp, res.err = a.dispatchNewListSubscriptionLevelByRegionPager(req) + case "AlertsClient.BeginSimulate": + res.resp, res.err = a.dispatchBeginSimulate(req) + case "AlertsClient.UpdateResourceGroupLevelStateToActivate": + res.resp, res.err = a.dispatchUpdateResourceGroupLevelStateToActivate(req) + case "AlertsClient.UpdateResourceGroupLevelStateToDismiss": + res.resp, res.err = a.dispatchUpdateResourceGroupLevelStateToDismiss(req) + case "AlertsClient.UpdateResourceGroupLevelStateToInProgress": + res.resp, res.err = a.dispatchUpdateResourceGroupLevelStateToInProgress(req) + case "AlertsClient.UpdateResourceGroupLevelStateToResolve": + res.resp, res.err = a.dispatchUpdateResourceGroupLevelStateToResolve(req) + case "AlertsClient.UpdateSubscriptionLevelStateToActivate": + res.resp, res.err = a.dispatchUpdateSubscriptionLevelStateToActivate(req) + case "AlertsClient.UpdateSubscriptionLevelStateToDismiss": + res.resp, res.err = a.dispatchUpdateSubscriptionLevelStateToDismiss(req) + case "AlertsClient.UpdateSubscriptionLevelStateToInProgress": + res.resp, res.err = a.dispatchUpdateSubscriptionLevelStateToInProgress(req) + case "AlertsClient.UpdateSubscriptionLevelStateToResolve": + res.resp, res.err = a.dispatchUpdateSubscriptionLevelStateToResolve(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AlertsServerTransport) dispatchGetResourceGroupLevel(req *http.Request) (*http.Response, error) { @@ -414,9 +430,9 @@ func (a *AlertsServerTransport) dispatchBeginSimulate(req *http.Request) (*http. return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { a.beginSimulate.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginSimulate) { a.beginSimulate.remove(req) @@ -704,3 +720,9 @@ func (a *AlertsServerTransport) dispatchUpdateSubscriptionLevelStateToResolve(re } return resp, nil } + +// set this to conditionally intercept incoming requests to AlertsServerTransport +var alertsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/alertssuppressionrules_server.go b/sdk/resourcemanager/security/armsecurity/fake/alertssuppressionrules_server.go index 2ef4892aedda..455d8280824c 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/alertssuppressionrules_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/alertssuppressionrules_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -66,27 +63,46 @@ func (a *AlertsSuppressionRulesServerTransport) Do(req *http.Request) (*http.Res return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AlertsSuppressionRulesClient.Delete": - resp, err = a.dispatchDelete(req) - case "AlertsSuppressionRulesClient.Get": - resp, err = a.dispatchGet(req) - case "AlertsSuppressionRulesClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - case "AlertsSuppressionRulesClient.Update": - resp, err = a.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AlertsSuppressionRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if alertsSuppressionRulesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = alertsSuppressionRulesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AlertsSuppressionRulesClient.Delete": + res.resp, res.err = a.dispatchDelete(req) + case "AlertsSuppressionRulesClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AlertsSuppressionRulesClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + case "AlertsSuppressionRulesClient.Update": + res.resp, res.err = a.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AlertsSuppressionRulesServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { @@ -224,3 +240,9 @@ func (a *AlertsSuppressionRulesServerTransport) dispatchUpdate(req *http.Request } return resp, nil } + +// set this to conditionally intercept incoming requests to AlertsSuppressionRulesServerTransport +var alertsSuppressionRulesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/allowedconnections_server.go b/sdk/resourcemanager/security/armsecurity/fake/allowedconnections_server.go index bfc1b2aaead0..d355e06a5062 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/allowedconnections_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/allowedconnections_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -64,25 +61,44 @@ func (a *AllowedConnectionsServerTransport) Do(req *http.Request) (*http.Respons return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AllowedConnectionsClient.Get": - resp, err = a.dispatchGet(req) - case "AllowedConnectionsClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - case "AllowedConnectionsClient.NewListByHomeRegionPager": - resp, err = a.dispatchNewListByHomeRegionPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AllowedConnectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if allowedConnectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = allowedConnectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AllowedConnectionsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AllowedConnectionsClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + case "AllowedConnectionsClient.NewListByHomeRegionPager": + res.resp, res.err = a.dispatchNewListByHomeRegionPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AllowedConnectionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -197,3 +213,9 @@ func (a *AllowedConnectionsServerTransport) dispatchNewListByHomeRegionPager(req } return resp, nil } + +// set this to conditionally intercept incoming requests to AllowedConnectionsServerTransport +var allowedConnectionsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/apicollections_server.go b/sdk/resourcemanager/security/armsecurity/fake/apicollections_server.go index 39a225eb96db..5a1e5c32cf23 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/apicollections_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/apicollections_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -80,31 +77,50 @@ func (a *APICollectionsServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "APICollectionsClient.GetByAzureAPIManagementService": - resp, err = a.dispatchGetByAzureAPIManagementService(req) - case "APICollectionsClient.NewListByAzureAPIManagementServicePager": - resp, err = a.dispatchNewListByAzureAPIManagementServicePager(req) - case "APICollectionsClient.NewListByResourceGroupPager": - resp, err = a.dispatchNewListByResourceGroupPager(req) - case "APICollectionsClient.NewListBySubscriptionPager": - resp, err = a.dispatchNewListBySubscriptionPager(req) - case "APICollectionsClient.OffboardAzureAPIManagementAPI": - resp, err = a.dispatchOffboardAzureAPIManagementAPI(req) - case "APICollectionsClient.BeginOnboardAzureAPIManagementAPI": - resp, err = a.dispatchBeginOnboardAzureAPIManagementAPI(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *APICollectionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if apiCollectionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = apiCollectionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "APICollectionsClient.GetByAzureAPIManagementService": + res.resp, res.err = a.dispatchGetByAzureAPIManagementService(req) + case "APICollectionsClient.NewListByAzureAPIManagementServicePager": + res.resp, res.err = a.dispatchNewListByAzureAPIManagementServicePager(req) + case "APICollectionsClient.NewListByResourceGroupPager": + res.resp, res.err = a.dispatchNewListByResourceGroupPager(req) + case "APICollectionsClient.NewListBySubscriptionPager": + res.resp, res.err = a.dispatchNewListBySubscriptionPager(req) + case "APICollectionsClient.OffboardAzureAPIManagementAPI": + res.resp, res.err = a.dispatchOffboardAzureAPIManagementAPI(req) + case "APICollectionsClient.BeginOnboardAzureAPIManagementAPI": + res.resp, res.err = a.dispatchBeginOnboardAzureAPIManagementAPI(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *APICollectionsServerTransport) dispatchGetByAzureAPIManagementService(req *http.Request) (*http.Response, error) { @@ -339,3 +355,9 @@ func (a *APICollectionsServerTransport) dispatchBeginOnboardAzureAPIManagementAP return resp, nil } + +// set this to conditionally intercept incoming requests to APICollectionsServerTransport +var apiCollectionsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/application_server.go b/sdk/resourcemanager/security/armsecurity/fake/application_server.go index 7df622770449..b5553a0878b9 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/application_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/application_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -57,25 +54,44 @@ func (a *ApplicationServerTransport) Do(req *http.Request) (*http.Response, erro return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "ApplicationClient.CreateOrUpdate": - resp, err = a.dispatchCreateOrUpdate(req) - case "ApplicationClient.Delete": - resp, err = a.dispatchDelete(req) - case "ApplicationClient.Get": - resp, err = a.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return a.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err +func (a *ApplicationServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if applicationServerTransportInterceptor != nil { + res.resp, res.err, intercepted = applicationServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ApplicationClient.CreateOrUpdate": + res.resp, res.err = a.dispatchCreateOrUpdate(req) + case "ApplicationClient.Delete": + res.resp, res.err = a.dispatchDelete(req) + case "ApplicationClient.Get": + res.resp, res.err = a.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - - return resp, nil } func (a *ApplicationServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -168,3 +184,9 @@ func (a *ApplicationServerTransport) dispatchGet(req *http.Request) (*http.Respo } return resp, nil } + +// set this to conditionally intercept incoming requests to ApplicationServerTransport +var applicationServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/applications_server.go b/sdk/resourcemanager/security/armsecurity/fake/applications_server.go index 115355f33157..639120c872ed 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/applications_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/applications_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -52,21 +49,40 @@ func (a *ApplicationsServerTransport) Do(req *http.Request) (*http.Response, err return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "ApplicationsClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *ApplicationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if applicationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = applicationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ApplicationsClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *ApplicationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -101,3 +117,9 @@ func (a *ApplicationsServerTransport) dispatchNewListPager(req *http.Request) (* } return resp, nil } + +// set this to conditionally intercept incoming requests to ApplicationsServerTransport +var applicationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/assessments_server.go b/sdk/resourcemanager/security/armsecurity/fake/assessments_server.go index ac38bfc35836..ad50fa0239d5 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/assessments_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/assessments_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -66,27 +63,46 @@ func (a *AssessmentsServerTransport) Do(req *http.Request) (*http.Response, erro return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AssessmentsClient.CreateOrUpdate": - resp, err = a.dispatchCreateOrUpdate(req) - case "AssessmentsClient.Delete": - resp, err = a.dispatchDelete(req) - case "AssessmentsClient.Get": - resp, err = a.dispatchGet(req) - case "AssessmentsClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AssessmentsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if assessmentsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = assessmentsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AssessmentsClient.CreateOrUpdate": + res.resp, res.err = a.dispatchCreateOrUpdate(req) + case "AssessmentsClient.Delete": + res.resp, res.err = a.dispatchDelete(req) + case "AssessmentsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AssessmentsClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AssessmentsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -240,3 +256,9 @@ func (a *AssessmentsServerTransport) dispatchNewListPager(req *http.Request) (*h } return resp, nil } + +// set this to conditionally intercept incoming requests to AssessmentsServerTransport +var assessmentsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/assessmentsmetadata_server.go b/sdk/resourcemanager/security/armsecurity/fake/assessmentsmetadata_server.go index 046d8ddb412b..f1ccc54d3ccb 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/assessmentsmetadata_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/assessmentsmetadata_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -76,31 +73,50 @@ func (a *AssessmentsMetadataServerTransport) Do(req *http.Request) (*http.Respon return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AssessmentsMetadataClient.CreateInSubscription": - resp, err = a.dispatchCreateInSubscription(req) - case "AssessmentsMetadataClient.DeleteInSubscription": - resp, err = a.dispatchDeleteInSubscription(req) - case "AssessmentsMetadataClient.Get": - resp, err = a.dispatchGet(req) - case "AssessmentsMetadataClient.GetInSubscription": - resp, err = a.dispatchGetInSubscription(req) - case "AssessmentsMetadataClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - case "AssessmentsMetadataClient.NewListBySubscriptionPager": - resp, err = a.dispatchNewListBySubscriptionPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AssessmentsMetadataServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if assessmentsMetadataServerTransportInterceptor != nil { + res.resp, res.err, intercepted = assessmentsMetadataServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AssessmentsMetadataClient.CreateInSubscription": + res.resp, res.err = a.dispatchCreateInSubscription(req) + case "AssessmentsMetadataClient.DeleteInSubscription": + res.resp, res.err = a.dispatchDeleteInSubscription(req) + case "AssessmentsMetadataClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AssessmentsMetadataClient.GetInSubscription": + res.resp, res.err = a.dispatchGetInSubscription(req) + case "AssessmentsMetadataClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + case "AssessmentsMetadataClient.NewListBySubscriptionPager": + res.resp, res.err = a.dispatchNewListBySubscriptionPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AssessmentsMetadataServerTransport) dispatchCreateInSubscription(req *http.Request) (*http.Response, error) { @@ -282,3 +298,9 @@ func (a *AssessmentsMetadataServerTransport) dispatchNewListBySubscriptionPager( } return resp, nil } + +// set this to conditionally intercept incoming requests to AssessmentsMetadataServerTransport +var assessmentsMetadataServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/automations_server.go b/sdk/resourcemanager/security/armsecurity/fake/automations_server.go index 2c8b6ae682d6..a0c486148632 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/automations_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/automations_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -80,33 +77,52 @@ func (a *AutomationsServerTransport) Do(req *http.Request) (*http.Response, erro return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AutomationsClient.CreateOrUpdate": - resp, err = a.dispatchCreateOrUpdate(req) - case "AutomationsClient.Delete": - resp, err = a.dispatchDelete(req) - case "AutomationsClient.Get": - resp, err = a.dispatchGet(req) - case "AutomationsClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - case "AutomationsClient.NewListByResourceGroupPager": - resp, err = a.dispatchNewListByResourceGroupPager(req) - case "AutomationsClient.Update": - resp, err = a.dispatchUpdate(req) - case "AutomationsClient.Validate": - resp, err = a.dispatchValidate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AutomationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if automationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = automationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AutomationsClient.CreateOrUpdate": + res.resp, res.err = a.dispatchCreateOrUpdate(req) + case "AutomationsClient.Delete": + res.resp, res.err = a.dispatchDelete(req) + case "AutomationsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AutomationsClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + case "AutomationsClient.NewListByResourceGroupPager": + res.resp, res.err = a.dispatchNewListByResourceGroupPager(req) + case "AutomationsClient.Update": + res.resp, res.err = a.dispatchUpdate(req) + case "AutomationsClient.Validate": + res.resp, res.err = a.dispatchValidate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AutomationsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -355,3 +371,9 @@ func (a *AutomationsServerTransport) dispatchValidate(req *http.Request) (*http. } return resp, nil } + +// set this to conditionally intercept incoming requests to AutomationsServerTransport +var automationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/autoprovisioningsettings_server.go b/sdk/resourcemanager/security/armsecurity/fake/autoprovisioningsettings_server.go index c0ed6d6d0ee9..79e5ae21cf31 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/autoprovisioningsettings_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/autoprovisioningsettings_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -62,25 +59,44 @@ func (a *AutoProvisioningSettingsServerTransport) Do(req *http.Request) (*http.R return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AutoProvisioningSettingsClient.Create": - resp, err = a.dispatchCreate(req) - case "AutoProvisioningSettingsClient.Get": - resp, err = a.dispatchGet(req) - case "AutoProvisioningSettingsClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AutoProvisioningSettingsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if autoProvisioningSettingsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = autoProvisioningSettingsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AutoProvisioningSettingsClient.Create": + res.resp, res.err = a.dispatchCreate(req) + case "AutoProvisioningSettingsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AutoProvisioningSettingsClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AutoProvisioningSettingsServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { @@ -177,3 +193,9 @@ func (a *AutoProvisioningSettingsServerTransport) dispatchNewListPager(req *http } return resp, nil } + +// set this to conditionally intercept incoming requests to AutoProvisioningSettingsServerTransport +var autoProvisioningSettingsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/azuredevopsorgs_server.go b/sdk/resourcemanager/security/armsecurity/fake/azuredevopsorgs_server.go index de560da51a81..7dc202063068 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/azuredevopsorgs_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/azuredevopsorgs_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -74,29 +71,48 @@ func (a *AzureDevOpsOrgsServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AzureDevOpsOrgsClient.BeginCreateOrUpdate": - resp, err = a.dispatchBeginCreateOrUpdate(req) - case "AzureDevOpsOrgsClient.Get": - resp, err = a.dispatchGet(req) - case "AzureDevOpsOrgsClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - case "AzureDevOpsOrgsClient.ListAvailable": - resp, err = a.dispatchListAvailable(req) - case "AzureDevOpsOrgsClient.BeginUpdate": - resp, err = a.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AzureDevOpsOrgsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if azureDevOpsOrgsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = azureDevOpsOrgsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AzureDevOpsOrgsClient.BeginCreateOrUpdate": + res.resp, res.err = a.dispatchBeginCreateOrUpdate(req) + case "AzureDevOpsOrgsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AzureDevOpsOrgsClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + case "AzureDevOpsOrgsClient.ListAvailable": + res.resp, res.err = a.dispatchListAvailable(req) + case "AzureDevOpsOrgsClient.BeginUpdate": + res.resp, res.err = a.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AzureDevOpsOrgsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -313,3 +329,9 @@ func (a *AzureDevOpsOrgsServerTransport) dispatchBeginUpdate(req *http.Request) return resp, nil } + +// set this to conditionally intercept incoming requests to AzureDevOpsOrgsServerTransport +var azureDevOpsOrgsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/azuredevopsprojects_server.go b/sdk/resourcemanager/security/armsecurity/fake/azuredevopsprojects_server.go index 1a9317eb5aab..9c097c5ced5c 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/azuredevopsprojects_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/azuredevopsprojects_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -70,27 +67,46 @@ func (a *AzureDevOpsProjectsServerTransport) Do(req *http.Request) (*http.Respon return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AzureDevOpsProjectsClient.BeginCreateOrUpdate": - resp, err = a.dispatchBeginCreateOrUpdate(req) - case "AzureDevOpsProjectsClient.Get": - resp, err = a.dispatchGet(req) - case "AzureDevOpsProjectsClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - case "AzureDevOpsProjectsClient.BeginUpdate": - resp, err = a.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AzureDevOpsProjectsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if azureDevOpsProjectsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = azureDevOpsProjectsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AzureDevOpsProjectsClient.BeginCreateOrUpdate": + res.resp, res.err = a.dispatchBeginCreateOrUpdate(req) + case "AzureDevOpsProjectsClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AzureDevOpsProjectsClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + case "AzureDevOpsProjectsClient.BeginUpdate": + res.resp, res.err = a.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AzureDevOpsProjectsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -290,3 +306,9 @@ func (a *AzureDevOpsProjectsServerTransport) dispatchBeginUpdate(req *http.Reque return resp, nil } + +// set this to conditionally intercept incoming requests to AzureDevOpsProjectsServerTransport +var azureDevOpsProjectsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/azuredevopsrepos_server.go b/sdk/resourcemanager/security/armsecurity/fake/azuredevopsrepos_server.go index f82e267b33a7..3b8134a4151d 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/azuredevopsrepos_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/azuredevopsrepos_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -70,27 +67,46 @@ func (a *AzureDevOpsReposServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return a.dispatchToMethodFake(req, method) +} - switch method { - case "AzureDevOpsReposClient.BeginCreateOrUpdate": - resp, err = a.dispatchBeginCreateOrUpdate(req) - case "AzureDevOpsReposClient.Get": - resp, err = a.dispatchGet(req) - case "AzureDevOpsReposClient.NewListPager": - resp, err = a.dispatchNewListPager(req) - case "AzureDevOpsReposClient.BeginUpdate": - resp, err = a.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (a *AzureDevOpsReposServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if azureDevOpsReposServerTransportInterceptor != nil { + res.resp, res.err, intercepted = azureDevOpsReposServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "AzureDevOpsReposClient.BeginCreateOrUpdate": + res.resp, res.err = a.dispatchBeginCreateOrUpdate(req) + case "AzureDevOpsReposClient.Get": + res.resp, res.err = a.dispatchGet(req) + case "AzureDevOpsReposClient.NewListPager": + res.resp, res.err = a.dispatchNewListPager(req) + case "AzureDevOpsReposClient.BeginUpdate": + res.resp, res.err = a.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (a *AzureDevOpsReposServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -306,3 +322,9 @@ func (a *AzureDevOpsReposServerTransport) dispatchBeginUpdate(req *http.Request) return resp, nil } + +// set this to conditionally intercept incoming requests to AzureDevOpsReposServerTransport +var azureDevOpsReposServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/complianceresults_server.go b/sdk/resourcemanager/security/armsecurity/fake/complianceresults_server.go index 5a3803555629..37111f2ed971 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/complianceresults_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/complianceresults_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -58,23 +55,42 @@ func (c *ComplianceResultsServerTransport) Do(req *http.Request) (*http.Response return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "ComplianceResultsClient.Get": - resp, err = c.dispatchGet(req) - case "ComplianceResultsClient.NewListPager": - resp, err = c.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *ComplianceResultsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if complianceResultsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = complianceResultsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ComplianceResultsClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "ComplianceResultsClient.NewListPager": + res.resp, res.err = c.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *ComplianceResultsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -146,3 +162,9 @@ func (c *ComplianceResultsServerTransport) dispatchNewListPager(req *http.Reques } return resp, nil } + +// set this to conditionally intercept incoming requests to ComplianceResultsServerTransport +var complianceResultsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/compliances_server.go b/sdk/resourcemanager/security/armsecurity/fake/compliances_server.go index 63b9b0d7ab5b..cd07106137c6 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/compliances_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/compliances_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -58,23 +55,42 @@ func (c *CompliancesServerTransport) Do(req *http.Request) (*http.Response, erro return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "CompliancesClient.Get": - resp, err = c.dispatchGet(req) - case "CompliancesClient.NewListPager": - resp, err = c.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *CompliancesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if compliancesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = compliancesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "CompliancesClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "CompliancesClient.NewListPager": + res.resp, res.err = c.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *CompliancesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -146,3 +162,9 @@ func (c *CompliancesServerTransport) dispatchNewListPager(req *http.Request) (*h } return resp, nil } + +// set this to conditionally intercept incoming requests to CompliancesServerTransport +var compliancesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/connectorapplication_server.go b/sdk/resourcemanager/security/armsecurity/fake/connectorapplication_server.go index e7eeee4258e7..ad9c648461f7 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/connectorapplication_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/connectorapplication_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -57,25 +54,44 @@ func (c *ConnectorApplicationServerTransport) Do(req *http.Request) (*http.Respo return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "ConnectorApplicationClient.CreateOrUpdate": - resp, err = c.dispatchCreateOrUpdate(req) - case "ConnectorApplicationClient.Delete": - resp, err = c.dispatchDelete(req) - case "ConnectorApplicationClient.Get": - resp, err = c.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return c.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err +func (c *ConnectorApplicationServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if connectorApplicationServerTransportInterceptor != nil { + res.resp, res.err, intercepted = connectorApplicationServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ConnectorApplicationClient.CreateOrUpdate": + res.resp, res.err = c.dispatchCreateOrUpdate(req) + case "ConnectorApplicationClient.Delete": + res.resp, res.err = c.dispatchDelete(req) + case "ConnectorApplicationClient.Get": + res.resp, res.err = c.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - - return resp, nil } func (c *ConnectorApplicationServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -192,3 +208,9 @@ func (c *ConnectorApplicationServerTransport) dispatchGet(req *http.Request) (*h } return resp, nil } + +// set this to conditionally intercept incoming requests to ConnectorApplicationServerTransport +var connectorApplicationServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/connectorapplications_server.go b/sdk/resourcemanager/security/armsecurity/fake/connectorapplications_server.go index 40e2915a5513..ea9f76e3d0a1 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/connectorapplications_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/connectorapplications_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -53,21 +50,40 @@ func (c *ConnectorApplicationsServerTransport) Do(req *http.Request) (*http.Resp return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "ConnectorApplicationsClient.NewListPager": - resp, err = c.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *ConnectorApplicationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if connectorApplicationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = connectorApplicationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ConnectorApplicationsClient.NewListPager": + res.resp, res.err = c.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *ConnectorApplicationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -110,3 +126,9 @@ func (c *ConnectorApplicationsServerTransport) dispatchNewListPager(req *http.Re } return resp, nil } + +// set this to conditionally intercept incoming requests to ConnectorApplicationsServerTransport +var connectorApplicationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/connectors_server.go b/sdk/resourcemanager/security/armsecurity/fake/connectors_server.go index a3ae8491b13e..608921def4f8 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/connectors_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/connectors_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -76,31 +73,50 @@ func (c *ConnectorsServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "ConnectorsClient.CreateOrUpdate": - resp, err = c.dispatchCreateOrUpdate(req) - case "ConnectorsClient.Delete": - resp, err = c.dispatchDelete(req) - case "ConnectorsClient.Get": - resp, err = c.dispatchGet(req) - case "ConnectorsClient.NewListPager": - resp, err = c.dispatchNewListPager(req) - case "ConnectorsClient.NewListByResourceGroupPager": - resp, err = c.dispatchNewListByResourceGroupPager(req) - case "ConnectorsClient.Update": - resp, err = c.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *ConnectorsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if connectorsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = connectorsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ConnectorsClient.CreateOrUpdate": + res.resp, res.err = c.dispatchCreateOrUpdate(req) + case "ConnectorsClient.Delete": + res.resp, res.err = c.dispatchDelete(req) + case "ConnectorsClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "ConnectorsClient.NewListPager": + res.resp, res.err = c.dispatchNewListPager(req) + case "ConnectorsClient.NewListByResourceGroupPager": + res.resp, res.err = c.dispatchNewListByResourceGroupPager(req) + case "ConnectorsClient.Update": + res.resp, res.err = c.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *ConnectorsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -312,3 +328,9 @@ func (c *ConnectorsServerTransport) dispatchUpdate(req *http.Request) (*http.Res } return resp, nil } + +// set this to conditionally intercept incoming requests to ConnectorsServerTransport +var connectorsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/contacts_server.go b/sdk/resourcemanager/security/armsecurity/fake/contacts_server.go index e546367d05d8..c112e82de83a 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/contacts_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/contacts_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -66,27 +63,46 @@ func (c *ContactsServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "ContactsClient.Create": - resp, err = c.dispatchCreate(req) - case "ContactsClient.Delete": - resp, err = c.dispatchDelete(req) - case "ContactsClient.Get": - resp, err = c.dispatchGet(req) - case "ContactsClient.NewListPager": - resp, err = c.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *ContactsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if contactsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = contactsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ContactsClient.Create": + res.resp, res.err = c.dispatchCreate(req) + case "ContactsClient.Delete": + res.resp, res.err = c.dispatchDelete(req) + case "ContactsClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "ContactsClient.NewListPager": + res.resp, res.err = c.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *ContactsServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { @@ -230,3 +246,9 @@ func (c *ContactsServerTransport) dispatchNewListPager(req *http.Request) (*http } return resp, nil } + +// set this to conditionally intercept incoming requests to ContactsServerTransport +var contactsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/customassessmentautomations_server.go b/sdk/resourcemanager/security/armsecurity/fake/customassessmentautomations_server.go index a463bb75db9c..e3dc7fd2da18 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/customassessmentautomations_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/customassessmentautomations_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -72,29 +69,48 @@ func (c *CustomAssessmentAutomationsServerTransport) Do(req *http.Request) (*htt return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "CustomAssessmentAutomationsClient.Create": - resp, err = c.dispatchCreate(req) - case "CustomAssessmentAutomationsClient.Delete": - resp, err = c.dispatchDelete(req) - case "CustomAssessmentAutomationsClient.Get": - resp, err = c.dispatchGet(req) - case "CustomAssessmentAutomationsClient.NewListByResourceGroupPager": - resp, err = c.dispatchNewListByResourceGroupPager(req) - case "CustomAssessmentAutomationsClient.NewListBySubscriptionPager": - resp, err = c.dispatchNewListBySubscriptionPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *CustomAssessmentAutomationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if customAssessmentAutomationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = customAssessmentAutomationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "CustomAssessmentAutomationsClient.Create": + res.resp, res.err = c.dispatchCreate(req) + case "CustomAssessmentAutomationsClient.Delete": + res.resp, res.err = c.dispatchDelete(req) + case "CustomAssessmentAutomationsClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "CustomAssessmentAutomationsClient.NewListByResourceGroupPager": + res.resp, res.err = c.dispatchNewListByResourceGroupPager(req) + case "CustomAssessmentAutomationsClient.NewListBySubscriptionPager": + res.resp, res.err = c.dispatchNewListBySubscriptionPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *CustomAssessmentAutomationsServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { @@ -269,3 +285,9 @@ func (c *CustomAssessmentAutomationsServerTransport) dispatchNewListBySubscripti } return resp, nil } + +// set this to conditionally intercept incoming requests to CustomAssessmentAutomationsServerTransport +var customAssessmentAutomationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/customentitystoreassignments_server.go b/sdk/resourcemanager/security/armsecurity/fake/customentitystoreassignments_server.go index e6c1b8146c2d..62de26963b13 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/customentitystoreassignments_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/customentitystoreassignments_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -72,29 +69,48 @@ func (c *CustomEntityStoreAssignmentsServerTransport) Do(req *http.Request) (*ht return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return c.dispatchToMethodFake(req, method) +} - switch method { - case "CustomEntityStoreAssignmentsClient.Create": - resp, err = c.dispatchCreate(req) - case "CustomEntityStoreAssignmentsClient.Delete": - resp, err = c.dispatchDelete(req) - case "CustomEntityStoreAssignmentsClient.Get": - resp, err = c.dispatchGet(req) - case "CustomEntityStoreAssignmentsClient.NewListByResourceGroupPager": - resp, err = c.dispatchNewListByResourceGroupPager(req) - case "CustomEntityStoreAssignmentsClient.NewListBySubscriptionPager": - resp, err = c.dispatchNewListBySubscriptionPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (c *CustomEntityStoreAssignmentsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if customEntityStoreAssignmentsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = customEntityStoreAssignmentsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "CustomEntityStoreAssignmentsClient.Create": + res.resp, res.err = c.dispatchCreate(req) + case "CustomEntityStoreAssignmentsClient.Delete": + res.resp, res.err = c.dispatchDelete(req) + case "CustomEntityStoreAssignmentsClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "CustomEntityStoreAssignmentsClient.NewListByResourceGroupPager": + res.resp, res.err = c.dispatchNewListByResourceGroupPager(req) + case "CustomEntityStoreAssignmentsClient.NewListBySubscriptionPager": + res.resp, res.err = c.dispatchNewListBySubscriptionPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (c *CustomEntityStoreAssignmentsServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { @@ -269,3 +285,9 @@ func (c *CustomEntityStoreAssignmentsServerTransport) dispatchNewListBySubscript } return resp, nil } + +// set this to conditionally intercept incoming requests to CustomEntityStoreAssignmentsServerTransport +var customEntityStoreAssignmentsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/customrecommendations_server.go b/sdk/resourcemanager/security/armsecurity/fake/customrecommendations_server.go new file mode 100644 index 000000000000..d10f16d8e9c2 --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/fake/customrecommendations_server.go @@ -0,0 +1,252 @@ +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" + "net/http" + "net/url" + "regexp" +) + +// CustomRecommendationsServer is a fake server for instances of the armsecurity.CustomRecommendationsClient type. +type CustomRecommendationsServer struct { + // CreateOrUpdate is the fake for method CustomRecommendationsClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, scope string, customRecommendationName string, customRecommendationBody armsecurity.CustomRecommendation, options *armsecurity.CustomRecommendationsClientCreateOrUpdateOptions) (resp azfake.Responder[armsecurity.CustomRecommendationsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method CustomRecommendationsClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, scope string, customRecommendationName string, options *armsecurity.CustomRecommendationsClientDeleteOptions) (resp azfake.Responder[armsecurity.CustomRecommendationsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method CustomRecommendationsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, scope string, customRecommendationName string, options *armsecurity.CustomRecommendationsClientGetOptions) (resp azfake.Responder[armsecurity.CustomRecommendationsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method CustomRecommendationsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(scope string, options *armsecurity.CustomRecommendationsClientListOptions) (resp azfake.PagerResponder[armsecurity.CustomRecommendationsClientListResponse]) +} + +// NewCustomRecommendationsServerTransport creates a new instance of CustomRecommendationsServerTransport with the provided implementation. +// The returned CustomRecommendationsServerTransport instance is connected to an instance of armsecurity.CustomRecommendationsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewCustomRecommendationsServerTransport(srv *CustomRecommendationsServer) *CustomRecommendationsServerTransport { + return &CustomRecommendationsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armsecurity.CustomRecommendationsClientListResponse]](), + } +} + +// CustomRecommendationsServerTransport connects instances of armsecurity.CustomRecommendationsClient to instances of CustomRecommendationsServer. +// Don't use this type directly, use NewCustomRecommendationsServerTransport instead. +type CustomRecommendationsServerTransport struct { + srv *CustomRecommendationsServer + newListPager *tracker[azfake.PagerResponder[armsecurity.CustomRecommendationsClientListResponse]] +} + +// Do implements the policy.Transporter interface for CustomRecommendationsServerTransport. +func (c *CustomRecommendationsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return c.dispatchToMethodFake(req, method) +} + +func (c *CustomRecommendationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if customRecommendationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = customRecommendationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "CustomRecommendationsClient.CreateOrUpdate": + res.resp, res.err = c.dispatchCreateOrUpdate(req) + case "CustomRecommendationsClient.Delete": + res.resp, res.err = c.dispatchDelete(req) + case "CustomRecommendationsClient.Get": + res.resp, res.err = c.dispatchGet(req) + case "CustomRecommendationsClient.NewListPager": + res.resp, res.err = c.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (c *CustomRecommendationsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if c.srv.CreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} + } + const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Security/customRecommendations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armsecurity.CustomRecommendation](req) + if err != nil { + return nil, err + } + scopeParam, err := url.PathUnescape(matches[regex.SubexpIndex("scope")]) + if err != nil { + return nil, err + } + customRecommendationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("customRecommendationName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.CreateOrUpdate(req.Context(), scopeParam, customRecommendationNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).CustomRecommendation, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *CustomRecommendationsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if c.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Security/customRecommendations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + scopeParam, err := url.PathUnescape(matches[regex.SubexpIndex("scope")]) + if err != nil { + return nil, err + } + customRecommendationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("customRecommendationName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.Delete(req.Context(), scopeParam, customRecommendationNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *CustomRecommendationsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if c.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Security/customRecommendations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + scopeParam, err := url.PathUnescape(matches[regex.SubexpIndex("scope")]) + if err != nil { + return nil, err + } + customRecommendationNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("customRecommendationName")]) + if err != nil { + return nil, err + } + respr, errRespr := c.srv.Get(req.Context(), scopeParam, customRecommendationNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).CustomRecommendation, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (c *CustomRecommendationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if c.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := c.newListPager.get(req) + if newListPager == nil { + const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Security/customRecommendations` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + scopeParam, err := url.PathUnescape(matches[regex.SubexpIndex("scope")]) + if err != nil { + return nil, err + } + resp := c.srv.NewListPager(scopeParam, nil) + newListPager = &resp + c.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armsecurity.CustomRecommendationsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + c.newListPager.remove(req) + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to CustomRecommendationsServerTransport +var customRecommendationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/date_type.go b/sdk/resourcemanager/security/armsecurity/fake/date_type.go deleted file mode 100644 index 6a8d61c6788c..000000000000 --- a/sdk/resourcemanager/security/armsecurity/fake/date_type.go +++ /dev/null @@ -1,58 +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. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "time" -) - -const ( - fullDateJSON = `"2006-01-02"` - jsonFormat = `"%04d-%02d-%02d"` -) - -type dateType time.Time - -func (t dateType) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf(jsonFormat, time.Time(t).Year(), time.Time(t).Month(), time.Time(t).Day())), nil -} - -func (d *dateType) UnmarshalJSON(data []byte) (err error) { - t, err := time.Parse(fullDateJSON, string(data)) - *d = (dateType)(t) - return err -} - -func populateDateType(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateType)(t) -} - -func unpopulateDateType(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || string(data) == "null" { - return nil - } - var aux dateType - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/security/armsecurity/fake/defenderforstorage_server.go b/sdk/resourcemanager/security/armsecurity/fake/defenderforstorage_server.go index 00a893a000bf..61d350a40741 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/defenderforstorage_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/defenderforstorage_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -23,13 +20,25 @@ import ( // DefenderForStorageServer is a fake server for instances of the armsecurity.DefenderForStorageClient type. type DefenderForStorageServer struct { + // CancelMalwareScan is the fake for method DefenderForStorageClient.CancelMalwareScan + // HTTP status codes to indicate success: http.StatusOK + CancelMalwareScan func(ctx context.Context, resourceID string, settingName armsecurity.SettingNameAutoGenerated, scanID string, options *armsecurity.DefenderForStorageClientCancelMalwareScanOptions) (resp azfake.Responder[armsecurity.DefenderForStorageClientCancelMalwareScanResponse], errResp azfake.ErrorResponder) + // Create is the fake for method DefenderForStorageClient.Create // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated - Create func(ctx context.Context, resourceID string, settingName armsecurity.SettingName, defenderForStorageSetting armsecurity.DefenderForStorageSetting, options *armsecurity.DefenderForStorageClientCreateOptions) (resp azfake.Responder[armsecurity.DefenderForStorageClientCreateResponse], errResp azfake.ErrorResponder) + Create func(ctx context.Context, resourceID string, settingName armsecurity.SettingNameAutoGenerated, defenderForStorageSetting armsecurity.DefenderForStorageSetting, options *armsecurity.DefenderForStorageClientCreateOptions) (resp azfake.Responder[armsecurity.DefenderForStorageClientCreateResponse], errResp azfake.ErrorResponder) // Get is the fake for method DefenderForStorageClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, resourceID string, settingName armsecurity.SettingName, options *armsecurity.DefenderForStorageClientGetOptions) (resp azfake.Responder[armsecurity.DefenderForStorageClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, resourceID string, settingName armsecurity.SettingNameAutoGenerated, options *armsecurity.DefenderForStorageClientGetOptions) (resp azfake.Responder[armsecurity.DefenderForStorageClientGetResponse], errResp azfake.ErrorResponder) + + // GetMalwareScan is the fake for method DefenderForStorageClient.GetMalwareScan + // HTTP status codes to indicate success: http.StatusOK + GetMalwareScan func(ctx context.Context, resourceID string, settingName armsecurity.SettingNameAutoGenerated, scanID string, options *armsecurity.DefenderForStorageClientGetMalwareScanOptions) (resp azfake.Responder[armsecurity.DefenderForStorageClientGetMalwareScanResponse], errResp azfake.ErrorResponder) + + // StartMalwareScan is the fake for method DefenderForStorageClient.StartMalwareScan + // HTTP status codes to indicate success: http.StatusOK + StartMalwareScan func(ctx context.Context, resourceID string, settingName armsecurity.SettingNameAutoGenerated, options *armsecurity.DefenderForStorageClientStartMalwareScanOptions) (resp azfake.Responder[armsecurity.DefenderForStorageClientStartMalwareScanResponse], errResp azfake.ErrorResponder) } // NewDefenderForStorageServerTransport creates a new instance of DefenderForStorageServerTransport with the provided implementation. @@ -53,22 +62,90 @@ func (d *DefenderForStorageServerTransport) Do(req *http.Request) (*http.Respons return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} + +func (d *DefenderForStorageServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if defenderForStorageServerTransportInterceptor != nil { + res.resp, res.err, intercepted = defenderForStorageServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DefenderForStorageClient.CancelMalwareScan": + res.resp, res.err = d.dispatchCancelMalwareScan(req) + case "DefenderForStorageClient.Create": + res.resp, res.err = d.dispatchCreate(req) + case "DefenderForStorageClient.Get": + res.resp, res.err = d.dispatchGet(req) + case "DefenderForStorageClient.GetMalwareScan": + res.resp, res.err = d.dispatchGetMalwareScan(req) + case "DefenderForStorageClient.StartMalwareScan": + res.resp, res.err = d.dispatchStartMalwareScan(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() - switch method { - case "DefenderForStorageClient.Create": - resp, err = d.dispatchCreate(req) - case "DefenderForStorageClient.Get": - resp, err = d.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } +} +func (d *DefenderForStorageServerTransport) dispatchCancelMalwareScan(req *http.Request) (*http.Response, error) { + if d.srv.CancelMalwareScan == nil { + return nil, &nonRetriableError{errors.New("fake for method CancelMalwareScan not implemented")} + } + const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Security/defenderForStorageSettings/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/malwareScans/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cancelMalwareScan` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceId")]) + if err != nil { + return nil, err + } + settingNameParam, err := parseWithCast(matches[regex.SubexpIndex("settingName")], func(v string) (armsecurity.SettingNameAutoGenerated, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armsecurity.SettingNameAutoGenerated(p), nil + }) + if err != nil { + return nil, err + } + scanIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("scanId")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.CancelMalwareScan(req.Context(), resourceIDParam, settingNameParam, scanIDParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).MalwareScan, req) if err != nil { return nil, err } - return resp, nil } @@ -90,12 +167,12 @@ func (d *DefenderForStorageServerTransport) dispatchCreate(req *http.Request) (* if err != nil { return nil, err } - settingNameParam, err := parseWithCast(matches[regex.SubexpIndex("settingName")], func(v string) (armsecurity.SettingName, error) { + settingNameParam, err := parseWithCast(matches[regex.SubexpIndex("settingName")], func(v string) (armsecurity.SettingNameAutoGenerated, error) { p, unescapeErr := url.PathUnescape(v) if unescapeErr != nil { return "", unescapeErr } - return armsecurity.SettingName(p), nil + return armsecurity.SettingNameAutoGenerated(p), nil }) if err != nil { return nil, err @@ -129,12 +206,12 @@ func (d *DefenderForStorageServerTransport) dispatchGet(req *http.Request) (*htt if err != nil { return nil, err } - settingNameParam, err := parseWithCast(matches[regex.SubexpIndex("settingName")], func(v string) (armsecurity.SettingName, error) { + settingNameParam, err := parseWithCast(matches[regex.SubexpIndex("settingName")], func(v string) (armsecurity.SettingNameAutoGenerated, error) { p, unescapeErr := url.PathUnescape(v) if unescapeErr != nil { return "", unescapeErr } - return armsecurity.SettingName(p), nil + return armsecurity.SettingNameAutoGenerated(p), nil }) if err != nil { return nil, err @@ -153,3 +230,91 @@ func (d *DefenderForStorageServerTransport) dispatchGet(req *http.Request) (*htt } return resp, nil } + +func (d *DefenderForStorageServerTransport) dispatchGetMalwareScan(req *http.Request) (*http.Response, error) { + if d.srv.GetMalwareScan == nil { + return nil, &nonRetriableError{errors.New("fake for method GetMalwareScan not implemented")} + } + const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Security/defenderForStorageSettings/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/malwareScans/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceId")]) + if err != nil { + return nil, err + } + settingNameParam, err := parseWithCast(matches[regex.SubexpIndex("settingName")], func(v string) (armsecurity.SettingNameAutoGenerated, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armsecurity.SettingNameAutoGenerated(p), nil + }) + if err != nil { + return nil, err + } + scanIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("scanId")]) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.GetMalwareScan(req.Context(), resourceIDParam, settingNameParam, scanIDParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).MalwareScan, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (d *DefenderForStorageServerTransport) dispatchStartMalwareScan(req *http.Request) (*http.Response, error) { + if d.srv.StartMalwareScan == nil { + return nil, &nonRetriableError{errors.New("fake for method StartMalwareScan not implemented")} + } + const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Security/defenderForStorageSettings/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/startMalwareScan` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceId")]) + if err != nil { + return nil, err + } + settingNameParam, err := parseWithCast(matches[regex.SubexpIndex("settingName")], func(v string) (armsecurity.SettingNameAutoGenerated, error) { + p, unescapeErr := url.PathUnescape(v) + if unescapeErr != nil { + return "", unescapeErr + } + return armsecurity.SettingNameAutoGenerated(p), nil + }) + if err != nil { + return nil, err + } + respr, errRespr := d.srv.StartMalwareScan(req.Context(), resourceIDParam, settingNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).MalwareScan, req) + if err != nil { + return nil, err + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to DefenderForStorageServerTransport +var defenderForStorageServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/devicesecuritygroups_server.go b/sdk/resourcemanager/security/armsecurity/fake/devicesecuritygroups_server.go index a8a07bef1ad7..6041c3378d1c 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/devicesecuritygroups_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/devicesecuritygroups_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -66,27 +63,46 @@ func (d *DeviceSecurityGroupsServerTransport) Do(req *http.Request) (*http.Respo return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} - switch method { - case "DeviceSecurityGroupsClient.CreateOrUpdate": - resp, err = d.dispatchCreateOrUpdate(req) - case "DeviceSecurityGroupsClient.Delete": - resp, err = d.dispatchDelete(req) - case "DeviceSecurityGroupsClient.Get": - resp, err = d.dispatchGet(req) - case "DeviceSecurityGroupsClient.NewListPager": - resp, err = d.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (d *DeviceSecurityGroupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if deviceSecurityGroupsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = deviceSecurityGroupsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DeviceSecurityGroupsClient.CreateOrUpdate": + res.resp, res.err = d.dispatchCreateOrUpdate(req) + case "DeviceSecurityGroupsClient.Delete": + res.resp, res.err = d.dispatchDelete(req) + case "DeviceSecurityGroupsClient.Get": + res.resp, res.err = d.dispatchGet(req) + case "DeviceSecurityGroupsClient.NewListPager": + res.resp, res.err = d.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (d *DeviceSecurityGroupsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -228,3 +244,9 @@ func (d *DeviceSecurityGroupsServerTransport) dispatchNewListPager(req *http.Req } return resp, nil } + +// set this to conditionally intercept incoming requests to DeviceSecurityGroupsServerTransport +var deviceSecurityGroupsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/devopsconfigurations_server.go b/sdk/resourcemanager/security/armsecurity/fake/devopsconfigurations_server.go index 766bb66f77a8..9ba547849cbb 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/devopsconfigurations_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/devopsconfigurations_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -76,29 +73,48 @@ func (d *DevOpsConfigurationsServerTransport) Do(req *http.Request) (*http.Respo return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} - switch method { - case "DevOpsConfigurationsClient.BeginCreateOrUpdate": - resp, err = d.dispatchBeginCreateOrUpdate(req) - case "DevOpsConfigurationsClient.BeginDelete": - resp, err = d.dispatchBeginDelete(req) - case "DevOpsConfigurationsClient.Get": - resp, err = d.dispatchGet(req) - case "DevOpsConfigurationsClient.NewListPager": - resp, err = d.dispatchNewListPager(req) - case "DevOpsConfigurationsClient.BeginUpdate": - resp, err = d.dispatchBeginUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (d *DevOpsConfigurationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if devOpsConfigurationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = devOpsConfigurationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DevOpsConfigurationsClient.BeginCreateOrUpdate": + res.resp, res.err = d.dispatchBeginCreateOrUpdate(req) + case "DevOpsConfigurationsClient.BeginDelete": + res.resp, res.err = d.dispatchBeginDelete(req) + case "DevOpsConfigurationsClient.Get": + res.resp, res.err = d.dispatchGet(req) + case "DevOpsConfigurationsClient.NewListPager": + res.resp, res.err = d.dispatchNewListPager(req) + case "DevOpsConfigurationsClient.BeginUpdate": + res.resp, res.err = d.dispatchBeginUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (d *DevOpsConfigurationsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -314,3 +330,9 @@ func (d *DevOpsConfigurationsServerTransport) dispatchBeginUpdate(req *http.Requ return resp, nil } + +// set this to conditionally intercept incoming requests to DevOpsConfigurationsServerTransport +var devOpsConfigurationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/devopsoperationresults_server.go b/sdk/resourcemanager/security/armsecurity/fake/devopsoperationresults_server.go index 4760ad6ab4c9..f96f7d027fb1 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/devopsoperationresults_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/devopsoperationresults_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -49,21 +46,40 @@ func (d *DevOpsOperationResultsServerTransport) Do(req *http.Request) (*http.Res return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} - switch method { - case "DevOpsOperationResultsClient.Get": - resp, err = d.dispatchGet(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (d *DevOpsOperationResultsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if devOpsOperationResultsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = devOpsOperationResultsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DevOpsOperationResultsClient.Get": + res.resp, res.err = d.dispatchGet(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (d *DevOpsOperationResultsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -102,3 +118,9 @@ func (d *DevOpsOperationResultsServerTransport) dispatchGet(req *http.Request) ( } return resp, nil } + +// set this to conditionally intercept incoming requests to DevOpsOperationResultsServerTransport +var devOpsOperationResultsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/discoveredsecuritysolutions_server.go b/sdk/resourcemanager/security/armsecurity/fake/discoveredsecuritysolutions_server.go index 776db7b38f60..9af279fd479a 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/discoveredsecuritysolutions_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/discoveredsecuritysolutions_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -64,25 +61,44 @@ func (d *DiscoveredSecuritySolutionsServerTransport) Do(req *http.Request) (*htt return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return d.dispatchToMethodFake(req, method) +} - switch method { - case "DiscoveredSecuritySolutionsClient.Get": - resp, err = d.dispatchGet(req) - case "DiscoveredSecuritySolutionsClient.NewListPager": - resp, err = d.dispatchNewListPager(req) - case "DiscoveredSecuritySolutionsClient.NewListByHomeRegionPager": - resp, err = d.dispatchNewListByHomeRegionPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (d *DiscoveredSecuritySolutionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if discoveredSecuritySolutionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = discoveredSecuritySolutionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "DiscoveredSecuritySolutionsClient.Get": + res.resp, res.err = d.dispatchGet(req) + case "DiscoveredSecuritySolutionsClient.NewListPager": + res.resp, res.err = d.dispatchNewListPager(req) + case "DiscoveredSecuritySolutionsClient.NewListByHomeRegionPager": + res.resp, res.err = d.dispatchNewListByHomeRegionPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (d *DiscoveredSecuritySolutionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -191,3 +207,9 @@ func (d *DiscoveredSecuritySolutionsServerTransport) dispatchNewListByHomeRegion } return resp, nil } + +// set this to conditionally intercept incoming requests to DiscoveredSecuritySolutionsServerTransport +var discoveredSecuritySolutionsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/externalsecuritysolutions_server.go b/sdk/resourcemanager/security/armsecurity/fake/externalsecuritysolutions_server.go index 484bc707a711..8fdd08fd317a 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/externalsecuritysolutions_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/externalsecuritysolutions_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -64,25 +61,44 @@ func (e *ExternalSecuritySolutionsServerTransport) Do(req *http.Request) (*http. return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return e.dispatchToMethodFake(req, method) +} - switch method { - case "ExternalSecuritySolutionsClient.Get": - resp, err = e.dispatchGet(req) - case "ExternalSecuritySolutionsClient.NewListPager": - resp, err = e.dispatchNewListPager(req) - case "ExternalSecuritySolutionsClient.NewListByHomeRegionPager": - resp, err = e.dispatchNewListByHomeRegionPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (e *ExternalSecuritySolutionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if externalSecuritySolutionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = externalSecuritySolutionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ExternalSecuritySolutionsClient.Get": + res.resp, res.err = e.dispatchGet(req) + case "ExternalSecuritySolutionsClient.NewListPager": + res.resp, res.err = e.dispatchNewListPager(req) + case "ExternalSecuritySolutionsClient.NewListByHomeRegionPager": + res.resp, res.err = e.dispatchNewListByHomeRegionPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (e *ExternalSecuritySolutionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -191,3 +207,9 @@ func (e *ExternalSecuritySolutionsServerTransport) dispatchNewListByHomeRegionPa } return resp, nil } + +// set this to conditionally intercept incoming requests to ExternalSecuritySolutionsServerTransport +var externalSecuritySolutionsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/githubowners_server.go b/sdk/resourcemanager/security/armsecurity/fake/githubowners_server.go index 00f74585a09d..b0ac3910c623 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/githubowners_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/githubowners_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -62,25 +59,44 @@ func (g *GitHubOwnersServerTransport) Do(req *http.Request) (*http.Response, err return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return g.dispatchToMethodFake(req, method) +} - switch method { - case "GitHubOwnersClient.Get": - resp, err = g.dispatchGet(req) - case "GitHubOwnersClient.NewListPager": - resp, err = g.dispatchNewListPager(req) - case "GitHubOwnersClient.ListAvailable": - resp, err = g.dispatchListAvailable(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (g *GitHubOwnersServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if gitHubOwnersServerTransportInterceptor != nil { + res.resp, res.err, intercepted = gitHubOwnersServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "GitHubOwnersClient.Get": + res.resp, res.err = g.dispatchGet(req) + case "GitHubOwnersClient.NewListPager": + res.resp, res.err = g.dispatchNewListPager(req) + case "GitHubOwnersClient.ListAvailable": + res.resp, res.err = g.dispatchListAvailable(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (g *GitHubOwnersServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -193,3 +209,9 @@ func (g *GitHubOwnersServerTransport) dispatchListAvailable(req *http.Request) ( } return resp, nil } + +// set this to conditionally intercept incoming requests to GitHubOwnersServerTransport +var gitHubOwnersServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/githubrepos_server.go b/sdk/resourcemanager/security/armsecurity/fake/githubrepos_server.go index 8bd332f79483..fc251b1ca430 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/githubrepos_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/githubrepos_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -58,23 +55,42 @@ func (g *GitHubReposServerTransport) Do(req *http.Request) (*http.Response, erro return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return g.dispatchToMethodFake(req, method) +} - switch method { - case "GitHubReposClient.Get": - resp, err = g.dispatchGet(req) - case "GitHubReposClient.NewListPager": - resp, err = g.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (g *GitHubReposServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if gitHubReposServerTransportInterceptor != nil { + res.resp, res.err, intercepted = gitHubReposServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "GitHubReposClient.Get": + res.resp, res.err = g.dispatchGet(req) + case "GitHubReposClient.NewListPager": + res.resp, res.err = g.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (g *GitHubReposServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -162,3 +178,9 @@ func (g *GitHubReposServerTransport) dispatchNewListPager(req *http.Request) (*h } return resp, nil } + +// set this to conditionally intercept incoming requests to GitHubReposServerTransport +var gitHubReposServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/gitlabgroups_server.go b/sdk/resourcemanager/security/armsecurity/fake/gitlabgroups_server.go index 19d6804afcae..8ea0b27fd7fd 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/gitlabgroups_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/gitlabgroups_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -62,25 +59,44 @@ func (g *GitLabGroupsServerTransport) Do(req *http.Request) (*http.Response, err return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return g.dispatchToMethodFake(req, method) +} - switch method { - case "GitLabGroupsClient.Get": - resp, err = g.dispatchGet(req) - case "GitLabGroupsClient.NewListPager": - resp, err = g.dispatchNewListPager(req) - case "GitLabGroupsClient.ListAvailable": - resp, err = g.dispatchListAvailable(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (g *GitLabGroupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if gitLabGroupsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = gitLabGroupsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "GitLabGroupsClient.Get": + res.resp, res.err = g.dispatchGet(req) + case "GitLabGroupsClient.NewListPager": + res.resp, res.err = g.dispatchNewListPager(req) + case "GitLabGroupsClient.ListAvailable": + res.resp, res.err = g.dispatchListAvailable(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (g *GitLabGroupsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -193,3 +209,9 @@ func (g *GitLabGroupsServerTransport) dispatchListAvailable(req *http.Request) ( } return resp, nil } + +// set this to conditionally intercept incoming requests to GitLabGroupsServerTransport +var gitLabGroupsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/gitlabprojects_server.go b/sdk/resourcemanager/security/armsecurity/fake/gitlabprojects_server.go index 1bc9dd065aac..5f91ada8527d 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/gitlabprojects_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/gitlabprojects_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -58,23 +55,42 @@ func (g *GitLabProjectsServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return g.dispatchToMethodFake(req, method) +} - switch method { - case "GitLabProjectsClient.Get": - resp, err = g.dispatchGet(req) - case "GitLabProjectsClient.NewListPager": - resp, err = g.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (g *GitLabProjectsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if gitLabProjectsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = gitLabProjectsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "GitLabProjectsClient.Get": + res.resp, res.err = g.dispatchGet(req) + case "GitLabProjectsClient.NewListPager": + res.resp, res.err = g.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (g *GitLabProjectsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -162,3 +178,9 @@ func (g *GitLabProjectsServerTransport) dispatchNewListPager(req *http.Request) } return resp, nil } + +// set this to conditionally intercept incoming requests to GitLabProjectsServerTransport +var gitLabProjectsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/gitlabsubgroups_server.go b/sdk/resourcemanager/security/armsecurity/fake/gitlabsubgroups_server.go index 686734d02292..30fdf9decdea 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/gitlabsubgroups_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/gitlabsubgroups_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -49,21 +46,40 @@ func (g *GitLabSubgroupsServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return g.dispatchToMethodFake(req, method) +} - switch method { - case "GitLabSubgroupsClient.List": - resp, err = g.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (g *GitLabSubgroupsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if gitLabSubgroupsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = gitLabSubgroupsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "GitLabSubgroupsClient.List": + res.resp, res.err = g.dispatchList(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (g *GitLabSubgroupsServerTransport) dispatchList(req *http.Request) (*http.Response, error) { @@ -102,3 +118,9 @@ func (g *GitLabSubgroupsServerTransport) dispatchList(req *http.Request) (*http. } return resp, nil } + +// set this to conditionally intercept incoming requests to GitLabSubgroupsServerTransport +var gitLabSubgroupsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/governanceassignments_server.go b/sdk/resourcemanager/security/armsecurity/fake/governanceassignments_server.go index 243bc872b436..f09fa28ece32 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/governanceassignments_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/governanceassignments_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -66,27 +63,46 @@ func (g *GovernanceAssignmentsServerTransport) Do(req *http.Request) (*http.Resp return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return g.dispatchToMethodFake(req, method) +} - switch method { - case "GovernanceAssignmentsClient.CreateOrUpdate": - resp, err = g.dispatchCreateOrUpdate(req) - case "GovernanceAssignmentsClient.Delete": - resp, err = g.dispatchDelete(req) - case "GovernanceAssignmentsClient.Get": - resp, err = g.dispatchGet(req) - case "GovernanceAssignmentsClient.NewListPager": - resp, err = g.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (g *GovernanceAssignmentsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if governanceAssignmentsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = governanceAssignmentsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "GovernanceAssignmentsClient.CreateOrUpdate": + res.resp, res.err = g.dispatchCreateOrUpdate(req) + case "GovernanceAssignmentsClient.Delete": + res.resp, res.err = g.dispatchDelete(req) + case "GovernanceAssignmentsClient.Get": + res.resp, res.err = g.dispatchGet(req) + case "GovernanceAssignmentsClient.NewListPager": + res.resp, res.err = g.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (g *GovernanceAssignmentsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -244,3 +260,9 @@ func (g *GovernanceAssignmentsServerTransport) dispatchNewListPager(req *http.Re } return resp, nil } + +// set this to conditionally intercept incoming requests to GovernanceAssignmentsServerTransport +var governanceAssignmentsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/governancerules_server.go b/sdk/resourcemanager/security/armsecurity/fake/governancerules_server.go index df9e1741c2c4..405b1cbcdda0 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/governancerules_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/governancerules_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -34,7 +31,7 @@ type GovernanceRulesServer struct { BeginDelete func(ctx context.Context, scope string, ruleID string, options *armsecurity.GovernanceRulesClientBeginDeleteOptions) (resp azfake.PollerResponder[armsecurity.GovernanceRulesClientDeleteResponse], errResp azfake.ErrorResponder) // BeginExecute is the fake for method GovernanceRulesClient.BeginExecute - // HTTP status codes to indicate success: http.StatusAccepted + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent BeginExecute func(ctx context.Context, scope string, ruleID string, options *armsecurity.GovernanceRulesClientBeginExecuteOptions) (resp azfake.PollerResponder[armsecurity.GovernanceRulesClientExecuteResponse], errResp azfake.ErrorResponder) // Get is the fake for method GovernanceRulesClient.Get @@ -79,31 +76,50 @@ func (g *GovernanceRulesServerTransport) Do(req *http.Request) (*http.Response, return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return g.dispatchToMethodFake(req, method) +} - switch method { - case "GovernanceRulesClient.CreateOrUpdate": - resp, err = g.dispatchCreateOrUpdate(req) - case "GovernanceRulesClient.BeginDelete": - resp, err = g.dispatchBeginDelete(req) - case "GovernanceRulesClient.BeginExecute": - resp, err = g.dispatchBeginExecute(req) - case "GovernanceRulesClient.Get": - resp, err = g.dispatchGet(req) - case "GovernanceRulesClient.NewListPager": - resp, err = g.dispatchNewListPager(req) - case "GovernanceRulesClient.OperationResults": - resp, err = g.dispatchOperationResults(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (g *GovernanceRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if governanceRulesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = governanceRulesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "GovernanceRulesClient.CreateOrUpdate": + res.resp, res.err = g.dispatchCreateOrUpdate(req) + case "GovernanceRulesClient.BeginDelete": + res.resp, res.err = g.dispatchBeginDelete(req) + case "GovernanceRulesClient.BeginExecute": + res.resp, res.err = g.dispatchBeginExecute(req) + case "GovernanceRulesClient.Get": + res.resp, res.err = g.dispatchGet(req) + case "GovernanceRulesClient.NewListPager": + res.resp, res.err = g.dispatchNewListPager(req) + case "GovernanceRulesClient.OperationResults": + res.resp, res.err = g.dispatchOperationResults(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (g *GovernanceRulesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -230,9 +246,9 @@ func (g *GovernanceRulesServerTransport) dispatchBeginExecute(req *http.Request) return nil, err } - if !contains([]int{http.StatusAccepted}, resp.StatusCode) { + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { g.beginExecute.remove(req) - return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusAccepted", resp.StatusCode)} + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } if !server.PollerResponderMore(beginExecute) { g.beginExecute.remove(req) @@ -350,3 +366,9 @@ func (g *GovernanceRulesServerTransport) dispatchOperationResults(req *http.Requ } return resp, nil } + +// set this to conditionally intercept incoming requests to GovernanceRulesServerTransport +var governanceRulesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/healthreports_server.go b/sdk/resourcemanager/security/armsecurity/fake/healthreports_server.go index a6392e906238..cf375ef935b8 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/healthreports_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/healthreports_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -58,23 +55,42 @@ func (h *HealthReportsServerTransport) Do(req *http.Request) (*http.Response, er return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return h.dispatchToMethodFake(req, method) +} - switch method { - case "HealthReportsClient.Get": - resp, err = h.dispatchGet(req) - case "HealthReportsClient.NewListPager": - resp, err = h.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (h *HealthReportsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if healthReportsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = healthReportsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "HealthReportsClient.Get": + res.resp, res.err = h.dispatchGet(req) + case "HealthReportsClient.NewListPager": + res.resp, res.err = h.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (h *HealthReportsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -146,3 +162,9 @@ func (h *HealthReportsServerTransport) dispatchNewListPager(req *http.Request) ( } return resp, nil } + +// set this to conditionally intercept incoming requests to HealthReportsServerTransport +var healthReportsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/informationprotectionpolicies_server.go b/sdk/resourcemanager/security/armsecurity/fake/informationprotectionpolicies_server.go index b7401c808ecc..2e1681989272 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/informationprotectionpolicies_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/informationprotectionpolicies_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -62,25 +59,44 @@ func (i *InformationProtectionPoliciesServerTransport) Do(req *http.Request) (*h return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return i.dispatchToMethodFake(req, method) +} - switch method { - case "InformationProtectionPoliciesClient.CreateOrUpdate": - resp, err = i.dispatchCreateOrUpdate(req) - case "InformationProtectionPoliciesClient.Get": - resp, err = i.dispatchGet(req) - case "InformationProtectionPoliciesClient.NewListPager": - resp, err = i.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (i *InformationProtectionPoliciesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if informationProtectionPoliciesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = informationProtectionPoliciesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "InformationProtectionPoliciesClient.CreateOrUpdate": + res.resp, res.err = i.dispatchCreateOrUpdate(req) + case "InformationProtectionPoliciesClient.Get": + res.resp, res.err = i.dispatchGet(req) + case "InformationProtectionPoliciesClient.NewListPager": + res.resp, res.err = i.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (i *InformationProtectionPoliciesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -201,3 +217,9 @@ func (i *InformationProtectionPoliciesServerTransport) dispatchNewListPager(req } return resp, nil } + +// set this to conditionally intercept incoming requests to InformationProtectionPoliciesServerTransport +var informationProtectionPoliciesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/internal.go b/sdk/resourcemanager/security/armsecurity/fake/internal.go index 40041750dbe9..561a0a7001bf 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/internal.go +++ b/sdk/resourcemanager/security/armsecurity/fake/internal.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -16,6 +13,11 @@ import ( "sync" ) +type result struct { + resp *http.Response + err error +} + type nonRetriableError struct { error } diff --git a/sdk/resourcemanager/security/armsecurity/fake/iotsecuritysolution_server.go b/sdk/resourcemanager/security/armsecurity/fake/iotsecuritysolution_server.go index b04e15637707..c6bcb90a4499 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/iotsecuritysolution_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/iotsecuritysolution_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -76,31 +73,50 @@ func (i *IotSecuritySolutionServerTransport) Do(req *http.Request) (*http.Respon return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return i.dispatchToMethodFake(req, method) +} - switch method { - case "IotSecuritySolutionClient.CreateOrUpdate": - resp, err = i.dispatchCreateOrUpdate(req) - case "IotSecuritySolutionClient.Delete": - resp, err = i.dispatchDelete(req) - case "IotSecuritySolutionClient.Get": - resp, err = i.dispatchGet(req) - case "IotSecuritySolutionClient.NewListByResourceGroupPager": - resp, err = i.dispatchNewListByResourceGroupPager(req) - case "IotSecuritySolutionClient.NewListBySubscriptionPager": - resp, err = i.dispatchNewListBySubscriptionPager(req) - case "IotSecuritySolutionClient.Update": - resp, err = i.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (i *IotSecuritySolutionServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if iotSecuritySolutionServerTransportInterceptor != nil { + res.resp, res.err, intercepted = iotSecuritySolutionServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "IotSecuritySolutionClient.CreateOrUpdate": + res.resp, res.err = i.dispatchCreateOrUpdate(req) + case "IotSecuritySolutionClient.Delete": + res.resp, res.err = i.dispatchDelete(req) + case "IotSecuritySolutionClient.Get": + res.resp, res.err = i.dispatchGet(req) + case "IotSecuritySolutionClient.NewListByResourceGroupPager": + res.resp, res.err = i.dispatchNewListByResourceGroupPager(req) + case "IotSecuritySolutionClient.NewListBySubscriptionPager": + res.resp, res.err = i.dispatchNewListBySubscriptionPager(req) + case "IotSecuritySolutionClient.Update": + res.resp, res.err = i.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (i *IotSecuritySolutionServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -336,3 +352,9 @@ func (i *IotSecuritySolutionServerTransport) dispatchUpdate(req *http.Request) ( } return resp, nil } + +// set this to conditionally intercept incoming requests to IotSecuritySolutionServerTransport +var iotSecuritySolutionServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/iotsecuritysolutionanalytics_server.go b/sdk/resourcemanager/security/armsecurity/fake/iotsecuritysolutionanalytics_server.go index e72af2df67e6..52133eb9b0cc 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/iotsecuritysolutionanalytics_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/iotsecuritysolutionanalytics_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -53,23 +50,42 @@ func (i *IotSecuritySolutionAnalyticsServerTransport) Do(req *http.Request) (*ht return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return i.dispatchToMethodFake(req, method) +} - switch method { - case "IotSecuritySolutionAnalyticsClient.Get": - resp, err = i.dispatchGet(req) - case "IotSecuritySolutionAnalyticsClient.List": - resp, err = i.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (i *IotSecuritySolutionAnalyticsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if iotSecuritySolutionAnalyticsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = iotSecuritySolutionAnalyticsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "IotSecuritySolutionAnalyticsClient.Get": + res.resp, res.err = i.dispatchGet(req) + case "IotSecuritySolutionAnalyticsClient.List": + res.resp, res.err = i.dispatchList(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (i *IotSecuritySolutionAnalyticsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -137,3 +153,9 @@ func (i *IotSecuritySolutionAnalyticsServerTransport) dispatchList(req *http.Req } return resp, nil } + +// set this to conditionally intercept incoming requests to IotSecuritySolutionAnalyticsServerTransport +var iotSecuritySolutionAnalyticsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/iotsecuritysolutionsanalyticsaggregatedalert_server.go b/sdk/resourcemanager/security/armsecurity/fake/iotsecuritysolutionsanalyticsaggregatedalert_server.go index f111382454be..20862115cefe 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/iotsecuritysolutionsanalyticsaggregatedalert_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/iotsecuritysolutionsanalyticsaggregatedalert_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -63,25 +60,44 @@ func (i *IotSecuritySolutionsAnalyticsAggregatedAlertServerTransport) Do(req *ht return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return i.dispatchToMethodFake(req, method) +} - switch method { - case "IotSecuritySolutionsAnalyticsAggregatedAlertClient.Dismiss": - resp, err = i.dispatchDismiss(req) - case "IotSecuritySolutionsAnalyticsAggregatedAlertClient.Get": - resp, err = i.dispatchGet(req) - case "IotSecuritySolutionsAnalyticsAggregatedAlertClient.NewListPager": - resp, err = i.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (i *IotSecuritySolutionsAnalyticsAggregatedAlertServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if iotSecuritySolutionsAnalyticsAggregatedAlertServerTransportInterceptor != nil { + res.resp, res.err, intercepted = iotSecuritySolutionsAnalyticsAggregatedAlertServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "IotSecuritySolutionsAnalyticsAggregatedAlertClient.Dismiss": + res.resp, res.err = i.dispatchDismiss(req) + case "IotSecuritySolutionsAnalyticsAggregatedAlertClient.Get": + res.resp, res.err = i.dispatchGet(req) + case "IotSecuritySolutionsAnalyticsAggregatedAlertClient.NewListPager": + res.resp, res.err = i.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (i *IotSecuritySolutionsAnalyticsAggregatedAlertServerTransport) dispatchDismiss(req *http.Request) (*http.Response, error) { @@ -219,3 +235,9 @@ func (i *IotSecuritySolutionsAnalyticsAggregatedAlertServerTransport) dispatchNe } return resp, nil } + +// set this to conditionally intercept incoming requests to IotSecuritySolutionsAnalyticsAggregatedAlertServerTransport +var iotSecuritySolutionsAnalyticsAggregatedAlertServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/iotsecuritysolutionsanalyticsrecommendation_server.go b/sdk/resourcemanager/security/armsecurity/fake/iotsecuritysolutionsanalyticsrecommendation_server.go index d99b15a61679..bc7669f2fd03 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/iotsecuritysolutionsanalyticsrecommendation_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/iotsecuritysolutionsanalyticsrecommendation_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -59,23 +56,42 @@ func (i *IotSecuritySolutionsAnalyticsRecommendationServerTransport) Do(req *htt return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return i.dispatchToMethodFake(req, method) +} - switch method { - case "IotSecuritySolutionsAnalyticsRecommendationClient.Get": - resp, err = i.dispatchGet(req) - case "IotSecuritySolutionsAnalyticsRecommendationClient.NewListPager": - resp, err = i.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (i *IotSecuritySolutionsAnalyticsRecommendationServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if iotSecuritySolutionsAnalyticsRecommendationServerTransportInterceptor != nil { + res.resp, res.err, intercepted = iotSecuritySolutionsAnalyticsRecommendationServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "IotSecuritySolutionsAnalyticsRecommendationClient.Get": + res.resp, res.err = i.dispatchGet(req) + case "IotSecuritySolutionsAnalyticsRecommendationClient.NewListPager": + res.resp, res.err = i.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (i *IotSecuritySolutionsAnalyticsRecommendationServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -176,3 +192,9 @@ func (i *IotSecuritySolutionsAnalyticsRecommendationServerTransport) dispatchNew } return resp, nil } + +// set this to conditionally intercept incoming requests to IotSecuritySolutionsAnalyticsRecommendationServerTransport +var iotSecuritySolutionsAnalyticsRecommendationServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/jitnetworkaccesspolicies_server.go b/sdk/resourcemanager/security/armsecurity/fake/jitnetworkaccesspolicies_server.go index d2f5091ccb01..9675febadb8c 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/jitnetworkaccesspolicies_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/jitnetworkaccesspolicies_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -88,35 +85,54 @@ func (j *JitNetworkAccessPoliciesServerTransport) Do(req *http.Request) (*http.R return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return j.dispatchToMethodFake(req, method) +} - switch method { - case "JitNetworkAccessPoliciesClient.CreateOrUpdate": - resp, err = j.dispatchCreateOrUpdate(req) - case "JitNetworkAccessPoliciesClient.Delete": - resp, err = j.dispatchDelete(req) - case "JitNetworkAccessPoliciesClient.Get": - resp, err = j.dispatchGet(req) - case "JitNetworkAccessPoliciesClient.Initiate": - resp, err = j.dispatchInitiate(req) - case "JitNetworkAccessPoliciesClient.NewListPager": - resp, err = j.dispatchNewListPager(req) - case "JitNetworkAccessPoliciesClient.NewListByRegionPager": - resp, err = j.dispatchNewListByRegionPager(req) - case "JitNetworkAccessPoliciesClient.NewListByResourceGroupPager": - resp, err = j.dispatchNewListByResourceGroupPager(req) - case "JitNetworkAccessPoliciesClient.NewListByResourceGroupAndRegionPager": - resp, err = j.dispatchNewListByResourceGroupAndRegionPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (j *JitNetworkAccessPoliciesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if jitNetworkAccessPoliciesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = jitNetworkAccessPoliciesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "JitNetworkAccessPoliciesClient.CreateOrUpdate": + res.resp, res.err = j.dispatchCreateOrUpdate(req) + case "JitNetworkAccessPoliciesClient.Delete": + res.resp, res.err = j.dispatchDelete(req) + case "JitNetworkAccessPoliciesClient.Get": + res.resp, res.err = j.dispatchGet(req) + case "JitNetworkAccessPoliciesClient.Initiate": + res.resp, res.err = j.dispatchInitiate(req) + case "JitNetworkAccessPoliciesClient.NewListPager": + res.resp, res.err = j.dispatchNewListPager(req) + case "JitNetworkAccessPoliciesClient.NewListByRegionPager": + res.resp, res.err = j.dispatchNewListByRegionPager(req) + case "JitNetworkAccessPoliciesClient.NewListByResourceGroupPager": + res.resp, res.err = j.dispatchNewListByResourceGroupPager(req) + case "JitNetworkAccessPoliciesClient.NewListByResourceGroupAndRegionPager": + res.resp, res.err = j.dispatchNewListByResourceGroupAndRegionPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (j *JitNetworkAccessPoliciesServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -422,3 +438,9 @@ func (j *JitNetworkAccessPoliciesServerTransport) dispatchNewListByResourceGroup } return resp, nil } + +// set this to conditionally intercept incoming requests to JitNetworkAccessPoliciesServerTransport +var jitNetworkAccessPoliciesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/locations_server.go b/sdk/resourcemanager/security/armsecurity/fake/locations_server.go index 2499d9eb0c06..0488a24db520 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/locations_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/locations_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -58,23 +55,42 @@ func (l *LocationsServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return l.dispatchToMethodFake(req, method) +} - switch method { - case "LocationsClient.Get": - resp, err = l.dispatchGet(req) - case "LocationsClient.NewListPager": - resp, err = l.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (l *LocationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if locationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = locationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "LocationsClient.Get": + res.resp, res.err = l.dispatchGet(req) + case "LocationsClient.NewListPager": + res.resp, res.err = l.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (l *LocationsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -138,3 +154,9 @@ func (l *LocationsServerTransport) dispatchNewListPager(req *http.Request) (*htt } return resp, nil } + +// set this to conditionally intercept incoming requests to LocationsServerTransport +var locationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/mdeonboardings_server.go b/sdk/resourcemanager/security/armsecurity/fake/mdeonboardings_server.go index 51729b233301..66e48be4955e 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/mdeonboardings_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/mdeonboardings_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -52,23 +49,42 @@ func (m *MdeOnboardingsServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return m.dispatchToMethodFake(req, method) +} - switch method { - case "MdeOnboardingsClient.Get": - resp, err = m.dispatchGet(req) - case "MdeOnboardingsClient.List": - resp, err = m.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (m *MdeOnboardingsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if mdeOnboardingsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = mdeOnboardingsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "MdeOnboardingsClient.Get": + res.resp, res.err = m.dispatchGet(req) + case "MdeOnboardingsClient.List": + res.resp, res.err = m.dispatchList(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (m *MdeOnboardingsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -120,3 +136,9 @@ func (m *MdeOnboardingsServerTransport) dispatchList(req *http.Request) (*http.R } return resp, nil } + +// set this to conditionally intercept incoming requests to MdeOnboardingsServerTransport +var mdeOnboardingsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/operations_server.go b/sdk/resourcemanager/security/armsecurity/fake/operations_server.go index c4bd7d723bba..54ae613cc588 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/operations_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/operations_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -51,21 +48,40 @@ func (o *OperationsServerTransport) Do(req *http.Request) (*http.Response, error return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return o.dispatchToMethodFake(req, method) +} - switch method { - case "OperationsClient.NewListPager": - resp, err = o.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (o *OperationsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if operationsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operationsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperationsClient.NewListPager": + res.resp, res.err = o.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -94,3 +110,9 @@ func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*ht } return resp, nil } + +// set this to conditionally intercept incoming requests to OperationsServerTransport +var operationsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/operators_server.go b/sdk/resourcemanager/security/armsecurity/fake/operators_server.go index 2e00229c0d38..79b6e000aa33 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/operators_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/operators_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -61,27 +58,46 @@ func (o *OperatorsServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "OperatorsClient.CreateOrUpdate": - resp, err = o.dispatchCreateOrUpdate(req) - case "OperatorsClient.Delete": - resp, err = o.dispatchDelete(req) - case "OperatorsClient.Get": - resp, err = o.dispatchGet(req) - case "OperatorsClient.List": - resp, err = o.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return o.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err +func (o *OperatorsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if operatorsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = operatorsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "OperatorsClient.CreateOrUpdate": + res.resp, res.err = o.dispatchCreateOrUpdate(req) + case "OperatorsClient.Delete": + res.resp, res.err = o.dispatchDelete(req) + case "OperatorsClient.Get": + res.resp, res.err = o.dispatchGet(req) + case "OperatorsClient.List": + res.resp, res.err = o.dispatchList(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - - return resp, nil } func (o *OperatorsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -211,3 +227,9 @@ func (o *OperatorsServerTransport) dispatchList(req *http.Request) (*http.Respon } return resp, nil } + +// set this to conditionally intercept incoming requests to OperatorsServerTransport +var operatorsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/polymorphic_helpers.go b/sdk/resourcemanager/security/armsecurity/fake/polymorphic_helpers.go index 39cc59321940..e7144a32b921 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/polymorphic_helpers.go +++ b/sdk/resourcemanager/security/armsecurity/fake/polymorphic_helpers.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. diff --git a/sdk/resourcemanager/security/armsecurity/fake/pricings_server.go b/sdk/resourcemanager/security/armsecurity/fake/pricings_server.go index 4b3546990e24..1da3f2cab484 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/pricings_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/pricings_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -61,27 +58,46 @@ func (p *PricingsServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return p.dispatchToMethodFake(req, method) +} - switch method { - case "PricingsClient.Delete": - resp, err = p.dispatchDelete(req) - case "PricingsClient.Get": - resp, err = p.dispatchGet(req) - case "PricingsClient.List": - resp, err = p.dispatchList(req) - case "PricingsClient.Update": - resp, err = p.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (p *PricingsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if pricingsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = pricingsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "PricingsClient.Delete": + res.resp, res.err = p.dispatchDelete(req) + case "PricingsClient.Get": + res.resp, res.err = p.dispatchGet(req) + case "PricingsClient.List": + res.resp, res.err = p.dispatchList(req) + case "PricingsClient.Update": + res.resp, res.err = p.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (p *PricingsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { @@ -227,3 +243,9 @@ func (p *PricingsServerTransport) dispatchUpdate(req *http.Request) (*http.Respo } return resp, nil } + +// set this to conditionally intercept incoming requests to PricingsServerTransport +var pricingsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/regulatorycomplianceassessments_server.go b/sdk/resourcemanager/security/armsecurity/fake/regulatorycomplianceassessments_server.go index 3ad46f025b9d..fd13e9a2d00f 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/regulatorycomplianceassessments_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/regulatorycomplianceassessments_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -58,23 +55,42 @@ func (r *RegulatoryComplianceAssessmentsServerTransport) Do(req *http.Request) ( return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return r.dispatchToMethodFake(req, method) +} - switch method { - case "RegulatoryComplianceAssessmentsClient.Get": - resp, err = r.dispatchGet(req) - case "RegulatoryComplianceAssessmentsClient.NewListPager": - resp, err = r.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (r *RegulatoryComplianceAssessmentsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if regulatoryComplianceAssessmentsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = regulatoryComplianceAssessmentsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "RegulatoryComplianceAssessmentsClient.Get": + res.resp, res.err = r.dispatchGet(req) + case "RegulatoryComplianceAssessmentsClient.NewListPager": + res.resp, res.err = r.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (r *RegulatoryComplianceAssessmentsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -166,3 +182,9 @@ func (r *RegulatoryComplianceAssessmentsServerTransport) dispatchNewListPager(re } return resp, nil } + +// set this to conditionally intercept incoming requests to RegulatoryComplianceAssessmentsServerTransport +var regulatoryComplianceAssessmentsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/regulatorycompliancecontrols_server.go b/sdk/resourcemanager/security/armsecurity/fake/regulatorycompliancecontrols_server.go index 3e12e55f8f37..fb1ba0364002 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/regulatorycompliancecontrols_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/regulatorycompliancecontrols_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -58,23 +55,42 @@ func (r *RegulatoryComplianceControlsServerTransport) Do(req *http.Request) (*ht return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return r.dispatchToMethodFake(req, method) +} - switch method { - case "RegulatoryComplianceControlsClient.Get": - resp, err = r.dispatchGet(req) - case "RegulatoryComplianceControlsClient.NewListPager": - resp, err = r.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (r *RegulatoryComplianceControlsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if regulatoryComplianceControlsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = regulatoryComplianceControlsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "RegulatoryComplianceControlsClient.Get": + res.resp, res.err = r.dispatchGet(req) + case "RegulatoryComplianceControlsClient.NewListPager": + res.resp, res.err = r.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (r *RegulatoryComplianceControlsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -158,3 +174,9 @@ func (r *RegulatoryComplianceControlsServerTransport) dispatchNewListPager(req * } return resp, nil } + +// set this to conditionally intercept incoming requests to RegulatoryComplianceControlsServerTransport +var regulatoryComplianceControlsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/regulatorycompliancestandards_server.go b/sdk/resourcemanager/security/armsecurity/fake/regulatorycompliancestandards_server.go index 6f5fe6abb5a0..02be87a2e820 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/regulatorycompliancestandards_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/regulatorycompliancestandards_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -58,23 +55,42 @@ func (r *RegulatoryComplianceStandardsServerTransport) Do(req *http.Request) (*h return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return r.dispatchToMethodFake(req, method) +} - switch method { - case "RegulatoryComplianceStandardsClient.Get": - resp, err = r.dispatchGet(req) - case "RegulatoryComplianceStandardsClient.NewListPager": - resp, err = r.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (r *RegulatoryComplianceStandardsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if regulatoryComplianceStandardsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = regulatoryComplianceStandardsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "RegulatoryComplianceStandardsClient.Get": + res.resp, res.err = r.dispatchGet(req) + case "RegulatoryComplianceStandardsClient.NewListPager": + res.resp, res.err = r.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (r *RegulatoryComplianceStandardsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -150,3 +166,9 @@ func (r *RegulatoryComplianceStandardsServerTransport) dispatchNewListPager(req } return resp, nil } + +// set this to conditionally intercept incoming requests to RegulatoryComplianceStandardsServerTransport +var regulatoryComplianceStandardsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/securescorecontroldefinitions_server.go b/sdk/resourcemanager/security/armsecurity/fake/securescorecontroldefinitions_server.go index cb8c5f14c327..f5361b17e9b0 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/securescorecontroldefinitions_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/securescorecontroldefinitions_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -58,23 +55,42 @@ func (s *SecureScoreControlDefinitionsServerTransport) Do(req *http.Request) (*h return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SecureScoreControlDefinitionsClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - case "SecureScoreControlDefinitionsClient.NewListBySubscriptionPager": - resp, err = s.dispatchNewListBySubscriptionPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SecureScoreControlDefinitionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if secureScoreControlDefinitionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = secureScoreControlDefinitionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SecureScoreControlDefinitionsClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + case "SecureScoreControlDefinitionsClient.NewListBySubscriptionPager": + res.resp, res.err = s.dispatchNewListBySubscriptionPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SecureScoreControlDefinitionsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -136,3 +152,9 @@ func (s *SecureScoreControlDefinitionsServerTransport) dispatchNewListBySubscrip } return resp, nil } + +// set this to conditionally intercept incoming requests to SecureScoreControlDefinitionsServerTransport +var secureScoreControlDefinitionsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/securescorecontrols_server.go b/sdk/resourcemanager/security/armsecurity/fake/securescorecontrols_server.go index 1878ffc37202..b660016f89b5 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/securescorecontrols_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/securescorecontrols_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -59,23 +56,42 @@ func (s *SecureScoreControlsServerTransport) Do(req *http.Request) (*http.Respon return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SecureScoreControlsClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - case "SecureScoreControlsClient.NewListBySecureScorePager": - resp, err = s.dispatchNewListBySecureScorePager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SecureScoreControlsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if secureScoreControlsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = secureScoreControlsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SecureScoreControlsClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + case "SecureScoreControlsClient.NewListBySecureScorePager": + res.resp, res.err = s.dispatchNewListBySecureScorePager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SecureScoreControlsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { @@ -171,3 +187,9 @@ func (s *SecureScoreControlsServerTransport) dispatchNewListBySecureScorePager(r } return resp, nil } + +// set this to conditionally intercept incoming requests to SecureScoreControlsServerTransport +var secureScoreControlsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/securescores_server.go b/sdk/resourcemanager/security/armsecurity/fake/securescores_server.go index bb3d57aefbf0..45f8139ce3f5 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/securescores_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/securescores_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -58,23 +55,42 @@ func (s *SecureScoresServerTransport) Do(req *http.Request) (*http.Response, err return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SecureScoresClient.Get": - resp, err = s.dispatchGet(req) - case "SecureScoresClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SecureScoresServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if secureScoresServerTransportInterceptor != nil { + res.resp, res.err, intercepted = secureScoresServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SecureScoresClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SecureScoresClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SecureScoresServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -138,3 +154,9 @@ func (s *SecureScoresServerTransport) dispatchNewListPager(req *http.Request) (* } return resp, nil } + +// set this to conditionally intercept incoming requests to SecureScoresServerTransport +var secureScoresServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/sensitivitysettings_server.go b/sdk/resourcemanager/security/armsecurity/fake/sensitivitysettings_server.go index 72c977be612d..96d4a638a94c 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/sensitivitysettings_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/sensitivitysettings_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -55,25 +52,44 @@ func (s *SensitivitySettingsServerTransport) Do(req *http.Request) (*http.Respon return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error - - switch method { - case "SensitivitySettingsClient.CreateOrUpdate": - resp, err = s.dispatchCreateOrUpdate(req) - case "SensitivitySettingsClient.Get": - resp, err = s.dispatchGet(req) - case "SensitivitySettingsClient.List": - resp, err = s.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } + return s.dispatchToMethodFake(req, method) +} - if err != nil { - return nil, err +func (s *SensitivitySettingsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if sensitivitySettingsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = sensitivitySettingsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SensitivitySettingsClient.CreateOrUpdate": + res.resp, res.err = s.dispatchCreateOrUpdate(req) + case "SensitivitySettingsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SensitivitySettingsClient.List": + res.resp, res.err = s.dispatchList(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err } - - return resp, nil } func (s *SensitivitySettingsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -136,3 +152,9 @@ func (s *SensitivitySettingsServerTransport) dispatchList(req *http.Request) (*h } return resp, nil } + +// set this to conditionally intercept incoming requests to SensitivitySettingsServerTransport +var sensitivitySettingsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/server_factory.go b/sdk/resourcemanager/security/armsecurity/fake/server_factory.go index 8925f6234015..f6e4bc6e840f 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/server_factory.go +++ b/sdk/resourcemanager/security/armsecurity/fake/server_factory.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -19,76 +16,218 @@ import ( // ServerFactory is a fake server for instances of the armsecurity.ClientFactory type. type ServerFactory struct { - APICollectionsServer APICollectionsServer - AccountConnectorsServer AccountConnectorsServer - AdaptiveApplicationControlsServer AdaptiveApplicationControlsServer - AdaptiveNetworkHardeningsServer AdaptiveNetworkHardeningsServer - AdvancedThreatProtectionServer AdvancedThreatProtectionServer - AlertsServer AlertsServer - AlertsSuppressionRulesServer AlertsSuppressionRulesServer - AllowedConnectionsServer AllowedConnectionsServer - ApplicationServer ApplicationServer - ApplicationsServer ApplicationsServer - AssessmentsServer AssessmentsServer - AssessmentsMetadataServer AssessmentsMetadataServer - AutoProvisioningSettingsServer AutoProvisioningSettingsServer - AutomationsServer AutomationsServer - AzureDevOpsOrgsServer AzureDevOpsOrgsServer - AzureDevOpsProjectsServer AzureDevOpsProjectsServer - AzureDevOpsReposServer AzureDevOpsReposServer - ComplianceResultsServer ComplianceResultsServer - CompliancesServer CompliancesServer - ConnectorApplicationServer ConnectorApplicationServer - ConnectorApplicationsServer ConnectorApplicationsServer - ConnectorsServer ConnectorsServer - ContactsServer ContactsServer - CustomAssessmentAutomationsServer CustomAssessmentAutomationsServer - CustomEntityStoreAssignmentsServer CustomEntityStoreAssignmentsServer - DefenderForStorageServer DefenderForStorageServer - DevOpsConfigurationsServer DevOpsConfigurationsServer - DevOpsOperationResultsServer DevOpsOperationResultsServer - DeviceSecurityGroupsServer DeviceSecurityGroupsServer - DiscoveredSecuritySolutionsServer DiscoveredSecuritySolutionsServer - ExternalSecuritySolutionsServer ExternalSecuritySolutionsServer - GitHubOwnersServer GitHubOwnersServer - GitHubReposServer GitHubReposServer - GitLabGroupsServer GitLabGroupsServer - GitLabProjectsServer GitLabProjectsServer - GitLabSubgroupsServer GitLabSubgroupsServer - GovernanceAssignmentsServer GovernanceAssignmentsServer - GovernanceRulesServer GovernanceRulesServer - HealthReportsServer HealthReportsServer - InformationProtectionPoliciesServer InformationProtectionPoliciesServer - IotSecuritySolutionAnalyticsServer IotSecuritySolutionAnalyticsServer - IotSecuritySolutionServer IotSecuritySolutionServer + // APICollectionsServer contains the fakes for client APICollectionsClient + APICollectionsServer APICollectionsServer + + // AccountConnectorsServer contains the fakes for client AccountConnectorsClient + AccountConnectorsServer AccountConnectorsServer + + // AdvancedThreatProtectionServer contains the fakes for client AdvancedThreatProtectionClient + AdvancedThreatProtectionServer AdvancedThreatProtectionServer + + // AlertsServer contains the fakes for client AlertsClient + AlertsServer AlertsServer + + // AlertsSuppressionRulesServer contains the fakes for client AlertsSuppressionRulesClient + AlertsSuppressionRulesServer AlertsSuppressionRulesServer + + // AllowedConnectionsServer contains the fakes for client AllowedConnectionsClient + AllowedConnectionsServer AllowedConnectionsServer + + // ApplicationServer contains the fakes for client ApplicationClient + ApplicationServer ApplicationServer + + // ApplicationsServer contains the fakes for client ApplicationsClient + ApplicationsServer ApplicationsServer + + // AssessmentsServer contains the fakes for client AssessmentsClient + AssessmentsServer AssessmentsServer + + // AssessmentsMetadataServer contains the fakes for client AssessmentsMetadataClient + AssessmentsMetadataServer AssessmentsMetadataServer + + // AutoProvisioningSettingsServer contains the fakes for client AutoProvisioningSettingsClient + AutoProvisioningSettingsServer AutoProvisioningSettingsServer + + // AutomationsServer contains the fakes for client AutomationsClient + AutomationsServer AutomationsServer + + // AzureDevOpsOrgsServer contains the fakes for client AzureDevOpsOrgsClient + AzureDevOpsOrgsServer AzureDevOpsOrgsServer + + // AzureDevOpsProjectsServer contains the fakes for client AzureDevOpsProjectsClient + AzureDevOpsProjectsServer AzureDevOpsProjectsServer + + // AzureDevOpsReposServer contains the fakes for client AzureDevOpsReposClient + AzureDevOpsReposServer AzureDevOpsReposServer + + // ComplianceResultsServer contains the fakes for client ComplianceResultsClient + ComplianceResultsServer ComplianceResultsServer + + // CompliancesServer contains the fakes for client CompliancesClient + CompliancesServer CompliancesServer + + // ConnectorApplicationServer contains the fakes for client ConnectorApplicationClient + ConnectorApplicationServer ConnectorApplicationServer + + // ConnectorApplicationsServer contains the fakes for client ConnectorApplicationsClient + ConnectorApplicationsServer ConnectorApplicationsServer + + // ConnectorsServer contains the fakes for client ConnectorsClient + ConnectorsServer ConnectorsServer + + // ContactsServer contains the fakes for client ContactsClient + ContactsServer ContactsServer + + // CustomAssessmentAutomationsServer contains the fakes for client CustomAssessmentAutomationsClient + CustomAssessmentAutomationsServer CustomAssessmentAutomationsServer + + // CustomEntityStoreAssignmentsServer contains the fakes for client CustomEntityStoreAssignmentsClient + CustomEntityStoreAssignmentsServer CustomEntityStoreAssignmentsServer + + // CustomRecommendationsServer contains the fakes for client CustomRecommendationsClient + CustomRecommendationsServer CustomRecommendationsServer + + // DefenderForStorageServer contains the fakes for client DefenderForStorageClient + DefenderForStorageServer DefenderForStorageServer + + // DevOpsConfigurationsServer contains the fakes for client DevOpsConfigurationsClient + DevOpsConfigurationsServer DevOpsConfigurationsServer + + // DevOpsOperationResultsServer contains the fakes for client DevOpsOperationResultsClient + DevOpsOperationResultsServer DevOpsOperationResultsServer + + // DeviceSecurityGroupsServer contains the fakes for client DeviceSecurityGroupsClient + DeviceSecurityGroupsServer DeviceSecurityGroupsServer + + // DiscoveredSecuritySolutionsServer contains the fakes for client DiscoveredSecuritySolutionsClient + DiscoveredSecuritySolutionsServer DiscoveredSecuritySolutionsServer + + // ExternalSecuritySolutionsServer contains the fakes for client ExternalSecuritySolutionsClient + ExternalSecuritySolutionsServer ExternalSecuritySolutionsServer + + // GitHubOwnersServer contains the fakes for client GitHubOwnersClient + GitHubOwnersServer GitHubOwnersServer + + // GitHubReposServer contains the fakes for client GitHubReposClient + GitHubReposServer GitHubReposServer + + // GitLabGroupsServer contains the fakes for client GitLabGroupsClient + GitLabGroupsServer GitLabGroupsServer + + // GitLabProjectsServer contains the fakes for client GitLabProjectsClient + GitLabProjectsServer GitLabProjectsServer + + // GitLabSubgroupsServer contains the fakes for client GitLabSubgroupsClient + GitLabSubgroupsServer GitLabSubgroupsServer + + // GovernanceAssignmentsServer contains the fakes for client GovernanceAssignmentsClient + GovernanceAssignmentsServer GovernanceAssignmentsServer + + // GovernanceRulesServer contains the fakes for client GovernanceRulesClient + GovernanceRulesServer GovernanceRulesServer + + // HealthReportsServer contains the fakes for client HealthReportsClient + HealthReportsServer HealthReportsServer + + // InformationProtectionPoliciesServer contains the fakes for client InformationProtectionPoliciesClient + InformationProtectionPoliciesServer InformationProtectionPoliciesServer + + // IotSecuritySolutionAnalyticsServer contains the fakes for client IotSecuritySolutionAnalyticsClient + IotSecuritySolutionAnalyticsServer IotSecuritySolutionAnalyticsServer + + // IotSecuritySolutionServer contains the fakes for client IotSecuritySolutionClient + IotSecuritySolutionServer IotSecuritySolutionServer + + // IotSecuritySolutionsAnalyticsAggregatedAlertServer contains the fakes for client IotSecuritySolutionsAnalyticsAggregatedAlertClient IotSecuritySolutionsAnalyticsAggregatedAlertServer IotSecuritySolutionsAnalyticsAggregatedAlertServer - IotSecuritySolutionsAnalyticsRecommendationServer IotSecuritySolutionsAnalyticsRecommendationServer - JitNetworkAccessPoliciesServer JitNetworkAccessPoliciesServer - LocationsServer LocationsServer - MdeOnboardingsServer MdeOnboardingsServer - OperationsServer OperationsServer - OperatorsServer OperatorsServer - PricingsServer PricingsServer - RegulatoryComplianceAssessmentsServer RegulatoryComplianceAssessmentsServer - RegulatoryComplianceControlsServer RegulatoryComplianceControlsServer - RegulatoryComplianceStandardsServer RegulatoryComplianceStandardsServer - SQLVulnerabilityAssessmentBaselineRulesServer SQLVulnerabilityAssessmentBaselineRulesServer - SQLVulnerabilityAssessmentScanResultsServer SQLVulnerabilityAssessmentScanResultsServer - SQLVulnerabilityAssessmentScansServer SQLVulnerabilityAssessmentScansServer - SecureScoreControlDefinitionsServer SecureScoreControlDefinitionsServer - SecureScoreControlsServer SecureScoreControlsServer - SecureScoresServer SecureScoresServer - SensitivitySettingsServer SensitivitySettingsServer - ServerVulnerabilityAssessmentServer ServerVulnerabilityAssessmentServer - ServerVulnerabilityAssessmentsSettingsServer ServerVulnerabilityAssessmentsSettingsServer - SettingsServer SettingsServer - SoftwareInventoriesServer SoftwareInventoriesServer - SolutionsServer SolutionsServer - SolutionsReferenceDataServer SolutionsReferenceDataServer - SubAssessmentsServer SubAssessmentsServer - TasksServer TasksServer - TopologyServer TopologyServer - WorkspaceSettingsServer WorkspaceSettingsServer + + // IotSecuritySolutionsAnalyticsRecommendationServer contains the fakes for client IotSecuritySolutionsAnalyticsRecommendationClient + IotSecuritySolutionsAnalyticsRecommendationServer IotSecuritySolutionsAnalyticsRecommendationServer + + // JitNetworkAccessPoliciesServer contains the fakes for client JitNetworkAccessPoliciesClient + JitNetworkAccessPoliciesServer JitNetworkAccessPoliciesServer + + // LocationsServer contains the fakes for client LocationsClient + LocationsServer LocationsServer + + // MdeOnboardingsServer contains the fakes for client MdeOnboardingsClient + MdeOnboardingsServer MdeOnboardingsServer + + // OperationsServer contains the fakes for client OperationsClient + OperationsServer OperationsServer + + // OperatorsServer contains the fakes for client OperatorsClient + OperatorsServer OperatorsServer + + // PricingsServer contains the fakes for client PricingsClient + PricingsServer PricingsServer + + // RegulatoryComplianceAssessmentsServer contains the fakes for client RegulatoryComplianceAssessmentsClient + RegulatoryComplianceAssessmentsServer RegulatoryComplianceAssessmentsServer + + // RegulatoryComplianceControlsServer contains the fakes for client RegulatoryComplianceControlsClient + RegulatoryComplianceControlsServer RegulatoryComplianceControlsServer + + // RegulatoryComplianceStandardsServer contains the fakes for client RegulatoryComplianceStandardsClient + RegulatoryComplianceStandardsServer RegulatoryComplianceStandardsServer + + // SQLVulnerabilityAssessmentBaselineRulesServer contains the fakes for client SQLVulnerabilityAssessmentBaselineRulesClient + SQLVulnerabilityAssessmentBaselineRulesServer SQLVulnerabilityAssessmentBaselineRulesServer + + // SQLVulnerabilityAssessmentScanResultsServer contains the fakes for client SQLVulnerabilityAssessmentScanResultsClient + SQLVulnerabilityAssessmentScanResultsServer SQLVulnerabilityAssessmentScanResultsServer + + // SQLVulnerabilityAssessmentScansServer contains the fakes for client SQLVulnerabilityAssessmentScansClient + SQLVulnerabilityAssessmentScansServer SQLVulnerabilityAssessmentScansServer + + // SecureScoreControlDefinitionsServer contains the fakes for client SecureScoreControlDefinitionsClient + SecureScoreControlDefinitionsServer SecureScoreControlDefinitionsServer + + // SecureScoreControlsServer contains the fakes for client SecureScoreControlsClient + SecureScoreControlsServer SecureScoreControlsServer + + // SecureScoresServer contains the fakes for client SecureScoresClient + SecureScoresServer SecureScoresServer + + // SensitivitySettingsServer contains the fakes for client SensitivitySettingsClient + SensitivitySettingsServer SensitivitySettingsServer + + // ServerVulnerabilityAssessmentServer contains the fakes for client ServerVulnerabilityAssessmentClient + ServerVulnerabilityAssessmentServer ServerVulnerabilityAssessmentServer + + // ServerVulnerabilityAssessmentsSettingsServer contains the fakes for client ServerVulnerabilityAssessmentsSettingsClient + ServerVulnerabilityAssessmentsSettingsServer ServerVulnerabilityAssessmentsSettingsServer + + // SettingsServer contains the fakes for client SettingsClient + SettingsServer SettingsServer + + // SoftwareInventoriesServer contains the fakes for client SoftwareInventoriesClient + SoftwareInventoriesServer SoftwareInventoriesServer + + // SolutionsServer contains the fakes for client SolutionsClient + SolutionsServer SolutionsServer + + // SolutionsReferenceDataServer contains the fakes for client SolutionsReferenceDataClient + SolutionsReferenceDataServer SolutionsReferenceDataServer + + // StandardAssignmentsServer contains the fakes for client StandardAssignmentsClient + StandardAssignmentsServer StandardAssignmentsServer + + // StandardsServer contains the fakes for client StandardsClient + StandardsServer StandardsServer + + // SubAssessmentsServer contains the fakes for client SubAssessmentsClient + SubAssessmentsServer SubAssessmentsServer + + // TasksServer contains the fakes for client TasksClient + TasksServer TasksServer + + // TopologyServer contains the fakes for client TopologyClient + TopologyServer TopologyServer + + // WorkspaceSettingsServer contains the fakes for client WorkspaceSettingsClient + WorkspaceSettingsServer WorkspaceSettingsServer } // NewServerFactoryTransport creates a new instance of ServerFactoryTransport with the provided implementation. @@ -107,8 +246,6 @@ type ServerFactoryTransport struct { trMu sync.Mutex trAPICollectionsServer *APICollectionsServerTransport trAccountConnectorsServer *AccountConnectorsServerTransport - trAdaptiveApplicationControlsServer *AdaptiveApplicationControlsServerTransport - trAdaptiveNetworkHardeningsServer *AdaptiveNetworkHardeningsServerTransport trAdvancedThreatProtectionServer *AdvancedThreatProtectionServerTransport trAlertsServer *AlertsServerTransport trAlertsSuppressionRulesServer *AlertsSuppressionRulesServerTransport @@ -130,6 +267,7 @@ type ServerFactoryTransport struct { trContactsServer *ContactsServerTransport trCustomAssessmentAutomationsServer *CustomAssessmentAutomationsServerTransport trCustomEntityStoreAssignmentsServer *CustomEntityStoreAssignmentsServerTransport + trCustomRecommendationsServer *CustomRecommendationsServerTransport trDefenderForStorageServer *DefenderForStorageServerTransport trDevOpsConfigurationsServer *DevOpsConfigurationsServerTransport trDevOpsOperationResultsServer *DevOpsOperationResultsServerTransport @@ -171,6 +309,8 @@ type ServerFactoryTransport struct { trSoftwareInventoriesServer *SoftwareInventoriesServerTransport trSolutionsServer *SolutionsServerTransport trSolutionsReferenceDataServer *SolutionsReferenceDataServerTransport + trStandardAssignmentsServer *StandardAssignmentsServerTransport + trStandardsServer *StandardsServerTransport trSubAssessmentsServer *SubAssessmentsServerTransport trTasksServer *TasksServerTransport trTopologyServer *TopologyServerTransport @@ -200,16 +340,6 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewAccountConnectorsServerTransport(&s.srv.AccountConnectorsServer) }) resp, err = s.trAccountConnectorsServer.Do(req) - case "AdaptiveApplicationControlsClient": - initServer(s, &s.trAdaptiveApplicationControlsServer, func() *AdaptiveApplicationControlsServerTransport { - return NewAdaptiveApplicationControlsServerTransport(&s.srv.AdaptiveApplicationControlsServer) - }) - resp, err = s.trAdaptiveApplicationControlsServer.Do(req) - case "AdaptiveNetworkHardeningsClient": - initServer(s, &s.trAdaptiveNetworkHardeningsServer, func() *AdaptiveNetworkHardeningsServerTransport { - return NewAdaptiveNetworkHardeningsServerTransport(&s.srv.AdaptiveNetworkHardeningsServer) - }) - resp, err = s.trAdaptiveNetworkHardeningsServer.Do(req) case "AdvancedThreatProtectionClient": initServer(s, &s.trAdvancedThreatProtectionServer, func() *AdvancedThreatProtectionServerTransport { return NewAdvancedThreatProtectionServerTransport(&s.srv.AdvancedThreatProtectionServer) @@ -299,6 +429,11 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewCustomEntityStoreAssignmentsServerTransport(&s.srv.CustomEntityStoreAssignmentsServer) }) resp, err = s.trCustomEntityStoreAssignmentsServer.Do(req) + case "CustomRecommendationsClient": + initServer(s, &s.trCustomRecommendationsServer, func() *CustomRecommendationsServerTransport { + return NewCustomRecommendationsServerTransport(&s.srv.CustomRecommendationsServer) + }) + resp, err = s.trCustomRecommendationsServer.Do(req) case "DefenderForStorageClient": initServer(s, &s.trDefenderForStorageServer, func() *DefenderForStorageServerTransport { return NewDefenderForStorageServerTransport(&s.srv.DefenderForStorageServer) @@ -484,6 +619,14 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewSolutionsReferenceDataServerTransport(&s.srv.SolutionsReferenceDataServer) }) resp, err = s.trSolutionsReferenceDataServer.Do(req) + case "StandardAssignmentsClient": + initServer(s, &s.trStandardAssignmentsServer, func() *StandardAssignmentsServerTransport { + return NewStandardAssignmentsServerTransport(&s.srv.StandardAssignmentsServer) + }) + resp, err = s.trStandardAssignmentsServer.Do(req) + case "StandardsClient": + initServer(s, &s.trStandardsServer, func() *StandardsServerTransport { return NewStandardsServerTransport(&s.srv.StandardsServer) }) + resp, err = s.trStandardsServer.Do(req) case "SubAssessmentsClient": initServer(s, &s.trSubAssessmentsServer, func() *SubAssessmentsServerTransport { return NewSubAssessmentsServerTransport(&s.srv.SubAssessmentsServer) diff --git a/sdk/resourcemanager/security/armsecurity/fake/servervulnerabilityassessment_server.go b/sdk/resourcemanager/security/armsecurity/fake/servervulnerabilityassessment_server.go index dec766753e12..e405846f2287 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/servervulnerabilityassessment_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/servervulnerabilityassessment_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -65,27 +62,46 @@ func (s *ServerVulnerabilityAssessmentServerTransport) Do(req *http.Request) (*h return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "ServerVulnerabilityAssessmentClient.CreateOrUpdate": - resp, err = s.dispatchCreateOrUpdate(req) - case "ServerVulnerabilityAssessmentClient.BeginDelete": - resp, err = s.dispatchBeginDelete(req) - case "ServerVulnerabilityAssessmentClient.Get": - resp, err = s.dispatchGet(req) - case "ServerVulnerabilityAssessmentClient.ListByExtendedResource": - resp, err = s.dispatchListByExtendedResource(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *ServerVulnerabilityAssessmentServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if serverVulnerabilityAssessmentServerTransportInterceptor != nil { + res.resp, res.err, intercepted = serverVulnerabilityAssessmentServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ServerVulnerabilityAssessmentClient.CreateOrUpdate": + res.resp, res.err = s.dispatchCreateOrUpdate(req) + case "ServerVulnerabilityAssessmentClient.BeginDelete": + res.resp, res.err = s.dispatchBeginDelete(req) + case "ServerVulnerabilityAssessmentClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "ServerVulnerabilityAssessmentClient.ListByExtendedResource": + res.resp, res.err = s.dispatchListByExtendedResource(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *ServerVulnerabilityAssessmentServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -262,3 +278,9 @@ func (s *ServerVulnerabilityAssessmentServerTransport) dispatchListByExtendedRes } return resp, nil } + +// set this to conditionally intercept incoming requests to ServerVulnerabilityAssessmentServerTransport +var serverVulnerabilityAssessmentServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/servervulnerabilityassessmentssettings_server.go b/sdk/resourcemanager/security/armsecurity/fake/servervulnerabilityassessmentssettings_server.go index 1b38b9a20580..ba27ae225165 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/servervulnerabilityassessmentssettings_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/servervulnerabilityassessmentssettings_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -66,27 +63,46 @@ func (s *ServerVulnerabilityAssessmentsSettingsServerTransport) Do(req *http.Req return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "ServerVulnerabilityAssessmentsSettingsClient.CreateOrUpdate": - resp, err = s.dispatchCreateOrUpdate(req) - case "ServerVulnerabilityAssessmentsSettingsClient.Delete": - resp, err = s.dispatchDelete(req) - case "ServerVulnerabilityAssessmentsSettingsClient.Get": - resp, err = s.dispatchGet(req) - case "ServerVulnerabilityAssessmentsSettingsClient.NewListBySubscriptionPager": - resp, err = s.dispatchNewListBySubscriptionPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *ServerVulnerabilityAssessmentsSettingsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if serverVulnerabilityAssessmentsSettingsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = serverVulnerabilityAssessmentsSettingsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "ServerVulnerabilityAssessmentsSettingsClient.CreateOrUpdate": + res.resp, res.err = s.dispatchCreateOrUpdate(req) + case "ServerVulnerabilityAssessmentsSettingsClient.Delete": + res.resp, res.err = s.dispatchDelete(req) + case "ServerVulnerabilityAssessmentsSettingsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "ServerVulnerabilityAssessmentsSettingsClient.NewListBySubscriptionPager": + res.resp, res.err = s.dispatchNewListBySubscriptionPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *ServerVulnerabilityAssessmentsSettingsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { @@ -234,3 +250,9 @@ func (s *ServerVulnerabilityAssessmentsSettingsServerTransport) dispatchNewListB } return resp, nil } + +// set this to conditionally intercept incoming requests to ServerVulnerabilityAssessmentsSettingsServerTransport +var serverVulnerabilityAssessmentsSettingsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/settings_server.go b/sdk/resourcemanager/security/armsecurity/fake/settings_server.go index 2cfbe5e67dda..123254929341 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/settings_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/settings_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -26,7 +23,7 @@ import ( type SettingsServer struct { // Get is the fake for method SettingsClient.Get // HTTP status codes to indicate success: http.StatusOK - Get func(ctx context.Context, settingName armsecurity.SettingNameAutoGenerated, options *armsecurity.SettingsClientGetOptions) (resp azfake.Responder[armsecurity.SettingsClientGetResponse], errResp azfake.ErrorResponder) + Get func(ctx context.Context, settingName armsecurity.SettingName, options *armsecurity.SettingsClientGetOptions) (resp azfake.Responder[armsecurity.SettingsClientGetResponse], errResp azfake.ErrorResponder) // NewListPager is the fake for method SettingsClient.NewListPager // HTTP status codes to indicate success: http.StatusOK @@ -34,7 +31,7 @@ type SettingsServer struct { // Update is the fake for method SettingsClient.Update // HTTP status codes to indicate success: http.StatusOK - Update func(ctx context.Context, settingName armsecurity.SettingNameAutoGenerated, setting armsecurity.SettingClassification, options *armsecurity.SettingsClientUpdateOptions) (resp azfake.Responder[armsecurity.SettingsClientUpdateResponse], errResp azfake.ErrorResponder) + Update func(ctx context.Context, settingName armsecurity.SettingName, setting armsecurity.SettingClassification, options *armsecurity.SettingsClientUpdateOptions) (resp azfake.Responder[armsecurity.SettingsClientUpdateResponse], errResp azfake.ErrorResponder) } // NewSettingsServerTransport creates a new instance of SettingsServerTransport with the provided implementation. @@ -62,25 +59,44 @@ func (s *SettingsServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SettingsClient.Get": - resp, err = s.dispatchGet(req) - case "SettingsClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - case "SettingsClient.Update": - resp, err = s.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SettingsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if settingsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = settingsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SettingsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SettingsClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + case "SettingsClient.Update": + res.resp, res.err = s.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SettingsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -93,12 +109,12 @@ func (s *SettingsServerTransport) dispatchGet(req *http.Request) (*http.Response if matches == nil || len(matches) < 2 { return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } - settingNameParam, err := parseWithCast(matches[regex.SubexpIndex("settingName")], func(v string) (armsecurity.SettingNameAutoGenerated, error) { + settingNameParam, err := parseWithCast(matches[regex.SubexpIndex("settingName")], func(v string) (armsecurity.SettingName, error) { p, unescapeErr := url.PathUnescape(v) if unescapeErr != nil { return "", unescapeErr } - return armsecurity.SettingNameAutoGenerated(p), nil + return armsecurity.SettingName(p), nil }) if err != nil { return nil, err @@ -169,12 +185,12 @@ func (s *SettingsServerTransport) dispatchUpdate(req *http.Request) (*http.Respo if err != nil { return nil, err } - settingNameParam, err := parseWithCast(matches[regex.SubexpIndex("settingName")], func(v string) (armsecurity.SettingNameAutoGenerated, error) { + settingNameParam, err := parseWithCast(matches[regex.SubexpIndex("settingName")], func(v string) (armsecurity.SettingName, error) { p, unescapeErr := url.PathUnescape(v) if unescapeErr != nil { return "", unescapeErr } - return armsecurity.SettingNameAutoGenerated(p), nil + return armsecurity.SettingName(p), nil }) if err != nil { return nil, err @@ -193,3 +209,9 @@ func (s *SettingsServerTransport) dispatchUpdate(req *http.Request) (*http.Respo } return resp, nil } + +// set this to conditionally intercept incoming requests to SettingsServerTransport +var settingsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/softwareinventories_server.go b/sdk/resourcemanager/security/armsecurity/fake/softwareinventories_server.go index 7a8e5248afbc..57533a489373 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/softwareinventories_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/softwareinventories_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -64,25 +61,44 @@ func (s *SoftwareInventoriesServerTransport) Do(req *http.Request) (*http.Respon return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SoftwareInventoriesClient.Get": - resp, err = s.dispatchGet(req) - case "SoftwareInventoriesClient.NewListByExtendedResourcePager": - resp, err = s.dispatchNewListByExtendedResourcePager(req) - case "SoftwareInventoriesClient.NewListBySubscriptionPager": - resp, err = s.dispatchNewListBySubscriptionPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SoftwareInventoriesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if softwareInventoriesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = softwareInventoriesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SoftwareInventoriesClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SoftwareInventoriesClient.NewListByExtendedResourcePager": + res.resp, res.err = s.dispatchNewListByExtendedResourcePager(req) + case "SoftwareInventoriesClient.NewListBySubscriptionPager": + res.resp, res.err = s.dispatchNewListBySubscriptionPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SoftwareInventoriesServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -211,3 +227,9 @@ func (s *SoftwareInventoriesServerTransport) dispatchNewListBySubscriptionPager( } return resp, nil } + +// set this to conditionally intercept incoming requests to SoftwareInventoriesServerTransport +var softwareInventoriesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/solutions_server.go b/sdk/resourcemanager/security/armsecurity/fake/solutions_server.go index b8d72b092a7a..321b96a09633 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/solutions_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/solutions_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -58,23 +55,42 @@ func (s *SolutionsServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SolutionsClient.Get": - resp, err = s.dispatchGet(req) - case "SolutionsClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SolutionsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if solutionsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = solutionsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SolutionsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SolutionsClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SolutionsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -146,3 +162,9 @@ func (s *SolutionsServerTransport) dispatchNewListPager(req *http.Request) (*htt } return resp, nil } + +// set this to conditionally intercept incoming requests to SolutionsServerTransport +var solutionsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/solutionsreferencedata_server.go b/sdk/resourcemanager/security/armsecurity/fake/solutionsreferencedata_server.go index c5a0fe3d04d2..54f9f9e1648d 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/solutionsreferencedata_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/solutionsreferencedata_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -53,23 +50,42 @@ func (s *SolutionsReferenceDataServerTransport) Do(req *http.Request) (*http.Res return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SolutionsReferenceDataClient.List": - resp, err = s.dispatchList(req) - case "SolutionsReferenceDataClient.ListByHomeRegion": - resp, err = s.dispatchListByHomeRegion(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SolutionsReferenceDataServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if solutionsReferenceDataServerTransportInterceptor != nil { + res.resp, res.err, intercepted = solutionsReferenceDataServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SolutionsReferenceDataClient.List": + res.resp, res.err = s.dispatchList(req) + case "SolutionsReferenceDataClient.ListByHomeRegion": + res.resp, res.err = s.dispatchListByHomeRegion(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SolutionsReferenceDataServerTransport) dispatchList(req *http.Request) (*http.Response, error) { @@ -125,3 +141,9 @@ func (s *SolutionsReferenceDataServerTransport) dispatchListByHomeRegion(req *ht } return resp, nil } + +// set this to conditionally intercept incoming requests to SolutionsReferenceDataServerTransport +var solutionsReferenceDataServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/sqlvulnerabilityassessmentbaselinerules_server.go b/sdk/resourcemanager/security/armsecurity/fake/sqlvulnerabilityassessmentbaselinerules_server.go index 2f1da94110ae..1ca53ecc81ac 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/sqlvulnerabilityassessmentbaselinerules_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/sqlvulnerabilityassessmentbaselinerules_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -66,29 +63,48 @@ func (s *SQLVulnerabilityAssessmentBaselineRulesServerTransport) Do(req *http.Re return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SQLVulnerabilityAssessmentBaselineRulesClient.Add": - resp, err = s.dispatchAdd(req) - case "SQLVulnerabilityAssessmentBaselineRulesClient.CreateOrUpdate": - resp, err = s.dispatchCreateOrUpdate(req) - case "SQLVulnerabilityAssessmentBaselineRulesClient.Delete": - resp, err = s.dispatchDelete(req) - case "SQLVulnerabilityAssessmentBaselineRulesClient.Get": - resp, err = s.dispatchGet(req) - case "SQLVulnerabilityAssessmentBaselineRulesClient.List": - resp, err = s.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SQLVulnerabilityAssessmentBaselineRulesServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if sqlVulnerabilityAssessmentBaselineRulesServerTransportInterceptor != nil { + res.resp, res.err, intercepted = sqlVulnerabilityAssessmentBaselineRulesServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SQLVulnerabilityAssessmentBaselineRulesClient.Add": + res.resp, res.err = s.dispatchAdd(req) + case "SQLVulnerabilityAssessmentBaselineRulesClient.CreateOrUpdate": + res.resp, res.err = s.dispatchCreateOrUpdate(req) + case "SQLVulnerabilityAssessmentBaselineRulesClient.Delete": + res.resp, res.err = s.dispatchDelete(req) + case "SQLVulnerabilityAssessmentBaselineRulesClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SQLVulnerabilityAssessmentBaselineRulesClient.List": + res.resp, res.err = s.dispatchList(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SQLVulnerabilityAssessmentBaselineRulesServerTransport) dispatchAdd(req *http.Request) (*http.Response, error) { @@ -292,3 +308,9 @@ func (s *SQLVulnerabilityAssessmentBaselineRulesServerTransport) dispatchList(re } return resp, nil } + +// set this to conditionally intercept incoming requests to SQLVulnerabilityAssessmentBaselineRulesServerTransport +var sqlVulnerabilityAssessmentBaselineRulesServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/sqlvulnerabilityassessmentscanresults_server.go b/sdk/resourcemanager/security/armsecurity/fake/sqlvulnerabilityassessmentscanresults_server.go index 84d56e014ade..a01f47fba4cd 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/sqlvulnerabilityassessmentscanresults_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/sqlvulnerabilityassessmentscanresults_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -53,23 +50,42 @@ func (s *SQLVulnerabilityAssessmentScanResultsServerTransport) Do(req *http.Requ return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SQLVulnerabilityAssessmentScanResultsClient.Get": - resp, err = s.dispatchGet(req) - case "SQLVulnerabilityAssessmentScanResultsClient.List": - resp, err = s.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SQLVulnerabilityAssessmentScanResultsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if sqlVulnerabilityAssessmentScanResultsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = sqlVulnerabilityAssessmentScanResultsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SQLVulnerabilityAssessmentScanResultsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SQLVulnerabilityAssessmentScanResultsClient.List": + res.resp, res.err = s.dispatchList(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SQLVulnerabilityAssessmentScanResultsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -151,3 +167,9 @@ func (s *SQLVulnerabilityAssessmentScanResultsServerTransport) dispatchList(req } return resp, nil } + +// set this to conditionally intercept incoming requests to SQLVulnerabilityAssessmentScanResultsServerTransport +var sqlVulnerabilityAssessmentScanResultsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/sqlvulnerabilityassessmentscans_server.go b/sdk/resourcemanager/security/armsecurity/fake/sqlvulnerabilityassessmentscans_server.go index fac898be5e02..dc8c5250de1f 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/sqlvulnerabilityassessmentscans_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/sqlvulnerabilityassessmentscans_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -53,23 +50,42 @@ func (s *SQLVulnerabilityAssessmentScansServerTransport) Do(req *http.Request) ( return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SQLVulnerabilityAssessmentScansClient.Get": - resp, err = s.dispatchGet(req) - case "SQLVulnerabilityAssessmentScansClient.List": - resp, err = s.dispatchList(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SQLVulnerabilityAssessmentScansServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if sqlVulnerabilityAssessmentScansServerTransportInterceptor != nil { + res.resp, res.err, intercepted = sqlVulnerabilityAssessmentScansServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SQLVulnerabilityAssessmentScansClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SQLVulnerabilityAssessmentScansClient.List": + res.resp, res.err = s.dispatchList(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SQLVulnerabilityAssessmentScansServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -143,3 +159,9 @@ func (s *SQLVulnerabilityAssessmentScansServerTransport) dispatchList(req *http. } return resp, nil } + +// set this to conditionally intercept incoming requests to SQLVulnerabilityAssessmentScansServerTransport +var sqlVulnerabilityAssessmentScansServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/standardassignments_server.go b/sdk/resourcemanager/security/armsecurity/fake/standardassignments_server.go new file mode 100644 index 000000000000..7b5fba9fa668 --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/fake/standardassignments_server.go @@ -0,0 +1,252 @@ +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" + "net/http" + "net/url" + "regexp" +) + +// StandardAssignmentsServer is a fake server for instances of the armsecurity.StandardAssignmentsClient type. +type StandardAssignmentsServer struct { + // Create is the fake for method StandardAssignmentsClient.Create + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + Create func(ctx context.Context, resourceID string, standardAssignmentName string, standardAssignment armsecurity.StandardAssignment, options *armsecurity.StandardAssignmentsClientCreateOptions) (resp azfake.Responder[armsecurity.StandardAssignmentsClientCreateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method StandardAssignmentsClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, resourceID string, standardAssignmentName string, options *armsecurity.StandardAssignmentsClientDeleteOptions) (resp azfake.Responder[armsecurity.StandardAssignmentsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method StandardAssignmentsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceID string, standardAssignmentName string, options *armsecurity.StandardAssignmentsClientGetOptions) (resp azfake.Responder[armsecurity.StandardAssignmentsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method StandardAssignmentsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(scope string, options *armsecurity.StandardAssignmentsClientListOptions) (resp azfake.PagerResponder[armsecurity.StandardAssignmentsClientListResponse]) +} + +// NewStandardAssignmentsServerTransport creates a new instance of StandardAssignmentsServerTransport with the provided implementation. +// The returned StandardAssignmentsServerTransport instance is connected to an instance of armsecurity.StandardAssignmentsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewStandardAssignmentsServerTransport(srv *StandardAssignmentsServer) *StandardAssignmentsServerTransport { + return &StandardAssignmentsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armsecurity.StandardAssignmentsClientListResponse]](), + } +} + +// StandardAssignmentsServerTransport connects instances of armsecurity.StandardAssignmentsClient to instances of StandardAssignmentsServer. +// Don't use this type directly, use NewStandardAssignmentsServerTransport instead. +type StandardAssignmentsServerTransport struct { + srv *StandardAssignmentsServer + newListPager *tracker[azfake.PagerResponder[armsecurity.StandardAssignmentsClientListResponse]] +} + +// Do implements the policy.Transporter interface for StandardAssignmentsServerTransport. +func (s *StandardAssignmentsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return s.dispatchToMethodFake(req, method) +} + +func (s *StandardAssignmentsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if standardAssignmentsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = standardAssignmentsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "StandardAssignmentsClient.Create": + res.resp, res.err = s.dispatchCreate(req) + case "StandardAssignmentsClient.Delete": + res.resp, res.err = s.dispatchDelete(req) + case "StandardAssignmentsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "StandardAssignmentsClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (s *StandardAssignmentsServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { + if s.srv.Create == nil { + return nil, &nonRetriableError{errors.New("fake for method Create not implemented")} + } + const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Security/standardAssignments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armsecurity.StandardAssignment](req) + if err != nil { + return nil, err + } + resourceIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceId")]) + if err != nil { + return nil, err + } + standardAssignmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("standardAssignmentName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Create(req.Context(), resourceIDParam, standardAssignmentNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).StandardAssignment, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *StandardAssignmentsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if s.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Security/standardAssignments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceId")]) + if err != nil { + return nil, err + } + standardAssignmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("standardAssignmentName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Delete(req.Context(), resourceIDParam, standardAssignmentNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *StandardAssignmentsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if s.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Security/standardAssignments/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceId")]) + if err != nil { + return nil, err + } + standardAssignmentNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("standardAssignmentName")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Get(req.Context(), resourceIDParam, standardAssignmentNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).StandardAssignment, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *StandardAssignmentsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if s.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := s.newListPager.get(req) + if newListPager == nil { + const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Security/standardAssignments` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + scopeParam, err := url.PathUnescape(matches[regex.SubexpIndex("scope")]) + if err != nil { + return nil, err + } + resp := s.srv.NewListPager(scopeParam, nil) + newListPager = &resp + s.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armsecurity.StandardAssignmentsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + s.newListPager.remove(req) + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to StandardAssignmentsServerTransport +var standardAssignmentsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/standards_server.go b/sdk/resourcemanager/security/armsecurity/fake/standards_server.go new file mode 100644 index 000000000000..09d1fc20390b --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/fake/standards_server.go @@ -0,0 +1,252 @@ +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" + "net/http" + "net/url" + "regexp" +) + +// StandardsServer is a fake server for instances of the armsecurity.StandardsClient type. +type StandardsServer struct { + // CreateOrUpdate is the fake for method StandardsClient.CreateOrUpdate + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + CreateOrUpdate func(ctx context.Context, scope string, standardID string, standard armsecurity.Standard, options *armsecurity.StandardsClientCreateOrUpdateOptions) (resp azfake.Responder[armsecurity.StandardsClientCreateOrUpdateResponse], errResp azfake.ErrorResponder) + + // Delete is the fake for method StandardsClient.Delete + // HTTP status codes to indicate success: http.StatusOK, http.StatusNoContent + Delete func(ctx context.Context, scope string, standardID string, options *armsecurity.StandardsClientDeleteOptions) (resp azfake.Responder[armsecurity.StandardsClientDeleteResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method StandardsClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, scope string, standardID string, options *armsecurity.StandardsClientGetOptions) (resp azfake.Responder[armsecurity.StandardsClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method StandardsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(scope string, options *armsecurity.StandardsClientListOptions) (resp azfake.PagerResponder[armsecurity.StandardsClientListResponse]) +} + +// NewStandardsServerTransport creates a new instance of StandardsServerTransport with the provided implementation. +// The returned StandardsServerTransport instance is connected to an instance of armsecurity.StandardsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewStandardsServerTransport(srv *StandardsServer) *StandardsServerTransport { + return &StandardsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armsecurity.StandardsClientListResponse]](), + } +} + +// StandardsServerTransport connects instances of armsecurity.StandardsClient to instances of StandardsServer. +// Don't use this type directly, use NewStandardsServerTransport instead. +type StandardsServerTransport struct { + srv *StandardsServer + newListPager *tracker[azfake.PagerResponder[armsecurity.StandardsClientListResponse]] +} + +// Do implements the policy.Transporter interface for StandardsServerTransport. +func (s *StandardsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return s.dispatchToMethodFake(req, method) +} + +func (s *StandardsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if standardsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = standardsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "StandardsClient.CreateOrUpdate": + res.resp, res.err = s.dispatchCreateOrUpdate(req) + case "StandardsClient.Delete": + res.resp, res.err = s.dispatchDelete(req) + case "StandardsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "StandardsClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (s *StandardsServerTransport) dispatchCreateOrUpdate(req *http.Request) (*http.Response, error) { + if s.srv.CreateOrUpdate == nil { + return nil, &nonRetriableError{errors.New("fake for method CreateOrUpdate not implemented")} + } + const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Security/securityStandards/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armsecurity.Standard](req) + if err != nil { + return nil, err + } + scopeParam, err := url.PathUnescape(matches[regex.SubexpIndex("scope")]) + if err != nil { + return nil, err + } + standardIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("standardId")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.CreateOrUpdate(req.Context(), scopeParam, standardIDParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusCreated}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Standard, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *StandardsServerTransport) dispatchDelete(req *http.Request) (*http.Response, error) { + if s.srv.Delete == nil { + return nil, &nonRetriableError{errors.New("fake for method Delete not implemented")} + } + const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Security/securityStandards/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + scopeParam, err := url.PathUnescape(matches[regex.SubexpIndex("scope")]) + if err != nil { + return nil, err + } + standardIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("standardId")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Delete(req.Context(), scopeParam, standardIDParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK, http.StatusNoContent}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusNoContent", respContent.HTTPStatus)} + } + resp, err := server.NewResponse(respContent, req, nil) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *StandardsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if s.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Security/securityStandards/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 2 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + scopeParam, err := url.PathUnescape(matches[regex.SubexpIndex("scope")]) + if err != nil { + return nil, err + } + standardIDParam, err := url.PathUnescape(matches[regex.SubexpIndex("standardId")]) + if err != nil { + return nil, err + } + respr, errRespr := s.srv.Get(req.Context(), scopeParam, standardIDParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Standard, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (s *StandardsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if s.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := s.newListPager.get(req) + if newListPager == nil { + const regexStr = `/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Security/securityStandards` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 1 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + scopeParam, err := url.PathUnescape(matches[regex.SubexpIndex("scope")]) + if err != nil { + return nil, err + } + resp := s.srv.NewListPager(scopeParam, nil) + newListPager = &resp + s.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armsecurity.StandardsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + s.newListPager.remove(req) + } + return resp, nil +} + +// set this to conditionally intercept incoming requests to StandardsServerTransport +var standardsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/subassessments_server.go b/sdk/resourcemanager/security/armsecurity/fake/subassessments_server.go index 72776f0554cd..b36fa5b76002 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/subassessments_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/subassessments_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -64,25 +61,44 @@ func (s *SubAssessmentsServerTransport) Do(req *http.Request) (*http.Response, e return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return s.dispatchToMethodFake(req, method) +} - switch method { - case "SubAssessmentsClient.Get": - resp, err = s.dispatchGet(req) - case "SubAssessmentsClient.NewListPager": - resp, err = s.dispatchNewListPager(req) - case "SubAssessmentsClient.NewListAllPager": - resp, err = s.dispatchNewListAllPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (s *SubAssessmentsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if subAssessmentsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = subAssessmentsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "SubAssessmentsClient.Get": + res.resp, res.err = s.dispatchGet(req) + case "SubAssessmentsClient.NewListPager": + res.resp, res.err = s.dispatchNewListPager(req) + case "SubAssessmentsClient.NewListAllPager": + res.resp, res.err = s.dispatchNewListAllPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (s *SubAssessmentsServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -199,3 +215,9 @@ func (s *SubAssessmentsServerTransport) dispatchNewListAllPager(req *http.Reques } return resp, nil } + +// set this to conditionally intercept incoming requests to SubAssessmentsServerTransport +var subAssessmentsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/tasks_server.go b/sdk/resourcemanager/security/armsecurity/fake/tasks_server.go index bbdb2e7bdf15..ab4643625b94 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/tasks_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/tasks_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -82,33 +79,52 @@ func (t *TasksServerTransport) Do(req *http.Request) (*http.Response, error) { return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return t.dispatchToMethodFake(req, method) +} - switch method { - case "TasksClient.GetResourceGroupLevelTask": - resp, err = t.dispatchGetResourceGroupLevelTask(req) - case "TasksClient.GetSubscriptionLevelTask": - resp, err = t.dispatchGetSubscriptionLevelTask(req) - case "TasksClient.NewListPager": - resp, err = t.dispatchNewListPager(req) - case "TasksClient.NewListByHomeRegionPager": - resp, err = t.dispatchNewListByHomeRegionPager(req) - case "TasksClient.NewListByResourceGroupPager": - resp, err = t.dispatchNewListByResourceGroupPager(req) - case "TasksClient.UpdateResourceGroupLevelTaskState": - resp, err = t.dispatchUpdateResourceGroupLevelTaskState(req) - case "TasksClient.UpdateSubscriptionLevelTaskState": - resp, err = t.dispatchUpdateSubscriptionLevelTaskState(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (t *TasksServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if tasksServerTransportInterceptor != nil { + res.resp, res.err, intercepted = tasksServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "TasksClient.GetResourceGroupLevelTask": + res.resp, res.err = t.dispatchGetResourceGroupLevelTask(req) + case "TasksClient.GetSubscriptionLevelTask": + res.resp, res.err = t.dispatchGetSubscriptionLevelTask(req) + case "TasksClient.NewListPager": + res.resp, res.err = t.dispatchNewListPager(req) + case "TasksClient.NewListByHomeRegionPager": + res.resp, res.err = t.dispatchNewListByHomeRegionPager(req) + case "TasksClient.NewListByResourceGroupPager": + res.resp, res.err = t.dispatchNewListByResourceGroupPager(req) + case "TasksClient.UpdateResourceGroupLevelTaskState": + res.resp, res.err = t.dispatchUpdateResourceGroupLevelTaskState(req) + case "TasksClient.UpdateSubscriptionLevelTaskState": + res.resp, res.err = t.dispatchUpdateSubscriptionLevelTaskState(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (t *TasksServerTransport) dispatchGetResourceGroupLevelTask(req *http.Request) (*http.Response, error) { @@ -417,3 +433,9 @@ func (t *TasksServerTransport) dispatchUpdateSubscriptionLevelTaskState(req *htt } return resp, nil } + +// set this to conditionally intercept incoming requests to TasksServerTransport +var tasksServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/time_rfc3339.go b/sdk/resourcemanager/security/armsecurity/fake/time_rfc3339.go deleted file mode 100644 index 81f308b0d343..000000000000 --- a/sdk/resourcemanager/security/armsecurity/fake/time_rfc3339.go +++ /dev/null @@ -1,110 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package fake - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) - -const ( - utcDateTime = "2006-01-02T15:04:05.999999999" - utcDateTimeJSON = `"` + utcDateTime + `"` - utcDateTimeNoT = "2006-01-02 15:04:05.999999999" - utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` - dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` - dateTimeJSON = `"` + time.RFC3339Nano + `"` - dateTimeJSONNoT = `"` + dateTimeNoT + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = dateTimeJSON - } else if tzOffset { - layout = dateTimeJSONNoT - } else if hasT { - layout = utcDateTimeJSON - } else { - layout = utcDateTimeJSONNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = time.RFC3339Nano - } else if tzOffset { - layout = dateTimeNoT - } else if hasT { - layout = utcDateTime - } else { - layout = utcDateTimeNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func (t dateTimeRFC3339) String() string { - return time.Time(t).Format(time.RFC3339Nano) -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || string(data) == "null" { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/security/armsecurity/fake/topology_server.go b/sdk/resourcemanager/security/armsecurity/fake/topology_server.go index 89d962d25f0a..cbc27f70e185 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/topology_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/topology_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -64,25 +61,44 @@ func (t *TopologyServerTransport) Do(req *http.Request) (*http.Response, error) return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return t.dispatchToMethodFake(req, method) +} - switch method { - case "TopologyClient.Get": - resp, err = t.dispatchGet(req) - case "TopologyClient.NewListPager": - resp, err = t.dispatchNewListPager(req) - case "TopologyClient.NewListByHomeRegionPager": - resp, err = t.dispatchNewListByHomeRegionPager(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (t *TopologyServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if topologyServerTransportInterceptor != nil { + res.resp, res.err, intercepted = topologyServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "TopologyClient.Get": + res.resp, res.err = t.dispatchGet(req) + case "TopologyClient.NewListPager": + res.resp, res.err = t.dispatchNewListPager(req) + case "TopologyClient.NewListByHomeRegionPager": + res.resp, res.err = t.dispatchNewListByHomeRegionPager(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (t *TopologyServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { @@ -191,3 +207,9 @@ func (t *TopologyServerTransport) dispatchNewListByHomeRegionPager(req *http.Req } return resp, nil } + +// set this to conditionally intercept incoming requests to TopologyServerTransport +var topologyServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/fake/workspacesettings_server.go b/sdk/resourcemanager/security/armsecurity/fake/workspacesettings_server.go index 829b6ddf6a44..a56afa38d26c 100644 --- a/sdk/resourcemanager/security/armsecurity/fake/workspacesettings_server.go +++ b/sdk/resourcemanager/security/armsecurity/fake/workspacesettings_server.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -70,29 +67,48 @@ func (w *WorkspaceSettingsServerTransport) Do(req *http.Request) (*http.Response return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} } - var resp *http.Response - var err error + return w.dispatchToMethodFake(req, method) +} - switch method { - case "WorkspaceSettingsClient.Create": - resp, err = w.dispatchCreate(req) - case "WorkspaceSettingsClient.Delete": - resp, err = w.dispatchDelete(req) - case "WorkspaceSettingsClient.Get": - resp, err = w.dispatchGet(req) - case "WorkspaceSettingsClient.NewListPager": - resp, err = w.dispatchNewListPager(req) - case "WorkspaceSettingsClient.Update": - resp, err = w.dispatchUpdate(req) - default: - err = fmt.Errorf("unhandled API %s", method) - } +func (w *WorkspaceSettingsServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) - if err != nil { - return nil, err - } + go func() { + var intercepted bool + var res result + if workspaceSettingsServerTransportInterceptor != nil { + res.resp, res.err, intercepted = workspaceSettingsServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "WorkspaceSettingsClient.Create": + res.resp, res.err = w.dispatchCreate(req) + case "WorkspaceSettingsClient.Delete": + res.resp, res.err = w.dispatchDelete(req) + case "WorkspaceSettingsClient.Get": + res.resp, res.err = w.dispatchGet(req) + case "WorkspaceSettingsClient.NewListPager": + res.resp, res.err = w.dispatchNewListPager(req) + case "WorkspaceSettingsClient.Update": + res.resp, res.err = w.dispatchUpdate(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } - return resp, nil + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } } func (w *WorkspaceSettingsServerTransport) dispatchCreate(req *http.Request) (*http.Response, error) { @@ -251,3 +267,9 @@ func (w *WorkspaceSettingsServerTransport) dispatchUpdate(req *http.Request) (*h } return resp, nil } + +// set this to conditionally intercept incoming requests to WorkspaceSettingsServerTransport +var workspaceSettingsServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/security/armsecurity/githubowners_client.go b/sdk/resourcemanager/security/armsecurity/githubowners_client.go index c4fdc71f9e3c..f88ba36608f0 100644 --- a/sdk/resourcemanager/security/armsecurity/githubowners_client.go +++ b/sdk/resourcemanager/security/armsecurity/githubowners_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewGitHubOwnersClient(subscriptionID string, credential azcore.TokenCredent // Get - Returns a monitored GitHub owner. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - ownerName - The GitHub owner name. @@ -74,7 +71,7 @@ func (client *GitHubOwnersClient) Get(ctx context.Context, resourceGroupName str } // getCreateRequest creates the Get request. -func (client *GitHubOwnersClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, ownerName string, options *GitHubOwnersClientGetOptions) (*policy.Request, error) { +func (client *GitHubOwnersClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, ownerName string, _ *GitHubOwnersClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitHubOwners/{ownerName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -97,7 +94,7 @@ func (client *GitHubOwnersClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,7 +111,7 @@ func (client *GitHubOwnersClient) getHandleResponse(resp *http.Response) (GitHub // NewListPager - Returns a list of GitHub owners onboarded to the connector. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - options - GitHubOwnersClientListOptions contains the optional parameters for the GitHubOwnersClient.NewListPager method. @@ -142,7 +139,7 @@ func (client *GitHubOwnersClient) NewListPager(resourceGroupName string, securit } // listCreateRequest creates the List request. -func (client *GitHubOwnersClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, options *GitHubOwnersClientListOptions) (*policy.Request, error) { +func (client *GitHubOwnersClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, _ *GitHubOwnersClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitHubOwners" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -161,7 +158,7 @@ func (client *GitHubOwnersClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -179,7 +176,7 @@ func (client *GitHubOwnersClient) listHandleResponse(resp *http.Response) (GitHu // ListAvailable - Returns a list of all GitHub owners accessible by the user token consumed by the connector. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - options - GitHubOwnersClientListAvailableOptions contains the optional parameters for the GitHubOwnersClient.ListAvailable @@ -207,7 +204,7 @@ func (client *GitHubOwnersClient) ListAvailable(ctx context.Context, resourceGro } // listAvailableCreateRequest creates the ListAvailable request. -func (client *GitHubOwnersClient) listAvailableCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, options *GitHubOwnersClientListAvailableOptions) (*policy.Request, error) { +func (client *GitHubOwnersClient) listAvailableCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, _ *GitHubOwnersClientListAvailableOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/listAvailableGitHubOwners" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -226,7 +223,7 @@ func (client *GitHubOwnersClient) listAvailableCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/security/armsecurity/githubowners_client_example_test.go b/sdk/resourcemanager/security/armsecurity/githubowners_client_example_test.go deleted file mode 100644 index 3fbdc75f3a1f..000000000000 --- a/sdk/resourcemanager/security/armsecurity/githubowners_client_example_test.go +++ /dev/null @@ -1,138 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListAvailableGitHubOwners_example.json -func ExampleGitHubOwnersClient_ListAvailable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGitHubOwnersClient().ListAvailable(ctx, "myRg", "mySecurityConnectorName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GitHubOwnerListResponse = armsecurity.GitHubOwnerListResponse{ - // Value: []*armsecurity.GitHubOwner{ - // { - // Name: to.Ptr("myGitHubOwner"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/gitHubOwners"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/gitHubOwners/myGitHubOwner"), - // Properties: &armsecurity.GitHubOwnerProperties{ - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboarded), - // OwnerURL: to.Ptr("https://github.com/myGitHubOwner"), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("anotherGitHubOwner"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/gitHubOwners"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/gitHubOwners/anotherGitHubOwner"), - // Properties: &armsecurity.GitHubOwnerProperties{ - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboardedByOtherConnector), - // OwnerURL: to.Ptr("https://github.com/anotherGitHubOwner"), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("notOnboardedOwner"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/gitHubOwners"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/gitHubOwners/notOnboardedOwner"), - // Properties: &armsecurity.GitHubOwnerProperties{ - // OnboardingState: to.Ptr(armsecurity.OnboardingStateNotOnboarded), - // OwnerURL: to.Ptr("https://github.com/notOnboardedOwner"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListGitHubOwners_example.json -func ExampleGitHubOwnersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGitHubOwnersClient().NewListPager("myRg", "mySecurityConnectorName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GitHubOwnerListResponse = armsecurity.GitHubOwnerListResponse{ - // Value: []*armsecurity.GitHubOwner{ - // { - // Name: to.Ptr("myGitHubOwner"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/gitHubOwners"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/gitHubOwners/myGitHubOwner"), - // Properties: &armsecurity.GitHubOwnerProperties{ - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboarded), - // OwnerURL: to.Ptr("https://github.com/myGitHubOwner"), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetGitHubOwners_example.json -func ExampleGitHubOwnersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGitHubOwnersClient().Get(ctx, "myRg", "mySecurityConnectorName", "myGitHubOwner", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GitHubOwner = armsecurity.GitHubOwner{ - // Name: to.Ptr("myGitHubOwner"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/gitHubOwners"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/gitHubOwners/myGitHubOwner"), - // Properties: &armsecurity.GitHubOwnerProperties{ - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboarded), - // OwnerURL: to.Ptr("https://github.com/myGitHubOwner"), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/githubrepos_client.go b/sdk/resourcemanager/security/armsecurity/githubrepos_client.go index e0ddc54d0729..b5b63b7911fb 100644 --- a/sdk/resourcemanager/security/armsecurity/githubrepos_client.go +++ b/sdk/resourcemanager/security/armsecurity/githubrepos_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewGitHubReposClient(subscriptionID string, credential azcore.TokenCredenti // Get - Returns a monitored GitHub repository. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - ownerName - The GitHub owner name. @@ -75,7 +72,7 @@ func (client *GitHubReposClient) Get(ctx context.Context, resourceGroupName stri } // getCreateRequest creates the Get request. -func (client *GitHubReposClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, ownerName string, repoName string, options *GitHubReposClientGetOptions) (*policy.Request, error) { +func (client *GitHubReposClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, ownerName string, repoName string, _ *GitHubReposClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitHubOwners/{ownerName}/repos/{repoName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -102,7 +99,7 @@ func (client *GitHubReposClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -119,7 +116,7 @@ func (client *GitHubReposClient) getHandleResponse(resp *http.Response) (GitHubR // NewListPager - Returns a list of GitHub repositories onboarded to the connector. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - ownerName - The GitHub owner name. @@ -148,7 +145,7 @@ func (client *GitHubReposClient) NewListPager(resourceGroupName string, security } // listCreateRequest creates the List request. -func (client *GitHubReposClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, ownerName string, options *GitHubReposClientListOptions) (*policy.Request, error) { +func (client *GitHubReposClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, ownerName string, _ *GitHubReposClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitHubOwners/{ownerName}/repos" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -171,7 +168,7 @@ func (client *GitHubReposClient) listCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/security/armsecurity/githubrepos_client_example_test.go b/sdk/resourcemanager/security/armsecurity/githubrepos_client_example_test.go deleted file mode 100644 index b5daa86a7e6c..000000000000 --- a/sdk/resourcemanager/security/armsecurity/githubrepos_client_example_test.go +++ /dev/null @@ -1,92 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListGitHubRepos_example.json -func ExampleGitHubReposClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGitHubReposClient().NewListPager("myRg", "mySecurityConnectorName", "myGitHubOwner", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GitHubRepositoryListResponse = armsecurity.GitHubRepositoryListResponse{ - // Value: []*armsecurity.GitHubRepository{ - // { - // Name: to.Ptr("myGitHubRepo"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/gitHubOwners/repos"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/gitHubOwners/myGitHubOwner/repos/myGitHubRepo"), - // Properties: &armsecurity.GitHubRepositoryProperties{ - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboarded), - // ParentOwnerName: to.Ptr("myGitHubOwner"), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // RepoFullName: to.Ptr("myGitHubOwner/myGitHubRepo"), - // RepoName: to.Ptr("myGitHubRepo"), - // RepoURL: to.Ptr("https://github.com/myGitHubOwner/myGitHubRepo"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetGitHubRepos_example.json -func ExampleGitHubReposClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGitHubReposClient().Get(ctx, "myRg", "mySecurityConnectorName", "myGitHubOwner", "myGitHubRepo", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GitHubRepository = armsecurity.GitHubRepository{ - // Name: to.Ptr("myGitHubRepo"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/gitHubOwners/repos"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/gitHubOwners/myGitHubOwner/repos/myGitHubRepo"), - // Properties: &armsecurity.GitHubRepositoryProperties{ - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboarded), - // ParentOwnerName: to.Ptr("myGitHubOwner"), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // RepoFullName: to.Ptr("myGitHubOwner/myGitHubRepo"), - // RepoName: to.Ptr("myGitHubRepo"), - // RepoURL: to.Ptr("https://github.com/myGitHubOwner/myGitHubRepo"), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/gitlabgroups_client.go b/sdk/resourcemanager/security/armsecurity/gitlabgroups_client.go index b0696c710ce1..349cb6f01683 100644 --- a/sdk/resourcemanager/security/armsecurity/gitlabgroups_client.go +++ b/sdk/resourcemanager/security/armsecurity/gitlabgroups_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewGitLabGroupsClient(subscriptionID string, credential azcore.TokenCredent // Get - Returns a monitored GitLab Group resource for a given fully-qualified name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - groupFQName - The GitLab group fully-qualified name. @@ -74,7 +71,7 @@ func (client *GitLabGroupsClient) Get(ctx context.Context, resourceGroupName str } // getCreateRequest creates the Get request. -func (client *GitLabGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, groupFQName string, options *GitLabGroupsClientGetOptions) (*policy.Request, error) { +func (client *GitLabGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, groupFQName string, _ *GitLabGroupsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitLabGroups/{groupFQName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -97,7 +94,7 @@ func (client *GitLabGroupsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,7 +111,7 @@ func (client *GitLabGroupsClient) getHandleResponse(resp *http.Response) (GitLab // NewListPager - Returns a list of GitLab groups onboarded to the connector. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - options - GitLabGroupsClientListOptions contains the optional parameters for the GitLabGroupsClient.NewListPager method. @@ -142,7 +139,7 @@ func (client *GitLabGroupsClient) NewListPager(resourceGroupName string, securit } // listCreateRequest creates the List request. -func (client *GitLabGroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, options *GitLabGroupsClientListOptions) (*policy.Request, error) { +func (client *GitLabGroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, _ *GitLabGroupsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitLabGroups" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -161,7 +158,7 @@ func (client *GitLabGroupsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -179,7 +176,7 @@ func (client *GitLabGroupsClient) listHandleResponse(resp *http.Response) (GitLa // ListAvailable - Returns a list of all GitLab groups accessible by the user token consumed by the connector. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - options - GitLabGroupsClientListAvailableOptions contains the optional parameters for the GitLabGroupsClient.ListAvailable @@ -207,7 +204,7 @@ func (client *GitLabGroupsClient) ListAvailable(ctx context.Context, resourceGro } // listAvailableCreateRequest creates the ListAvailable request. -func (client *GitLabGroupsClient) listAvailableCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, options *GitLabGroupsClientListAvailableOptions) (*policy.Request, error) { +func (client *GitLabGroupsClient) listAvailableCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, _ *GitLabGroupsClientListAvailableOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/listAvailableGitLabGroups" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -226,7 +223,7 @@ func (client *GitLabGroupsClient) listAvailableCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/security/armsecurity/gitlabgroups_client_example_test.go b/sdk/resourcemanager/security/armsecurity/gitlabgroups_client_example_test.go deleted file mode 100644 index 2e85a883e681..000000000000 --- a/sdk/resourcemanager/security/armsecurity/gitlabgroups_client_example_test.go +++ /dev/null @@ -1,143 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListAvailableGitLabGroups_example.json -func ExampleGitLabGroupsClient_ListAvailable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGitLabGroupsClient().ListAvailable(ctx, "myRg", "mySecurityConnectorName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GitLabGroupListResponse = armsecurity.GitLabGroupListResponse{ - // Value: []*armsecurity.GitLabGroup{ - // { - // Name: to.Ptr("myGitLabGroup$mySubGroup"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/gitLabGroups"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/gitLabGroups/myGitLabGroup$mySubGroup"), - // Properties: &armsecurity.GitLabGroupProperties{ - // FullyQualifiedName: to.Ptr("myGitLabGroup$mySubGroup"), - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboarded), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // URL: to.Ptr("https://gitlab.example.com/myGitLabGroup/mySubGroup"), - // }, - // }, - // { - // Name: to.Ptr("myGitLabGroup"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/gitLabGroups"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/gitLabGroups/myGitLabGroup"), - // Properties: &armsecurity.GitLabGroupProperties{ - // FullyQualifiedName: to.Ptr("myGitLabGroup"), - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboardedByOtherConnector), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // URL: to.Ptr("https://gitlab.example.com/myGitLabGroup"), - // }, - // }, - // { - // Name: to.Ptr("anotherGitLabGroup"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/gitLabGroups"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/gitLabGroups/anotherGitLabGroup"), - // Properties: &armsecurity.GitLabGroupProperties{ - // FullyQualifiedName: to.Ptr("anotherGitLabGroup"), - // OnboardingState: to.Ptr(armsecurity.OnboardingStateNotOnboarded), - // URL: to.Ptr("https://gitlab.example.com/anotherGitLabGroup"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListGitLabGroups_example.json -func ExampleGitLabGroupsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGitLabGroupsClient().NewListPager("myRg", "mySecurityConnectorName", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GitLabGroupListResponse = armsecurity.GitLabGroupListResponse{ - // Value: []*armsecurity.GitLabGroup{ - // { - // Name: to.Ptr("myGitLabGroup$mySubGroup"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/gitLabGroups"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/gitLabGroups/myGitLabGroup$mySubGroup"), - // Properties: &armsecurity.GitLabGroupProperties{ - // FullyQualifiedName: to.Ptr("myGitLabGroup$mySubGroup"), - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboarded), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // URL: to.Ptr("https://gitlab.example.com/myGitLabGroup/mySubGroup"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetGitLabGroups_example.json -func ExampleGitLabGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGitLabGroupsClient().Get(ctx, "myRg", "mySecurityConnectorName", "myGitLabGroup$mySubGroup", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GitLabGroup = armsecurity.GitLabGroup{ - // Name: to.Ptr("myGitLabGroup$mySubGroup"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/gitLabGroups"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/gitLabGroups/myGitLabGroup$mySubGroup"), - // Properties: &armsecurity.GitLabGroupProperties{ - // FullyQualifiedName: to.Ptr("myGitLabGroup$mySubGroup"), - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboarded), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // URL: to.Ptr("https://gitlab.example.com/myGitLabGroup/mySubGroup"), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/gitlabprojects_client.go b/sdk/resourcemanager/security/armsecurity/gitlabprojects_client.go index 45c14ba71c8c..cd7033240bf1 100644 --- a/sdk/resourcemanager/security/armsecurity/gitlabprojects_client.go +++ b/sdk/resourcemanager/security/armsecurity/gitlabprojects_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewGitLabProjectsClient(subscriptionID string, credential azcore.TokenCrede // Get - Returns a monitored GitLab Project resource for a given fully-qualified group name and project name. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - groupFQName - The GitLab group fully-qualified name. @@ -75,7 +72,7 @@ func (client *GitLabProjectsClient) Get(ctx context.Context, resourceGroupName s } // getCreateRequest creates the Get request. -func (client *GitLabProjectsClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, groupFQName string, projectName string, options *GitLabProjectsClientGetOptions) (*policy.Request, error) { +func (client *GitLabProjectsClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, groupFQName string, projectName string, _ *GitLabProjectsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitLabGroups/{groupFQName}/projects/{projectName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -102,7 +99,7 @@ func (client *GitLabProjectsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -119,7 +116,7 @@ func (client *GitLabProjectsClient) getHandleResponse(resp *http.Response) (GitL // NewListPager - Gets a list of GitLab projects that are directly owned by given group and onboarded to the connector. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - groupFQName - The GitLab group fully-qualified name. @@ -148,7 +145,7 @@ func (client *GitLabProjectsClient) NewListPager(resourceGroupName string, secur } // listCreateRequest creates the List request. -func (client *GitLabProjectsClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, groupFQName string, options *GitLabProjectsClientListOptions) (*policy.Request, error) { +func (client *GitLabProjectsClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, groupFQName string, _ *GitLabProjectsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitLabGroups/{groupFQName}/projects" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -171,7 +168,7 @@ func (client *GitLabProjectsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/security/armsecurity/gitlabprojects_client_example_test.go b/sdk/resourcemanager/security/armsecurity/gitlabprojects_client_example_test.go deleted file mode 100644 index e81f094e2b27..000000000000 --- a/sdk/resourcemanager/security/armsecurity/gitlabprojects_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. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListGitLabProjects_example.json -func ExampleGitLabProjectsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGitLabProjectsClient().NewListPager("myRg", "mySecurityConnectorName", "myGitLabGroup$mySubGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GitLabProjectListResponse = armsecurity.GitLabProjectListResponse{ - // Value: []*armsecurity.GitLabProject{ - // { - // Name: to.Ptr("myGitLabProject"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/gitLabGroups/projects"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/gitLabGroups/myGitLabGroup$mySubGroup/projects/myGitLabProject"), - // Properties: &armsecurity.GitLabProjectProperties{ - // FullyQualifiedName: to.Ptr("myGitLabGroup$mySubGroup$myGitLabProject"), - // FullyQualifiedParentGroupName: to.Ptr("myGitLabGroup$mySubGroup"), - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboarded), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // URL: to.Ptr("https://gitlab.example.com/myGitLabGroup/mySubGroup/myGitLabProject"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/GetGitLabProjects_example.json -func ExampleGitLabProjectsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGitLabProjectsClient().Get(ctx, "myRg", "mySecurityConnectorName", "myGitLabGroup$mySubGroup", "myGitLabProject", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GitLabProject = armsecurity.GitLabProject{ - // Name: to.Ptr("myGitLabProject"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/gitLabGroups/projects"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/gitLabGroups/myGitLabGroup$mySubGroup/projects/myGitLabProject"), - // Properties: &armsecurity.GitLabProjectProperties{ - // FullyQualifiedName: to.Ptr("myGitLabGroup$mySubGroup$myGitLabProject"), - // FullyQualifiedParentGroupName: to.Ptr("myGitLabGroup$mySubGroup"), - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboarded), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // URL: to.Ptr("https://gitlab.example.com/myGitLabGroup/mySubGroup/myGitLabProject"), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/gitlabsubgroups_client.go b/sdk/resourcemanager/security/armsecurity/gitlabsubgroups_client.go index 83a9056516d0..f3bca20b5afb 100644 --- a/sdk/resourcemanager/security/armsecurity/gitlabsubgroups_client.go +++ b/sdk/resourcemanager/security/armsecurity/gitlabsubgroups_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -46,7 +43,7 @@ func NewGitLabSubgroupsClient(subscriptionID string, credential azcore.TokenCred // List - Gets nested subgroups of given GitLab Group which are onboarded to the connector. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-09-01-preview +// Generated from API version 2025-03-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - securityConnectorName - The security connector name. // - groupFQName - The GitLab group fully-qualified name. @@ -74,7 +71,7 @@ func (client *GitLabSubgroupsClient) List(ctx context.Context, resourceGroupName } // listCreateRequest creates the List request. -func (client *GitLabSubgroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, groupFQName string, options *GitLabSubgroupsClientListOptions) (*policy.Request, error) { +func (client *GitLabSubgroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, groupFQName string, _ *GitLabSubgroupsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/devops/default/gitLabGroups/{groupFQName}/listSubgroups" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -97,7 +94,7 @@ func (client *GitLabSubgroupsClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-09-01-preview") + reqQP.Set("api-version", "2025-03-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/security/armsecurity/gitlabsubgroups_client_example_test.go b/sdk/resourcemanager/security/armsecurity/gitlabsubgroups_client_example_test.go deleted file mode 100644 index 6add328158ad..000000000000 --- a/sdk/resourcemanager/security/armsecurity/gitlabsubgroups_client_example_test.go +++ /dev/null @@ -1,52 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-09-01-preview/examples/SecurityConnectorsDevOps/ListGitLabSubgroups_example.json -func ExampleGitLabSubgroupsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGitLabSubgroupsClient().List(ctx, "myRg", "mySecurityConnectorName", "myGitLabGroup", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GitLabGroupListResponse = armsecurity.GitLabGroupListResponse{ - // Value: []*armsecurity.GitLabGroup{ - // { - // Name: to.Ptr("myGitLabGroup$mySubGroup"), - // Type: to.Ptr("Microsoft.Security/securityConnectors/devops/gitLabGroups"), - // ID: to.Ptr("/subscriptions/0806e1cd-cfda-4ff8-b99c-2b0af42cffd3/resourceGroups/myRg/providers/Microsoft.Security/securityConnectors/mySecurityConnectorName/devops/default/gitLabGroups/myGitLabGroup$mySubGroup"), - // Properties: &armsecurity.GitLabGroupProperties{ - // FullyQualifiedName: to.Ptr("myGitLabGroup$mySubGroup"), - // OnboardingState: to.Ptr(armsecurity.OnboardingStateOnboarded), - // ProvisioningState: to.Ptr(armsecurity.DevOpsProvisioningStateSucceeded), - // URL: to.Ptr("https://gitlab.example.com/myGitLabGroup/mySubGroup"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/go.mod b/sdk/resourcemanager/security/armsecurity/go.mod index 2f929a6bc3f6..4224df2f6a5b 100644 --- a/sdk/resourcemanager/security/armsecurity/go.mod +++ b/sdk/resourcemanager/security/armsecurity/go.mod @@ -2,20 +2,10 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurit go 1.23.0 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 // indirect - github.com/golang-jwt/jwt/v5 v5.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect - golang.org/x/crypto v0.36.0 // indirect golang.org/x/net v0.38.0 // indirect - golang.org/x/sys v0.31.0 // indirect golang.org/x/text v0.23.0 // indirect ) diff --git a/sdk/resourcemanager/security/armsecurity/go.sum b/sdk/resourcemanager/security/armsecurity/go.sum index 4bacf756f06c..4de695d9e23a 100644 --- a/sdk/resourcemanager/security/armsecurity/go.sum +++ b/sdk/resourcemanager/security/armsecurity/go.sum @@ -1,44 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1 h1:DSDNVxqkoXJiko6x8a90zidoYqnYYa6c1MTzDKzKkTo= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.1/go.mod h1:zGqV2R4Cr/k8Uye5w+dgQ06WJtEcbQG/8J7BB6hnCr4= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2 h1:F0gBpfdPLGsw+nsgk6aqqkZS1jiixa5WwFe3fk/T3Ys= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.2/go.mod h1:SqINnQ9lVVdRlyC8cd1lCI0SdX4n2paeABd2K8ggfnE= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY= -github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2/go.mod h1:Pa9ZNPuoNu/GztvBSKk9J1cDJW6vk/n0zLtV4mgd8N8= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 h1:ywEEhmNahHBihViHepv3xPBn1663uRv2t2q/ESv9seY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0/go.mod h1:iZDifYGJTIgIIkYRNWPENUnqx6bJ2xnSDFI2tjwZNuY= -github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1 h1:WJTmL004Abzc5wDB5VtZG2PJk5ndYDgVacGqfirKxjM= -github.com/AzureAD/microsoft-authentication-extensions-for-go/cache v0.1.1/go.mod h1:tCcJZ0uHAmvjsVYzEFivsRTN00oz5BEsRgQHu5JZ9WE= -github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2 h1:oygO0locgZJe7PpYPXT5A29ZkwJaPqcva7BVeemZOZs= -github.com/AzureAD/microsoft-authentication-library-for-go v1.4.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= -github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= -github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= -github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= -github.com/golang-jwt/jwt/v5 v5.2.2 h1:Rl4B7itRWVtYIHFrSNd7vhTiz9UpLdi6gZhZ3wEeDy8= -github.com/golang-jwt/jwt/v5 v5.2.2/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= -github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6 h1:IsMZxCuZqKuao2vNdfD82fjjgPLfyHLpR41Z88viRWs= -github.com/keybase/go-keychain v0.0.0-20231219164618-57a3676c3af6/go.mod h1:3VeWNIJaW+O5xpRQbPp0Ybqu1vJd/pm7s2F473HRrkw= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= -github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/redis/go-redis/v9 v9.7.0 h1:HhLSs+B6O021gwzl+locl0zEDnyNkxMtf/Z3NNBMa9E= -github.com/redis/go-redis/v9 v9.7.0/go.mod h1:f6zhXITC7JUJIlPEiBOTXxJgPLdZcA93GewI7inzyWw= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= -golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= -golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= -golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/sdk/resourcemanager/security/armsecurity/governanceassignments_client.go b/sdk/resourcemanager/security/armsecurity/governanceassignments_client.go index 6a5db35e4a77..8c511df91d2a 100644 --- a/sdk/resourcemanager/security/armsecurity/governanceassignments_client.go +++ b/sdk/resourcemanager/security/armsecurity/governanceassignments_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -75,7 +72,7 @@ func (client *GovernanceAssignmentsClient) CreateOrUpdate(ctx context.Context, s } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *GovernanceAssignmentsClient) createOrUpdateCreateRequest(ctx context.Context, scope string, assessmentName string, assignmentKey string, governanceAssignment GovernanceAssignment, options *GovernanceAssignmentsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *GovernanceAssignmentsClient) createOrUpdateCreateRequest(ctx context.Context, scope string, assessmentName string, assignmentKey string, governanceAssignment GovernanceAssignment, _ *GovernanceAssignmentsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}" if scope == "" { return nil, errors.New("parameter scope cannot be empty") @@ -145,7 +142,7 @@ func (client *GovernanceAssignmentsClient) Delete(ctx context.Context, scope str } // deleteCreateRequest creates the Delete request. -func (client *GovernanceAssignmentsClient) deleteCreateRequest(ctx context.Context, scope string, assessmentName string, assignmentKey string, options *GovernanceAssignmentsClientDeleteOptions) (*policy.Request, error) { +func (client *GovernanceAssignmentsClient) deleteCreateRequest(ctx context.Context, scope string, assessmentName string, assignmentKey string, _ *GovernanceAssignmentsClientDeleteOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}" if scope == "" { return nil, errors.New("parameter scope cannot be empty") @@ -203,7 +200,7 @@ func (client *GovernanceAssignmentsClient) Get(ctx context.Context, scope string } // getCreateRequest creates the Get request. -func (client *GovernanceAssignmentsClient) getCreateRequest(ctx context.Context, scope string, assessmentName string, assignmentKey string, options *GovernanceAssignmentsClientGetOptions) (*policy.Request, error) { +func (client *GovernanceAssignmentsClient) getCreateRequest(ctx context.Context, scope string, assessmentName string, assignmentKey string, _ *GovernanceAssignmentsClientGetOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}" if scope == "" { return nil, errors.New("parameter scope cannot be empty") @@ -270,7 +267,7 @@ func (client *GovernanceAssignmentsClient) NewListPager(scope string, assessment } // listCreateRequest creates the List request. -func (client *GovernanceAssignmentsClient) listCreateRequest(ctx context.Context, scope string, assessmentName string, options *GovernanceAssignmentsClientListOptions) (*policy.Request, error) { +func (client *GovernanceAssignmentsClient) listCreateRequest(ctx context.Context, scope string, assessmentName string, _ *GovernanceAssignmentsClientListOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments" if scope == "" { return nil, errors.New("parameter scope cannot be empty") diff --git a/sdk/resourcemanager/security/armsecurity/governanceassignments_client_example_test.go b/sdk/resourcemanager/security/armsecurity/governanceassignments_client_example_test.go deleted file mode 100644 index c2b4da826da5..000000000000 --- a/sdk/resourcemanager/security/armsecurity/governanceassignments_client_example_test.go +++ /dev/null @@ -1,209 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/ListGovernanceAssignments_example.json -func ExampleGovernanceAssignmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGovernanceAssignmentsClient().NewListPager("subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd", "6b9421dd-5555-2251-9b3d-2be58e2f82cd", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GovernanceAssignmentsList = armsecurity.GovernanceAssignmentsList{ - // Value: []*armsecurity.GovernanceAssignment{ - // { - // Name: to.Ptr("6634ff9f-127b-4bf2-8e6e-b1737f5e789c"), - // Type: to.Ptr("Microsoft.Security/assessments/governanceAssignments"), - // ID: to.Ptr("/subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012/providers/Microsoft.Security/assessments/6b9421dd-5555-2251-9b3d-2be58e2f82cd/governanceAssignments/6634ff9f-127b-4bf2-8e6e-b1737f5e789c"), - // Properties: &armsecurity.GovernanceAssignmentProperties{ - // AdditionalData: &armsecurity.GovernanceAssignmentAdditionalData{ - // TicketLink: to.Ptr("https://snow.com"), - // TicketNumber: to.Ptr[int32](123123), - // TicketStatus: to.Ptr("Active"), - // }, - // IsGracePeriod: to.Ptr(true), - // Owner: to.Ptr("user@contoso.com"), - // RemediationDueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-07T13:00:00.000Z"); return t}()), - // RemediationEta: &armsecurity.RemediationEta{ - // Eta: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T13:00:00.000Z"); return t}()), - // Justification: to.Ptr("Justification of ETA"), - // }, - // }, - // }, - // { - // Name: to.Ptr("41fb92a5-43dc-4c00-a969-469c16cef7a7"), - // Type: to.Ptr("Microsoft.Security/assessments/governanceAssignments"), - // ID: to.Ptr("/subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2011/providers/Microsoft.Security/assessments/6b9421dd-5555-2251-9b3d-2be58e2f82cd/governanceAssignments/41fb92a5-43dc-4c00-a969-469c16cef7a7"), - // Properties: &armsecurity.GovernanceAssignmentProperties{ - // AdditionalData: &armsecurity.GovernanceAssignmentAdditionalData{ - // TicketLink: to.Ptr("https://snow.com"), - // TicketNumber: to.Ptr[int32](653424), - // TicketStatus: to.Ptr("Active"), - // }, - // IsGracePeriod: to.Ptr(true), - // Owner: to.Ptr("user2@contoso.com"), - // RemediationDueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-07T13:00:00.000Z"); return t}()), - // RemediationEta: &armsecurity.RemediationEta{ - // Eta: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T13:00:00.000Z"); return t}()), - // Justification: to.Ptr("Justification of ETA"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/GetGovernanceAssignment_example.json -func ExampleGovernanceAssignmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGovernanceAssignmentsClient().Get(ctx, "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", "6b9421dd-5555-2251-9b3d-2be58e2f82cd", "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GovernanceAssignment = armsecurity.GovernanceAssignment{ - // Name: to.Ptr("6634ff9f-127b-4bf2-8e6e-b1737f5e789c"), - // Type: to.Ptr("Microsoft.Security/assessments/governanceAssignments"), - // ID: to.Ptr("/subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012/providers/Microsoft.Security/assessments/6b9421dd-5555-2251-9b3d-2be58e2f82cd/governanceAssignments/6634ff9f-127b-4bf2-8e6e-b1737f5e789c"), - // Properties: &armsecurity.GovernanceAssignmentProperties{ - // AdditionalData: &armsecurity.GovernanceAssignmentAdditionalData{ - // TicketLink: to.Ptr("https://snow.com"), - // TicketNumber: to.Ptr[int32](123123), - // TicketStatus: to.Ptr("Active"), - // }, - // GovernanceEmailNotification: &armsecurity.GovernanceEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(false), - // DisableOwnerEmailNotification: to.Ptr(false), - // }, - // IsGracePeriod: to.Ptr(true), - // Owner: to.Ptr("user@contoso.com"), - // RemediationDueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-07T13:00:00.000Z"); return t}()), - // RemediationEta: &armsecurity.RemediationEta{ - // Eta: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T13:00:00.000Z"); return t}()), - // Justification: to.Ptr("Justification of ETA"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/PutGovernanceAssignment_example.json -func ExampleGovernanceAssignmentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGovernanceAssignmentsClient().CreateOrUpdate(ctx, "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", "6b9421dd-5555-2251-9b3d-2be58e2f82cd", "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", armsecurity.GovernanceAssignment{ - Properties: &armsecurity.GovernanceAssignmentProperties{ - AdditionalData: &armsecurity.GovernanceAssignmentAdditionalData{ - TicketLink: to.Ptr("https://snow.com"), - TicketNumber: to.Ptr[int32](123123), - TicketStatus: to.Ptr("Active"), - }, - GovernanceEmailNotification: &armsecurity.GovernanceEmailNotification{ - DisableManagerEmailNotification: to.Ptr(false), - DisableOwnerEmailNotification: to.Ptr(false), - }, - IsGracePeriod: to.Ptr(true), - Owner: to.Ptr("user@contoso.com"), - RemediationDueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-07T13:00:00.000Z"); return t }()), - RemediationEta: &armsecurity.RemediationEta{ - Eta: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T13:00:00.000Z"); return t }()), - Justification: to.Ptr("Justification of ETA"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GovernanceAssignment = armsecurity.GovernanceAssignment{ - // Name: to.Ptr("6634ff9f-127b-4bf2-8e6e-b1737f5e789c"), - // Type: to.Ptr("Microsoft.Security/assessments/governanceAssignments"), - // ID: to.Ptr("/subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012/providers/Microsoft.Security/assessments/6b9421dd-5555-2251-9b3d-2be58e2f82cd/governanceAssignments/6634ff9f-127b-4bf2-8e6e-b1737f5e789c"), - // Properties: &armsecurity.GovernanceAssignmentProperties{ - // AdditionalData: &armsecurity.GovernanceAssignmentAdditionalData{ - // TicketLink: to.Ptr("https://snow.com"), - // TicketNumber: to.Ptr[int32](123123), - // TicketStatus: to.Ptr("Active"), - // }, - // GovernanceEmailNotification: &armsecurity.GovernanceEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(false), - // DisableOwnerEmailNotification: to.Ptr(false), - // }, - // IsGracePeriod: to.Ptr(true), - // Owner: to.Ptr("user@contoso.com"), - // RemediationDueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-07T13:00:00.000Z"); return t}()), - // RemediationEta: &armsecurity.RemediationEta{ - // Eta: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T13:00:00.000Z"); return t}()), - // Justification: to.Ptr("Justification of ETA"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/DeleteGovernanceAssignment_example.json -func ExampleGovernanceAssignmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewGovernanceAssignmentsClient().Delete(ctx, "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", "6b9421dd-5555-2251-9b3d-2be58e2f82cd", "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/governancerules_client.go b/sdk/resourcemanager/security/armsecurity/governancerules_client.go index 48a227d805f9..d5d62d26202b 100644 --- a/sdk/resourcemanager/security/armsecurity/governancerules_client.go +++ b/sdk/resourcemanager/security/armsecurity/governancerules_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -75,7 +72,7 @@ func (client *GovernanceRulesClient) CreateOrUpdate(ctx context.Context, scope s } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *GovernanceRulesClient) createOrUpdateCreateRequest(ctx context.Context, scope string, ruleID string, governanceRule GovernanceRule, options *GovernanceRulesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *GovernanceRulesClient) createOrUpdateCreateRequest(ctx context.Context, scope string, ruleID string, governanceRule GovernanceRule, _ *GovernanceRulesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}" if scope == "" { return nil, errors.New("parameter scope cannot be empty") @@ -163,7 +160,7 @@ func (client *GovernanceRulesClient) deleteOperation(ctx context.Context, scope } // deleteCreateRequest creates the Delete request. -func (client *GovernanceRulesClient) deleteCreateRequest(ctx context.Context, scope string, ruleID string, options *GovernanceRulesClientBeginDeleteOptions) (*policy.Request, error) { +func (client *GovernanceRulesClient) deleteCreateRequest(ctx context.Context, scope string, ruleID string, _ *GovernanceRulesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}" if scope == "" { return nil, errors.New("parameter scope cannot be empty") @@ -298,7 +295,7 @@ func (client *GovernanceRulesClient) Get(ctx context.Context, scope string, rule } // getCreateRequest creates the Get request. -func (client *GovernanceRulesClient) getCreateRequest(ctx context.Context, scope string, ruleID string, options *GovernanceRulesClientGetOptions) (*policy.Request, error) { +func (client *GovernanceRulesClient) getCreateRequest(ctx context.Context, scope string, ruleID string, _ *GovernanceRulesClientGetOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}" if scope == "" { return nil, errors.New("parameter scope cannot be empty") @@ -361,7 +358,7 @@ func (client *GovernanceRulesClient) NewListPager(scope string, options *Governa } // listCreateRequest creates the List request. -func (client *GovernanceRulesClient) listCreateRequest(ctx context.Context, scope string, options *GovernanceRulesClientListOptions) (*policy.Request, error) { +func (client *GovernanceRulesClient) listCreateRequest(ctx context.Context, scope string, _ *GovernanceRulesClientListOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/governanceRules" if scope == "" { return nil, errors.New("parameter scope cannot be empty") @@ -422,7 +419,7 @@ func (client *GovernanceRulesClient) OperationResults(ctx context.Context, scope } // operationResultsCreateRequest creates the OperationResults request. -func (client *GovernanceRulesClient) operationResultsCreateRequest(ctx context.Context, scope string, ruleID string, operationID string, options *GovernanceRulesClientOperationResultsOptions) (*policy.Request, error) { +func (client *GovernanceRulesClient) operationResultsCreateRequest(ctx context.Context, scope string, ruleID string, operationID string, _ *GovernanceRulesClientOperationResultsOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}" if scope == "" { return nil, errors.New("parameter scope cannot be empty") 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 b7c07290a619..000000000000 --- a/sdk/resourcemanager/security/armsecurity/governancerules_client_example_test.go +++ /dev/null @@ -1,1020 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ListByManagementGroupGovernanceRules_example.json -func ExampleGovernanceRulesClient_NewListPager_listGovernanceRulesByManagementGroupScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGovernanceRulesClient().NewListPager("providers/Microsoft.Management/managementGroups/contoso", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GovernanceRuleList = armsecurity.GovernanceRuleList{ - // Value: []*armsecurity.GovernanceRule{ - // { - // Name: to.Ptr("ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Type: to.Ptr("Microsoft.Security/governanceRules"), - // ID: to.Ptr("providers/Microsoft.Management/managementGroups/contoso/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.GovernanceRuleProperties{ - // Description: to.Ptr("A rule for a management group"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "In", - // "property": "$.AssessmentKey", - // "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]", - // }, - // }, - // }}, - // DisplayName: to.Ptr("Management group rule"), - // GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(false), - // DisableOwnerEmailNotification: to.Ptr(false), - // }, - // IsDisabled: to.Ptr(false), - // IsGracePeriod: to.Ptr(true), - // Metadata: &armsecurity.GovernanceRuleMetadata{ - // CreatedBy: to.Ptr("c23b5354-ff0a-4b2a-9f92-6f144effd936"), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T08:31:26.799Z"); return t}()), - // UpdatedBy: to.Ptr("c23b5354-ff0a-4b2a-9f92-6f144effd936"), - // UpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T08:31:26.799Z"); return t}()), - // }, - // OwnerSource: &armsecurity.GovernanceRuleOwnerSource{ - // Type: to.Ptr(armsecurity.GovernanceRuleOwnerSourceTypeManually), - // Value: to.Ptr("user@contoso.com"), - // }, - // RemediationTimeframe: to.Ptr("7.00:00:00"), - // RulePriority: to.Ptr[int32](100), - // RuleType: to.Ptr(armsecurity.GovernanceRuleTypeIntegrated), - // SourceResourceType: to.Ptr(armsecurity.GovernanceRuleSourceResourceTypeAssessments), - // TenantID: to.Ptr("f0b6d37b-e4bc-4719-9291-c066c3194f23"), - // }, - // }, - // { - // Name: to.Ptr("4106f43c-6d82-4fc8-a92c-dcfe50799d1d"), - // Type: to.Ptr("Microsoft.Security/governanceRules"), - // ID: to.Ptr("providers/Microsoft.Management/managementGroups/contoso/providers/Microsoft.Security/governanceRules/4106f43c-6d82-4fc8-a92c-dcfe50799d1d"), - // Properties: &armsecurity.GovernanceRuleProperties{ - // Description: to.Ptr("A rule for a management group"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "Equals", - // "property": "$.Metadata.Severity", - // "value": "Low", - // }, - // }, - // }}, - // DisplayName: to.Ptr("Management group rule 2"), - // ExcludedScopes: []*string{ - // to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23")}, - // GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(false), - // DisableOwnerEmailNotification: to.Ptr(false), - // }, - // IncludeMemberScopes: to.Ptr(false), - // IsDisabled: to.Ptr(false), - // IsGracePeriod: to.Ptr(true), - // Metadata: &armsecurity.GovernanceRuleMetadata{ - // CreatedBy: to.Ptr("c23b5354-ff0a-4b2a-9f92-6f144effd936"), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T08:31:26.799Z"); return t}()), - // UpdatedBy: to.Ptr("c23b5354-ff0a-4b2a-9f92-6f144effd936"), - // UpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T08:31:26.799Z"); return t}()), - // }, - // 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), - // TenantID: to.Ptr("f0b6d37b-e4bc-4719-9291-c066c3194f23"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ListBySecurityConnectorGovernanceRules_example.json -func ExampleGovernanceRulesClient_NewListPager_listGovernanceRulesBySecurityConnectorScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGovernanceRulesClient().NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GovernanceRuleList = armsecurity.GovernanceRuleList{ - // Value: []*armsecurity.GovernanceRule{ - // { - // Name: to.Ptr("ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Type: to.Ptr("Microsoft.Security/governanceRules"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.GovernanceRuleProperties{ - // Description: to.Ptr("A rule on critical GCP recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "In", - // "property": "$.AssessmentKey", - // "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]", - // }, - // }, - // }}, - // DisplayName: to.Ptr("Admin's GCP rule"), - // ExcludedScopes: []*string{ - // }, - // GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(false), - // DisableOwnerEmailNotification: to.Ptr(false), - // }, - // IncludeMemberScopes: to.Ptr(false), - // IsDisabled: to.Ptr(false), - // IsGracePeriod: to.Ptr(true), - // Metadata: &armsecurity.GovernanceRuleMetadata{ - // CreatedBy: to.Ptr("c23b5354-ff0a-4b2a-9f92-6f144effd936"), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T08:31:26.799Z"); return t}()), - // UpdatedBy: to.Ptr("c23b5354-ff0a-4b2a-9f92-6f144effd936"), - // UpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T08:31:26.799Z"); return t}()), - // }, - // OwnerSource: &armsecurity.GovernanceRuleOwnerSource{ - // Type: to.Ptr(armsecurity.GovernanceRuleOwnerSourceTypeManually), - // Value: to.Ptr("user@contoso.com"), - // }, - // RemediationTimeframe: to.Ptr("7.00:00:00"), - // RulePriority: to.Ptr[int32](100), - // RuleType: to.Ptr(armsecurity.GovernanceRuleTypeIntegrated), - // SourceResourceType: to.Ptr(armsecurity.GovernanceRuleSourceResourceTypeAssessments), - // TenantID: to.Ptr("f0b6d37b-e4bc-4719-9291-c066c3194f23"), - // }, - // }, - // { - // Name: to.Ptr("4106f43c-6d82-4fc8-a92c-dcfe50799d1d"), - // Type: to.Ptr("Microsoft.Security/governanceRules"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector/providers/Microsoft.Security/governanceRules/4106f43c-6d82-4fc8-a92c-dcfe50799d1d"), - // Properties: &armsecurity.GovernanceRuleProperties{ - // Description: to.Ptr("A rule on critical GCP recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "Equals", - // "property": "$.Metadata.Severity", - // "value": "Low", - // }, - // }, - // }}, - // DisplayName: to.Ptr("GCP Admin's rule"), - // ExcludedScopes: []*string{ - // }, - // GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(false), - // DisableOwnerEmailNotification: to.Ptr(false), - // }, - // IncludeMemberScopes: to.Ptr(false), - // IsDisabled: to.Ptr(false), - // IsGracePeriod: to.Ptr(true), - // Metadata: &armsecurity.GovernanceRuleMetadata{ - // CreatedBy: to.Ptr("c23b5354-ff0a-4b2a-9f92-6f144effd936"), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T08:31:26.799Z"); return t}()), - // UpdatedBy: to.Ptr("c23b5354-ff0a-4b2a-9f92-6f144effd936"), - // UpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T08:31:26.799Z"); return t}()), - // }, - // 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), - // TenantID: to.Ptr("f0b6d37b-e4bc-4719-9291-c066c3194f23"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ListBySubscriptionGovernanceRules_example.json -func ExampleGovernanceRulesClient_NewListPager_listGovernanceRulesBySubscriptionScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGovernanceRulesClient().NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GovernanceRuleList = armsecurity.GovernanceRuleList{ - // Value: []*armsecurity.GovernanceRule{ - // { - // Name: to.Ptr("ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Type: to.Ptr("Microsoft.Security/governanceRules"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.GovernanceRuleProperties{ - // Description: to.Ptr("A rule for critical recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "In", - // "property": "$.AssessmentKey", - // "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]", - // }, - // }, - // }}, - // DisplayName: to.Ptr("Admin's rule"), - // ExcludedScopes: []*string{ - // }, - // GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(false), - // DisableOwnerEmailNotification: to.Ptr(false), - // }, - // IncludeMemberScopes: to.Ptr(false), - // IsDisabled: to.Ptr(false), - // IsGracePeriod: to.Ptr(true), - // Metadata: &armsecurity.GovernanceRuleMetadata{ - // CreatedBy: to.Ptr("c23b5354-ff0a-4b2a-9f92-6f144effd936"), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T08:31:26.799Z"); return t}()), - // UpdatedBy: to.Ptr("c23b5354-ff0a-4b2a-9f92-6f144effd936"), - // UpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T08:31:26.799Z"); return t}()), - // }, - // OwnerSource: &armsecurity.GovernanceRuleOwnerSource{ - // Type: to.Ptr(armsecurity.GovernanceRuleOwnerSourceTypeManually), - // Value: to.Ptr("user@contoso.com"), - // }, - // RemediationTimeframe: to.Ptr("7.00:00:00"), - // RulePriority: to.Ptr[int32](100), - // RuleType: to.Ptr(armsecurity.GovernanceRuleTypeIntegrated), - // SourceResourceType: to.Ptr(armsecurity.GovernanceRuleSourceResourceTypeAssessments), - // TenantID: to.Ptr("f0b6d37b-e4bc-4719-9291-c066c3194f23"), - // }, - // }, - // { - // Name: to.Ptr("4106f43c-6d82-4fc8-a92c-dcfe50799d1d"), - // Type: to.Ptr("Microsoft.Security/governanceRules"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/governanceRules/4106f43c-6d82-4fc8-a92c-dcfe50799d1d"), - // Properties: &armsecurity.GovernanceRuleProperties{ - // Description: to.Ptr("A rule for critical recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "Equals", - // "property": "$.Metadata.Severity", - // "value": "Low", - // }, - // }, - // }}, - // DisplayName: to.Ptr("Admin's rule"), - // ExcludedScopes: []*string{ - // }, - // GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(true), - // DisableOwnerEmailNotification: to.Ptr(true), - // }, - // IncludeMemberScopes: to.Ptr(false), - // IsDisabled: to.Ptr(false), - // IsGracePeriod: to.Ptr(true), - // Metadata: &armsecurity.GovernanceRuleMetadata{ - // CreatedBy: to.Ptr("c23b5354-ff0a-4b2a-9f92-6f144effd936"), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T08:31:26.799Z"); return t}()), - // UpdatedBy: to.Ptr("c23b5354-ff0a-4b2a-9f92-6f144effd936"), - // UpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T08:31:26.799Z"); return t}()), - // }, - // 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), - // TenantID: to.Ptr("f0b6d37b-e4bc-4719-9291-c066c3194f23"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRule_example.json -func ExampleGovernanceRulesClient_Get_getAGovernanceRuleOverManagementGroupScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGovernanceRulesClient().Get(ctx, "providers/Microsoft.Management/managementGroups/contoso", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GovernanceRule = armsecurity.GovernanceRule{ - // Name: to.Ptr("ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Type: to.Ptr("Microsoft.Security/governanceRules"), - // ID: to.Ptr("providers/Microsoft.Management/managementGroups/contoso/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.GovernanceRuleProperties{ - // Description: to.Ptr("A rule for a management group"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "In", - // "property": "$.AssessmentKey", - // "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]", - // }, - // }, - // }}, - // DisplayName: to.Ptr("Management group rule"), - // ExcludedScopes: []*string{ - // to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23")}, - // GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(false), - // DisableOwnerEmailNotification: to.Ptr(false), - // }, - // IncludeMemberScopes: to.Ptr(false), - // IsDisabled: to.Ptr(false), - // IsGracePeriod: to.Ptr(true), - // Metadata: &armsecurity.GovernanceRuleMetadata{ - // CreatedBy: to.Ptr("c23b5354-ff0a-4b2a-9f92-6f144effd936"), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T08:31:26.799Z"); return t}()), - // UpdatedBy: to.Ptr("c23b5354-ff0a-4b2a-9f92-6f144effd936"), - // UpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T08:31:26.799Z"); return t}()), - // }, - // 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), - // TenantID: to.Ptr("f0b6d37b-e4bc-4719-9291-c066c3194f23"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRule_example.json -func ExampleGovernanceRulesClient_Get_getAGovernanceRuleOverSecurityConnectorScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGovernanceRulesClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GovernanceRule = armsecurity.GovernanceRule{ - // Name: to.Ptr("ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Type: to.Ptr("Microsoft.Security/governanceRules"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.GovernanceRuleProperties{ - // Description: to.Ptr("A rule on critical GCP recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "In", - // "property": "$.AssessmentKey", - // "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]", - // }, - // }, - // }}, - // DisplayName: to.Ptr("GCP Admin's rule"), - // ExcludedScopes: []*string{ - // }, - // GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(false), - // DisableOwnerEmailNotification: to.Ptr(false), - // }, - // IncludeMemberScopes: to.Ptr(false), - // IsDisabled: to.Ptr(false), - // IsGracePeriod: to.Ptr(true), - // Metadata: &armsecurity.GovernanceRuleMetadata{ - // CreatedBy: to.Ptr("c23b5354-ff0a-4b2a-9f92-6f144effd936"), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T08:31:26.799Z"); return t}()), - // UpdatedBy: to.Ptr("c23b5354-ff0a-4b2a-9f92-6f144effd936"), - // UpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T08:31:26.799Z"); return t}()), - // }, - // 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), - // TenantID: to.Ptr("f0b6d37b-e4bc-4719-9291-c066c3194f23"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRule_example.json -func ExampleGovernanceRulesClient_Get_getAGovernanceRuleOverSubscriptionScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGovernanceRulesClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GovernanceRule = armsecurity.GovernanceRule{ - // Name: to.Ptr("ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Type: to.Ptr("Microsoft.Security/governanceRules"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.GovernanceRuleProperties{ - // Description: to.Ptr("A rule for critical recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "In", - // "property": "$.AssessmentKey", - // "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]", - // }, - // }, - // }}, - // DisplayName: to.Ptr("Admin's rule"), - // ExcludedScopes: []*string{ - // }, - // GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(false), - // DisableOwnerEmailNotification: to.Ptr(false), - // }, - // IncludeMemberScopes: to.Ptr(false), - // IsDisabled: to.Ptr(false), - // IsGracePeriod: to.Ptr(true), - // Metadata: &armsecurity.GovernanceRuleMetadata{ - // CreatedBy: to.Ptr("c23b5354-ff0a-4b2a-9f92-6f144effd936"), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T08:31:26.799Z"); return t}()), - // UpdatedBy: to.Ptr("c23b5354-ff0a-4b2a-9f92-6f144effd936"), - // UpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T08:31:26.799Z"); return t}()), - // }, - // 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), - // TenantID: to.Ptr("f0b6d37b-e4bc-4719-9291-c066c3194f23"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PutManagementGroupGovernanceRule_example.json -func ExampleGovernanceRulesClient_CreateOrUpdate_createOrUpdateGovernanceRuleOverManagementGroupScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGovernanceRulesClient().CreateOrUpdate(ctx, "providers/Microsoft.Management/managementGroups/contoso", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", armsecurity.GovernanceRule{ - Properties: &armsecurity.GovernanceRuleProperties{ - Description: to.Ptr("A rule for a management group"), - ConditionSets: []any{ - map[string]any{ - "conditions": []any{ - map[string]any{ - "operator": "In", - "property": "$.AssessmentKey", - "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]", - }, - }, - }}, - DisplayName: to.Ptr("Management group rule"), - ExcludedScopes: []*string{ - to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23")}, - GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - DisableManagerEmailNotification: to.Ptr(true), - DisableOwnerEmailNotification: to.Ptr(false), - }, - IsDisabled: to.Ptr(false), - IsGracePeriod: to.Ptr(true), - OwnerSource: &armsecurity.GovernanceRuleOwnerSource{ - Type: to.Ptr(armsecurity.GovernanceRuleOwnerSourceTypeManually), - Value: to.Ptr("user@contoso.com"), - }, - RemediationTimeframe: to.Ptr("7.00:00:00"), - RulePriority: to.Ptr[int32](200), - RuleType: to.Ptr(armsecurity.GovernanceRuleTypeIntegrated), - SourceResourceType: to.Ptr(armsecurity.GovernanceRuleSourceResourceTypeAssessments), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GovernanceRule = armsecurity.GovernanceRule{ - // Name: to.Ptr("ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Type: to.Ptr("Microsoft.Security/governanceRules"), - // ID: to.Ptr("providers/Microsoft.Management/managementGroups/contoso/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.GovernanceRuleProperties{ - // Description: to.Ptr("A rule for a management group"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "In", - // "property": "$.AssessmentKey", - // "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]", - // }, - // }, - // }}, - // DisplayName: to.Ptr("Management group rule"), - // ExcludedScopes: []*string{ - // to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23")}, - // GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(true), - // DisableOwnerEmailNotification: to.Ptr(false), - // }, - // IncludeMemberScopes: to.Ptr(false), - // IsDisabled: to.Ptr(false), - // IsGracePeriod: to.Ptr(true), - // Metadata: &armsecurity.GovernanceRuleMetadata{ - // CreatedBy: to.Ptr("c23b5354-ff0a-4b2a-9f92-6f144effd936"), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T08:31:26.799Z"); return t}()), - // UpdatedBy: to.Ptr("c23b5354-ff0a-4b2a-9f92-6f144effd936"), - // UpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T08:31:26.799Z"); return t}()), - // }, - // 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), - // TenantID: to.Ptr("f0b6d37b-e4bc-4719-9291-c066c3194f23"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PutSecurityConnectorGovernanceRule_example.json -func ExampleGovernanceRulesClient_CreateOrUpdate_createOrUpdateGovernanceRuleOverSecurityConnectorScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGovernanceRulesClient().CreateOrUpdate(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", armsecurity.GovernanceRule{ - Properties: &armsecurity.GovernanceRuleProperties{ - Description: to.Ptr("A rule on critical GCP recommendations"), - ConditionSets: []any{ - map[string]any{ - "conditions": []any{ - map[string]any{ - "operator": "In", - "property": "$.AssessmentKey", - "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]", - }, - }, - }}, - DisplayName: to.Ptr("GCP Admin's rule"), - GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - DisableManagerEmailNotification: to.Ptr(true), - DisableOwnerEmailNotification: to.Ptr(false), - }, - IsDisabled: to.Ptr(false), - IsGracePeriod: to.Ptr(true), - OwnerSource: &armsecurity.GovernanceRuleOwnerSource{ - Type: to.Ptr(armsecurity.GovernanceRuleOwnerSourceTypeManually), - Value: to.Ptr("user@contoso.com"), - }, - RemediationTimeframe: to.Ptr("7.00:00:00"), - RulePriority: to.Ptr[int32](200), - RuleType: to.Ptr(armsecurity.GovernanceRuleTypeIntegrated), - SourceResourceType: to.Ptr(armsecurity.GovernanceRuleSourceResourceTypeAssessments), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GovernanceRule = armsecurity.GovernanceRule{ - // Name: to.Ptr("ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Type: to.Ptr("Microsoft.Security/governanceRules"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.GovernanceRuleProperties{ - // Description: to.Ptr("A rule on critical GCP recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "In", - // "property": "$.AssessmentKey", - // "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]", - // }, - // }, - // }}, - // DisplayName: to.Ptr("GCP Admin's rule"), - // ExcludedScopes: []*string{ - // }, - // GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(true), - // DisableOwnerEmailNotification: to.Ptr(false), - // }, - // IncludeMemberScopes: to.Ptr(false), - // IsDisabled: to.Ptr(false), - // IsGracePeriod: to.Ptr(true), - // Metadata: &armsecurity.GovernanceRuleMetadata{ - // CreatedBy: to.Ptr("c23b5354-ff0a-4b2a-9f92-6f144effd936"), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T08:31:26.799Z"); return t}()), - // UpdatedBy: to.Ptr("c23b5354-ff0a-4b2a-9f92-6f144effd936"), - // UpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T08:31:26.799Z"); return t}()), - // }, - // 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), - // TenantID: to.Ptr("f0b6d37b-e4bc-4719-9291-c066c3194f23"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PutGovernanceRule_example.json -func ExampleGovernanceRulesClient_CreateOrUpdate_createOrUpdateGovernanceRuleOverSubscriptionScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGovernanceRulesClient().CreateOrUpdate(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", armsecurity.GovernanceRule{ - Properties: &armsecurity.GovernanceRuleProperties{ - Description: to.Ptr("A rule for critical recommendations"), - ConditionSets: []any{ - map[string]any{ - "conditions": []any{ - map[string]any{ - "operator": "In", - "property": "$.AssessmentKey", - "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]", - }, - }, - }}, - DisplayName: to.Ptr("Admin's rule"), - GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - DisableManagerEmailNotification: to.Ptr(false), - DisableOwnerEmailNotification: to.Ptr(false), - }, - IsDisabled: to.Ptr(false), - IsGracePeriod: to.Ptr(true), - OwnerSource: &armsecurity.GovernanceRuleOwnerSource{ - Type: to.Ptr(armsecurity.GovernanceRuleOwnerSourceTypeManually), - Value: to.Ptr("user@contoso.com"), - }, - RemediationTimeframe: to.Ptr("7.00:00:00"), - RulePriority: to.Ptr[int32](200), - RuleType: to.Ptr(armsecurity.GovernanceRuleTypeIntegrated), - SourceResourceType: to.Ptr(armsecurity.GovernanceRuleSourceResourceTypeAssessments), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GovernanceRule = armsecurity.GovernanceRule{ - // Name: to.Ptr("ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Type: to.Ptr("Microsoft.Security/governanceRules"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8"), - // Properties: &armsecurity.GovernanceRuleProperties{ - // Description: to.Ptr("A rule for critical recommendations"), - // ConditionSets: []any{ - // map[string]any{ - // "conditions":[]any{ - // map[string]any{ - // "operator": "In", - // "property": "$.AssessmentKey", - // "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]", - // }, - // }, - // }}, - // DisplayName: to.Ptr("Admin's rule"), - // ExcludedScopes: []*string{ - // }, - // GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(false), - // DisableOwnerEmailNotification: to.Ptr(false), - // }, - // IncludeMemberScopes: to.Ptr(false), - // IsDisabled: to.Ptr(false), - // IsGracePeriod: to.Ptr(true), - // Metadata: &armsecurity.GovernanceRuleMetadata{ - // CreatedBy: to.Ptr("c23b5354-ff0a-4b2a-9f92-6f144effd936"), - // CreatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T08:31:26.799Z"); return t}()), - // UpdatedBy: to.Ptr("c23b5354-ff0a-4b2a-9f92-6f144effd936"), - // UpdatedOn: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-11-10T08:31:26.799Z"); return t}()), - // }, - // 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), - // TenantID: to.Ptr("f0b6d37b-e4bc-4719-9291-c066c3194f23"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteManagementGroupGovernanceRule_example.json -func ExampleGovernanceRulesClient_BeginDelete_deleteAGovernanceRuleOverManagementGroupScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGovernanceRulesClient().BeginDelete(ctx, "providers/Microsoft.Management/managementGroups/contoso", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteSecurityConnectorGovernanceRule_example.json -func ExampleGovernanceRulesClient_BeginDelete_deleteAGovernanceRuleOverSecurityConnectorScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGovernanceRulesClient().BeginDelete(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteGovernanceRule_example.json -func ExampleGovernanceRulesClient_BeginDelete_deleteAGovernanceRuleOverSubscriptionScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGovernanceRulesClient().BeginDelete(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PostGovernanceRule_example.json -func ExampleGovernanceRulesClient_BeginExecute_executeGovernanceRuleOverSubscriptionScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGovernanceRulesClient().BeginExecute(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", &armsecurity.GovernanceRulesClientBeginExecuteOptions{ExecuteGovernanceRuleParams: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PostManagementGroupGovernanceRule_example.json -func ExampleGovernanceRulesClient_BeginExecute_executeGovernanceRuleOverManagementGroupScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGovernanceRulesClient().BeginExecute(ctx, "providers/Microsoft.Management/managementGroups/contoso", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", &armsecurity.GovernanceRulesClientBeginExecuteOptions{ExecuteGovernanceRuleParams: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PostSecurityConnectorGovernanceRule_example.json -func ExampleGovernanceRulesClient_BeginExecute_executeGovernanceRuleOverSecurityConnectorScope() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewGovernanceRulesClient().BeginExecute(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", &armsecurity.GovernanceRulesClientBeginExecuteOptions{ExecuteGovernanceRuleParams: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetManagementGroupGovernanceRuleExecuteStatus_example.json -func ExampleGovernanceRulesClient_OperationResults_getGovernanceRulesLongRunOperationResultOverManagementGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGovernanceRulesClient().OperationResults(ctx, "providers/Microsoft.Management/managementGroups/contoso", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationResultAutoGenerated = armsecurity.OperationResultAutoGenerated{ - // Status: to.Ptr(armsecurity.OperationResultSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRuleExecuteStatus_example.json -func ExampleGovernanceRulesClient_OperationResults_getGovernanceRulesLongRunOperationResultOverSecurityConnector() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGovernanceRulesClient().OperationResults(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationResultAutoGenerated = armsecurity.OperationResultAutoGenerated{ - // Status: to.Ptr(armsecurity.OperationResultSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRuleExecuteStatus_example.json -func ExampleGovernanceRulesClient_OperationResults_getGovernanceRulesLongRunOperationResultOverSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGovernanceRulesClient().OperationResults(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationResultAutoGenerated = armsecurity.OperationResultAutoGenerated{ - // Status: to.Ptr(armsecurity.OperationResultSucceeded), - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/healthreports_client.go b/sdk/resourcemanager/security/armsecurity/healthreports_client.go index 53fac9ea1cb3..b344abce0ead 100644 --- a/sdk/resourcemanager/security/armsecurity/healthreports_client.go +++ b/sdk/resourcemanager/security/armsecurity/healthreports_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -70,7 +67,7 @@ func (client *HealthReportsClient) Get(ctx context.Context, resourceID string, h } // getCreateRequest creates the Get request. -func (client *HealthReportsClient) getCreateRequest(ctx context.Context, resourceID string, healthReportName string, options *HealthReportsClientGetOptions) (*policy.Request, error) { +func (client *HealthReportsClient) getCreateRequest(ctx context.Context, resourceID string, healthReportName string, _ *HealthReportsClientGetOptions) (*policy.Request, error) { urlPath := "/{resourceId}/providers/Microsoft.Security/healthReports/{healthReportName}" urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID) if healthReportName == "" { @@ -128,7 +125,7 @@ func (client *HealthReportsClient) NewListPager(scope string, options *HealthRep } // listCreateRequest creates the List request. -func (client *HealthReportsClient) listCreateRequest(ctx context.Context, scope string, options *HealthReportsClientListOptions) (*policy.Request, error) { +func (client *HealthReportsClient) listCreateRequest(ctx context.Context, scope string, _ *HealthReportsClientListOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/healthReports" urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) diff --git a/sdk/resourcemanager/security/armsecurity/healthreports_client_example_test.go b/sdk/resourcemanager/security/armsecurity/healthreports_client_example_test.go deleted file mode 100644 index 2c9c814253f9..000000000000 --- a/sdk/resourcemanager/security/armsecurity/healthreports_client_example_test.go +++ /dev/null @@ -1,143 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-05-01-preview/examples/HealthReports/ListHealthReports_example.json -func ExampleHealthReportsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewHealthReportsClient().NewListPager("subscriptions/a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.HealthReportsList = armsecurity.HealthReportsList{ - // Value: []*armsecurity.HealthReport{ - // { - // Name: to.Ptr("2351eaac-f8e6-43d8-87c0-a7e2c3d197c0"), - // Type: to.Ptr("Microsoft.Security/healthReports"), - // ID: to.Ptr("/subscriptions/a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2/resourcegroups/ascdemorg/providers/microsoft.compute/virtualmachines/vm3/providers/Microsoft.Security/healthReports/2351eaac-f8e6-43d8-87c0-a7e2c3d197c0"), - // Properties: &armsecurity.HealthReportProperties{ - // AffectedDefendersPlans: []*string{ - // to.Ptr("DefenderForServers")}, - // EnvironmentDetails: &armsecurity.EnvironmentDetails{ - // EnvironmentHierarchyID: to.Ptr("a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2"), - // NativeResourceID: to.Ptr("/subscriptions/a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2/resourcegroups/ascdemorg/providers/microsoft.compute/virtualmachines/vm3"), - // OrganizationalHierarchyID: to.Ptr("200d73cf-ba70-4b93-8fa2-25e05e6aa1f6"), - // SubscriptionID: to.Ptr("a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2"), - // TenantID: to.Ptr("200d73cf-ba70-4b93-8fa2-25e05e6aa1f6"), - // }, - // HealthDataClassification: &armsecurity.HealthDataClassification{ - // Component: to.Ptr("MDE"), - // Scenario: to.Ptr("Reporting"), - // Scope: to.Ptr("VirtualMachines"), - // }, - // Issues: []*armsecurity.Issue{ - // }, - // ResourceDetails: &armsecurity.ResourceDetailsAutoGenerated{ - // ID: to.Ptr("/subscriptions/a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2/resourcegroups/ascdemorg/providers/microsoft.compute/virtualmachines/vm3"), - // Source: to.Ptr(armsecurity.SourceAzure), - // }, - // Status: &armsecurity.StatusAutoGenerated{ - // Code: to.Ptr(armsecurity.StatusNameHealthy), - // FirstEvaluationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-12T09:07:18.675Z"); return t}()), - // LastScannedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-25T09:02:20.134Z"); return t}()), - // StatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-12T09:07:18.675Z"); return t}()), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-05-01-preview/examples/HealthReports/GetHealthReports_example.json -func ExampleHealthReportsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewHealthReportsClient().Get(ctx, "subscriptions/a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2/resourcegroups/E2E-IBB0WX/providers/Microsoft.Security/securityconnectors/AwsConnectorAllOfferings", "909c629a-bf39-4521-8e4f-10b443a0bc02", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.HealthReport = armsecurity.HealthReport{ - // Name: to.Ptr("909c629a-bf39-4521-8e4f-10b443a0bc02"), - // Type: to.Ptr("Microsoft.Security/healthReports"), - // ID: to.Ptr("/subscriptions/a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2/resourcegroups/E2E-IBB0WX/providers/Microsoft.Security/securityconnectors/AwsConnectorAllOfferings/providers/Microsoft.Security/healthReports/909c629a-bf39-4521-8e4f-10b443a0bc02"), - // Properties: &armsecurity.HealthReportProperties{ - // AffectedDefendersPlans: []*string{ - // }, - // EnvironmentDetails: &armsecurity.EnvironmentDetails{ - // EnvironmentHierarchyID: to.Ptr("a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2"), - // NativeResourceID: to.Ptr("arn:aws:iam::827098768879"), - // OrganizationalHierarchyID: to.Ptr("e81b978c-11be-449f-a392-42c0ed96bb91"), - // SubscriptionID: to.Ptr("a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2"), - // TenantID: to.Ptr("a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2"), - // }, - // HealthDataClassification: &armsecurity.HealthDataClassification{ - // Component: to.Ptr("Connectivity"), - // Scope: to.Ptr("Connectors"), - // }, - // Issues: []*armsecurity.Issue{ - // { - // IssueAdditionalData: map[string]*string{ - // "StacksetName": to.Ptr("ProdStackSet"), - // }, - // IssueDescription: to.Ptr("A problem was identified with the AWS CloudFormation StackSet. The StackSet is used to create stacks across multiple accounts. To grant Defender for Cloud access to your member accounts, there is a need to run the StackSet on the member accounts."), - // IssueKey: to.Ptr("414af15d-207e-4c63-b8eb-624d1b652e45"), - // IssueName: to.Ptr("AWS CloudFormation StackSet name invalid or does not exist"), - // RemediationScript: to.Ptr(""), - // RemediationSteps: to.Ptr("Validate that the StackSet name in AWS matches the name provided in the onboarding set up: StackSet name can be found in AWS Management Console -> CloudFormation -> StackSets -> StackSet name In case the names do not match, update the StackSet name to match the StackSet name provided in the onboarding set up. In case the StackSet does not exist, re-run the CloudFormation template only for StackSet. Navigate to CloudFormation 'StackSets' in AWS Management Console -> Click 'Create StackSet' -> Choose 'Upload a template file', `Choose file` and select the downloaded template. Make sure to enter the exact StackSet name as it was provided in the onboarding set up. Download template link "), - // SecurityValues: []*string{ - // to.Ptr("Connectivity to AWS member accounts")}, - // }}, - // ResourceDetails: &armsecurity.ResourceDetailsAutoGenerated{ - // ConnectorID: to.Ptr("bb7ad9cc-26b6-48ec-a5b4-23fc23be2733"), - // ID: to.Ptr("/subscriptions/a1efb6ca-fbc5-4782-9aaa-5c7daded1ce2/resourcegroups/E2E-IBB0WX/providers/Microsoft.Security/securityconnectors/AwsConnectorAllOfferings"), - // Source: to.Ptr(armsecurity.Source("Aws")), - // }, - // Status: &armsecurity.StatusAutoGenerated{ - // Code: to.Ptr(armsecurity.StatusNameNotHealthy), - // FirstEvaluationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-12T09:07:18.675Z"); return t}()), - // LastScannedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-04-25T09:02:20.134Z"); return t}()), - // StatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-12T09:07:18.675Z"); return t}()), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/informationprotectionpolicies_client.go b/sdk/resourcemanager/security/armsecurity/informationprotectionpolicies_client.go index 077b5740e34e..1fd6d0cef4ae 100644 --- a/sdk/resourcemanager/security/armsecurity/informationprotectionpolicies_client.go +++ b/sdk/resourcemanager/security/armsecurity/informationprotectionpolicies_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -73,7 +70,7 @@ func (client *InformationProtectionPoliciesClient) CreateOrUpdate(ctx context.Co } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *InformationProtectionPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, scope string, informationProtectionPolicyName InformationProtectionPolicyName, informationProtectionPolicy InformationProtectionPolicy, options *InformationProtectionPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *InformationProtectionPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, scope string, informationProtectionPolicyName InformationProtectionPolicyName, informationProtectionPolicy InformationProtectionPolicy, _ *InformationProtectionPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}" urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) if informationProtectionPolicyName == "" { @@ -135,7 +132,7 @@ func (client *InformationProtectionPoliciesClient) Get(ctx context.Context, scop } // getCreateRequest creates the Get request. -func (client *InformationProtectionPoliciesClient) getCreateRequest(ctx context.Context, scope string, informationProtectionPolicyName InformationProtectionPolicyName, options *InformationProtectionPoliciesClientGetOptions) (*policy.Request, error) { +func (client *InformationProtectionPoliciesClient) getCreateRequest(ctx context.Context, scope string, informationProtectionPolicyName InformationProtectionPolicyName, _ *InformationProtectionPoliciesClientGetOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}" urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) if informationProtectionPolicyName == "" { @@ -193,7 +190,7 @@ func (client *InformationProtectionPoliciesClient) NewListPager(scope string, op } // listCreateRequest creates the List request. -func (client *InformationProtectionPoliciesClient) listCreateRequest(ctx context.Context, scope string, options *InformationProtectionPoliciesClientListOptions) (*policy.Request, error) { +func (client *InformationProtectionPoliciesClient) listCreateRequest(ctx context.Context, scope string, _ *InformationProtectionPoliciesClientListOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/informationProtectionPolicies" urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) 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 c467e431b0e9..000000000000 --- a/sdk/resourcemanager/security/armsecurity/informationprotectionpolicies_client_example_test.go +++ /dev/null @@ -1,512 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/GetCustomInformationProtectionPolicy_example.json -func ExampleInformationProtectionPoliciesClient_Get_getTheCustomizedInformationProtectionPolicyForAManagementGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInformationProtectionPoliciesClient().Get(ctx, "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", armsecurity.InformationProtectionPolicyNameCustom, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.InformationProtectionPolicy = armsecurity.InformationProtectionPolicy{ - // Name: to.Ptr("custom"), - // Type: to.Ptr("Microsoft.Security/informationProtectionPolicies"), - // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e/providers/Microsoft.Security/informationProtectionPolicies/custom"), - // Properties: &armsecurity.InformationProtectionPolicyProperties{ - // InformationTypes: map[string]*armsecurity.InformationType{ - // "3bf35491-99b8-41f2-86d5-c1200a7df658": &armsecurity.InformationType{ - // Custom: to.Ptr(true), - // DisplayName: to.Ptr("Custom"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(true), - // Custom: to.Ptr(true), - // Pattern: to.Ptr("%custom%"), - // }}, - // Order: to.Ptr[int32](1400), - // RecommendedLabelID: to.Ptr("7aa516c7-5a53-4857-bc6e-6808c6acd542"), - // }, - // "7fb9419d-2473-4ad8-8e11-b25cc8cf6a07": &armsecurity.InformationType{ - // Custom: to.Ptr(false), - // DisplayName: to.Ptr("Networking"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(true), - // Pattern: to.Ptr("%networking%"), - // }}, - // Order: to.Ptr[int32](100), - // RecommendedLabelID: to.Ptr("575739d2-3d53-4df0-9042-4c7772d5c7b1"), - // }, - // }, - // Labels: map[string]*armsecurity.SensitivityLabel{ - // "1345da73-bc5a-4a8f-b7dd-3820eb713da8": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("Public"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](100), - // }, - // "575739d2-3d53-4df0-9042-4c7772d5c7b1": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("Confidential"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](300), - // }, - // "7aa516c7-5a53-4857-bc6e-6808c6acd542": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("General"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](200), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/GetEffectiveInformationProtectionPolicy_example.json -func ExampleInformationProtectionPoliciesClient_Get_getTheEffectiveInformationProtectionPolicyForAManagementGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInformationProtectionPoliciesClient().Get(ctx, "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", armsecurity.InformationProtectionPolicyNameEffective, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.InformationProtectionPolicy = armsecurity.InformationProtectionPolicy{ - // Name: to.Ptr("effective"), - // Type: to.Ptr("Microsoft.Security/informationProtectionPolicies"), - // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e/providers/Microsoft.Security/informationProtectionPolicies/effective"), - // Properties: &armsecurity.InformationProtectionPolicyProperties{ - // InformationTypes: map[string]*armsecurity.InformationType{ - // "3bf35491-99b8-41f2-86d5-c1200a7df658": &armsecurity.InformationType{ - // Custom: to.Ptr(true), - // DisplayName: to.Ptr("Custom"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(true), - // Pattern: to.Ptr("%networking%"), - // }}, - // Order: to.Ptr[int32](1400), - // RecommendedLabelID: to.Ptr("7aa516c7-5a53-4857-bc6e-6808c6acd542"), - // }, - // "5856f35c-8e08-4d08-9bf7-87a146150569": &armsecurity.InformationType{ - // Custom: to.Ptr(false), - // DisplayName: to.Ptr("Contact Info"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%email%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%e-mail%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%addr%"), - // }, - // { - // CanBeNumeric: to.Ptr(true), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%street%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%city%"), - // }}, - // Order: to.Ptr[int32](200), - // RecommendedLabelID: to.Ptr("575739d2-3d53-4df0-9042-4c7772d5c7b1"), - // }, - // "7fb9419d-2473-4ad8-8e11-b25cc8cf6a07": &armsecurity.InformationType{ - // Custom: to.Ptr(false), - // DisplayName: to.Ptr("Networking"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%ip%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("ip%address%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%mac%address%"), - // }, - // { - // CanBeNumeric: to.Ptr(true), - // Custom: to.Ptr(true), - // Excluded: to.Ptr(true), - // Pattern: to.Ptr("%networking%"), - // }}, - // Order: to.Ptr[int32](100), - // RecommendedLabelID: to.Ptr("575739d2-3d53-4df0-9042-4c7772d5c7b1"), - // }, - // }, - // Labels: map[string]*armsecurity.SensitivityLabel{ - // "1345da73-bc5a-4a8f-b7dd-3820eb713da8": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("Public"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](100), - // }, - // "575739d2-3d53-4df0-9042-4c7772d5c7b1": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("Confidential"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](300), - // }, - // "7aa516c7-5a53-4857-bc6e-6808c6acd542": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("General"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](200), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/CreateOrUpdateInformationProtectionPolicy_example.json -func ExampleInformationProtectionPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewInformationProtectionPoliciesClient().CreateOrUpdate(ctx, "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", armsecurity.InformationProtectionPolicyNameCustom, armsecurity.InformationProtectionPolicy{ - Properties: &armsecurity.InformationProtectionPolicyProperties{ - InformationTypes: map[string]*armsecurity.InformationType{ - "3bf35491-99b8-41f2-86d5-c1200a7df658": { - Custom: to.Ptr(true), - DisplayName: to.Ptr("Custom"), - Enabled: to.Ptr(true), - Keywords: []*armsecurity.InformationProtectionKeyword{ - { - CanBeNumeric: to.Ptr(true), - Custom: to.Ptr(true), - Pattern: to.Ptr("%custom%"), - }}, - Order: to.Ptr[int32](1400), - RecommendedLabelID: to.Ptr("7aa516c7-5a53-4857-bc6e-6808c6acd542"), - }, - "7fb9419d-2473-4ad8-8e11-b25cc8cf6a07": { - Custom: to.Ptr(false), - DisplayName: to.Ptr("Networking"), - Enabled: to.Ptr(true), - Keywords: []*armsecurity.InformationProtectionKeyword{ - { - CanBeNumeric: to.Ptr(false), - Custom: to.Ptr(true), - Pattern: to.Ptr("%networking%"), - }}, - Order: to.Ptr[int32](100), - RecommendedLabelID: to.Ptr("575739d2-3d53-4df0-9042-4c7772d5c7b1"), - }, - }, - Labels: map[string]*armsecurity.SensitivityLabel{ - "1345da73-bc5a-4a8f-b7dd-3820eb713da8": { - DisplayName: to.Ptr("Public"), - Enabled: to.Ptr(true), - Order: to.Ptr[int32](100), - }, - "575739d2-3d53-4df0-9042-4c7772d5c7b1": { - DisplayName: to.Ptr("Confidential"), - Enabled: to.Ptr(true), - Order: to.Ptr[int32](300), - }, - "7aa516c7-5a53-4857-bc6e-6808c6acd542": { - DisplayName: to.Ptr("General"), - Enabled: to.Ptr(true), - Order: to.Ptr[int32](200), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.InformationProtectionPolicy = armsecurity.InformationProtectionPolicy{ - // Name: to.Ptr("custom"), - // Type: to.Ptr("Microsoft.Security/informationProtectionPolicies"), - // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e/providers/Microsoft.Security/informationProtectionPolicies/custom"), - // Properties: &armsecurity.InformationProtectionPolicyProperties{ - // InformationTypes: map[string]*armsecurity.InformationType{ - // "3bf35491-99b8-41f2-86d5-c1200a7df658": &armsecurity.InformationType{ - // Custom: to.Ptr(true), - // DisplayName: to.Ptr("Custom"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(true), - // Custom: to.Ptr(true), - // Pattern: to.Ptr("%custom%"), - // }}, - // Order: to.Ptr[int32](1400), - // RecommendedLabelID: to.Ptr("7aa516c7-5a53-4857-bc6e-6808c6acd542"), - // }, - // "7fb9419d-2473-4ad8-8e11-b25cc8cf6a07": &armsecurity.InformationType{ - // Custom: to.Ptr(false), - // DisplayName: to.Ptr("Networking"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(true), - // Pattern: to.Ptr("%networking%"), - // }}, - // Order: to.Ptr[int32](100), - // RecommendedLabelID: to.Ptr("575739d2-3d53-4df0-9042-4c7772d5c7b1"), - // }, - // }, - // Labels: map[string]*armsecurity.SensitivityLabel{ - // "1345da73-bc5a-4a8f-b7dd-3820eb713da8": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("Public"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](100), - // }, - // "575739d2-3d53-4df0-9042-4c7772d5c7b1": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("Confidential"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](300), - // }, - // "7aa516c7-5a53-4857-bc6e-6808c6acd542": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("General"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](200), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/ListInformationProtectionPolicies_example.json -func ExampleInformationProtectionPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInformationProtectionPoliciesClient().NewListPager("providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.InformationProtectionPolicyList = armsecurity.InformationProtectionPolicyList{ - // Value: []*armsecurity.InformationProtectionPolicy{ - // { - // Name: to.Ptr("effective"), - // Type: to.Ptr("Microsoft.Security/informationProtectionPolicies"), - // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e/providers/Microsoft.Security/informationProtectionPolicies/effective"), - // Properties: &armsecurity.InformationProtectionPolicyProperties{ - // InformationTypes: map[string]*armsecurity.InformationType{ - // "3bf35491-99b8-41f2-86d5-c1200a7df658": &armsecurity.InformationType{ - // Custom: to.Ptr(true), - // DisplayName: to.Ptr("Custom"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(true), - // Pattern: to.Ptr("%networking%"), - // }}, - // Order: to.Ptr[int32](1400), - // RecommendedLabelID: to.Ptr("7aa516c7-5a53-4857-bc6e-6808c6acd542"), - // }, - // "5856f35c-8e08-4d08-9bf7-87a146150569": &armsecurity.InformationType{ - // Custom: to.Ptr(false), - // DisplayName: to.Ptr("Contact Info"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%email%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%e-mail%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%addr%"), - // }, - // { - // CanBeNumeric: to.Ptr(true), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%street%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%city%"), - // }}, - // Order: to.Ptr[int32](200), - // RecommendedLabelID: to.Ptr("575739d2-3d53-4df0-9042-4c7772d5c7b1"), - // }, - // "7fb9419d-2473-4ad8-8e11-b25cc8cf6a07": &armsecurity.InformationType{ - // Custom: to.Ptr(false), - // DisplayName: to.Ptr("Networking"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%ip%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("ip%address%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%mac%address%"), - // }, - // { - // CanBeNumeric: to.Ptr(true), - // Custom: to.Ptr(true), - // Pattern: to.Ptr("%networking%"), - // }}, - // Order: to.Ptr[int32](100), - // RecommendedLabelID: to.Ptr("575739d2-3d53-4df0-9042-4c7772d5c7b1"), - // }, - // }, - // Labels: map[string]*armsecurity.SensitivityLabel{ - // "1345da73-bc5a-4a8f-b7dd-3820eb713da8": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("Public"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](100), - // }, - // "575739d2-3d53-4df0-9042-4c7772d5c7b1": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("Confidential"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](300), - // }, - // "7aa516c7-5a53-4857-bc6e-6808c6acd542": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("General"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](200), - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("custom"), - // Type: to.Ptr("Microsoft.Security/informationProtectionPolicies"), - // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e/providers/Microsoft.Security/informationProtectionPolicies/custom"), - // Properties: &armsecurity.InformationProtectionPolicyProperties{ - // InformationTypes: map[string]*armsecurity.InformationType{ - // "3bf35491-99b8-41f2-86d5-c1200a7df658": &armsecurity.InformationType{ - // Custom: to.Ptr(true), - // DisplayName: to.Ptr("Custom"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(true), - // Custom: to.Ptr(true), - // Pattern: to.Ptr("%custom%"), - // }}, - // Order: to.Ptr[int32](1400), - // RecommendedLabelID: to.Ptr("7aa516c7-5a53-4857-bc6e-6808c6acd542"), - // }, - // "7fb9419d-2473-4ad8-8e11-b25cc8cf6a07": &armsecurity.InformationType{ - // Custom: to.Ptr(false), - // DisplayName: to.Ptr("Networking"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(true), - // Pattern: to.Ptr("%networking%"), - // }}, - // Order: to.Ptr[int32](100), - // RecommendedLabelID: to.Ptr("575739d2-3d53-4df0-9042-4c7772d5c7b1"), - // }, - // }, - // Labels: map[string]*armsecurity.SensitivityLabel{ - // "1345da73-bc5a-4a8f-b7dd-3820eb713da8": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("Public"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](100), - // }, - // "575739d2-3d53-4df0-9042-4c7772d5c7b1": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("Confidential"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](300), - // }, - // "7aa516c7-5a53-4857-bc6e-6808c6acd542": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("General"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](200), - // }, - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/interfaces.go b/sdk/resourcemanager/security/armsecurity/interfaces.go index 64b6b9daf958..7448add810a9 100644 --- a/sdk/resourcemanager/security/armsecurity/interfaces.go +++ b/sdk/resourcemanager/security/armsecurity/interfaces.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -36,6 +33,15 @@ type AllowlistCustomAlertRuleClassification interface { GetAllowlistCustomAlertRule() *AllowlistCustomAlertRule } +// AuthenticationClassification provides polymorphic access to related types. +// Call the interface's GetAuthentication() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AccessTokenAuthentication, *Authentication +type AuthenticationClassification interface { + // GetAuthentication returns the Authentication content of the underlying type. + GetAuthentication() *Authentication +} + // AuthenticationDetailsPropertiesClassification provides polymorphic access to related types. // Call the interface's GetAuthenticationDetailsProperties() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: @@ -67,9 +73,11 @@ type AwsOrganizationalDataClassification interface { // CloudOfferingClassification provides polymorphic access to related types. // Call the interface's GetCloudOffering() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *CloudOffering, *CspmMonitorAwsOffering, *CspmMonitorAzureDevOpsOffering, *CspmMonitorGcpOffering, *CspmMonitorGitLabOffering, -// - *CspmMonitorGithubOffering, *DefenderCspmAwsOffering, *DefenderCspmGcpOffering, *DefenderFoDatabasesAwsOffering, *DefenderForContainersAwsOffering, -// - *DefenderForContainersGcpOffering, *DefenderForDatabasesGcpOffering, *DefenderForServersAwsOffering, *DefenderForServersGcpOffering +// - *CloudOffering, *CspmMonitorAwsOffering, *CspmMonitorAzureDevOpsOffering, *CspmMonitorDockerHubOffering, *CspmMonitorGcpOffering, +// - *CspmMonitorGitLabOffering, *CspmMonitorGithubOffering, *CspmMonitorJFrogOffering, *DefenderCspmAwsOffering, *DefenderCspmDockerHubOffering, +// - *DefenderCspmGcpOffering, *DefenderCspmJFrogOffering, *DefenderFoDatabasesAwsOffering, *DefenderForContainersAwsOffering, +// - *DefenderForContainersDockerHubOffering, *DefenderForContainersGcpOffering, *DefenderForContainersJFrogOffering, *DefenderForDatabasesGcpOffering, +// - *DefenderForServersAwsOffering, *DefenderForServersGcpOffering type CloudOfferingClassification interface { // GetCloudOffering returns the CloudOffering content of the underlying type. GetCloudOffering() *CloudOffering @@ -93,8 +101,8 @@ type CustomAlertRuleClassification interface { // 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, -// - *GitlabScopeEnvironmentData +// - *AwsEnvironmentData, *AzureDevOpsScopeEnvironmentData, *DockerHubEnvironmentData, *EnvironmentData, *GcpProjectEnvironmentData, +// - *GithubScopeEnvironmentData, *GitlabScopeEnvironmentData, *JFrogEnvironmentData type EnvironmentDataClassification interface { // GetEnvironmentData returns the EnvironmentData content of the underlying type. GetEnvironmentData() *EnvironmentData diff --git a/sdk/resourcemanager/security/armsecurity/iotsecuritysolution_client.go b/sdk/resourcemanager/security/armsecurity/iotsecuritysolution_client.go index ee1428fe0c5a..92583c1b8567 100644 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolution_client.go +++ b/sdk/resourcemanager/security/armsecurity/iotsecuritysolution_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -75,7 +72,7 @@ func (client *IotSecuritySolutionClient) CreateOrUpdate(ctx context.Context, res } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *IotSecuritySolutionClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, solutionName string, iotSecuritySolutionData IoTSecuritySolutionModel, options *IotSecuritySolutionClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *IotSecuritySolutionClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, solutionName string, iotSecuritySolutionData IoTSecuritySolutionModel, _ *IotSecuritySolutionClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -142,7 +139,7 @@ func (client *IotSecuritySolutionClient) Delete(ctx context.Context, resourceGro } // deleteCreateRequest creates the Delete request. -func (client *IotSecuritySolutionClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, solutionName string, options *IotSecuritySolutionClientDeleteOptions) (*policy.Request, error) { +func (client *IotSecuritySolutionClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, solutionName string, _ *IotSecuritySolutionClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -197,7 +194,7 @@ func (client *IotSecuritySolutionClient) Get(ctx context.Context, resourceGroupN } // getCreateRequest creates the Get request. -func (client *IotSecuritySolutionClient) getCreateRequest(ctx context.Context, resourceGroupName string, solutionName string, options *IotSecuritySolutionClientGetOptions) (*policy.Request, error) { +func (client *IotSecuritySolutionClient) getCreateRequest(ctx context.Context, resourceGroupName string, solutionName string, _ *IotSecuritySolutionClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -385,7 +382,7 @@ func (client *IotSecuritySolutionClient) Update(ctx context.Context, resourceGro } // updateCreateRequest creates the Update request. -func (client *IotSecuritySolutionClient) updateCreateRequest(ctx context.Context, resourceGroupName string, solutionName string, updateIotSecuritySolutionData UpdateIotSecuritySolutionData, options *IotSecuritySolutionClientUpdateOptions) (*policy.Request, error) { +func (client *IotSecuritySolutionClient) updateCreateRequest(ctx context.Context, resourceGroupName string, solutionName string, updateIotSecuritySolutionData UpdateIotSecuritySolutionData, _ *IotSecuritySolutionClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 eb13b94f3fd7..000000000000 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolution_client_example_test.go +++ /dev/null @@ -1,1192 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsListByIotHub.json -func ExampleIotSecuritySolutionClient_NewListBySubscriptionPager_listIoTSecuritySolutionsByIoTHub() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIotSecuritySolutionClient().NewListBySubscriptionPager(&armsecurity.IotSecuritySolutionClientListBySubscriptionOptions{Filter: to.Ptr("properties.iotHubs/any(i eq \"/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub\")")}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IoTSecuritySolutionsList = armsecurity.IoTSecuritySolutionsList{ - // Value: []*armsecurity.IoTSecuritySolutionModel{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/IoTSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East Us"), - // Properties: &armsecurity.IoTSecuritySolutionProperties{ - // AutoDiscoveredResources: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735"), - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // DisabledDataSources: []*armsecurity.DataSource{ - // }, - // DisplayName: to.Ptr("Solution Default"), - // Export: []*armsecurity.ExportData{ - // to.Ptr(armsecurity.ExportDataRawEvents)}, - // IotHubs: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - // { - // Name: to.Ptr("Service Principal Not Used with ACR"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAcrauthentication), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Agent sending underutilized messages"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAgentSendsUnutilizedMessages), - // Status: to.Ptr(armsecurity.RecommendationConfigStatus("TurnedOn")), - // }, - // { - // Name: to.Ptr("Operating system (OS) baseline validation failure"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTBaseline), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Edge Hub memory can be optimized"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeHubMemOptimize), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("No Logging Configured for Edge Module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeLoggingOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Module Settings Inconsistent in SecurityGroup"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInconsistentModuleSettings), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Install the Azure Security of Things Agent"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInstallAgent), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Default IP Filter Policy should be Deny"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterDenyAll), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("IP Filter rule includes large IP range"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterPermissiveRule), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Open Ports On Device"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveFirewallPolicy), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the input chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveInputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the output chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveOutputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPrivilegedDockerOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Same Authentication Credentials used by multiple devices"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("TLS cipher suite upgrade"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTVulnerableTLSCipherSuite), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }}, - // Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - // UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - // UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - // Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - // QuerySubscriptions: []*string{ - // to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - // }, - // Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsList.json -func ExampleIotSecuritySolutionClient_NewListBySubscriptionPager_listIoTSecuritySolutionsBySubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIotSecuritySolutionClient().NewListBySubscriptionPager(&armsecurity.IotSecuritySolutionClientListBySubscriptionOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IoTSecuritySolutionsList = armsecurity.IoTSecuritySolutionsList{ - // Value: []*armsecurity.IoTSecuritySolutionModel{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/IoTSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East Us"), - // Properties: &armsecurity.IoTSecuritySolutionProperties{ - // AutoDiscoveredResources: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735"), - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // DisabledDataSources: []*armsecurity.DataSource{ - // }, - // DisplayName: to.Ptr("Solution Default"), - // Export: []*armsecurity.ExportData{ - // }, - // IotHubs: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - // { - // Name: to.Ptr("Service Principal Not Used with ACR"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAcrauthentication), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Agent sending underutilized messages"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAgentSendsUnutilizedMessages), - // Status: to.Ptr(armsecurity.RecommendationConfigStatus("TurnedOn")), - // }, - // { - // Name: to.Ptr("Operating system (OS) baseline validation failure"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTBaseline), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Edge Hub memory can be optimized"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeHubMemOptimize), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("No Logging Configured for Edge Module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeLoggingOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Module Settings Inconsistent in SecurityGroup"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInconsistentModuleSettings), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Install the Azure Security of Things Agent"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInstallAgent), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Default IP Filter Policy should be Deny"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterDenyAll), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("IP Filter rule includes large IP range"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterPermissiveRule), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Open Ports On Device"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveFirewallPolicy), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the input chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveInputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the output chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveOutputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPrivilegedDockerOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Same Authentication Credentials used by multiple devices"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("TLS cipher suite upgrade"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTVulnerableTLSCipherSuite), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }}, - // Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - // UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - // UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - // Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - // QuerySubscriptions: []*string{ - // to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - // }, - // Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("sec-solution"), - // Type: to.Ptr("Microsoft.Security/IoTSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SecondGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/sec-solution"), - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East Us"), - // Properties: &armsecurity.IoTSecuritySolutionProperties{ - // AutoDiscoveredResources: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735"), - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/IotHubSecond")}, - // DisabledDataSources: []*armsecurity.DataSource{ - // }, - // DisplayName: to.Ptr("Second Solution"), - // Export: []*armsecurity.ExportData{ - // to.Ptr(armsecurity.ExportDataRawEvents)}, - // IotHubs: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/IotHubSecond")}, - // RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - // { - // Name: to.Ptr("Service Principal Not Used with ACR"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAcrauthentication), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Agent sending underutilized messages"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAgentSendsUnutilizedMessages), - // Status: to.Ptr(armsecurity.RecommendationConfigStatus("TurnedOn")), - // }, - // { - // Name: to.Ptr("Operating system (OS) baseline validation failure"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTBaseline), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Edge Hub memory can be optimized"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeHubMemOptimize), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("No Logging Configured for Edge Module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeLoggingOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Module Settings Inconsistent in SecurityGroup"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInconsistentModuleSettings), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Install the Azure Security of Things Agent"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInstallAgent), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Default IP Filter Policy should be Deny"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterDenyAll), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("IP Filter rule includes large IP range"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterPermissiveRule), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Open Ports On Device"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveFirewallPolicy), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the input chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveInputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the output chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveOutputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPrivilegedDockerOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Same Authentication Credentials used by multiple devices"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("TLS cipher suite upgrade"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTVulnerableTLSCipherSuite), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }}, - // Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - // UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - // UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - // Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - // QuerySubscriptions: []*string{ - // to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - // }, - // Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsListByRg.json -func ExampleIotSecuritySolutionClient_NewListByResourceGroupPager_listIoTSecuritySolutionsByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIotSecuritySolutionClient().NewListByResourceGroupPager("MyGroup", &armsecurity.IotSecuritySolutionClientListByResourceGroupOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IoTSecuritySolutionsList = armsecurity.IoTSecuritySolutionsList{ - // Value: []*armsecurity.IoTSecuritySolutionModel{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/IoTSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East Us"), - // Properties: &armsecurity.IoTSecuritySolutionProperties{ - // AutoDiscoveredResources: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735"), - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // DisabledDataSources: []*armsecurity.DataSource{ - // }, - // DisplayName: to.Ptr("Solution Default"), - // Export: []*armsecurity.ExportData{ - // }, - // IotHubs: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - // { - // Name: to.Ptr("Service Principal Not Used with ACR"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAcrauthentication), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Agent sending underutilized messages"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAgentSendsUnutilizedMessages), - // Status: to.Ptr(armsecurity.RecommendationConfigStatus("TurnedOn")), - // }, - // { - // Name: to.Ptr("Operating system (OS) baseline validation failure"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTBaseline), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Edge Hub memory can be optimized"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeHubMemOptimize), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("No Logging Configured for Edge Module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeLoggingOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Module Settings Inconsistent in SecurityGroup"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInconsistentModuleSettings), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Install the Azure Security of Things Agent"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInstallAgent), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Default IP Filter Policy should be Deny"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterDenyAll), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("IP Filter rule includes large IP range"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterPermissiveRule), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Open Ports On Device"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveFirewallPolicy), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the input chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveInputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the output chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveOutputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPrivilegedDockerOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Same Authentication Credentials used by multiple devices"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("TLS cipher suite upgrade"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTVulnerableTLSCipherSuite), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }}, - // Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - // UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - // UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - // Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - // QuerySubscriptions: []*string{ - // to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - // }, - // Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsListByIotHubAndRg.json -func ExampleIotSecuritySolutionClient_NewListByResourceGroupPager_listIoTSecuritySolutionsByResourceGroupAndIoTHub() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIotSecuritySolutionClient().NewListByResourceGroupPager("MyRg", &armsecurity.IotSecuritySolutionClientListByResourceGroupOptions{Filter: to.Ptr("properties.iotHubs/any(i eq \"/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub\")")}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IoTSecuritySolutionsList = armsecurity.IoTSecuritySolutionsList{ - // Value: []*armsecurity.IoTSecuritySolutionModel{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/IoTSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyRg/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East Us"), - // Properties: &armsecurity.IoTSecuritySolutionProperties{ - // AutoDiscoveredResources: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735"), - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // DisabledDataSources: []*armsecurity.DataSource{ - // }, - // DisplayName: to.Ptr("Solution Default"), - // Export: []*armsecurity.ExportData{ - // to.Ptr(armsecurity.ExportDataRawEvents)}, - // IotHubs: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - // { - // Name: to.Ptr("Service Principal Not Used with ACR"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAcrauthentication), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Agent sending underutilized messages"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAgentSendsUnutilizedMessages), - // Status: to.Ptr(armsecurity.RecommendationConfigStatus("TurnedOn")), - // }, - // { - // Name: to.Ptr("Operating system (OS) baseline validation failure"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTBaseline), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Edge Hub memory can be optimized"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeHubMemOptimize), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("No Logging Configured for Edge Module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeLoggingOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Module Settings Inconsistent in SecurityGroup"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInconsistentModuleSettings), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Install the Azure Security of Things Agent"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInstallAgent), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Default IP Filter Policy should be Deny"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterDenyAll), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("IP Filter rule includes large IP range"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterPermissiveRule), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Open Ports On Device"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveFirewallPolicy), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the input chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveInputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the output chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveOutputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPrivilegedDockerOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Same Authentication Credentials used by multiple devices"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("TLS cipher suite upgrade"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTVulnerableTLSCipherSuite), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }}, - // Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - // UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - // UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - // Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - // QuerySubscriptions: []*string{ - // to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - // }, - // Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolution.json -func ExampleIotSecuritySolutionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIotSecuritySolutionClient().Get(ctx, "MyGroup", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IoTSecuritySolutionModel = armsecurity.IoTSecuritySolutionModel{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/IoTSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East Us"), - // Properties: &armsecurity.IoTSecuritySolutionProperties{ - // AutoDiscoveredResources: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735"), - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // DisabledDataSources: []*armsecurity.DataSource{ - // }, - // DisplayName: to.Ptr("Solution Default"), - // Export: []*armsecurity.ExportData{ - // }, - // IotHubs: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - // { - // Name: to.Ptr("Service Principal Not Used with ACR"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAcrauthentication), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Agent sending underutilized messages"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAgentSendsUnutilizedMessages), - // Status: to.Ptr(armsecurity.RecommendationConfigStatus("TurnedOn")), - // }, - // { - // Name: to.Ptr("Operating system (OS) baseline validation failure"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTBaseline), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Edge Hub memory can be optimized"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeHubMemOptimize), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("No Logging Configured for Edge Module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeLoggingOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Module Settings Inconsistent in SecurityGroup"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInconsistentModuleSettings), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Install the Azure Security of Things Agent"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInstallAgent), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Default IP Filter Policy should be Deny"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterDenyAll), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("IP Filter rule includes large IP range"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterPermissiveRule), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Open Ports On Device"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveFirewallPolicy), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the input chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveInputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the output chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveOutputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPrivilegedDockerOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Same Authentication Credentials used by multiple devices"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("TLS cipher suite upgrade"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTVulnerableTLSCipherSuite), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }}, - // Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - // UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - // UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - // Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - // QuerySubscriptions: []*string{ - // to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - // }, - // Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/CreateIoTSecuritySolution.json -func ExampleIotSecuritySolutionClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIotSecuritySolutionClient().CreateOrUpdate(ctx, "MyGroup", "default", armsecurity.IoTSecuritySolutionModel{ - Tags: map[string]*string{}, - Location: to.Ptr("East Us"), - Properties: &armsecurity.IoTSecuritySolutionProperties{ - DisabledDataSources: []*armsecurity.DataSource{}, - DisplayName: to.Ptr("Solution Default"), - Export: []*armsecurity.ExportData{}, - IotHubs: []*string{ - to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - { - RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - }, - { - RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - }}, - Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - QuerySubscriptions: []*string{ - to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - }, - Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IoTSecuritySolutionModel = armsecurity.IoTSecuritySolutionModel{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/IoTSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/Locations/eastus/IoTSecuritySolutions/default"), - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East Us"), - // Properties: &armsecurity.IoTSecuritySolutionProperties{ - // AutoDiscoveredResources: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735"), - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // DisabledDataSources: []*armsecurity.DataSource{ - // }, - // DisplayName: to.Ptr("Solution Default"), - // Export: []*armsecurity.ExportData{ - // }, - // IotHubs: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - // { - // Name: to.Ptr("Service Principal Not Used with ACR"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAcrauthentication), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Agent sending underutilized messages"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAgentSendsUnutilizedMessages), - // Status: to.Ptr(armsecurity.RecommendationConfigStatus("TurnedOn")), - // }, - // { - // Name: to.Ptr("Operating system (OS) baseline validation failure"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTBaseline), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Edge Hub memory can be optimized"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeHubMemOptimize), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("No Logging Configured for Edge Module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeLoggingOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Module Settings Inconsistent in SecurityGroup"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInconsistentModuleSettings), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Install the Azure Security of Things Agent"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInstallAgent), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Default IP Filter Policy should be Deny"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterDenyAll), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("IP Filter rule includes large IP range"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterPermissiveRule), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Open Ports On Device"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveFirewallPolicy), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the input chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveInputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the output chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveOutputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPrivilegedDockerOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Same Authentication Credentials used by multiple devices"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("TLS cipher suite upgrade"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTVulnerableTLSCipherSuite), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }}, - // Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - // UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - // UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - // Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - // QuerySubscriptions: []*string{ - // to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - // }, - // Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/UpdateIoTSecuritySolution.json -func ExampleIotSecuritySolutionClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIotSecuritySolutionClient().Update(ctx, "myRg", "default", armsecurity.UpdateIotSecuritySolutionData{ - Tags: map[string]*string{ - "foo": to.Ptr("bar"), - }, - Properties: &armsecurity.UpdateIoTSecuritySolutionProperties{ - RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - { - RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - }, - { - RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - }}, - UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"v2\""), - QuerySubscriptions: []*string{ - to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IoTSecuritySolutionModel = armsecurity.IoTSecuritySolutionModel{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/IoTSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/Locations/eastus/IoTSecuritySolutions/default"), - // Tags: map[string]*string{ - // "foo": to.Ptr("bar"), - // }, - // Location: to.Ptr("East Us"), - // Properties: &armsecurity.IoTSecuritySolutionProperties{ - // AutoDiscoveredResources: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735"), - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // DisabledDataSources: []*armsecurity.DataSource{ - // }, - // DisplayName: to.Ptr("Solution Default"), - // Export: []*armsecurity.ExportData{ - // to.Ptr(armsecurity.ExportDataRawEvents)}, - // IotHubs: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - // { - // Name: to.Ptr("Service Principal Not Used with ACR"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAcrauthentication), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Agent sending underutilized messages"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAgentSendsUnutilizedMessages), - // Status: to.Ptr(armsecurity.RecommendationConfigStatus("TurnedOn")), - // }, - // { - // Name: to.Ptr("Operating system (OS) baseline validation failure"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTBaseline), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Edge Hub memory can be optimized"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeHubMemOptimize), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("No Logging Configured for Edge Module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeLoggingOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Module Settings Inconsistent in SecurityGroup"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInconsistentModuleSettings), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Install the Azure Security of Things Agent"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInstallAgent), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Default IP Filter Policy should be Deny"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterDenyAll), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("IP Filter rule includes large IP range"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterPermissiveRule), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Open Ports On Device"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveFirewallPolicy), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the input chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveInputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the output chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveOutputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPrivilegedDockerOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Same Authentication Credentials used by multiple devices"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("TLS cipher suite upgrade"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTVulnerableTLSCipherSuite), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }}, - // Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - // UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - // UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - // Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"v2\""), - // QuerySubscriptions: []*string{ - // to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - // }, - // Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.092Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/DeleteIoTSecuritySolution.json -func ExampleIotSecuritySolutionClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewIotSecuritySolutionClient().Delete(ctx, "MyGroup", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionanalytics_client.go b/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionanalytics_client.go index ef0ddaa3c931..16c928abdca1 100644 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionanalytics_client.go +++ b/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionanalytics_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -74,7 +71,7 @@ func (client *IotSecuritySolutionAnalyticsClient) Get(ctx context.Context, resou } // getCreateRequest creates the Get request. -func (client *IotSecuritySolutionAnalyticsClient) getCreateRequest(ctx context.Context, resourceGroupName string, solutionName string, options *IotSecuritySolutionAnalyticsClientGetOptions) (*policy.Request, error) { +func (client *IotSecuritySolutionAnalyticsClient) getCreateRequest(ctx context.Context, resourceGroupName string, solutionName string, _ *IotSecuritySolutionAnalyticsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -139,7 +136,7 @@ func (client *IotSecuritySolutionAnalyticsClient) List(ctx context.Context, reso } // listCreateRequest creates the List request. -func (client *IotSecuritySolutionAnalyticsClient) listCreateRequest(ctx context.Context, resourceGroupName string, solutionName string, options *IotSecuritySolutionAnalyticsClientListOptions) (*policy.Request, error) { +func (client *IotSecuritySolutionAnalyticsClient) listCreateRequest(ctx context.Context, resourceGroupName string, solutionName string, _ *IotSecuritySolutionAnalyticsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 4c9682a27add..000000000000 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionanalytics_client_example_test.go +++ /dev/null @@ -1,211 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAnalyticsList.json -func ExampleIotSecuritySolutionAnalyticsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIotSecuritySolutionAnalyticsClient().List(ctx, "MyGroup", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IoTSecuritySolutionAnalyticsModelList = armsecurity.IoTSecuritySolutionAnalyticsModelList{ - // Value: []*armsecurity.IoTSecuritySolutionAnalyticsModel{ - // { - // Name: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Type: to.Ptr("Microsoft.Security/iotSecuritySolutions/analyticsModels"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Properties: &armsecurity.IoTSecuritySolutionAnalyticsModelProperties{ - // DevicesMetrics: []*armsecurity.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem{ - // { - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-02-01T00:00:00.000Z"); return t}()), - // DevicesMetrics: &armsecurity.IoTSeverityMetrics{ - // High: to.Ptr[int64](3), - // Low: to.Ptr[int64](70), - // Medium: to.Ptr[int64](15), - // }, - // }, - // { - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-02-02T00:00:00.000Z"); return t}()), - // DevicesMetrics: &armsecurity.IoTSeverityMetrics{ - // High: to.Ptr[int64](3), - // Low: to.Ptr[int64](65), - // Medium: to.Ptr[int64](45), - // }, - // }}, - // Metrics: &armsecurity.IoTSeverityMetrics{ - // High: to.Ptr[int64](5), - // Low: to.Ptr[int64](102), - // Medium: to.Ptr[int64](200), - // }, - // MostPrevalentDeviceAlerts: []*armsecurity.IoTSecurityDeviceAlert{ - // { - // AlertDisplayName: to.Ptr("Custom Alert - number of device to cloud messages in AMQP protocol is not in the allowed range"), - // AlertsCount: to.Ptr[int64](200), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // }, - // { - // AlertDisplayName: to.Ptr("Custom Alert - execution of a process that is not allowed"), - // AlertsCount: to.Ptr[int64](170), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityMedium), - // }, - // { - // AlertDisplayName: to.Ptr("Successful Bruteforce"), - // AlertsCount: to.Ptr[int64](150), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // }}, - // MostPrevalentDeviceRecommendations: []*armsecurity.IoTSecurityDeviceRecommendation{ - // { - // DevicesCount: to.Ptr[int64](200), - // RecommendationDisplayName: to.Ptr("Install the Azure Security of Things Agent"), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // }, - // { - // DevicesCount: to.Ptr[int64](170), - // RecommendationDisplayName: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // }, - // { - // DevicesCount: to.Ptr[int64](150), - // RecommendationDisplayName: to.Ptr("Same Authentication Credentials used by multiple devices"), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityMedium), - // }}, - // TopAlertedDevices: []*armsecurity.IoTSecurityAlertedDevice{ - // { - // AlertsCount: to.Ptr[int64](200), - // DeviceID: to.Ptr("id1"), - // }, - // { - // AlertsCount: to.Ptr[int64](170), - // DeviceID: to.Ptr("id2"), - // }, - // { - // AlertsCount: to.Ptr[int64](150), - // DeviceID: to.Ptr("id3"), - // }}, - // UnhealthyDeviceCount: to.Ptr[int64](1200), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAnalytics.json -func ExampleIotSecuritySolutionAnalyticsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIotSecuritySolutionAnalyticsClient().Get(ctx, "MyGroup", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IoTSecuritySolutionAnalyticsModel = armsecurity.IoTSecuritySolutionAnalyticsModel{ - // Name: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Type: to.Ptr("Microsoft.Security/iotSecuritySolutions/analyticsModels"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Properties: &armsecurity.IoTSecuritySolutionAnalyticsModelProperties{ - // DevicesMetrics: []*armsecurity.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem{ - // { - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-02-01T00:00:00.000Z"); return t}()), - // DevicesMetrics: &armsecurity.IoTSeverityMetrics{ - // High: to.Ptr[int64](3), - // Low: to.Ptr[int64](70), - // Medium: to.Ptr[int64](15), - // }, - // }, - // { - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-02-02T00:00:00.000Z"); return t}()), - // DevicesMetrics: &armsecurity.IoTSeverityMetrics{ - // High: to.Ptr[int64](3), - // Low: to.Ptr[int64](65), - // Medium: to.Ptr[int64](45), - // }, - // }}, - // Metrics: &armsecurity.IoTSeverityMetrics{ - // High: to.Ptr[int64](5), - // Low: to.Ptr[int64](102), - // Medium: to.Ptr[int64](200), - // }, - // MostPrevalentDeviceAlerts: []*armsecurity.IoTSecurityDeviceAlert{ - // { - // AlertDisplayName: to.Ptr("Custom Alert - number of device to cloud messages in AMQP protocol is not in the allowed range"), - // AlertsCount: to.Ptr[int64](200), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // }, - // { - // AlertDisplayName: to.Ptr("Custom Alert - execution of a process that is not allowed"), - // AlertsCount: to.Ptr[int64](170), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityMedium), - // }, - // { - // AlertDisplayName: to.Ptr("Successful Bruteforce"), - // AlertsCount: to.Ptr[int64](150), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // }}, - // MostPrevalentDeviceRecommendations: []*armsecurity.IoTSecurityDeviceRecommendation{ - // { - // DevicesCount: to.Ptr[int64](200), - // RecommendationDisplayName: to.Ptr("Install the Azure Security of Things Agent"), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // }, - // { - // DevicesCount: to.Ptr[int64](170), - // RecommendationDisplayName: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // }, - // { - // DevicesCount: to.Ptr[int64](150), - // RecommendationDisplayName: to.Ptr("Same Authentication Credentials used by multiple devices"), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityMedium), - // }}, - // TopAlertedDevices: []*armsecurity.IoTSecurityAlertedDevice{ - // { - // AlertsCount: to.Ptr[int64](200), - // DeviceID: to.Ptr("id1"), - // }, - // { - // AlertsCount: to.Ptr[int64](170), - // DeviceID: to.Ptr("id2"), - // }, - // { - // AlertsCount: to.Ptr[int64](150), - // DeviceID: to.Ptr("id3"), - // }}, - // UnhealthyDeviceCount: to.Ptr[int64](1200), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsaggregatedalert_client.go b/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsaggregatedalert_client.go index 0d6a74abd132..c2180e2c36dc 100644 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsaggregatedalert_client.go +++ b/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsaggregatedalert_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -21,7 +18,8 @@ import ( "strings" ) -// IotSecuritySolutionsAnalyticsAggregatedAlertClient contains the methods for the IotSecuritySolutionsAnalyticsAggregatedAlert group. +// IotSecuritySolutionsAnalyticsAggregatedAlertClient contains the methods for the IotSecuritySolutionsAnalyticsAggregatedAlert +// group. // Don't use this type directly, use NewIotSecuritySolutionsAnalyticsAggregatedAlertClient() instead. type IotSecuritySolutionsAnalyticsAggregatedAlertClient struct { internal *arm.Client @@ -75,7 +73,7 @@ func (client *IotSecuritySolutionsAnalyticsAggregatedAlertClient) Dismiss(ctx co } // dismissCreateRequest creates the Dismiss request. -func (client *IotSecuritySolutionsAnalyticsAggregatedAlertClient) dismissCreateRequest(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string, options *IotSecuritySolutionsAnalyticsAggregatedAlertClientDismissOptions) (*policy.Request, error) { +func (client *IotSecuritySolutionsAnalyticsAggregatedAlertClient) dismissCreateRequest(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string, _ *IotSecuritySolutionsAnalyticsAggregatedAlertClientDismissOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName}/dismiss" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -137,7 +135,7 @@ func (client *IotSecuritySolutionsAnalyticsAggregatedAlertClient) Get(ctx contex } // getCreateRequest creates the Get request. -func (client *IotSecuritySolutionsAnalyticsAggregatedAlertClient) getCreateRequest(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string, options *IotSecuritySolutionsAnalyticsAggregatedAlertClientGetOptions) (*policy.Request, error) { +func (client *IotSecuritySolutionsAnalyticsAggregatedAlertClient) getCreateRequest(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string, _ *IotSecuritySolutionsAnalyticsAggregatedAlertClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedAlerts/{aggregatedAlertName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 19fc112d0a8b..000000000000 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsaggregatedalert_client_example_test.go +++ /dev/null @@ -1,173 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAggregatedAlertList.json -func ExampleIotSecuritySolutionsAnalyticsAggregatedAlertClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIotSecuritySolutionsAnalyticsAggregatedAlertClient().NewListPager("MyGroup", "default", &armsecurity.IotSecuritySolutionsAnalyticsAggregatedAlertClientListOptions{Top: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IoTSecurityAggregatedAlertList = armsecurity.IoTSecurityAggregatedAlertList{ - // Value: []*armsecurity.IoTSecurityAggregatedAlert{ - // { - // Name: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/IoT_Bruteforce_Fail/2019-02-02"), - // Type: to.Ptr("Microsoft.Security/iotSecuritySolutions/analyticsModels/aggregatedAlerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/IoT_Bruteforce_Fail/2019-02-02"), - // Properties: &armsecurity.IoTSecurityAggregatedAlertProperties{ - // Description: to.Ptr("Multiple unsuccsseful login attempts identified. A Bruteforce attack on the device failed."), - // ActionTaken: to.Ptr("Detected"), - // AggregatedDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2019-02-02"); return t}()), - // AlertDisplayName: to.Ptr("Failed Bruteforce"), - // AlertType: to.Ptr("IoT_Bruteforce_Fail"), - // Count: to.Ptr[int64](50), - // EffectedResourceType: to.Ptr("IoT Device"), - // LogAnalyticsQuery: to.Ptr("SecurityAlert | where tolower(ResourceId) == tolower('/subscriptions/b77ec8a9-04ed-48d2-a87a-e5887b978ba6/resourceGroups/IoT-Solution-DemoEnv/providers/Microsoft.Devices/IotHubs/rtogm-hub') and tolower(AlertName) == tolower('Custom Alert - number of device to cloud messages in MQTT protocol is not in the allowed range') | extend DeviceId=parse_json(ExtendedProperties)['DeviceId'] | project DeviceId, TimeGenerated, DisplayName, AlertSeverity, Description, RemediationSteps, ExtendedProperties"), - // RemediationSteps: to.Ptr(""), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // SystemSource: to.Ptr("Devices"), - // TopDevicesList: []*armsecurity.IoTSecurityAggregatedAlertPropertiesTopDevicesListItem{ - // { - // AlertsCount: to.Ptr[int64](45), - // DeviceID: to.Ptr("testDevice1"), - // LastOccurrence: to.Ptr("10:42"), - // }, - // { - // AlertsCount: to.Ptr[int64](30), - // DeviceID: to.Ptr("testDevice2"), - // LastOccurrence: to.Ptr("15:42"), - // }}, - // VendorName: to.Ptr("Microsoft"), - // }, - // }, - // { - // Name: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/IoT_Bruteforce_Success/2019-02-02"), - // Type: to.Ptr("Microsoft.Security/iotSecuritySolutions/analyticsModels/aggregatedAlerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/IoT_Bruteforce_Success/2019-02-02"), - // Properties: &armsecurity.IoTSecurityAggregatedAlertProperties{ - // Description: to.Ptr("Multiple unsuccsseful login attempts identified followed by a succssful login. A Bruteforce attack on the device was Successfule"), - // ActionTaken: to.Ptr("Detected"), - // AggregatedDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2019-02-02"); return t}()), - // AlertDisplayName: to.Ptr("Successful Bruteforce"), - // AlertType: to.Ptr("IoT_Bruteforce_Success"), - // Count: to.Ptr[int64](600000), - // EffectedResourceType: to.Ptr("IoT Device"), - // LogAnalyticsQuery: to.Ptr("SecurityAlert | where tolower(ResourceId) == tolower('/subscriptions/b77ec8a9-04ed-48d2-a87a-e5887b978ba6/resourceGroups/IoT-Solution-DemoEnv/providers/Microsoft.Devices/IotHubs/rtogm-hub') and tolower(AlertName) == tolower('Custom Alert - number of device to cloud messages in MQTT protocol is not in the allowed range') | extend DeviceId=parse_json(ExtendedProperties)['DeviceId'] | project DeviceId, TimeGenerated, DisplayName, AlertSeverity, Description, RemediationSteps, ExtendedProperties"), - // RemediationSteps: to.Ptr(""), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // SystemSource: to.Ptr("Devices"), - // TopDevicesList: []*armsecurity.IoTSecurityAggregatedAlertPropertiesTopDevicesListItem{ - // { - // AlertsCount: to.Ptr[int64](12321), - // DeviceID: to.Ptr("testDevice1"), - // LastOccurrence: to.Ptr("10:42"), - // }, - // { - // AlertsCount: to.Ptr[int64](455), - // DeviceID: to.Ptr("testDevice2"), - // LastOccurrence: to.Ptr("15:42"), - // }}, - // VendorName: to.Ptr("Microsoft"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAggregatedAlert.json -func ExampleIotSecuritySolutionsAnalyticsAggregatedAlertClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIotSecuritySolutionsAnalyticsAggregatedAlertClient().Get(ctx, "MyGroup", "default", "IoT_Bruteforce_Fail/2019-02-02", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IoTSecurityAggregatedAlert = armsecurity.IoTSecurityAggregatedAlert{ - // Name: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/IoT_Bruteforce_Fail/2019-02-02"), - // Type: to.Ptr("Microsoft.Security/iotSecuritySolutions/analyticsModels/aggregatedAlerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/IoT_Bruteforce_Fail/2019-02-02"), - // Properties: &armsecurity.IoTSecurityAggregatedAlertProperties{ - // Description: to.Ptr("Multiple unsuccsseful login attempts identified. A Bruteforce attack on the device failed."), - // ActionTaken: to.Ptr("Detected"), - // AggregatedDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse("2006-01-02", "2019-02-02"); return t}()), - // AlertDisplayName: to.Ptr("Failed Bruteforce"), - // AlertType: to.Ptr("IoT_Bruteforce_Fail"), - // Count: to.Ptr[int64](50), - // EffectedResourceType: to.Ptr("IoT Device"), - // LogAnalyticsQuery: to.Ptr("SecurityAlert | where tolower(ResourceId) == tolower('/subscriptions/b77ec8a9-04ed-48d2-a87a-e5887b978ba6/resourceGroups/IoT-Solution-DemoEnv/providers/Microsoft.Devices/IotHubs/rtogm-hub') and tolower(AlertName) == tolower('Custom Alert - number of device to cloud messages in MQTT protocol is not in the allowed range') | extend DeviceId=parse_json(ExtendedProperties)['DeviceId'] | project DeviceId, TimeGenerated, DisplayName, AlertSeverity, Description, RemediationSteps, ExtendedProperties"), - // RemediationSteps: to.Ptr(""), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // SystemSource: to.Ptr("Devices"), - // TopDevicesList: []*armsecurity.IoTSecurityAggregatedAlertPropertiesTopDevicesListItem{ - // { - // AlertsCount: to.Ptr[int64](100), - // DeviceID: to.Ptr("testDevice1"), - // LastOccurrence: to.Ptr("10:42"), - // }, - // { - // AlertsCount: to.Ptr[int64](80), - // DeviceID: to.Ptr("testDevice2"), - // LastOccurrence: to.Ptr("15:42"), - // }}, - // VendorName: to.Ptr("Microsoft"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/PostIoTSecuritySolutionsSecurityAggregatedAlertDismiss.json -func ExampleIotSecuritySolutionsAnalyticsAggregatedAlertClient_Dismiss() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewIotSecuritySolutionsAnalyticsAggregatedAlertClient().Dismiss(ctx, "IoTEdgeResources", "default", "IoT_Bruteforce_Fail/2019-02-02/dismiss", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsrecommendation_client.go b/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsrecommendation_client.go index 1a2d3fe1289e..89f3365dab67 100644 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsrecommendation_client.go +++ b/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsrecommendation_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -21,7 +18,8 @@ import ( "strings" ) -// IotSecuritySolutionsAnalyticsRecommendationClient contains the methods for the IotSecuritySolutionsAnalyticsRecommendation group. +// IotSecuritySolutionsAnalyticsRecommendationClient contains the methods for the IotSecuritySolutionsAnalyticsRecommendation +// group. // Don't use this type directly, use NewIotSecuritySolutionsAnalyticsRecommendationClient() instead. type IotSecuritySolutionsAnalyticsRecommendationClient struct { internal *arm.Client @@ -77,7 +75,7 @@ func (client *IotSecuritySolutionsAnalyticsRecommendationClient) Get(ctx context } // getCreateRequest creates the Get request. -func (client *IotSecuritySolutionsAnalyticsRecommendationClient) getCreateRequest(ctx context.Context, resourceGroupName string, solutionName string, aggregatedRecommendationName string, options *IotSecuritySolutionsAnalyticsRecommendationClientGetOptions) (*policy.Request, error) { +func (client *IotSecuritySolutionsAnalyticsRecommendationClient) getCreateRequest(ctx context.Context, resourceGroupName string, solutionName string, aggregatedRecommendationName string, _ *IotSecuritySolutionsAnalyticsRecommendationClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/iotSecuritySolutions/{solutionName}/analyticsModels/default/aggregatedRecommendations/{aggregatedRecommendationName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 c455bca7631f..000000000000 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsrecommendation_client_example_test.go +++ /dev/null @@ -1,117 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityRecommendation.json -func ExampleIotSecuritySolutionsAnalyticsRecommendationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIotSecuritySolutionsAnalyticsRecommendationClient().Get(ctx, "IoTEdgeResources", "default", "OpenPortsOnDevice", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IoTSecurityAggregatedRecommendation = armsecurity.IoTSecurityAggregatedRecommendation{ - // Name: to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/OpenPortsOnDevice"), - // Type: to.Ptr("Microsoft.Security/iotSecuritySolutions/analyticsModels/aggregatedRecommendations"), - // ID: to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/OpenPortsOnDevice"), - // Properties: &armsecurity.IoTSecurityAggregatedRecommendationProperties{ - // Description: to.Ptr("An allowed firewall policy was found in main firewall Chains (INPUT/OUTPUT). The policy should Deny all traffic by default define rules to allow necessary communication to/from the device"), - // DetectedBy: to.Ptr("Microsoft"), - // HealthyDevices: to.Ptr[int64](10000), - // LogAnalyticsQuery: to.Ptr("SecurityRecommendation | where tolower(AssessedResourceId) == tolower('/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Devices/IotHubs/t-ofdadu-hub') and tolower(RecommendationName) == tolower('OpenPortsOnDevice')"), - // RecommendationDisplayName: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationName: to.Ptr("OpenPortsOnDevice"), - // RecommendationTypeID: to.Ptr("{20ff7fc3-e762-44dd-bd96-b71116dcdc23}"), - // RemediationSteps: to.Ptr(""), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // UnhealthyDeviceCount: to.Ptr[int64](200), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityRecommendationList.json -func ExampleIotSecuritySolutionsAnalyticsRecommendationClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIotSecuritySolutionsAnalyticsRecommendationClient().NewListPager("IoTEdgeResources", "default", &armsecurity.IotSecuritySolutionsAnalyticsRecommendationClientListOptions{Top: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IoTSecurityAggregatedRecommendationList = armsecurity.IoTSecurityAggregatedRecommendationList{ - // Value: []*armsecurity.IoTSecurityAggregatedRecommendation{ - // { - // Name: to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/OpenPortsOnDevice"), - // Type: to.Ptr("Microsoft.Security/iotSecuritySolutions/analyticsModels/aggregatedRecommendations"), - // ID: to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/OpenPortsOnDevice"), - // Properties: &armsecurity.IoTSecurityAggregatedRecommendationProperties{ - // Description: to.Ptr("An allowed firewall policy was found in main firewall Chains (INPUT/OUTPUT). The policy should Deny all traffic by default define rules to allow necessary communication to/from the device"), - // DetectedBy: to.Ptr("Microsoft"), - // HealthyDevices: to.Ptr[int64](10000), - // LogAnalyticsQuery: to.Ptr("SecurityRecommendation | where tolower(AssessedResourceId) == tolower('/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Devices/IotHubs/t-ofdadu-hub') and tolower(RecommendationName) == tolower('OpenPortsOnDevice')"), - // RecommendationDisplayName: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationName: to.Ptr("OpenPortsOnDevice"), - // RecommendationTypeID: to.Ptr("{20ff7fc3-e762-44dd-bd96-b71116dcdc23}"), - // RemediationSteps: to.Ptr(""), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // UnhealthyDeviceCount: to.Ptr[int64](200), - // }, - // }, - // { - // Name: to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/IoT_InstallAgent"), - // Type: to.Ptr("Microsoft.Security/iotSecuritySolutions/analyticsModels/aggregatedRecommendations"), - // ID: to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default/TooLargeIPRange"), - // Properties: &armsecurity.IoTSecurityAggregatedRecommendationProperties{ - // Description: to.Ptr("An allow IP filter rule source IP range is too large. Overly permissive rules can expose your IoT hub to malicious actors."), - // DetectedBy: to.Ptr("Microsoft"), - // HealthyDevices: to.Ptr[int64](130000), - // LogAnalyticsQuery: to.Ptr("SecurityRecommendation | where tolower(AssessedResourceId) == tolower('/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/IoTEdgeResources/providers/Microsoft.Devices/IotHubs/t-ofdadu-hub') and tolower(RecommendationName) == tolower('TooLargeIPRange')"), - // RecommendationDisplayName: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationName: to.Ptr("TooLargeIPRange"), - // RecommendationTypeID: to.Ptr("{20ff7fc3-e762-44dd-bd96-b71116dcdc23}"), - // RemediationSteps: to.Ptr(""), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityHigh), - // UnhealthyDeviceCount: to.Ptr[int64](1), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/jitnetworkaccesspolicies_client.go b/sdk/resourcemanager/security/armsecurity/jitnetworkaccesspolicies_client.go index a965aa8c4c33..7127e7b5ffdd 100644 --- a/sdk/resourcemanager/security/armsecurity/jitnetworkaccesspolicies_client.go +++ b/sdk/resourcemanager/security/armsecurity/jitnetworkaccesspolicies_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -75,7 +72,7 @@ func (client *JitNetworkAccessPoliciesClient) CreateOrUpdate(ctx context.Context } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *JitNetworkAccessPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicy, options *JitNetworkAccessPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *JitNetworkAccessPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicy, _ *JitNetworkAccessPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -147,7 +144,7 @@ func (client *JitNetworkAccessPoliciesClient) Delete(ctx context.Context, resour } // deleteCreateRequest creates the Delete request. -func (client *JitNetworkAccessPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, options *JitNetworkAccessPoliciesClientDeleteOptions) (*policy.Request, error) { +func (client *JitNetworkAccessPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, _ *JitNetworkAccessPoliciesClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -208,7 +205,7 @@ func (client *JitNetworkAccessPoliciesClient) Get(ctx context.Context, resourceG } // getCreateRequest creates the Get request. -func (client *JitNetworkAccessPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, options *JitNetworkAccessPoliciesClientGetOptions) (*policy.Request, error) { +func (client *JitNetworkAccessPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, _ *JitNetworkAccessPoliciesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -278,7 +275,7 @@ func (client *JitNetworkAccessPoliciesClient) Initiate(ctx context.Context, reso } // initiateCreateRequest creates the Initiate request. -func (client *JitNetworkAccessPoliciesClient) initiateCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicyInitiateRequest, options *JitNetworkAccessPoliciesClientInitiateOptions) (*policy.Request, error) { +func (client *JitNetworkAccessPoliciesClient) initiateCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicyInitiateRequest, _ *JitNetworkAccessPoliciesClientInitiateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies/{jitNetworkAccessPolicyName}/{jitNetworkAccessPolicyInitiateType}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -349,7 +346,7 @@ func (client *JitNetworkAccessPoliciesClient) NewListPager(options *JitNetworkAc } // listCreateRequest creates the List request. -func (client *JitNetworkAccessPoliciesClient) listCreateRequest(ctx context.Context, options *JitNetworkAccessPoliciesClientListOptions) (*policy.Request, error) { +func (client *JitNetworkAccessPoliciesClient) listCreateRequest(ctx context.Context, _ *JitNetworkAccessPoliciesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/jitNetworkAccessPolicies" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -405,7 +402,7 @@ func (client *JitNetworkAccessPoliciesClient) NewListByRegionPager(ascLocation s } // listByRegionCreateRequest creates the ListByRegion request. -func (client *JitNetworkAccessPoliciesClient) listByRegionCreateRequest(ctx context.Context, ascLocation string, options *JitNetworkAccessPoliciesClientListByRegionOptions) (*policy.Request, error) { +func (client *JitNetworkAccessPoliciesClient) listByRegionCreateRequest(ctx context.Context, ascLocation string, _ *JitNetworkAccessPoliciesClientListByRegionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -466,7 +463,7 @@ func (client *JitNetworkAccessPoliciesClient) NewListByResourceGroupPager(resour } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. -func (client *JitNetworkAccessPoliciesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *JitNetworkAccessPoliciesClientListByResourceGroupOptions) (*policy.Request, error) { +func (client *JitNetworkAccessPoliciesClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *JitNetworkAccessPoliciesClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/jitNetworkAccessPolicies" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -528,7 +525,7 @@ func (client *JitNetworkAccessPoliciesClient) NewListByResourceGroupAndRegionPag } // listByResourceGroupAndRegionCreateRequest creates the ListByResourceGroupAndRegion request. -func (client *JitNetworkAccessPoliciesClient) listByResourceGroupAndRegionCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, options *JitNetworkAccessPoliciesClientListByResourceGroupAndRegionOptions) (*policy.Request, error) { +func (client *JitNetworkAccessPoliciesClient) listByResourceGroupAndRegionCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, _ *JitNetworkAccessPoliciesClientListByResourceGroupAndRegionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/jitNetworkAccessPolicies" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 ce1d0ffe20e1..000000000000 --- a/sdk/resourcemanager/security/armsecurity/jitnetworkaccesspolicies_client_example_test.go +++ /dev/null @@ -1,530 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesSubscription_example.json -func ExampleJitNetworkAccessPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJitNetworkAccessPoliciesClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JitNetworkAccessPoliciesList = armsecurity.JitNetworkAccessPoliciesList{ - // Value: []*armsecurity.JitNetworkAccessPolicy{ - // { - // Kind: to.Ptr("Basic"), - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/locations/jitNetworkAccessPolicies"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/default"), - // Properties: &armsecurity.JitNetworkAccessPolicyProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // Requests: []*armsecurity.JitNetworkAccessRequest{ - // { - // Justification: to.Ptr("testing a new version of the product"), - // Requestor: to.Ptr("barbara@contoso.com"), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T08:06:45.569Z"); 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.569Z"); return t}()), - // Number: to.Ptr[int32](3389), - // Status: to.Ptr(armsecurity.StatusInitiated), - // StatusReason: to.Ptr(armsecurity.StatusReasonUserRequested), - // }}, - // }}, - // }}, - // VirtualMachines: []*armsecurity.JitNetworkAccessPolicyVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessPortRule{ - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](22), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }, - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](3389), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }}, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesSubscriptionLocation_example.json -func ExampleJitNetworkAccessPoliciesClient_NewListByRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJitNetworkAccessPoliciesClient().NewListByRegionPager("westeurope", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JitNetworkAccessPoliciesList = armsecurity.JitNetworkAccessPoliciesList{ - // Value: []*armsecurity.JitNetworkAccessPolicy{ - // { - // Kind: to.Ptr("Basic"), - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/locations/jitNetworkAccessPolicies"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/default"), - // Properties: &armsecurity.JitNetworkAccessPolicyProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // Requests: []*armsecurity.JitNetworkAccessRequest{ - // { - // Justification: to.Ptr("testing a new version of the product"), - // Requestor: to.Ptr("barbara@contoso.com"), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T08:06:45.569Z"); 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.569Z"); return t}()), - // Number: to.Ptr[int32](3389), - // Status: to.Ptr(armsecurity.StatusInitiated), - // StatusReason: to.Ptr(armsecurity.StatusReasonUserRequested), - // }}, - // }}, - // }}, - // VirtualMachines: []*armsecurity.JitNetworkAccessPolicyVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessPortRule{ - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](22), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }, - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](3389), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }}, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesResourceGroup_example.json -func ExampleJitNetworkAccessPoliciesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJitNetworkAccessPoliciesClient().NewListByResourceGroupPager("myRg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JitNetworkAccessPoliciesList = armsecurity.JitNetworkAccessPoliciesList{ - // Value: []*armsecurity.JitNetworkAccessPolicy{ - // { - // Kind: to.Ptr("Basic"), - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/locations/jitNetworkAccessPolicies"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/default"), - // Properties: &armsecurity.JitNetworkAccessPolicyProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // Requests: []*armsecurity.JitNetworkAccessRequest{ - // { - // Justification: to.Ptr("testing a new version of the product"), - // Requestor: to.Ptr("barbara@contoso.com"), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T08:06:45.569Z"); 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.569Z"); return t}()), - // Number: to.Ptr[int32](3389), - // Status: to.Ptr(armsecurity.StatusInitiated), - // StatusReason: to.Ptr(armsecurity.StatusReasonUserRequested), - // }}, - // }}, - // }}, - // VirtualMachines: []*armsecurity.JitNetworkAccessPolicyVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessPortRule{ - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](22), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }, - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](3389), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }}, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesResourceGroupLocation_example.json -func ExampleJitNetworkAccessPoliciesClient_NewListByResourceGroupAndRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJitNetworkAccessPoliciesClient().NewListByResourceGroupAndRegionPager("myRg1", "westeurope", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JitNetworkAccessPoliciesList = armsecurity.JitNetworkAccessPoliciesList{ - // Value: []*armsecurity.JitNetworkAccessPolicy{ - // { - // Kind: to.Ptr("Basic"), - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/locations/jitNetworkAccessPolicies"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/default"), - // Properties: &armsecurity.JitNetworkAccessPolicyProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // Requests: []*armsecurity.JitNetworkAccessRequest{ - // { - // Justification: to.Ptr("testing a new version of the product"), - // Requestor: to.Ptr("barbara@contoso.com"), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T08:06:45.569Z"); 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.569Z"); return t}()), - // Number: to.Ptr[int32](3389), - // Status: to.Ptr(armsecurity.StatusInitiated), - // StatusReason: to.Ptr(armsecurity.StatusReasonUserRequested), - // }}, - // }}, - // }}, - // VirtualMachines: []*armsecurity.JitNetworkAccessPolicyVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessPortRule{ - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](22), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }, - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](3389), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }}, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPolicy_example.json -func ExampleJitNetworkAccessPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJitNetworkAccessPoliciesClient().Get(ctx, "myRg1", "westeurope", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JitNetworkAccessPolicy = armsecurity.JitNetworkAccessPolicy{ - // Kind: to.Ptr("Basic"), - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/locations/jitNetworkAccessPolicies"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/default"), - // Properties: &armsecurity.JitNetworkAccessPolicyProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // Requests: []*armsecurity.JitNetworkAccessRequest{ - // { - // Justification: to.Ptr("testing a new version of the product"), - // Requestor: to.Ptr("barbara@contoso.com"), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T08:06:45.569Z"); 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.569Z"); return t}()), - // Number: to.Ptr[int32](3389), - // Status: to.Ptr(armsecurity.StatusInitiated), - // StatusReason: to.Ptr(armsecurity.StatusReasonUserRequested), - // }}, - // }}, - // }}, - // VirtualMachines: []*armsecurity.JitNetworkAccessPolicyVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessPortRule{ - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](22), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }, - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](3389), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/CreateJitNetworkAccessPolicy_example.json -func ExampleJitNetworkAccessPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJitNetworkAccessPoliciesClient().CreateOrUpdate(ctx, "myRg1", "westeurope", "default", armsecurity.JitNetworkAccessPolicy{ - Kind: to.Ptr("Basic"), - Location: to.Ptr("westeurope"), - Name: to.Ptr("default"), - Type: to.Ptr("Microsoft.Security/locations/jitNetworkAccessPolicies"), - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/default"), - Properties: &armsecurity.JitNetworkAccessPolicyProperties{ - ProvisioningState: to.Ptr("Succeeded"), - Requests: []*armsecurity.JitNetworkAccessRequest{ - { - Requestor: to.Ptr("barbara@contoso.com"), - StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T08:06:45.569Z"); 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.569Z"); return t }()), - Number: to.Ptr[int32](3389), - Status: to.Ptr(armsecurity.StatusInitiated), - StatusReason: to.Ptr(armsecurity.StatusReasonUserRequested), - }}, - }}, - }}, - VirtualMachines: []*armsecurity.JitNetworkAccessPolicyVirtualMachine{ - { - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - Ports: []*armsecurity.JitNetworkAccessPortRule{ - { - AllowedSourceAddressPrefix: to.Ptr("*"), - MaxRequestAccessDuration: to.Ptr("PT3H"), - Number: to.Ptr[int32](22), - Protocol: to.Ptr(armsecurity.ProtocolAll), - }, - { - AllowedSourceAddressPrefix: to.Ptr("*"), - MaxRequestAccessDuration: to.Ptr("PT3H"), - Number: to.Ptr[int32](3389), - Protocol: to.Ptr(armsecurity.ProtocolAll), - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JitNetworkAccessPolicy = armsecurity.JitNetworkAccessPolicy{ - // Kind: to.Ptr("Basic"), - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/locations/jitNetworkAccessPolicies"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/default"), - // Properties: &armsecurity.JitNetworkAccessPolicyProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // Requests: []*armsecurity.JitNetworkAccessRequest{ - // { - // Requestor: to.Ptr("barbara@contoso.com"), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T08:06:45.569Z"); 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.569Z"); return t}()), - // Number: to.Ptr[int32](3389), - // Status: to.Ptr(armsecurity.StatusInitiated), - // StatusReason: to.Ptr(armsecurity.StatusReasonUserRequested), - // }}, - // }}, - // }}, - // VirtualMachines: []*armsecurity.JitNetworkAccessPolicyVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessPortRule{ - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](22), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }, - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](3389), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/DeleteJitNetworkAccessPolicy_example.json -func ExampleJitNetworkAccessPoliciesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewJitNetworkAccessPoliciesClient().Delete(ctx, "myRg1", "westeurope", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/InitiateJitNetworkAccessPolicy_example.json -func ExampleJitNetworkAccessPoliciesClient_Initiate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewJitNetworkAccessPoliciesClient().Initiate(ctx, "myRg1", "westeurope", "default", armsecurity.JitNetworkAccessPolicyInitiateRequest{ - Justification: to.Ptr("testing a new version of the product"), - VirtualMachines: []*armsecurity.JitNetworkAccessPolicyInitiateVirtualMachine{ - { - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - Ports: []*armsecurity.JitNetworkAccessPolicyInitiatePort{ - { - AllowedSourceAddressPrefix: to.Ptr("192.127.0.2"), - Number: to.Ptr[int32](3389), - }}, - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/locations_client.go b/sdk/resourcemanager/security/armsecurity/locations_client.go index e40a0382b534..d7d5443582ab 100644 --- a/sdk/resourcemanager/security/armsecurity/locations_client.go +++ b/sdk/resourcemanager/security/armsecurity/locations_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -72,7 +69,7 @@ func (client *LocationsClient) Get(ctx context.Context, ascLocation string, opti } // getCreateRequest creates the Get request. -func (client *LocationsClient) getCreateRequest(ctx context.Context, ascLocation string, options *LocationsClientGetOptions) (*policy.Request, error) { +func (client *LocationsClient) getCreateRequest(ctx context.Context, ascLocation string, _ *LocationsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -132,7 +129,7 @@ func (client *LocationsClient) NewListPager(options *LocationsClientListOptions) } // listCreateRequest creates the List request. -func (client *LocationsClient) listCreateRequest(ctx context.Context, options *LocationsClientListOptions) (*policy.Request, error) { +func (client *LocationsClient) listCreateRequest(ctx context.Context, _ *LocationsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 2f6af02d21b2..000000000000 --- a/sdk/resourcemanager/security/armsecurity/locations_client_example_test.go +++ /dev/null @@ -1,82 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Locations/GetLocations_example.json -func ExampleLocationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewLocationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AscLocationList = armsecurity.AscLocationList{ - // Value: []*armsecurity.AscLocation{ - // { - // Name: to.Ptr("centralus"), - // Type: to.Ptr("Microsoft.Security/locations"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/centralus"), - // Properties: map[string]any{ - // "homeRegionName": "centralus", - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Locations/GetLocation_example.json -func ExampleLocationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewLocationsClient().Get(ctx, "centralus", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AscLocation = armsecurity.AscLocation{ - // Name: to.Ptr("centralus"), - // Type: to.Ptr("Microsoft.Security/locations"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/centralus"), - // Properties: map[string]any{ - // "homeRegionName": "centralus", - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/mdeonboardings_client.go b/sdk/resourcemanager/security/armsecurity/mdeonboardings_client.go index fb8963b4566d..7532f646d209 100644 --- a/sdk/resourcemanager/security/armsecurity/mdeonboardings_client.go +++ b/sdk/resourcemanager/security/armsecurity/mdeonboardings_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -71,7 +68,7 @@ func (client *MdeOnboardingsClient) Get(ctx context.Context, options *MdeOnboard } // getCreateRequest creates the Get request. -func (client *MdeOnboardingsClient) getCreateRequest(ctx context.Context, options *MdeOnboardingsClientGetOptions) (*policy.Request, error) { +func (client *MdeOnboardingsClient) getCreateRequest(ctx context.Context, _ *MdeOnboardingsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings/default" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -125,7 +122,7 @@ func (client *MdeOnboardingsClient) List(ctx context.Context, options *MdeOnboar } // listCreateRequest creates the List request. -func (client *MdeOnboardingsClient) listCreateRequest(ctx context.Context, options *MdeOnboardingsClientListOptions) (*policy.Request, error) { +func (client *MdeOnboardingsClient) listCreateRequest(ctx context.Context, _ *MdeOnboardingsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/mdeOnboardings" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 65d37bb5393f..000000000000 --- a/sdk/resourcemanager/security/armsecurity/mdeonboardings_client_example_test.go +++ /dev/null @@ -1,79 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2021-10-01-preview/examples/MdeOnboardings/ListMdeOnboardings_example.json -func ExampleMdeOnboardingsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMdeOnboardingsClient().List(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MdeOnboardingDataList = armsecurity.MdeOnboardingDataList{ - // Value: []*armsecurity.MdeOnboardingData{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/mdeOnboarding"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/mdeOnboarding/default"), - // Properties: &armsecurity.MdeOnboardingDataProperties{ - // OnboardingPackageLinux: []byte("QGVjaG8gb2ZmCgplY2hvLiA+TlVMIDI+JjEKZWNobyBTdGFydGluZyBXaW5kb3dzIERlZmVuZGVyIEFkdmFuY2VkIFRocmVhdCBQcm90ZWN0aW9uIG9uYm9hcmRpbmcgcHJvY2Vzcy4uLiA+TlVMIDI+JjEKZWNoby4gPk5VTCAyPiYxCgpzZXQgZXJyb3JDb2RlPTAKc2V0IGxhc3RFcnJvcj0wCnNldCAidHJvdWJsZXNob290SW5mbz1Gb3IgbW9yZSBpbmZvcm1hdGlvbiwgdmlzaXQ6IGh0dHBzOi8vZ28ubWljcm9zb2Z0LmNvbS9md2xpbmsvcC8/bGlua2lkPTgyMjgwNyIKc2V0ICJlcnJvckRlc2NyaXB0aW9uPSIKCmVjaG8gVGVzdGluZyBhZG1pbmlzdHJhdG9yIHByaXZpbGVnZXMgPk5VTCAyPiYxCgpuZXQgc2Vzc2lvbiA+TlVMIDI+JjEKaWYgJUVSUk9STEVWRUwlIE5FUSAwICgKCUBlY2hvIFNjcmlwdCBpcyBydW5uaW5nIHdpdGggaW5zdWZmaWNpZW50IHByaXZpbGVnZXMuIFBsZWFzZSBydW4gd2l0aCBhZG1pbmlzdHJhdG9yIHByaXZpbGVnZXM+ICVUTVAlXHNlbnNlVG1wLnR4dAoJc2V0IGVycm9yQ29kZT02NQogc2V0IGxhc3RFcnJvcj0lRVJST1JMRVZFTCUKCUdPVE8gRVJST1IKKQoKZWNobyBTY3JpcHQgaXMgcnVubmluZyB3aXRoIHN1ZmZpY2llbnQgcHJpdmlsZWdlcyA+TlVMIDI+JjEKZWNoby4gPk5VTCAyPiYxCmVjaG8gUGVyZm9ybWluZyBvbmJvYXJkaW5nIG9wZXJhdGlvbnMgPk5VTCAyPiYxCmVjaG8uID5OVUwgMj4mMQoKSUYgWyVQUk9DRVNTT1JfQVJDSElURVc2NDMyJV0gRVFVIFtdICgKICBzZXQgcG93ZXJzaGVsbFBhdGg9JXdpbmRpciVcU3lzdGVtMzJcV2luZG93c1Bvd2VyU2hlbGxcdjEuMFxwb3dlcnNoZWxsLmV4ZQopIEVMU0UgKAogIHNldCBwb3dlcnNoZWxsUGF0aD0ld2luZGlyJVxTeXNOYXRpdmVcV2luZG93c1Bvd2VyU2hlbGxcdjEuMFxwb3dlcnNoZWxsLmV4ZQopCgpzZXQgc2RiaW49MDEwMDA0ODA0NDAwMDAwMDU0MDAwMDAwMDAwMDAwMDAxNDAwMDAwMDAyMDAzMDAwMDIwMDAwMDAwMDAwMTQwMEZGMEYxMjAwMDEwMTAwMDAwMDAwMDAwNTEyMDAwMDAwMDAwMDE0MDBFMTA0MTIwMDAxMDEwMDAwMDAwMDAwMDUwQjAwMDAwMDAxMDIwMDAwMDAwMDAwMDUyMDAwMDAwMDIwMDIwMDAwMDEwMjAwMDAwMDAwMDAwNTIwMDAwMDAwMjAwMjAwMDAgPk5VTCAyPiYxCnJlZyBhZGQgSEtMTVxTWVNURU1cQ3VycmVudENvbnRyb2xTZXRcQ29udHJvbFxXTUlcU2VjdXJpdHkgL3YgMTRmODEzOGUtM2I2MS01ODBiLTU0NGItMjYwOTM3OGFlNDYwIC90IFJFR19CSU5BUlkgL2QgJXNkYmluJSAvZiA+TlVMIDI+JjEKcmVnIGFkZCBIS0xNXFNZU1RFTVxDdXJyZW50Q29udHJvbFNldFxDb250cm9sXFdNSVxTZWN1cml0eSAvdiBjYjJmZjcyZC1kNGU0LTU4NWQtMzNmOS1mM2EzOTVjNDBiZTcgL3QgUkVHX0JJTkFSWSAvZCAlc2RiaW4lIC9mID5OVUwgMj4mMQoKUkVHIGFkZCAiSEtMTVxTT0ZUV0FSRVxQb2xpY2llc1xNaWNyb3NvZnRcV2luZG93c1xEYXRhQ29sbGVjdGlvbiIgL3YgRGlzYWJsZUVudGVycHJpc2VBdXRoUHJveHkgL3QgUkVHX0RXT1JEIC9mIC9kIDEgPk5VTCAyPiYxCgolcG93ZXJzaGVsbFBhdGglIC1FeGVjdXRpb25Qb2xpY3kgQnlwYXNzIC1Ob1Byb2ZpbGUgLUNvbW1hbmQgIkFkZC1UeXBlICcgdXNpbmcgU3lzdGVtOyB1c2luZyBTeXN0ZW0uSU87IHVzaW5nIFN5c3RlbS5SdW50aW1lLkludGVyb3BTZXJ2aWNlczsgdXNpbmcgTWljcm9zb2Z0LldpbjMyLlNhZmVIYW5kbGVzOyB1c2luZyBTeXN0ZW0uQ29tcG9uZW50TW9kZWw7IHB1YmxpYyBzdGF0aWMgY2xhc3MgRWxhbXsgW0RsbEltcG9ydChcIktlcm5lbDMyXCIsIENoYXJTZXQ9Q2hhclNldC5BdXRvLCBTZXRMYXN0RXJyb3I9dHJ1ZSldIHB1YmxpYyBzdGF0aWMgZXh0ZXJuIGJvb2wgSW5zdGFsbEVMQU1DZXJ0aWZpY2F0ZUluZm8oU2FmZUZpbGVIYW5kbGUgaGFuZGxlKTsgcHVibGljIHN0YXRpYyB2b2lkIEluc3RhbGxXZEJvb3Qoc3RyaW5nIHBhdGgpIHsgQ29uc29sZS5PdXQuV3JpdGVMaW5lKFwiQWJvdXQgdG8gY2FsbCBjcmVhdGUgZmlsZSBvbiB7MH1cIiwgcGF0aCk7IHZhciBzdHJlYW0gPSBGaWxlLk9wZW4ocGF0aCwgRmlsZU1vZGUuT3BlbiwgRmlsZUFjY2Vzcy5SZWFkLCBGaWxlU2hhcmUuUmVhZCk7IHZhciBoYW5kbGUgPSBzdHJlYW0uU2FmZUZpbGVIYW5kbGU7IENvbnNvbGUuT3V0LldyaXRlTGluZShcIkFib3V0IHRvIGNhbGwgSW5zdGFsbEVMQU1DZXJ0aWZpY2F0ZUluZm8gb24gaGFuZGxlIHswfVwiLCBoYW5kbGUuRGFuZ2Vyb3VzR2V0SGFuZGxlKCkpOyBpZiAoIUluc3RhbGxFTEFNQ2VydGlmaWNhdGVJbmZvKGhhbmRsZSkpIHsgQ29uc29sZS5PdXQuV3JpdGVMaW5lKFwiQ2FsbCBmYWlsZWQuXCIpOyB0aHJvdyBuZXcgV2luMzJFeGNlcHRpb24oTWFyc2hhbC5HZXRMYXN0V2luMzJFcnJvcigpKTsgfSBDb25zb2xlLk91dC5Xcml0ZUxpbmUoXCJDYWxsIHN1Y2Nlc3NmdWwuXCIpOyB9IH0gJzsgJGRyaXZlclBhdGggPSAkZW52OlN5c3RlbVJvb3QgKyAnXFN5c3RlbTMyXERyaXZlcnNcV2RCb290LnN5cyc7IFtFbGFtXTo6SW5zdGFsbFdkQm9vdCgkZHJpdmVyUGF0aCkgIiA+TlVMIDI+JjEKClJFRyBxdWVyeSAiSEtMTVxTT0ZUV0FSRVxQb2xpY2llc1xNaWNyb3NvZnRcV2luZG93cyBBZHZhbmNlZCBUaHJlYXQgUHJvdGVjdGlvbiIgL3YgNjk2QzFGQTEtNDAzMC00RkE0LTg3MTMtRkFGOUIyRUE3QzBBIC9yZWc6NjQgPiAlVE1QJVxzZW5zZVRtcC50eHQgMj4mMQppZiAlRVJST1JMRVZFTCUgRVFVIDAgKCAgCiAgICBSRUcgZGVsZXRlICJIS0xNXFNPRlRXQVJFXFBvbGljaWVzXE1pY3Jvc29mdFxXaW5kb3dzIEFkdmFuY2VkIFRocmVhdCBQcm90ZWN0aW9uIiAvdiA2OTZDMUZBMS00MDMwLTRGQTQtODcxMy1GQUY5QjJFQTdDMEEgL2YgPiAlVE1QJVxzZW5zZVRtcC50eHQgMj4mMQogICAgaWYgJUVSUk9STEVWRUwlIE5FUSAwICgKICAgICAgICBzZXQgImVycm9yRGVzY3JpcHRpb249VW5hYmxlIHRvIGRlbGV0ZSBwcmV2aW91cyBvZmZib2FyZGluZyBpbmZvcm1hdGlvbiBmcm9tIHJlZ2lzdHJ5LiIKICAgICAgICBzZXQgZXJyb3JDb2RlPTUKICAgICAgICBzZXQgbGFzdEVycm9yPSVFUlJPUkxFVkVMJQogICAgICAgIEdPVE8gRVJST1IKICAgICkKKQoKUkVHIGFkZCAiSEtMTVxTT0ZUV0FSRVxQb2xpY2llc1xNaWNyb3NvZnRcV2luZG93cyBBZHZhbmNlZCBUaHJlYXQgUHJvdGVjdGlvbiIgL3YgT25ib2FyZGluZ0luZm8gL3QgUkVHX1NaIC9mIC9kICJ7XCJib2R5XCI6XCJ7XFxcInByZXZpb3VzT3JnSWRzXFxcIjpbXSxcXFwib3JnSWRcXFwiOlxcXCIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMGRlYWRcXFwiLFxcXCJnZW9Mb2NhdGlvblVybFxcXCI6XFxcImh0dHBzOi8vc2V2aWxsZWNsb3VkZ2F0ZXdheS1zdGcubWljcm9zb2Z0LmNvbS9cXFwiLFxcXCJkYXRhY2VudGVyXFxcIjpcXFwiRWFzdFVzMlxcXCIsXFxcInZvcnRleEdlb0xvY2F0aW9uXFxcIjpcXFwiU2FuZGJveFxcXCIsXFxcInZlcnNpb25cXFwiOlxcXCIxLjNcXFwifVwiLFwic2lnXCI6XCJKc0dGR2o3UCtIL1cvUEExcW9LTml3RXROZkU4YkhGblhxeks1SDhsQ09wc0RnRGNWTWpoT3BmQTZJTTJ3RFZadk5kWGhvZ0dEQ1FDWjNYdFJCbHRkcGFWc3pZNGtINVpHVkdnRUQxVE80ZCtCTjk2VDFSa3pOZ2NjZ2ZCWDNNQUw1bllUWXdiMGlUQUtFMGIxb3BmQmZrMzJQN3Q3b3A5dkhPeXZNMW5qdlZybVdWWWVSNk4rZFFrLzM4UDNUY2V3b2FkRmFUb3pidjBZK3dZOHgrbFcxeWN6bk1KMitQWTlxRHpabXoybE1rd0FlaDJwRTI4VW5MT0lhNjg0Y3U5RitHUlAveGhhR3dQWmpoc1JCSW51cHV5U1E2Y09YdE9kSERCQlRaZzVKSEhHMDBkNk9tUk5ONmxBelJWeFJURUVmaFFUVnN0U1poKzNMSjJTMGhmZGc9PVwiLFwic2hhMjU2c2lnXCI6XCJsVGI4ZittdkFveDRCckxPS0lqejFnTTNrRHREbG9wL21uNmZodmVEWjMvblVqb1lhNk81V2p4R0x2Z3lqZ0RtdThETkdPNUtqWWlxTVZ6Z0QzcHdqOVYwOXVOeUdYNGJUaXN0d1BnQTFLbGMrMUFLcmtWQTRGWGlQTHlST2tXdlhLM2dydFFJWU9nYjdSRlh6dzhnQlB5YlV0Z0FWbmNaMVFpdTAzblFLdGh5MFU3aXBlZUxaVE9oYVlhN001cTJxUTcya1BaSTZWUWlqSE42NVg3UTEvcm5rdUlSUkFmUEErZElIeE4wN0tpSlY2MGZsbDFZUUtOUlpSYUhKeGQ1UDd0RmdaaytEZE5mNVNXcHVaSTZTZE9MdExDN3VnbmdnK0krU2pUeUtvcVFKZElkWGRRaE5JK3I3WEM1L1M0ZlhnRVNtWmZKTUYxL0JtVlVFZUJDZlE9PVwiLFwiY2VydFwiOlwiTUlJRjVqQ0NBODZnQXdJQkFnSVRNd0FBQVkwdmh1VTl6R2x5b1FBQUFBQUJqVEFOQmdrcWhraUc5dzBCQVFzRkFEQitNUXN3Q1FZRFZRUUdFd0pWVXpFVE1CRUdBMVVFQ0JNS1YyRnphR2x1WjNSdmJqRVFNQTRHQTFVRUJ4TUhVbVZrYlc5dVpERWVNQndHQTFVRUNoTVZUV2xqY205emIyWjBJRU52Y25CdmNtRjBhVzl1TVNnd0pnWURWUVFERXg5TmFXTnliM052Wm5RZ1UyVmpkWEpsSUZObGNuWmxjaUJEUVNBeU1ERXhNQjRYRFRJd01EZ3dOakl3TlRBMU9Gb1hEVEl4TURnd05qSXdOVEExT0Zvd2dZb3hDekFKQmdOVkJBWVRBbFZUTVFzd0NRWURWUVFJRXdKWFFURVFNQTRHQTFVRUJ4TUhVbVZrYlc5dVpERWVNQndHQTFVRUNoTVZUV2xqY205emIyWjBJRU52Y25CdmNtRjBhVzl1TVI0d0hBWURWUVFMRXhWTmFXTnliM052Wm5RZ1EyOXljRzl5WVhScGIyNHhIREFhQmdOVkJBTVRFMU5sZG1sc2JHVXVWMmx1Wkc5M2N5NWpiMjB3Z2dFaU1BMEdDU3FHU0liM0RRRUJBUVVBQTRJQkR3QXdnZ0VLQW9JQkFRRENmcWtCcmV1Um1qdm90bDFFdURQWVplaVc1dUVERmV6MXhsYmh6cjVaa1BjSUJYT3RIMVZWRjRaUmVrdTFpK3ZMbTNON2xkVGl4c2RSZW0yU09iVkFGb1dDbjZ2cEYwL1ZYcWpmUTJHbyt2dk9UU1Q0Si9pQWxocXhialVVbkRyWFpXYUMvS2xtU0lYMjlHUng5bG1pT0IrWVBhRzlOTEE1U3F3emNad2hjTThzS3F0VDhHaWQ3Q3JFNGs1WldES0gyL1dPVTVsQ01iZTY2MWtrbWxKZDB2TlBDTXpyMUgzVmNmRG1qVVo4Q25WQzBFODlhVVA3VHhhME1uS0FzVFArQkpCNXJMenhkVlJRbGRNbmhHVXNXRU0ydUNOWXFOdWc4QWYrTGp3RytySXZrSVR3NVlDMUZDZy9qVHBvdHJnSFhmSGRqaURqa0F3ZWY1TlVkTmx0QWdNQkFBR2pnZ0ZPTUlJQlNqQU9CZ05WSFE4QkFmOEVCQU1DQjRBd0V3WURWUjBsQkF3d0NnWUlLd1lCQlFVSEF3RXdIUVlEVlIwT0JCWUVGT0U1NVFoeno5bEhuWTl2aDVTWmtyMTdjbEtzTUI0R0ExVWRFUVFYTUJXQ0UxTmxkbWxzYkdVdVYybHVaRzkzY3k1amIyMHdId1lEVlIwakJCZ3dGb0FVTmxhSlpVbkxXNXN2UEt4Q0ZsQk5rYmt6MTVFd1V3WURWUjBmQkV3d1NqQklvRWFnUklaQ2FIUjBjRG92TDNkM2R5NXRhV055YjNOdlpuUXVZMjl0TDNCcmFXOXdjeTlqY213dlRXbGpVMlZqVTJWeVEwRXlNREV4WHpJd01URXRNVEF0TVRndVkzSnNNR0FHQ0NzR0FRVUZCd0VCQkZRd1VqQlFCZ2dyQmdFRkJRY3dBb1pFYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVc5d2N5OWpaWEowY3k5TmFXTlRaV05UWlhKRFFUSXdNVEZmTWpBeE1TMHhNQzB4T0M1amNuUXdEQVlEVlIwVEFRSC9CQUl3QURBTkJna3Foa2lHOXcwQkFRc0ZBQU9DQWdFQVp3ZGxhWjg4U3BURFdUUjc5NWRHV2N0dUxUWmc2UDBqYmh4Q0dhOXBnb3AzSXZ1Qi9QYzJXT2Ruc1ZCYUpUZG5WN3NvcFZHa3V4Vjc1eWk2Q0NQM2sxNG0xQ1FhNk01cmNodmJuVEY0TFdjWld4U1g4Z0hjRWhObFdYV3hxU3FKMzNnSHVGNEc5SCs3VDM3UlNMb2Jqb1MyeVRhc21SRWtCNTI4b1gwWVU0cVpjeVdyK0xEMVovQk10dEhMUlZUZUtHdnpMaVpCNmhqWURybW9qUUxKZXZwSEdoTVdOTU9oR2RLd2pOS0crZGhVRHV6dTdsVXgwZzdhaUR3c1l4NzFTaU9ucDJWOSt5UEhET2R5OXlBRUNPb0N3bUprbW5qLzlDMmVNMDFDQjFZMUxTWHNiQUJtQVd3Si9iczhRNnhTWlJtSnkyRXJSQ3VTakl0MUQydzRTUFVMRFNNVTdIaDk3TWJpQVJDV25TMVRRMGg5azZFWVVmbW1ZaFNHQ0p3MXFlekFqZ2FmTngyYWcrRDhzRFFkQzRjVHhUSTk5aGthUm1DakFmeW1qcVdscUx5V0pCUmdvaXdTd21MVDFUbzRJNUVjZHFoQ1FNdEpoRVVRR2dpenk2ZUE2RlhtNHhmeExua08xSkNKSGJUejlqL2c4OW5zZ0hVN2V4SDVnZHhZQ0FDMGJkUlZLN1YrVlBDcExnLy9SemtlNm9mc1Y3WkxyQUpvN0EyQTZka0dVL09XeGhpVjJiY0VlUEpmSWsrVjM3UHp3c25yZ1JFV2RpM1pic3dBOU5aTTVzZGVSMFlFRm11bit0b2JCRGMzMlRidlVyTUpTb2tjcG9XNnRZczlkR0tUcE1GV01EZ09UeEZjSHljbHZrMjRVQVV2dXk2WVcvSVN2VlY4a3BRPVwiLFwiY2hhaW5cIjpbXCJNSUlHMkRDQ0JNQ2dBd0lCQWdJS1lUKzNHQUFBQUFBQUJEQU5CZ2txaGtpRzl3MEJBUXNGQURDQmlERUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVEIxSmxaRzF2Ym1ReEhqQWNCZ05WQkFvVEZVMXBZM0p2YzI5bWRDQkRiM0p3YjNKaGRHbHZiakV5TURBR0ExVUVBeE1wVFdsamNtOXpiMlowSUZKdmIzUWdRMlZ5ZEdsbWFXTmhkR1VnUVhWMGFHOXlhWFI1SURJd01URXdIaGNOTVRFeE1ERTRNakkxTlRFNVdoY05Nall4TURFNE1qTXdOVEU1V2pCK01Rc3dDUVlEVlFRR0V3SlZVekVUTUJFR0ExVUVDQk1LVjJGemFHbHVaM1J2YmpFUU1BNEdBMVVFQnhNSFVtVmtiVzl1WkRFZU1Cd0dBMVVFQ2hNVlRXbGpjbTl6YjJaMElFTnZjbkJ2Y21GMGFXOXVNU2d3SmdZRFZRUURFeDlOYVdOeWIzTnZablFnVTJWamRYSmxJRk5sY25abGNpQkRRU0F5TURFeE1JSUNJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBZzhBTUlJQ0NnS0NBZ0VBMEF2QXBLZ1pnZUkyNWVLcTVmT3lGVmgxdnJUbFNmSGdoUG03RFdUdmhjR0JWYmp6NS9GdFFGVTl6b3RxMFlTVDlYVjhXNlRVZEJES012TWowNjd1ejU0RVdNTFpSOHZSZkFCQlNIRWJBV2NYR0svRy9uTURmdVR2UTV6dkFYRXFINEVtUTNlWVZGZHpuVlVyOEo2T2ZRWU9yQnRVOHliMytDTUlJb3VlQmgwM09QMXkwc3JsWThHYVduMnliYk5TcVc3cHJyWDhpemI1bnZyMkhGZ2JsMWFsRWVXM1V0dTc2ZkJVdjdUL0xHeTRYU2JPb0FyWDM1UHRmOTJzOFN4ekd0a1pOMVc2M1NKNGpxSFVtd240QnlJeGNiQ1VydUN3NXlaRVY1Q0JseFhPWWV4bDRrdnhoVklXTXZpMWVLcCt6VTNzZ3lHa3FKdSttbW9FNEtNY3pWWVliUDFyTDBJKzRqZnljcXZRZUhOeWU5N3NBRmpsSVRDakNEcVo3NS9EOTNvV2xtVzF3NEd2OURsd1NhLzJxZlpxQURqNXRBZ1o0Qm8xcFZaMklsOXE4bW11UHExWVJrMjRWUGFKUVVRZWNyRzhFaWRUMHNIL3NzMVFtQjYxOUx1MndvSTUyYXdiOGpzbmhHcXd4aVlMMXpvUTU3UGJmTk5XckZOTUMvbzdNVGQwMkZrcitRQjVHUVo3L1J3ZFF0UkJEUzhGRHRWclNTUC96ODM0ZW9MUDJqd3QzK2pZRWdRWXVoNklkN2lZSHhBSHU4Z0ZmZ3NKdjJ2ZDQwNWJzUG5IaEtZN3lreWZXMklwOThlaXFKV0ljQ3psd1Q4OFVpTlBRSnJETVlXREw3OHA4UjFRanlHV0I4N3Y4b0RDUkgyYll1OHZ3M2VKcTBWTlV6NENlZE1DQXdFQUFhT0NBVXN3Z2dGSE1CQUdDU3NHQVFRQmdqY1ZBUVFEQWdFQU1CMEdBMVVkRGdRV0JCUTJWb2xsU2N0Ym15ODhyRUlXVUUyUnVUUFhrVEFaQmdrckJnRUVBWUkzRkFJRURCNEtBRk1BZFFCaUFFTUFRVEFMQmdOVkhROEVCQU1DQVlZd0R3WURWUjBUQVFIL0JBVXdBd0VCL3pBZkJnTlZIU01FR0RBV2dCUnlMVG9DTVpCRHVSUUZUdUhxcDhjeDBTT0pOREJhQmdOVkhSOEVVekJSTUUrZ1RhQkxoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1amIyMHZjR3RwTDJOeWJDOXdjbTlrZFdOMGN5OU5hV05TYjI5RFpYSkJkWFF5TURFeFh6SXdNVEZmTUROZk1qSXVZM0pzTUY0R0NDc0dBUVVGQndFQkJGSXdVREJPQmdnckJnRUZCUWN3QW9aQ2FIUjBjRG92TDNkM2R5NXRhV055YjNOdlpuUXVZMjl0TDNCcmFTOWpaWEowY3k5TmFXTlNiMjlEWlhKQmRYUXlNREV4WHpJd01URmZNRE5mTWpJdVkzSjBNQTBHQ1NxR1NJYjNEUUVCQ3dVQUE0SUNBUUJCeUdIQjlWdWVQcEV4OGJER3Z3a0J0SjIya0hUWENkdW1MZzJmeU9kMk5FYXZCMkNKVElHelBOWDBFalYxd25PbDlVMkVqTXVrWGErL2t2WVhDRmRDbFhKbEJYWjVyZTdSdXJndVZLTlJCNnhvNnlFTTR5V0J3czBxOHNQL3o4SzlTUmlheC9DRXhma1V2R3VWNVpidnMwTFNVOVZLb0JMRXJoSjJVd2xXRHAzMzA2WkppRkR5aWl5WElLSytUbmp2QldXM1M2RVdpTjR4eHdoQ0pIeWtlNTZkdkdBQVhtS1g0NVA4cC81YmV5WGY1Rk4vUzc3bVB2RGJBWGxDSEc2RmJIMjJSREQ3cFRlU2s3S2w3aUN0UDFQVnlmUW9hMWZCK0IxcXQxWXF0aWVCSEtZdG4rZjAwREdEbDZncXRxeStHMEgxNUlsZlZ2dmFXdE5lZlZXVUVINVRWL1JLUFVBcXlMMW5uNFRoRU83OTJtc1Zna244UmgzL1JRWjBuRUlVN2NVNTA3UE5DNE1ua0VOUmt2SkVncTV1bWhVWHNobjZ4MFZzbUFGN3Z6ZXBzSWlra3J3NE9PQWQ1SHlYbUJvdVgrODRaYmMxTDcxL1R5SDZ4SXpTYndiNVNUWHEzeUFQSmFycVlLc3NIMHVKL0xmNlhGU1FTejZpS0U5czVGSmx3ZjJRSElXQ2lHN3BwbFhkSVNoNVJiQVU1UXJNNWwvRXU5dGhOR21mckNZNDk4RXBRUWdWTGt5Zzkva01QdDVmcXdnSkxZT3NyRFNEWXZUSlNVS0pKYlZ1c2tmRnN6bWdzU0FiTExHT0JHK2xNRWtjMEVicFFGdjByVzY2MjRKS2h4SktnQWxOMjk5MnVRVmJHK0M3SUhCZkFDWEgwdzc2RnExN0lwNXhDQT09XCIsXCJNSUlGN1RDQ0E5V2dBd0lCQWdJUVA0dkl0Znlmc3BaRHRXbldiRUxoUkRBTkJna3Foa2lHOXcwQkFRc0ZBRENCaURFTE1Ba0dBMVVFQmhNQ1ZWTXhFekFSQmdOVkJBZ1RDbGRoYzJocGJtZDBiMjR4RURBT0JnTlZCQWNUQjFKbFpHMXZibVF4SGpBY0JnTlZCQW9URlUxcFkzSnZjMjltZENCRGIzSndiM0poZEdsdmJqRXlNREFHQTFVRUF4TXBUV2xqY205emIyWjBJRkp2YjNRZ1EyVnlkR2xtYVdOaGRHVWdRWFYwYUc5eWFYUjVJREl3TVRFd0hoY05NVEV3TXpJeU1qSXdOVEk0V2hjTk16WXdNekl5TWpJeE16QTBXakNCaURFTE1Ba0dBMVVFQmhNQ1ZWTXhFekFSQmdOVkJBZ1RDbGRoYzJocGJtZDBiMjR4RURBT0JnTlZCQWNUQjFKbFpHMXZibVF4SGpBY0JnTlZCQW9URlUxcFkzSnZjMjltZENCRGIzSndiM0poZEdsdmJqRXlNREFHQTFVRUF4TXBUV2xqY205emIyWjBJRkp2YjNRZ1EyVnlkR2xtYVdOaGRHVWdRWFYwYUc5eWFYUjVJREl3TVRFd2dnSWlNQTBHQ1NxR1NJYjNEUUVCQVFVQUE0SUNEd0F3Z2dJS0FvSUNBUUN5Z0VHcU5UaE5FM0l5YUNKTnVMTHgvOVZTdkd6SDlkSktqRGJ1MGNKY2ZveUtycThUS0cvQWMrTTZ6dEFscUZvNmJlK291Rm1yRXlOb3pRd3BoOUZ2Z0Z5UFJIOWRrQUZTV0t4UnhWOHFoOXpjMkFvZHdRTzVlN0JXNktQZVpHSENudmp6Zkxuc0RiVlUva3kyWlUrSThKeEltUXhDQ3dsOE1Wa1hlUVo0S0kySk9rd0RKYjV4YWx3TDU0UmdwSmtpNDlLdmhLU24rOUdZN1F5cDNwU0o0UTZnM01ET21UM3FDRks3Vm5ua0g0UzZIcmkweEVsY1R6RkxoOTNkQldjbW1ZRGdjUkdqdUtWQjRxUlR1ZmN5S1lNTUU3ODJYZ1N6UzBOSEwydmlrUjdUbUUvZFFnZkk2QjBTL0ptcGF6NlNmc2pXYVRyOFpMMjJDWjNLL1F3TG9wdDNZRXNEbEtRd2FSTFdRaTNCUVV6SzNLcjlqMXVEUnByWi9MSFI0N1BKZjBoNnpTVHdRWTljZE5Dc3NCQWdCa20zeHkwaHlGZmowSWJ6QTJqNzBNNXh3WW1aU21RQmJQM3NNSkhQUVR5U3grVzZoaDFoaE1kZmd6bGlyclNTTDBmekMvaFY2NkFmV2RDN2RKc2UwSGJtOHVrRzF4RG8rbVRlYWNZMWxvZ0M4RWE0UHllWmI4dHhpU2sxOTBnV0FqV1AxWGw4VFFMUFgrdUtnMDlGY1lqNXFRMU9jdW5DbkFmUFNSdE9CQTVqVVl4ZTJBREJWU3kyeHVEQ1pVN0pORG4xbkxQRWZ1aGhiaE5mRmNSZjJYN3RIYzd1Uk96TExvYXg3RGoyY08yclhCUEIyUThOeDRDeVZlMDA5NnliNU1QYTUwYzhwcldQTWQvRlM2L3I4UUlEQVFBQm8xRXdUekFMQmdOVkhROEVCQU1DQVlZd0R3WURWUjBUQVFIL0JBVXdBd0VCL3pBZEJnTlZIUTRFRmdRVWNpMDZBakdRUTdrVUJVN2g2cWZITWRFamlUUXdFQVlKS3dZQkJBR0NOeFVCQkFNQ0FRQXdEUVlKS29aSWh2Y05BUUVMQlFBRGdnSUJBSDl5encrM3hSWGJtOEJKeWlaYi9wNFQ1dFB3MHR1WFgvSkxQMDJ6cmhtdTdkZVhvS3p2cVRxandrR3c1YmlSbmhPQkpBUG1DZjAvVjBBNUlTUlcwUkF2UzBDcE5vWkx0Rk5YbXZ2eGZvbVBFZjRZYkZHcTZPMEpsYlhsY2NtaDZZZDFwaFYveVg0M1ZGNTBrOFhEWjh3TlQydW9Gd3h0Q0pKK2k5MkJxaTF3SWNNOUJoUzd2eVJlcDRUWFB3OGhJcjFMQUFiYmx4ellYdFRGQzF5SGJsQ2s2TU00cFB2TExNV1NacHVGWHN0NmJKTjhnQ2xZVzFlMVFHbTZDSG1tWkdJVm5ZZVdSYlZtSXlBRGl4eHpvTk9pZVRQZ1VGbUcyeS9sQWlYcWN5cWZBQlRJTnNlU08rbE9BT3pZVmdtNU0wa1MwbFFMQWF1c1I3YVJLWDFNdEhXQVVnSG95b0wybjh5c25JOFg2aThtc0t0eXJBditubEVleDBOVlowOVJzMWZXdHV6dVVyYzY2VTdoMTRHSXZFK09kYnRMcVBBMXFpYlVaMmRKc25CTU81UGNIZDk0a0laeXNqaWswZHlTVGNsWTZ5c1NYTlE3cm94cnNJUGxBVC80Q1RMMmt6VTBJcS9kTncxM0NZQXJ6VWdBOFl5WkdVY0ZBZW5SdjlGTzBPWW9RemVacEFwS0NObWFjWFBTcXMweEUyTjJvVGR2a2pnZWZSSThaakxueTIzaC9GS0ozY3JXWmdXYWxtRytvaWpISEtPbk5sQThPcVRmU203bWh6dk82L0RnZ1RlZEV6eFNqcjI1SFRUR0hkVUthajJZS1hDTWlTclJxNElRU0IvYzlPK2x4YnRWR2poamhFNjNiSzJWVk94bEloQkpGN2pBSHNjUHJGUkhcIl19IiA+ICVUTVAlXHNlbnNlVG1wLnR4dCAyPiYxCmlmICVFUlJPUkxFVkVMJSBORVEgMCAoCiAgIHNldCAiZXJyb3JEZXNjcmlwdGlvbj1VbmFibGUgdG8gd3JpdGUgb25ib2FyZGluZyBpbmZvcm1hdGlvbiB0byByZWdpc3RyeS4iCiAgIHNldCBlcnJvckNvZGU9MTAKICAgc2V0IGxhc3RFcnJvcj0lRVJST1JMRVZFTCUKICAgR09UTyBFUlJPUgopCgplY2hvIFN0YXJ0aW5nIHRoZSBzZXJ2aWNlLCBpZiBub3QgYWxyZWFkeSBydW5uaW5nID5OVUwgMj4mMQplY2hvLiA+TlVMIDI+JjEKc2MgcXVlcnkgIlNFTlNFIiB8IGZpbmQgL2kgIlJVTk5JTkciID5OVUwgMj4mMQppZiAlRVJST1JMRVZFTCUgRVFVIDAgR09UTyBSVU5OSU5HCgpuZXQgc3RhcnQgc2Vuc2UgPiAlVE1QJVxzZW5zZVRtcC50eHQgMj4mMQppZiAlRVJST1JMRVZFTCUgTkVRIDAgKAogICBlY2hvIFdpbmRvd3MgRGVmZW5kZXIgQWR2YW5jZWQgVGhyZWF0IFByb3RlY3Rpb24gU2VydmljZSBoYXMgbm90IHN0YXJ0ZWQgeWV0ID5OVUwgMj4mMQogICBHT1RPIFdBSVRfRk9SX1RIRV9TRVJWSUNFX1RPX1NUQVJUCikKZ290byBTVUNDRUVERUQKCjpSVU5OSU5HCnNldCAicnVubmluZ091dHB1dD1UaGUgV2luZG93cyBEZWZlbmRlciBBZHZhbmNlZCBUaHJlYXQgUHJvdGVjdGlvbiBTZXJ2aWNlIGlzIGFscmVhZHkgcnVubmluZyEiCmVjaG8gJXJ1bm5pbmdPdXRwdXQlID5OVUwgMj4mMQplY2hvLiA+TlVMIDI+JjEKZXZlbnRjcmVhdGUgL2wgQXBwbGljYXRpb24gL3NvIFdEQVRQT25ib2FyZGluZyAvdCBJbmZvcm1hdGlvbiAvaWQgMTAgL2QgIiVydW5uaW5nT3V0cHV0JSIgPk5VTCAyPiYxCkdPVE8gV0FJVF9GT1JfVEhFX1NFUlZJQ0VfVE9fU1RBUlQKCjpFUlJPUgpTZXQgL1AgZXJyb3JNc2c9PCVUTVAlXHNlbnNlVG1wLnR4dApzZXQgImVycm9yT3V0cHV0PVtFcnJvciBJZDogJWVycm9yQ29kZSUsIEVycm9yIExldmVsOiAlbGFzdEVycm9yJV0gJWVycm9yRGVzY3JpcHRpb24lIEVycm9yIG1lc3NhZ2U6ICVlcnJvck1zZyUiCiVwb3dlcnNoZWxsUGF0aCUgLUV4ZWN1dGlvblBvbGljeSBCeXBhc3MgLU5vUHJvZmlsZSAtQ29tbWFuZCAiQWRkLVR5cGUgJ3VzaW5nIFN5c3RlbTsgdXNpbmcgU3lzdGVtLkRpYWdub3N0aWNzOyB1c2luZyBTeXN0ZW0uRGlhZ25vc3RpY3MuVHJhY2luZzsgbmFtZXNwYWNlIFNlbnNlIHsgW0V2ZW50RGF0YShOYW1lID0gXCJPbmJvYXJkaW5nXCIpXXB1YmxpYyBzdHJ1Y3QgT25ib2FyZGluZ3twdWJsaWMgc3RyaW5nIE1lc3NhZ2UgeyBnZXQ7IHNldDsgfX0gcHVibGljIGNsYXNzIFRyYWNlIHtwdWJsaWMgc3RhdGljIEV2ZW50U291cmNlT3B0aW9ucyBUZWxlbWV0cnlDcml0aWNhbE9wdGlvbiA9IG5ldyBFdmVudFNvdXJjZU9wdGlvbnMoKXtMZXZlbCA9IEV2ZW50TGV2ZWwuRXJyb3IsIEtleXdvcmRzID0gKEV2ZW50S2V5d29yZHMpMHgwMDAwMjAwMDAwMDAwMDAwLCBUYWdzID0gKEV2ZW50VGFncykweDAyMDAwMDB9OyBwdWJsaWMgdm9pZCBXcml0ZU9uYm9hcmRpbmdNZXNzYWdlKHN0cmluZyBtZXNzYWdlKXtlcy5Xcml0ZShcIk9uYm9hcmRpbmdTY3JpcHRcIiwgVGVsZW1ldHJ5Q3JpdGljYWxPcHRpb24sIG5ldyBPbmJvYXJkaW5nIHtNZXNzYWdlID0gbWVzc2FnZX0pO30gcHJpdmF0ZSBzdGF0aWMgcmVhZG9ubHkgc3RyaW5nW10gdGVsZW1ldHJ5VHJhaXRzID0geyBcIkVUV19HUk9VUFwiLCBcIns1RUNCMEJBQy1COTMwLTQ3RjUtQThBNC1FODI1MzUyOUVEQjd9XCIgfTsgcHJpdmF0ZSBFdmVudFNvdXJjZSBlcyA9IG5ldyBFdmVudFNvdXJjZShcIk1pY3Jvc29mdC5XaW5kb3dzLlNlbnNlLkNsaWVudC5NYW5hZ2VtZW50XCIsRXZlbnRTb3VyY2VTZXR0aW5ncy5FdHdTZWxmRGVzY3JpYmluZ0V2ZW50Rm9ybWF0LHRlbGVtZXRyeVRyYWl0cyk7fX0nOyAkbG9nZ2VyID0gTmV3LU9iamVjdCAtVHlwZU5hbWUgU2Vuc2UuVHJhY2U7ICRsb2dnZXIuV3JpdGVPbmJvYXJkaW5nTWVzc2FnZSgnJWVycm9yT3V0cHV0JScpIiA+TlVMIDI+JjEKZWNobyAlZXJyb3JPdXRwdXQlID5OVUwgMj4mMQplY2hvLiA+TlVMIDI+JjEKZXZlbnRjcmVhdGUgL2wgQXBwbGljYXRpb24gL3NvIFdEQVRQT25ib2FyZGluZyAvdCBFcnJvciAvaWQgJWVycm9yQ29kZSUgL2QgIiVlcnJvck91dHB1dCUiID5OVUwgMj4mMQpHT1RPIENMRUFOVVAKCjpTVUNDRUVERUQKZWNobyBGaW5pc2hlZCBwZXJmb3JtaW5nIG9uYm9hcmRpbmcgb3BlcmF0aW9ucyA+TlVMIDI+JjEKZWNoby4gPk5VTCAyPiYxCkdPVE8gV0FJVF9GT1JfVEhFX1NFUlZJQ0VfVE9fU1RBUlQKCjpXQUlUX0ZPUl9USEVfU0VSVklDRV9UT19TVEFSVAplY2hvIFdhaXRpbmcgZm9yIHRoZSBzZXJ2aWNlIHRvIHN0YXJ0ID5OVUwgMj4mMQplY2hvLiA+TlVMIDI+JjEKCnNldCAvYSBjb3VudGVyPTAKCjpTRU5TRV9SVU5OSU5HX1dBSVQKc2MgcXVlcnkgIlNFTlNFIiB8IGZpbmQgL2kgIlJVTk5JTkciID5OVUwgMj4mMQppZiAlRVJST1JMRVZFTCUgTkVRIDAgKAoJSUYgJWNvdW50ZXIlIEVRVSA0ICgKCQlzZXQgImVycm9yRGVzY3JpcHRpb249VW5hYmxlIHRvIHN0YXJ0IFdpbmRvd3MgRGVmZW5kZXIgQWR2YW5jZWQgVGhyZWF0IFByb3RlY3Rpb24gU2VydmljZS4iCgkJc2V0IGVycm9yQ29kZT0xNQoJCXNldCBsYXN0RXJyb3I9JUVSUk9STEVWRUwlCgkJR09UTyBFUlJPUgoJKQoKCXNldCAvYSBjb3VudGVyPSVjb3VudGVyJSsxCgoJdGltZW91dCA1ID5OVUwgMj4mMQoJR09UTyA6U0VOU0VfUlVOTklOR19XQUlUCikKCnNldCAvYSBjb3VudGVyPTAKCjpTRU5TRV9PTkJPQVJERURfU1RBVFVTX1dBSVQKUkVHIHF1ZXJ5ICJIS0xNXFNPRlRXQVJFXE1pY3Jvc29mdFxXaW5kb3dzIEFkdmFuY2VkIFRocmVhdCBQcm90ZWN0aW9uXFN0YXR1cyIgL3YgT25ib2FyZGluZ1N0YXRlIC9yZWc6NjQgPk5VTCAyPiYxCmlmICVFUlJPUkxFVkVMJSBORVEgMCAoCglJRiAlY291bnRlciUgRVFVIDQgKAoJCUBlY2hvIFdpbmRvd3MgRGVmZW5kZXIgQWR2YW5jZWQgVGhyZWF0IFByb3RlY3Rpb24gU2VydmljZSBpcyBub3QgcnVubmluZyBhcyBleHBlY3RlZD4gJVRNUCVcc2Vuc2VUbXAudHh0CgkJc2V0IGVycm9yQ29kZT0zNQogICAgIHNldCBsYXN0RXJyb3I9JUVSUk9STEVWRUwlCgkJR09UTyBFUlJPUgoJKQoKCXNldCAvYSBjb3VudGVyPSVjb3VudGVyJSsxCgoJdGltZW91dCA1ID5OVUwgMj4mMQoJR09UTyA6U0VOU0VfT05CT0FSREVEX1NUQVRVU19XQUlUCikKCnNldCAvYSBjb3VudGVyPTAKCjpTRU5TRV9PTkJPQVJERURfV0FJVApSRUcgcXVlcnkgIkhLTE1cU09GVFdBUkVcTWljcm9zb2Z0XFdpbmRvd3MgQWR2YW5jZWQgVGhyZWF0IFByb3RlY3Rpb25cU3RhdHVzIiAvdiBPbmJvYXJkaW5nU3RhdGUgL3JlZzo2NCB8IGZpbmQgL2kgIjB4MSIgPk5VTCAyPiYxCmlmICVFUlJPUkxFVkVMJSBORVEgMCAoCglJRiAlY291bnRlciUgRVFVIDQgKAoJCUBlY2hvIFdpbmRvd3MgRGVmZW5kZXIgQWR2YW5jZWQgVGhyZWF0IFByb3RlY3Rpb24gU2VydmljZSBpcyBub3QgcnVubmluZyBhcyBleHBlY3RlZD4gJVRNUCVcc2Vuc2VUbXAudHh0CgkJc2V0IGVycm9yQ29kZT00MAogICAgIHNldCBsYXN0RXJyb3I9JUVSUk9STEVWRUwlCgkJR09UTyBFUlJPUgoJKQoKCXNldCAvYSBjb3VudGVyPSVjb3VudGVyJSsxCgoJdGltZW91dCA1ID5OVUwgMj4mMQoJR09UTyA6U0VOU0VfT05CT0FSREVEX1dBSVQKKQoKc2V0ICJzdWNjZXNzT3V0cHV0PVN1Y2Nlc3NmdWxseSBvbmJvYXJkZWQgbWFjaGluZSB0byBXaW5kb3dzIERlZmVuZGVyIEFkdmFuY2VkIFRocmVhdCBQcm90ZWN0aW9uIgplY2hvICVzdWNjZXNzT3V0cHV0JSA+TlVMIDI+JjEKZWNoby4KZXZlbnRjcmVhdGUgL2wgQXBwbGljYXRpb24gL3NvIFdEQVRQT25ib2FyZGluZyAvdCBJbmZvcm1hdGlvbiAvaWQgMjAgL2QgIiVzdWNjZXNzT3V0cHV0JSIgPk5VTCAyPiYxCiVwb3dlcnNoZWxsUGF0aCUgLUV4ZWN1dGlvblBvbGljeSBCeXBhc3MgLU5vUHJvZmlsZSAtQ29tbWFuZCAiQWRkLVR5cGUgJ3VzaW5nIFN5c3RlbTsgdXNpbmcgU3lzdGVtLkRpYWdub3N0aWNzOyB1c2luZyBTeXN0ZW0uRGlhZ25vc3RpY3MuVHJhY2luZzsgbmFtZXNwYWNlIFNlbnNlIHsgW0V2ZW50RGF0YShOYW1lID0gXCJPbmJvYXJkaW5nXCIpXXB1YmxpYyBzdHJ1Y3QgT25ib2FyZGluZ3twdWJsaWMgc3RyaW5nIE1lc3NhZ2UgeyBnZXQ7IHNldDsgfX0gcHVibGljIGNsYXNzIFRyYWNlIHtwdWJsaWMgc3RhdGljIEV2ZW50U291cmNlT3B0aW9ucyBUZWxlbWV0cnlDcml0aWNhbE9wdGlvbiA9IG5ldyBFdmVudFNvdXJjZU9wdGlvbnMoKXtMZXZlbCA9IEV2ZW50TGV2ZWwuSW5mb3JtYXRpb25hbCwgS2V5d29yZHMgPSAoRXZlbnRLZXl3b3JkcykweDAwMDAyMDAwMDAwMDAwMDAsIFRhZ3MgPSAoRXZlbnRUYWdzKTB4MDIwMDAwMH07IHB1YmxpYyB2b2lkIFdyaXRlT25ib2FyZGluZ01lc3NhZ2Uoc3RyaW5nIG1lc3NhZ2Upe2VzLldyaXRlKFwiT25ib2FyZGluZ1NjcmlwdFwiLCBUZWxlbWV0cnlDcml0aWNhbE9wdGlvbiwgbmV3IE9uYm9hcmRpbmcge01lc3NhZ2UgPSBtZXNzYWdlfSk7fSBwcml2YXRlIHN0YXRpYyByZWFkb25seSBzdHJpbmdbXSB0ZWxlbWV0cnlUcmFpdHMgPSB7IFwiRVRXX0dST1VQXCIsIFwiezVFQ0IwQkFDLUI5MzAtNDdGNS1BOEE0LUU4MjUzNTI5RURCN31cIiB9OyBwcml2YXRlIEV2ZW50U291cmNlIGVzID0gbmV3IEV2ZW50U291cmNlKFwiTWljcm9zb2Z0LldpbmRvd3MuU2Vuc2UuQ2xpZW50Lk1hbmFnZW1lbnRcIixFdmVudFNvdXJjZVNldHRpbmdzLkV0d1NlbGZEZXNjcmliaW5nRXZlbnRGb3JtYXQsdGVsZW1ldHJ5VHJhaXRzKTt9fSc7ICRsb2dnZXIgPSBOZXctT2JqZWN0IC1UeXBlTmFtZSBTZW5zZS5UcmFjZTsgJGxvZ2dlci5Xcml0ZU9uYm9hcmRpbmdNZXNzYWdlKCclc3VjY2Vzc091dHB1dCUnKSIgPk5VTCAyPiYxCiIlUFJPR1JBTUZJTEVTJVxXaW5kb3dzIERlZmVuZGVyXE1wQ21kUnVuLmV4ZSIgLVJlbG9hZEVuZ2luZSA+TlVMIDI+JjEKCkdPVE8gQ0xFQU5VUAoKOkNMRUFOVVAKaWYgZXhpc3QgJVRNUCVcc2Vuc2VUbXAudHh0IGRlbCAlVE1QJVxzZW5zZVRtcC50eHQKRVhJVCAvQiAlZXJyb3JDb2RlJQo=="), - // OnboardingPackageWindows: []byte("QGVjaG8gb2ZmCgplY2hvLiA+TlVMIDI+JjEKZWNobyBTdGFydGluZyBXaW5kb3dzIERlZmVuZGVyIEFkdmFuY2VkIFRocmVhdCBQcm90ZWN0aW9uIG9uYm9hcmRpbmcgcHJvY2Vzcy4uLiA+TlVMIDI+JjEKZWNoby4gPk5VTCAyPiYxCgpzZXQgZXJyb3JDb2RlPTAKc2V0IGxhc3RFcnJvcj0wCnNldCAidHJvdWJsZXNob290SW5mbz1Gb3IgbW9yZSBpbmZvcm1hdGlvbiwgdmlzaXQ6IGh0dHBzOi8vZ28ubWljcm9zb2Z0LmNvbS9md2xpbmsvcC8/bGlua2lkPTgyMjgwNyIKc2V0ICJlcnJvckRlc2NyaXB0aW9uPSIKCmVjaG8gVGVzdGluZyBhZG1pbmlzdHJhdG9yIHByaXZpbGVnZXMgPk5VTCAyPiYxCgpuZXQgc2Vzc2lvbiA+TlVMIDI+JjEKaWYgJUVSUk9STEVWRUwlIE5FUSAwICgKCUBlY2hvIFNjcmlwdCBpcyBydW5uaW5nIHdpdGggaW5zdWZmaWNpZW50IHByaXZpbGVnZXMuIFBsZWFzZSBydW4gd2l0aCBhZG1pbmlzdHJhdG9yIHByaXZpbGVnZXM+ICVUTVAlXHNlbnNlVG1wLnR4dAoJc2V0IGVycm9yQ29kZT02NQogc2V0IGxhc3RFcnJvcj0lRVJST1JMRVZFTCUKCUdPVE8gRVJST1IKKQoKZWNobyBTY3JpcHQgaXMgcnVubmluZyB3aXRoIHN1ZmZpY2llbnQgcHJpdmlsZWdlcyA+TlVMIDI+JjEKZWNoby4gPk5VTCAyPiYxCmVjaG8gUGVyZm9ybWluZyBvbmJvYXJkaW5nIG9wZXJhdGlvbnMgPk5VTCAyPiYxCmVjaG8uID5OVUwgMj4mMQoKSUYgWyVQUk9DRVNTT1JfQVJDSElURVc2NDMyJV0gRVFVIFtdICgKICBzZXQgcG93ZXJzaGVsbFBhdGg9JXdpbmRpciVcU3lzdGVtMzJcV2luZG93c1Bvd2VyU2hlbGxcdjEuMFxwb3dlcnNoZWxsLmV4ZQopIEVMU0UgKAogIHNldCBwb3dlcnNoZWxsUGF0aD0ld2luZGlyJVxTeXNOYXRpdmVcV2luZG93c1Bvd2VyU2hlbGxcdjEuMFxwb3dlcnNoZWxsLmV4ZQopCgpzZXQgc2RiaW49MDEwMDA0ODA0NDAwMDAwMDU0MDAwMDAwMDAwMDAwMDAxNDAwMDAwMDAyMDAzMDAwMDIwMDAwMDAwMDAwMTQwMEZGMEYxMjAwMDEwMTAwMDAwMDAwMDAwNTEyMDAwMDAwMDAwMDE0MDBFMTA0MTIwMDAxMDEwMDAwMDAwMDAwMDUwQjAwMDAwMDAxMDIwMDAwMDAwMDAwMDUyMDAwMDAwMDIwMDIwMDAwMDEwMjAwMDAwMDAwMDAwNTIwMDAwMDAwMjAwMjAwMDAgPk5VTCAyPiYxCnJlZyBhZGQgSEtMTVxTWVNURU1cQ3VycmVudENvbnRyb2xTZXRcQ29udHJvbFxXTUlcU2VjdXJpdHkgL3YgMTRmODEzOGUtM2I2MS01ODBiLTU0NGItMjYwOTM3OGFlNDYwIC90IFJFR19CSU5BUlkgL2QgJXNkYmluJSAvZiA+TlVMIDI+JjEKcmVnIGFkZCBIS0xNXFNZU1RFTVxDdXJyZW50Q29udHJvbFNldFxDb250cm9sXFdNSVxTZWN1cml0eSAvdiBjYjJmZjcyZC1kNGU0LTU4NWQtMzNmOS1mM2EzOTVjNDBiZTcgL3QgUkVHX0JJTkFSWSAvZCAlc2RiaW4lIC9mID5OVUwgMj4mMQoKUkVHIGFkZCAiSEtMTVxTT0ZUV0FSRVxQb2xpY2llc1xNaWNyb3NvZnRcV2luZG93c1xEYXRhQ29sbGVjdGlvbiIgL3YgRGlzYWJsZUVudGVycHJpc2VBdXRoUHJveHkgL3QgUkVHX0RXT1JEIC9mIC9kIDEgPk5VTCAyPiYxCgolcG93ZXJzaGVsbFBhdGglIC1FeGVjdXRpb25Qb2xpY3kgQnlwYXNzIC1Ob1Byb2ZpbGUgLUNvbW1hbmQgIkFkZC1UeXBlICcgdXNpbmcgU3lzdGVtOyB1c2luZyBTeXN0ZW0uSU87IHVzaW5nIFN5c3RlbS5SdW50aW1lLkludGVyb3BTZXJ2aWNlczsgdXNpbmcgTWljcm9zb2Z0LldpbjMyLlNhZmVIYW5kbGVzOyB1c2luZyBTeXN0ZW0uQ29tcG9uZW50TW9kZWw7IHB1YmxpYyBzdGF0aWMgY2xhc3MgRWxhbXsgW0RsbEltcG9ydChcIktlcm5lbDMyXCIsIENoYXJTZXQ9Q2hhclNldC5BdXRvLCBTZXRMYXN0RXJyb3I9dHJ1ZSldIHB1YmxpYyBzdGF0aWMgZXh0ZXJuIGJvb2wgSW5zdGFsbEVMQU1DZXJ0aWZpY2F0ZUluZm8oU2FmZUZpbGVIYW5kbGUgaGFuZGxlKTsgcHVibGljIHN0YXRpYyB2b2lkIEluc3RhbGxXZEJvb3Qoc3RyaW5nIHBhdGgpIHsgQ29uc29sZS5PdXQuV3JpdGVMaW5lKFwiQWJvdXQgdG8gY2FsbCBjcmVhdGUgZmlsZSBvbiB7MH1cIiwgcGF0aCk7IHZhciBzdHJlYW0gPSBGaWxlLk9wZW4ocGF0aCwgRmlsZU1vZGUuT3BlbiwgRmlsZUFjY2Vzcy5SZWFkLCBGaWxlU2hhcmUuUmVhZCk7IHZhciBoYW5kbGUgPSBzdHJlYW0uU2FmZUZpbGVIYW5kbGU7IENvbnNvbGUuT3V0LldyaXRlTGluZShcIkFib3V0IHRvIGNhbGwgSW5zdGFsbEVMQU1DZXJ0aWZpY2F0ZUluZm8gb24gaGFuZGxlIHswfVwiLCBoYW5kbGUuRGFuZ2Vyb3VzR2V0SGFuZGxlKCkpOyBpZiAoIUluc3RhbGxFTEFNQ2VydGlmaWNhdGVJbmZvKGhhbmRsZSkpIHsgQ29uc29sZS5PdXQuV3JpdGVMaW5lKFwiQ2FsbCBmYWlsZWQuXCIpOyB0aHJvdyBuZXcgV2luMzJFeGNlcHRpb24oTWFyc2hhbC5HZXRMYXN0V2luMzJFcnJvcigpKTsgfSBDb25zb2xlLk91dC5Xcml0ZUxpbmUoXCJDYWxsIHN1Y2Nlc3NmdWwuXCIpOyB9IH0gJzsgJGRyaXZlclBhdGggPSAkZW52OlN5c3RlbVJvb3QgKyAnXFN5c3RlbTMyXERyaXZlcnNcV2RCb290LnN5cyc7IFtFbGFtXTo6SW5zdGFsbFdkQm9vdCgkZHJpdmVyUGF0aCkgIiA+TlVMIDI+JjEKClJFRyBxdWVyeSAiSEtMTVxTT0ZUV0FSRVxQb2xpY2llc1xNaWNyb3NvZnRcV2luZG93cyBBZHZhbmNlZCBUaHJlYXQgUHJvdGVjdGlvbiIgL3YgNjk2QzFGQTEtNDAzMC00RkE0LTg3MTMtRkFGOUIyRUE3QzBBIC9yZWc6NjQgPiAlVE1QJVxzZW5zZVRtcC50eHQgMj4mMQppZiAlRVJST1JMRVZFTCUgRVFVIDAgKCAgCiAgICBSRUcgZGVsZXRlICJIS0xNXFNPRlRXQVJFXFBvbGljaWVzXE1pY3Jvc29mdFxXaW5kb3dzIEFkdmFuY2VkIFRocmVhdCBQcm90ZWN0aW9uIiAvdiA2OTZDMUZBMS00MDMwLTRGQTQtODcxMy1GQUY5QjJFQTdDMEEgL2YgPiAlVE1QJVxzZW5zZVRtcC50eHQgMj4mMQogICAgaWYgJUVSUk9STEVWRUwlIE5FUSAwICgKICAgICAgICBzZXQgImVycm9yRGVzY3JpcHRpb249VW5hYmxlIHRvIGRlbGV0ZSBwcmV2aW91cyBvZmZib2FyZGluZyBpbmZvcm1hdGlvbiBmcm9tIHJlZ2lzdHJ5LiIKICAgICAgICBzZXQgZXJyb3JDb2RlPTUKICAgICAgICBzZXQgbGFzdEVycm9yPSVFUlJPUkxFVkVMJQogICAgICAgIEdPVE8gRVJST1IKICAgICkKKQoKUkVHIGFkZCAiSEtMTVxTT0ZUV0FSRVxQb2xpY2llc1xNaWNyb3NvZnRcV2luZG93cyBBZHZhbmNlZCBUaHJlYXQgUHJvdGVjdGlvbiIgL3YgT25ib2FyZGluZ0luZm8gL3QgUkVHX1NaIC9mIC9kICJ7XCJib2R5XCI6XCJ7XFxcInByZXZpb3VzT3JnSWRzXFxcIjpbXSxcXFwib3JnSWRcXFwiOlxcXCIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMGRlYWRcXFwiLFxcXCJnZW9Mb2NhdGlvblVybFxcXCI6XFxcImh0dHBzOi8vc2V2aWxsZWNsb3VkZ2F0ZXdheS1zdGcubWljcm9zb2Z0LmNvbS9cXFwiLFxcXCJkYXRhY2VudGVyXFxcIjpcXFwiRWFzdFVzMlxcXCIsXFxcInZvcnRleEdlb0xvY2F0aW9uXFxcIjpcXFwiU2FuZGJveFxcXCIsXFxcInZlcnNpb25cXFwiOlxcXCIxLjNcXFwifVwiLFwic2lnXCI6XCJKc0dGR2o3UCtIL1cvUEExcW9LTml3RXROZkU4YkhGblhxeks1SDhsQ09wc0RnRGNWTWpoT3BmQTZJTTJ3RFZadk5kWGhvZ0dEQ1FDWjNYdFJCbHRkcGFWc3pZNGtINVpHVkdnRUQxVE80ZCtCTjk2VDFSa3pOZ2NjZ2ZCWDNNQUw1bllUWXdiMGlUQUtFMGIxb3BmQmZrMzJQN3Q3b3A5dkhPeXZNMW5qdlZybVdWWWVSNk4rZFFrLzM4UDNUY2V3b2FkRmFUb3pidjBZK3dZOHgrbFcxeWN6bk1KMitQWTlxRHpabXoybE1rd0FlaDJwRTI4VW5MT0lhNjg0Y3U5RitHUlAveGhhR3dQWmpoc1JCSW51cHV5U1E2Y09YdE9kSERCQlRaZzVKSEhHMDBkNk9tUk5ONmxBelJWeFJURUVmaFFUVnN0U1poKzNMSjJTMGhmZGc9PVwiLFwic2hhMjU2c2lnXCI6XCJsVGI4ZittdkFveDRCckxPS0lqejFnTTNrRHREbG9wL21uNmZodmVEWjMvblVqb1lhNk81V2p4R0x2Z3lqZ0RtdThETkdPNUtqWWlxTVZ6Z0QzcHdqOVYwOXVOeUdYNGJUaXN0d1BnQTFLbGMrMUFLcmtWQTRGWGlQTHlST2tXdlhLM2dydFFJWU9nYjdSRlh6dzhnQlB5YlV0Z0FWbmNaMVFpdTAzblFLdGh5MFU3aXBlZUxaVE9oYVlhN001cTJxUTcya1BaSTZWUWlqSE42NVg3UTEvcm5rdUlSUkFmUEErZElIeE4wN0tpSlY2MGZsbDFZUUtOUlpSYUhKeGQ1UDd0RmdaaytEZE5mNVNXcHVaSTZTZE9MdExDN3VnbmdnK0krU2pUeUtvcVFKZElkWGRRaE5JK3I3WEM1L1M0ZlhnRVNtWmZKTUYxL0JtVlVFZUJDZlE9PVwiLFwiY2VydFwiOlwiTUlJRjVqQ0NBODZnQXdJQkFnSVRNd0FBQVkwdmh1VTl6R2x5b1FBQUFBQUJqVEFOQmdrcWhraUc5dzBCQVFzRkFEQitNUXN3Q1FZRFZRUUdFd0pWVXpFVE1CRUdBMVVFQ0JNS1YyRnphR2x1WjNSdmJqRVFNQTRHQTFVRUJ4TUhVbVZrYlc5dVpERWVNQndHQTFVRUNoTVZUV2xqY205emIyWjBJRU52Y25CdmNtRjBhVzl1TVNnd0pnWURWUVFERXg5TmFXTnliM052Wm5RZ1UyVmpkWEpsSUZObGNuWmxjaUJEUVNBeU1ERXhNQjRYRFRJd01EZ3dOakl3TlRBMU9Gb1hEVEl4TURnd05qSXdOVEExT0Zvd2dZb3hDekFKQmdOVkJBWVRBbFZUTVFzd0NRWURWUVFJRXdKWFFURVFNQTRHQTFVRUJ4TUhVbVZrYlc5dVpERWVNQndHQTFVRUNoTVZUV2xqY205emIyWjBJRU52Y25CdmNtRjBhVzl1TVI0d0hBWURWUVFMRXhWTmFXTnliM052Wm5RZ1EyOXljRzl5WVhScGIyNHhIREFhQmdOVkJBTVRFMU5sZG1sc2JHVXVWMmx1Wkc5M2N5NWpiMjB3Z2dFaU1BMEdDU3FHU0liM0RRRUJBUVVBQTRJQkR3QXdnZ0VLQW9JQkFRRENmcWtCcmV1Um1qdm90bDFFdURQWVplaVc1dUVERmV6MXhsYmh6cjVaa1BjSUJYT3RIMVZWRjRaUmVrdTFpK3ZMbTNON2xkVGl4c2RSZW0yU09iVkFGb1dDbjZ2cEYwL1ZYcWpmUTJHbyt2dk9UU1Q0Si9pQWxocXhialVVbkRyWFpXYUMvS2xtU0lYMjlHUng5bG1pT0IrWVBhRzlOTEE1U3F3emNad2hjTThzS3F0VDhHaWQ3Q3JFNGs1WldES0gyL1dPVTVsQ01iZTY2MWtrbWxKZDB2TlBDTXpyMUgzVmNmRG1qVVo4Q25WQzBFODlhVVA3VHhhME1uS0FzVFArQkpCNXJMenhkVlJRbGRNbmhHVXNXRU0ydUNOWXFOdWc4QWYrTGp3RytySXZrSVR3NVlDMUZDZy9qVHBvdHJnSFhmSGRqaURqa0F3ZWY1TlVkTmx0QWdNQkFBR2pnZ0ZPTUlJQlNqQU9CZ05WSFE4QkFmOEVCQU1DQjRBd0V3WURWUjBsQkF3d0NnWUlLd1lCQlFVSEF3RXdIUVlEVlIwT0JCWUVGT0U1NVFoeno5bEhuWTl2aDVTWmtyMTdjbEtzTUI0R0ExVWRFUVFYTUJXQ0UxTmxkbWxzYkdVdVYybHVaRzkzY3k1amIyMHdId1lEVlIwakJCZ3dGb0FVTmxhSlpVbkxXNXN2UEt4Q0ZsQk5rYmt6MTVFd1V3WURWUjBmQkV3d1NqQklvRWFnUklaQ2FIUjBjRG92TDNkM2R5NXRhV055YjNOdlpuUXVZMjl0TDNCcmFXOXdjeTlqY213dlRXbGpVMlZqVTJWeVEwRXlNREV4WHpJd01URXRNVEF0TVRndVkzSnNNR0FHQ0NzR0FRVUZCd0VCQkZRd1VqQlFCZ2dyQmdFRkJRY3dBb1pFYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVc5d2N5OWpaWEowY3k5TmFXTlRaV05UWlhKRFFUSXdNVEZmTWpBeE1TMHhNQzB4T0M1amNuUXdEQVlEVlIwVEFRSC9CQUl3QURBTkJna3Foa2lHOXcwQkFRc0ZBQU9DQWdFQVp3ZGxhWjg4U3BURFdUUjc5NWRHV2N0dUxUWmc2UDBqYmh4Q0dhOXBnb3AzSXZ1Qi9QYzJXT2Ruc1ZCYUpUZG5WN3NvcFZHa3V4Vjc1eWk2Q0NQM2sxNG0xQ1FhNk01cmNodmJuVEY0TFdjWld4U1g4Z0hjRWhObFdYV3hxU3FKMzNnSHVGNEc5SCs3VDM3UlNMb2Jqb1MyeVRhc21SRWtCNTI4b1gwWVU0cVpjeVdyK0xEMVovQk10dEhMUlZUZUtHdnpMaVpCNmhqWURybW9qUUxKZXZwSEdoTVdOTU9oR2RLd2pOS0crZGhVRHV6dTdsVXgwZzdhaUR3c1l4NzFTaU9ucDJWOSt5UEhET2R5OXlBRUNPb0N3bUprbW5qLzlDMmVNMDFDQjFZMUxTWHNiQUJtQVd3Si9iczhRNnhTWlJtSnkyRXJSQ3VTakl0MUQydzRTUFVMRFNNVTdIaDk3TWJpQVJDV25TMVRRMGg5azZFWVVmbW1ZaFNHQ0p3MXFlekFqZ2FmTngyYWcrRDhzRFFkQzRjVHhUSTk5aGthUm1DakFmeW1qcVdscUx5V0pCUmdvaXdTd21MVDFUbzRJNUVjZHFoQ1FNdEpoRVVRR2dpenk2ZUE2RlhtNHhmeExua08xSkNKSGJUejlqL2c4OW5zZ0hVN2V4SDVnZHhZQ0FDMGJkUlZLN1YrVlBDcExnLy9SemtlNm9mc1Y3WkxyQUpvN0EyQTZka0dVL09XeGhpVjJiY0VlUEpmSWsrVjM3UHp3c25yZ1JFV2RpM1pic3dBOU5aTTVzZGVSMFlFRm11bit0b2JCRGMzMlRidlVyTUpTb2tjcG9XNnRZczlkR0tUcE1GV01EZ09UeEZjSHljbHZrMjRVQVV2dXk2WVcvSVN2VlY4a3BRPVwiLFwiY2hhaW5cIjpbXCJNSUlHMkRDQ0JNQ2dBd0lCQWdJS1lUKzNHQUFBQUFBQUJEQU5CZ2txaGtpRzl3MEJBUXNGQURDQmlERUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVEIxSmxaRzF2Ym1ReEhqQWNCZ05WQkFvVEZVMXBZM0p2YzI5bWRDQkRiM0p3YjNKaGRHbHZiakV5TURBR0ExVUVBeE1wVFdsamNtOXpiMlowSUZKdmIzUWdRMlZ5ZEdsbWFXTmhkR1VnUVhWMGFHOXlhWFI1SURJd01URXdIaGNOTVRFeE1ERTRNakkxTlRFNVdoY05Nall4TURFNE1qTXdOVEU1V2pCK01Rc3dDUVlEVlFRR0V3SlZVekVUTUJFR0ExVUVDQk1LVjJGemFHbHVaM1J2YmpFUU1BNEdBMVVFQnhNSFVtVmtiVzl1WkRFZU1Cd0dBMVVFQ2hNVlRXbGpjbTl6YjJaMElFTnZjbkJ2Y21GMGFXOXVNU2d3SmdZRFZRUURFeDlOYVdOeWIzTnZablFnVTJWamRYSmxJRk5sY25abGNpQkRRU0F5TURFeE1JSUNJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBZzhBTUlJQ0NnS0NBZ0VBMEF2QXBLZ1pnZUkyNWVLcTVmT3lGVmgxdnJUbFNmSGdoUG03RFdUdmhjR0JWYmp6NS9GdFFGVTl6b3RxMFlTVDlYVjhXNlRVZEJES012TWowNjd1ejU0RVdNTFpSOHZSZkFCQlNIRWJBV2NYR0svRy9uTURmdVR2UTV6dkFYRXFINEVtUTNlWVZGZHpuVlVyOEo2T2ZRWU9yQnRVOHliMytDTUlJb3VlQmgwM09QMXkwc3JsWThHYVduMnliYk5TcVc3cHJyWDhpemI1bnZyMkhGZ2JsMWFsRWVXM1V0dTc2ZkJVdjdUL0xHeTRYU2JPb0FyWDM1UHRmOTJzOFN4ekd0a1pOMVc2M1NKNGpxSFVtd240QnlJeGNiQ1VydUN3NXlaRVY1Q0JseFhPWWV4bDRrdnhoVklXTXZpMWVLcCt6VTNzZ3lHa3FKdSttbW9FNEtNY3pWWVliUDFyTDBJKzRqZnljcXZRZUhOeWU5N3NBRmpsSVRDakNEcVo3NS9EOTNvV2xtVzF3NEd2OURsd1NhLzJxZlpxQURqNXRBZ1o0Qm8xcFZaMklsOXE4bW11UHExWVJrMjRWUGFKUVVRZWNyRzhFaWRUMHNIL3NzMVFtQjYxOUx1MndvSTUyYXdiOGpzbmhHcXd4aVlMMXpvUTU3UGJmTk5XckZOTUMvbzdNVGQwMkZrcitRQjVHUVo3L1J3ZFF0UkJEUzhGRHRWclNTUC96ODM0ZW9MUDJqd3QzK2pZRWdRWXVoNklkN2lZSHhBSHU4Z0ZmZ3NKdjJ2ZDQwNWJzUG5IaEtZN3lreWZXMklwOThlaXFKV0ljQ3psd1Q4OFVpTlBRSnJETVlXREw3OHA4UjFRanlHV0I4N3Y4b0RDUkgyYll1OHZ3M2VKcTBWTlV6NENlZE1DQXdFQUFhT0NBVXN3Z2dGSE1CQUdDU3NHQVFRQmdqY1ZBUVFEQWdFQU1CMEdBMVVkRGdRV0JCUTJWb2xsU2N0Ym15ODhyRUlXVUUyUnVUUFhrVEFaQmdrckJnRUVBWUkzRkFJRURCNEtBRk1BZFFCaUFFTUFRVEFMQmdOVkhROEVCQU1DQVlZd0R3WURWUjBUQVFIL0JBVXdBd0VCL3pBZkJnTlZIU01FR0RBV2dCUnlMVG9DTVpCRHVSUUZUdUhxcDhjeDBTT0pOREJhQmdOVkhSOEVVekJSTUUrZ1RhQkxoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1amIyMHZjR3RwTDJOeWJDOXdjbTlrZFdOMGN5OU5hV05TYjI5RFpYSkJkWFF5TURFeFh6SXdNVEZmTUROZk1qSXVZM0pzTUY0R0NDc0dBUVVGQndFQkJGSXdVREJPQmdnckJnRUZCUWN3QW9aQ2FIUjBjRG92TDNkM2R5NXRhV055YjNOdlpuUXVZMjl0TDNCcmFTOWpaWEowY3k5TmFXTlNiMjlEWlhKQmRYUXlNREV4WHpJd01URmZNRE5mTWpJdVkzSjBNQTBHQ1NxR1NJYjNEUUVCQ3dVQUE0SUNBUUJCeUdIQjlWdWVQcEV4OGJER3Z3a0J0SjIya0hUWENkdW1MZzJmeU9kMk5FYXZCMkNKVElHelBOWDBFalYxd25PbDlVMkVqTXVrWGErL2t2WVhDRmRDbFhKbEJYWjVyZTdSdXJndVZLTlJCNnhvNnlFTTR5V0J3czBxOHNQL3o4SzlTUmlheC9DRXhma1V2R3VWNVpidnMwTFNVOVZLb0JMRXJoSjJVd2xXRHAzMzA2WkppRkR5aWl5WElLSytUbmp2QldXM1M2RVdpTjR4eHdoQ0pIeWtlNTZkdkdBQVhtS1g0NVA4cC81YmV5WGY1Rk4vUzc3bVB2RGJBWGxDSEc2RmJIMjJSREQ3cFRlU2s3S2w3aUN0UDFQVnlmUW9hMWZCK0IxcXQxWXF0aWVCSEtZdG4rZjAwREdEbDZncXRxeStHMEgxNUlsZlZ2dmFXdE5lZlZXVUVINVRWL1JLUFVBcXlMMW5uNFRoRU83OTJtc1Zna244UmgzL1JRWjBuRUlVN2NVNTA3UE5DNE1ua0VOUmt2SkVncTV1bWhVWHNobjZ4MFZzbUFGN3Z6ZXBzSWlra3J3NE9PQWQ1SHlYbUJvdVgrODRaYmMxTDcxL1R5SDZ4SXpTYndiNVNUWHEzeUFQSmFycVlLc3NIMHVKL0xmNlhGU1FTejZpS0U5czVGSmx3ZjJRSElXQ2lHN3BwbFhkSVNoNVJiQVU1UXJNNWwvRXU5dGhOR21mckNZNDk4RXBRUWdWTGt5Zzkva01QdDVmcXdnSkxZT3NyRFNEWXZUSlNVS0pKYlZ1c2tmRnN6bWdzU0FiTExHT0JHK2xNRWtjMEVicFFGdjByVzY2MjRKS2h4SktnQWxOMjk5MnVRVmJHK0M3SUhCZkFDWEgwdzc2RnExN0lwNXhDQT09XCIsXCJNSUlGN1RDQ0E5V2dBd0lCQWdJUVA0dkl0Znlmc3BaRHRXbldiRUxoUkRBTkJna3Foa2lHOXcwQkFRc0ZBRENCaURFTE1Ba0dBMVVFQmhNQ1ZWTXhFekFSQmdOVkJBZ1RDbGRoYzJocGJtZDBiMjR4RURBT0JnTlZCQWNUQjFKbFpHMXZibVF4SGpBY0JnTlZCQW9URlUxcFkzSnZjMjltZENCRGIzSndiM0poZEdsdmJqRXlNREFHQTFVRUF4TXBUV2xqY205emIyWjBJRkp2YjNRZ1EyVnlkR2xtYVdOaGRHVWdRWFYwYUc5eWFYUjVJREl3TVRFd0hoY05NVEV3TXpJeU1qSXdOVEk0V2hjTk16WXdNekl5TWpJeE16QTBXakNCaURFTE1Ba0dBMVVFQmhNQ1ZWTXhFekFSQmdOVkJBZ1RDbGRoYzJocGJtZDBiMjR4RURBT0JnTlZCQWNUQjFKbFpHMXZibVF4SGpBY0JnTlZCQW9URlUxcFkzSnZjMjltZENCRGIzSndiM0poZEdsdmJqRXlNREFHQTFVRUF4TXBUV2xqY205emIyWjBJRkp2YjNRZ1EyVnlkR2xtYVdOaGRHVWdRWFYwYUc5eWFYUjVJREl3TVRFd2dnSWlNQTBHQ1NxR1NJYjNEUUVCQVFVQUE0SUNEd0F3Z2dJS0FvSUNBUUN5Z0VHcU5UaE5FM0l5YUNKTnVMTHgvOVZTdkd6SDlkSktqRGJ1MGNKY2ZveUtycThUS0cvQWMrTTZ6dEFscUZvNmJlK291Rm1yRXlOb3pRd3BoOUZ2Z0Z5UFJIOWRrQUZTV0t4UnhWOHFoOXpjMkFvZHdRTzVlN0JXNktQZVpHSENudmp6Zkxuc0RiVlUva3kyWlUrSThKeEltUXhDQ3dsOE1Wa1hlUVo0S0kySk9rd0RKYjV4YWx3TDU0UmdwSmtpNDlLdmhLU24rOUdZN1F5cDNwU0o0UTZnM01ET21UM3FDRks3Vm5ua0g0UzZIcmkweEVsY1R6RkxoOTNkQldjbW1ZRGdjUkdqdUtWQjRxUlR1ZmN5S1lNTUU3ODJYZ1N6UzBOSEwydmlrUjdUbUUvZFFnZkk2QjBTL0ptcGF6NlNmc2pXYVRyOFpMMjJDWjNLL1F3TG9wdDNZRXNEbEtRd2FSTFdRaTNCUVV6SzNLcjlqMXVEUnByWi9MSFI0N1BKZjBoNnpTVHdRWTljZE5Dc3NCQWdCa20zeHkwaHlGZmowSWJ6QTJqNzBNNXh3WW1aU21RQmJQM3NNSkhQUVR5U3grVzZoaDFoaE1kZmd6bGlyclNTTDBmekMvaFY2NkFmV2RDN2RKc2UwSGJtOHVrRzF4RG8rbVRlYWNZMWxvZ0M4RWE0UHllWmI4dHhpU2sxOTBnV0FqV1AxWGw4VFFMUFgrdUtnMDlGY1lqNXFRMU9jdW5DbkFmUFNSdE9CQTVqVVl4ZTJBREJWU3kyeHVEQ1pVN0pORG4xbkxQRWZ1aGhiaE5mRmNSZjJYN3RIYzd1Uk96TExvYXg3RGoyY08yclhCUEIyUThOeDRDeVZlMDA5NnliNU1QYTUwYzhwcldQTWQvRlM2L3I4UUlEQVFBQm8xRXdUekFMQmdOVkhROEVCQU1DQVlZd0R3WURWUjBUQVFIL0JBVXdBd0VCL3pBZEJnTlZIUTRFRmdRVWNpMDZBakdRUTdrVUJVN2g2cWZITWRFamlUUXdFQVlKS3dZQkJBR0NOeFVCQkFNQ0FRQXdEUVlKS29aSWh2Y05BUUVMQlFBRGdnSUJBSDl5encrM3hSWGJtOEJKeWlaYi9wNFQ1dFB3MHR1WFgvSkxQMDJ6cmhtdTdkZVhvS3p2cVRxandrR3c1YmlSbmhPQkpBUG1DZjAvVjBBNUlTUlcwUkF2UzBDcE5vWkx0Rk5YbXZ2eGZvbVBFZjRZYkZHcTZPMEpsYlhsY2NtaDZZZDFwaFYveVg0M1ZGNTBrOFhEWjh3TlQydW9Gd3h0Q0pKK2k5MkJxaTF3SWNNOUJoUzd2eVJlcDRUWFB3OGhJcjFMQUFiYmx4ellYdFRGQzF5SGJsQ2s2TU00cFB2TExNV1NacHVGWHN0NmJKTjhnQ2xZVzFlMVFHbTZDSG1tWkdJVm5ZZVdSYlZtSXlBRGl4eHpvTk9pZVRQZ1VGbUcyeS9sQWlYcWN5cWZBQlRJTnNlU08rbE9BT3pZVmdtNU0wa1MwbFFMQWF1c1I3YVJLWDFNdEhXQVVnSG95b0wybjh5c25JOFg2aThtc0t0eXJBditubEVleDBOVlowOVJzMWZXdHV6dVVyYzY2VTdoMTRHSXZFK09kYnRMcVBBMXFpYlVaMmRKc25CTU81UGNIZDk0a0laeXNqaWswZHlTVGNsWTZ5c1NYTlE3cm94cnNJUGxBVC80Q1RMMmt6VTBJcS9kTncxM0NZQXJ6VWdBOFl5WkdVY0ZBZW5SdjlGTzBPWW9RemVacEFwS0NObWFjWFBTcXMweEUyTjJvVGR2a2pnZWZSSThaakxueTIzaC9GS0ozY3JXWmdXYWxtRytvaWpISEtPbk5sQThPcVRmU203bWh6dk82L0RnZ1RlZEV6eFNqcjI1SFRUR0hkVUthajJZS1hDTWlTclJxNElRU0IvYzlPK2x4YnRWR2poamhFNjNiSzJWVk94bEloQkpGN2pBSHNjUHJGUkhcIl19IiA+ICVUTVAlXHNlbnNlVG1wLnR4dCAyPiYxCmlmICVFUlJPUkxFVkVMJSBORVEgMCAoCiAgIHNldCAiZXJyb3JEZXNjcmlwdGlvbj1VbmFibGUgdG8gd3JpdGUgb25ib2FyZGluZyBpbmZvcm1hdGlvbiB0byByZWdpc3RyeS4iCiAgIHNldCBlcnJvckNvZGU9MTAKICAgc2V0IGxhc3RFcnJvcj0lRVJST1JMRVZFTCUKICAgR09UTyBFUlJPUgopCgplY2hvIFN0YXJ0aW5nIHRoZSBzZXJ2aWNlLCBpZiBub3QgYWxyZWFkeSBydW5uaW5nID5OVUwgMj4mMQplY2hvLiA+TlVMIDI+JjEKc2MgcXVlcnkgIlNFTlNFIiB8IGZpbmQgL2kgIlJVTk5JTkciID5OVUwgMj4mMQppZiAlRVJST1JMRVZFTCUgRVFVIDAgR09UTyBSVU5OSU5HCgpuZXQgc3RhcnQgc2Vuc2UgPiAlVE1QJVxzZW5zZVRtcC50eHQgMj4mMQppZiAlRVJST1JMRVZFTCUgTkVRIDAgKAogICBlY2hvIFdpbmRvd3MgRGVmZW5kZXIgQWR2YW5jZWQgVGhyZWF0IFByb3RlY3Rpb24gU2VydmljZSBoYXMgbm90IHN0YXJ0ZWQgeWV0ID5OVUwgMj4mMQogICBHT1RPIFdBSVRfRk9SX1RIRV9TRVJWSUNFX1RPX1NUQVJUCikKZ290byBTVUNDRUVERUQKCjpSVU5OSU5HCnNldCAicnVubmluZ091dHB1dD1UaGUgV2luZG93cyBEZWZlbmRlciBBZHZhbmNlZCBUaHJlYXQgUHJvdGVjdGlvbiBTZXJ2aWNlIGlzIGFscmVhZHkgcnVubmluZyEiCmVjaG8gJXJ1bm5pbmdPdXRwdXQlID5OVUwgMj4mMQplY2hvLiA+TlVMIDI+JjEKZXZlbnRjcmVhdGUgL2wgQXBwbGljYXRpb24gL3NvIFdEQVRQT25ib2FyZGluZyAvdCBJbmZvcm1hdGlvbiAvaWQgMTAgL2QgIiVydW5uaW5nT3V0cHV0JSIgPk5VTCAyPiYxCkdPVE8gV0FJVF9GT1JfVEhFX1NFUlZJQ0VfVE9fU1RBUlQKCjpFUlJPUgpTZXQgL1AgZXJyb3JNc2c9PCVUTVAlXHNlbnNlVG1wLnR4dApzZXQgImVycm9yT3V0cHV0PVtFcnJvciBJZDogJWVycm9yQ29kZSUsIEVycm9yIExldmVsOiAlbGFzdEVycm9yJV0gJWVycm9yRGVzY3JpcHRpb24lIEVycm9yIG1lc3NhZ2U6ICVlcnJvck1zZyUiCiVwb3dlcnNoZWxsUGF0aCUgLUV4ZWN1dGlvblBvbGljeSBCeXBhc3MgLU5vUHJvZmlsZSAtQ29tbWFuZCAiQWRkLVR5cGUgJ3VzaW5nIFN5c3RlbTsgdXNpbmcgU3lzdGVtLkRpYWdub3N0aWNzOyB1c2luZyBTeXN0ZW0uRGlhZ25vc3RpY3MuVHJhY2luZzsgbmFtZXNwYWNlIFNlbnNlIHsgW0V2ZW50RGF0YShOYW1lID0gXCJPbmJvYXJkaW5nXCIpXXB1YmxpYyBzdHJ1Y3QgT25ib2FyZGluZ3twdWJsaWMgc3RyaW5nIE1lc3NhZ2UgeyBnZXQ7IHNldDsgfX0gcHVibGljIGNsYXNzIFRyYWNlIHtwdWJsaWMgc3RhdGljIEV2ZW50U291cmNlT3B0aW9ucyBUZWxlbWV0cnlDcml0aWNhbE9wdGlvbiA9IG5ldyBFdmVudFNvdXJjZU9wdGlvbnMoKXtMZXZlbCA9IEV2ZW50TGV2ZWwuRXJyb3IsIEtleXdvcmRzID0gKEV2ZW50S2V5d29yZHMpMHgwMDAwMjAwMDAwMDAwMDAwLCBUYWdzID0gKEV2ZW50VGFncykweDAyMDAwMDB9OyBwdWJsaWMgdm9pZCBXcml0ZU9uYm9hcmRpbmdNZXNzYWdlKHN0cmluZyBtZXNzYWdlKXtlcy5Xcml0ZShcIk9uYm9hcmRpbmdTY3JpcHRcIiwgVGVsZW1ldHJ5Q3JpdGljYWxPcHRpb24sIG5ldyBPbmJvYXJkaW5nIHtNZXNzYWdlID0gbWVzc2FnZX0pO30gcHJpdmF0ZSBzdGF0aWMgcmVhZG9ubHkgc3RyaW5nW10gdGVsZW1ldHJ5VHJhaXRzID0geyBcIkVUV19HUk9VUFwiLCBcIns1RUNCMEJBQy1COTMwLTQ3RjUtQThBNC1FODI1MzUyOUVEQjd9XCIgfTsgcHJpdmF0ZSBFdmVudFNvdXJjZSBlcyA9IG5ldyBFdmVudFNvdXJjZShcIk1pY3Jvc29mdC5XaW5kb3dzLlNlbnNlLkNsaWVudC5NYW5hZ2VtZW50XCIsRXZlbnRTb3VyY2VTZXR0aW5ncy5FdHdTZWxmRGVzY3JpYmluZ0V2ZW50Rm9ybWF0LHRlbGVtZXRyeVRyYWl0cyk7fX0nOyAkbG9nZ2VyID0gTmV3LU9iamVjdCAtVHlwZU5hbWUgU2Vuc2UuVHJhY2U7ICRsb2dnZXIuV3JpdGVPbmJvYXJkaW5nTWVzc2FnZSgnJWVycm9yT3V0cHV0JScpIiA+TlVMIDI+JjEKZWNobyAlZXJyb3JPdXRwdXQlID5OVUwgMj4mMQplY2hvLiA+TlVMIDI+JjEKZXZlbnRjcmVhdGUgL2wgQXBwbGljYXRpb24gL3NvIFdEQVRQT25ib2FyZGluZyAvdCBFcnJvciAvaWQgJWVycm9yQ29kZSUgL2QgIiVlcnJvck91dHB1dCUiID5OVUwgMj4mMQpHT1RPIENMRUFOVVAKCjpTVUNDRUVERUQKZWNobyBGaW5pc2hlZCBwZXJmb3JtaW5nIG9uYm9hcmRpbmcgb3BlcmF0aW9ucyA+TlVMIDI+JjEKZWNoby4gPk5VTCAyPiYxCkdPVE8gV0FJVF9GT1JfVEhFX1NFUlZJQ0VfVE9fU1RBUlQKCjpXQUlUX0ZPUl9USEVfU0VSVklDRV9UT19TVEFSVAplY2hvIFdhaXRpbmcgZm9yIHRoZSBzZXJ2aWNlIHRvIHN0YXJ0ID5OVUwgMj4mMQplY2hvLiA+TlVMIDI+JjEKCnNldCAvYSBjb3VudGVyPTAKCjpTRU5TRV9SVU5OSU5HX1dBSVQKc2MgcXVlcnkgIlNFTlNFIiB8IGZpbmQgL2kgIlJVTk5JTkciID5OVUwgMj4mMQppZiAlRVJST1JMRVZFTCUgTkVRIDAgKAoJSUYgJWNvdW50ZXIlIEVRVSA0ICgKCQlzZXQgImVycm9yRGVzY3JpcHRpb249VW5hYmxlIHRvIHN0YXJ0IFdpbmRvd3MgRGVmZW5kZXIgQWR2YW5jZWQgVGhyZWF0IFByb3RlY3Rpb24gU2VydmljZS4iCgkJc2V0IGVycm9yQ29kZT0xNQoJCXNldCBsYXN0RXJyb3I9JUVSUk9STEVWRUwlCgkJR09UTyBFUlJPUgoJKQoKCXNldCAvYSBjb3VudGVyPSVjb3VudGVyJSsxCgoJdGltZW91dCA1ID5OVUwgMj4mMQoJR09UTyA6U0VOU0VfUlVOTklOR19XQUlUCikKCnNldCAvYSBjb3VudGVyPTAKCjpTRU5TRV9PTkJPQVJERURfU1RBVFVTX1dBSVQKUkVHIHF1ZXJ5ICJIS0xNXFNPRlRXQVJFXE1pY3Jvc29mdFxXaW5kb3dzIEFkdmFuY2VkIFRocmVhdCBQcm90ZWN0aW9uXFN0YXR1cyIgL3YgT25ib2FyZGluZ1N0YXRlIC9yZWc6NjQgPk5VTCAyPiYxCmlmICVFUlJPUkxFVkVMJSBORVEgMCAoCglJRiAlY291bnRlciUgRVFVIDQgKAoJCUBlY2hvIFdpbmRvd3MgRGVmZW5kZXIgQWR2YW5jZWQgVGhyZWF0IFByb3RlY3Rpb24gU2VydmljZSBpcyBub3QgcnVubmluZyBhcyBleHBlY3RlZD4gJVRNUCVcc2Vuc2VUbXAudHh0CgkJc2V0IGVycm9yQ29kZT0zNQogICAgIHNldCBsYXN0RXJyb3I9JUVSUk9STEVWRUwlCgkJR09UTyBFUlJPUgoJKQoKCXNldCAvYSBjb3VudGVyPSVjb3VudGVyJSsxCgoJdGltZW91dCA1ID5OVUwgMj4mMQoJR09UTyA6U0VOU0VfT05CT0FSREVEX1NUQVRVU19XQUlUCikKCnNldCAvYSBjb3VudGVyPTAKCjpTRU5TRV9PTkJPQVJERURfV0FJVApSRUcgcXVlcnkgIkhLTE1cU09GVFdBUkVcTWljcm9zb2Z0XFdpbmRvd3MgQWR2YW5jZWQgVGhyZWF0IFByb3RlY3Rpb25cU3RhdHVzIiAvdiBPbmJvYXJkaW5nU3RhdGUgL3JlZzo2NCB8IGZpbmQgL2kgIjB4MSIgPk5VTCAyPiYxCmlmICVFUlJPUkxFVkVMJSBORVEgMCAoCglJRiAlY291bnRlciUgRVFVIDQgKAoJCUBlY2hvIFdpbmRvd3MgRGVmZW5kZXIgQWR2YW5jZWQgVGhyZWF0IFByb3RlY3Rpb24gU2VydmljZSBpcyBub3QgcnVubmluZyBhcyBleHBlY3RlZD4gJVRNUCVcc2Vuc2VUbXAudHh0CgkJc2V0IGVycm9yQ29kZT00MAogICAgIHNldCBsYXN0RXJyb3I9JUVSUk9STEVWRUwlCgkJR09UTyBFUlJPUgoJKQoKCXNldCAvYSBjb3VudGVyPSVjb3VudGVyJSsxCgoJdGltZW91dCA1ID5OVUwgMj4mMQoJR09UTyA6U0VOU0VfT05CT0FSREVEX1dBSVQKKQoKc2V0ICJzdWNjZXNzT3V0cHV0PVN1Y2Nlc3NmdWxseSBvbmJvYXJkZWQgbWFjaGluZSB0byBXaW5kb3dzIERlZmVuZGVyIEFkdmFuY2VkIFRocmVhdCBQcm90ZWN0aW9uIgplY2hvICVzdWNjZXNzT3V0cHV0JSA+TlVMIDI+JjEKZWNoby4KZXZlbnRjcmVhdGUgL2wgQXBwbGljYXRpb24gL3NvIFdEQVRQT25ib2FyZGluZyAvdCBJbmZvcm1hdGlvbiAvaWQgMjAgL2QgIiVzdWNjZXNzT3V0cHV0JSIgPk5VTCAyPiYxCiVwb3dlcnNoZWxsUGF0aCUgLUV4ZWN1dGlvblBvbGljeSBCeXBhc3MgLU5vUHJvZmlsZSAtQ29tbWFuZCAiQWRkLVR5cGUgJ3VzaW5nIFN5c3RlbTsgdXNpbmcgU3lzdGVtLkRpYWdub3N0aWNzOyB1c2luZyBTeXN0ZW0uRGlhZ25vc3RpY3MuVHJhY2luZzsgbmFtZXNwYWNlIFNlbnNlIHsgW0V2ZW50RGF0YShOYW1lID0gXCJPbmJvYXJkaW5nXCIpXXB1YmxpYyBzdHJ1Y3QgT25ib2FyZGluZ3twdWJsaWMgc3RyaW5nIE1lc3NhZ2UgeyBnZXQ7IHNldDsgfX0gcHVibGljIGNsYXNzIFRyYWNlIHtwdWJsaWMgc3RhdGljIEV2ZW50U291cmNlT3B0aW9ucyBUZWxlbWV0cnlDcml0aWNhbE9wdGlvbiA9IG5ldyBFdmVudFNvdXJjZU9wdGlvbnMoKXtMZXZlbCA9IEV2ZW50TGV2ZWwuSW5mb3JtYXRpb25hbCwgS2V5d29yZHMgPSAoRXZlbnRLZXl3b3JkcykweDAwMDAyMDAwMDAwMDAwMDAsIFRhZ3MgPSAoRXZlbnRUYWdzKTB4MDIwMDAwMH07IHB1YmxpYyB2b2lkIFdyaXRlT25ib2FyZGluZ01lc3NhZ2Uoc3RyaW5nIG1lc3NhZ2Upe2VzLldyaXRlKFwiT25ib2FyZGluZ1NjcmlwdFwiLCBUZWxlbWV0cnlDcml0aWNhbE9wdGlvbiwgbmV3IE9uYm9hcmRpbmcge01lc3NhZ2UgPSBtZXNzYWdlfSk7fSBwcml2YXRlIHN0YXRpYyByZWFkb25seSBzdHJpbmdbXSB0ZWxlbWV0cnlUcmFpdHMgPSB7IFwiRVRXX0dST1VQXCIsIFwiezVFQ0IwQkFDLUI5MzAtNDdGNS1BOEE0LUU4MjUzNTI5RURCN31cIiB9OyBwcml2YXRlIEV2ZW50U291cmNlIGVzID0gbmV3IEV2ZW50U291cmNlKFwiTWljcm9zb2Z0LldpbmRvd3MuU2Vuc2UuQ2xpZW50Lk1hbmFnZW1lbnRcIixFdmVudFNvdXJjZVNldHRpbmdzLkV0d1NlbGZEZXNjcmliaW5nRXZlbnRGb3JtYXQsdGVsZW1ldHJ5VHJhaXRzKTt9fSc7ICRsb2dnZXIgPSBOZXctT2JqZWN0IC1UeXBlTmFtZSBTZW5zZS5UcmFjZTsgJGxvZ2dlci5Xcml0ZU9uYm9hcmRpbmdNZXNzYWdlKCclc3VjY2Vzc091dHB1dCUnKSIgPk5VTCAyPiYxCiIlUFJPR1JBTUZJTEVTJVxXaW5kb3dzIERlZmVuZGVyXE1wQ21kUnVuLmV4ZSIgLVJlbG9hZEVuZ2luZSA+TlVMIDI+JjEKCkdPVE8gQ0xFQU5VUAoKOkNMRUFOVVAKaWYgZXhpc3QgJVRNUCVcc2Vuc2VUbXAudHh0IGRlbCAlVE1QJVxzZW5zZVRtcC50eHQKRVhJVCAvQiAlZXJyb3JDb2RlJQo=="), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2021-10-01-preview/examples/MdeOnboardings/GetMdeOnboardings_example.json -func ExampleMdeOnboardingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewMdeOnboardingsClient().Get(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.MdeOnboardingData = armsecurity.MdeOnboardingData{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/mdeOnboardings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/mdeOnboardings/default"), - // Properties: &armsecurity.MdeOnboardingDataProperties{ - // OnboardingPackageLinux: []byte("QGVjaG8gb2ZmCgplY2hvLiA+TlVMIDI+JjEKZWNobyBTdGFydGluZyBXaW5kb3dzIERlZmVuZGVyIEFkdmFuY2VkIFRocmVhdCBQcm90ZWN0aW9uIG9uYm9hcmRpbmcgcHJvY2Vzcy4uLiA+TlVMIDI+JjEKZWNoby4gPk5VTCAyPiYxCgpzZXQgZXJyb3JDb2RlPTAKc2V0IGxhc3RFcnJvcj0wCnNldCAidHJvdWJsZXNob290SW5mbz1Gb3IgbW9yZSBpbmZvcm1hdGlvbiwgdmlzaXQ6IGh0dHBzOi8vZ28ubWljcm9zb2Z0LmNvbS9md2xpbmsvcC8/bGlua2lkPTgyMjgwNyIKc2V0ICJlcnJvckRlc2NyaXB0aW9uPSIKCmVjaG8gVGVzdGluZyBhZG1pbmlzdHJhdG9yIHByaXZpbGVnZXMgPk5VTCAyPiYxCgpuZXQgc2Vzc2lvbiA+TlVMIDI+JjEKaWYgJUVSUk9STEVWRUwlIE5FUSAwICgKCUBlY2hvIFNjcmlwdCBpcyBydW5uaW5nIHdpdGggaW5zdWZmaWNpZW50IHByaXZpbGVnZXMuIFBsZWFzZSBydW4gd2l0aCBhZG1pbmlzdHJhdG9yIHByaXZpbGVnZXM+ICVUTVAlXHNlbnNlVG1wLnR4dAoJc2V0IGVycm9yQ29kZT02NQogc2V0IGxhc3RFcnJvcj0lRVJST1JMRVZFTCUKCUdPVE8gRVJST1IKKQoKZWNobyBTY3JpcHQgaXMgcnVubmluZyB3aXRoIHN1ZmZpY2llbnQgcHJpdmlsZWdlcyA+TlVMIDI+JjEKZWNoby4gPk5VTCAyPiYxCmVjaG8gUGVyZm9ybWluZyBvbmJvYXJkaW5nIG9wZXJhdGlvbnMgPk5VTCAyPiYxCmVjaG8uID5OVUwgMj4mMQoKSUYgWyVQUk9DRVNTT1JfQVJDSElURVc2NDMyJV0gRVFVIFtdICgKICBzZXQgcG93ZXJzaGVsbFBhdGg9JXdpbmRpciVcU3lzdGVtMzJcV2luZG93c1Bvd2VyU2hlbGxcdjEuMFxwb3dlcnNoZWxsLmV4ZQopIEVMU0UgKAogIHNldCBwb3dlcnNoZWxsUGF0aD0ld2luZGlyJVxTeXNOYXRpdmVcV2luZG93c1Bvd2VyU2hlbGxcdjEuMFxwb3dlcnNoZWxsLmV4ZQopCgpzZXQgc2RiaW49MDEwMDA0ODA0NDAwMDAwMDU0MDAwMDAwMDAwMDAwMDAxNDAwMDAwMDAyMDAzMDAwMDIwMDAwMDAwMDAwMTQwMEZGMEYxMjAwMDEwMTAwMDAwMDAwMDAwNTEyMDAwMDAwMDAwMDE0MDBFMTA0MTIwMDAxMDEwMDAwMDAwMDAwMDUwQjAwMDAwMDAxMDIwMDAwMDAwMDAwMDUyMDAwMDAwMDIwMDIwMDAwMDEwMjAwMDAwMDAwMDAwNTIwMDAwMDAwMjAwMjAwMDAgPk5VTCAyPiYxCnJlZyBhZGQgSEtMTVxTWVNURU1cQ3VycmVudENvbnRyb2xTZXRcQ29udHJvbFxXTUlcU2VjdXJpdHkgL3YgMTRmODEzOGUtM2I2MS01ODBiLTU0NGItMjYwOTM3OGFlNDYwIC90IFJFR19CSU5BUlkgL2QgJXNkYmluJSAvZiA+TlVMIDI+JjEKcmVnIGFkZCBIS0xNXFNZU1RFTVxDdXJyZW50Q29udHJvbFNldFxDb250cm9sXFdNSVxTZWN1cml0eSAvdiBjYjJmZjcyZC1kNGU0LTU4NWQtMzNmOS1mM2EzOTVjNDBiZTcgL3QgUkVHX0JJTkFSWSAvZCAlc2RiaW4lIC9mID5OVUwgMj4mMQoKUkVHIGFkZCAiSEtMTVxTT0ZUV0FSRVxQb2xpY2llc1xNaWNyb3NvZnRcV2luZG93c1xEYXRhQ29sbGVjdGlvbiIgL3YgRGlzYWJsZUVudGVycHJpc2VBdXRoUHJveHkgL3QgUkVHX0RXT1JEIC9mIC9kIDEgPk5VTCAyPiYxCgolcG93ZXJzaGVsbFBhdGglIC1FeGVjdXRpb25Qb2xpY3kgQnlwYXNzIC1Ob1Byb2ZpbGUgLUNvbW1hbmQgIkFkZC1UeXBlICcgdXNpbmcgU3lzdGVtOyB1c2luZyBTeXN0ZW0uSU87IHVzaW5nIFN5c3RlbS5SdW50aW1lLkludGVyb3BTZXJ2aWNlczsgdXNpbmcgTWljcm9zb2Z0LldpbjMyLlNhZmVIYW5kbGVzOyB1c2luZyBTeXN0ZW0uQ29tcG9uZW50TW9kZWw7IHB1YmxpYyBzdGF0aWMgY2xhc3MgRWxhbXsgW0RsbEltcG9ydChcIktlcm5lbDMyXCIsIENoYXJTZXQ9Q2hhclNldC5BdXRvLCBTZXRMYXN0RXJyb3I9dHJ1ZSldIHB1YmxpYyBzdGF0aWMgZXh0ZXJuIGJvb2wgSW5zdGFsbEVMQU1DZXJ0aWZpY2F0ZUluZm8oU2FmZUZpbGVIYW5kbGUgaGFuZGxlKTsgcHVibGljIHN0YXRpYyB2b2lkIEluc3RhbGxXZEJvb3Qoc3RyaW5nIHBhdGgpIHsgQ29uc29sZS5PdXQuV3JpdGVMaW5lKFwiQWJvdXQgdG8gY2FsbCBjcmVhdGUgZmlsZSBvbiB7MH1cIiwgcGF0aCk7IHZhciBzdHJlYW0gPSBGaWxlLk9wZW4ocGF0aCwgRmlsZU1vZGUuT3BlbiwgRmlsZUFjY2Vzcy5SZWFkLCBGaWxlU2hhcmUuUmVhZCk7IHZhciBoYW5kbGUgPSBzdHJlYW0uU2FmZUZpbGVIYW5kbGU7IENvbnNvbGUuT3V0LldyaXRlTGluZShcIkFib3V0IHRvIGNhbGwgSW5zdGFsbEVMQU1DZXJ0aWZpY2F0ZUluZm8gb24gaGFuZGxlIHswfVwiLCBoYW5kbGUuRGFuZ2Vyb3VzR2V0SGFuZGxlKCkpOyBpZiAoIUluc3RhbGxFTEFNQ2VydGlmaWNhdGVJbmZvKGhhbmRsZSkpIHsgQ29uc29sZS5PdXQuV3JpdGVMaW5lKFwiQ2FsbCBmYWlsZWQuXCIpOyB0aHJvdyBuZXcgV2luMzJFeGNlcHRpb24oTWFyc2hhbC5HZXRMYXN0V2luMzJFcnJvcigpKTsgfSBDb25zb2xlLk91dC5Xcml0ZUxpbmUoXCJDYWxsIHN1Y2Nlc3NmdWwuXCIpOyB9IH0gJzsgJGRyaXZlclBhdGggPSAkZW52OlN5c3RlbVJvb3QgKyAnXFN5c3RlbTMyXERyaXZlcnNcV2RCb290LnN5cyc7IFtFbGFtXTo6SW5zdGFsbFdkQm9vdCgkZHJpdmVyUGF0aCkgIiA+TlVMIDI+JjEKClJFRyBxdWVyeSAiSEtMTVxTT0ZUV0FSRVxQb2xpY2llc1xNaWNyb3NvZnRcV2luZG93cyBBZHZhbmNlZCBUaHJlYXQgUHJvdGVjdGlvbiIgL3YgNjk2QzFGQTEtNDAzMC00RkE0LTg3MTMtRkFGOUIyRUE3QzBBIC9yZWc6NjQgPiAlVE1QJVxzZW5zZVRtcC50eHQgMj4mMQppZiAlRVJST1JMRVZFTCUgRVFVIDAgKCAgCiAgICBSRUcgZGVsZXRlICJIS0xNXFNPRlRXQVJFXFBvbGljaWVzXE1pY3Jvc29mdFxXaW5kb3dzIEFkdmFuY2VkIFRocmVhdCBQcm90ZWN0aW9uIiAvdiA2OTZDMUZBMS00MDMwLTRGQTQtODcxMy1GQUY5QjJFQTdDMEEgL2YgPiAlVE1QJVxzZW5zZVRtcC50eHQgMj4mMQogICAgaWYgJUVSUk9STEVWRUwlIE5FUSAwICgKICAgICAgICBzZXQgImVycm9yRGVzY3JpcHRpb249VW5hYmxlIHRvIGRlbGV0ZSBwcmV2aW91cyBvZmZib2FyZGluZyBpbmZvcm1hdGlvbiBmcm9tIHJlZ2lzdHJ5LiIKICAgICAgICBzZXQgZXJyb3JDb2RlPTUKICAgICAgICBzZXQgbGFzdEVycm9yPSVFUlJPUkxFVkVMJQogICAgICAgIEdPVE8gRVJST1IKICAgICkKKQoKUkVHIGFkZCAiSEtMTVxTT0ZUV0FSRVxQb2xpY2llc1xNaWNyb3NvZnRcV2luZG93cyBBZHZhbmNlZCBUaHJlYXQgUHJvdGVjdGlvbiIgL3YgT25ib2FyZGluZ0luZm8gL3QgUkVHX1NaIC9mIC9kICJ7XCJib2R5XCI6XCJ7XFxcInByZXZpb3VzT3JnSWRzXFxcIjpbXSxcXFwib3JnSWRcXFwiOlxcXCIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMGRlYWRcXFwiLFxcXCJnZW9Mb2NhdGlvblVybFxcXCI6XFxcImh0dHBzOi8vc2V2aWxsZWNsb3VkZ2F0ZXdheS1zdGcubWljcm9zb2Z0LmNvbS9cXFwiLFxcXCJkYXRhY2VudGVyXFxcIjpcXFwiRWFzdFVzMlxcXCIsXFxcInZvcnRleEdlb0xvY2F0aW9uXFxcIjpcXFwiU2FuZGJveFxcXCIsXFxcInZlcnNpb25cXFwiOlxcXCIxLjNcXFwifVwiLFwic2lnXCI6XCJKc0dGR2o3UCtIL1cvUEExcW9LTml3RXROZkU4YkhGblhxeks1SDhsQ09wc0RnRGNWTWpoT3BmQTZJTTJ3RFZadk5kWGhvZ0dEQ1FDWjNYdFJCbHRkcGFWc3pZNGtINVpHVkdnRUQxVE80ZCtCTjk2VDFSa3pOZ2NjZ2ZCWDNNQUw1bllUWXdiMGlUQUtFMGIxb3BmQmZrMzJQN3Q3b3A5dkhPeXZNMW5qdlZybVdWWWVSNk4rZFFrLzM4UDNUY2V3b2FkRmFUb3pidjBZK3dZOHgrbFcxeWN6bk1KMitQWTlxRHpabXoybE1rd0FlaDJwRTI4VW5MT0lhNjg0Y3U5RitHUlAveGhhR3dQWmpoc1JCSW51cHV5U1E2Y09YdE9kSERCQlRaZzVKSEhHMDBkNk9tUk5ONmxBelJWeFJURUVmaFFUVnN0U1poKzNMSjJTMGhmZGc9PVwiLFwic2hhMjU2c2lnXCI6XCJsVGI4ZittdkFveDRCckxPS0lqejFnTTNrRHREbG9wL21uNmZodmVEWjMvblVqb1lhNk81V2p4R0x2Z3lqZ0RtdThETkdPNUtqWWlxTVZ6Z0QzcHdqOVYwOXVOeUdYNGJUaXN0d1BnQTFLbGMrMUFLcmtWQTRGWGlQTHlST2tXdlhLM2dydFFJWU9nYjdSRlh6dzhnQlB5YlV0Z0FWbmNaMVFpdTAzblFLdGh5MFU3aXBlZUxaVE9oYVlhN001cTJxUTcya1BaSTZWUWlqSE42NVg3UTEvcm5rdUlSUkFmUEErZElIeE4wN0tpSlY2MGZsbDFZUUtOUlpSYUhKeGQ1UDd0RmdaaytEZE5mNVNXcHVaSTZTZE9MdExDN3VnbmdnK0krU2pUeUtvcVFKZElkWGRRaE5JK3I3WEM1L1M0ZlhnRVNtWmZKTUYxL0JtVlVFZUJDZlE9PVwiLFwiY2VydFwiOlwiTUlJRjVqQ0NBODZnQXdJQkFnSVRNd0FBQVkwdmh1VTl6R2x5b1FBQUFBQUJqVEFOQmdrcWhraUc5dzBCQVFzRkFEQitNUXN3Q1FZRFZRUUdFd0pWVXpFVE1CRUdBMVVFQ0JNS1YyRnphR2x1WjNSdmJqRVFNQTRHQTFVRUJ4TUhVbVZrYlc5dVpERWVNQndHQTFVRUNoTVZUV2xqY205emIyWjBJRU52Y25CdmNtRjBhVzl1TVNnd0pnWURWUVFERXg5TmFXTnliM052Wm5RZ1UyVmpkWEpsSUZObGNuWmxjaUJEUVNBeU1ERXhNQjRYRFRJd01EZ3dOakl3TlRBMU9Gb1hEVEl4TURnd05qSXdOVEExT0Zvd2dZb3hDekFKQmdOVkJBWVRBbFZUTVFzd0NRWURWUVFJRXdKWFFURVFNQTRHQTFVRUJ4TUhVbVZrYlc5dVpERWVNQndHQTFVRUNoTVZUV2xqY205emIyWjBJRU52Y25CdmNtRjBhVzl1TVI0d0hBWURWUVFMRXhWTmFXTnliM052Wm5RZ1EyOXljRzl5WVhScGIyNHhIREFhQmdOVkJBTVRFMU5sZG1sc2JHVXVWMmx1Wkc5M2N5NWpiMjB3Z2dFaU1BMEdDU3FHU0liM0RRRUJBUVVBQTRJQkR3QXdnZ0VLQW9JQkFRRENmcWtCcmV1Um1qdm90bDFFdURQWVplaVc1dUVERmV6MXhsYmh6cjVaa1BjSUJYT3RIMVZWRjRaUmVrdTFpK3ZMbTNON2xkVGl4c2RSZW0yU09iVkFGb1dDbjZ2cEYwL1ZYcWpmUTJHbyt2dk9UU1Q0Si9pQWxocXhialVVbkRyWFpXYUMvS2xtU0lYMjlHUng5bG1pT0IrWVBhRzlOTEE1U3F3emNad2hjTThzS3F0VDhHaWQ3Q3JFNGs1WldES0gyL1dPVTVsQ01iZTY2MWtrbWxKZDB2TlBDTXpyMUgzVmNmRG1qVVo4Q25WQzBFODlhVVA3VHhhME1uS0FzVFArQkpCNXJMenhkVlJRbGRNbmhHVXNXRU0ydUNOWXFOdWc4QWYrTGp3RytySXZrSVR3NVlDMUZDZy9qVHBvdHJnSFhmSGRqaURqa0F3ZWY1TlVkTmx0QWdNQkFBR2pnZ0ZPTUlJQlNqQU9CZ05WSFE4QkFmOEVCQU1DQjRBd0V3WURWUjBsQkF3d0NnWUlLd1lCQlFVSEF3RXdIUVlEVlIwT0JCWUVGT0U1NVFoeno5bEhuWTl2aDVTWmtyMTdjbEtzTUI0R0ExVWRFUVFYTUJXQ0UxTmxkbWxzYkdVdVYybHVaRzkzY3k1amIyMHdId1lEVlIwakJCZ3dGb0FVTmxhSlpVbkxXNXN2UEt4Q0ZsQk5rYmt6MTVFd1V3WURWUjBmQkV3d1NqQklvRWFnUklaQ2FIUjBjRG92TDNkM2R5NXRhV055YjNOdlpuUXVZMjl0TDNCcmFXOXdjeTlqY213dlRXbGpVMlZqVTJWeVEwRXlNREV4WHpJd01URXRNVEF0TVRndVkzSnNNR0FHQ0NzR0FRVUZCd0VCQkZRd1VqQlFCZ2dyQmdFRkJRY3dBb1pFYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVc5d2N5OWpaWEowY3k5TmFXTlRaV05UWlhKRFFUSXdNVEZmTWpBeE1TMHhNQzB4T0M1amNuUXdEQVlEVlIwVEFRSC9CQUl3QURBTkJna3Foa2lHOXcwQkFRc0ZBQU9DQWdFQVp3ZGxhWjg4U3BURFdUUjc5NWRHV2N0dUxUWmc2UDBqYmh4Q0dhOXBnb3AzSXZ1Qi9QYzJXT2Ruc1ZCYUpUZG5WN3NvcFZHa3V4Vjc1eWk2Q0NQM2sxNG0xQ1FhNk01cmNodmJuVEY0TFdjWld4U1g4Z0hjRWhObFdYV3hxU3FKMzNnSHVGNEc5SCs3VDM3UlNMb2Jqb1MyeVRhc21SRWtCNTI4b1gwWVU0cVpjeVdyK0xEMVovQk10dEhMUlZUZUtHdnpMaVpCNmhqWURybW9qUUxKZXZwSEdoTVdOTU9oR2RLd2pOS0crZGhVRHV6dTdsVXgwZzdhaUR3c1l4NzFTaU9ucDJWOSt5UEhET2R5OXlBRUNPb0N3bUprbW5qLzlDMmVNMDFDQjFZMUxTWHNiQUJtQVd3Si9iczhRNnhTWlJtSnkyRXJSQ3VTakl0MUQydzRTUFVMRFNNVTdIaDk3TWJpQVJDV25TMVRRMGg5azZFWVVmbW1ZaFNHQ0p3MXFlekFqZ2FmTngyYWcrRDhzRFFkQzRjVHhUSTk5aGthUm1DakFmeW1qcVdscUx5V0pCUmdvaXdTd21MVDFUbzRJNUVjZHFoQ1FNdEpoRVVRR2dpenk2ZUE2RlhtNHhmeExua08xSkNKSGJUejlqL2c4OW5zZ0hVN2V4SDVnZHhZQ0FDMGJkUlZLN1YrVlBDcExnLy9SemtlNm9mc1Y3WkxyQUpvN0EyQTZka0dVL09XeGhpVjJiY0VlUEpmSWsrVjM3UHp3c25yZ1JFV2RpM1pic3dBOU5aTTVzZGVSMFlFRm11bit0b2JCRGMzMlRidlVyTUpTb2tjcG9XNnRZczlkR0tUcE1GV01EZ09UeEZjSHljbHZrMjRVQVV2dXk2WVcvSVN2VlY4a3BRPVwiLFwiY2hhaW5cIjpbXCJNSUlHMkRDQ0JNQ2dBd0lCQWdJS1lUKzNHQUFBQUFBQUJEQU5CZ2txaGtpRzl3MEJBUXNGQURDQmlERUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVEIxSmxaRzF2Ym1ReEhqQWNCZ05WQkFvVEZVMXBZM0p2YzI5bWRDQkRiM0p3YjNKaGRHbHZiakV5TURBR0ExVUVBeE1wVFdsamNtOXpiMlowSUZKdmIzUWdRMlZ5ZEdsbWFXTmhkR1VnUVhWMGFHOXlhWFI1SURJd01URXdIaGNOTVRFeE1ERTRNakkxTlRFNVdoY05Nall4TURFNE1qTXdOVEU1V2pCK01Rc3dDUVlEVlFRR0V3SlZVekVUTUJFR0ExVUVDQk1LVjJGemFHbHVaM1J2YmpFUU1BNEdBMVVFQnhNSFVtVmtiVzl1WkRFZU1Cd0dBMVVFQ2hNVlRXbGpjbTl6YjJaMElFTnZjbkJ2Y21GMGFXOXVNU2d3SmdZRFZRUURFeDlOYVdOeWIzTnZablFnVTJWamRYSmxJRk5sY25abGNpQkRRU0F5TURFeE1JSUNJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBZzhBTUlJQ0NnS0NBZ0VBMEF2QXBLZ1pnZUkyNWVLcTVmT3lGVmgxdnJUbFNmSGdoUG03RFdUdmhjR0JWYmp6NS9GdFFGVTl6b3RxMFlTVDlYVjhXNlRVZEJES012TWowNjd1ejU0RVdNTFpSOHZSZkFCQlNIRWJBV2NYR0svRy9uTURmdVR2UTV6dkFYRXFINEVtUTNlWVZGZHpuVlVyOEo2T2ZRWU9yQnRVOHliMytDTUlJb3VlQmgwM09QMXkwc3JsWThHYVduMnliYk5TcVc3cHJyWDhpemI1bnZyMkhGZ2JsMWFsRWVXM1V0dTc2ZkJVdjdUL0xHeTRYU2JPb0FyWDM1UHRmOTJzOFN4ekd0a1pOMVc2M1NKNGpxSFVtd240QnlJeGNiQ1VydUN3NXlaRVY1Q0JseFhPWWV4bDRrdnhoVklXTXZpMWVLcCt6VTNzZ3lHa3FKdSttbW9FNEtNY3pWWVliUDFyTDBJKzRqZnljcXZRZUhOeWU5N3NBRmpsSVRDakNEcVo3NS9EOTNvV2xtVzF3NEd2OURsd1NhLzJxZlpxQURqNXRBZ1o0Qm8xcFZaMklsOXE4bW11UHExWVJrMjRWUGFKUVVRZWNyRzhFaWRUMHNIL3NzMVFtQjYxOUx1MndvSTUyYXdiOGpzbmhHcXd4aVlMMXpvUTU3UGJmTk5XckZOTUMvbzdNVGQwMkZrcitRQjVHUVo3L1J3ZFF0UkJEUzhGRHRWclNTUC96ODM0ZW9MUDJqd3QzK2pZRWdRWXVoNklkN2lZSHhBSHU4Z0ZmZ3NKdjJ2ZDQwNWJzUG5IaEtZN3lreWZXMklwOThlaXFKV0ljQ3psd1Q4OFVpTlBRSnJETVlXREw3OHA4UjFRanlHV0I4N3Y4b0RDUkgyYll1OHZ3M2VKcTBWTlV6NENlZE1DQXdFQUFhT0NBVXN3Z2dGSE1CQUdDU3NHQVFRQmdqY1ZBUVFEQWdFQU1CMEdBMVVkRGdRV0JCUTJWb2xsU2N0Ym15ODhyRUlXVUUyUnVUUFhrVEFaQmdrckJnRUVBWUkzRkFJRURCNEtBRk1BZFFCaUFFTUFRVEFMQmdOVkhROEVCQU1DQVlZd0R3WURWUjBUQVFIL0JBVXdBd0VCL3pBZkJnTlZIU01FR0RBV2dCUnlMVG9DTVpCRHVSUUZUdUhxcDhjeDBTT0pOREJhQmdOVkhSOEVVekJSTUUrZ1RhQkxoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1amIyMHZjR3RwTDJOeWJDOXdjbTlrZFdOMGN5OU5hV05TYjI5RFpYSkJkWFF5TURFeFh6SXdNVEZmTUROZk1qSXVZM0pzTUY0R0NDc0dBUVVGQndFQkJGSXdVREJPQmdnckJnRUZCUWN3QW9aQ2FIUjBjRG92TDNkM2R5NXRhV055YjNOdlpuUXVZMjl0TDNCcmFTOWpaWEowY3k5TmFXTlNiMjlEWlhKQmRYUXlNREV4WHpJd01URmZNRE5mTWpJdVkzSjBNQTBHQ1NxR1NJYjNEUUVCQ3dVQUE0SUNBUUJCeUdIQjlWdWVQcEV4OGJER3Z3a0J0SjIya0hUWENkdW1MZzJmeU9kMk5FYXZCMkNKVElHelBOWDBFalYxd25PbDlVMkVqTXVrWGErL2t2WVhDRmRDbFhKbEJYWjVyZTdSdXJndVZLTlJCNnhvNnlFTTR5V0J3czBxOHNQL3o4SzlTUmlheC9DRXhma1V2R3VWNVpidnMwTFNVOVZLb0JMRXJoSjJVd2xXRHAzMzA2WkppRkR5aWl5WElLSytUbmp2QldXM1M2RVdpTjR4eHdoQ0pIeWtlNTZkdkdBQVhtS1g0NVA4cC81YmV5WGY1Rk4vUzc3bVB2RGJBWGxDSEc2RmJIMjJSREQ3cFRlU2s3S2w3aUN0UDFQVnlmUW9hMWZCK0IxcXQxWXF0aWVCSEtZdG4rZjAwREdEbDZncXRxeStHMEgxNUlsZlZ2dmFXdE5lZlZXVUVINVRWL1JLUFVBcXlMMW5uNFRoRU83OTJtc1Zna244UmgzL1JRWjBuRUlVN2NVNTA3UE5DNE1ua0VOUmt2SkVncTV1bWhVWHNobjZ4MFZzbUFGN3Z6ZXBzSWlra3J3NE9PQWQ1SHlYbUJvdVgrODRaYmMxTDcxL1R5SDZ4SXpTYndiNVNUWHEzeUFQSmFycVlLc3NIMHVKL0xmNlhGU1FTejZpS0U5czVGSmx3ZjJRSElXQ2lHN3BwbFhkSVNoNVJiQVU1UXJNNWwvRXU5dGhOR21mckNZNDk4RXBRUWdWTGt5Zzkva01QdDVmcXdnSkxZT3NyRFNEWXZUSlNVS0pKYlZ1c2tmRnN6bWdzU0FiTExHT0JHK2xNRWtjMEVicFFGdjByVzY2MjRKS2h4SktnQWxOMjk5MnVRVmJHK0M3SUhCZkFDWEgwdzc2RnExN0lwNXhDQT09XCIsXCJNSUlGN1RDQ0E5V2dBd0lCQWdJUVA0dkl0Znlmc3BaRHRXbldiRUxoUkRBTkJna3Foa2lHOXcwQkFRc0ZBRENCaURFTE1Ba0dBMVVFQmhNQ1ZWTXhFekFSQmdOVkJBZ1RDbGRoYzJocGJtZDBiMjR4RURBT0JnTlZCQWNUQjFKbFpHMXZibVF4SGpBY0JnTlZCQW9URlUxcFkzSnZjMjltZENCRGIzSndiM0poZEdsdmJqRXlNREFHQTFVRUF4TXBUV2xqY205emIyWjBJRkp2YjNRZ1EyVnlkR2xtYVdOaGRHVWdRWFYwYUc5eWFYUjVJREl3TVRFd0hoY05NVEV3TXpJeU1qSXdOVEk0V2hjTk16WXdNekl5TWpJeE16QTBXakNCaURFTE1Ba0dBMVVFQmhNQ1ZWTXhFekFSQmdOVkJBZ1RDbGRoYzJocGJtZDBiMjR4RURBT0JnTlZCQWNUQjFKbFpHMXZibVF4SGpBY0JnTlZCQW9URlUxcFkzSnZjMjltZENCRGIzSndiM0poZEdsdmJqRXlNREFHQTFVRUF4TXBUV2xqY205emIyWjBJRkp2YjNRZ1EyVnlkR2xtYVdOaGRHVWdRWFYwYUc5eWFYUjVJREl3TVRFd2dnSWlNQTBHQ1NxR1NJYjNEUUVCQVFVQUE0SUNEd0F3Z2dJS0FvSUNBUUN5Z0VHcU5UaE5FM0l5YUNKTnVMTHgvOVZTdkd6SDlkSktqRGJ1MGNKY2ZveUtycThUS0cvQWMrTTZ6dEFscUZvNmJlK291Rm1yRXlOb3pRd3BoOUZ2Z0Z5UFJIOWRrQUZTV0t4UnhWOHFoOXpjMkFvZHdRTzVlN0JXNktQZVpHSENudmp6Zkxuc0RiVlUva3kyWlUrSThKeEltUXhDQ3dsOE1Wa1hlUVo0S0kySk9rd0RKYjV4YWx3TDU0UmdwSmtpNDlLdmhLU24rOUdZN1F5cDNwU0o0UTZnM01ET21UM3FDRks3Vm5ua0g0UzZIcmkweEVsY1R6RkxoOTNkQldjbW1ZRGdjUkdqdUtWQjRxUlR1ZmN5S1lNTUU3ODJYZ1N6UzBOSEwydmlrUjdUbUUvZFFnZkk2QjBTL0ptcGF6NlNmc2pXYVRyOFpMMjJDWjNLL1F3TG9wdDNZRXNEbEtRd2FSTFdRaTNCUVV6SzNLcjlqMXVEUnByWi9MSFI0N1BKZjBoNnpTVHdRWTljZE5Dc3NCQWdCa20zeHkwaHlGZmowSWJ6QTJqNzBNNXh3WW1aU21RQmJQM3NNSkhQUVR5U3grVzZoaDFoaE1kZmd6bGlyclNTTDBmekMvaFY2NkFmV2RDN2RKc2UwSGJtOHVrRzF4RG8rbVRlYWNZMWxvZ0M4RWE0UHllWmI4dHhpU2sxOTBnV0FqV1AxWGw4VFFMUFgrdUtnMDlGY1lqNXFRMU9jdW5DbkFmUFNSdE9CQTVqVVl4ZTJBREJWU3kyeHVEQ1pVN0pORG4xbkxQRWZ1aGhiaE5mRmNSZjJYN3RIYzd1Uk96TExvYXg3RGoyY08yclhCUEIyUThOeDRDeVZlMDA5NnliNU1QYTUwYzhwcldQTWQvRlM2L3I4UUlEQVFBQm8xRXdUekFMQmdOVkhROEVCQU1DQVlZd0R3WURWUjBUQVFIL0JBVXdBd0VCL3pBZEJnTlZIUTRFRmdRVWNpMDZBakdRUTdrVUJVN2g2cWZITWRFamlUUXdFQVlKS3dZQkJBR0NOeFVCQkFNQ0FRQXdEUVlKS29aSWh2Y05BUUVMQlFBRGdnSUJBSDl5encrM3hSWGJtOEJKeWlaYi9wNFQ1dFB3MHR1WFgvSkxQMDJ6cmhtdTdkZVhvS3p2cVRxandrR3c1YmlSbmhPQkpBUG1DZjAvVjBBNUlTUlcwUkF2UzBDcE5vWkx0Rk5YbXZ2eGZvbVBFZjRZYkZHcTZPMEpsYlhsY2NtaDZZZDFwaFYveVg0M1ZGNTBrOFhEWjh3TlQydW9Gd3h0Q0pKK2k5MkJxaTF3SWNNOUJoUzd2eVJlcDRUWFB3OGhJcjFMQUFiYmx4ellYdFRGQzF5SGJsQ2s2TU00cFB2TExNV1NacHVGWHN0NmJKTjhnQ2xZVzFlMVFHbTZDSG1tWkdJVm5ZZVdSYlZtSXlBRGl4eHpvTk9pZVRQZ1VGbUcyeS9sQWlYcWN5cWZBQlRJTnNlU08rbE9BT3pZVmdtNU0wa1MwbFFMQWF1c1I3YVJLWDFNdEhXQVVnSG95b0wybjh5c25JOFg2aThtc0t0eXJBditubEVleDBOVlowOVJzMWZXdHV6dVVyYzY2VTdoMTRHSXZFK09kYnRMcVBBMXFpYlVaMmRKc25CTU81UGNIZDk0a0laeXNqaWswZHlTVGNsWTZ5c1NYTlE3cm94cnNJUGxBVC80Q1RMMmt6VTBJcS9kTncxM0NZQXJ6VWdBOFl5WkdVY0ZBZW5SdjlGTzBPWW9RemVacEFwS0NObWFjWFBTcXMweEUyTjJvVGR2a2pnZWZSSThaakxueTIzaC9GS0ozY3JXWmdXYWxtRytvaWpISEtPbk5sQThPcVRmU203bWh6dk82L0RnZ1RlZEV6eFNqcjI1SFRUR0hkVUthajJZS1hDTWlTclJxNElRU0IvYzlPK2x4YnRWR2poamhFNjNiSzJWVk94bEloQkpGN2pBSHNjUHJGUkhcIl19IiA+ICVUTVAlXHNlbnNlVG1wLnR4dCAyPiYxCmlmICVFUlJPUkxFVkVMJSBORVEgMCAoCiAgIHNldCAiZXJyb3JEZXNjcmlwdGlvbj1VbmFibGUgdG8gd3JpdGUgb25ib2FyZGluZyBpbmZvcm1hdGlvbiB0byByZWdpc3RyeS4iCiAgIHNldCBlcnJvckNvZGU9MTAKICAgc2V0IGxhc3RFcnJvcj0lRVJST1JMRVZFTCUKICAgR09UTyBFUlJPUgopCgplY2hvIFN0YXJ0aW5nIHRoZSBzZXJ2aWNlLCBpZiBub3QgYWxyZWFkeSBydW5uaW5nID5OVUwgMj4mMQplY2hvLiA+TlVMIDI+JjEKc2MgcXVlcnkgIlNFTlNFIiB8IGZpbmQgL2kgIlJVTk5JTkciID5OVUwgMj4mMQppZiAlRVJST1JMRVZFTCUgRVFVIDAgR09UTyBSVU5OSU5HCgpuZXQgc3RhcnQgc2Vuc2UgPiAlVE1QJVxzZW5zZVRtcC50eHQgMj4mMQppZiAlRVJST1JMRVZFTCUgTkVRIDAgKAogICBlY2hvIFdpbmRvd3MgRGVmZW5kZXIgQWR2YW5jZWQgVGhyZWF0IFByb3RlY3Rpb24gU2VydmljZSBoYXMgbm90IHN0YXJ0ZWQgeWV0ID5OVUwgMj4mMQogICBHT1RPIFdBSVRfRk9SX1RIRV9TRVJWSUNFX1RPX1NUQVJUCikKZ290byBTVUNDRUVERUQKCjpSVU5OSU5HCnNldCAicnVubmluZ091dHB1dD1UaGUgV2luZG93cyBEZWZlbmRlciBBZHZhbmNlZCBUaHJlYXQgUHJvdGVjdGlvbiBTZXJ2aWNlIGlzIGFscmVhZHkgcnVubmluZyEiCmVjaG8gJXJ1bm5pbmdPdXRwdXQlID5OVUwgMj4mMQplY2hvLiA+TlVMIDI+JjEKZXZlbnRjcmVhdGUgL2wgQXBwbGljYXRpb24gL3NvIFdEQVRQT25ib2FyZGluZyAvdCBJbmZvcm1hdGlvbiAvaWQgMTAgL2QgIiVydW5uaW5nT3V0cHV0JSIgPk5VTCAyPiYxCkdPVE8gV0FJVF9GT1JfVEhFX1NFUlZJQ0VfVE9fU1RBUlQKCjpFUlJPUgpTZXQgL1AgZXJyb3JNc2c9PCVUTVAlXHNlbnNlVG1wLnR4dApzZXQgImVycm9yT3V0cHV0PVtFcnJvciBJZDogJWVycm9yQ29kZSUsIEVycm9yIExldmVsOiAlbGFzdEVycm9yJV0gJWVycm9yRGVzY3JpcHRpb24lIEVycm9yIG1lc3NhZ2U6ICVlcnJvck1zZyUiCiVwb3dlcnNoZWxsUGF0aCUgLUV4ZWN1dGlvblBvbGljeSBCeXBhc3MgLU5vUHJvZmlsZSAtQ29tbWFuZCAiQWRkLVR5cGUgJ3VzaW5nIFN5c3RlbTsgdXNpbmcgU3lzdGVtLkRpYWdub3N0aWNzOyB1c2luZyBTeXN0ZW0uRGlhZ25vc3RpY3MuVHJhY2luZzsgbmFtZXNwYWNlIFNlbnNlIHsgW0V2ZW50RGF0YShOYW1lID0gXCJPbmJvYXJkaW5nXCIpXXB1YmxpYyBzdHJ1Y3QgT25ib2FyZGluZ3twdWJsaWMgc3RyaW5nIE1lc3NhZ2UgeyBnZXQ7IHNldDsgfX0gcHVibGljIGNsYXNzIFRyYWNlIHtwdWJsaWMgc3RhdGljIEV2ZW50U291cmNlT3B0aW9ucyBUZWxlbWV0cnlDcml0aWNhbE9wdGlvbiA9IG5ldyBFdmVudFNvdXJjZU9wdGlvbnMoKXtMZXZlbCA9IEV2ZW50TGV2ZWwuRXJyb3IsIEtleXdvcmRzID0gKEV2ZW50S2V5d29yZHMpMHgwMDAwMjAwMDAwMDAwMDAwLCBUYWdzID0gKEV2ZW50VGFncykweDAyMDAwMDB9OyBwdWJsaWMgdm9pZCBXcml0ZU9uYm9hcmRpbmdNZXNzYWdlKHN0cmluZyBtZXNzYWdlKXtlcy5Xcml0ZShcIk9uYm9hcmRpbmdTY3JpcHRcIiwgVGVsZW1ldHJ5Q3JpdGljYWxPcHRpb24sIG5ldyBPbmJvYXJkaW5nIHtNZXNzYWdlID0gbWVzc2FnZX0pO30gcHJpdmF0ZSBzdGF0aWMgcmVhZG9ubHkgc3RyaW5nW10gdGVsZW1ldHJ5VHJhaXRzID0geyBcIkVUV19HUk9VUFwiLCBcIns1RUNCMEJBQy1COTMwLTQ3RjUtQThBNC1FODI1MzUyOUVEQjd9XCIgfTsgcHJpdmF0ZSBFdmVudFNvdXJjZSBlcyA9IG5ldyBFdmVudFNvdXJjZShcIk1pY3Jvc29mdC5XaW5kb3dzLlNlbnNlLkNsaWVudC5NYW5hZ2VtZW50XCIsRXZlbnRTb3VyY2VTZXR0aW5ncy5FdHdTZWxmRGVzY3JpYmluZ0V2ZW50Rm9ybWF0LHRlbGVtZXRyeVRyYWl0cyk7fX0nOyAkbG9nZ2VyID0gTmV3LU9iamVjdCAtVHlwZU5hbWUgU2Vuc2UuVHJhY2U7ICRsb2dnZXIuV3JpdGVPbmJvYXJkaW5nTWVzc2FnZSgnJWVycm9yT3V0cHV0JScpIiA+TlVMIDI+JjEKZWNobyAlZXJyb3JPdXRwdXQlID5OVUwgMj4mMQplY2hvLiA+TlVMIDI+JjEKZXZlbnRjcmVhdGUgL2wgQXBwbGljYXRpb24gL3NvIFdEQVRQT25ib2FyZGluZyAvdCBFcnJvciAvaWQgJWVycm9yQ29kZSUgL2QgIiVlcnJvck91dHB1dCUiID5OVUwgMj4mMQpHT1RPIENMRUFOVVAKCjpTVUNDRUVERUQKZWNobyBGaW5pc2hlZCBwZXJmb3JtaW5nIG9uYm9hcmRpbmcgb3BlcmF0aW9ucyA+TlVMIDI+JjEKZWNoby4gPk5VTCAyPiYxCkdPVE8gV0FJVF9GT1JfVEhFX1NFUlZJQ0VfVE9fU1RBUlQKCjpXQUlUX0ZPUl9USEVfU0VSVklDRV9UT19TVEFSVAplY2hvIFdhaXRpbmcgZm9yIHRoZSBzZXJ2aWNlIHRvIHN0YXJ0ID5OVUwgMj4mMQplY2hvLiA+TlVMIDI+JjEKCnNldCAvYSBjb3VudGVyPTAKCjpTRU5TRV9SVU5OSU5HX1dBSVQKc2MgcXVlcnkgIlNFTlNFIiB8IGZpbmQgL2kgIlJVTk5JTkciID5OVUwgMj4mMQppZiAlRVJST1JMRVZFTCUgTkVRIDAgKAoJSUYgJWNvdW50ZXIlIEVRVSA0ICgKCQlzZXQgImVycm9yRGVzY3JpcHRpb249VW5hYmxlIHRvIHN0YXJ0IFdpbmRvd3MgRGVmZW5kZXIgQWR2YW5jZWQgVGhyZWF0IFByb3RlY3Rpb24gU2VydmljZS4iCgkJc2V0IGVycm9yQ29kZT0xNQoJCXNldCBsYXN0RXJyb3I9JUVSUk9STEVWRUwlCgkJR09UTyBFUlJPUgoJKQoKCXNldCAvYSBjb3VudGVyPSVjb3VudGVyJSsxCgoJdGltZW91dCA1ID5OVUwgMj4mMQoJR09UTyA6U0VOU0VfUlVOTklOR19XQUlUCikKCnNldCAvYSBjb3VudGVyPTAKCjpTRU5TRV9PTkJPQVJERURfU1RBVFVTX1dBSVQKUkVHIHF1ZXJ5ICJIS0xNXFNPRlRXQVJFXE1pY3Jvc29mdFxXaW5kb3dzIEFkdmFuY2VkIFRocmVhdCBQcm90ZWN0aW9uXFN0YXR1cyIgL3YgT25ib2FyZGluZ1N0YXRlIC9yZWc6NjQgPk5VTCAyPiYxCmlmICVFUlJPUkxFVkVMJSBORVEgMCAoCglJRiAlY291bnRlciUgRVFVIDQgKAoJCUBlY2hvIFdpbmRvd3MgRGVmZW5kZXIgQWR2YW5jZWQgVGhyZWF0IFByb3RlY3Rpb24gU2VydmljZSBpcyBub3QgcnVubmluZyBhcyBleHBlY3RlZD4gJVRNUCVcc2Vuc2VUbXAudHh0CgkJc2V0IGVycm9yQ29kZT0zNQogICAgIHNldCBsYXN0RXJyb3I9JUVSUk9STEVWRUwlCgkJR09UTyBFUlJPUgoJKQoKCXNldCAvYSBjb3VudGVyPSVjb3VudGVyJSsxCgoJdGltZW91dCA1ID5OVUwgMj4mMQoJR09UTyA6U0VOU0VfT05CT0FSREVEX1NUQVRVU19XQUlUCikKCnNldCAvYSBjb3VudGVyPTAKCjpTRU5TRV9PTkJPQVJERURfV0FJVApSRUcgcXVlcnkgIkhLTE1cU09GVFdBUkVcTWljcm9zb2Z0XFdpbmRvd3MgQWR2YW5jZWQgVGhyZWF0IFByb3RlY3Rpb25cU3RhdHVzIiAvdiBPbmJvYXJkaW5nU3RhdGUgL3JlZzo2NCB8IGZpbmQgL2kgIjB4MSIgPk5VTCAyPiYxCmlmICVFUlJPUkxFVkVMJSBORVEgMCAoCglJRiAlY291bnRlciUgRVFVIDQgKAoJCUBlY2hvIFdpbmRvd3MgRGVmZW5kZXIgQWR2YW5jZWQgVGhyZWF0IFByb3RlY3Rpb24gU2VydmljZSBpcyBub3QgcnVubmluZyBhcyBleHBlY3RlZD4gJVRNUCVcc2Vuc2VUbXAudHh0CgkJc2V0IGVycm9yQ29kZT00MAogICAgIHNldCBsYXN0RXJyb3I9JUVSUk9STEVWRUwlCgkJR09UTyBFUlJPUgoJKQoKCXNldCAvYSBjb3VudGVyPSVjb3VudGVyJSsxCgoJdGltZW91dCA1ID5OVUwgMj4mMQoJR09UTyA6U0VOU0VfT05CT0FSREVEX1dBSVQKKQoKc2V0ICJzdWNjZXNzT3V0cHV0PVN1Y2Nlc3NmdWxseSBvbmJvYXJkZWQgbWFjaGluZSB0byBXaW5kb3dzIERlZmVuZGVyIEFkdmFuY2VkIFRocmVhdCBQcm90ZWN0aW9uIgplY2hvICVzdWNjZXNzT3V0cHV0JSA+TlVMIDI+JjEKZWNoby4KZXZlbnRjcmVhdGUgL2wgQXBwbGljYXRpb24gL3NvIFdEQVRQT25ib2FyZGluZyAvdCBJbmZvcm1hdGlvbiAvaWQgMjAgL2QgIiVzdWNjZXNzT3V0cHV0JSIgPk5VTCAyPiYxCiVwb3dlcnNoZWxsUGF0aCUgLUV4ZWN1dGlvblBvbGljeSBCeXBhc3MgLU5vUHJvZmlsZSAtQ29tbWFuZCAiQWRkLVR5cGUgJ3VzaW5nIFN5c3RlbTsgdXNpbmcgU3lzdGVtLkRpYWdub3N0aWNzOyB1c2luZyBTeXN0ZW0uRGlhZ25vc3RpY3MuVHJhY2luZzsgbmFtZXNwYWNlIFNlbnNlIHsgW0V2ZW50RGF0YShOYW1lID0gXCJPbmJvYXJkaW5nXCIpXXB1YmxpYyBzdHJ1Y3QgT25ib2FyZGluZ3twdWJsaWMgc3RyaW5nIE1lc3NhZ2UgeyBnZXQ7IHNldDsgfX0gcHVibGljIGNsYXNzIFRyYWNlIHtwdWJsaWMgc3RhdGljIEV2ZW50U291cmNlT3B0aW9ucyBUZWxlbWV0cnlDcml0aWNhbE9wdGlvbiA9IG5ldyBFdmVudFNvdXJjZU9wdGlvbnMoKXtMZXZlbCA9IEV2ZW50TGV2ZWwuSW5mb3JtYXRpb25hbCwgS2V5d29yZHMgPSAoRXZlbnRLZXl3b3JkcykweDAwMDAyMDAwMDAwMDAwMDAsIFRhZ3MgPSAoRXZlbnRUYWdzKTB4MDIwMDAwMH07IHB1YmxpYyB2b2lkIFdyaXRlT25ib2FyZGluZ01lc3NhZ2Uoc3RyaW5nIG1lc3NhZ2Upe2VzLldyaXRlKFwiT25ib2FyZGluZ1NjcmlwdFwiLCBUZWxlbWV0cnlDcml0aWNhbE9wdGlvbiwgbmV3IE9uYm9hcmRpbmcge01lc3NhZ2UgPSBtZXNzYWdlfSk7fSBwcml2YXRlIHN0YXRpYyByZWFkb25seSBzdHJpbmdbXSB0ZWxlbWV0cnlUcmFpdHMgPSB7IFwiRVRXX0dST1VQXCIsIFwiezVFQ0IwQkFDLUI5MzAtNDdGNS1BOEE0LUU4MjUzNTI5RURCN31cIiB9OyBwcml2YXRlIEV2ZW50U291cmNlIGVzID0gbmV3IEV2ZW50U291cmNlKFwiTWljcm9zb2Z0LldpbmRvd3MuU2Vuc2UuQ2xpZW50Lk1hbmFnZW1lbnRcIixFdmVudFNvdXJjZVNldHRpbmdzLkV0d1NlbGZEZXNjcmliaW5nRXZlbnRGb3JtYXQsdGVsZW1ldHJ5VHJhaXRzKTt9fSc7ICRsb2dnZXIgPSBOZXctT2JqZWN0IC1UeXBlTmFtZSBTZW5zZS5UcmFjZTsgJGxvZ2dlci5Xcml0ZU9uYm9hcmRpbmdNZXNzYWdlKCclc3VjY2Vzc091dHB1dCUnKSIgPk5VTCAyPiYxCiIlUFJPR1JBTUZJTEVTJVxXaW5kb3dzIERlZmVuZGVyXE1wQ21kUnVuLmV4ZSIgLVJlbG9hZEVuZ2luZSA+TlVMIDI+JjEKCkdPVE8gQ0xFQU5VUAoKOkNMRUFOVVAKaWYgZXhpc3QgJVRNUCVcc2Vuc2VUbXAudHh0IGRlbCAlVE1QJVxzZW5zZVRtcC50eHQKRVhJVCAvQiAlZXJyb3JDb2RlJQo=="), - // OnboardingPackageWindows: []byte("QGVjaG8gb2ZmCgplY2hvLiA+TlVMIDI+JjEKZWNobyBTdGFydGluZyBXaW5kb3dzIERlZmVuZGVyIEFkdmFuY2VkIFRocmVhdCBQcm90ZWN0aW9uIG9uYm9hcmRpbmcgcHJvY2Vzcy4uLiA+TlVMIDI+JjEKZWNoby4gPk5VTCAyPiYxCgpzZXQgZXJyb3JDb2RlPTAKc2V0IGxhc3RFcnJvcj0wCnNldCAidHJvdWJsZXNob290SW5mbz1Gb3IgbW9yZSBpbmZvcm1hdGlvbiwgdmlzaXQ6IGh0dHBzOi8vZ28ubWljcm9zb2Z0LmNvbS9md2xpbmsvcC8/bGlua2lkPTgyMjgwNyIKc2V0ICJlcnJvckRlc2NyaXB0aW9uPSIKCmVjaG8gVGVzdGluZyBhZG1pbmlzdHJhdG9yIHByaXZpbGVnZXMgPk5VTCAyPiYxCgpuZXQgc2Vzc2lvbiA+TlVMIDI+JjEKaWYgJUVSUk9STEVWRUwlIE5FUSAwICgKCUBlY2hvIFNjcmlwdCBpcyBydW5uaW5nIHdpdGggaW5zdWZmaWNpZW50IHByaXZpbGVnZXMuIFBsZWFzZSBydW4gd2l0aCBhZG1pbmlzdHJhdG9yIHByaXZpbGVnZXM+ICVUTVAlXHNlbnNlVG1wLnR4dAoJc2V0IGVycm9yQ29kZT02NQogc2V0IGxhc3RFcnJvcj0lRVJST1JMRVZFTCUKCUdPVE8gRVJST1IKKQoKZWNobyBTY3JpcHQgaXMgcnVubmluZyB3aXRoIHN1ZmZpY2llbnQgcHJpdmlsZWdlcyA+TlVMIDI+JjEKZWNoby4gPk5VTCAyPiYxCmVjaG8gUGVyZm9ybWluZyBvbmJvYXJkaW5nIG9wZXJhdGlvbnMgPk5VTCAyPiYxCmVjaG8uID5OVUwgMj4mMQoKSUYgWyVQUk9DRVNTT1JfQVJDSElURVc2NDMyJV0gRVFVIFtdICgKICBzZXQgcG93ZXJzaGVsbFBhdGg9JXdpbmRpciVcU3lzdGVtMzJcV2luZG93c1Bvd2VyU2hlbGxcdjEuMFxwb3dlcnNoZWxsLmV4ZQopIEVMU0UgKAogIHNldCBwb3dlcnNoZWxsUGF0aD0ld2luZGlyJVxTeXNOYXRpdmVcV2luZG93c1Bvd2VyU2hlbGxcdjEuMFxwb3dlcnNoZWxsLmV4ZQopCgpzZXQgc2RiaW49MDEwMDA0ODA0NDAwMDAwMDU0MDAwMDAwMDAwMDAwMDAxNDAwMDAwMDAyMDAzMDAwMDIwMDAwMDAwMDAwMTQwMEZGMEYxMjAwMDEwMTAwMDAwMDAwMDAwNTEyMDAwMDAwMDAwMDE0MDBFMTA0MTIwMDAxMDEwMDAwMDAwMDAwMDUwQjAwMDAwMDAxMDIwMDAwMDAwMDAwMDUyMDAwMDAwMDIwMDIwMDAwMDEwMjAwMDAwMDAwMDAwNTIwMDAwMDAwMjAwMjAwMDAgPk5VTCAyPiYxCnJlZyBhZGQgSEtMTVxTWVNURU1cQ3VycmVudENvbnRyb2xTZXRcQ29udHJvbFxXTUlcU2VjdXJpdHkgL3YgMTRmODEzOGUtM2I2MS01ODBiLTU0NGItMjYwOTM3OGFlNDYwIC90IFJFR19CSU5BUlkgL2QgJXNkYmluJSAvZiA+TlVMIDI+JjEKcmVnIGFkZCBIS0xNXFNZU1RFTVxDdXJyZW50Q29udHJvbFNldFxDb250cm9sXFdNSVxTZWN1cml0eSAvdiBjYjJmZjcyZC1kNGU0LTU4NWQtMzNmOS1mM2EzOTVjNDBiZTcgL3QgUkVHX0JJTkFSWSAvZCAlc2RiaW4lIC9mID5OVUwgMj4mMQoKUkVHIGFkZCAiSEtMTVxTT0ZUV0FSRVxQb2xpY2llc1xNaWNyb3NvZnRcV2luZG93c1xEYXRhQ29sbGVjdGlvbiIgL3YgRGlzYWJsZUVudGVycHJpc2VBdXRoUHJveHkgL3QgUkVHX0RXT1JEIC9mIC9kIDEgPk5VTCAyPiYxCgolcG93ZXJzaGVsbFBhdGglIC1FeGVjdXRpb25Qb2xpY3kgQnlwYXNzIC1Ob1Byb2ZpbGUgLUNvbW1hbmQgIkFkZC1UeXBlICcgdXNpbmcgU3lzdGVtOyB1c2luZyBTeXN0ZW0uSU87IHVzaW5nIFN5c3RlbS5SdW50aW1lLkludGVyb3BTZXJ2aWNlczsgdXNpbmcgTWljcm9zb2Z0LldpbjMyLlNhZmVIYW5kbGVzOyB1c2luZyBTeXN0ZW0uQ29tcG9uZW50TW9kZWw7IHB1YmxpYyBzdGF0aWMgY2xhc3MgRWxhbXsgW0RsbEltcG9ydChcIktlcm5lbDMyXCIsIENoYXJTZXQ9Q2hhclNldC5BdXRvLCBTZXRMYXN0RXJyb3I9dHJ1ZSldIHB1YmxpYyBzdGF0aWMgZXh0ZXJuIGJvb2wgSW5zdGFsbEVMQU1DZXJ0aWZpY2F0ZUluZm8oU2FmZUZpbGVIYW5kbGUgaGFuZGxlKTsgcHVibGljIHN0YXRpYyB2b2lkIEluc3RhbGxXZEJvb3Qoc3RyaW5nIHBhdGgpIHsgQ29uc29sZS5PdXQuV3JpdGVMaW5lKFwiQWJvdXQgdG8gY2FsbCBjcmVhdGUgZmlsZSBvbiB7MH1cIiwgcGF0aCk7IHZhciBzdHJlYW0gPSBGaWxlLk9wZW4ocGF0aCwgRmlsZU1vZGUuT3BlbiwgRmlsZUFjY2Vzcy5SZWFkLCBGaWxlU2hhcmUuUmVhZCk7IHZhciBoYW5kbGUgPSBzdHJlYW0uU2FmZUZpbGVIYW5kbGU7IENvbnNvbGUuT3V0LldyaXRlTGluZShcIkFib3V0IHRvIGNhbGwgSW5zdGFsbEVMQU1DZXJ0aWZpY2F0ZUluZm8gb24gaGFuZGxlIHswfVwiLCBoYW5kbGUuRGFuZ2Vyb3VzR2V0SGFuZGxlKCkpOyBpZiAoIUluc3RhbGxFTEFNQ2VydGlmaWNhdGVJbmZvKGhhbmRsZSkpIHsgQ29uc29sZS5PdXQuV3JpdGVMaW5lKFwiQ2FsbCBmYWlsZWQuXCIpOyB0aHJvdyBuZXcgV2luMzJFeGNlcHRpb24oTWFyc2hhbC5HZXRMYXN0V2luMzJFcnJvcigpKTsgfSBDb25zb2xlLk91dC5Xcml0ZUxpbmUoXCJDYWxsIHN1Y2Nlc3NmdWwuXCIpOyB9IH0gJzsgJGRyaXZlclBhdGggPSAkZW52OlN5c3RlbVJvb3QgKyAnXFN5c3RlbTMyXERyaXZlcnNcV2RCb290LnN5cyc7IFtFbGFtXTo6SW5zdGFsbFdkQm9vdCgkZHJpdmVyUGF0aCkgIiA+TlVMIDI+JjEKClJFRyBxdWVyeSAiSEtMTVxTT0ZUV0FSRVxQb2xpY2llc1xNaWNyb3NvZnRcV2luZG93cyBBZHZhbmNlZCBUaHJlYXQgUHJvdGVjdGlvbiIgL3YgNjk2QzFGQTEtNDAzMC00RkE0LTg3MTMtRkFGOUIyRUE3QzBBIC9yZWc6NjQgPiAlVE1QJVxzZW5zZVRtcC50eHQgMj4mMQppZiAlRVJST1JMRVZFTCUgRVFVIDAgKCAgCiAgICBSRUcgZGVsZXRlICJIS0xNXFNPRlRXQVJFXFBvbGljaWVzXE1pY3Jvc29mdFxXaW5kb3dzIEFkdmFuY2VkIFRocmVhdCBQcm90ZWN0aW9uIiAvdiA2OTZDMUZBMS00MDMwLTRGQTQtODcxMy1GQUY5QjJFQTdDMEEgL2YgPiAlVE1QJVxzZW5zZVRtcC50eHQgMj4mMQogICAgaWYgJUVSUk9STEVWRUwlIE5FUSAwICgKICAgICAgICBzZXQgImVycm9yRGVzY3JpcHRpb249VW5hYmxlIHRvIGRlbGV0ZSBwcmV2aW91cyBvZmZib2FyZGluZyBpbmZvcm1hdGlvbiBmcm9tIHJlZ2lzdHJ5LiIKICAgICAgICBzZXQgZXJyb3JDb2RlPTUKICAgICAgICBzZXQgbGFzdEVycm9yPSVFUlJPUkxFVkVMJQogICAgICAgIEdPVE8gRVJST1IKICAgICkKKQoKUkVHIGFkZCAiSEtMTVxTT0ZUV0FSRVxQb2xpY2llc1xNaWNyb3NvZnRcV2luZG93cyBBZHZhbmNlZCBUaHJlYXQgUHJvdGVjdGlvbiIgL3YgT25ib2FyZGluZ0luZm8gL3QgUkVHX1NaIC9mIC9kICJ7XCJib2R5XCI6XCJ7XFxcInByZXZpb3VzT3JnSWRzXFxcIjpbXSxcXFwib3JnSWRcXFwiOlxcXCIwMDAwMDAwMC0wMDAwLTAwMDAtMDAwMC0wMDAwMDAwMGRlYWRcXFwiLFxcXCJnZW9Mb2NhdGlvblVybFxcXCI6XFxcImh0dHBzOi8vc2V2aWxsZWNsb3VkZ2F0ZXdheS1zdGcubWljcm9zb2Z0LmNvbS9cXFwiLFxcXCJkYXRhY2VudGVyXFxcIjpcXFwiRWFzdFVzMlxcXCIsXFxcInZvcnRleEdlb0xvY2F0aW9uXFxcIjpcXFwiU2FuZGJveFxcXCIsXFxcInZlcnNpb25cXFwiOlxcXCIxLjNcXFwifVwiLFwic2lnXCI6XCJKc0dGR2o3UCtIL1cvUEExcW9LTml3RXROZkU4YkhGblhxeks1SDhsQ09wc0RnRGNWTWpoT3BmQTZJTTJ3RFZadk5kWGhvZ0dEQ1FDWjNYdFJCbHRkcGFWc3pZNGtINVpHVkdnRUQxVE80ZCtCTjk2VDFSa3pOZ2NjZ2ZCWDNNQUw1bllUWXdiMGlUQUtFMGIxb3BmQmZrMzJQN3Q3b3A5dkhPeXZNMW5qdlZybVdWWWVSNk4rZFFrLzM4UDNUY2V3b2FkRmFUb3pidjBZK3dZOHgrbFcxeWN6bk1KMitQWTlxRHpabXoybE1rd0FlaDJwRTI4VW5MT0lhNjg0Y3U5RitHUlAveGhhR3dQWmpoc1JCSW51cHV5U1E2Y09YdE9kSERCQlRaZzVKSEhHMDBkNk9tUk5ONmxBelJWeFJURUVmaFFUVnN0U1poKzNMSjJTMGhmZGc9PVwiLFwic2hhMjU2c2lnXCI6XCJsVGI4ZittdkFveDRCckxPS0lqejFnTTNrRHREbG9wL21uNmZodmVEWjMvblVqb1lhNk81V2p4R0x2Z3lqZ0RtdThETkdPNUtqWWlxTVZ6Z0QzcHdqOVYwOXVOeUdYNGJUaXN0d1BnQTFLbGMrMUFLcmtWQTRGWGlQTHlST2tXdlhLM2dydFFJWU9nYjdSRlh6dzhnQlB5YlV0Z0FWbmNaMVFpdTAzblFLdGh5MFU3aXBlZUxaVE9oYVlhN001cTJxUTcya1BaSTZWUWlqSE42NVg3UTEvcm5rdUlSUkFmUEErZElIeE4wN0tpSlY2MGZsbDFZUUtOUlpSYUhKeGQ1UDd0RmdaaytEZE5mNVNXcHVaSTZTZE9MdExDN3VnbmdnK0krU2pUeUtvcVFKZElkWGRRaE5JK3I3WEM1L1M0ZlhnRVNtWmZKTUYxL0JtVlVFZUJDZlE9PVwiLFwiY2VydFwiOlwiTUlJRjVqQ0NBODZnQXdJQkFnSVRNd0FBQVkwdmh1VTl6R2x5b1FBQUFBQUJqVEFOQmdrcWhraUc5dzBCQVFzRkFEQitNUXN3Q1FZRFZRUUdFd0pWVXpFVE1CRUdBMVVFQ0JNS1YyRnphR2x1WjNSdmJqRVFNQTRHQTFVRUJ4TUhVbVZrYlc5dVpERWVNQndHQTFVRUNoTVZUV2xqY205emIyWjBJRU52Y25CdmNtRjBhVzl1TVNnd0pnWURWUVFERXg5TmFXTnliM052Wm5RZ1UyVmpkWEpsSUZObGNuWmxjaUJEUVNBeU1ERXhNQjRYRFRJd01EZ3dOakl3TlRBMU9Gb1hEVEl4TURnd05qSXdOVEExT0Zvd2dZb3hDekFKQmdOVkJBWVRBbFZUTVFzd0NRWURWUVFJRXdKWFFURVFNQTRHQTFVRUJ4TUhVbVZrYlc5dVpERWVNQndHQTFVRUNoTVZUV2xqY205emIyWjBJRU52Y25CdmNtRjBhVzl1TVI0d0hBWURWUVFMRXhWTmFXTnliM052Wm5RZ1EyOXljRzl5WVhScGIyNHhIREFhQmdOVkJBTVRFMU5sZG1sc2JHVXVWMmx1Wkc5M2N5NWpiMjB3Z2dFaU1BMEdDU3FHU0liM0RRRUJBUVVBQTRJQkR3QXdnZ0VLQW9JQkFRRENmcWtCcmV1Um1qdm90bDFFdURQWVplaVc1dUVERmV6MXhsYmh6cjVaa1BjSUJYT3RIMVZWRjRaUmVrdTFpK3ZMbTNON2xkVGl4c2RSZW0yU09iVkFGb1dDbjZ2cEYwL1ZYcWpmUTJHbyt2dk9UU1Q0Si9pQWxocXhialVVbkRyWFpXYUMvS2xtU0lYMjlHUng5bG1pT0IrWVBhRzlOTEE1U3F3emNad2hjTThzS3F0VDhHaWQ3Q3JFNGs1WldES0gyL1dPVTVsQ01iZTY2MWtrbWxKZDB2TlBDTXpyMUgzVmNmRG1qVVo4Q25WQzBFODlhVVA3VHhhME1uS0FzVFArQkpCNXJMenhkVlJRbGRNbmhHVXNXRU0ydUNOWXFOdWc4QWYrTGp3RytySXZrSVR3NVlDMUZDZy9qVHBvdHJnSFhmSGRqaURqa0F3ZWY1TlVkTmx0QWdNQkFBR2pnZ0ZPTUlJQlNqQU9CZ05WSFE4QkFmOEVCQU1DQjRBd0V3WURWUjBsQkF3d0NnWUlLd1lCQlFVSEF3RXdIUVlEVlIwT0JCWUVGT0U1NVFoeno5bEhuWTl2aDVTWmtyMTdjbEtzTUI0R0ExVWRFUVFYTUJXQ0UxTmxkbWxzYkdVdVYybHVaRzkzY3k1amIyMHdId1lEVlIwakJCZ3dGb0FVTmxhSlpVbkxXNXN2UEt4Q0ZsQk5rYmt6MTVFd1V3WURWUjBmQkV3d1NqQklvRWFnUklaQ2FIUjBjRG92TDNkM2R5NXRhV055YjNOdlpuUXVZMjl0TDNCcmFXOXdjeTlqY213dlRXbGpVMlZqVTJWeVEwRXlNREV4WHpJd01URXRNVEF0TVRndVkzSnNNR0FHQ0NzR0FRVUZCd0VCQkZRd1VqQlFCZ2dyQmdFRkJRY3dBb1pFYUhSMGNEb3ZMM2QzZHk1dGFXTnliM052Wm5RdVkyOXRMM0JyYVc5d2N5OWpaWEowY3k5TmFXTlRaV05UWlhKRFFUSXdNVEZmTWpBeE1TMHhNQzB4T0M1amNuUXdEQVlEVlIwVEFRSC9CQUl3QURBTkJna3Foa2lHOXcwQkFRc0ZBQU9DQWdFQVp3ZGxhWjg4U3BURFdUUjc5NWRHV2N0dUxUWmc2UDBqYmh4Q0dhOXBnb3AzSXZ1Qi9QYzJXT2Ruc1ZCYUpUZG5WN3NvcFZHa3V4Vjc1eWk2Q0NQM2sxNG0xQ1FhNk01cmNodmJuVEY0TFdjWld4U1g4Z0hjRWhObFdYV3hxU3FKMzNnSHVGNEc5SCs3VDM3UlNMb2Jqb1MyeVRhc21SRWtCNTI4b1gwWVU0cVpjeVdyK0xEMVovQk10dEhMUlZUZUtHdnpMaVpCNmhqWURybW9qUUxKZXZwSEdoTVdOTU9oR2RLd2pOS0crZGhVRHV6dTdsVXgwZzdhaUR3c1l4NzFTaU9ucDJWOSt5UEhET2R5OXlBRUNPb0N3bUprbW5qLzlDMmVNMDFDQjFZMUxTWHNiQUJtQVd3Si9iczhRNnhTWlJtSnkyRXJSQ3VTakl0MUQydzRTUFVMRFNNVTdIaDk3TWJpQVJDV25TMVRRMGg5azZFWVVmbW1ZaFNHQ0p3MXFlekFqZ2FmTngyYWcrRDhzRFFkQzRjVHhUSTk5aGthUm1DakFmeW1qcVdscUx5V0pCUmdvaXdTd21MVDFUbzRJNUVjZHFoQ1FNdEpoRVVRR2dpenk2ZUE2RlhtNHhmeExua08xSkNKSGJUejlqL2c4OW5zZ0hVN2V4SDVnZHhZQ0FDMGJkUlZLN1YrVlBDcExnLy9SemtlNm9mc1Y3WkxyQUpvN0EyQTZka0dVL09XeGhpVjJiY0VlUEpmSWsrVjM3UHp3c25yZ1JFV2RpM1pic3dBOU5aTTVzZGVSMFlFRm11bit0b2JCRGMzMlRidlVyTUpTb2tjcG9XNnRZczlkR0tUcE1GV01EZ09UeEZjSHljbHZrMjRVQVV2dXk2WVcvSVN2VlY4a3BRPVwiLFwiY2hhaW5cIjpbXCJNSUlHMkRDQ0JNQ2dBd0lCQWdJS1lUKzNHQUFBQUFBQUJEQU5CZ2txaGtpRzl3MEJBUXNGQURDQmlERUxNQWtHQTFVRUJoTUNWVk14RXpBUkJnTlZCQWdUQ2xkaGMyaHBibWQwYjI0eEVEQU9CZ05WQkFjVEIxSmxaRzF2Ym1ReEhqQWNCZ05WQkFvVEZVMXBZM0p2YzI5bWRDQkRiM0p3YjNKaGRHbHZiakV5TURBR0ExVUVBeE1wVFdsamNtOXpiMlowSUZKdmIzUWdRMlZ5ZEdsbWFXTmhkR1VnUVhWMGFHOXlhWFI1SURJd01URXdIaGNOTVRFeE1ERTRNakkxTlRFNVdoY05Nall4TURFNE1qTXdOVEU1V2pCK01Rc3dDUVlEVlFRR0V3SlZVekVUTUJFR0ExVUVDQk1LVjJGemFHbHVaM1J2YmpFUU1BNEdBMVVFQnhNSFVtVmtiVzl1WkRFZU1Cd0dBMVVFQ2hNVlRXbGpjbTl6YjJaMElFTnZjbkJ2Y21GMGFXOXVNU2d3SmdZRFZRUURFeDlOYVdOeWIzTnZablFnVTJWamRYSmxJRk5sY25abGNpQkRRU0F5TURFeE1JSUNJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBZzhBTUlJQ0NnS0NBZ0VBMEF2QXBLZ1pnZUkyNWVLcTVmT3lGVmgxdnJUbFNmSGdoUG03RFdUdmhjR0JWYmp6NS9GdFFGVTl6b3RxMFlTVDlYVjhXNlRVZEJES012TWowNjd1ejU0RVdNTFpSOHZSZkFCQlNIRWJBV2NYR0svRy9uTURmdVR2UTV6dkFYRXFINEVtUTNlWVZGZHpuVlVyOEo2T2ZRWU9yQnRVOHliMytDTUlJb3VlQmgwM09QMXkwc3JsWThHYVduMnliYk5TcVc3cHJyWDhpemI1bnZyMkhGZ2JsMWFsRWVXM1V0dTc2ZkJVdjdUL0xHeTRYU2JPb0FyWDM1UHRmOTJzOFN4ekd0a1pOMVc2M1NKNGpxSFVtd240QnlJeGNiQ1VydUN3NXlaRVY1Q0JseFhPWWV4bDRrdnhoVklXTXZpMWVLcCt6VTNzZ3lHa3FKdSttbW9FNEtNY3pWWVliUDFyTDBJKzRqZnljcXZRZUhOeWU5N3NBRmpsSVRDakNEcVo3NS9EOTNvV2xtVzF3NEd2OURsd1NhLzJxZlpxQURqNXRBZ1o0Qm8xcFZaMklsOXE4bW11UHExWVJrMjRWUGFKUVVRZWNyRzhFaWRUMHNIL3NzMVFtQjYxOUx1MndvSTUyYXdiOGpzbmhHcXd4aVlMMXpvUTU3UGJmTk5XckZOTUMvbzdNVGQwMkZrcitRQjVHUVo3L1J3ZFF0UkJEUzhGRHRWclNTUC96ODM0ZW9MUDJqd3QzK2pZRWdRWXVoNklkN2lZSHhBSHU4Z0ZmZ3NKdjJ2ZDQwNWJzUG5IaEtZN3lreWZXMklwOThlaXFKV0ljQ3psd1Q4OFVpTlBRSnJETVlXREw3OHA4UjFRanlHV0I4N3Y4b0RDUkgyYll1OHZ3M2VKcTBWTlV6NENlZE1DQXdFQUFhT0NBVXN3Z2dGSE1CQUdDU3NHQVFRQmdqY1ZBUVFEQWdFQU1CMEdBMVVkRGdRV0JCUTJWb2xsU2N0Ym15ODhyRUlXVUUyUnVUUFhrVEFaQmdrckJnRUVBWUkzRkFJRURCNEtBRk1BZFFCaUFFTUFRVEFMQmdOVkhROEVCQU1DQVlZd0R3WURWUjBUQVFIL0JBVXdBd0VCL3pBZkJnTlZIU01FR0RBV2dCUnlMVG9DTVpCRHVSUUZUdUhxcDhjeDBTT0pOREJhQmdOVkhSOEVVekJSTUUrZ1RhQkxoa2xvZEhSd09pOHZZM0pzTG0xcFkzSnZjMjltZEM1amIyMHZjR3RwTDJOeWJDOXdjbTlrZFdOMGN5OU5hV05TYjI5RFpYSkJkWFF5TURFeFh6SXdNVEZmTUROZk1qSXVZM0pzTUY0R0NDc0dBUVVGQndFQkJGSXdVREJPQmdnckJnRUZCUWN3QW9aQ2FIUjBjRG92TDNkM2R5NXRhV055YjNOdlpuUXVZMjl0TDNCcmFTOWpaWEowY3k5TmFXTlNiMjlEWlhKQmRYUXlNREV4WHpJd01URmZNRE5mTWpJdVkzSjBNQTBHQ1NxR1NJYjNEUUVCQ3dVQUE0SUNBUUJCeUdIQjlWdWVQcEV4OGJER3Z3a0J0SjIya0hUWENkdW1MZzJmeU9kMk5FYXZCMkNKVElHelBOWDBFalYxd25PbDlVMkVqTXVrWGErL2t2WVhDRmRDbFhKbEJYWjVyZTdSdXJndVZLTlJCNnhvNnlFTTR5V0J3czBxOHNQL3o4SzlTUmlheC9DRXhma1V2R3VWNVpidnMwTFNVOVZLb0JMRXJoSjJVd2xXRHAzMzA2WkppRkR5aWl5WElLSytUbmp2QldXM1M2RVdpTjR4eHdoQ0pIeWtlNTZkdkdBQVhtS1g0NVA4cC81YmV5WGY1Rk4vUzc3bVB2RGJBWGxDSEc2RmJIMjJSREQ3cFRlU2s3S2w3aUN0UDFQVnlmUW9hMWZCK0IxcXQxWXF0aWVCSEtZdG4rZjAwREdEbDZncXRxeStHMEgxNUlsZlZ2dmFXdE5lZlZXVUVINVRWL1JLUFVBcXlMMW5uNFRoRU83OTJtc1Zna244UmgzL1JRWjBuRUlVN2NVNTA3UE5DNE1ua0VOUmt2SkVncTV1bWhVWHNobjZ4MFZzbUFGN3Z6ZXBzSWlra3J3NE9PQWQ1SHlYbUJvdVgrODRaYmMxTDcxL1R5SDZ4SXpTYndiNVNUWHEzeUFQSmFycVlLc3NIMHVKL0xmNlhGU1FTejZpS0U5czVGSmx3ZjJRSElXQ2lHN3BwbFhkSVNoNVJiQVU1UXJNNWwvRXU5dGhOR21mckNZNDk4RXBRUWdWTGt5Zzkva01QdDVmcXdnSkxZT3NyRFNEWXZUSlNVS0pKYlZ1c2tmRnN6bWdzU0FiTExHT0JHK2xNRWtjMEVicFFGdjByVzY2MjRKS2h4SktnQWxOMjk5MnVRVmJHK0M3SUhCZkFDWEgwdzc2RnExN0lwNXhDQT09XCIsXCJNSUlGN1RDQ0E5V2dBd0lCQWdJUVA0dkl0Znlmc3BaRHRXbldiRUxoUkRBTkJna3Foa2lHOXcwQkFRc0ZBRENCaURFTE1Ba0dBMVVFQmhNQ1ZWTXhFekFSQmdOVkJBZ1RDbGRoYzJocGJtZDBiMjR4RURBT0JnTlZCQWNUQjFKbFpHMXZibVF4SGpBY0JnTlZCQW9URlUxcFkzSnZjMjltZENCRGIzSndiM0poZEdsdmJqRXlNREFHQTFVRUF4TXBUV2xqY205emIyWjBJRkp2YjNRZ1EyVnlkR2xtYVdOaGRHVWdRWFYwYUc5eWFYUjVJREl3TVRFd0hoY05NVEV3TXpJeU1qSXdOVEk0V2hjTk16WXdNekl5TWpJeE16QTBXakNCaURFTE1Ba0dBMVVFQmhNQ1ZWTXhFekFSQmdOVkJBZ1RDbGRoYzJocGJtZDBiMjR4RURBT0JnTlZCQWNUQjFKbFpHMXZibVF4SGpBY0JnTlZCQW9URlUxcFkzSnZjMjltZENCRGIzSndiM0poZEdsdmJqRXlNREFHQTFVRUF4TXBUV2xqY205emIyWjBJRkp2YjNRZ1EyVnlkR2xtYVdOaGRHVWdRWFYwYUc5eWFYUjVJREl3TVRFd2dnSWlNQTBHQ1NxR1NJYjNEUUVCQVFVQUE0SUNEd0F3Z2dJS0FvSUNBUUN5Z0VHcU5UaE5FM0l5YUNKTnVMTHgvOVZTdkd6SDlkSktqRGJ1MGNKY2ZveUtycThUS0cvQWMrTTZ6dEFscUZvNmJlK291Rm1yRXlOb3pRd3BoOUZ2Z0Z5UFJIOWRrQUZTV0t4UnhWOHFoOXpjMkFvZHdRTzVlN0JXNktQZVpHSENudmp6Zkxuc0RiVlUva3kyWlUrSThKeEltUXhDQ3dsOE1Wa1hlUVo0S0kySk9rd0RKYjV4YWx3TDU0UmdwSmtpNDlLdmhLU24rOUdZN1F5cDNwU0o0UTZnM01ET21UM3FDRks3Vm5ua0g0UzZIcmkweEVsY1R6RkxoOTNkQldjbW1ZRGdjUkdqdUtWQjRxUlR1ZmN5S1lNTUU3ODJYZ1N6UzBOSEwydmlrUjdUbUUvZFFnZkk2QjBTL0ptcGF6NlNmc2pXYVRyOFpMMjJDWjNLL1F3TG9wdDNZRXNEbEtRd2FSTFdRaTNCUVV6SzNLcjlqMXVEUnByWi9MSFI0N1BKZjBoNnpTVHdRWTljZE5Dc3NCQWdCa20zeHkwaHlGZmowSWJ6QTJqNzBNNXh3WW1aU21RQmJQM3NNSkhQUVR5U3grVzZoaDFoaE1kZmd6bGlyclNTTDBmekMvaFY2NkFmV2RDN2RKc2UwSGJtOHVrRzF4RG8rbVRlYWNZMWxvZ0M4RWE0UHllWmI4dHhpU2sxOTBnV0FqV1AxWGw4VFFMUFgrdUtnMDlGY1lqNXFRMU9jdW5DbkFmUFNSdE9CQTVqVVl4ZTJBREJWU3kyeHVEQ1pVN0pORG4xbkxQRWZ1aGhiaE5mRmNSZjJYN3RIYzd1Uk96TExvYXg3RGoyY08yclhCUEIyUThOeDRDeVZlMDA5NnliNU1QYTUwYzhwcldQTWQvRlM2L3I4UUlEQVFBQm8xRXdUekFMQmdOVkhROEVCQU1DQVlZd0R3WURWUjBUQVFIL0JBVXdBd0VCL3pBZEJnTlZIUTRFRmdRVWNpMDZBakdRUTdrVUJVN2g2cWZITWRFamlUUXdFQVlKS3dZQkJBR0NOeFVCQkFNQ0FRQXdEUVlKS29aSWh2Y05BUUVMQlFBRGdnSUJBSDl5encrM3hSWGJtOEJKeWlaYi9wNFQ1dFB3MHR1WFgvSkxQMDJ6cmhtdTdkZVhvS3p2cVRxandrR3c1YmlSbmhPQkpBUG1DZjAvVjBBNUlTUlcwUkF2UzBDcE5vWkx0Rk5YbXZ2eGZvbVBFZjRZYkZHcTZPMEpsYlhsY2NtaDZZZDFwaFYveVg0M1ZGNTBrOFhEWjh3TlQydW9Gd3h0Q0pKK2k5MkJxaTF3SWNNOUJoUzd2eVJlcDRUWFB3OGhJcjFMQUFiYmx4ellYdFRGQzF5SGJsQ2s2TU00cFB2TExNV1NacHVGWHN0NmJKTjhnQ2xZVzFlMVFHbTZDSG1tWkdJVm5ZZVdSYlZtSXlBRGl4eHpvTk9pZVRQZ1VGbUcyeS9sQWlYcWN5cWZBQlRJTnNlU08rbE9BT3pZVmdtNU0wa1MwbFFMQWF1c1I3YVJLWDFNdEhXQVVnSG95b0wybjh5c25JOFg2aThtc0t0eXJBditubEVleDBOVlowOVJzMWZXdHV6dVVyYzY2VTdoMTRHSXZFK09kYnRMcVBBMXFpYlVaMmRKc25CTU81UGNIZDk0a0laeXNqaWswZHlTVGNsWTZ5c1NYTlE3cm94cnNJUGxBVC80Q1RMMmt6VTBJcS9kTncxM0NZQXJ6VWdBOFl5WkdVY0ZBZW5SdjlGTzBPWW9RemVacEFwS0NObWFjWFBTcXMweEUyTjJvVGR2a2pnZWZSSThaakxueTIzaC9GS0ozY3JXWmdXYWxtRytvaWpISEtPbk5sQThPcVRmU203bWh6dk82L0RnZ1RlZEV6eFNqcjI1SFRUR0hkVUthajJZS1hDTWlTclJxNElRU0IvYzlPK2x4YnRWR2poamhFNjNiSzJWVk94bEloQkpGN2pBSHNjUHJGUkhcIl19IiA+ICVUTVAlXHNlbnNlVG1wLnR4dCAyPiYxCmlmICVFUlJPUkxFVkVMJSBORVEgMCAoCiAgIHNldCAiZXJyb3JEZXNjcmlwdGlvbj1VbmFibGUgdG8gd3JpdGUgb25ib2FyZGluZyBpbmZvcm1hdGlvbiB0byByZWdpc3RyeS4iCiAgIHNldCBlcnJvckNvZGU9MTAKICAgc2V0IGxhc3RFcnJvcj0lRVJST1JMRVZFTCUKICAgR09UTyBFUlJPUgopCgplY2hvIFN0YXJ0aW5nIHRoZSBzZXJ2aWNlLCBpZiBub3QgYWxyZWFkeSBydW5uaW5nID5OVUwgMj4mMQplY2hvLiA+TlVMIDI+JjEKc2MgcXVlcnkgIlNFTlNFIiB8IGZpbmQgL2kgIlJVTk5JTkciID5OVUwgMj4mMQppZiAlRVJST1JMRVZFTCUgRVFVIDAgR09UTyBSVU5OSU5HCgpuZXQgc3RhcnQgc2Vuc2UgPiAlVE1QJVxzZW5zZVRtcC50eHQgMj4mMQppZiAlRVJST1JMRVZFTCUgTkVRIDAgKAogICBlY2hvIFdpbmRvd3MgRGVmZW5kZXIgQWR2YW5jZWQgVGhyZWF0IFByb3RlY3Rpb24gU2VydmljZSBoYXMgbm90IHN0YXJ0ZWQgeWV0ID5OVUwgMj4mMQogICBHT1RPIFdBSVRfRk9SX1RIRV9TRVJWSUNFX1RPX1NUQVJUCikKZ290byBTVUNDRUVERUQKCjpSVU5OSU5HCnNldCAicnVubmluZ091dHB1dD1UaGUgV2luZG93cyBEZWZlbmRlciBBZHZhbmNlZCBUaHJlYXQgUHJvdGVjdGlvbiBTZXJ2aWNlIGlzIGFscmVhZHkgcnVubmluZyEiCmVjaG8gJXJ1bm5pbmdPdXRwdXQlID5OVUwgMj4mMQplY2hvLiA+TlVMIDI+JjEKZXZlbnRjcmVhdGUgL2wgQXBwbGljYXRpb24gL3NvIFdEQVRQT25ib2FyZGluZyAvdCBJbmZvcm1hdGlvbiAvaWQgMTAgL2QgIiVydW5uaW5nT3V0cHV0JSIgPk5VTCAyPiYxCkdPVE8gV0FJVF9GT1JfVEhFX1NFUlZJQ0VfVE9fU1RBUlQKCjpFUlJPUgpTZXQgL1AgZXJyb3JNc2c9PCVUTVAlXHNlbnNlVG1wLnR4dApzZXQgImVycm9yT3V0cHV0PVtFcnJvciBJZDogJWVycm9yQ29kZSUsIEVycm9yIExldmVsOiAlbGFzdEVycm9yJV0gJWVycm9yRGVzY3JpcHRpb24lIEVycm9yIG1lc3NhZ2U6ICVlcnJvck1zZyUiCiVwb3dlcnNoZWxsUGF0aCUgLUV4ZWN1dGlvblBvbGljeSBCeXBhc3MgLU5vUHJvZmlsZSAtQ29tbWFuZCAiQWRkLVR5cGUgJ3VzaW5nIFN5c3RlbTsgdXNpbmcgU3lzdGVtLkRpYWdub3N0aWNzOyB1c2luZyBTeXN0ZW0uRGlhZ25vc3RpY3MuVHJhY2luZzsgbmFtZXNwYWNlIFNlbnNlIHsgW0V2ZW50RGF0YShOYW1lID0gXCJPbmJvYXJkaW5nXCIpXXB1YmxpYyBzdHJ1Y3QgT25ib2FyZGluZ3twdWJsaWMgc3RyaW5nIE1lc3NhZ2UgeyBnZXQ7IHNldDsgfX0gcHVibGljIGNsYXNzIFRyYWNlIHtwdWJsaWMgc3RhdGljIEV2ZW50U291cmNlT3B0aW9ucyBUZWxlbWV0cnlDcml0aWNhbE9wdGlvbiA9IG5ldyBFdmVudFNvdXJjZU9wdGlvbnMoKXtMZXZlbCA9IEV2ZW50TGV2ZWwuRXJyb3IsIEtleXdvcmRzID0gKEV2ZW50S2V5d29yZHMpMHgwMDAwMjAwMDAwMDAwMDAwLCBUYWdzID0gKEV2ZW50VGFncykweDAyMDAwMDB9OyBwdWJsaWMgdm9pZCBXcml0ZU9uYm9hcmRpbmdNZXNzYWdlKHN0cmluZyBtZXNzYWdlKXtlcy5Xcml0ZShcIk9uYm9hcmRpbmdTY3JpcHRcIiwgVGVsZW1ldHJ5Q3JpdGljYWxPcHRpb24sIG5ldyBPbmJvYXJkaW5nIHtNZXNzYWdlID0gbWVzc2FnZX0pO30gcHJpdmF0ZSBzdGF0aWMgcmVhZG9ubHkgc3RyaW5nW10gdGVsZW1ldHJ5VHJhaXRzID0geyBcIkVUV19HUk9VUFwiLCBcIns1RUNCMEJBQy1COTMwLTQ3RjUtQThBNC1FODI1MzUyOUVEQjd9XCIgfTsgcHJpdmF0ZSBFdmVudFNvdXJjZSBlcyA9IG5ldyBFdmVudFNvdXJjZShcIk1pY3Jvc29mdC5XaW5kb3dzLlNlbnNlLkNsaWVudC5NYW5hZ2VtZW50XCIsRXZlbnRTb3VyY2VTZXR0aW5ncy5FdHdTZWxmRGVzY3JpYmluZ0V2ZW50Rm9ybWF0LHRlbGVtZXRyeVRyYWl0cyk7fX0nOyAkbG9nZ2VyID0gTmV3LU9iamVjdCAtVHlwZU5hbWUgU2Vuc2UuVHJhY2U7ICRsb2dnZXIuV3JpdGVPbmJvYXJkaW5nTWVzc2FnZSgnJWVycm9yT3V0cHV0JScpIiA+TlVMIDI+JjEKZWNobyAlZXJyb3JPdXRwdXQlID5OVUwgMj4mMQplY2hvLiA+TlVMIDI+JjEKZXZlbnRjcmVhdGUgL2wgQXBwbGljYXRpb24gL3NvIFdEQVRQT25ib2FyZGluZyAvdCBFcnJvciAvaWQgJWVycm9yQ29kZSUgL2QgIiVlcnJvck91dHB1dCUiID5OVUwgMj4mMQpHT1RPIENMRUFOVVAKCjpTVUNDRUVERUQKZWNobyBGaW5pc2hlZCBwZXJmb3JtaW5nIG9uYm9hcmRpbmcgb3BlcmF0aW9ucyA+TlVMIDI+JjEKZWNoby4gPk5VTCAyPiYxCkdPVE8gV0FJVF9GT1JfVEhFX1NFUlZJQ0VfVE9fU1RBUlQKCjpXQUlUX0ZPUl9USEVfU0VSVklDRV9UT19TVEFSVAplY2hvIFdhaXRpbmcgZm9yIHRoZSBzZXJ2aWNlIHRvIHN0YXJ0ID5OVUwgMj4mMQplY2hvLiA+TlVMIDI+JjEKCnNldCAvYSBjb3VudGVyPTAKCjpTRU5TRV9SVU5OSU5HX1dBSVQKc2MgcXVlcnkgIlNFTlNFIiB8IGZpbmQgL2kgIlJVTk5JTkciID5OVUwgMj4mMQppZiAlRVJST1JMRVZFTCUgTkVRIDAgKAoJSUYgJWNvdW50ZXIlIEVRVSA0ICgKCQlzZXQgImVycm9yRGVzY3JpcHRpb249VW5hYmxlIHRvIHN0YXJ0IFdpbmRvd3MgRGVmZW5kZXIgQWR2YW5jZWQgVGhyZWF0IFByb3RlY3Rpb24gU2VydmljZS4iCgkJc2V0IGVycm9yQ29kZT0xNQoJCXNldCBsYXN0RXJyb3I9JUVSUk9STEVWRUwlCgkJR09UTyBFUlJPUgoJKQoKCXNldCAvYSBjb3VudGVyPSVjb3VudGVyJSsxCgoJdGltZW91dCA1ID5OVUwgMj4mMQoJR09UTyA6U0VOU0VfUlVOTklOR19XQUlUCikKCnNldCAvYSBjb3VudGVyPTAKCjpTRU5TRV9PTkJPQVJERURfU1RBVFVTX1dBSVQKUkVHIHF1ZXJ5ICJIS0xNXFNPRlRXQVJFXE1pY3Jvc29mdFxXaW5kb3dzIEFkdmFuY2VkIFRocmVhdCBQcm90ZWN0aW9uXFN0YXR1cyIgL3YgT25ib2FyZGluZ1N0YXRlIC9yZWc6NjQgPk5VTCAyPiYxCmlmICVFUlJPUkxFVkVMJSBORVEgMCAoCglJRiAlY291bnRlciUgRVFVIDQgKAoJCUBlY2hvIFdpbmRvd3MgRGVmZW5kZXIgQWR2YW5jZWQgVGhyZWF0IFByb3RlY3Rpb24gU2VydmljZSBpcyBub3QgcnVubmluZyBhcyBleHBlY3RlZD4gJVRNUCVcc2Vuc2VUbXAudHh0CgkJc2V0IGVycm9yQ29kZT0zNQogICAgIHNldCBsYXN0RXJyb3I9JUVSUk9STEVWRUwlCgkJR09UTyBFUlJPUgoJKQoKCXNldCAvYSBjb3VudGVyPSVjb3VudGVyJSsxCgoJdGltZW91dCA1ID5OVUwgMj4mMQoJR09UTyA6U0VOU0VfT05CT0FSREVEX1NUQVRVU19XQUlUCikKCnNldCAvYSBjb3VudGVyPTAKCjpTRU5TRV9PTkJPQVJERURfV0FJVApSRUcgcXVlcnkgIkhLTE1cU09GVFdBUkVcTWljcm9zb2Z0XFdpbmRvd3MgQWR2YW5jZWQgVGhyZWF0IFByb3RlY3Rpb25cU3RhdHVzIiAvdiBPbmJvYXJkaW5nU3RhdGUgL3JlZzo2NCB8IGZpbmQgL2kgIjB4MSIgPk5VTCAyPiYxCmlmICVFUlJPUkxFVkVMJSBORVEgMCAoCglJRiAlY291bnRlciUgRVFVIDQgKAoJCUBlY2hvIFdpbmRvd3MgRGVmZW5kZXIgQWR2YW5jZWQgVGhyZWF0IFByb3RlY3Rpb24gU2VydmljZSBpcyBub3QgcnVubmluZyBhcyBleHBlY3RlZD4gJVRNUCVcc2Vuc2VUbXAudHh0CgkJc2V0IGVycm9yQ29kZT00MAogICAgIHNldCBsYXN0RXJyb3I9JUVSUk9STEVWRUwlCgkJR09UTyBFUlJPUgoJKQoKCXNldCAvYSBjb3VudGVyPSVjb3VudGVyJSsxCgoJdGltZW91dCA1ID5OVUwgMj4mMQoJR09UTyA6U0VOU0VfT05CT0FSREVEX1dBSVQKKQoKc2V0ICJzdWNjZXNzT3V0cHV0PVN1Y2Nlc3NmdWxseSBvbmJvYXJkZWQgbWFjaGluZSB0byBXaW5kb3dzIERlZmVuZGVyIEFkdmFuY2VkIFRocmVhdCBQcm90ZWN0aW9uIgplY2hvICVzdWNjZXNzT3V0cHV0JSA+TlVMIDI+JjEKZWNoby4KZXZlbnRjcmVhdGUgL2wgQXBwbGljYXRpb24gL3NvIFdEQVRQT25ib2FyZGluZyAvdCBJbmZvcm1hdGlvbiAvaWQgMjAgL2QgIiVzdWNjZXNzT3V0cHV0JSIgPk5VTCAyPiYxCiVwb3dlcnNoZWxsUGF0aCUgLUV4ZWN1dGlvblBvbGljeSBCeXBhc3MgLU5vUHJvZmlsZSAtQ29tbWFuZCAiQWRkLVR5cGUgJ3VzaW5nIFN5c3RlbTsgdXNpbmcgU3lzdGVtLkRpYWdub3N0aWNzOyB1c2luZyBTeXN0ZW0uRGlhZ25vc3RpY3MuVHJhY2luZzsgbmFtZXNwYWNlIFNlbnNlIHsgW0V2ZW50RGF0YShOYW1lID0gXCJPbmJvYXJkaW5nXCIpXXB1YmxpYyBzdHJ1Y3QgT25ib2FyZGluZ3twdWJsaWMgc3RyaW5nIE1lc3NhZ2UgeyBnZXQ7IHNldDsgfX0gcHVibGljIGNsYXNzIFRyYWNlIHtwdWJsaWMgc3RhdGljIEV2ZW50U291cmNlT3B0aW9ucyBUZWxlbWV0cnlDcml0aWNhbE9wdGlvbiA9IG5ldyBFdmVudFNvdXJjZU9wdGlvbnMoKXtMZXZlbCA9IEV2ZW50TGV2ZWwuSW5mb3JtYXRpb25hbCwgS2V5d29yZHMgPSAoRXZlbnRLZXl3b3JkcykweDAwMDAyMDAwMDAwMDAwMDAsIFRhZ3MgPSAoRXZlbnRUYWdzKTB4MDIwMDAwMH07IHB1YmxpYyB2b2lkIFdyaXRlT25ib2FyZGluZ01lc3NhZ2Uoc3RyaW5nIG1lc3NhZ2Upe2VzLldyaXRlKFwiT25ib2FyZGluZ1NjcmlwdFwiLCBUZWxlbWV0cnlDcml0aWNhbE9wdGlvbiwgbmV3IE9uYm9hcmRpbmcge01lc3NhZ2UgPSBtZXNzYWdlfSk7fSBwcml2YXRlIHN0YXRpYyByZWFkb25seSBzdHJpbmdbXSB0ZWxlbWV0cnlUcmFpdHMgPSB7IFwiRVRXX0dST1VQXCIsIFwiezVFQ0IwQkFDLUI5MzAtNDdGNS1BOEE0LUU4MjUzNTI5RURCN31cIiB9OyBwcml2YXRlIEV2ZW50U291cmNlIGVzID0gbmV3IEV2ZW50U291cmNlKFwiTWljcm9zb2Z0LldpbmRvd3MuU2Vuc2UuQ2xpZW50Lk1hbmFnZW1lbnRcIixFdmVudFNvdXJjZVNldHRpbmdzLkV0d1NlbGZEZXNjcmliaW5nRXZlbnRGb3JtYXQsdGVsZW1ldHJ5VHJhaXRzKTt9fSc7ICRsb2dnZXIgPSBOZXctT2JqZWN0IC1UeXBlTmFtZSBTZW5zZS5UcmFjZTsgJGxvZ2dlci5Xcml0ZU9uYm9hcmRpbmdNZXNzYWdlKCclc3VjY2Vzc091dHB1dCUnKSIgPk5VTCAyPiYxCiIlUFJPR1JBTUZJTEVTJVxXaW5kb3dzIERlZmVuZGVyXE1wQ21kUnVuLmV4ZSIgLVJlbG9hZEVuZ2luZSA+TlVMIDI+JjEKCkdPVE8gQ0xFQU5VUAoKOkNMRUFOVVAKaWYgZXhpc3QgJVRNUCVcc2Vuc2VUbXAudHh0IGRlbCAlVE1QJVxzZW5zZVRtcC50eHQKRVhJVCAvQiAlZXJyb3JDb2RlJQo=="), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/models.go b/sdk/resourcemanager/security/armsecurity/models.go index 1b78ec3604e8..6c1a13dfc981 100644 --- a/sdk/resourcemanager/security/armsecurity/models.go +++ b/sdk/resourcemanager/security/armsecurity/models.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -120,6 +117,25 @@ type APICollectionProperties struct { SensitivityLabel *string } +// AccessTokenAuthentication - The environment authentication details +type AccessTokenAuthentication struct { + // REQUIRED; The authentication type + AuthenticationType *AuthenticationType + + // The access token that will be used while authenticating with the onboarded environment + AccessToken *string + + // The user name that will be used while authenticating with the onboarded environment + Username *string +} + +// GetAuthentication implements the AuthenticationClassification interface for type AccessTokenAuthentication. +func (a *AccessTokenAuthentication) GetAuthentication() *Authentication { + return &Authentication{ + AuthenticationType: a.AuthenticationType, + } +} + // ActionableRemediation - Configuration payload for PR Annotations. type ActionableRemediation struct { // Repository branch configuration for PR Annotations. @@ -197,107 +213,6 @@ func (a *ActiveConnectionsNotInAllowedRange) GetTimeWindowCustomAlertRule() *Tim } } -type AdaptiveApplicationControlGroup struct { - // REQUIRED; Represents a machines group and set of rules to be allowed running on a machine - Properties *AdaptiveApplicationControlGroupData - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Location where the resource is stored - Location *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// AdaptiveApplicationControlGroupData - Represents a machines group and set of rules to be allowed running on a machine -type AdaptiveApplicationControlGroupData struct { - // The application control policy enforcement/protection mode of the machine group - EnforcementMode *EnforcementMode - PathRecommendations []*PathRecommendation - - // The protection mode of the collection/file types. Exe/Msi/Script are used for Windows, Executable is used for Linux. - ProtectionMode *ProtectionMode - VMRecommendations []*VMRecommendation - - // READ-ONLY; The configuration status of the machines group or machine or rule - ConfigurationStatus *ConfigurationStatus - - // READ-ONLY - Issues []*AdaptiveApplicationControlIssueSummary - - // READ-ONLY; The initial recommendation status of the machine group or machine - RecommendationStatus *RecommendationStatus - - // READ-ONLY; The source type of the machine group - SourceSystem *SourceSystem -} - -// AdaptiveApplicationControlGroups - Represents a list of VM/server groups and set of rules that are Recommended by Microsoft -// Defender for Cloud to be allowed -type AdaptiveApplicationControlGroups struct { - Value []*AdaptiveApplicationControlGroup -} - -// AdaptiveApplicationControlIssueSummary - Represents a summary of the alerts of the machine group -type AdaptiveApplicationControlIssueSummary struct { - // An alert that machines within a group can have - Issue *AdaptiveApplicationControlIssue - - // The number of machines in the group that have this alert - NumberOfVMs *float32 -} - -// AdaptiveNetworkHardening - The resource whose properties describes the Adaptive Network Hardening settings for some Azure -// resource -type AdaptiveNetworkHardening struct { - // Properties of the Adaptive Network Hardening resource - Properties *AdaptiveNetworkHardeningProperties - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -type AdaptiveNetworkHardeningEnforceRequest struct { - // REQUIRED; The Azure resource IDs of the effective network security groups that will be updated with the created security - // rules from the Adaptive Network Hardening rules - NetworkSecurityGroups []*string - - // REQUIRED; The rules to enforce - Rules []*Rule -} - -// AdaptiveNetworkHardeningProperties - Adaptive Network Hardening resource properties -type AdaptiveNetworkHardeningProperties struct { - // The Network Security Groups effective on the network interfaces of the protected resource - EffectiveNetworkSecurityGroups []*EffectiveNetworkSecurityGroups - - // The security rules which are recommended to be effective on the VM - Rules []*Rule - - // The UTC time on which the rules were calculated - RulesCalculationTime *time.Time -} - -// AdaptiveNetworkHardeningsList - Response for ListAdaptiveNetworkHardenings API service call -type AdaptiveNetworkHardeningsList struct { - // The URL to get the next set of results - NextLink *string - - // A list of Adaptive Network Hardenings resources - Value []*AdaptiveNetworkHardening -} - // AdditionalData - Details of the sub-assessment type AdditionalData struct { // REQUIRED; Sub-assessment resource type @@ -340,6 +255,25 @@ type AdvancedThreatProtectionSetting struct { Type *string } +// AgentlessConfiguration - Details about Agentless configuration. +type AgentlessConfiguration struct { + // AutoDiscovery states. + AgentlessAutoDiscovery *AutoDiscovery + + // Agentless Enablement states. + AgentlessEnabled *AgentlessEnablement + + // Gets or sets the inventory list for inclusion or exclusion from Agentless. Will be ignored if agentless auto-discovery + // is enabled. + InventoryList []*InventoryList + + // Types for inventory list. + InventoryListType *InventoryListKind + + // Gets or sets the scanners for the connector. + Scanners []*string +} + // Alert - Security alert type Alert struct { // describes security alert properties. @@ -1252,6 +1186,18 @@ type AssessmentStatusResponse struct { StatusChangeDate *time.Time } +// AssignedAssessmentItem - Describe the properties of a security assessment object reference (by key) +type AssignedAssessmentItem struct { + // Unique key to a security assessment object + AssessmentKey *string +} + +// AssignedStandardItem - Describe the properties of a of a standard assignments object reference +type AssignedStandardItem struct { + // Full resourceId of the Microsoft.Security/standard object + ID *string +} + // AtaExternalSecuritySolution - Represents an ATA security solution which sends logs to an OMS workspace type AtaExternalSecuritySolution struct { // REQUIRED; The kind of the external solution @@ -1296,6 +1242,24 @@ type AtaSolutionProperties struct { Workspace *ConnectedWorkspace } +// AttestationEvidence - Describe the properties of a assignment attestation +type AttestationEvidence struct { + // The description of the evidence + Description *string + + // The source url of the evidence + SourceURL *string +} + +// Authentication - The environment authentication details +type Authentication struct { + // REQUIRED; The authentication type + AuthenticationType *AuthenticationType +} + +// GetAuthentication implements the AuthenticationClassification interface for type Authentication. +func (a *Authentication) GetAuthentication() *Authentication { return a } + // AuthenticationDetailsProperties - Settings for cloud authentication management type AuthenticationDetailsProperties struct { // REQUIRED; Connect to your cloud account, for AWS use either account credentials or role-based authentication. For GCP use @@ -1434,7 +1398,7 @@ func (a *AutomationActionLogicApp) GetAutomationAction() *AutomationAction { } } -// AutomationActionWorkspace - The�Log�Analytics�Workspace�to�which�event data will be exported. Security alerts data will +// AutomationActionWorkspace - The Log Analytics Workspace to which event data will be exported. Security alerts data will // reside in the 'SecurityAlert' table and the assessments data will reside in the 'SecurityRecommendation' // table (under the 'Security'/'SecurityCenterFree' solutions). Note that in order to view the data in the workspace, the // Security Center Log Analytics free/standard solution needs to be enabled on that @@ -1722,16 +1686,16 @@ type AzureDevOpsOrgProperties struct { // state is not applicable to the current endpoint. OnboardingState *OnboardingState - // The provisioning state of the resource. + // READ-ONLY; The provisioning state of the resource. // Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - Provisioning // canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion // successful. DeletionFailure - Deletion failure. ProvisioningState *DevOpsProvisioningState - // READ-ONLY; Gets or sets resource status message. + // READ-ONLY; Gets the resource status message. ProvisioningStatusMessage *string - // READ-ONLY; Gets or sets time when resource was last checked. + // READ-ONLY; Gets the time when resource was last checked. ProvisioningStatusUpdateTimeUTC *time.Time } @@ -1797,19 +1761,19 @@ type AzureDevOpsProjectProperties struct { // Gets or sets parent Azure DevOps Organization name. ParentOrgName *string - // The provisioning state of the resource. + // READ-ONLY; Gets or sets Azure DevOps Project id. + ProjectID *string + + // READ-ONLY; The provisioning state of the resource. // Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - Provisioning // canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion // successful. DeletionFailure - Deletion failure. ProvisioningState *DevOpsProvisioningState - // READ-ONLY; Gets or sets Azure DevOps Project id. - ProjectID *string - - // READ-ONLY; Gets or sets resource status message. + // READ-ONLY; Gets the resource status message. ProvisioningStatusMessage *string - // READ-ONLY; Gets or sets time when resource was last checked. + // READ-ONLY; Gets the time when resource was last checked. ProvisioningStatusUpdateTimeUTC *time.Time } @@ -1858,16 +1822,16 @@ type AzureDevOpsRepositoryProperties struct { // Gets or sets parent Azure DevOps Project name. ParentProjectName *string - // The provisioning state of the resource. + // READ-ONLY; The provisioning state of the resource. // Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - Provisioning // canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion // successful. DeletionFailure - Deletion failure. ProvisioningState *DevOpsProvisioningState - // READ-ONLY; Gets or sets resource status message. + // READ-ONLY; Gets the resource status message. ProvisioningStatusMessage *string - // READ-ONLY; Gets or sets time when resource was last checked. + // READ-ONLY; Gets the time when resource was last checked. ProvisioningStatusUpdateTimeUTC *time.Time // READ-ONLY; Gets or sets Azure DevOps Repository id. @@ -2009,6 +1973,24 @@ type BenchmarkReference struct { Reference *string } +// BlobsScanSummary - A summary of the scan results of the blobs that were scanned. +type BlobsScanSummary struct { + // The number of failed blob scans. + FailedBlobsCount *int64 + + // The number of malicious blobs that were detected during the scan. + MaliciousBlobsCount *int64 + + // The number of gigabytes of data that were scanned. + ScannedBlobsInGB *float64 + + // The number of blobs that were skipped. + SkippedBlobsCount *int64 + + // The total number of blobs that were scanned. + TotalBlobsScanned *int64 +} + // BuiltInInfoType - Pre-configured sensitive information type type BuiltInInfoType struct { // Id of the info type @@ -2560,6 +2542,23 @@ func (c *CspmMonitorAzureDevOpsOffering) GetCloudOffering() *CloudOffering { } } +// CspmMonitorDockerHubOffering - The CSPM (Cloud security posture management) monitoring for Docker Hub offering +type CspmMonitorDockerHubOffering struct { + // REQUIRED; The type of the security offering. + OfferingType *OfferingType + + // READ-ONLY; The offering description. + Description *string +} + +// GetCloudOffering implements the CloudOfferingClassification interface for type CspmMonitorDockerHubOffering. +func (c *CspmMonitorDockerHubOffering) GetCloudOffering() *CloudOffering { + return &CloudOffering{ + Description: c.Description, + OfferingType: c.OfferingType, + } +} + // CspmMonitorGcpOffering - The CSPM monitoring for GCP offering type CspmMonitorGcpOffering struct { // REQUIRED; The type of the security offering. @@ -2623,6 +2622,23 @@ func (c *CspmMonitorGithubOffering) GetCloudOffering() *CloudOffering { } } +// CspmMonitorJFrogOffering - The CSPM (Cloud security posture management) monitoring for JFrog Artifactory offering +type CspmMonitorJFrogOffering struct { + // REQUIRED; The type of the security offering. + OfferingType *OfferingType + + // READ-ONLY; The offering description. + Description *string +} + +// GetCloudOffering implements the CloudOfferingClassification interface for type CspmMonitorJFrogOffering. +func (c *CspmMonitorJFrogOffering) GetCloudOffering() *CloudOffering { + return &CloudOffering{ + Description: c.Description, + OfferingType: c.OfferingType, + } +} + // CustomAlertRule - A custom alert rule. type CustomAlertRule struct { // REQUIRED; Status of the custom alert. @@ -2776,6 +2792,60 @@ type CustomEntityStoreAssignmentsListResult struct { Value []*CustomEntityStoreAssignment } +// CustomRecommendation - Custom Recommendation +type CustomRecommendation struct { + // describes Custom Recommendation properties. + Properties *CustomRecommendationProperties + + // READ-ONLY; Resource Id + ID *string + + // READ-ONLY; Resource name + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; Resource type + Type *string +} + +// CustomRecommendationProperties - describes the Custom Recommendation properties +type CustomRecommendationProperties struct { + // List of all standard supported clouds. + CloudProviders []*RecommendationSupportedClouds + + // The description to relate to the assessments generated by this Recommendation. + Description *string + + // The display name of the assessments generated by this Recommendation. + DisplayName *string + + // KQL query representing the Recommendation results required. + Query *string + + // The remediation description to relate to the assessments generated by this Recommendation. + RemediationDescription *string + + // The severity to relate to the assessments generated by this Recommendation. + SecurityIssue *SecurityIssue + + // The severity to relate to the assessments generated by this Recommendation. + Severity *SeverityEnum + + // READ-ONLY; The assessment metadata key used when an assessment is generated for this Recommendation. + AssessmentKey *string +} + +// CustomRecommendationsList - A list of Custom Recommendations +type CustomRecommendationsList struct { + // READ-ONLY; Collection of Custom Recommendations + Value []*CustomRecommendation + + // The link used to get the next page of operations. + NextLink *string +} + // DataExportSettingProperties - The data export setting properties type DataExportSettingProperties struct { // REQUIRED; Is the data export setting enabled @@ -2917,6 +2987,23 @@ type DefenderCspmAwsOfferingVMScanners struct { Enabled *bool } +// DefenderCspmDockerHubOffering - The Defender for CSPM Docker Hub offering configurations +type DefenderCspmDockerHubOffering struct { + // REQUIRED; The type of the security offering. + OfferingType *OfferingType + + // READ-ONLY; The offering description. + Description *string +} + +// GetCloudOffering implements the CloudOfferingClassification interface for type DefenderCspmDockerHubOffering. +func (d *DefenderCspmDockerHubOffering) GetCloudOffering() *CloudOffering { + return &CloudOffering{ + Description: d.Description, + OfferingType: d.OfferingType, + } +} + // DefenderCspmGcpOffering - The CSPM P1 for GCP offering type DefenderCspmGcpOffering struct { // REQUIRED; The type of the security offering. @@ -3006,6 +3093,32 @@ type DefenderCspmGcpOfferingVMScanners struct { Enabled *bool } +// DefenderCspmJFrogOffering - The CSPM P1 for JFrog Artifactory offering +type DefenderCspmJFrogOffering struct { + // REQUIRED; The type of the security offering. + OfferingType *OfferingType + + // The Microsoft Defender Container image assessment configuration + MdcContainersImageAssessment *DefenderCspmJFrogOfferingMdcContainersImageAssessment + + // READ-ONLY; The offering description. + Description *string +} + +// GetCloudOffering implements the CloudOfferingClassification interface for type DefenderCspmJFrogOffering. +func (d *DefenderCspmJFrogOffering) GetCloudOffering() *CloudOffering { + return &CloudOffering{ + Description: d.Description, + OfferingType: d.OfferingType, + } +} + +// DefenderCspmJFrogOfferingMdcContainersImageAssessment - The Microsoft Defender Container image assessment configuration +type DefenderCspmJFrogOfferingMdcContainersImageAssessment struct { + // Is Microsoft Defender container image assessment enabled + Enabled *bool +} + // DefenderFoDatabasesAwsOffering - The Defender for Databases AWS offering type DefenderFoDatabasesAwsOffering struct { // REQUIRED; The type of the security offering. @@ -3170,6 +3283,23 @@ type DefenderForContainersAwsOfferingVMScanners struct { Enabled *bool } +// DefenderForContainersDockerHubOffering - The Defender for containers Docker Hub offering configurations +type DefenderForContainersDockerHubOffering struct { + // REQUIRED; The type of the security offering. + OfferingType *OfferingType + + // READ-ONLY; The offering description. + Description *string +} + +// GetCloudOffering implements the CloudOfferingClassification interface for type DefenderForContainersDockerHubOffering. +func (d *DefenderForContainersDockerHubOffering) GetCloudOffering() *CloudOffering { + return &CloudOffering{ + Description: d.Description, + OfferingType: d.OfferingType, + } +} + // DefenderForContainersGcpOffering - The containers GCP offering type DefenderForContainersGcpOffering struct { // REQUIRED; The type of the security offering. @@ -3263,6 +3393,23 @@ type DefenderForContainersGcpOfferingVMScanners struct { Enabled *bool } +// DefenderForContainersJFrogOffering - The Defender for Containers for JFrog Artifactory offering +type DefenderForContainersJFrogOffering struct { + // REQUIRED; The type of the security offering. + OfferingType *OfferingType + + // READ-ONLY; The offering description. + Description *string +} + +// GetCloudOffering implements the CloudOfferingClassification interface for type DefenderForContainersJFrogOffering. +func (d *DefenderForContainersJFrogOffering) GetCloudOffering() *CloudOffering { + return &CloudOffering{ + Description: d.Description, + OfferingType: d.OfferingType, + } +} + // DefenderForDatabasesGcpOffering - The Defender for Databases GCP offering configurations type DefenderForDatabasesGcpOffering struct { // REQUIRED; The type of the security offering. @@ -3563,6 +3710,15 @@ func (d *DenylistCustomAlertRule) GetListCustomAlertRule() *ListCustomAlertRule } } +// DevOpsCapability - Details about DevOps capability. +type DevOpsCapability struct { + // READ-ONLY; Gets the name of the DevOps capability. + Name *string + + // READ-ONLY; Gets the value of the DevOps capability. + Value *string +} + // DevOpsConfiguration - DevOps Configuration resource. type DevOpsConfiguration struct { // DevOps Configuration properties. @@ -3592,25 +3748,31 @@ type DevOpsConfigurationListResponse struct { // DevOpsConfigurationProperties - DevOps Configuration properties. type DevOpsConfigurationProperties struct { + // Details about Agentless configuration. + AgentlessConfiguration *AgentlessConfiguration + // Authorization payload. Authorization *Authorization // AutoDiscovery states. AutoDiscovery *AutoDiscovery - // The provisioning state of the resource. + // List of top-level inventory to select when AutoDiscovery is disabled. This field is ignored when AutoDiscovery is enabled. + TopLevelInventoryList []*string + + // READ-ONLY; List of capabilities assigned to the DevOps configuration during the discovery process. + Capabilities []*DevOpsCapability + + // READ-ONLY; The provisioning state of the resource. // Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - Provisioning // canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion // successful. DeletionFailure - Deletion failure. ProvisioningState *DevOpsProvisioningState - // List of top-level inventory to select when AutoDiscovery is disabled. This field is ignored when AutoDiscovery is enabled. - TopLevelInventoryList []*string - - // READ-ONLY; Gets or sets resource status message. + // READ-ONLY; Gets the resource status message. ProvisioningStatusMessage *string - // READ-ONLY; Gets or sets time when resource was last checked. + // READ-ONLY; Gets the time when resource was last checked. ProvisioningStatusUpdateTimeUTC *time.Time } @@ -3750,21 +3912,31 @@ type DiscoveredSecuritySolutionProperties struct { SecurityFamily *SecurityFamily } +// DockerHubEnvironmentData - The Docker Hub connector environment data +type DockerHubEnvironmentData struct { + // REQUIRED; The type of the environment data. + EnvironmentType *EnvironmentType + + // The Docker Hub organization authentication details + Authentication AuthenticationClassification + + // Scan interval in hours (value should be between 1-hour to 24-hours) + ScanInterval *int64 +} + +// GetEnvironmentData implements the EnvironmentDataClassification interface for type DockerHubEnvironmentData. +func (d *DockerHubEnvironmentData) GetEnvironmentData() *EnvironmentData { + return &EnvironmentData{ + EnvironmentType: d.EnvironmentType, + } +} + // ETag - Entity tag is used for comparing two or more entities from the same requested resource. type ETag struct { // Entity tag is used for comparing two or more entities from the same requested resource. Etag *string } -// EffectiveNetworkSecurityGroups - Describes the Network Security Groups effective on a network interface -type EffectiveNetworkSecurityGroups struct { - // The Azure resource ID of the network interface - NetworkInterface *string - - // The Network Security Groups effective on the network interface - NetworkSecurityGroups []*string -} - // EnvironmentData - The security connector environment data. type EnvironmentData struct { // REQUIRED; The type of the environment data. @@ -3838,6 +4010,24 @@ type ErrorDetailAutoGenerated struct { Target *string } +// ErrorDetailAutoGenerated2 - The error detail. +type ErrorDetailAutoGenerated2 struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo + + // READ-ONLY; The error code. + Code *string + + // READ-ONLY; The error details. + Details []*ErrorDetailAutoGenerated2 + + // READ-ONLY; The error message. + Message *string + + // READ-ONLY; The error target. + Target *string +} + // ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. // (This also follows the OData error response format.). type ErrorResponse struct { @@ -3852,6 +4042,13 @@ type ErrorResponseAutoGenerated struct { Error *ErrorDetailAutoGenerated } +// ErrorResponseAutoGenerated2 - Common error response for all Azure Resource Manager APIs to return error details for failed +// operations. (This also follows the OData error response format.). +type ErrorResponseAutoGenerated2 struct { + // The error object. + Error *ErrorDetailAutoGenerated2 +} + // ExecuteGovernanceRuleParams - Governance rule execution parameters type ExecuteGovernanceRuleParams struct { // Describe if governance rule should be override @@ -3864,25 +4061,55 @@ type Extension struct { IsEnabled *IsEnabled // REQUIRED; The extension name. Supported values are: - // AgentlessDiscoveryForKubernetes - API-based discovery of information about Kubernetes cluster architecture, workload objects, - // and setup. Required for Kubernetes inventory, identity and network - // exposure detection, attack path analysis and risk hunting as part of the cloud security explorer. Available for CloudPosture - // plan. + // AgentlessDiscoveryForKubernetes - Provides zero footprint, API-based discovery of Kubernetes clusters, their configurations + // and deployments. The collected data is used to create a contextualized + // security graph for Kubernetes clusters, provide risk hunting capabilities, and visualize risks and threats to Kubernetes + // environments and workloads. + // Available for CloudPosture plan and Containers plan. // OnUploadMalwareScanning - Limits the GB to be scanned per month for each storage account within the subscription. Once // this limit reached on a given storage account, Blobs won't be scanned during - // current calendar month. Available for StorageAccounts plan. + // current calendar month. + // Available for StorageAccounts plan (DefenderForStorageV2 sub plans). // SensitiveDataDiscovery - Sensitive data discovery identifies Blob storage container with sensitive data such as credentials, // credit cards, and more, to help prioritize and investigate security events. - // Available for StorageAccounts and CloudPosture plans. + // Available for StorageAccounts plan (DefenderForStorageV2 sub plan) and CloudPosture plan. // ContainerRegistriesVulnerabilityAssessments - Provides vulnerability management for images stored in your container registries. - // Available for CloudPosture and Containers plans. + // Available for CloudPosture plan and Containers plan. + // MdeDesignatedSubscription - Direct onboarding is a seamless integration between Defender for Endpoint and Defender for + // Cloud that doesn’t require extra software deployment on your servers. The + // onboarded resources will be presented under a designated Azure Subscription you configure + // Available for VirtualMachines plan (P1 and P2 sub plans). + // AgentlessVmScanning - Scans your machines for installed software, vulnerabilities, malware and secret scanning without + // relying on agents or impacting machine performance. Learn more here + // https://learn.microsoft.com/en-us/azure/defender-for-cloud/concept-agentless-data-collection. + // Available for CloudPosture plan, VirtualMachines plan (P2 sub plan) and Containers plan. + // EntraPermissionsManagement - Permissions Management provides Cloud Infrastructure Entitlement Management (CIEM) capabilities + // that helps organizations to manage and control user access and entitlements + // in their cloud infrastructure - important attack vector for cloud environments. + // Permissions Management analyzes all permissions and active usage, and suggests recommendations to reduce permissions to + // enforce the principle of least privilege. Learn more here + // https://learn.microsoft.com/en-us/azure/defender-for-cloud/permissions-management. + // Available for CloudPosture plan. + // FileIntegrityMonitoring - File integrity monitoring (FIM), examines operating system files. + // Windows registries, Linux system files, in real time, for changes that might indicate an attack. + // Available for VirtualMachines plan (P2 sub plan). + // ContainerSensor - The sensor is based on IG and provides a rich threat detection suite for Kubernetes clusters, nodes, + // and workloads, powered by Microsoft leading threat intelligence, provides mapping + // to MITRE ATT&CK framework. + // Available for Containers plan. + // AIPromptEvidence - Exposes the prompts passed between the user and the AI model as alert evidence. This helps classify + // and triage the alerts with relevant user context. The prompt snippets will + // include only segments of the user prompt or model response that were deemed suspicious and relevant for security classifications. + // The prompt evidence will be available through Defender portal as part + // of each alert. + // Available for AI plan. Name *string // Property values associated with the extension. AdditionalExtensionProperties map[string]any // READ-ONLY; Optional. A status describing the success/failure of the extension's enablement/disablement operation. - OperationStatus *OperationStatusAutoGenerated + OperationStatus *OperationStatus } // ExternalSecuritySolution - Represents a security solution external to Microsoft Defender for Cloud which sends information @@ -4287,22 +4514,22 @@ type GitHubOwnerProperties struct { // state is not applicable to the current endpoint. OnboardingState *OnboardingState - // The provisioning state of the resource. - // Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - Provisioning - // canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion - // successful. DeletionFailure - Deletion failure. - ProvisioningState *DevOpsProvisioningState - // READ-ONLY; Gets or sets internal GitHub id. GitHubInternalID *string // READ-ONLY; Gets or sets GitHub Owner url. OwnerURL *string - // READ-ONLY; Gets or sets resource status message. + // READ-ONLY; The provisioning state of the resource. + // Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - Provisioning + // canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion + // successful. DeletionFailure - Deletion failure. + ProvisioningState *DevOpsProvisioningState + + // READ-ONLY; Gets the resource status message. ProvisioningStatusMessage *string - // READ-ONLY; Gets or sets time when resource was last checked. + // READ-ONLY; Gets the time when resource was last checked. ProvisioningStatusUpdateTimeUTC *time.Time } @@ -4345,16 +4572,16 @@ type GitHubRepositoryProperties struct { // Gets or sets parent GitHub Owner name. ParentOwnerName *string - // The provisioning state of the resource. + // READ-ONLY; The provisioning state of the resource. // Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - Provisioning // canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion // successful. DeletionFailure - Deletion failure. ProvisioningState *DevOpsProvisioningState - // READ-ONLY; Gets or sets resource status message. + // READ-ONLY; Gets the resource status message. ProvisioningStatusMessage *string - // READ-ONLY; Gets or sets time when resource was last checked. + // READ-ONLY; Gets the time when resource was last checked. ProvisioningStatusUpdateTimeUTC *time.Time // READ-ONLY; Gets or sets GitHub Full Name. Repository name, prefixed with Owner name. Eg: "my-org/new-repo-1". @@ -4417,12 +4644,6 @@ type GitLabGroupProperties struct { // state is not applicable to the current endpoint. OnboardingState *OnboardingState - // The provisioning state of the resource. - // Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - Provisioning - // canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion - // successful. DeletionFailure - Deletion failure. - ProvisioningState *DevOpsProvisioningState - // READ-ONLY; Gets or sets the human readable fully-qualified name of the Group object. // This contains the entire namespace hierarchy as seen on GitLab UI where namespaces are separated by the '/' character. FullyQualifiedFriendlyName *string @@ -4431,10 +4652,16 @@ type GitLabGroupProperties struct { // This contains the entire namespace hierarchy where namespaces are separated by the '$' character. FullyQualifiedName *string - // READ-ONLY; Gets or sets resource status message. + // READ-ONLY; The provisioning state of the resource. + // Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - Provisioning + // canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion + // successful. DeletionFailure - Deletion failure. + ProvisioningState *DevOpsProvisioningState + + // READ-ONLY; Gets the resource status message. ProvisioningStatusMessage *string - // READ-ONLY; Gets or sets time when resource was last checked. + // READ-ONLY; Gets the time when resource was last checked. ProvisioningStatusUpdateTimeUTC *time.Time // READ-ONLY; Gets or sets the url of the GitLab Group. @@ -4477,12 +4704,6 @@ type GitLabProjectProperties struct { // state is not applicable to the current endpoint. OnboardingState *OnboardingState - // The provisioning state of the resource. - // Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - Provisioning - // canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion - // successful. DeletionFailure - Deletion failure. - ProvisioningState *DevOpsProvisioningState - // READ-ONLY; Gets or sets the human readable fully-qualified name of the Project object. // This contains the entire namespace hierarchy as seen on GitLab UI where entities are separated by the '/' character. FullyQualifiedFriendlyName *string @@ -4495,10 +4716,16 @@ type GitLabProjectProperties struct { // This contains the entire hierarchy where namespaces are separated by the '$' character. FullyQualifiedParentGroupName *string - // READ-ONLY; Gets or sets resource status message. + // READ-ONLY; The provisioning state of the resource. + // Pending - Provisioning pending. Failed - Provisioning failed. Succeeded - Successful provisioning. Canceled - Provisioning + // canceled. PendingDeletion - Deletion pending. DeletionSuccess - Deletion + // successful. DeletionFailure - Deletion failure. + ProvisioningState *DevOpsProvisioningState + + // READ-ONLY; Gets the resource status message. ProvisioningStatusMessage *string - // READ-ONLY; Gets or sets time when resource was last checked. + // READ-ONLY; Gets the time when resource was last checked. ProvisioningStatusUpdateTimeUTC *time.Time // READ-ONLY; Gets or sets the url of the GitLab Project. @@ -4970,7 +5197,8 @@ type HybridComputeSettingsProperties struct { // Identity for the resource. type Identity struct { - // The identity type. + // CONSTANT; The identity type. + // Field has constant value "SystemAssigned", any specified value is ignored. Type *string // READ-ONLY; The principal ID of resource identity. @@ -5070,6 +5298,15 @@ type InformationType struct { RecommendedLabelID *string } +// InventoryList - Model for inventory to be included or excluded from Agentless. +type InventoryList struct { + // Types for inventory kind. + InventoryKind *InventoryKind + + // Gets or sets the value for inventory type. + Value *string +} + // IoTSecurityAggregatedAlert - Security Solution Aggregated Alert information type IoTSecurityAggregatedAlert struct { // IoT Security solution aggregated alert details. @@ -5403,6 +5640,22 @@ type Issue struct { SecurityValues []*string } +// JFrogEnvironmentData - The JFrog Artifactory connector environment data +type JFrogEnvironmentData struct { + // REQUIRED; The type of the environment data. + EnvironmentType *EnvironmentType + + // Scan interval in hours (value should be between 1-hour to 24-hours) + ScanInterval *int32 +} + +// GetEnvironmentData implements the EnvironmentDataClassification interface for type JFrogEnvironmentData. +func (j *JFrogEnvironmentData) GetEnvironmentData() *EnvironmentData { + return &EnvironmentData{ + EnvironmentType: j.EnvironmentType, + } +} + type JitNetworkAccessPoliciesList struct { Value []*JitNetworkAccessPolicy @@ -5675,6 +5928,31 @@ func (l *LogAnalyticsIdentifier) GetResourceIdentifier() *ResourceIdentifier { } } +// MalwareScan - Describes the state of a malware scan operation. +type MalwareScan struct { + Properties *MalwareScanProperties +} + +type MalwareScanProperties struct { + // The time at which the scan has ended. Only available for a scan which has terminated. + ScanEndTime *string + + // The identifier of the scan. + ScanID *string + + // The time at which the scan had been initiated. + ScanStartTime *string + + // A status code of the scan operation. + ScanStatus *string + + // A description of the status of the scan. + ScanStatusMessage *string + + // A summary of the scan results. + ScanSummary *ScanSummary +} + // MalwareScanningProperties - Properties of Malware Scanning. type MalwareScanningProperties struct { // Properties of On Upload malware scanning. @@ -5684,7 +5962,7 @@ type MalwareScanningProperties struct { ScanResultsEventGridTopicResourceID *string // READ-ONLY; Upon failure or partial success. Additional data describing Malware Scanning enable/disable operation. - OperationStatus *OperationStatus + OperationStatus *OperationStatusAutoGenerated } // MdeOnboardingData - The resource of the configuration or data needed to onboard the machine to MDE @@ -6010,47 +6288,60 @@ func (o *OnPremiseSQLResourceDetails) GetResourceDetails() *ResourceDetails { // OnUploadProperties - Properties of On Upload malware scanning. type OnUploadProperties struct { - // Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. + // Defines the max GB to be scanned per Month. Set to -1 if no capping is needed. If not specified, the default value is -1. CapGBPerMonth *int32 // Indicates whether On Upload malware scanning should be enabled. IsEnabled *bool } -// Operation - Possible operation in the REST API of Microsoft.Security +// Operation - Details of a REST API operation, returned from the Resource Provider Operations API type Operation struct { - // Security operation display + // Localized display information for this particular operation. Display *OperationDisplay - // READ-ONLY; Name of the operation + // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + ActionType *ActionType + + // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane + // operations. + IsDataAction *bool + + // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", + // "Microsoft.Compute/virtualMachines/capture/action" Name *string - // READ-ONLY; Where the operation is originated - Origin *string + // READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default + // value is "user,system" + Origin *Origin } -// OperationDisplay - Security operation display +// OperationDisplay - Localized display information for this particular operation. type OperationDisplay struct { - // READ-ONLY; The description of the operation. + // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. Description *string - // READ-ONLY; The display name of the security operation. + // READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual + // Machine", "Restart Virtual Machine". Operation *string - // READ-ONLY; The resource provider for the operation. + // READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft + // Compute". Provider *string - // READ-ONLY; The display name of the resource the operation applies to. + // READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job + // Schedule Collections". Resource *string } -// OperationList - List of possible operations for Microsoft.Security resource provider -type OperationList struct { - // List of Security operations - Value []*Operation - - // READ-ONLY; The URI to fetch the next page. +// OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to +// get the next set of results. +type OperationListResult struct { + // READ-ONLY; URL to get the next set of operation list results (if there are any). NextLink *string + + // READ-ONLY; List of operations supported by the resource provider + Value []*Operation } // OperationResultAutoGenerated - Long run operation status of governance rule over a given scope @@ -6059,19 +6350,19 @@ type OperationResultAutoGenerated struct { Status *OperationResult } -// OperationStatus - A status describing the success/failure of the enablement/disablement operation. +// OperationStatus - A status describing the success/failure of the extension's enablement/disablement operation. type OperationStatus struct { // The operation status code. - Code *string + Code *Code // Additional information regarding the success/failure of the operation. Message *string } -// OperationStatusAutoGenerated - A status describing the success/failure of the extension's enablement/disablement operation. +// OperationStatusAutoGenerated - A status describing the success/failure of the enablement/disablement operation. type OperationStatusAutoGenerated struct { // The operation status code. - Code *Code + Code *string // Additional information regarding the success/failure of the operation. Message *string @@ -6086,7 +6377,7 @@ type OperationStatusResult struct { EndTime *time.Time // If present, details of the operation error. - Error *ErrorDetailAutoGenerated + Error *ErrorDetailAutoGenerated2 // Fully qualified ID for the async operation. ID *string @@ -6125,30 +6416,10 @@ type OperatorResource struct { Type *string } -// PathRecommendation - Represents a path that is recommended to be allowed and its properties -type PathRecommendation struct { - // The recommendation action of the machine or rule - Action *RecommendationAction - - // Whether the application is commonly run on the machine - Common *bool - - // The configuration status of the machines group or machine or rule - ConfigurationStatus *ConfigurationStatus - - // The type of the file (for Linux files - Executable is used) - FileType *FileType - - // The full path of the file, or an identifier of the application - Path *string - - // Represents the publisher information of a process/rule - PublisherInfo *PublisherInfo - - // The type of IoT Security recommendation. - Type *RecommendationType - UserSids []*string - Usernames []*UserRecommendation +// PartialAssessmentProperties - Describes properties of an assessment as related to the standard +type PartialAssessmentProperties struct { + // The assessment key + AssessmentKey *string } // Pricing - Microsoft Defender for Cloud is provided in two pricing tiers: free and standard. The standard tier offers advanced @@ -6280,22 +6551,6 @@ func (p *ProcessNotAllowed) GetListCustomAlertRule() *ListCustomAlertRule { } } -// ProtectionMode - The protection mode of the collection/file types. Exe/Msi/Script are used for Windows, Executable is used -// for Linux. -type ProtectionMode struct { - // The application control policy enforcement/protection mode of the machine group - Exe *EnforcementMode - - // The application control policy enforcement/protection mode of the machine group - Executable *EnforcementMode - - // The application control policy enforcement/protection mode of the machine group - Msi *EnforcementMode - - // The application control policy enforcement/protection mode of the machine group - Script *EnforcementMode -} - // ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a // location type ProxyResource struct { @@ -6319,22 +6574,6 @@ type ProxyServerProperties struct { Port *string } -// PublisherInfo - Represents the publisher information of a process/rule -type PublisherInfo struct { - // The "OriginalName" field taken from the file's version resource - BinaryName *string - - // The product name taken from the file's version resource - ProductName *string - - // The Subject field of the x.509 certificate used to sign the code, using the following fields - O = Organization, L = Locality, - // S = State or Province, and C = Country - PublisherName *string - - // The binary file version taken from the file's version resource - Version *string -} - // QueryCheck - The rule query details. type QueryCheck struct { // Column names of expected result. @@ -6591,27 +6830,27 @@ type Resource struct { // ResourceAutoGenerated - Common fields that are returned in the response for all Azure Resource Manager resources type ResourceAutoGenerated struct { - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" ID *string // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } // ResourceAutoGenerated2 - Common fields that are returned in the response for all Azure Resource Manager resources type ResourceAutoGenerated2 struct { - // READ-ONLY; Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string // READ-ONLY; The name of the resource Name *string - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } @@ -6647,25 +6886,6 @@ type ResourceIdentifier struct { // GetResourceIdentifier implements the ResourceIdentifierClassification interface for type ResourceIdentifier. func (r *ResourceIdentifier) GetResourceIdentifier() *ResourceIdentifier { return r } -// Rule - Describes remote addresses that is recommended to communicate with the Azure resource on some (Protocol, Port, Direction). -// All other remote addresses are recommended to be blocked -type Rule struct { - // The rule's destination port - DestinationPort *int32 - - // The rule's direction - Direction *Direction - - // The remote IP addresses that should be able to communicate with the Azure resource on the rule's destination port and protocol - IPAddresses []*string - - // The name of the rule - Name *string - - // The rule's transport protocols - Protocols []*TransportProtocol -} - // RuleResults - Rule results. type RuleResults struct { // Rule results properties. @@ -6838,6 +7058,15 @@ type ScanResults struct { Value []*ScanResult } +// ScanSummary - A summary of the scan results. +type ScanSummary struct { + // A summary of the scan results of the blobs that were scanned. + Blobs *BlobsScanSummary + + // The estimated cost of the scan. Only available for a scan which has terminated. + EstimatedScanCostUSD *float64 +} + // Scans - A list of vulnerability assessment scan records. type Scans struct { // List of vulnerability assessment scan records. @@ -7017,7 +7246,7 @@ type SensitiveDataDiscoveryProperties struct { IsEnabled *bool // READ-ONLY; Upon failure or partial success. Additional data describing Sensitive Data Discovery enable/disable operation. - OperationStatus *OperationStatus + OperationStatus *OperationStatusAutoGenerated } // SensitivityLabel - The sensitivity label. @@ -7309,6 +7538,162 @@ type SolutionsReferenceDataProperties struct { Template *string } +// Standard - Security Standard on a resource +type Standard struct { + // Properties of a security standard + Properties *StandardProperties + + // READ-ONLY; Resource Id + ID *string + + // READ-ONLY; Resource name + Name *string + + // READ-ONLY; Resource type + Type *string +} + +// StandardAssignment - Security Assignment on a resource group over a given scope +type StandardAssignment struct { + // Properties of a standard assignments assignment + Properties *StandardAssignmentProperties + + // READ-ONLY; Resource Id + ID *string + + // READ-ONLY; Resource name + Name *string + + // READ-ONLY; Resource type + Type *string +} + +// StandardAssignmentMetadata - The standard assignment metadata +type StandardAssignmentMetadata struct { + // READ-ONLY; Standard assignment Created by object id (GUID) + CreatedBy *string + + // READ-ONLY; Standard assignment creation date + CreatedOn *time.Time + + // READ-ONLY; Standard assignment last updated by object id (GUID) + LastUpdatedBy *string + + // READ-ONLY; Standard assignment last update date + LastUpdatedOn *time.Time +} + +// StandardAssignmentProperties - Describes the properties of a standardAssignment +type StandardAssignmentProperties struct { + // Standard item with key as applied to this standard assignment over the given scope + AssignedStandard *AssignedStandardItem + + // Additional data about assignment that has Attest effect + AttestationData *StandardAssignmentPropertiesAttestationData + + // Description of the standardAssignment + Description *string + + // Display name of the standardAssignment + DisplayName *string + + // Expected effect of this assignment (Audit/Exempt/Attest) + Effect *Effect + + // Excluded scopes, filter out the descendants of the scope (on management scopes) + ExcludedScopes []*string + + // Additional data about assignment that has Exempt effect + ExemptionData *StandardAssignmentPropertiesExemptionData + + // Expiration date of this assignment as a full ISO date + ExpiresOn *time.Time + + // The standard assignment metadata. + Metadata *StandardAssignmentMetadata +} + +// StandardAssignmentPropertiesAttestationData - Additional data about assignment that has Attest effect +type StandardAssignmentPropertiesAttestationData struct { + // Component item with key as applied to this standard assignment over the given scope + AssignedAssessment *AssignedAssessmentItem + + // Attest category of this assignment + ComplianceState *AttestationComplianceState + + // Array of links to attestation evidence + Evidence []*AttestationEvidence + + // READ-ONLY; Attestation compliance date + ComplianceDate *time.Time +} + +// StandardAssignmentPropertiesExemptionData - Additional data about assignment that has Exempt effect +type StandardAssignmentPropertiesExemptionData struct { + // Component item with key as applied to this standard assignment over the given scope + AssignedAssessment *AssignedAssessmentItem + + // Exemption category of this assignment + ExemptionCategory *ExemptionCategory +} + +// StandardAssignmentsList - Page of a standard assignment list +type StandardAssignmentsList struct { + // READ-ONLY; Collection of standardAssignments in this page + Value []*StandardAssignment + + // READ-ONLY; The URI to fetch the next page + NextLink *string +} + +// StandardList - Page of a Standard list +type StandardList struct { + // READ-ONLY; Collection of standards in this page + Value []*Standard + + // READ-ONLY; The URI to fetch the next page + NextLink *string +} + +// StandardMetadata - The standard metadata +type StandardMetadata struct { + // READ-ONLY; Standard Created by object id (GUID) + CreatedBy *string + + // READ-ONLY; Standard creation date + CreatedOn *time.Time + + // READ-ONLY; Standard last updated by object id (GUID) + LastUpdatedBy *string + + // READ-ONLY; Standard last update date + LastUpdatedOn *time.Time +} + +// StandardProperties - Describes properties of a standard. +type StandardProperties struct { + // List of assessment keys to apply to standard scope. + Assessments []*PartialAssessmentProperties + + // List of all standard supported clouds. + CloudProviders []*StandardSupportedCloud + + // Description of the standard + Description *string + + // Display name of the standard, equivalent to the standardId + DisplayName *string + + // The security standard metadata. + Metadata *StandardMetadata + + // The policy set definition id associated with the standard. + PolicySetDefinitionID *string + + // READ-ONLY; Standard type (Custom or Default or Compliance only currently) + StandardType *StandardType +} + // StatusAutoGenerated - The status of the health report type StatusAutoGenerated struct { // The status of the health report @@ -7837,30 +8222,6 @@ type UserDefinedResourcesProperties struct { QuerySubscriptions []*string } -// UserRecommendation - Represents a user that is recommended to be allowed for a certain rule -type UserRecommendation struct { - // The recommendation action of the machine or rule - RecommendationAction *RecommendationAction - - // Represents a user that is recommended to be allowed for a certain rule - Username *string -} - -// VMRecommendation - Represents a machine that is part of a machine group -type VMRecommendation struct { - // The configuration status of the machines group or machine or rule - ConfigurationStatus *ConfigurationStatus - - // The machine supportability of Enforce feature - EnforcementSupport *EnforcementSupport - - // The recommendation action of the machine or rule - RecommendationAction *RecommendationAction - - // The full resource id of the machine - ResourceID *string -} - // VMScannersAws - A VM scanning configuration for a security offering of a Aws environment type VMScannersAws struct { // The cloud role ARN in AWS for this feature diff --git a/sdk/resourcemanager/security/armsecurity/models_serde.go b/sdk/resourcemanager/security/armsecurity/models_serde.go index 9510c747f9f0..13c3e769262b 100644 --- a/sdk/resourcemanager/security/armsecurity/models_serde.go +++ b/sdk/resourcemanager/security/armsecurity/models_serde.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -278,6 +275,41 @@ func (a *APICollectionProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AccessTokenAuthentication. +func (a AccessTokenAuthentication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accessToken", a.AccessToken) + objectMap["authenticationType"] = "AccessToken" + populate(objectMap, "username", a.Username) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessTokenAuthentication. +func (a *AccessTokenAuthentication) 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 "accessToken": + err = unpopulate(val, "AccessToken", &a.AccessToken) + delete(rawMsg, key) + case "authenticationType": + err = unpopulate(val, "AuthenticationType", &a.AuthenticationType) + delete(rawMsg, key) + case "username": + err = unpopulate(val, "Username", &a.Username) + 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 ActionableRemediation. func (a ActionableRemediation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -368,19 +400,15 @@ func (a *ActiveConnectionsNotInAllowedRange) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AdaptiveApplicationControlGroup. -func (a AdaptiveApplicationControlGroup) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AdditionalData. +func (a AdditionalData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", a.ID) - populate(objectMap, "location", a.Location) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) + objectMap["assessedResourceType"] = a.AssessedResourceType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AdaptiveApplicationControlGroup. -func (a *AdaptiveApplicationControlGroup) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AdditionalData. +func (a *AdditionalData) 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) @@ -388,20 +416,8 @@ func (a *AdaptiveApplicationControlGroup) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &a.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) + case "assessedResourceType": + err = unpopulate(val, "AssessedResourceType", &a.AssessedResourceType) delete(rawMsg, key) } if err != nil { @@ -411,22 +427,17 @@ func (a *AdaptiveApplicationControlGroup) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AdaptiveApplicationControlGroupData. -func (a AdaptiveApplicationControlGroupData) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AdditionalWorkspacesProperties. +func (a AdditionalWorkspacesProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "configurationStatus", a.ConfigurationStatus) - populate(objectMap, "enforcementMode", a.EnforcementMode) - populate(objectMap, "issues", a.Issues) - populate(objectMap, "pathRecommendations", a.PathRecommendations) - populate(objectMap, "protectionMode", a.ProtectionMode) - populate(objectMap, "recommendationStatus", a.RecommendationStatus) - populate(objectMap, "sourceSystem", a.SourceSystem) - populate(objectMap, "vmRecommendations", a.VMRecommendations) + populate(objectMap, "dataTypes", a.DataTypes) + populate(objectMap, "type", a.Type) + populate(objectMap, "workspace", a.Workspace) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AdaptiveApplicationControlGroupData. -func (a *AdaptiveApplicationControlGroupData) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AdditionalWorkspacesProperties. +func (a *AdditionalWorkspacesProperties) 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) @@ -434,56 +445,14 @@ func (a *AdaptiveApplicationControlGroupData) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "configurationStatus": - err = unpopulate(val, "ConfigurationStatus", &a.ConfigurationStatus) - delete(rawMsg, key) - case "enforcementMode": - err = unpopulate(val, "EnforcementMode", &a.EnforcementMode) - delete(rawMsg, key) - case "issues": - err = unpopulate(val, "Issues", &a.Issues) - delete(rawMsg, key) - case "pathRecommendations": - err = unpopulate(val, "PathRecommendations", &a.PathRecommendations) - delete(rawMsg, key) - case "protectionMode": - err = unpopulate(val, "ProtectionMode", &a.ProtectionMode) - delete(rawMsg, key) - case "recommendationStatus": - err = unpopulate(val, "RecommendationStatus", &a.RecommendationStatus) - delete(rawMsg, key) - case "sourceSystem": - err = unpopulate(val, "SourceSystem", &a.SourceSystem) + case "dataTypes": + err = unpopulate(val, "DataTypes", &a.DataTypes) delete(rawMsg, key) - case "vmRecommendations": - err = unpopulate(val, "VMRecommendations", &a.VMRecommendations) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AdaptiveApplicationControlGroups. -func (a AdaptiveApplicationControlGroups) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AdaptiveApplicationControlGroups. -func (a *AdaptiveApplicationControlGroups) 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 "value": - err = unpopulate(val, "Value", &a.Value) + case "workspace": + err = unpopulate(val, "Workspace", &a.Workspace) delete(rawMsg, key) } if err != nil { @@ -493,16 +462,15 @@ func (a *AdaptiveApplicationControlGroups) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AdaptiveApplicationControlIssueSummary. -func (a AdaptiveApplicationControlIssueSummary) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AdvancedThreatProtectionProperties. +func (a AdvancedThreatProtectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "issue", a.Issue) - populate(objectMap, "numberOfVms", a.NumberOfVMs) + populate(objectMap, "isEnabled", a.IsEnabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AdaptiveApplicationControlIssueSummary. -func (a *AdaptiveApplicationControlIssueSummary) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AdvancedThreatProtectionProperties. +func (a *AdvancedThreatProtectionProperties) 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) @@ -510,11 +478,8 @@ func (a *AdaptiveApplicationControlIssueSummary) UnmarshalJSON(data []byte) erro for key, val := range rawMsg { var err error switch key { - case "issue": - err = unpopulate(val, "Issue", &a.Issue) - delete(rawMsg, key) - case "numberOfVms": - err = unpopulate(val, "NumberOfVMs", &a.NumberOfVMs) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &a.IsEnabled) delete(rawMsg, key) } if err != nil { @@ -524,8 +489,8 @@ func (a *AdaptiveApplicationControlIssueSummary) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type AdaptiveNetworkHardening. -func (a AdaptiveNetworkHardening) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AdvancedThreatProtectionSetting. +func (a AdvancedThreatProtectionSetting) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) @@ -534,8 +499,8 @@ func (a AdaptiveNetworkHardening) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AdaptiveNetworkHardening. -func (a *AdaptiveNetworkHardening) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AdvancedThreatProtectionSetting. +func (a *AdvancedThreatProtectionSetting) 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) @@ -563,16 +528,19 @@ func (a *AdaptiveNetworkHardening) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AdaptiveNetworkHardeningEnforceRequest. -func (a AdaptiveNetworkHardeningEnforceRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AgentlessConfiguration. +func (a AgentlessConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "networkSecurityGroups", a.NetworkSecurityGroups) - populate(objectMap, "rules", a.Rules) + populate(objectMap, "agentlessAutoDiscovery", a.AgentlessAutoDiscovery) + populate(objectMap, "agentlessEnabled", a.AgentlessEnabled) + populate(objectMap, "inventoryList", a.InventoryList) + populate(objectMap, "inventoryListType", a.InventoryListType) + populate(objectMap, "scanners", a.Scanners) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AdaptiveNetworkHardeningEnforceRequest. -func (a *AdaptiveNetworkHardeningEnforceRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AgentlessConfiguration. +func (a *AgentlessConfiguration) 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) @@ -580,11 +548,20 @@ func (a *AdaptiveNetworkHardeningEnforceRequest) UnmarshalJSON(data []byte) erro for key, val := range rawMsg { var err error switch key { - case "networkSecurityGroups": - err = unpopulate(val, "NetworkSecurityGroups", &a.NetworkSecurityGroups) + case "agentlessAutoDiscovery": + err = unpopulate(val, "AgentlessAutoDiscovery", &a.AgentlessAutoDiscovery) delete(rawMsg, key) - case "rules": - err = unpopulate(val, "Rules", &a.Rules) + case "agentlessEnabled": + err = unpopulate(val, "AgentlessEnabled", &a.AgentlessEnabled) + delete(rawMsg, key) + case "inventoryList": + err = unpopulate(val, "InventoryList", &a.InventoryList) + delete(rawMsg, key) + case "inventoryListType": + err = unpopulate(val, "InventoryListType", &a.InventoryListType) + delete(rawMsg, key) + case "scanners": + err = unpopulate(val, "Scanners", &a.Scanners) delete(rawMsg, key) } if err != nil { @@ -594,17 +571,18 @@ func (a *AdaptiveNetworkHardeningEnforceRequest) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type AdaptiveNetworkHardeningProperties. -func (a AdaptiveNetworkHardeningProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Alert. +func (a Alert) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "effectiveNetworkSecurityGroups", a.EffectiveNetworkSecurityGroups) - populate(objectMap, "rules", a.Rules) - populateDateTimeRFC3339(objectMap, "rulesCalculationTime", a.RulesCalculationTime) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AdaptiveNetworkHardeningProperties. -func (a *AdaptiveNetworkHardeningProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Alert. +func (a *Alert) 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) @@ -612,14 +590,17 @@ func (a *AdaptiveNetworkHardeningProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "effectiveNetworkSecurityGroups": - err = unpopulate(val, "EffectiveNetworkSecurityGroups", &a.EffectiveNetworkSecurityGroups) + case "id": + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) - case "rules": - err = unpopulate(val, "Rules", &a.Rules) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) - case "rulesCalculationTime": - err = unpopulateDateTimeRFC3339(val, "RulesCalculationTime", &a.RulesCalculationTime) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { @@ -629,16 +610,20 @@ func (a *AdaptiveNetworkHardeningProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AdaptiveNetworkHardeningsList. -func (a AdaptiveNetworkHardeningsList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AlertEntity. +func (a AlertEntity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) + populate(objectMap, "type", a.Type) + if a.AdditionalProperties != nil { + for key, val := range a.AdditionalProperties { + objectMap[key] = val + } + } return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AdaptiveNetworkHardeningsList. -func (a *AdaptiveNetworkHardeningsList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AlertEntity. +func (a *AlertEntity) 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) @@ -646,11 +631,18 @@ func (a *AdaptiveNetworkHardeningsList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) + default: + if a.AdditionalProperties == nil { + a.AdditionalProperties = map[string]any{} + } + if val != nil { + var aux any + err = json.Unmarshal(val, &aux) + a.AdditionalProperties[key] = aux + } delete(rawMsg, key) } if err != nil { @@ -660,15 +652,16 @@ func (a *AdaptiveNetworkHardeningsList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AdditionalData. -func (a AdditionalData) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AlertList. +func (a AlertList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["assessedResourceType"] = a.AssessedResourceType + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AdditionalData. -func (a *AdditionalData) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AlertList. +func (a *AlertList) 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) @@ -676,8 +669,11 @@ func (a *AdditionalData) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "assessedResourceType": - err = unpopulate(val, "AssessedResourceType", &a.AssessedResourceType) + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) } if err != nil { @@ -687,17 +683,41 @@ func (a *AdditionalData) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AdditionalWorkspacesProperties. -func (a AdditionalWorkspacesProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AlertProperties. +func (a AlertProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dataTypes", a.DataTypes) - populate(objectMap, "type", a.Type) - populate(objectMap, "workspace", a.Workspace) + populate(objectMap, "alertDisplayName", a.AlertDisplayName) + populate(objectMap, "alertType", a.AlertType) + populate(objectMap, "alertUri", a.AlertURI) + populate(objectMap, "compromisedEntity", a.CompromisedEntity) + populate(objectMap, "correlationKey", a.CorrelationKey) + populate(objectMap, "description", a.Description) + populateDateTimeRFC3339(objectMap, "endTimeUtc", a.EndTimeUTC) + populate(objectMap, "entities", a.Entities) + populate(objectMap, "extendedLinks", a.ExtendedLinks) + populate(objectMap, "extendedProperties", a.ExtendedProperties) + populate(objectMap, "intent", a.Intent) + populate(objectMap, "isIncident", a.IsIncident) + populateDateTimeRFC3339(objectMap, "processingEndTimeUtc", a.ProcessingEndTimeUTC) + populate(objectMap, "productComponentName", a.ProductComponentName) + populate(objectMap, "productName", a.ProductName) + populate(objectMap, "remediationSteps", a.RemediationSteps) + populate(objectMap, "resourceIdentifiers", a.ResourceIdentifiers) + populate(objectMap, "severity", a.Severity) + populateDateTimeRFC3339(objectMap, "startTimeUtc", a.StartTimeUTC) + populate(objectMap, "status", a.Status) + populate(objectMap, "subTechniques", a.SubTechniques) + populate(objectMap, "supportingEvidence", a.SupportingEvidence) + populate(objectMap, "systemAlertId", a.SystemAlertID) + populate(objectMap, "techniques", a.Techniques) + populateDateTimeRFC3339(objectMap, "timeGeneratedUtc", a.TimeGeneratedUTC) + populate(objectMap, "vendorName", a.VendorName) + populate(objectMap, "version", a.Version) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AdditionalWorkspacesProperties. -func (a *AdditionalWorkspacesProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AlertProperties. +func (a *AlertProperties) 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) @@ -705,254 +725,17 @@ func (a *AdditionalWorkspacesProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "dataTypes": - err = unpopulate(val, "DataTypes", &a.DataTypes) + case "alertDisplayName": + err = unpopulate(val, "AlertDisplayName", &a.AlertDisplayName) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) + case "alertType": + err = unpopulate(val, "AlertType", &a.AlertType) delete(rawMsg, key) - case "workspace": - err = unpopulate(val, "Workspace", &a.Workspace) + case "alertUri": + err = unpopulate(val, "AlertURI", &a.AlertURI) 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 AdvancedThreatProtectionProperties. -func (a AdvancedThreatProtectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "isEnabled", a.IsEnabled) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AdvancedThreatProtectionProperties. -func (a *AdvancedThreatProtectionProperties) 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 "isEnabled": - err = unpopulate(val, "IsEnabled", &a.IsEnabled) - 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 AdvancedThreatProtectionSetting. -func (a AdvancedThreatProtectionSetting) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AdvancedThreatProtectionSetting. -func (a *AdvancedThreatProtectionSetting) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Alert. -func (a Alert) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Alert. -func (a *Alert) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &a.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AlertEntity. -func (a AlertEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "type", a.Type) - if a.AdditionalProperties != nil { - for key, val := range a.AdditionalProperties { - objectMap[key] = val - } - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AlertEntity. -func (a *AlertEntity) 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 "type": - err = unpopulate(val, "Type", &a.Type) - delete(rawMsg, key) - default: - if a.AdditionalProperties == nil { - a.AdditionalProperties = map[string]any{} - } - if val != nil { - var aux any - err = json.Unmarshal(val, &aux) - a.AdditionalProperties[key] = aux - } - 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 AlertList. -func (a AlertList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AlertList. -func (a *AlertList) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type AlertProperties. -func (a AlertProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "alertDisplayName", a.AlertDisplayName) - populate(objectMap, "alertType", a.AlertType) - populate(objectMap, "alertUri", a.AlertURI) - populate(objectMap, "compromisedEntity", a.CompromisedEntity) - populate(objectMap, "correlationKey", a.CorrelationKey) - populate(objectMap, "description", a.Description) - populateDateTimeRFC3339(objectMap, "endTimeUtc", a.EndTimeUTC) - populate(objectMap, "entities", a.Entities) - populate(objectMap, "extendedLinks", a.ExtendedLinks) - populate(objectMap, "extendedProperties", a.ExtendedProperties) - populate(objectMap, "intent", a.Intent) - populate(objectMap, "isIncident", a.IsIncident) - populateDateTimeRFC3339(objectMap, "processingEndTimeUtc", a.ProcessingEndTimeUTC) - populate(objectMap, "productComponentName", a.ProductComponentName) - populate(objectMap, "productName", a.ProductName) - populate(objectMap, "remediationSteps", a.RemediationSteps) - populate(objectMap, "resourceIdentifiers", a.ResourceIdentifiers) - populate(objectMap, "severity", a.Severity) - populateDateTimeRFC3339(objectMap, "startTimeUtc", a.StartTimeUTC) - populate(objectMap, "status", a.Status) - populate(objectMap, "subTechniques", a.SubTechniques) - populate(objectMap, "supportingEvidence", a.SupportingEvidence) - populate(objectMap, "systemAlertId", a.SystemAlertID) - populate(objectMap, "techniques", a.Techniques) - populateDateTimeRFC3339(objectMap, "timeGeneratedUtc", a.TimeGeneratedUTC) - populate(objectMap, "vendorName", a.VendorName) - populate(objectMap, "version", a.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AlertProperties. -func (a *AlertProperties) 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 "alertDisplayName": - err = unpopulate(val, "AlertDisplayName", &a.AlertDisplayName) - delete(rawMsg, key) - case "alertType": - err = unpopulate(val, "AlertType", &a.AlertType) - delete(rawMsg, key) - case "alertUri": - err = unpopulate(val, "AlertURI", &a.AlertURI) - delete(rawMsg, key) - case "compromisedEntity": - err = unpopulate(val, "CompromisedEntity", &a.CompromisedEntity) + case "compromisedEntity": + err = unpopulate(val, "CompromisedEntity", &a.CompromisedEntity) delete(rawMsg, key) case "correlationKey": err = unpopulate(val, "CorrelationKey", &a.CorrelationKey) @@ -2753,6 +2536,60 @@ func (a *AssessmentStatusResponse) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AssignedAssessmentItem. +func (a AssignedAssessmentItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "assessmentKey", a.AssessmentKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AssignedAssessmentItem. +func (a *AssignedAssessmentItem) 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 "assessmentKey": + err = unpopulate(val, "AssessmentKey", &a.AssessmentKey) + 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 AssignedStandardItem. +func (a AssignedStandardItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AssignedStandardItem. +func (a *AssignedStandardItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AtaExternalSecuritySolution. func (a AtaExternalSecuritySolution) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2854,6 +2691,64 @@ func (a *AtaSolutionProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type AttestationEvidence. +func (a AttestationEvidence) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", a.Description) + populate(objectMap, "sourceUrl", a.SourceURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AttestationEvidence. +func (a *AttestationEvidence) 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 "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "sourceUrl": + err = unpopulate(val, "SourceURL", &a.SourceURL) + 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 Authentication. +func (a Authentication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["authenticationType"] = a.AuthenticationType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Authentication. +func (a *Authentication) 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 "authenticationType": + err = unpopulate(val, "AuthenticationType", &a.AuthenticationType) + 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 AuthenticationDetailsProperties. func (a AuthenticationDetailsProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -4457,6 +4352,49 @@ func (b *BenchmarkReference) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type BlobsScanSummary. +func (b BlobsScanSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "failedBlobsCount", b.FailedBlobsCount) + populate(objectMap, "maliciousBlobsCount", b.MaliciousBlobsCount) + populate(objectMap, "scannedBlobsInGB", b.ScannedBlobsInGB) + populate(objectMap, "skippedBlobsCount", b.SkippedBlobsCount) + populate(objectMap, "totalBlobsScanned", b.TotalBlobsScanned) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BlobsScanSummary. +func (b *BlobsScanSummary) 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", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "failedBlobsCount": + err = unpopulate(val, "FailedBlobsCount", &b.FailedBlobsCount) + delete(rawMsg, key) + case "maliciousBlobsCount": + err = unpopulate(val, "MaliciousBlobsCount", &b.MaliciousBlobsCount) + delete(rawMsg, key) + case "scannedBlobsInGB": + err = unpopulate(val, "ScannedBlobsInGB", &b.ScannedBlobsInGB) + delete(rawMsg, key) + case "skippedBlobsCount": + err = unpopulate(val, "SkippedBlobsCount", &b.SkippedBlobsCount) + delete(rawMsg, key) + case "totalBlobsScanned": + err = unpopulate(val, "TotalBlobsScanned", &b.TotalBlobsScanned) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type BuiltInInfoType. func (b BuiltInInfoType) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5710,6 +5648,37 @@ func (c *CspmMonitorAzureDevOpsOffering) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type CspmMonitorDockerHubOffering. +func (c CspmMonitorDockerHubOffering) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", c.Description) + objectMap["offeringType"] = OfferingTypeCspmMonitorDockerHub + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CspmMonitorDockerHubOffering. +func (c *CspmMonitorDockerHubOffering) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "offeringType": + err = unpopulate(val, "OfferingType", &c.OfferingType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type CspmMonitorGcpOffering. func (c CspmMonitorGcpOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5838,6 +5807,37 @@ func (c *CspmMonitorGithubOffering) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type CspmMonitorJFrogOffering. +func (c CspmMonitorJFrogOffering) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", c.Description) + objectMap["offeringType"] = OfferingTypeCspmMonitorJFrog + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CspmMonitorJFrogOffering. +func (c *CspmMonitorJFrogOffering) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "offeringType": + err = unpopulate(val, "OfferingType", &c.OfferingType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type CustomAlertRule. func (c CustomAlertRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -6259,6 +6259,141 @@ func (c *CustomEntityStoreAssignmentsListResult) UnmarshalJSON(data []byte) erro return nil } +// MarshalJSON implements the json.Marshaller interface for type CustomRecommendation. +func (c CustomRecommendation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomRecommendation. +func (c *CustomRecommendation) 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 "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + 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 CustomRecommendationProperties. +func (c CustomRecommendationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "assessmentKey", c.AssessmentKey) + populate(objectMap, "cloudProviders", c.CloudProviders) + populate(objectMap, "description", c.Description) + populate(objectMap, "displayName", c.DisplayName) + populate(objectMap, "query", c.Query) + populate(objectMap, "remediationDescription", c.RemediationDescription) + if c.SecurityIssue == nil { + c.SecurityIssue = to.Ptr(SecurityIssueBestPractices) + } + populate(objectMap, "securityIssue", c.SecurityIssue) + if c.Severity == nil { + c.Severity = to.Ptr(SeverityEnumLow) + } + populate(objectMap, "severity", c.Severity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomRecommendationProperties. +func (c *CustomRecommendationProperties) 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 "assessmentKey": + err = unpopulate(val, "AssessmentKey", &c.AssessmentKey) + delete(rawMsg, key) + case "cloudProviders": + err = unpopulate(val, "CloudProviders", &c.CloudProviders) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &c.DisplayName) + delete(rawMsg, key) + case "query": + err = unpopulate(val, "Query", &c.Query) + delete(rawMsg, key) + case "remediationDescription": + err = unpopulate(val, "RemediationDescription", &c.RemediationDescription) + delete(rawMsg, key) + case "securityIssue": + err = unpopulate(val, "SecurityIssue", &c.SecurityIssue) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &c.Severity) + 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 CustomRecommendationsList. +func (c CustomRecommendationsList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomRecommendationsList. +func (c *CustomRecommendationsList) 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 "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + 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 DataExportSettingProperties. func (d DataExportSettingProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -6632,21 +6767,16 @@ func (d *DefenderCspmAwsOfferingVMScanners) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderCspmGcpOffering. -func (d DefenderCspmGcpOffering) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderCspmDockerHubOffering. +func (d DefenderCspmDockerHubOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "ciemDiscovery", d.CiemDiscovery) - populate(objectMap, "dataSensitivityDiscovery", d.DataSensitivityDiscovery) populate(objectMap, "description", d.Description) - populate(objectMap, "mdcContainersAgentlessDiscoveryK8s", d.MdcContainersAgentlessDiscoveryK8S) - populate(objectMap, "mdcContainersImageAssessment", d.MdcContainersImageAssessment) - objectMap["offeringType"] = OfferingTypeDefenderCspmGcp - populate(objectMap, "vmScanners", d.VMScanners) + objectMap["offeringType"] = OfferingTypeDefenderCspmDockerHub return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmGcpOffering. -func (d *DefenderCspmGcpOffering) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmDockerHubOffering. +func (d *DefenderCspmDockerHubOffering) 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) @@ -6654,17 +6784,53 @@ func (d *DefenderCspmGcpOffering) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "ciemDiscovery": - err = unpopulate(val, "CiemDiscovery", &d.CiemDiscovery) - delete(rawMsg, key) - case "dataSensitivityDiscovery": - err = unpopulate(val, "DataSensitivityDiscovery", &d.DataSensitivityDiscovery) - delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &d.Description) delete(rawMsg, key) - case "mdcContainersAgentlessDiscoveryK8s": - err = unpopulate(val, "MdcContainersAgentlessDiscoveryK8S", &d.MdcContainersAgentlessDiscoveryK8S) + 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 DefenderCspmGcpOffering. +func (d DefenderCspmGcpOffering) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ciemDiscovery", d.CiemDiscovery) + populate(objectMap, "dataSensitivityDiscovery", d.DataSensitivityDiscovery) + populate(objectMap, "description", d.Description) + populate(objectMap, "mdcContainersAgentlessDiscoveryK8s", d.MdcContainersAgentlessDiscoveryK8S) + populate(objectMap, "mdcContainersImageAssessment", d.MdcContainersImageAssessment) + objectMap["offeringType"] = OfferingTypeDefenderCspmGcp + populate(objectMap, "vmScanners", d.VMScanners) + 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 "ciemDiscovery": + err = unpopulate(val, "CiemDiscovery", &d.CiemDiscovery) + delete(rawMsg, key) + case "dataSensitivityDiscovery": + err = unpopulate(val, "DataSensitivityDiscovery", &d.DataSensitivityDiscovery) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "mdcContainersAgentlessDiscoveryK8s": + err = unpopulate(val, "MdcContainersAgentlessDiscoveryK8S", &d.MdcContainersAgentlessDiscoveryK8S) delete(rawMsg, key) case "mdcContainersImageAssessment": err = unpopulate(val, "MdcContainersImageAssessment", &d.MdcContainersImageAssessment) @@ -6854,6 +7020,68 @@ func (d *DefenderCspmGcpOfferingVMScanners) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DefenderCspmJFrogOffering. +func (d DefenderCspmJFrogOffering) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", d.Description) + populate(objectMap, "mdcContainersImageAssessment", d.MdcContainersImageAssessment) + objectMap["offeringType"] = OfferingTypeDefenderCspmJFrog + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmJFrogOffering. +func (d *DefenderCspmJFrogOffering) 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 "mdcContainersImageAssessment": + err = unpopulate(val, "MdcContainersImageAssessment", &d.MdcContainersImageAssessment) + 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 DefenderCspmJFrogOfferingMdcContainersImageAssessment. +func (d DefenderCspmJFrogOfferingMdcContainersImageAssessment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", d.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmJFrogOfferingMdcContainersImageAssessment. +func (d *DefenderCspmJFrogOfferingMdcContainersImageAssessment) 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 "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 DefenderFoDatabasesAwsOffering. func (d DefenderFoDatabasesAwsOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -7278,6 +7506,37 @@ func (d *DefenderForContainersAwsOfferingVMScanners) UnmarshalJSON(data []byte) return nil } +// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersDockerHubOffering. +func (d DefenderForContainersDockerHubOffering) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", d.Description) + objectMap["offeringType"] = OfferingTypeDefenderForContainersDockerHub + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersDockerHubOffering. +func (d *DefenderForContainersDockerHubOffering) 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 DefenderForContainersGcpOffering. func (d DefenderForContainersGcpOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -7504,6 +7763,37 @@ func (d *DefenderForContainersGcpOfferingVMScanners) UnmarshalJSON(data []byte) return nil } +// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersJFrogOffering. +func (d DefenderForContainersJFrogOffering) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", d.Description) + objectMap["offeringType"] = OfferingTypeDefenderForContainersJFrog + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersJFrogOffering. +func (d *DefenderForContainersJFrogOffering) 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 DefenderForDatabasesGcpOffering. func (d DefenderForDatabasesGcpOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -8262,6 +8552,37 @@ func (d *DenylistCustomAlertRule) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DevOpsCapability. +func (d DevOpsCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", d.Name) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DevOpsCapability. +func (d *DevOpsCapability) 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 "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + 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 DevOpsConfiguration. func (d DevOpsConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -8339,8 +8660,10 @@ func (d *DevOpsConfigurationListResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DevOpsConfigurationProperties. func (d DevOpsConfigurationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "agentlessConfiguration", d.AgentlessConfiguration) populate(objectMap, "authorization", d.Authorization) populate(objectMap, "autoDiscovery", d.AutoDiscovery) + populate(objectMap, "capabilities", d.Capabilities) populate(objectMap, "provisioningState", d.ProvisioningState) populate(objectMap, "provisioningStatusMessage", d.ProvisioningStatusMessage) populateDateTimeRFC3339(objectMap, "provisioningStatusUpdateTimeUtc", d.ProvisioningStatusUpdateTimeUTC) @@ -8357,12 +8680,18 @@ func (d *DevOpsConfigurationProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "agentlessConfiguration": + err = unpopulate(val, "AgentlessConfiguration", &d.AgentlessConfiguration) + delete(rawMsg, key) case "authorization": err = unpopulate(val, "Authorization", &d.Authorization) delete(rawMsg, key) case "autoDiscovery": err = unpopulate(val, "AutoDiscovery", &d.AutoDiscovery) delete(rawMsg, key) + case "capabilities": + err = unpopulate(val, "Capabilities", &d.Capabilities) + delete(rawMsg, key) case "provisioningState": err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) delete(rawMsg, key) @@ -8656,43 +8985,50 @@ func (d *DiscoveredSecuritySolutionProperties) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type ETag. -func (e ETag) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DockerHubEnvironmentData. +func (d DockerHubEnvironmentData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "etag", e.Etag) + populate(objectMap, "authentication", d.Authentication) + objectMap["environmentType"] = EnvironmentTypeDockerHubOrganization + populate(objectMap, "scanInterval", d.ScanInterval) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ETag. -func (e *ETag) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DockerHubEnvironmentData. +func (d *DockerHubEnvironmentData) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "etag": - err = unpopulate(val, "Etag", &e.Etag) + case "authentication": + d.Authentication, err = unmarshalAuthenticationClassification(val) + delete(rawMsg, key) + case "environmentType": + err = unpopulate(val, "EnvironmentType", &d.EnvironmentType) + delete(rawMsg, key) + case "scanInterval": + err = unpopulate(val, "ScanInterval", &d.ScanInterval) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EffectiveNetworkSecurityGroups. -func (e EffectiveNetworkSecurityGroups) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ETag. +func (e ETag) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "networkInterface", e.NetworkInterface) - populate(objectMap, "networkSecurityGroups", e.NetworkSecurityGroups) + populate(objectMap, "etag", e.Etag) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EffectiveNetworkSecurityGroups. -func (e *EffectiveNetworkSecurityGroups) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ETag. +func (e *ETag) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -8700,11 +9036,8 @@ func (e *EffectiveNetworkSecurityGroups) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "networkInterface": - err = unpopulate(val, "NetworkInterface", &e.NetworkInterface) - delete(rawMsg, key) - case "networkSecurityGroups": - err = unpopulate(val, "NetworkSecurityGroups", &e.NetworkSecurityGroups) + case "etag": + err = unpopulate(val, "Etag", &e.Etag) delete(rawMsg, key) } if err != nil { @@ -8901,6 +9234,49 @@ func (e *ErrorDetailAutoGenerated) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ErrorDetailAutoGenerated2. +func (e ErrorDetailAutoGenerated2) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetailAutoGenerated2. +func (e *ErrorDetailAutoGenerated2) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ErrorResponse. func (e ErrorResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -8955,15 +9331,15 @@ func (e *ErrorResponseAutoGenerated) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ExecuteGovernanceRuleParams. -func (e ExecuteGovernanceRuleParams) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ErrorResponseAutoGenerated2. +func (e ErrorResponseAutoGenerated2) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "override", e.Override) + populate(objectMap, "error", e.Error) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExecuteGovernanceRuleParams. -func (e *ExecuteGovernanceRuleParams) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseAutoGenerated2. +func (e *ErrorResponseAutoGenerated2) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", e, err) @@ -8971,8 +9347,8 @@ func (e *ExecuteGovernanceRuleParams) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "override": - err = unpopulate(val, "Override", &e.Override) + case "error": + err = unpopulate(val, "Error", &e.Error) delete(rawMsg, key) } if err != nil { @@ -8982,13 +9358,40 @@ func (e *ExecuteGovernanceRuleParams) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Extension. -func (e Extension) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ExecuteGovernanceRuleParams. +func (e ExecuteGovernanceRuleParams) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "additionalExtensionProperties", e.AdditionalExtensionProperties) - populate(objectMap, "isEnabled", e.IsEnabled) - populate(objectMap, "name", e.Name) - populate(objectMap, "operationStatus", e.OperationStatus) + populate(objectMap, "override", e.Override) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExecuteGovernanceRuleParams. +func (e *ExecuteGovernanceRuleParams) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "override": + err = unpopulate(val, "Override", &e.Override) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Extension. +func (e Extension) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalExtensionProperties", e.AdditionalExtensionProperties) + populate(objectMap, "isEnabled", e.IsEnabled) + populate(objectMap, "name", e.Name) + populate(objectMap, "operationStatus", e.OperationStatus) return json.Marshal(objectMap) } @@ -11343,6 +11746,37 @@ func (i *InformationType) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type InventoryList. +func (i InventoryList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "inventoryKind", i.InventoryKind) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InventoryList. +func (i *InventoryList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "inventoryKind": + err = unpopulate(val, "InventoryKind", &i.InventoryKind) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type IoTSecurityAggregatedAlert. func (i IoTSecurityAggregatedAlert) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -12148,6 +12582,37 @@ func (i *Issue) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type JFrogEnvironmentData. +func (j JFrogEnvironmentData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["environmentType"] = EnvironmentTypeJFrogArtifactory + populate(objectMap, "scanInterval", j.ScanInterval) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JFrogEnvironmentData. +func (j *JFrogEnvironmentData) 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", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "environmentType": + err = unpopulate(val, "EnvironmentType", &j.EnvironmentType) + delete(rawMsg, key) + case "scanInterval": + err = unpopulate(val, "ScanInterval", &j.ScanInterval) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type JitNetworkAccessPoliciesList. func (j JitNetworkAccessPoliciesList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -12779,6 +13244,80 @@ func (l *LogAnalyticsIdentifier) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type MalwareScan. +func (m MalwareScan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", m.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MalwareScan. +func (m *MalwareScan) 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", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MalwareScanProperties. +func (m MalwareScanProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "scanEndTime", m.ScanEndTime) + populate(objectMap, "scanId", m.ScanID) + populate(objectMap, "scanStartTime", m.ScanStartTime) + populate(objectMap, "scanStatus", m.ScanStatus) + populate(objectMap, "scanStatusMessage", m.ScanStatusMessage) + populate(objectMap, "scanSummary", m.ScanSummary) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MalwareScanProperties. +func (m *MalwareScanProperties) 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", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "scanEndTime": + err = unpopulate(val, "ScanEndTime", &m.ScanEndTime) + delete(rawMsg, key) + case "scanId": + err = unpopulate(val, "ScanID", &m.ScanID) + delete(rawMsg, key) + case "scanStartTime": + err = unpopulate(val, "ScanStartTime", &m.ScanStartTime) + delete(rawMsg, key) + case "scanStatus": + err = unpopulate(val, "ScanStatus", &m.ScanStatus) + delete(rawMsg, key) + case "scanStatusMessage": + err = unpopulate(val, "ScanStatusMessage", &m.ScanStatusMessage) + delete(rawMsg, key) + case "scanSummary": + err = unpopulate(val, "ScanSummary", &m.ScanSummary) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type MalwareScanningProperties. func (m MalwareScanningProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -13289,7 +13828,9 @@ func (o *OnUploadProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "actionType", o.ActionType) populate(objectMap, "display", o.Display) + populate(objectMap, "isDataAction", o.IsDataAction) populate(objectMap, "name", o.Name) populate(objectMap, "origin", o.Origin) return json.Marshal(objectMap) @@ -13304,9 +13845,15 @@ func (o *Operation) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "actionType": + err = unpopulate(val, "ActionType", &o.ActionType) + delete(rawMsg, key) case "display": err = unpopulate(val, "Display", &o.Display) delete(rawMsg, key) + case "isDataAction": + err = unpopulate(val, "IsDataAction", &o.IsDataAction) + delete(rawMsg, key) case "name": err = unpopulate(val, "Name", &o.Name) delete(rawMsg, key) @@ -13360,16 +13907,16 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationList. -func (o OperationList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "nextLink", o.NextLink) populate(objectMap, "value", o.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationList. -func (o *OperationList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", o, err) @@ -13601,23 +14148,15 @@ func (o *OperatorResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PathRecommendation. -func (p PathRecommendation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type PartialAssessmentProperties. +func (p PartialAssessmentProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "action", p.Action) - populate(objectMap, "common", p.Common) - populate(objectMap, "configurationStatus", p.ConfigurationStatus) - populate(objectMap, "fileType", p.FileType) - populate(objectMap, "path", p.Path) - populate(objectMap, "publisherInfo", p.PublisherInfo) - populate(objectMap, "type", p.Type) - populate(objectMap, "userSids", p.UserSids) - populate(objectMap, "usernames", p.Usernames) + populate(objectMap, "assessmentKey", p.AssessmentKey) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PathRecommendation. -func (p *PathRecommendation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type PartialAssessmentProperties. +func (p *PartialAssessmentProperties) 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", p, err) @@ -13625,32 +14164,8 @@ func (p *PathRecommendation) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "action": - err = unpopulate(val, "Action", &p.Action) - delete(rawMsg, key) - case "common": - err = unpopulate(val, "Common", &p.Common) - delete(rawMsg, key) - case "configurationStatus": - err = unpopulate(val, "ConfigurationStatus", &p.ConfigurationStatus) - delete(rawMsg, key) - case "fileType": - err = unpopulate(val, "FileType", &p.FileType) - delete(rawMsg, key) - case "path": - err = unpopulate(val, "Path", &p.Path) - delete(rawMsg, key) - case "publisherInfo": - err = unpopulate(val, "PublisherInfo", &p.PublisherInfo) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - case "userSids": - err = unpopulate(val, "UserSids", &p.UserSids) - delete(rawMsg, key) - case "usernames": - err = unpopulate(val, "Usernames", &p.Usernames) + case "assessmentKey": + err = unpopulate(val, "AssessmentKey", &p.AssessmentKey) delete(rawMsg, key) } if err != nil { @@ -13840,45 +14355,6 @@ func (p *ProcessNotAllowed) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ProtectionMode. -func (p ProtectionMode) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "exe", p.Exe) - populate(objectMap, "executable", p.Executable) - populate(objectMap, "msi", p.Msi) - populate(objectMap, "script", p.Script) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionMode. -func (p *ProtectionMode) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "exe": - err = unpopulate(val, "Exe", &p.Exe) - delete(rawMsg, key) - case "executable": - err = unpopulate(val, "Executable", &p.Executable) - delete(rawMsg, key) - case "msi": - err = unpopulate(val, "Msi", &p.Msi) - delete(rawMsg, key) - case "script": - err = unpopulate(val, "Script", &p.Script) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type ProxyResource. func (p ProxyResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -13945,45 +14421,6 @@ func (p *ProxyServerProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type PublisherInfo. -func (p PublisherInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "binaryName", p.BinaryName) - populate(objectMap, "productName", p.ProductName) - populate(objectMap, "publisherName", p.PublisherName) - populate(objectMap, "version", p.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PublisherInfo. -func (p *PublisherInfo) 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", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "binaryName": - err = unpopulate(val, "BinaryName", &p.BinaryName) - delete(rawMsg, key) - case "productName": - err = unpopulate(val, "ProductName", &p.ProductName) - delete(rawMsg, key) - case "publisherName": - err = unpopulate(val, "PublisherName", &p.PublisherName) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &p.Version) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type QueryCheck. func (q QueryCheck) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -14566,6 +15003,7 @@ func (r ResourceAutoGenerated) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) + populate(objectMap, "systemData", r.SystemData) populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } @@ -14585,6 +15023,9 @@ func (r *ResourceAutoGenerated) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &r.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) @@ -14601,7 +15042,6 @@ func (r ResourceAutoGenerated2) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) - populate(objectMap, "systemData", r.SystemData) populate(objectMap, "type", r.Type) return json.Marshal(objectMap) } @@ -14621,9 +15061,6 @@ func (r *ResourceAutoGenerated2) UnmarshalJSON(data []byte) error { case "name": err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &r.SystemData) - delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) @@ -14724,49 +15161,6 @@ func (r *ResourceIdentifier) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Rule. -func (r Rule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "destinationPort", r.DestinationPort) - populate(objectMap, "direction", r.Direction) - populate(objectMap, "ipAddresses", r.IPAddresses) - populate(objectMap, "name", r.Name) - populate(objectMap, "protocols", r.Protocols) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Rule. -func (r *Rule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "destinationPort": - err = unpopulate(val, "DestinationPort", &r.DestinationPort) - delete(rawMsg, key) - case "direction": - err = unpopulate(val, "Direction", &r.Direction) - delete(rawMsg, key) - case "ipAddresses": - err = unpopulate(val, "IPAddresses", &r.IPAddresses) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "protocols": - err = unpopulate(val, "Protocols", &r.Protocols) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type RuleResults. func (r RuleResults) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -15196,6 +15590,37 @@ func (s *ScanResults) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ScanSummary. +func (s ScanSummary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "blobs", s.Blobs) + populate(objectMap, "estimatedScanCostUSD", s.EstimatedScanCostUSD) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScanSummary. +func (s *ScanSummary) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "blobs": + err = unpopulate(val, "Blobs", &s.Blobs) + delete(rawMsg, key) + case "estimatedScanCostUSD": + err = unpopulate(val, "EstimatedScanCostUSD", &s.EstimatedScanCostUSD) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Scans. func (s Scans) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -16114,8 +16539,410 @@ func (s *SettingsList) UnmarshalJSON(data []byte) error { case "nextLink": err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "value": - s.Value, err = unmarshalSettingClassificationArray(val) + case "value": + s.Value, err = unmarshalSettingClassificationArray(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Software. +func (s Software) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Software. +func (s *Software) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SoftwareProperties. +func (s SoftwareProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "deviceId", s.DeviceID) + populate(objectMap, "endOfSupportDate", s.EndOfSupportDate) + populate(objectMap, "endOfSupportStatus", s.EndOfSupportStatus) + populate(objectMap, "firstSeenAt", s.FirstSeenAt) + populate(objectMap, "numberOfKnownVulnerabilities", s.NumberOfKnownVulnerabilities) + populate(objectMap, "osPlatform", s.OSPlatform) + populate(objectMap, "softwareName", s.SoftwareName) + populate(objectMap, "vendor", s.Vendor) + populate(objectMap, "version", s.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SoftwareProperties. +func (s *SoftwareProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "deviceId": + err = unpopulate(val, "DeviceID", &s.DeviceID) + delete(rawMsg, key) + case "endOfSupportDate": + err = unpopulate(val, "EndOfSupportDate", &s.EndOfSupportDate) + delete(rawMsg, key) + case "endOfSupportStatus": + err = unpopulate(val, "EndOfSupportStatus", &s.EndOfSupportStatus) + delete(rawMsg, key) + case "firstSeenAt": + err = unpopulate(val, "FirstSeenAt", &s.FirstSeenAt) + delete(rawMsg, key) + case "numberOfKnownVulnerabilities": + err = unpopulate(val, "NumberOfKnownVulnerabilities", &s.NumberOfKnownVulnerabilities) + delete(rawMsg, key) + case "osPlatform": + err = unpopulate(val, "OSPlatform", &s.OSPlatform) + delete(rawMsg, key) + case "softwareName": + err = unpopulate(val, "SoftwareName", &s.SoftwareName) + delete(rawMsg, key) + case "vendor": + err = unpopulate(val, "Vendor", &s.Vendor) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &s.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SoftwaresList. +func (s SoftwaresList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SoftwaresList. +func (s *SoftwaresList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Solution. +func (s Solution) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Solution. +func (s *Solution) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SolutionList. +func (s SolutionList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SolutionList. +func (s *SolutionList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SolutionProperties. +func (s SolutionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "protectionStatus", s.ProtectionStatus) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "securityFamily", s.SecurityFamily) + populate(objectMap, "template", s.Template) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SolutionProperties. +func (s *SolutionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "protectionStatus": + err = unpopulate(val, "ProtectionStatus", &s.ProtectionStatus) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "securityFamily": + err = unpopulate(val, "SecurityFamily", &s.SecurityFamily) + delete(rawMsg, key) + case "template": + err = unpopulate(val, "Template", &s.Template) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SolutionsReferenceData. +func (s SolutionsReferenceData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SolutionsReferenceData. +func (s *SolutionsReferenceData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SolutionsReferenceDataList. +func (s SolutionsReferenceDataList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SolutionsReferenceDataList. +func (s *SolutionsReferenceDataList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SolutionsReferenceDataProperties. +func (s SolutionsReferenceDataProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "alertVendorName", s.AlertVendorName) + populate(objectMap, "packageInfoUrl", s.PackageInfoURL) + populate(objectMap, "productName", s.ProductName) + populate(objectMap, "publisher", s.Publisher) + populate(objectMap, "publisherDisplayName", s.PublisherDisplayName) + populate(objectMap, "securityFamily", s.SecurityFamily) + populate(objectMap, "template", s.Template) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SolutionsReferenceDataProperties. +func (s *SolutionsReferenceDataProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "alertVendorName": + err = unpopulate(val, "AlertVendorName", &s.AlertVendorName) + delete(rawMsg, key) + case "packageInfoUrl": + err = unpopulate(val, "PackageInfoURL", &s.PackageInfoURL) + delete(rawMsg, key) + case "productName": + err = unpopulate(val, "ProductName", &s.ProductName) + delete(rawMsg, key) + case "publisher": + err = unpopulate(val, "Publisher", &s.Publisher) + delete(rawMsg, key) + case "publisherDisplayName": + err = unpopulate(val, "PublisherDisplayName", &s.PublisherDisplayName) + delete(rawMsg, key) + case "securityFamily": + err = unpopulate(val, "SecurityFamily", &s.SecurityFamily) + delete(rawMsg, key) + case "template": + err = unpopulate(val, "Template", &s.Template) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Standard. +func (s Standard) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Standard. +func (s *Standard) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { @@ -16125,8 +16952,8 @@ func (s *SettingsList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Software. -func (s Software) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StandardAssignment. +func (s StandardAssignment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) @@ -16135,8 +16962,8 @@ func (s Software) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Software. -func (s *Software) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StandardAssignment. +func (s *StandardAssignment) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -16164,23 +16991,18 @@ func (s *Software) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SoftwareProperties. -func (s SoftwareProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StandardAssignmentMetadata. +func (s StandardAssignmentMetadata) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "deviceId", s.DeviceID) - populate(objectMap, "endOfSupportDate", s.EndOfSupportDate) - populate(objectMap, "endOfSupportStatus", s.EndOfSupportStatus) - populate(objectMap, "firstSeenAt", s.FirstSeenAt) - populate(objectMap, "numberOfKnownVulnerabilities", s.NumberOfKnownVulnerabilities) - populate(objectMap, "osPlatform", s.OSPlatform) - populate(objectMap, "softwareName", s.SoftwareName) - populate(objectMap, "vendor", s.Vendor) - populate(objectMap, "version", s.Version) + populate(objectMap, "createdBy", s.CreatedBy) + populateDateTimeRFC3339(objectMap, "createdOn", s.CreatedOn) + populate(objectMap, "lastUpdatedBy", s.LastUpdatedBy) + populateDateTimeRFC3339(objectMap, "lastUpdatedOn", s.LastUpdatedOn) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SoftwareProperties. -func (s *SoftwareProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StandardAssignmentMetadata. +func (s *StandardAssignmentMetadata) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -16188,32 +17010,17 @@ func (s *SoftwareProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "deviceId": - err = unpopulate(val, "DeviceID", &s.DeviceID) - delete(rawMsg, key) - case "endOfSupportDate": - err = unpopulate(val, "EndOfSupportDate", &s.EndOfSupportDate) - delete(rawMsg, key) - case "endOfSupportStatus": - err = unpopulate(val, "EndOfSupportStatus", &s.EndOfSupportStatus) - delete(rawMsg, key) - case "firstSeenAt": - err = unpopulate(val, "FirstSeenAt", &s.FirstSeenAt) - delete(rawMsg, key) - case "numberOfKnownVulnerabilities": - err = unpopulate(val, "NumberOfKnownVulnerabilities", &s.NumberOfKnownVulnerabilities) - delete(rawMsg, key) - case "osPlatform": - err = unpopulate(val, "OSPlatform", &s.OSPlatform) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) delete(rawMsg, key) - case "softwareName": - err = unpopulate(val, "SoftwareName", &s.SoftwareName) + case "createdOn": + err = unpopulateDateTimeRFC3339(val, "CreatedOn", &s.CreatedOn) delete(rawMsg, key) - case "vendor": - err = unpopulate(val, "Vendor", &s.Vendor) + case "lastUpdatedBy": + err = unpopulate(val, "LastUpdatedBy", &s.LastUpdatedBy) delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &s.Version) + case "lastUpdatedOn": + err = unpopulateDateTimeRFC3339(val, "LastUpdatedOn", &s.LastUpdatedOn) delete(rawMsg, key) } if err != nil { @@ -16223,16 +17030,23 @@ func (s *SoftwareProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SoftwaresList. -func (s SoftwaresList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StandardAssignmentProperties. +func (s StandardAssignmentProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + populate(objectMap, "assignedStandard", s.AssignedStandard) + populate(objectMap, "attestationData", s.AttestationData) + populate(objectMap, "description", s.Description) + populate(objectMap, "displayName", s.DisplayName) + populate(objectMap, "effect", s.Effect) + populate(objectMap, "excludedScopes", s.ExcludedScopes) + populate(objectMap, "exemptionData", s.ExemptionData) + populateDateTimeRFC3339(objectMap, "expiresOn", s.ExpiresOn) + populate(objectMap, "metadata", s.Metadata) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SoftwaresList. -func (s *SoftwaresList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StandardAssignmentProperties. +func (s *StandardAssignmentProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -16240,11 +17054,32 @@ func (s *SoftwaresList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) + case "assignedStandard": + err = unpopulate(val, "AssignedStandard", &s.AssignedStandard) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "attestationData": + err = unpopulate(val, "AttestationData", &s.AttestationData) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &s.DisplayName) + delete(rawMsg, key) + case "effect": + err = unpopulate(val, "Effect", &s.Effect) + delete(rawMsg, key) + case "excludedScopes": + err = unpopulate(val, "ExcludedScopes", &s.ExcludedScopes) + delete(rawMsg, key) + case "exemptionData": + err = unpopulate(val, "ExemptionData", &s.ExemptionData) + delete(rawMsg, key) + case "expiresOn": + err = unpopulateDateTimeRFC3339(val, "ExpiresOn", &s.ExpiresOn) + delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &s.Metadata) delete(rawMsg, key) } if err != nil { @@ -16254,19 +17089,18 @@ func (s *SoftwaresList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Solution. -func (s Solution) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StandardAssignmentPropertiesAttestationData. +func (s StandardAssignmentPropertiesAttestationData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) + populate(objectMap, "assignedAssessment", s.AssignedAssessment) + populateDateTimeRFC3339(objectMap, "complianceDate", s.ComplianceDate) + populate(objectMap, "complianceState", s.ComplianceState) + populate(objectMap, "evidence", s.Evidence) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Solution. -func (s *Solution) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StandardAssignmentPropertiesAttestationData. +func (s *StandardAssignmentPropertiesAttestationData) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -16274,20 +17108,17 @@ func (s *Solution) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &s.Location) + case "assignedAssessment": + err = unpopulate(val, "AssignedAssessment", &s.AssignedAssessment) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) + case "complianceDate": + err = unpopulateDateTimeRFC3339(val, "ComplianceDate", &s.ComplianceDate) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "complianceState": + err = unpopulate(val, "ComplianceState", &s.ComplianceState) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + case "evidence": + err = unpopulate(val, "Evidence", &s.Evidence) delete(rawMsg, key) } if err != nil { @@ -16297,16 +17128,16 @@ func (s *Solution) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SolutionList. -func (s SolutionList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StandardAssignmentPropertiesExemptionData. +func (s StandardAssignmentPropertiesExemptionData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) + populate(objectMap, "assignedAssessment", s.AssignedAssessment) + populate(objectMap, "exemptionCategory", s.ExemptionCategory) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SolutionList. -func (s *SolutionList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StandardAssignmentPropertiesExemptionData. +func (s *StandardAssignmentPropertiesExemptionData) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -16314,11 +17145,11 @@ func (s *SolutionList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &s.NextLink) + case "assignedAssessment": + err = unpopulate(val, "AssignedAssessment", &s.AssignedAssessment) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &s.Value) + case "exemptionCategory": + err = unpopulate(val, "ExemptionCategory", &s.ExemptionCategory) delete(rawMsg, key) } if err != nil { @@ -16328,18 +17159,16 @@ func (s *SolutionList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SolutionProperties. -func (s SolutionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StandardAssignmentsList. +func (s StandardAssignmentsList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "protectionStatus", s.ProtectionStatus) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "securityFamily", s.SecurityFamily) - populate(objectMap, "template", s.Template) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SolutionProperties. -func (s *SolutionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StandardAssignmentsList. +func (s *StandardAssignmentsList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -16347,17 +17176,11 @@ func (s *SolutionProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "protectionStatus": - err = unpopulate(val, "ProtectionStatus", &s.ProtectionStatus) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "securityFamily": - err = unpopulate(val, "SecurityFamily", &s.SecurityFamily) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "template": - err = unpopulate(val, "Template", &s.Template) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { @@ -16367,19 +17190,16 @@ func (s *SolutionProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SolutionsReferenceData. -func (s SolutionsReferenceData) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StandardList. +func (s StandardList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", s.ID) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SolutionsReferenceData. -func (s *SolutionsReferenceData) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StandardList. +func (s *StandardList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -16387,20 +17207,11 @@ func (s *SolutionsReferenceData) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &s.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &s.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &s.Properties) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &s.Type) + case "value": + err = unpopulate(val, "Value", &s.Value) delete(rawMsg, key) } if err != nil { @@ -16410,15 +17221,18 @@ func (s *SolutionsReferenceData) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SolutionsReferenceDataList. -func (s SolutionsReferenceDataList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StandardMetadata. +func (s StandardMetadata) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", s.Value) + populate(objectMap, "createdBy", s.CreatedBy) + populateDateTimeRFC3339(objectMap, "createdOn", s.CreatedOn) + populate(objectMap, "lastUpdatedBy", s.LastUpdatedBy) + populateDateTimeRFC3339(objectMap, "lastUpdatedOn", s.LastUpdatedOn) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SolutionsReferenceDataList. -func (s *SolutionsReferenceDataList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StandardMetadata. +func (s *StandardMetadata) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -16426,8 +17240,17 @@ func (s *SolutionsReferenceDataList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &s.Value) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdOn": + err = unpopulateDateTimeRFC3339(val, "CreatedOn", &s.CreatedOn) + delete(rawMsg, key) + case "lastUpdatedBy": + err = unpopulate(val, "LastUpdatedBy", &s.LastUpdatedBy) + delete(rawMsg, key) + case "lastUpdatedOn": + err = unpopulateDateTimeRFC3339(val, "LastUpdatedOn", &s.LastUpdatedOn) delete(rawMsg, key) } if err != nil { @@ -16437,21 +17260,21 @@ func (s *SolutionsReferenceDataList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type SolutionsReferenceDataProperties. -func (s SolutionsReferenceDataProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type StandardProperties. +func (s StandardProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "alertVendorName", s.AlertVendorName) - populate(objectMap, "packageInfoUrl", s.PackageInfoURL) - populate(objectMap, "productName", s.ProductName) - populate(objectMap, "publisher", s.Publisher) - populate(objectMap, "publisherDisplayName", s.PublisherDisplayName) - populate(objectMap, "securityFamily", s.SecurityFamily) - populate(objectMap, "template", s.Template) + populate(objectMap, "assessments", s.Assessments) + populate(objectMap, "cloudProviders", s.CloudProviders) + populate(objectMap, "description", s.Description) + populate(objectMap, "displayName", s.DisplayName) + populate(objectMap, "metadata", s.Metadata) + populate(objectMap, "policySetDefinitionId", s.PolicySetDefinitionID) + populate(objectMap, "standardType", s.StandardType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SolutionsReferenceDataProperties. -func (s *SolutionsReferenceDataProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type StandardProperties. +func (s *StandardProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", s, err) @@ -16459,26 +17282,26 @@ func (s *SolutionsReferenceDataProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "alertVendorName": - err = unpopulate(val, "AlertVendorName", &s.AlertVendorName) + case "assessments": + err = unpopulate(val, "Assessments", &s.Assessments) delete(rawMsg, key) - case "packageInfoUrl": - err = unpopulate(val, "PackageInfoURL", &s.PackageInfoURL) + case "cloudProviders": + err = unpopulate(val, "CloudProviders", &s.CloudProviders) delete(rawMsg, key) - case "productName": - err = unpopulate(val, "ProductName", &s.ProductName) + case "description": + err = unpopulate(val, "Description", &s.Description) delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &s.Publisher) + case "displayName": + err = unpopulate(val, "DisplayName", &s.DisplayName) delete(rawMsg, key) - case "publisherDisplayName": - err = unpopulate(val, "PublisherDisplayName", &s.PublisherDisplayName) + case "metadata": + err = unpopulate(val, "Metadata", &s.Metadata) delete(rawMsg, key) - case "securityFamily": - err = unpopulate(val, "SecurityFamily", &s.SecurityFamily) + case "policySetDefinitionId": + err = unpopulate(val, "PolicySetDefinitionID", &s.PolicySetDefinitionID) delete(rawMsg, key) - case "template": - err = unpopulate(val, "Template", &s.Template) + case "standardType": + err = unpopulate(val, "StandardType", &s.StandardType) delete(rawMsg, key) } if err != nil { @@ -17610,76 +18433,6 @@ func (u *UserDefinedResourcesProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type UserRecommendation. -func (u UserRecommendation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "recommendationAction", u.RecommendationAction) - populate(objectMap, "username", u.Username) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UserRecommendation. -func (u *UserRecommendation) 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", u, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "recommendationAction": - err = unpopulate(val, "RecommendationAction", &u.RecommendationAction) - delete(rawMsg, key) - case "username": - err = unpopulate(val, "Username", &u.Username) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type VMRecommendation. -func (v VMRecommendation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "configurationStatus", v.ConfigurationStatus) - populate(objectMap, "enforcementSupport", v.EnforcementSupport) - populate(objectMap, "recommendationAction", v.RecommendationAction) - populate(objectMap, "resourceId", v.ResourceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VMRecommendation. -func (v *VMRecommendation) 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", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "configurationStatus": - err = unpopulate(val, "ConfigurationStatus", &v.ConfigurationStatus) - delete(rawMsg, key) - case "enforcementSupport": - err = unpopulate(val, "EnforcementSupport", &v.EnforcementSupport) - delete(rawMsg, key) - case "recommendationAction": - err = unpopulate(val, "RecommendationAction", &v.RecommendationAction) - delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, "ResourceID", &v.ResourceID) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type VMScannersAws. func (v VMScannersAws) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/security/armsecurity/operations_client.go b/sdk/resourcemanager/security/armsecurity/operations_client.go index 3157d1c8d7c2..2590446ef0d2 100644 --- a/sdk/resourcemanager/security/armsecurity/operations_client.go +++ b/sdk/resourcemanager/security/armsecurity/operations_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -39,7 +36,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Exposes all available operations for discovery purposes. // -// Generated from API version 2015-06-01-preview +// Generated from API version 2024-10-01-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -65,14 +62,14 @@ func (client *OperationsClient) NewListPager(options *OperationsClientListOption } // listCreateRequest creates the List request. -func (client *OperationsClient) listCreateRequest(ctx context.Context, options *OperationsClientListOptions) (*policy.Request, error) { +func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *OperationsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Security/operations" req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2015-06-01-preview") + reqQP.Set("api-version", "2024-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -81,7 +78,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * // listHandleResponse handles the List response. func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { result := OperationsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.OperationList); err != nil { + if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { return OperationsClientListResponse{}, err } return result, nil diff --git a/sdk/resourcemanager/security/armsecurity/operators_client.go b/sdk/resourcemanager/security/armsecurity/operators_client.go index 9e66b7c8f881..722c04c0ebc3 100644 --- a/sdk/resourcemanager/security/armsecurity/operators_client.go +++ b/sdk/resourcemanager/security/armsecurity/operators_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -74,7 +71,7 @@ func (client *OperatorsClient) CreateOrUpdate(ctx context.Context, pricingName s } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *OperatorsClient) createOrUpdateCreateRequest(ctx context.Context, pricingName string, securityOperatorName string, options *OperatorsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *OperatorsClient) createOrUpdateCreateRequest(ctx context.Context, pricingName string, securityOperatorName string, _ *OperatorsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators/{securityOperatorName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -137,7 +134,7 @@ func (client *OperatorsClient) Delete(ctx context.Context, pricingName string, s } // deleteCreateRequest creates the Delete request. -func (client *OperatorsClient) deleteCreateRequest(ctx context.Context, pricingName string, securityOperatorName string, options *OperatorsClientDeleteOptions) (*policy.Request, error) { +func (client *OperatorsClient) deleteCreateRequest(ctx context.Context, pricingName string, securityOperatorName string, _ *OperatorsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators/{securityOperatorName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -192,7 +189,7 @@ func (client *OperatorsClient) Get(ctx context.Context, pricingName string, secu } // getCreateRequest creates the Get request. -func (client *OperatorsClient) getCreateRequest(ctx context.Context, pricingName string, securityOperatorName string, options *OperatorsClientGetOptions) (*policy.Request, error) { +func (client *OperatorsClient) getCreateRequest(ctx context.Context, pricingName string, securityOperatorName string, _ *OperatorsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators/{securityOperatorName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -255,7 +252,7 @@ func (client *OperatorsClient) List(ctx context.Context, pricingName string, opt } // listCreateRequest creates the List request. -func (client *OperatorsClient) listCreateRequest(ctx context.Context, pricingName string, options *OperatorsClientListOptions) (*policy.Request, error) { +func (client *OperatorsClient) listCreateRequest(ctx context.Context, pricingName string, _ *OperatorsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/pricings/{pricingName}/securityOperators" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") diff --git a/sdk/resourcemanager/security/armsecurity/operators_client_example_test.go b/sdk/resourcemanager/security/armsecurity/operators_client_example_test.go deleted file mode 100644 index 14d50b3eca91..000000000000 --- a/sdk/resourcemanager/security/armsecurity/operators_client_example_test.go +++ /dev/null @@ -1,128 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-01-01-preview/examples/SecurityOperators/ListSecurityOperators_example.json -func ExampleOperatorsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOperatorsClient().List(ctx, "CloudPosture", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperatorList = armsecurity.OperatorList{ - // Value: []*armsecurity.OperatorResource{ - // { - // Name: to.Ptr("DefenderCSPMSecurityOperator"), - // Type: to.Ptr("Microsoft.Security/pricings/securityOperator"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/CloudPosture/securityOperators/DefenderCSPMSecurityOperator"), - // Identity: &armsecurity.Identity{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("44ee8e7e-7f52-4750-b937-27490fbf7663"), - // TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-01-01-preview/examples/SecurityOperators/GetSecurityOperatorByName_example.json -func ExampleOperatorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOperatorsClient().Get(ctx, "CloudPosture", "DefenderCSPMSecurityOperator", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperatorResource = armsecurity.OperatorResource{ - // Name: to.Ptr("DefenderCSPMSecurityOperator"), - // Type: to.Ptr("Microsoft.Security/pricings/securityOperator"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/CloudPosture/securityOperators/DefenderCSPMSecurityOperator"), - // Identity: &armsecurity.Identity{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("44ee8e7e-7f52-4750-b937-27490fbf7663"), - // TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-01-01-preview/examples/SecurityOperators/PutSecurityOperatorByName_example.json -func ExampleOperatorsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOperatorsClient().CreateOrUpdate(ctx, "CloudPosture", "DefenderCSPMSecurityOperator", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperatorResource = armsecurity.OperatorResource{ - // Name: to.Ptr("DefenderCSPMSecurityOperator"), - // Type: to.Ptr("Microsoft.Security/pricings/securityOperator"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/CloudPosture/securityOperators/DefenderCSPMSecurityOperator"), - // Identity: &armsecurity.Identity{ - // Type: to.Ptr("SystemAssigned"), - // PrincipalID: to.Ptr("44ee8e7e-7f52-4750-b937-27490fbf7663"), - // TenantID: to.Ptr("72f988bf-86f1-41af-91ab-2d7cd011db47"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-01-01-preview/examples/SecurityOperators/DeleteSecurityOperatorByName_example.json -func ExampleOperatorsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewOperatorsClient().Delete(ctx, "CloudPosture", "DefenderCSPMSecurityOperator", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/options.go b/sdk/resourcemanager/security/armsecurity/options.go index 23cfae73dfc9..3e405349f44e 100644 --- a/sdk/resourcemanager/security/armsecurity/options.go +++ b/sdk/resourcemanager/security/armsecurity/options.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -11,7 +8,7 @@ package armsecurity // APICollectionsClientBeginOnboardAzureAPIManagementAPIOptions contains the optional parameters for the APICollectionsClient.BeginOnboardAzureAPIManagementAPI // method. type APICollectionsClientBeginOnboardAzureAPIManagementAPIOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -66,53 +63,6 @@ type AccountConnectorsClientListOptions struct { // placeholder for future optional parameters } -// AdaptiveApplicationControlsClientDeleteOptions contains the optional parameters for the AdaptiveApplicationControlsClient.Delete -// method. -type AdaptiveApplicationControlsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// AdaptiveApplicationControlsClientGetOptions contains the optional parameters for the AdaptiveApplicationControlsClient.Get -// method. -type AdaptiveApplicationControlsClientGetOptions struct { - // placeholder for future optional parameters -} - -// AdaptiveApplicationControlsClientListOptions contains the optional parameters for the AdaptiveApplicationControlsClient.List -// method. -type AdaptiveApplicationControlsClientListOptions struct { - // Include the policy rules - IncludePathRecommendations *bool - - // Return output in a summarized form - Summary *bool -} - -// AdaptiveApplicationControlsClientPutOptions contains the optional parameters for the AdaptiveApplicationControlsClient.Put -// method. -type AdaptiveApplicationControlsClientPutOptions struct { - // placeholder for future optional parameters -} - -// AdaptiveNetworkHardeningsClientBeginEnforceOptions contains the optional parameters for the AdaptiveNetworkHardeningsClient.BeginEnforce -// method. -type AdaptiveNetworkHardeningsClientBeginEnforceOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AdaptiveNetworkHardeningsClientGetOptions contains the optional parameters for the AdaptiveNetworkHardeningsClient.Get -// method. -type AdaptiveNetworkHardeningsClientGetOptions struct { - // placeholder for future optional parameters -} - -// AdaptiveNetworkHardeningsClientListByExtendedResourceOptions contains the optional parameters for the AdaptiveNetworkHardeningsClient.NewListByExtendedResourcePager -// method. -type AdaptiveNetworkHardeningsClientListByExtendedResourceOptions struct { - // placeholder for future optional parameters -} - // AdvancedThreatProtectionClientCreateOptions contains the optional parameters for the AdvancedThreatProtectionClient.Create // method. type AdvancedThreatProtectionClientCreateOptions struct { @@ -126,7 +76,7 @@ type AdvancedThreatProtectionClientGetOptions struct { // AlertsClientBeginSimulateOptions contains the optional parameters for the AlertsClient.BeginSimulate method. type AlertsClientBeginSimulateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -382,13 +332,13 @@ type AutomationsClientValidateOptions struct { // AzureDevOpsOrgsClientBeginCreateOrUpdateOptions contains the optional parameters for the AzureDevOpsOrgsClient.BeginCreateOrUpdate // method. type AzureDevOpsOrgsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AzureDevOpsOrgsClientBeginUpdateOptions contains the optional parameters for the AzureDevOpsOrgsClient.BeginUpdate method. type AzureDevOpsOrgsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -411,14 +361,14 @@ type AzureDevOpsOrgsClientListOptions struct { // AzureDevOpsProjectsClientBeginCreateOrUpdateOptions contains the optional parameters for the AzureDevOpsProjectsClient.BeginCreateOrUpdate // method. type AzureDevOpsProjectsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AzureDevOpsProjectsClientBeginUpdateOptions contains the optional parameters for the AzureDevOpsProjectsClient.BeginUpdate // method. type AzureDevOpsProjectsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -435,13 +385,13 @@ type AzureDevOpsProjectsClientListOptions struct { // AzureDevOpsReposClientBeginCreateOrUpdateOptions contains the optional parameters for the AzureDevOpsReposClient.BeginCreateOrUpdate // method. type AzureDevOpsReposClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // AzureDevOpsReposClientBeginUpdateOptions contains the optional parameters for the AzureDevOpsReposClient.BeginUpdate method. type AzureDevOpsReposClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -608,34 +558,74 @@ type CustomEntityStoreAssignmentsClientListBySubscriptionOptions struct { // placeholder for future optional parameters } +// CustomRecommendationsClientCreateOrUpdateOptions contains the optional parameters for the CustomRecommendationsClient.CreateOrUpdate +// method. +type CustomRecommendationsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// CustomRecommendationsClientDeleteOptions contains the optional parameters for the CustomRecommendationsClient.Delete method. +type CustomRecommendationsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// CustomRecommendationsClientGetOptions contains the optional parameters for the CustomRecommendationsClient.Get method. +type CustomRecommendationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// CustomRecommendationsClientListOptions contains the optional parameters for the CustomRecommendationsClient.NewListPager +// method. +type CustomRecommendationsClientListOptions struct { + // placeholder for future optional parameters +} + +// DefenderForStorageClientCancelMalwareScanOptions contains the optional parameters for the DefenderForStorageClient.CancelMalwareScan +// method. +type DefenderForStorageClientCancelMalwareScanOptions struct { + // placeholder for future optional parameters +} + // DefenderForStorageClientCreateOptions contains the optional parameters for the DefenderForStorageClient.Create method. type DefenderForStorageClientCreateOptions struct { // placeholder for future optional parameters } +// DefenderForStorageClientGetMalwareScanOptions contains the optional parameters for the DefenderForStorageClient.GetMalwareScan +// method. +type DefenderForStorageClientGetMalwareScanOptions struct { + // placeholder for future optional parameters +} + // DefenderForStorageClientGetOptions contains the optional parameters for the DefenderForStorageClient.Get method. type DefenderForStorageClientGetOptions struct { // placeholder for future optional parameters } +// DefenderForStorageClientStartMalwareScanOptions contains the optional parameters for the DefenderForStorageClient.StartMalwareScan +// method. +type DefenderForStorageClientStartMalwareScanOptions struct { + // placeholder for future optional parameters +} + // DevOpsConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the DevOpsConfigurationsClient.BeginCreateOrUpdate // method. type DevOpsConfigurationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // DevOpsConfigurationsClientBeginDeleteOptions contains the optional parameters for the DevOpsConfigurationsClient.BeginDelete // method. type DevOpsConfigurationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } // DevOpsConfigurationsClientBeginUpdateOptions contains the optional parameters for the DevOpsConfigurationsClient.BeginUpdate // method. type DevOpsConfigurationsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -792,7 +782,7 @@ type GovernanceAssignmentsClientListOptions struct { // GovernanceRulesClientBeginDeleteOptions contains the optional parameters for the GovernanceRulesClient.BeginDelete method. type GovernanceRulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -801,7 +791,7 @@ type GovernanceRulesClientBeginExecuteOptions struct { // Execute governance rule over a given scope ExecuteGovernanceRuleParams *ExecuteGovernanceRuleParams - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1196,7 +1186,7 @@ type SensitivitySettingsClientListOptions struct { // ServerVulnerabilityAssessmentClientBeginDeleteOptions contains the optional parameters for the ServerVulnerabilityAssessmentClient.BeginDelete // method. type ServerVulnerabilityAssessmentClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. + // Resumes the long-running operation from the provided token. ResumeToken string } @@ -1295,6 +1285,46 @@ type SolutionsReferenceDataClientListOptions struct { // placeholder for future optional parameters } +// StandardAssignmentsClientCreateOptions contains the optional parameters for the StandardAssignmentsClient.Create method. +type StandardAssignmentsClientCreateOptions struct { + // placeholder for future optional parameters +} + +// StandardAssignmentsClientDeleteOptions contains the optional parameters for the StandardAssignmentsClient.Delete method. +type StandardAssignmentsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// StandardAssignmentsClientGetOptions contains the optional parameters for the StandardAssignmentsClient.Get method. +type StandardAssignmentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// StandardAssignmentsClientListOptions contains the optional parameters for the StandardAssignmentsClient.NewListPager method. +type StandardAssignmentsClientListOptions struct { + // placeholder for future optional parameters +} + +// StandardsClientCreateOrUpdateOptions contains the optional parameters for the StandardsClient.CreateOrUpdate method. +type StandardsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// StandardsClientDeleteOptions contains the optional parameters for the StandardsClient.Delete method. +type StandardsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// StandardsClientGetOptions contains the optional parameters for the StandardsClient.Get method. +type StandardsClientGetOptions struct { + // placeholder for future optional parameters +} + +// StandardsClientListOptions contains the optional parameters for the StandardsClient.NewListPager method. +type StandardsClientListOptions struct { + // placeholder for future optional parameters +} + // SubAssessmentsClientGetOptions contains the optional parameters for the SubAssessmentsClient.Get method. type SubAssessmentsClientGetOptions struct { // placeholder for future optional parameters diff --git a/sdk/resourcemanager/security/armsecurity/polymorphic_helpers.go b/sdk/resourcemanager/security/armsecurity/polymorphic_helpers.go index 065369e837a0..ba7ef395b2d8 100644 --- a/sdk/resourcemanager/security/armsecurity/polymorphic_helpers.go +++ b/sdk/resourcemanager/security/armsecurity/polymorphic_helpers.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -102,6 +99,27 @@ func unmarshalAllowlistCustomAlertRuleClassificationArray(rawMsg json.RawMessage return fArray, nil } +func unmarshalAuthenticationClassification(rawMsg json.RawMessage) (AuthenticationClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b AuthenticationClassification + switch m["authenticationType"] { + case "AccessToken": + b = &AccessTokenAuthentication{} + default: + b = &Authentication{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + func unmarshalAuthenticationDetailsPropertiesClassification(rawMsg json.RawMessage) (AuthenticationDetailsPropertiesClassification, error) { if rawMsg == nil || string(rawMsg) == "null" { return nil, nil @@ -208,20 +226,32 @@ func unmarshalCloudOfferingClassification(rawMsg json.RawMessage) (CloudOffering b = &CspmMonitorAwsOffering{} case string(OfferingTypeCspmMonitorAzureDevOps): b = &CspmMonitorAzureDevOpsOffering{} + case string(OfferingTypeCspmMonitorDockerHub): + b = &CspmMonitorDockerHubOffering{} case string(OfferingTypeCspmMonitorGcp): b = &CspmMonitorGcpOffering{} case string(OfferingTypeCspmMonitorGitLab): b = &CspmMonitorGitLabOffering{} case string(OfferingTypeCspmMonitorGithub): b = &CspmMonitorGithubOffering{} + case string(OfferingTypeCspmMonitorJFrog): + b = &CspmMonitorJFrogOffering{} case string(OfferingTypeDefenderCspmAws): b = &DefenderCspmAwsOffering{} + case string(OfferingTypeDefenderCspmDockerHub): + b = &DefenderCspmDockerHubOffering{} case string(OfferingTypeDefenderCspmGcp): b = &DefenderCspmGcpOffering{} + case string(OfferingTypeDefenderCspmJFrog): + b = &DefenderCspmJFrogOffering{} case string(OfferingTypeDefenderForContainersAws): b = &DefenderForContainersAwsOffering{} + case string(OfferingTypeDefenderForContainersDockerHub): + b = &DefenderForContainersDockerHubOffering{} case string(OfferingTypeDefenderForContainersGcp): b = &DefenderForContainersGcpOffering{} + case string(OfferingTypeDefenderForContainersJFrog): + b = &DefenderForContainersJFrogOffering{} case string(OfferingTypeDefenderForDatabasesAws): b = &DefenderFoDatabasesAwsOffering{} case string(OfferingTypeDefenderForDatabasesGcp): @@ -272,12 +302,16 @@ func unmarshalEnvironmentDataClassification(rawMsg json.RawMessage) (Environment b = &AwsEnvironmentData{} case string(EnvironmentTypeAzureDevOpsScope): b = &AzureDevOpsScopeEnvironmentData{} + case string(EnvironmentTypeDockerHubOrganization): + b = &DockerHubEnvironmentData{} case string(EnvironmentTypeGcpProject): b = &GcpProjectEnvironmentData{} case string(EnvironmentTypeGithubScope): b = &GithubScopeEnvironmentData{} case string(EnvironmentTypeGitlabScope): b = &GitlabScopeEnvironmentData{} + case string(EnvironmentTypeJFrogArtifactory): + b = &JFrogEnvironmentData{} default: b = &EnvironmentData{} } diff --git a/sdk/resourcemanager/security/armsecurity/pricings_client.go b/sdk/resourcemanager/security/armsecurity/pricings_client.go index 04992092a284..289a4ec84fba 100644 --- a/sdk/resourcemanager/security/armsecurity/pricings_client.go +++ b/sdk/resourcemanager/security/armsecurity/pricings_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -70,7 +67,7 @@ func (client *PricingsClient) Delete(ctx context.Context, scopeID string, pricin } // deleteCreateRequest creates the Delete request. -func (client *PricingsClient) deleteCreateRequest(ctx context.Context, scopeID string, pricingName string, options *PricingsClientDeleteOptions) (*policy.Request, error) { +func (client *PricingsClient) deleteCreateRequest(ctx context.Context, scopeID string, pricingName string, _ *PricingsClientDeleteOptions) (*policy.Request, error) { urlPath := "/{scopeId}/providers/Microsoft.Security/pricings/{pricingName}" urlPath = strings.ReplaceAll(urlPath, "{scopeId}", scopeID) if pricingName == "" { @@ -123,7 +120,7 @@ func (client *PricingsClient) Get(ctx context.Context, scopeID string, pricingNa } // getCreateRequest creates the Get request. -func (client *PricingsClient) getCreateRequest(ctx context.Context, scopeID string, pricingName string, options *PricingsClientGetOptions) (*policy.Request, error) { +func (client *PricingsClient) getCreateRequest(ctx context.Context, scopeID string, pricingName string, _ *PricingsClientGetOptions) (*policy.Request, error) { urlPath := "/{scopeId}/providers/Microsoft.Security/pricings/{pricingName}" urlPath = strings.ReplaceAll(urlPath, "{scopeId}", scopeID) if pricingName == "" { @@ -248,7 +245,7 @@ func (client *PricingsClient) Update(ctx context.Context, scopeID string, pricin } // updateCreateRequest creates the Update request. -func (client *PricingsClient) updateCreateRequest(ctx context.Context, scopeID string, pricingName string, pricing Pricing, options *PricingsClientUpdateOptions) (*policy.Request, error) { +func (client *PricingsClient) updateCreateRequest(ctx context.Context, scopeID string, pricingName string, pricing Pricing, _ *PricingsClientUpdateOptions) (*policy.Request, error) { urlPath := "/{scopeId}/providers/Microsoft.Security/pricings/{pricingName}" urlPath = strings.ReplaceAll(urlPath, "{scopeId}", scopeID) if pricingName == "" { 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 2cf9b1cb5b6e..000000000000 --- a/sdk/resourcemanager/security/armsecurity/pricings_client_example_test.go +++ /dev/null @@ -1,926 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/GetResourcePricingByNameVirtualMachines_example.json -func ExamplePricingsClient_Get_getPricingsOnResourceVirtualMachinesPlan() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPricingsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1", "VirtualMachines", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Pricing = armsecurity.Pricing{ - // Name: to.Ptr("VirtualMachines"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1/providers/Microsoft.Security/pricings/VirtualMachines"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // Inherited: to.Ptr(armsecurity.InheritedTrue), - // InheritedFrom: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // SubPlan: to.Ptr("P2"), - // Extensions: []*armsecurity.Extension{ - // { - // Name: to.Ptr("AgentlessVmScanning"), - // AdditionalExtensionProperties: map[string]any{ - // "ExclusionTags": "[{\"Key\":\"TestKey1\",\"Value\":\"TestValue1\"},{\"Key\":\"TestKey2\",\"Value\":\"TestValue2\"}]", - // }, - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }, - // { - // Name: to.Ptr("MdeDesignatedSubscription"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/GetPricingByNameCloudPosture_example.json -func ExamplePricingsClient_Get_getPricingsOnSubscriptionCloudPosturePlan() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPricingsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "CloudPosture", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Pricing = armsecurity.Pricing{ - // Name: to.Ptr("CloudPosture"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/CloudPosture"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()), - // Enforce: to.Ptr(armsecurity.EnforceFalse), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered), - // Extensions: []*armsecurity.Extension{ - // { - // Name: to.Ptr("AgentlessVmScanning"), - // AdditionalExtensionProperties: map[string]any{ - // "ExclusionTags": "[]", - // }, - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }, - // { - // Name: to.Ptr("AgentlessDiscoveryForKubernetes"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }, - // { - // Name: to.Ptr("SensitiveDataDiscovery"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }, - // { - // Name: to.Ptr("ContainerRegistriesVulnerabilityAssessments"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }, - // { - // Name: to.Ptr("EntraPermissionsManagement"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/GetPricingByNameContainers_example.json -func ExamplePricingsClient_Get_getPricingsOnSubscriptionContainersPlan() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPricingsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "Containers", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Pricing = armsecurity.Pricing{ - // Name: to.Ptr("Containers"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/Containers"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()), - // Enforce: to.Ptr(armsecurity.EnforceFalse), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered), - // Extensions: []*armsecurity.Extension{ - // { - // Name: to.Ptr("ContainerRegistriesVulnerabilityAssessments"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/GetPricingByNameDns_example.json -func ExamplePricingsClient_Get_getPricingsOnSubscriptionDnsPlan() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPricingsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "Dns", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Pricing = armsecurity.Pricing{ - // Name: to.Ptr("Dns"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/Dns"), - // Properties: &armsecurity.PricingProperties{ - // Deprecated: to.Ptr(true), - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()), - // Enforce: to.Ptr(armsecurity.EnforceFalse), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // ReplacedBy: []*string{ - // to.Ptr("VirtualMachines")}, - // ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/GetPricingByNameStorageAccounts_example.json -func ExamplePricingsClient_Get_getPricingsOnSubscriptionStorageAccountsPlan() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPricingsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "StorageAccounts", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Pricing = armsecurity.Pricing{ - // Name: to.Ptr("StorageAccounts"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/StorageAccounts"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()), - // Enforce: to.Ptr(armsecurity.EnforceFalse), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered), - // SubPlan: to.Ptr("PerStorageAccount"), - // Extensions: []*armsecurity.Extension{ - // { - // Name: to.Ptr("OnUploadMalwareScanning"), - // AdditionalExtensionProperties: map[string]any{ - // "capGBPerMonthPerStorageAccount": float64(10), - // }, - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }, - // { - // Name: to.Ptr("SensitiveDataDiscovery"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/GetPricingByNameVirtualMachines_example.json -func ExamplePricingsClient_Get_getPricingsOnSubscriptionVirtualMachinesPlan() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPricingsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "VirtualMachines", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Pricing = armsecurity.Pricing{ - // Name: to.Ptr("VirtualMachines"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/VirtualMachines"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()), - // Enforce: to.Ptr(armsecurity.EnforceFalse), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusPartiallyCovered), - // SubPlan: to.Ptr("P2"), - // Extensions: []*armsecurity.Extension{ - // { - // Name: to.Ptr("AgentlessVmScanning"), - // AdditionalExtensionProperties: map[string]any{ - // "ExclusionTags": "[{\"Key\":\"TestKey1\",\"Value\":\"TestValue1\"},{\"Key\":\"TestKey2\",\"Value\":\"TestValue2\"}]", - // }, - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }, - // { - // Name: to.Ptr("MdeDesignatedSubscription"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/PutResourcePricingByNameVirtualMachines_example.json -func ExamplePricingsClient_Update_updatePricingOnResourceExampleForVirtualMachinesPlan() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPricingsClient().Update(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1", "virtualMachines", armsecurity.Pricing{ - Properties: &armsecurity.PricingProperties{ - PricingTier: to.Ptr(armsecurity.PricingTierStandard), - SubPlan: to.Ptr("P1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Pricing = armsecurity.Pricing{ - // Name: to.Ptr("virtualMachines"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1/providers/Microsoft.Security/pricings/virtualMachines"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // Inherited: to.Ptr(armsecurity.InheritedFalse), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // SubPlan: to.Ptr("P1"), - // Extensions: []*armsecurity.Extension{ - // { - // Name: to.Ptr("MdeDesignatedSubscription"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledFalse), - // }, - // { - // Name: to.Ptr("AgentlessVmScanning"), - // AdditionalExtensionProperties: map[string]any{ - // "ExclusionTags": "[{\"Key\":\"TestKey1\",\"Value\":\"TestValue1\"},{\"Key\":\"TestKey2\",\"Value\":\"TestValue2\"}]", - // }, - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/PutPricingByName_example.json -func ExamplePricingsClient_Update_updatePricingOnSubscriptionExampleForCloudPosturePlan() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPricingsClient().Update(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "CloudPosture", armsecurity.Pricing{ - Properties: &armsecurity.PricingProperties{ - PricingTier: to.Ptr(armsecurity.PricingTierStandard), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Pricing = armsecurity.Pricing{ - // Name: to.Ptr("CloudPosture"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/CloudPosture"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()), - // Enforce: to.Ptr(armsecurity.EnforceFalse), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered), - // Extensions: []*armsecurity.Extension{ - // { - // Name: to.Ptr("AgentlessVmScanning"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // OperationStatus: &armsecurity.OperationStatusAutoGenerated{ - // Code: to.Ptr(armsecurity.CodeSucceeded), - // Message: to.Ptr("Successfully enabled extension"), - // }, - // }, - // { - // Name: to.Ptr("AgentlessDiscoveryForKubernetes"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // OperationStatus: &armsecurity.OperationStatusAutoGenerated{ - // Code: to.Ptr(armsecurity.CodeSucceeded), - // Message: to.Ptr("Successfully enabled extension"), - // }, - // }, - // { - // Name: to.Ptr("SensitiveDataDiscovery"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // OperationStatus: &armsecurity.OperationStatusAutoGenerated{ - // Code: to.Ptr(armsecurity.CodeSucceeded), - // Message: to.Ptr("Successfully enabled extension"), - // }, - // }, - // { - // Name: to.Ptr("ContainerRegistriesVulnerabilityAssessments"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // OperationStatus: &armsecurity.OperationStatusAutoGenerated{ - // Code: to.Ptr(armsecurity.CodeSucceeded), - // Message: to.Ptr("Successfully enabled extension"), - // }, - // }, - // { - // Name: to.Ptr("EntraPermissionsManagement"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // OperationStatus: &armsecurity.OperationStatusAutoGenerated{ - // Code: to.Ptr(armsecurity.CodeSucceeded), - // Message: to.Ptr("Successfully enabled extension"), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/PutPricingByNamePartialSuccess_example.json -func ExamplePricingsClient_Update_updatePricingOnSubscriptionExampleForCloudPosturePlanPartialSuccess() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPricingsClient().Update(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "CloudPosture", armsecurity.Pricing{ - Properties: &armsecurity.PricingProperties{ - PricingTier: to.Ptr(armsecurity.PricingTierStandard), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Pricing = armsecurity.Pricing{ - // Name: to.Ptr("CloudPosture"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/CloudPosture"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()), - // Enforce: to.Ptr(armsecurity.EnforceFalse), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered), - // Extensions: []*armsecurity.Extension{ - // { - // Name: to.Ptr("AgentlessVmScanning"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // OperationStatus: &armsecurity.OperationStatusAutoGenerated{ - // Code: to.Ptr(armsecurity.CodeFailed), - // Message: to.Ptr("Failed find dedicated first party application client ID for extension"), - // }, - // }, - // { - // Name: to.Ptr("AgentlessDiscoveryForKubernetes"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // OperationStatus: &armsecurity.OperationStatusAutoGenerated{ - // Code: to.Ptr(armsecurity.CodeFailed), - // Message: to.Ptr("Failed assigning roles {d5a2ae44-610b-4500-93be-660a0c5f5ca6} to {identityName} for plan"), - // }, - // }, - // { - // Name: to.Ptr("SensitiveDataDiscovery"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // OperationStatus: &armsecurity.OperationStatusAutoGenerated{ - // Code: to.Ptr(armsecurity.CodeFailed), - // Message: to.Ptr("Failed assigning roles {f58310d9-a9f6-439a-9e8d-f62e7b41a168} to {identityName} for plan"), - // }, - // }, - // { - // Name: to.Ptr("ContainerRegistriesVulnerabilityAssessments"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // OperationStatus: &armsecurity.OperationStatusAutoGenerated{ - // Code: to.Ptr(armsecurity.CodeSucceeded), - // Message: to.Ptr("Successfully enabled extension"), - // }, - // }, - // { - // Name: to.Ptr("EntraPermissionsManagement"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // OperationStatus: &armsecurity.OperationStatusAutoGenerated{ - // Code: to.Ptr(armsecurity.CodeSucceeded), - // Message: to.Ptr("Successfully enabled extension"), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/PutPricingVMsByName_example.json -func ExamplePricingsClient_Update_updatePricingOnSubscriptionExampleForVirtualMachinesPlan() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPricingsClient().Update(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "VirtualMachines", armsecurity.Pricing{ - Properties: &armsecurity.PricingProperties{ - Enforce: to.Ptr(armsecurity.EnforceTrue), - PricingTier: to.Ptr(armsecurity.PricingTierStandard), - SubPlan: to.Ptr("P2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Pricing = armsecurity.Pricing{ - // Name: to.Ptr("VirtualMachines"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/VirtualMachines"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()), - // Enforce: to.Ptr(armsecurity.EnforceTrue), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered), - // SubPlan: to.Ptr("P2"), - // Extensions: []*armsecurity.Extension{ - // { - // Name: to.Ptr("MdeDesignatedSubscription"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledFalse), - // }, - // { - // Name: to.Ptr("AgentlessVmScanning"), - // AdditionalExtensionProperties: map[string]any{ - // "ExclusionTags": "[{\"Key\":\"TestKey1\",\"Value\":\"TestValue1\"},{\"Key\":\"TestKey2\",\"Value\":\"TestValue2\"}]", - // }, - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // OperationStatus: &armsecurity.OperationStatusAutoGenerated{ - // Code: to.Ptr(armsecurity.CodeSucceeded), - // Message: to.Ptr("Successfully enabled extension"), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/DeleteResourcePricing_example.json -func ExamplePricingsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewPricingsClient().Delete(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1", "VirtualMachines", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ListResourcePricings_example.json -func ExamplePricingsClient_List_getPricingsOnResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPricingsClient().List(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1", &armsecurity.PricingsClientListOptions{Filter: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PricingList = armsecurity.PricingList{ - // Value: []*armsecurity.Pricing{ - // { - // Name: to.Ptr("VirtualMachines"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1/providers/Microsoft.Security/pricings/VirtualMachines"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // Inherited: to.Ptr(armsecurity.InheritedTrue), - // InheritedFrom: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // SubPlan: to.Ptr("P2"), - // Extensions: []*armsecurity.Extension{ - // { - // Name: to.Ptr("AgentlessVmScanning"), - // AdditionalExtensionProperties: map[string]any{ - // "ExclusionTags": "[{\"Key\":\"TestKey1\",\"Value\":\"TestValue1\"},{\"Key\":\"TestKey2\",\"Value\":\"TestValue2\"}]", - // }, - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }, - // { - // Name: to.Ptr("MdeDesignatedSubscription"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }}, - // }, - // }, - // { - // Name: to.Ptr("CloudPosture"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/resourceGroups/DEMO/providers/Microsoft.Compute/virtualMachines/VM-1/providers/Microsoft.Security/pricings/CloudPosture"), - // Properties: &armsecurity.PricingProperties{ - // Inherited: to.Ptr(armsecurity.InheritedFalse), - // PricingTier: to.Ptr(armsecurity.PricingTierFree), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ListPricings_example.json -func ExamplePricingsClient_List_getPricingsOnSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPricingsClient().List(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", &armsecurity.PricingsClientListOptions{Filter: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PricingList = armsecurity.PricingList{ - // Value: []*armsecurity.Pricing{ - // { - // Name: to.Ptr("VirtualMachines"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/VirtualMachines"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()), - // Enforce: to.Ptr(armsecurity.EnforceFalse), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusPartiallyCovered), - // SubPlan: to.Ptr("P2"), - // Extensions: []*armsecurity.Extension{ - // { - // Name: to.Ptr("AgentlessVmScanning"), - // AdditionalExtensionProperties: map[string]any{ - // "ExclusionTags": "[{\"Key\":\"TestKey1\",\"Value\":\"TestValue1\"},{\"Key\":\"TestKey2\",\"Value\":\"TestValue2\"}]", - // }, - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }, - // { - // Name: to.Ptr("MdeDesignatedSubscription"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }}, - // }, - // }, - // { - // Name: to.Ptr("SqlServers"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/SqlServers"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()), - // Enforce: to.Ptr(armsecurity.EnforceFalse), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered), - // }, - // }, - // { - // Name: to.Ptr("AppServices"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/AppServices"), - // Properties: &armsecurity.PricingProperties{ - // Enforce: to.Ptr(armsecurity.EnforceFalse), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierFree), - // ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusNotCovered), - // }, - // }, - // { - // Name: to.Ptr("StorageAccounts"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/StorageAccounts"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()), - // Enforce: to.Ptr(armsecurity.EnforceFalse), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered), - // SubPlan: to.Ptr("DefenderForStorageV2"), - // Extensions: []*armsecurity.Extension{ - // { - // Name: to.Ptr("OnUploadMalwareScanning"), - // AdditionalExtensionProperties: map[string]any{ - // "capGBPerMonthPerStorageAccount": float64(10), - // }, - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }, - // { - // Name: to.Ptr("SensitiveDataDiscovery"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }}, - // }, - // }, - // { - // Name: to.Ptr("SqlServerVirtualMachines"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/SqlServerVirtualMachines"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()), - // Enforce: to.Ptr(armsecurity.EnforceFalse), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered), - // }, - // }, - // { - // Name: to.Ptr("KubernetesService"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/KubernetesService"), - // Properties: &armsecurity.PricingProperties{ - // Deprecated: to.Ptr(true), - // Enforce: to.Ptr(armsecurity.EnforceFalse), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierFree), - // ReplacedBy: []*string{ - // to.Ptr("Containers")}, - // ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusNotCovered), - // }, - // }, - // { - // Name: to.Ptr("ContainerRegistry"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/ContainerRegistry"), - // Properties: &armsecurity.PricingProperties{ - // Deprecated: to.Ptr(true), - // Enforce: to.Ptr(armsecurity.EnforceFalse), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierFree), - // ReplacedBy: []*string{ - // to.Ptr("Containers")}, - // ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusNotCovered), - // }, - // }, - // { - // Name: to.Ptr("KeyVaults"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/KeyVaults"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()), - // Enforce: to.Ptr(armsecurity.EnforceFalse), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered), - // SubPlan: to.Ptr("PerKeyVault"), - // }, - // }, - // { - // Name: to.Ptr("Dns"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/Dns"), - // Properties: &armsecurity.PricingProperties{ - // Deprecated: to.Ptr(true), - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()), - // Enforce: to.Ptr(armsecurity.EnforceFalse), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // ReplacedBy: []*string{ - // to.Ptr("VirtualMachines")}, - // ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered), - // }, - // }, - // { - // Name: to.Ptr("Arm"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/Arm"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()), - // Enforce: to.Ptr(armsecurity.EnforceFalse), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered), - // SubPlan: to.Ptr("PerSubscription"), - // }, - // }, - // { - // Name: to.Ptr("OpenSourceRelationalDatabases"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/OpenSourceRelationalDatabases"), - // Properties: &armsecurity.PricingProperties{ - // Enforce: to.Ptr(armsecurity.EnforceFalse), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered), - // }, - // }, - // { - // Name: to.Ptr("Containers"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/Containers"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()), - // Enforce: to.Ptr(armsecurity.EnforceFalse), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered), - // Extensions: []*armsecurity.Extension{ - // { - // Name: to.Ptr("ContainerRegistriesVulnerabilityAssessments"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }}, - // }, - // }, - // { - // Name: to.Ptr("CloudPosture"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/CloudPosture"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()), - // Enforce: to.Ptr(armsecurity.EnforceFalse), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered), - // Extensions: []*armsecurity.Extension{ - // { - // Name: to.Ptr("AgentlessVmScanning"), - // AdditionalExtensionProperties: map[string]any{ - // "ExclusionTags": "[]", - // }, - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }, - // { - // Name: to.Ptr("AgentlessDiscoveryForKubernetes"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }, - // { - // Name: to.Ptr("SensitiveDataDiscovery"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }, - // { - // Name: to.Ptr("ContainerRegistriesVulnerabilityAssessments"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }, - // { - // Name: to.Ptr("EntraPermissionsManagement"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }}, - // }, - // }, - // { - // Name: to.Ptr("Api"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/Api"), - // Properties: &armsecurity.PricingProperties{ - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // SubPlan: to.Ptr("P1"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2024-01-01/examples/Pricings/ListPricingsWithPlanFilter_example.json -func ExamplePricingsClient_List_getPricingsOnSubscriptionWithPlansFilter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPricingsClient().List(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", &armsecurity.PricingsClientListOptions{Filter: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PricingList = armsecurity.PricingList{ - // Value: []*armsecurity.Pricing{ - // { - // Name: to.Ptr("VirtualMachines"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/VirtualMachines"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()), - // Enforce: to.Ptr(armsecurity.EnforceFalse), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusPartiallyCovered), - // SubPlan: to.Ptr("P2"), - // Extensions: []*armsecurity.Extension{ - // { - // Name: to.Ptr("AgentlessVmScanning"), - // AdditionalExtensionProperties: map[string]any{ - // "ExclusionTags": "[{\"Key\":\"TestKey1\",\"Value\":\"TestValue1\"},{\"Key\":\"TestKey2\",\"Value\":\"TestValue2\"}]", - // }, - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }, - // { - // Name: to.Ptr("MdeDesignatedSubscription"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }}, - // }, - // }, - // { - // Name: to.Ptr("KeyVaults"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/KeyVaults"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.192Z"); return t}()), - // Enforce: to.Ptr(armsecurity.EnforceFalse), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // ResourcesCoverageStatus: to.Ptr(armsecurity.ResourcesCoverageStatusFullyCovered), - // SubPlan: to.Ptr("PerKeyVault"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/regulatorycomplianceassessments_client.go b/sdk/resourcemanager/security/armsecurity/regulatorycomplianceassessments_client.go index 8bb8018bee24..1439186d6fd5 100644 --- a/sdk/resourcemanager/security/armsecurity/regulatorycomplianceassessments_client.go +++ b/sdk/resourcemanager/security/armsecurity/regulatorycomplianceassessments_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -75,7 +72,7 @@ func (client *RegulatoryComplianceAssessmentsClient) Get(ctx context.Context, re } // getCreateRequest creates the Get request. -func (client *RegulatoryComplianceAssessmentsClient) getCreateRequest(ctx context.Context, regulatoryComplianceStandardName string, regulatoryComplianceControlName string, regulatoryComplianceAssessmentName string, options *RegulatoryComplianceAssessmentsClientGetOptions) (*policy.Request, error) { +func (client *RegulatoryComplianceAssessmentsClient) getCreateRequest(ctx context.Context, regulatoryComplianceStandardName string, regulatoryComplianceControlName string, regulatoryComplianceAssessmentName string, _ *RegulatoryComplianceAssessmentsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}/regulatoryComplianceAssessments/{regulatoryComplianceAssessmentName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 ffb7e2026e4e..000000000000 --- a/sdk/resourcemanager/security/armsecurity/regulatorycomplianceassessments_client_example_test.go +++ /dev/null @@ -1,122 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceAssessmentList_example.json -func ExampleRegulatoryComplianceAssessmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRegulatoryComplianceAssessmentsClient().NewListPager("PCI-DSS-3.2", "1.1", &armsecurity.RegulatoryComplianceAssessmentsClientListOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RegulatoryComplianceAssessmentList = armsecurity.RegulatoryComplianceAssessmentList{ - // Value: []*armsecurity.RegulatoryComplianceAssessment{ - // { - // Name: to.Ptr("968548cb-02b3-8cd2-11f8-0cf64ab1a347"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceAssessment"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/PCI-DSS-3.2/regulatoryComplianceControls/1.1/regulatoryComplianceAssessments/968548cb-02b3-8cd2-11f8-0cf64ab1a347"), - // Properties: &armsecurity.RegulatoryComplianceAssessmentProperties{ - // Description: to.Ptr("Troubleshoot missing scan data on your machines"), - // AssessmentDetailsLink: to.Ptr("https://management.azure.com/subscriptions/a27e854a-8578-4395-8eaf-6fc7849f3050/providers/Microsoft.Security/securityStatuses/968548cb-02b3-8cd2-11f8-0cf64ab1a347"), - // AssessmentType: to.Ptr("Assessment"), - // FailedResources: to.Ptr[int32](4), - // PassedResources: to.Ptr[int32](7), - // SkippedResources: to.Ptr[int32](0), - // State: to.Ptr(armsecurity.StateFailed), - // }, - // }, - // { - // Name: to.Ptr("3bcd234d-c9c7-c2a2-89e0-c01f419c1a8a"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceAssessment"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/PCI-DSS-3.2/regulatoryComplianceControls/2/regulatoryComplianceAssessments/3bcd234d-c9c7-c2a2-89e0-c01f419c1a8a"), - // Properties: &armsecurity.RegulatoryComplianceAssessmentProperties{ - // Description: to.Ptr("Resolve endpoint protection health issues on your machines"), - // AssessmentDetailsLink: to.Ptr("https://management.azure.com/subscriptions/a27e854a-8578-4395-8eaf-6fc7849f3050/providers/Microsoft.Security/securityStatuses/3bcd234d-c9c7-c2a2-89e0-c01f419c1a8a"), - // AssessmentType: to.Ptr("Assessment"), - // FailedResources: to.Ptr[int32](0), - // PassedResources: to.Ptr[int32](0), - // SkippedResources: to.Ptr[int32](10), - // State: to.Ptr(armsecurity.StateSkipped), - // }, - // }, - // { - // Name: to.Ptr("d1db3318-01ff-16de-29eb-28b344515626"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceAssessment"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/PCI-DSS-3.2/regulatoryComplianceControls/2.1/regulatoryComplianceAssessments/d1db3318-01ff-16de-29eb-28b344515626"), - // Properties: &armsecurity.RegulatoryComplianceAssessmentProperties{ - // Description: to.Ptr("Install monitoring agent on your machines"), - // AssessmentDetailsLink: to.Ptr("https://management.azure.com/subscriptions/a27e854a-8578-4395-8eaf-6fc7849f3050/providers/Microsoft.Security/securityStatuses/d1db3318-01ff-16de-29eb-28b344515626"), - // AssessmentType: to.Ptr("Assessment"), - // FailedResources: to.Ptr[int32](0), - // PassedResources: to.Ptr[int32](8), - // SkippedResources: to.Ptr[int32](0), - // State: to.Ptr(armsecurity.StatePassed), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceAssessment_example.json -func ExampleRegulatoryComplianceAssessmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegulatoryComplianceAssessmentsClient().Get(ctx, "PCI-DSS-3.2", "1.1", "968548cb-02b3-8cd2-11f8-0cf64ab1a347", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RegulatoryComplianceAssessment = armsecurity.RegulatoryComplianceAssessment{ - // Name: to.Ptr("968548cb-02b3-8cd2-11f8-0cf64ab1a347"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceAssessment"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/PCI-DSS-3.2/regulatoryComplianceControls/1.1/regulatoryComplianceAssessments/968548cb-02b3-8cd2-11f8-0cf64ab1a347"), - // Properties: &armsecurity.RegulatoryComplianceAssessmentProperties{ - // Description: to.Ptr("Troubleshoot missing scan data on your machines"), - // AssessmentDetailsLink: to.Ptr("https://management.azure.com/subscriptions/a27e854a-8578-4395-8eaf-6fc7849f3050/providers/Microsoft.Security/securityStatuses/968548cb-02b3-8cd2-11f8-0cf64ab1a347"), - // AssessmentType: to.Ptr("Assessment"), - // FailedResources: to.Ptr[int32](4), - // PassedResources: to.Ptr[int32](7), - // SkippedResources: to.Ptr[int32](0), - // State: to.Ptr(armsecurity.StateFailed), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/regulatorycompliancecontrols_client.go b/sdk/resourcemanager/security/armsecurity/regulatorycompliancecontrols_client.go index cdc70102cd59..2ef598e4e64a 100644 --- a/sdk/resourcemanager/security/armsecurity/regulatorycompliancecontrols_client.go +++ b/sdk/resourcemanager/security/armsecurity/regulatorycompliancecontrols_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -74,7 +71,7 @@ func (client *RegulatoryComplianceControlsClient) Get(ctx context.Context, regul } // getCreateRequest creates the Get request. -func (client *RegulatoryComplianceControlsClient) getCreateRequest(ctx context.Context, regulatoryComplianceStandardName string, regulatoryComplianceControlName string, options *RegulatoryComplianceControlsClientGetOptions) (*policy.Request, error) { +func (client *RegulatoryComplianceControlsClient) getCreateRequest(ctx context.Context, regulatoryComplianceStandardName string, regulatoryComplianceControlName string, _ *RegulatoryComplianceControlsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}/regulatoryComplianceControls/{regulatoryComplianceControlName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 61a3988d349d..000000000000 --- a/sdk/resourcemanager/security/armsecurity/regulatorycompliancecontrols_client_example_test.go +++ /dev/null @@ -1,114 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceControlList_example.json -func ExampleRegulatoryComplianceControlsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRegulatoryComplianceControlsClient().NewListPager("PCI-DSS-3.2", &armsecurity.RegulatoryComplianceControlsClientListOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RegulatoryComplianceControlList = armsecurity.RegulatoryComplianceControlList{ - // Value: []*armsecurity.RegulatoryComplianceControl{ - // { - // Name: to.Ptr("1.1"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceControl"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/PCI-DSS-3.2/regulatoryComplianceControls/1.1"), - // Properties: &armsecurity.RegulatoryComplianceControlProperties{ - // Description: to.Ptr("Common Criteria Related to Organization and Management."), - // FailedAssessments: to.Ptr[int32](4), - // PassedAssessments: to.Ptr[int32](7), - // SkippedAssessments: to.Ptr[int32](0), - // State: to.Ptr(armsecurity.StateFailed), - // }, - // }, - // { - // Name: to.Ptr("2"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceControl"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/PCI-DSS-3.2/regulatoryComplianceControls/2"), - // Properties: &armsecurity.RegulatoryComplianceControlProperties{ - // Description: to.Ptr("Confidential information is protected during the system design, development, testing, implementation, and change processes in accordance with confidentiality commitments and requirements."), - // FailedAssessments: to.Ptr[int32](0), - // PassedAssessments: to.Ptr[int32](0), - // SkippedAssessments: to.Ptr[int32](10), - // State: to.Ptr(armsecurity.StateSkipped), - // }, - // }, - // { - // Name: to.Ptr("2.1"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceControl"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/PCI-DSS-3.2/regulatoryComplianceControls/2.1"), - // Properties: &armsecurity.RegulatoryComplianceControlProperties{ - // Description: to.Ptr("Changes to confidentiality commitments and requirements are communicated to internal and external users, vendors, and other third parties whose products and services are included in the system."), - // FailedAssessments: to.Ptr[int32](0), - // PassedAssessments: to.Ptr[int32](0), - // SkippedAssessments: to.Ptr[int32](0), - // State: to.Ptr(armsecurity.StateUnsupported), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceControl_example.json -func ExampleRegulatoryComplianceControlsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegulatoryComplianceControlsClient().Get(ctx, "PCI-DSS-3.2", "1.1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RegulatoryComplianceControl = armsecurity.RegulatoryComplianceControl{ - // Name: to.Ptr("1.1"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceControl"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/PCI-DSS-3.2/regulatoryComplianceControls/1.1"), - // Properties: &armsecurity.RegulatoryComplianceControlProperties{ - // Description: to.Ptr("Common Criteria Related to Organization and Management"), - // FailedAssessments: to.Ptr[int32](4), - // PassedAssessments: to.Ptr[int32](7), - // SkippedAssessments: to.Ptr[int32](0), - // State: to.Ptr(armsecurity.StateFailed), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/regulatorycompliancestandards_client.go b/sdk/resourcemanager/security/armsecurity/regulatorycompliancestandards_client.go index 57854003c17a..8e40f06d79f4 100644 --- a/sdk/resourcemanager/security/armsecurity/regulatorycompliancestandards_client.go +++ b/sdk/resourcemanager/security/armsecurity/regulatorycompliancestandards_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -73,7 +70,7 @@ func (client *RegulatoryComplianceStandardsClient) Get(ctx context.Context, regu } // getCreateRequest creates the Get request. -func (client *RegulatoryComplianceStandardsClient) getCreateRequest(ctx context.Context, regulatoryComplianceStandardName string, options *RegulatoryComplianceStandardsClientGetOptions) (*policy.Request, error) { +func (client *RegulatoryComplianceStandardsClient) getCreateRequest(ctx context.Context, regulatoryComplianceStandardName string, _ *RegulatoryComplianceStandardsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/regulatoryComplianceStandards/{regulatoryComplianceStandardName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 5055a0c669cf..000000000000 --- a/sdk/resourcemanager/security/armsecurity/regulatorycompliancestandards_client_example_test.go +++ /dev/null @@ -1,126 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceStandardList_example.json -func ExampleRegulatoryComplianceStandardsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRegulatoryComplianceStandardsClient().NewListPager(&armsecurity.RegulatoryComplianceStandardsClientListOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RegulatoryComplianceStandardList = armsecurity.RegulatoryComplianceStandardList{ - // Value: []*armsecurity.RegulatoryComplianceStandard{ - // { - // Name: to.Ptr("PCI-DSS-3.2"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceStandard"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/PCI-DSS-3.2"), - // Properties: &armsecurity.RegulatoryComplianceStandardProperties{ - // FailedControls: to.Ptr[int32](4), - // PassedControls: to.Ptr[int32](7), - // SkippedControls: to.Ptr[int32](0), - // State: to.Ptr(armsecurity.StateFailed), - // UnsupportedControls: to.Ptr[int32](0), - // }, - // }, - // { - // Name: to.Ptr("ISO-27001"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceStandard"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/ISO-27001"), - // Properties: &armsecurity.RegulatoryComplianceStandardProperties{ - // FailedControls: to.Ptr[int32](0), - // PassedControls: to.Ptr[int32](0), - // SkippedControls: to.Ptr[int32](10), - // State: to.Ptr(armsecurity.StateSkipped), - // UnsupportedControls: to.Ptr[int32](0), - // }, - // }, - // { - // Name: to.Ptr("AZURE-CIS"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceStandard"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/AZURE-CIS"), - // Properties: &armsecurity.RegulatoryComplianceStandardProperties{ - // FailedControls: to.Ptr[int32](0), - // PassedControls: to.Ptr[int32](0), - // SkippedControls: to.Ptr[int32](0), - // State: to.Ptr(armsecurity.StateUnsupported), - // UnsupportedControls: to.Ptr[int32](0), - // }, - // }, - // { - // Name: to.Ptr("SOC-TSP"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceStandard"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/SOC-TSP"), - // Properties: &armsecurity.RegulatoryComplianceStandardProperties{ - // FailedControls: to.Ptr[int32](0), - // PassedControls: to.Ptr[int32](15), - // SkippedControls: to.Ptr[int32](0), - // State: to.Ptr(armsecurity.StatePassed), - // UnsupportedControls: to.Ptr[int32](0), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceStandard_example.json -func ExampleRegulatoryComplianceStandardsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegulatoryComplianceStandardsClient().Get(ctx, "PCI-DSS-3.2", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RegulatoryComplianceStandard = armsecurity.RegulatoryComplianceStandard{ - // Name: to.Ptr("PCI-DSS-3.2"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceStandard"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/PCI-DSS-3.2"), - // Properties: &armsecurity.RegulatoryComplianceStandardProperties{ - // FailedControls: to.Ptr[int32](4), - // PassedControls: to.Ptr[int32](7), - // SkippedControls: to.Ptr[int32](0), - // State: to.Ptr(armsecurity.StateFailed), - // UnsupportedControls: to.Ptr[int32](0), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/responses.go b/sdk/resourcemanager/security/armsecurity/responses.go index 8c6fdebc961f..dba87618c90e 100644 --- a/sdk/resourcemanager/security/armsecurity/responses.go +++ b/sdk/resourcemanager/security/armsecurity/responses.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -66,44 +63,6 @@ type AccountConnectorsClientListResponse struct { ConnectorSettingList } -// AdaptiveApplicationControlsClientDeleteResponse contains the response from method AdaptiveApplicationControlsClient.Delete. -type AdaptiveApplicationControlsClientDeleteResponse struct { - // placeholder for future response values -} - -// AdaptiveApplicationControlsClientGetResponse contains the response from method AdaptiveApplicationControlsClient.Get. -type AdaptiveApplicationControlsClientGetResponse struct { - AdaptiveApplicationControlGroup -} - -// AdaptiveApplicationControlsClientListResponse contains the response from method AdaptiveApplicationControlsClient.List. -type AdaptiveApplicationControlsClientListResponse struct { - // Represents a list of VM/server groups and set of rules that are Recommended by Microsoft Defender for Cloud to be allowed - AdaptiveApplicationControlGroups -} - -// AdaptiveApplicationControlsClientPutResponse contains the response from method AdaptiveApplicationControlsClient.Put. -type AdaptiveApplicationControlsClientPutResponse struct { - AdaptiveApplicationControlGroup -} - -// AdaptiveNetworkHardeningsClientEnforceResponse contains the response from method AdaptiveNetworkHardeningsClient.BeginEnforce. -type AdaptiveNetworkHardeningsClientEnforceResponse struct { - // placeholder for future response values -} - -// AdaptiveNetworkHardeningsClientGetResponse contains the response from method AdaptiveNetworkHardeningsClient.Get. -type AdaptiveNetworkHardeningsClientGetResponse struct { - // The resource whose properties describes the Adaptive Network Hardening settings for some Azure resource - AdaptiveNetworkHardening -} - -// AdaptiveNetworkHardeningsClientListByExtendedResourceResponse contains the response from method AdaptiveNetworkHardeningsClient.NewListByExtendedResourcePager. -type AdaptiveNetworkHardeningsClientListByExtendedResourceResponse struct { - // Response for ListAdaptiveNetworkHardenings API service call - AdaptiveNetworkHardeningsList -} - // AdvancedThreatProtectionClientCreateResponse contains the response from method AdvancedThreatProtectionClient.Create. type AdvancedThreatProtectionClientCreateResponse struct { // The Advanced Threat Protection resource. @@ -619,18 +578,59 @@ type CustomEntityStoreAssignmentsClientListBySubscriptionResponse struct { CustomEntityStoreAssignmentsListResult } +// CustomRecommendationsClientCreateOrUpdateResponse contains the response from method CustomRecommendationsClient.CreateOrUpdate. +type CustomRecommendationsClientCreateOrUpdateResponse struct { + // Custom Recommendation + CustomRecommendation +} + +// CustomRecommendationsClientDeleteResponse contains the response from method CustomRecommendationsClient.Delete. +type CustomRecommendationsClientDeleteResponse struct { + // placeholder for future response values +} + +// CustomRecommendationsClientGetResponse contains the response from method CustomRecommendationsClient.Get. +type CustomRecommendationsClientGetResponse struct { + // Custom Recommendation + CustomRecommendation +} + +// CustomRecommendationsClientListResponse contains the response from method CustomRecommendationsClient.NewListPager. +type CustomRecommendationsClientListResponse struct { + // A list of Custom Recommendations + CustomRecommendationsList +} + +// DefenderForStorageClientCancelMalwareScanResponse contains the response from method DefenderForStorageClient.CancelMalwareScan. +type DefenderForStorageClientCancelMalwareScanResponse struct { + // Describes the state of a malware scan operation. + MalwareScan +} + // DefenderForStorageClientCreateResponse contains the response from method DefenderForStorageClient.Create. type DefenderForStorageClientCreateResponse struct { // The Defender for Storage resource. DefenderForStorageSetting } +// DefenderForStorageClientGetMalwareScanResponse contains the response from method DefenderForStorageClient.GetMalwareScan. +type DefenderForStorageClientGetMalwareScanResponse struct { + // Describes the state of a malware scan operation. + MalwareScan +} + // DefenderForStorageClientGetResponse contains the response from method DefenderForStorageClient.Get. type DefenderForStorageClientGetResponse struct { // The Defender for Storage resource. DefenderForStorageSetting } +// DefenderForStorageClientStartMalwareScanResponse contains the response from method DefenderForStorageClient.StartMalwareScan. +type DefenderForStorageClientStartMalwareScanResponse struct { + // Describes the state of a malware scan operation. + MalwareScan +} + // DevOpsConfigurationsClientCreateOrUpdateResponse contains the response from method DevOpsConfigurationsClient.BeginCreateOrUpdate. type DevOpsConfigurationsClientCreateOrUpdateResponse struct { // DevOps Configuration resource. @@ -711,16 +711,6 @@ type ExternalSecuritySolutionsClientGetResponse struct { ExternalSecuritySolutionClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalSecuritySolutionsClientGetResponse. -func (e *ExternalSecuritySolutionsClientGetResponse) UnmarshalJSON(data []byte) error { - res, err := unmarshalExternalSecuritySolutionClassification(data) - if err != nil { - return err - } - e.ExternalSecuritySolutionClassification = res - return nil -} - // ExternalSecuritySolutionsClientListByHomeRegionResponse contains the response from method ExternalSecuritySolutionsClient.NewListByHomeRegionPager. type ExternalSecuritySolutionsClientListByHomeRegionResponse struct { ExternalSecuritySolutionList @@ -1029,8 +1019,8 @@ type MdeOnboardingsClientListResponse struct { // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { - // List of possible operations for Microsoft.Security resource provider - OperationList + // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. + OperationListResult } // OperatorsClientCreateOrUpdateResponse contains the response from method OperatorsClient.CreateOrUpdate. @@ -1253,16 +1243,6 @@ type ServerVulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse struct { ServerVulnerabilityAssessmentsSettingClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerVulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse. -func (s *ServerVulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse) UnmarshalJSON(data []byte) error { - res, err := unmarshalServerVulnerabilityAssessmentsSettingClassification(data) - if err != nil { - return err - } - s.ServerVulnerabilityAssessmentsSettingClassification = res - return nil -} - // ServerVulnerabilityAssessmentsSettingsClientDeleteResponse contains the response from method ServerVulnerabilityAssessmentsSettingsClient.Delete. type ServerVulnerabilityAssessmentsSettingsClientDeleteResponse struct { // placeholder for future response values @@ -1274,16 +1254,6 @@ type ServerVulnerabilityAssessmentsSettingsClientGetResponse struct { ServerVulnerabilityAssessmentsSettingClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerVulnerabilityAssessmentsSettingsClientGetResponse. -func (s *ServerVulnerabilityAssessmentsSettingsClientGetResponse) UnmarshalJSON(data []byte) error { - res, err := unmarshalServerVulnerabilityAssessmentsSettingClassification(data) - if err != nil { - return err - } - s.ServerVulnerabilityAssessmentsSettingClassification = res - return nil -} - // ServerVulnerabilityAssessmentsSettingsClientListBySubscriptionResponse contains the response from method ServerVulnerabilityAssessmentsSettingsClient.NewListBySubscriptionPager. type ServerVulnerabilityAssessmentsSettingsClientListBySubscriptionResponse struct { // A page of a server vulnerability assessments settings list @@ -1296,16 +1266,6 @@ type SettingsClientGetResponse struct { SettingClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type SettingsClientGetResponse. -func (s *SettingsClientGetResponse) UnmarshalJSON(data []byte) error { - res, err := unmarshalSettingClassification(data) - if err != nil { - return err - } - s.SettingClassification = res - return nil -} - // SettingsClientListResponse contains the response from method SettingsClient.NewListPager. type SettingsClientListResponse struct { // Subscription settings list. @@ -1318,16 +1278,6 @@ type SettingsClientUpdateResponse struct { SettingClassification } -// UnmarshalJSON implements the json.Unmarshaller interface for type SettingsClientUpdateResponse. -func (s *SettingsClientUpdateResponse) UnmarshalJSON(data []byte) error { - res, err := unmarshalSettingClassification(data) - if err != nil { - return err - } - s.SettingClassification = res - return nil -} - // SoftwareInventoriesClientGetResponse contains the response from method SoftwareInventoriesClient.Get. type SoftwareInventoriesClientGetResponse struct { // Represents a software data @@ -1366,6 +1316,52 @@ type SolutionsReferenceDataClientListResponse struct { SolutionsReferenceDataList } +// StandardAssignmentsClientCreateResponse contains the response from method StandardAssignmentsClient.Create. +type StandardAssignmentsClientCreateResponse struct { + // Security Assignment on a resource group over a given scope + StandardAssignment +} + +// StandardAssignmentsClientDeleteResponse contains the response from method StandardAssignmentsClient.Delete. +type StandardAssignmentsClientDeleteResponse struct { + // placeholder for future response values +} + +// StandardAssignmentsClientGetResponse contains the response from method StandardAssignmentsClient.Get. +type StandardAssignmentsClientGetResponse struct { + // Security Assignment on a resource group over a given scope + StandardAssignment +} + +// StandardAssignmentsClientListResponse contains the response from method StandardAssignmentsClient.NewListPager. +type StandardAssignmentsClientListResponse struct { + // Page of a standard assignment list + StandardAssignmentsList +} + +// StandardsClientCreateOrUpdateResponse contains the response from method StandardsClient.CreateOrUpdate. +type StandardsClientCreateOrUpdateResponse struct { + // Security Standard on a resource + Standard +} + +// StandardsClientDeleteResponse contains the response from method StandardsClient.Delete. +type StandardsClientDeleteResponse struct { + // placeholder for future response values +} + +// StandardsClientGetResponse contains the response from method StandardsClient.Get. +type StandardsClientGetResponse struct { + // Security Standard on a resource + Standard +} + +// StandardsClientListResponse contains the response from method StandardsClient.NewListPager. +type StandardsClientListResponse struct { + // Page of a Standard list + StandardList +} + // SubAssessmentsClientGetResponse contains the response from method SubAssessmentsClient.Get. type SubAssessmentsClientGetResponse struct { // Security sub-assessment on a resource diff --git a/sdk/resourcemanager/security/armsecurity/responses_serde.go b/sdk/resourcemanager/security/armsecurity/responses_serde.go new file mode 100644 index 000000000000..9b026e260d89 --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/responses_serde.go @@ -0,0 +1,56 @@ +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsecurity + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalSecuritySolutionsClientGetResponse. +func (e *ExternalSecuritySolutionsClientGetResponse) UnmarshalJSON(data []byte) error { + res, err := unmarshalExternalSecuritySolutionClassification(data) + if err != nil { + return err + } + e.ExternalSecuritySolutionClassification = res + return nil +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerVulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse. +func (s *ServerVulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse) UnmarshalJSON(data []byte) error { + res, err := unmarshalServerVulnerabilityAssessmentsSettingClassification(data) + if err != nil { + return err + } + s.ServerVulnerabilityAssessmentsSettingClassification = res + return nil +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerVulnerabilityAssessmentsSettingsClientGetResponse. +func (s *ServerVulnerabilityAssessmentsSettingsClientGetResponse) UnmarshalJSON(data []byte) error { + res, err := unmarshalServerVulnerabilityAssessmentsSettingClassification(data) + if err != nil { + return err + } + s.ServerVulnerabilityAssessmentsSettingClassification = res + return nil +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SettingsClientGetResponse. +func (s *SettingsClientGetResponse) UnmarshalJSON(data []byte) error { + res, err := unmarshalSettingClassification(data) + if err != nil { + return err + } + s.SettingClassification = res + return nil +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SettingsClientUpdateResponse. +func (s *SettingsClientUpdateResponse) UnmarshalJSON(data []byte) error { + res, err := unmarshalSettingClassification(data) + if err != nil { + return err + } + s.SettingClassification = res + return nil +} diff --git a/sdk/resourcemanager/security/armsecurity/securescorecontroldefinitions_client.go b/sdk/resourcemanager/security/armsecurity/securescorecontroldefinitions_client.go index b29daaf9de0c..0ca221f18102 100644 --- a/sdk/resourcemanager/security/armsecurity/securescorecontroldefinitions_client.go +++ b/sdk/resourcemanager/security/armsecurity/securescorecontroldefinitions_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -72,7 +69,7 @@ func (client *SecureScoreControlDefinitionsClient) NewListPager(options *SecureS } // listCreateRequest creates the List request. -func (client *SecureScoreControlDefinitionsClient) listCreateRequest(ctx context.Context, options *SecureScoreControlDefinitionsClientListOptions) (*policy.Request, error) { +func (client *SecureScoreControlDefinitionsClient) listCreateRequest(ctx context.Context, _ *SecureScoreControlDefinitionsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Security/secureScoreControlDefinitions" req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { @@ -124,7 +121,7 @@ func (client *SecureScoreControlDefinitionsClient) NewListBySubscriptionPager(op } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *SecureScoreControlDefinitionsClient) listBySubscriptionCreateRequest(ctx context.Context, options *SecureScoreControlDefinitionsClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *SecureScoreControlDefinitionsClient) listBySubscriptionCreateRequest(ctx context.Context, _ *SecureScoreControlDefinitionsClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControlDefinitions" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 5fc826c6b71e..000000000000 --- a/sdk/resourcemanager/security/armsecurity/securescorecontroldefinitions_client_example_test.go +++ /dev/null @@ -1,183 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScoreControlDefinitions/ListSecureScoreControlDefinitions_example.json -func ExampleSecureScoreControlDefinitionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecureScoreControlDefinitionsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SecureScoreControlDefinitionList = armsecurity.SecureScoreControlDefinitionList{ - // Value: []*armsecurity.SecureScoreControlDefinitionItem{ - // { - // Name: to.Ptr("a9909064-42b4-4d34-8143-275477afe18b"), - // Type: to.Ptr("Microsoft.Security/SecureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/SecureScoreControlDefinitions/a9909064-42b4-4d34-8143-275477afe18b"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // Description: to.Ptr("This control contains recommendations regarding DDoS attack prevention"), - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/e3de1cc0-f4dd-3b34-e496-8b5381ba2d70"), - // }}, - // DisplayName: to.Ptr("Protect applications against DDoS attacks"), - // MaxScore: to.Ptr[int32](2), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // { - // Name: to.Ptr("a000c66f-6da2-4f9d-826d-2364347d2588"), - // Type: to.Ptr("Microsoft.Security/SecureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/SecureScoreControlDefinitions/a000c66f-6da2-4f9d-826d-2364347d2588"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // Description: to.Ptr("This control contains recommendations regarding enabling adaptive application control"), - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/35f45c95-27cf-4e52-891f-8390d1de5828"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/d1db3318-01ff-16de-29eb-28b344515626"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/e7ee30c4-bac9-2966-54bd-2023a4282872"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8e2b96ff-3de2-289b-b5c1-3b9921a3441e"), - // }}, - // DisplayName: to.Ptr("Apply adaptive application control"), - // MaxScore: to.Ptr[int32](3), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScoreControlDefinitions/ListSecureScoreControlDefinitions_subscription_example.json -func ExampleSecureScoreControlDefinitionsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecureScoreControlDefinitionsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SecureScoreControlDefinitionList = armsecurity.SecureScoreControlDefinitionList{ - // Value: []*armsecurity.SecureScoreControlDefinitionItem{ - // { - // Name: to.Ptr("a9909064-42b4-4d34-8143-275477afe18b"), - // Type: to.Ptr("Microsoft.Security/SecureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/SecureScoreControlDefinitions/a9909064-42b4-4d34-8143-275477afe18b"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // Description: to.Ptr("This control contains recommendations regarding DDoS attack prevention"), - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/e3de1cc0-f4dd-3b34-e496-8b5381ba2d70"), - // }}, - // DisplayName: to.Ptr("Protect applications against DDoS attacks"), - // MaxScore: to.Ptr[int32](2), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // { - // Name: to.Ptr("34a42fb3-e6db-409c-b56b-7b1db6b8aee0"), - // Type: to.Ptr("Microsoft.Security/SecureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/SecureScoreControlDefinitions/34a42fb3-e6db-409c-b56b-7b1db6b8aee0"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // Description: to.Ptr("This control contains recommendations regarding MFA"), - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/151e82c5-5341-a74b-1eb0-bc38d2c84bb5"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/57e98606-6b1e-6193-0e3d-fe621387c16b"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/94290b00-4d0c-d7b4-7cea-064a9554e681"), - // }}, - // DisplayName: to.Ptr("Enable MFA"), - // MaxScore: to.Ptr[int32](10), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // { - // Name: to.Ptr("a000c66f-6da2-4f9d-826d-2364347d2588"), - // Type: to.Ptr("Microsoft.Security/SecureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/SecureScoreControlDefinitions/a000c66f-6da2-4f9d-826d-2364347d2588"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // Description: to.Ptr("This control contains recommendations regarding enabling adaptive application control"), - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/35f45c95-27cf-4e52-891f-8390d1de5828"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/d1db3318-01ff-16de-29eb-28b344515626"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/e7ee30c4-bac9-2966-54bd-2023a4282872"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8e2b96ff-3de2-289b-b5c1-3b9921a3441e"), - // }}, - // DisplayName: to.Ptr("Apply adaptive application control"), - // MaxScore: to.Ptr[int32](3), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/securescorecontrols_client.go b/sdk/resourcemanager/security/armsecurity/securescorecontrols_client.go index 0809a182e19a..1b4b6aa2e4af 100644 --- a/sdk/resourcemanager/security/armsecurity/securescorecontrols_client.go +++ b/sdk/resourcemanager/security/armsecurity/securescorecontrols_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. 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 42bad37f9c87..000000000000 --- a/sdk/resourcemanager/security/armsecurity/securescorecontrols_client_example_test.go +++ /dev/null @@ -1,1594 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScoreControlsForName_builtin_example.json -func ExampleSecureScoreControlsClient_NewListBySecureScorePager_getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiative() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecureScoreControlsClient().NewListBySecureScorePager("ascScore", &armsecurity.SecureScoreControlsClientListBySecureScoreOptions{Expand: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SecureScoreControlList = armsecurity.SecureScoreControlList{ - // Value: []*armsecurity.SecureScoreControlDetails{ - // { - // Name: to.Ptr("a9909064-42b4-4d34-8143-275477afe18b"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/a9909064-42b4-4d34-8143-275477afe18b"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Protect applications against DDoS attacks"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](1), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](0), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](0), - // }, - // }, - // { - // Name: to.Ptr("34a42fb3-e6db-409c-b56b-7b1db6b8aee0"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/34a42fb3-e6db-409c-b56b-7b1db6b8aee0"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Enable MFA"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](10), - // Max: to.Ptr[int32](10), - // Percentage: to.Ptr[float64](1), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("76763537-9feb-42d3-b4f4-78c01117be80"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/76763537-9feb-42d3-b4f4-78c01117be80"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Implement security best practices"), - // HealthyResourceCount: to.Ptr[int32](7), - // NotApplicableResourceCount: to.Ptr[int32](1), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](0), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](7), - // }, - // }, - // { - // Name: to.Ptr("4db8d6cf-075b-4149-a813-da09ca2ae120"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/4db8d6cf-075b-4149-a813-da09ca2ae120"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Enable Advanced Threat Protection"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](0), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("27b24961-75ba-4fe4-8909-97286d5dd5ee"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/27b24961-75ba-4fe4-8909-97286d5dd5ee"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Enable auditing and logging"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0.2), - // Max: to.Ptr[int32](1), - // Percentage: to.Ptr[float64](0.2), - // }, - // UnhealthyResourceCount: to.Ptr[int32](4), - // Weight: to.Ptr[int64](5), - // }, - // }, - // { - // Name: to.Ptr("2d85f639-0bea-4a4a-b6c6-608952a1414a"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/2d85f639-0bea-4a4a-b6c6-608952a1414a"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Manage access and permissions"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](2), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](0.5), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](2), - // }, - // }, - // { - // Name: to.Ptr("99fc8df2-e0f5-40f8-9415-a7f7ca948b5a"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/99fc8df2-e0f5-40f8-9415-a7f7ca948b5a"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Remediate security configurations"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("12136bd9-dc24-44f2-9587-7be3af6aac14"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/12136bd9-dc24-44f2-9587-7be3af6aac14"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Enable endpoint protection"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](2), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("61702b76-1fab-41f2-bcbc-50b7870dcf38"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/61702b76-1fab-41f2-bcbc-50b7870dcf38"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Apply system updates"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](6), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("0e55495e-034f-4abc-8293-767229250176"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/0e55495e-034f-4abc-8293-767229250176"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Encrypt data in transit"), - // HealthyResourceCount: to.Ptr[int32](5), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](3.33), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](0.8325), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](6), - // }, - // }, - // { - // Name: to.Ptr("f9d5432b-8f7b-45e9-b90c-e214a30f6a02"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/f9d5432b-8f7b-45e9-b90c-e214a30f6a02"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Restrict unauthorized network access"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](4), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](1), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("8fd574ec-43cf-426e-a439-a67cbaf2d564"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/8fd574ec-43cf-426e-a439-a67cbaf2d564"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Enable encryption at rest"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](4), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](1), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](1), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScoreControlsForNameWithExpand_builtin_example.json -func ExampleSecureScoreControlsClient_NewListBySecureScorePager_getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiativeWithTheExpandParameter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecureScoreControlsClient().NewListBySecureScorePager("ascScore", &armsecurity.SecureScoreControlsClientListBySecureScoreOptions{Expand: to.Ptr(armsecurity.ExpandControlsEnumDefinition)}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SecureScoreControlList = armsecurity.SecureScoreControlList{ - // Value: []*armsecurity.SecureScoreControlDetails{ - // { - // Name: to.Ptr("a9909064-42b4-4d34-8143-275477afe18b"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/a9909064-42b4-4d34-8143-275477afe18b"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // Definition: &armsecurity.SecureScoreControlDefinitionItem{ - // Name: to.Ptr("a9909064-42b4-4d34-8143-275477afe18b"), - // Type: to.Ptr("Microsoft.Security/secureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/secureScoreControlDefinitions/a9909064-42b4-4d34-8143-275477afe18b"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/e3de1cc0-f4dd-3b34-e496-8b5381ba2d70"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/08e628db-e2ed-4793-bc91-d13e684401c3"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/405c9ae6-49f9-46c4-8873-a86690f27818"), - // }}, - // DisplayName: to.Ptr("Protect applications against DDoS attacks"), - // MaxScore: to.Ptr[int32](2), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // DisplayName: to.Ptr("Protect applications against DDoS attacks"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](1), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](0), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](0), - // }, - // }, - // { - // Name: to.Ptr("34a42fb3-e6db-409c-b56b-7b1db6b8aee0"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/34a42fb3-e6db-409c-b56b-7b1db6b8aee0"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // Definition: &armsecurity.SecureScoreControlDefinitionItem{ - // Name: to.Ptr("34a42fb3-e6db-409c-b56b-7b1db6b8aee0"), - // Type: to.Ptr("Microsoft.Security/secureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/secureScoreControlDefinitions/34a42fb3-e6db-409c-b56b-7b1db6b8aee0"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/94290b00-4d0c-d7b4-7cea-064a9554e681"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/57e98606-6b1e-6193-0e3d-fe621387c16b"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/1f24d55a-df0f-4772-9090-4629c2d6bfff"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8e3d9ac0-a248-4276-a437-304c6cd1443b"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8d7a6128-c8f2-43df-b422-7877346f9ddb"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/dbfc99e3-e648-4c3b-bd32-995e6268430d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/4a946e22-47e8-443d-8761-b25620b4a1e1"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a7c8fa46-526d-4bf6-b8b3-17fa01310fd8"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/20f6c761-4dd7-4f27-9e37-6db8471486ef"), - // }}, - // DisplayName: to.Ptr("Enable MFA"), - // MaxScore: to.Ptr[int32](10), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // DisplayName: to.Ptr("Enable MFA"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](10), - // Max: to.Ptr[int32](10), - // Percentage: to.Ptr[float64](1), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("76763537-9feb-42d3-b4f4-78c01117be80"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/76763537-9feb-42d3-b4f4-78c01117be80"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // Definition: &armsecurity.SecureScoreControlDefinitionItem{ - // Name: to.Ptr("76763537-9feb-42d3-b4f4-78c01117be80"), - // Type: to.Ptr("Microsoft.Security/secureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/secureScoreControlDefinitions/76763537-9feb-42d3-b4f4-78c01117be80"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/151e82c5-5341-a74b-1eb0-bc38d2c84bb5"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a8c6a4ad-d51e-88fe-2979-d3ee3c864f8b"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/6f90a6d6-d4d6-0794-0ec1-98fa77878c2e"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a9341235-9389-42f0-a0bf-9bfb57960d44"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/45d313c3-3fca-5040-035f-d61928366d31"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/f0553104-cfdb-65e6-759c-002812e38500"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/47bb383c-8e25-95f0-c2aa-437add1d87d3"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/12018f4f-3d10-999b-e4c4-86ec25be08a1"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/eade5b56-eefd-444f-95c8-23f29e5d93cb"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/ebe970fe-9c27-4dd7-a165-1e943d565e10"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/f7010359-8d21-4598-a9f2-c3e81a17141e"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/24d8af06-d441-40b4-a49c-311421aa9f58"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8c3e93d3-0276-4d06-b20a-9a9f3012742c"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/9172da4e-9571-6e33-2b5b-d742847f3be7"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/093c685b-56dd-13a3-8ed5-887a001837a2"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/64b8637e-4e1d-76a9-0fc9-c1e487a97ed8"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/fe02b3b7-a722-d4d6-6731-6493776203a6"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/57f36d21-69e3-4b0f-a66c-18629d1b736d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/6c99f570-2ce7-46bc-8175-cde013df43bc"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/22489c48-27d1-4e40-9420-4303ad9cffef"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/fc84abc0-eee6-4758-8372-a7681965ca44"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/726cde3e-02f8-4041-8935-727f2be19ba7"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a2bb3a1b-4a09-4cf7-9e79-c438687e2c2f"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/664c6a0b-5cd2-4140-aaff-a94241c07afd"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/3af5de46-fda8-4b6e-90f1-6565187d7c48"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a9a59ebb-5d6f-42f5-92a1-036fd0fd1879"), - // }}, - // DisplayName: to.Ptr("Implement security best practices"), - // MaxScore: to.Ptr[int32](0), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // DisplayName: to.Ptr("Implement security best practices"), - // HealthyResourceCount: to.Ptr[int32](7), - // NotApplicableResourceCount: to.Ptr[int32](1), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](0), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](7), - // }, - // }, - // { - // Name: to.Ptr("4db8d6cf-075b-4149-a813-da09ca2ae120"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/4db8d6cf-075b-4149-a813-da09ca2ae120"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // Definition: &armsecurity.SecureScoreControlDefinitionItem{ - // Name: to.Ptr("4db8d6cf-075b-4149-a813-da09ca2ae120"), - // Type: to.Ptr("Microsoft.Security/secureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/secureScoreControlDefinitions/4db8d6cf-075b-4149-a813-da09ca2ae120"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/56a6e81f-7413-4f72-9a1b-aaeeaa87c872"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/0876ef51-fee7-449d-ba1e-f2662c7e43c6"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/58d72d9d-0310-4792-9a3b-6dd111093cdb"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/6ac66a74-761f-4a59-928a-d373eea3f028"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/1be22853-8ed1-4005-9907-ddad64cb1417"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/86ea1a79-29d3-4eac-a9f4-3541ace4e718"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/53572822-d3fc-4363-bfb9-248645841612"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/b1af52e4-e968-4e2b-b6d0-6736c9651f0a"), - // }}, - // DisplayName: to.Ptr("Enable Advanced Threat Protection"), - // MaxScore: to.Ptr[int32](0), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // DisplayName: to.Ptr("Enable Advanced Threat Protection"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](0), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("27b24961-75ba-4fe4-8909-97286d5dd5ee"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/27b24961-75ba-4fe4-8909-97286d5dd5ee"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // Definition: &armsecurity.SecureScoreControlDefinitionItem{ - // Name: to.Ptr("27b24961-75ba-4fe4-8909-97286d5dd5ee"), - // Type: to.Ptr("Microsoft.Security/secureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/secureScoreControlDefinitions/27b24961-75ba-4fe4-8909-97286d5dd5ee"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/94208a8b-16e8-4e5b-abbd-4e81c9d02bee"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/c6dad669-efd7-cd72-61c5-289935607791"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/77785808-ce86-4e40-b45f-19110a547397"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/32771b45-220c-1a8b-584e-fdd5a2584a66"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/f11b27f2-8c49-5bb4-eff5-e1e5384bf95e"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/f19ab7d9-5ff2-f8fd-ab3b-0bf95dcb6889"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/ad5bbaeb-7632-5edf-f1c2-752075831ce8"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/dea5192e-1bb3-101b-b70c-4646546f5e1e"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/1597605a-0faf-5860-eb74-462ae2e9fc21"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/91387f44-7e43-4ecc-55f0-46f5adee3dd5"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/961eb649-3ea9-f8c2-6595-88e9a3aeedeb"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/88bbc99c-e5af-ddd7-6105-6150b2bfa519"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/22438e3c-73c8-40af-a083-10c980c63aa2"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/5720f1a6-6061-4768-9c0d-2000a6041744"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/dbfc99e3-e648-4c3b-bd32-995e6268430d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/30c69b23-a9a2-4729-aca6-f21adacfff66"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a9ac48d8-8dd7-42b9-9752-b1fa70ea5dd9"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/00261067-76a8-4ebb-b5fc-becc81067bee"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/83ca4867-58c1-45d6-b6b6-dbf226512891"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a269cbdb-86e8-431c-9ff2-f0ea491174d8"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/5ea59e47-093b-446f-9765-5b0ec4c9da61"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/011397ca-1366-4bcc-b85a-7a5e3df2e80b"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/c62371bc-f6a7-4915-b5b5-14288682cf79"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/293ba336-7312-42fc-a59d-836e4e678b17"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/0b547a38-2c0d-47e1-b9a2-a59fccc140db"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/7d0ad86f-f43b-4889-b2f7-09d91bd1407b"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/b20558b6-de31-480c-8aa0-e920d62b9764"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/022efc2d-5119-480b-a203-e151b6b2645c"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/3ee7608e-f0e7-4c26-8921-5ae46c4e99df"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/33765629-073d-49eb-bab4-64bdf8ac90da"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/9c054f50-823f-45ab-839e-9df4eb7c2f11"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/f61e15f3-4bcf-4d2e-8f06-32237cabe0a0"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/cdb3af55-2abf-476b-aac7-5cfec366a4dd"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/bc26b0d4-a1d7-4665-9d44-efc205ae73f0"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/3812e247-34f2-4f06-a312-89a8fe51fa37"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/f0f8405a-5ecc-4314-808e-083e030d6163"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/c23e0eec-eee4-4632-b1c2-6c884c3c963b"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/7ce5a01f-e94b-438a-8b72-fa02c076f11a"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/46e4e0ed-106d-405e-b1a9-ca34c8f7d31f"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/b1294b0d-9b2e-4e1b-9f67-77a75fb10a65"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/0b86a67f-bde5-4c91-b10c-4102033b8692"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/3d55e4b1-ecdb-4eaf-9e3f-b00a764182bd"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a7c8fa46-526d-4bf6-b8b3-17fa01310fd8"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/20f6c761-4dd7-4f27-9e37-6db8471486ef"), - // }}, - // DisplayName: to.Ptr("Enable auditing and logging"), - // MaxScore: to.Ptr[int32](1), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // DisplayName: to.Ptr("Enable auditing and logging"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0.2), - // Max: to.Ptr[int32](1), - // Percentage: to.Ptr[float64](0.2), - // }, - // UnhealthyResourceCount: to.Ptr[int32](4), - // Weight: to.Ptr[int64](5), - // }, - // }, - // { - // Name: to.Ptr("2d85f639-0bea-4a4a-b6c6-608952a1414a"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/2d85f639-0bea-4a4a-b6c6-608952a1414a"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // Definition: &armsecurity.SecureScoreControlDefinitionItem{ - // Name: to.Ptr("2d85f639-0bea-4a4a-b6c6-608952a1414a"), - // Type: to.Ptr("Microsoft.Security/secureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/secureScoreControlDefinitions/2d85f639-0bea-4a4a-b6c6-608952a1414a"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/c3b6ae71-f1f0-31b4-e6c1-d5951285d03d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/04e7147b-0deb-9796-2e5c-0336343ceb3d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/e52064aa-6853-e252-a11e-dffc675689c2"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/00c6d40b-e990-6acf-d4f3-471e747a27c4"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/2c79b4af-f830-b61e-92b9-63dfa30f16e4"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/b0fdc63a-38e7-4bab-a7c4-2c2665abbaa9"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/03afeb6f-7634-adb3-0a01-803b0b9cb611"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/9d07b7e6-2986-4964-a76c-b2689604e212"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/08e628db-e2ed-4793-bc91-d13e684401c3"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/5d90913f-a1c5-4429-ad54-2c6c17fb3c73"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/582c14e9-48c1-4b25-ab93-91bdeaf9120c"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8a10942a-02ca-483f-81ae-2260ea7808cc"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/9b8eac17-6b11-4b94-9bb4-18c81aee7123"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/554ba13c-d7d4-4530-88ce-94cf11a670ce"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/66a1d478-4d24-42d4-8eca-dcdab6532a18"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/b396f112-a462-4813-a93f-80bc90041e4d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/5425052d-cc0d-4424-af71-050311f99634"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/09cb7d54-db05-4d31-97f3-9bbfe1dff610"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/01fb1ad4-303b-4789-abf2-c024c4a76523"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/0de072b9-6515-4985-842e-0318047bb85b"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8c3f474a-234e-442f-92b3-2a45e37f7eee"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/c55461af-4923-4fbb-b270-40d5e5f4c0ff"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/bbdc4999-1462-4d46-853b-2f8c6ca1c682"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/9e1f12d0-cb3d-4e1c-a468-6bc3d934c99d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/fd5d38f6-340e-4bd2-88f2-e1314c3c07a9"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/0384d5b7-5def-4130-b7b5-db7da7e63276"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/dbfc99e3-e648-4c3b-bd32-995e6268430d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/0ad39832-f031-4fdd-885e-c6cce85ac77c"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/90191798-da1b-40dd-aa9c-1c0eafb1ba87"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/ddced3c8-a5e2-4dc4-b0fe-1331c77fc9c4"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/52f83ea2-6871-45c3-8b26-13566e966638"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/79b4eb34-c06e-49bf-883d-5352a21a962f"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/5723400d-5b2a-45f1-99ee-837986866318"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/76e8881d-f18e-4e1b-b01d-376d0260e066"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/0eaf40a8-5673-4b33-8457-a31d85882233"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/5a235918-41a2-4bd0-8ab0-00a596e9d6a8"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/3ff38dcd-92e2-4b67-8765-35bb0174a4c7"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/1ff4501b-2109-4ef6-ba9d-e824a96d63d0"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/f493084a-d3c4-4886-8cf2-3c815aeef901"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a7c8fa46-526d-4bf6-b8b3-17fa01310fd8"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/20f6c761-4dd7-4f27-9e37-6db8471486ef"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/11c95609-3553-430d-b788-fd41cde8b2db"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/27d6f0e9-b4d5-468b-ae7e-03d5473fd864"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/f0debc84-981c-4a0d-924d-aa4bd7d55fef"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/9b795646-9130-41a4-90b7-df9eae2437c8"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/802c0637-5a8c-4c98-abd7-7c96d89d6010"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/43dc2a2e-ce69-4d42-923e-ab7d136f2cfe"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/2acd365d-e8b5-4094-bce4-244b7c51d67c"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/51fd8bb1-0db4-bbf1-7e2b-cfcba7eb66a6"), - // }}, - // DisplayName: to.Ptr("Manage access and permissions"), - // MaxScore: to.Ptr[int32](4), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // DisplayName: to.Ptr("Manage access and permissions"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](2), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](0.5), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](2), - // }, - // }, - // { - // Name: to.Ptr("99fc8df2-e0f5-40f8-9415-a7f7ca948b5a"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/99fc8df2-e0f5-40f8-9415-a7f7ca948b5a"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // Definition: &armsecurity.SecureScoreControlDefinitionItem{ - // Name: to.Ptr("99fc8df2-e0f5-40f8-9415-a7f7ca948b5a"), - // Type: to.Ptr("Microsoft.Security/secureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/secureScoreControlDefinitions/99fc8df2-e0f5-40f8-9415-a7f7ca948b5a"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/d1db3318-01ff-16de-29eb-28b344515626"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/e7ee30c4-bac9-2966-54bd-2023a4282872"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/27ac71b1-75c5-41c2-adc2-858f5db45b08"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/720a3e77-0b9a-4fa9-98b6-ddf0fd7e32c1"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8e2b96ff-3de2-289b-b5c1-3b9921a3441e"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/181ac480-f7c4-544b-9865-11b8ffe87f47"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8c3d9ad0-3639-4686-9cd2-2b2ab2609bda"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/0677209d-e675-2c6f-e91a-54cef2878663"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a3eee263-aa01-4b52-a7c0-0094578ef48f"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/45cfe080-ceb1-a91e-9743-71551ed24e94"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8941d121-f740-35f6-952c-6561d2b38d36"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/0396b18c-41aa-489c-affd-4ee5d1714a59"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/fa924a53-0837-4296-9bf7-18ce7dd68593"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/9e1789cd-7b61-42db-ba12-7268283ba466"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/233da9cd-11bf-463a-8aa7-4c81b9e788d1"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/c4131c22-1ecc-4beb-9961-d90108bd975f"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/d74d2738-2485-4103-9919-69c7e63776ec"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/5f65e47f-7a00-4bf3-acae-90ee441ee876"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/bc85a7ee-7f43-47ab-8736-4faaec9346b5"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/08e628db-e2ed-4793-bc91-d13e684401c3"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/86f91051-9d6a-47c3-a07f-bd14cb214b45"), - // }}, - // DisplayName: to.Ptr("Remediate security configurations"), - // MaxScore: to.Ptr[int32](4), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // DisplayName: to.Ptr("Remediate security configurations"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("12136bd9-dc24-44f2-9587-7be3af6aac14"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/12136bd9-dc24-44f2-9587-7be3af6aac14"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // Definition: &armsecurity.SecureScoreControlDefinitionItem{ - // Name: to.Ptr("12136bd9-dc24-44f2-9587-7be3af6aac14"), - // Type: to.Ptr("Microsoft.Security/secureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/secureScoreControlDefinitions/12136bd9-dc24-44f2-9587-7be3af6aac14"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/d1db3318-01ff-16de-29eb-28b344515626"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/e7ee30c4-bac9-2966-54bd-2023a4282872"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/27ac71b1-75c5-41c2-adc2-858f5db45b08"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/720a3e77-0b9a-4fa9-98b6-ddf0fd7e32c1"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8e2b96ff-3de2-289b-b5c1-3b9921a3441e"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/83f577bd-a1b6-b7e1-0891-12ca19d1e6df"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/4fb67663-9ab9-475d-b026-8c544cced439"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/383cf3bc-fdf9-4a02-120a-3e7e36c6bfee"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/3bcd234d-c9c7-c2a2-89e0-c01f419c1a8a"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/37a3689a-818e-4a0e-82ac-b1392b9bb000"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/45cfe080-ceb1-a91e-9743-71551ed24e94"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/21300918-b2e3-0346-785f-c77ff57d243b"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/e71020c2-860c-3235-cd39-04f3f8c936d2"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/bc85a7ee-7f43-47ab-8736-4faaec9346b5"), - // }}, - // DisplayName: to.Ptr("Enable endpoint protection"), - // MaxScore: to.Ptr[int32](2), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // DisplayName: to.Ptr("Enable endpoint protection"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](2), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("61702b76-1fab-41f2-bcbc-50b7870dcf38"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/61702b76-1fab-41f2-bcbc-50b7870dcf38"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // Definition: &armsecurity.SecureScoreControlDefinitionItem{ - // Name: to.Ptr("61702b76-1fab-41f2-bcbc-50b7870dcf38"), - // Type: to.Ptr("Microsoft.Security/secureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/secureScoreControlDefinitions/61702b76-1fab-41f2-bcbc-50b7870dcf38"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/d1db3318-01ff-16de-29eb-28b344515626"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/e7ee30c4-bac9-2966-54bd-2023a4282872"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/27ac71b1-75c5-41c2-adc2-858f5db45b08"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/720a3e77-0b9a-4fa9-98b6-ddf0fd7e32c1"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8e2b96ff-3de2-289b-b5c1-3b9921a3441e"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/4ab6e3c5-74dd-8b35-9ab9-f61b30875b27"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/f2805ebc-abc2-4aac-a8d6-35664c479971"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/c0f5316d-5ac5-9218-b77a-b96e16ccfd66"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/45cfe080-ceb1-a91e-9743-71551ed24e94"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/bd20bd91-aaf1-7f14-b6e4-866de2f43146"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/8bc390da-9eb6-938d-25ed-44a35d9bcc9d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/22e18b64-4576-41e6-8972-0eb28c9af0c8"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/bc85a7ee-7f43-47ab-8736-4faaec9346b5"), - // }}, - // DisplayName: to.Ptr("Apply system updates"), - // MaxScore: to.Ptr[int32](6), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // DisplayName: to.Ptr("Apply system updates"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](6), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("0e55495e-034f-4abc-8293-767229250176"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/0e55495e-034f-4abc-8293-767229250176"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // Definition: &armsecurity.SecureScoreControlDefinitionItem{ - // Name: to.Ptr("0e55495e-034f-4abc-8293-767229250176"), - // Type: to.Ptr("Microsoft.Security/secureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/secureScoreControlDefinitions/0e55495e-034f-4abc-8293-767229250176"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/1b351b29-41ca-6df5-946c-c190a56be5fe"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/cb0acdc6-0846-fd48-debe-9905af151b6d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/bf82a334-13b6-ca57-ea75-096fc2ffce50"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/35b25be2-d08a-e340-45ed-f08a95d804fc"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/1c5de8e1-f68d-6a17-e0d2-ec259c42768c"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a3ebc80a-847b-46d5-a37d-8dca5e6947df"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/c28a89d9-7cf4-439b-a8c4-ad4e769f68ee"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/2acc27c6-5fdb-405e-9080-cb66b850c8f5"), - // }}, - // DisplayName: to.Ptr("Encrypt data in transit"), - // MaxScore: to.Ptr[int32](4), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // DisplayName: to.Ptr("Encrypt data in transit"), - // HealthyResourceCount: to.Ptr[int32](5), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](3.33), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](0.8325), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](6), - // }, - // }, - // { - // Name: to.Ptr("f9d5432b-8f7b-45e9-b90c-e214a30f6a02"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/f9d5432b-8f7b-45e9-b90c-e214a30f6a02"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // Definition: &armsecurity.SecureScoreControlDefinitionItem{ - // Name: to.Ptr("f9d5432b-8f7b-45e9-b90c-e214a30f6a02"), - // Type: to.Ptr("Microsoft.Security/secureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/secureScoreControlDefinitions/f9d5432b-8f7b-45e9-b90c-e214a30f6a02"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/483f12ed-ae23-447e-a2de-a67a10db4353"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/3b20e985-f71f-483b-b078-f30d73936d43"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/f9f0eed0-f143-47bf-b856-671ea2eeed62"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/1a2b5b4c-f80d-46e7-ac81-b51a9fb363de"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/c3b51c94-588b-426b-a892-24696f9e54cc"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/e40df93c-7a7c-1b0a-c787-9987ceb98e54"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/7b3d4796-9400-2904-692b-4a5ede7f0a1e"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/df4d1739-47f0-60c7-1706-3731fea6ab03"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/1a36f14a-8bd8-45f5-abe5-eef88d76ab5b"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/beb62be3-5e78-49bd-ac5f-099250ef3c7c"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/ba975338-f956-41e7-a9f2-7614832d382d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/d5a8d84a-9ad0-42e2-80e0-d38e3d46028a"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/5a3d6cdd-8eb3-46d2-ba11-d24a0d47fe65"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/d8326952-60bb-40fb-b33f-51e662708a88"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/08e628db-e2ed-4793-bc91-d13e684401c3"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/5f88450f-9546-4b78-a181-a2d9162bb441"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/add45209-73f6-4fa5-a5a5-74a451b07fbe"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/dbfc99e3-e648-4c3b-bd32-995e6268430d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/b3473ed6-78c0-40d5-b5f0-674e98924952"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/9dd55566-33b9-4c07-a959-14794ce02355"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/ad0b04b9-eaf9-49f8-b85e-724f9520e760"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/ece6ec5d-a862-4e22-a8db-271661216018"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/e40b679a-f44e-4366-87dd-7693e16a2128"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/0bdcd23c-4ff2-4077-aa14-eb6950bfbdd8"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/1f386f4e-449e-41e8-b829-a2fe01086ae1"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/2f6c8a5a-9407-467c-8082-0ad4ab915d77"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/3b1713ec-feb3-4b32-b5b0-251acff0a84a"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/049f1551-438b-444e-8904-a3c3afbcb43e"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/684307e9-62a8-4f2a-887a-4b90de5e4b98"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/0327f9da-f758-4d69-8903-55448b8cf70e"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/cc637123-c11e-40ee-adf8-93c0876481f4"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a7c8fa46-526d-4bf6-b8b3-17fa01310fd8"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/20f6c761-4dd7-4f27-9e37-6db8471486ef"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/ebc68898-5c0f-4353-a426-4a5f1e737b12"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/f67fb4ed-d481-44d7-91e5-efadf504f74a"), - // }}, - // DisplayName: to.Ptr("Restrict unauthorized network access"), - // MaxScore: to.Ptr[int32](4), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // DisplayName: to.Ptr("Restrict unauthorized network access"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](4), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](1), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("8fd574ec-43cf-426e-a439-a67cbaf2d564"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/8fd574ec-43cf-426e-a439-a67cbaf2d564"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // Definition: &armsecurity.SecureScoreControlDefinitionItem{ - // Name: to.Ptr("8fd574ec-43cf-426e-a439-a67cbaf2d564"), - // Type: to.Ptr("Microsoft.Security/secureScoreControlDefinitions"), - // ID: to.Ptr("/providers/Microsoft.Security/secureScoreControlDefinitions/8fd574ec-43cf-426e-a439-a67cbaf2d564"), - // Properties: &armsecurity.SecureScoreControlDefinitionItemProperties{ - // AssessmentDefinitions: []*armsecurity.AzureResourceLink{ - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/d57a4221-a804-52ca-3dea-768284f06bb7"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/651967bf-044e-4bde-8376-3e08e0600105"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/b12bc79e-4f12-44db-acda-571820191ddc"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/7f04fc0c-4a3d-5c7e-ce19-666cb871b510"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/dbfc99e3-e648-4c3b-bd32-995e6268430d"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/c01fab9f-bde1-4ba5-9d35-7de51f31c2d3"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/23b514bd-2afc-4a3e-8d3d-f4327118eee9"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/3053474d-4fab-4603-8d18-2a6dfd09f782"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/6be98232-0100-474a-b33d-ba9c1a747f70"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/a7c8fa46-526d-4bf6-b8b3-17fa01310fd8"), - // }, - // { - // ID: to.Ptr("/providers/Microsoft.Security/assessmentMetadata/20f6c761-4dd7-4f27-9e37-6db8471486ef"), - // }}, - // DisplayName: to.Ptr("Enable encryption at rest"), - // MaxScore: to.Ptr[int32](4), - // Source: &armsecurity.SecureScoreControlDefinitionSource{ - // SourceType: to.Ptr(armsecurity.ControlTypeBuiltIn), - // }, - // }, - // }, - // DisplayName: to.Ptr("Enable encryption at rest"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](4), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](1), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](1), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScoreControls_example.json -func ExampleSecureScoreControlsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecureScoreControlsClient().NewListPager(&armsecurity.SecureScoreControlsClientListOptions{Expand: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SecureScoreControlList = armsecurity.SecureScoreControlList{ - // Value: []*armsecurity.SecureScoreControlDetails{ - // { - // Name: to.Ptr("a9909064-42b4-4d34-8143-275477afe18b"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/a9909064-42b4-4d34-8143-275477afe18b"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Protect applications against DDoS attacks"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](1), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](0), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](0), - // }, - // }, - // { - // Name: to.Ptr("34a42fb3-e6db-409c-b56b-7b1db6b8aee0"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/34a42fb3-e6db-409c-b56b-7b1db6b8aee0"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Enable MFA"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](10), - // Max: to.Ptr[int32](10), - // Percentage: to.Ptr[float64](1), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("76763537-9feb-42d3-b4f4-78c01117be80"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/76763537-9feb-42d3-b4f4-78c01117be80"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Implement security best practices"), - // HealthyResourceCount: to.Ptr[int32](7), - // NotApplicableResourceCount: to.Ptr[int32](1), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](0), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](7), - // }, - // }, - // { - // Name: to.Ptr("4db8d6cf-075b-4149-a813-da09ca2ae120"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/4db8d6cf-075b-4149-a813-da09ca2ae120"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Enable Advanced Threat Protection"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](0), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("27b24961-75ba-4fe4-8909-97286d5dd5ee"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/27b24961-75ba-4fe4-8909-97286d5dd5ee"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Enable auditing and logging"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0.2), - // Max: to.Ptr[int32](1), - // Percentage: to.Ptr[float64](0.2), - // }, - // UnhealthyResourceCount: to.Ptr[int32](4), - // Weight: to.Ptr[int64](5), - // }, - // }, - // { - // Name: to.Ptr("2d85f639-0bea-4a4a-b6c6-608952a1414a"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/2d85f639-0bea-4a4a-b6c6-608952a1414a"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Manage access and permissions"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](2), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](0.5), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](2), - // }, - // }, - // { - // Name: to.Ptr("99fc8df2-e0f5-40f8-9415-a7f7ca948b5a"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/99fc8df2-e0f5-40f8-9415-a7f7ca948b5a"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Remediate security configurations"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("12136bd9-dc24-44f2-9587-7be3af6aac14"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/12136bd9-dc24-44f2-9587-7be3af6aac14"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Enable endpoint protection"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](2), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("61702b76-1fab-41f2-bcbc-50b7870dcf38"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/61702b76-1fab-41f2-bcbc-50b7870dcf38"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Apply system updates"), - // HealthyResourceCount: to.Ptr[int32](0), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](0), - // Max: to.Ptr[int32](6), - // Percentage: to.Ptr[float64](0), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("0e55495e-034f-4abc-8293-767229250176"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/0e55495e-034f-4abc-8293-767229250176"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Encrypt data in transit"), - // HealthyResourceCount: to.Ptr[int32](5), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](3.33), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](0.8325), - // }, - // UnhealthyResourceCount: to.Ptr[int32](1), - // Weight: to.Ptr[int64](6), - // }, - // }, - // { - // Name: to.Ptr("f9d5432b-8f7b-45e9-b90c-e214a30f6a02"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/f9d5432b-8f7b-45e9-b90c-e214a30f6a02"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Restrict unauthorized network access"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](4), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](1), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](1), - // }, - // }, - // { - // Name: to.Ptr("8fd574ec-43cf-426e-a439-a67cbaf2d564"), - // Type: to.Ptr("Microsoft.Security/secureScores/secureScoreControls"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore/secureScoreControls/8fd574ec-43cf-426e-a439-a67cbaf2d564"), - // Properties: &armsecurity.SecureScoreControlScoreDetails{ - // DisplayName: to.Ptr("Enable encryption at rest"), - // HealthyResourceCount: to.Ptr[int32](1), - // NotApplicableResourceCount: to.Ptr[int32](0), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](4), - // Max: to.Ptr[int32](4), - // Percentage: to.Ptr[float64](1), - // }, - // UnhealthyResourceCount: to.Ptr[int32](0), - // Weight: to.Ptr[int64](1), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/securescores_client.go b/sdk/resourcemanager/security/armsecurity/securescores_client.go index 26172b8625ee..cd4f6b4b6547 100644 --- a/sdk/resourcemanager/security/armsecurity/securescores_client.go +++ b/sdk/resourcemanager/security/armsecurity/securescores_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -73,7 +70,7 @@ func (client *SecureScoresClient) Get(ctx context.Context, secureScoreName strin } // getCreateRequest creates the Get request. -func (client *SecureScoresClient) getCreateRequest(ctx context.Context, secureScoreName string, options *SecureScoresClientGetOptions) (*policy.Request, error) { +func (client *SecureScoresClient) getCreateRequest(ctx context.Context, secureScoreName string, _ *SecureScoresClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -131,7 +128,7 @@ func (client *SecureScoresClient) NewListPager(options *SecureScoresClientListOp } // listCreateRequest creates the List request. -func (client *SecureScoresClient) listCreateRequest(ctx context.Context, options *SecureScoresClientListOptions) (*policy.Request, error) { +func (client *SecureScoresClient) listCreateRequest(ctx context.Context, _ *SecureScoresClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 3ad3bf6b6f19..000000000000 --- a/sdk/resourcemanager/security/armsecurity/securescores_client_example_test.go +++ /dev/null @@ -1,94 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScores_example.json -func ExampleSecureScoresClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSecureScoresClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SecureScoresList = armsecurity.SecureScoresList{ - // Value: []*armsecurity.SecureScoreItem{ - // { - // Name: to.Ptr("ascScore"), - // Type: to.Ptr("Microsoft.Security/secureScores"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore"), - // Properties: &armsecurity.SecureScoreItemProperties{ - // DisplayName: to.Ptr("ASC score"), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](23.53), - // Max: to.Ptr[int32](39), - // Percentage: to.Ptr[float64](0.6033), - // }, - // Weight: to.Ptr[int64](67), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/GetSecureScoresSingle_example.json -func ExampleSecureScoresClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSecureScoresClient().Get(ctx, "ascScore", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SecureScoreItem = armsecurity.SecureScoreItem{ - // Name: to.Ptr("ascScore"), - // Type: to.Ptr("Microsoft.Security/secureScores"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/secureScores/ascScore"), - // Properties: &armsecurity.SecureScoreItemProperties{ - // DisplayName: to.Ptr("ASC score"), - // Score: &armsecurity.ScoreDetails{ - // Current: to.Ptr[float64](23.53), - // Max: to.Ptr[int32](39), - // Percentage: to.Ptr[float64](0.6033), - // }, - // Weight: to.Ptr[int64](67), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/sensitivitysettings_client.go b/sdk/resourcemanager/security/armsecurity/sensitivitysettings_client.go index cbb7e55ab982..c28a5de1fdf8 100644 --- a/sdk/resourcemanager/security/armsecurity/sensitivitysettings_client.go +++ b/sdk/resourcemanager/security/armsecurity/sensitivitysettings_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -67,7 +64,7 @@ func (client *SensitivitySettingsClient) CreateOrUpdate(ctx context.Context, sen } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *SensitivitySettingsClient) createOrUpdateCreateRequest(ctx context.Context, sensitivitySettings UpdateSensitivitySettingsRequest, options *SensitivitySettingsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *SensitivitySettingsClient) createOrUpdateCreateRequest(ctx context.Context, sensitivitySettings UpdateSensitivitySettingsRequest, _ *SensitivitySettingsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Security/sensitivitySettings/current" req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { @@ -120,7 +117,7 @@ func (client *SensitivitySettingsClient) Get(ctx context.Context, options *Sensi } // getCreateRequest creates the Get request. -func (client *SensitivitySettingsClient) getCreateRequest(ctx context.Context, options *SensitivitySettingsClientGetOptions) (*policy.Request, error) { +func (client *SensitivitySettingsClient) getCreateRequest(ctx context.Context, _ *SensitivitySettingsClientGetOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Security/sensitivitySettings/current" req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { @@ -171,7 +168,7 @@ func (client *SensitivitySettingsClient) List(ctx context.Context, options *Sens } // listCreateRequest creates the List request. -func (client *SensitivitySettingsClient) listCreateRequest(ctx context.Context, options *SensitivitySettingsClientListOptions) (*policy.Request, error) { +func (client *SensitivitySettingsClient) listCreateRequest(ctx context.Context, _ *SensitivitySettingsClientListOptions) (*policy.Request, error) { urlPath := "/providers/Microsoft.Security/sensitivitySettings" req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { diff --git a/sdk/resourcemanager/security/armsecurity/sensitivitysettings_client_example_test.go b/sdk/resourcemanager/security/armsecurity/sensitivitysettings_client_example_test.go deleted file mode 100644 index d38b7fd92c47..000000000000 --- a/sdk/resourcemanager/security/armsecurity/sensitivitysettings_client_example_test.go +++ /dev/null @@ -1,296 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-02-15-preview/examples/SensitivitySettings/PutSensitivitySettings_example.json -func ExampleSensitivitySettingsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSensitivitySettingsClient().CreateOrUpdate(ctx, armsecurity.UpdateSensitivitySettingsRequest{ - SensitiveInfoTypesIDs: []*string{ - to.Ptr("f2f8a7a1-28c0-404b-9ab4-30a0a7af18cb"), - to.Ptr("b452f22b-f87d-4f48-8490-ecf0873325b5"), - to.Ptr("d59ee8b6-2618-404b-a5e7-aa377cd67543")}, - SensitivityThresholdLabelID: to.Ptr("f2f8a7a1-28c0-404b-9ab4-30a0a7af18cb"), - SensitivityThresholdLabelOrder: to.Ptr[float32](2), - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GetSensitivitySettingsResponse = armsecurity.GetSensitivitySettingsResponse{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Security/sensitivitySettings"), - // ID: to.Ptr("/providers/Microsoft.Security/sensitivitySettings"), - // Properties: &armsecurity.GetSensitivitySettingsResponseProperties{ - // MipInformation: &armsecurity.GetSensitivitySettingsResponsePropertiesMipInformation{ - // BuiltInInfoTypes: []*armsecurity.BuiltInInfoType{ - // { - // Name: to.Ptr("Http Authorization Header"), - // Type: to.Ptr("Credentials"), - // ID: to.Ptr("4d0d3eb6-619f-4c8c-810c-c16150c95278"), - // }, - // { - // Name: to.Ptr("User Login Credentials"), - // Type: to.Ptr("Credentials"), - // ID: to.Ptr("a98fde82-45b6-4b2c-afd0-ad579cd9f826"), - // }, - // { - // Name: to.Ptr("Credit card number"), - // Type: to.Ptr("Finance"), - // ID: to.Ptr("50842eb7-edc8-4019-85dd-5a5c1f2bb085"), - // }, - // { - // Name: to.Ptr("EU debit card number"), - // Type: to.Ptr("Finance"), - // ID: to.Ptr("0e9b3178-9678-47dd-a509-37222ca96b42"), - // }}, - // CustomInfoTypes: []*armsecurity.InfoType{ - // { - // Name: to.Ptr("User created custom info type 1"), - // Description: to.Ptr("Custom info type description"), - // ID: to.Ptr("c5f9b9a1-2b9a-4a3a-8c5b-1f3d1d9d9c9b"), - // }, - // { - // Name: to.Ptr("User created custom info type 2"), - // Description: to.Ptr("Custom info type description"), - // ID: to.Ptr("a4fee2b6-5618-404b-a5e7-aa377cd67543"), - // }, - // { - // Name: to.Ptr("User created custom info type 3"), - // Description: to.Ptr("Custom info type description"), - // ID: to.Ptr("a355f11e-f87d-4f48-8490-ecf0873325b5"), - // }}, - // Labels: []*armsecurity.Label{ - // { - // Name: to.Ptr("Public"), - // ID: to.Ptr("fdfb5435-124d-4651-a889-a4210fec6a77"), - // Order: to.Ptr[float32](0), - // }, - // { - // Name: to.Ptr("Confidential"), - // ID: to.Ptr("4c5447ec-f7f3-4345-a160-6a5850f2bf0c"), - // Order: to.Ptr[float32](1), - // }, - // { - // Name: to.Ptr("Highly Confidential"), - // ID: to.Ptr("f38ac75c-f42a-4c89-aa37-9c4e74101414"), - // Order: to.Ptr[float32](2), - // }}, - // MipIntegrationStatus: to.Ptr(armsecurity.MipIntegrationStatusOk), - // }, - // SensitiveInfoTypesIDs: []*string{ - // to.Ptr("a98fde82-45b6-4b2c-afd0-ad579cd9f826"), - // to.Ptr("4d0d3eb6-619f-4c8c-810c-c16150c95278"), - // to.Ptr("0e9b3178-9678-47dd-a509-37222ca96b42"), - // to.Ptr("c5f9b9a1-2b9a-4a3a-8c5b-1f3d1d9d9c9b")}, - // SensitivityThresholdLabelOrder: to.Ptr[float32](2), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-02-15-preview/examples/SensitivitySettings/GetSensitivitySettings_example.json -func ExampleSensitivitySettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSensitivitySettingsClient().Get(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GetSensitivitySettingsResponse = armsecurity.GetSensitivitySettingsResponse{ - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Security/sensitivitySettings"), - // ID: to.Ptr("/providers/Microsoft.Security/sensitivitySettings"), - // Properties: &armsecurity.GetSensitivitySettingsResponseProperties{ - // MipInformation: &armsecurity.GetSensitivitySettingsResponsePropertiesMipInformation{ - // BuiltInInfoTypes: []*armsecurity.BuiltInInfoType{ - // { - // Name: to.Ptr("Http Authorization Header"), - // Type: to.Ptr("Credentials"), - // ID: to.Ptr("4d0d3eb6-619f-4c8c-810c-c16150c95278"), - // }, - // { - // Name: to.Ptr("User Login Credentials"), - // Type: to.Ptr("Credentials"), - // ID: to.Ptr("a98fde82-45b6-4b2c-afd0-ad579cd9f826"), - // }, - // { - // Name: to.Ptr("Credit card number"), - // Type: to.Ptr("Finance"), - // ID: to.Ptr("50842eb7-edc8-4019-85dd-5a5c1f2bb085"), - // }, - // { - // Name: to.Ptr("EU debit card number"), - // Type: to.Ptr("Finance"), - // ID: to.Ptr("0e9b3178-9678-47dd-a509-37222ca96b42"), - // }}, - // CustomInfoTypes: []*armsecurity.InfoType{ - // { - // Name: to.Ptr("User created custom info type 1"), - // Description: to.Ptr("Custom info type description"), - // ID: to.Ptr("c5f9b9a1-2b9a-4a3a-8c5b-1f3d1d9d9c9b"), - // }, - // { - // Name: to.Ptr("User created custom info type 2"), - // Description: to.Ptr("Custom info type description"), - // ID: to.Ptr("a4fee2b6-5618-404b-a5e7-aa377cd67543"), - // }, - // { - // Name: to.Ptr("User created custom info type 3"), - // Description: to.Ptr("Custom info type description"), - // ID: to.Ptr("a355f11e-f87d-4f48-8490-ecf0873325b5"), - // }}, - // Labels: []*armsecurity.Label{ - // { - // Name: to.Ptr("Public"), - // ID: to.Ptr("fdfb5435-124d-4651-a889-a4210fec6a77"), - // Order: to.Ptr[float32](0), - // }, - // { - // Name: to.Ptr("Confidential"), - // ID: to.Ptr("4c5447ec-f7f3-4345-a160-6a5850f2bf0c"), - // Order: to.Ptr[float32](1), - // }, - // { - // Name: to.Ptr("Highly Confidential"), - // ID: to.Ptr("f38ac75c-f42a-4c89-aa37-9c4e74101414"), - // Order: to.Ptr[float32](2), - // }}, - // MipIntegrationStatus: to.Ptr(armsecurity.MipIntegrationStatusOk), - // }, - // SensitiveInfoTypesIDs: []*string{ - // to.Ptr("a98fde82-45b6-4b2c-afd0-ad579cd9f826"), - // to.Ptr("4d0d3eb6-619f-4c8c-810c-c16150c95278"), - // to.Ptr("0e9b3178-9678-47dd-a509-37222ca96b42"), - // to.Ptr("c5f9b9a1-2b9a-4a3a-8c5b-1f3d1d9d9c9b")}, - // SensitivityThresholdLabelOrder: to.Ptr[float32](1), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-02-15-preview/examples/SensitivitySettings/GetSensitivitySettingsList_example.json -func ExampleSensitivitySettingsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSensitivitySettingsClient().List(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GetSensitivitySettingsListResponse = armsecurity.GetSensitivitySettingsListResponse{ - // Value: []*armsecurity.GetSensitivitySettingsResponse{ - // { - // Name: to.Ptr("current"), - // Type: to.Ptr("Microsoft.Security/sensitivitySettings"), - // ID: to.Ptr("/providers/Microsoft.Security/sensitivitySettings"), - // Properties: &armsecurity.GetSensitivitySettingsResponseProperties{ - // MipInformation: &armsecurity.GetSensitivitySettingsResponsePropertiesMipInformation{ - // BuiltInInfoTypes: []*armsecurity.BuiltInInfoType{ - // { - // Name: to.Ptr("Http Authorization Header"), - // Type: to.Ptr("Credentials"), - // ID: to.Ptr("4d0d3eb6-619f-4c8c-810c-c16150c95278"), - // }, - // { - // Name: to.Ptr("User Login Credentials"), - // Type: to.Ptr("Credentials"), - // ID: to.Ptr("a98fde82-45b6-4b2c-afd0-ad579cd9f826"), - // }, - // { - // Name: to.Ptr("Credit card number"), - // Type: to.Ptr("Finance"), - // ID: to.Ptr("50842eb7-edc8-4019-85dd-5a5c1f2bb085"), - // }, - // { - // Name: to.Ptr("EU debit card number"), - // Type: to.Ptr("Finance"), - // ID: to.Ptr("0e9b3178-9678-47dd-a509-37222ca96b42"), - // }}, - // CustomInfoTypes: []*armsecurity.InfoType{ - // { - // Name: to.Ptr("User created custom info type 1"), - // Description: to.Ptr("Custom info type description"), - // ID: to.Ptr("c5f9b9a1-2b9a-4a3a-8c5b-1f3d1d9d9c9b"), - // }, - // { - // Name: to.Ptr("User created custom info type 2"), - // Description: to.Ptr("Custom info type description"), - // ID: to.Ptr("a4fee2b6-5618-404b-a5e7-aa377cd67543"), - // }, - // { - // Name: to.Ptr("User created custom info type 3"), - // Description: to.Ptr("Custom info type description"), - // ID: to.Ptr("a355f11e-f87d-4f48-8490-ecf0873325b5"), - // }}, - // Labels: []*armsecurity.Label{ - // { - // Name: to.Ptr("Public"), - // ID: to.Ptr("fdfb5435-124d-4651-a889-a4210fec6a77"), - // Order: to.Ptr[float32](0), - // }, - // { - // Name: to.Ptr("Confidential"), - // ID: to.Ptr("4c5447ec-f7f3-4345-a160-6a5850f2bf0c"), - // Order: to.Ptr[float32](1), - // }, - // { - // Name: to.Ptr("Highly Confidential"), - // ID: to.Ptr("f38ac75c-f42a-4c89-aa37-9c4e74101414"), - // Order: to.Ptr[float32](2), - // }}, - // MipIntegrationStatus: to.Ptr(armsecurity.MipIntegrationStatusOk), - // }, - // SensitiveInfoTypesIDs: []*string{ - // to.Ptr("a98fde82-45b6-4b2c-afd0-ad579cd9f826"), - // to.Ptr("4d0d3eb6-619f-4c8c-810c-c16150c95278"), - // to.Ptr("0e9b3178-9678-47dd-a509-37222ca96b42"), - // to.Ptr("c5f9b9a1-2b9a-4a3a-8c5b-1f3d1d9d9c9b")}, - // SensitivityThresholdLabelOrder: to.Ptr[float32](1), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessment_client.go b/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessment_client.go index b23b9f96eca6..6a9f0371db68 100644 --- a/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessment_client.go +++ b/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessment_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -77,7 +74,7 @@ func (client *ServerVulnerabilityAssessmentClient) CreateOrUpdate(ctx context.Co } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ServerVulnerabilityAssessmentClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, options *ServerVulnerabilityAssessmentClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ServerVulnerabilityAssessmentClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, _ *ServerVulnerabilityAssessmentClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -174,7 +171,7 @@ func (client *ServerVulnerabilityAssessmentClient) deleteOperation(ctx context.C } // deleteCreateRequest creates the Delete request. -func (client *ServerVulnerabilityAssessmentClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, options *ServerVulnerabilityAssessmentClientBeginDeleteOptions) (*policy.Request, error) { +func (client *ServerVulnerabilityAssessmentClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, _ *ServerVulnerabilityAssessmentClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -241,7 +238,7 @@ func (client *ServerVulnerabilityAssessmentClient) Get(ctx context.Context, reso } // getCreateRequest creates the Get request. -func (client *ServerVulnerabilityAssessmentClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, options *ServerVulnerabilityAssessmentClientGetOptions) (*policy.Request, error) { +func (client *ServerVulnerabilityAssessmentClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, _ *ServerVulnerabilityAssessmentClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments/{serverVulnerabilityAssessment}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -317,7 +314,7 @@ func (client *ServerVulnerabilityAssessmentClient) ListByExtendedResource(ctx co } // listByExtendedResourceCreateRequest creates the ListByExtendedResource request. -func (client *ServerVulnerabilityAssessmentClient) listByExtendedResourceCreateRequest(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, options *ServerVulnerabilityAssessmentClientListByExtendedResourceOptions) (*policy.Request, error) { +func (client *ServerVulnerabilityAssessmentClient) listByExtendedResourceCreateRequest(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, _ *ServerVulnerabilityAssessmentClientListByExtendedResourceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/serverVulnerabilityAssessments" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 68943081aa4a..000000000000 --- a/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessment_client_example_test.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/ListByExtendedResourceServerVulnerabilityAssessments_example.json -func ExampleServerVulnerabilityAssessmentClient_ListByExtendedResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerVulnerabilityAssessmentClient().ListByExtendedResource(ctx, "rg1", "Microsoft.Compute", "virtualMachines", "vm1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerVulnerabilityAssessmentsList = armsecurity.ServerVulnerabilityAssessmentsList{ - // Value: []*armsecurity.ServerVulnerabilityAssessment{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/serverVulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Security/serverVulnerabilityAssessments/default"), - // Properties: &armsecurity.ServerVulnerabilityAssessmentProperties{ - // ProvisioningState: to.Ptr(armsecurity.ServerVulnerabilityAssessmentPropertiesProvisioningStateSucceeded), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/GetServerVulnerabilityAssessments_example.json -func ExampleServerVulnerabilityAssessmentClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerVulnerabilityAssessmentClient().Get(ctx, "rg1", "Microsoft.Compute", "virtualMachines", "vm1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ServerVulnerabilityAssessment = armsecurity.ServerVulnerabilityAssessment{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/serverVulnerabilityAssessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Security/serverVulnerabilityAssessments/default"), - // Properties: &armsecurity.ServerVulnerabilityAssessmentProperties{ - // ProvisioningState: to.Ptr(armsecurity.ServerVulnerabilityAssessmentPropertiesProvisioningStateSucceeded), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/CreateServerVulnerabilityAssessments_example.json -func ExampleServerVulnerabilityAssessmentClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewServerVulnerabilityAssessmentClient().CreateOrUpdate(ctx, "rg1", "Microsoft.Compute", "virtualMachines", "vm1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/DeleteServerVulnerabilityAssessments_example.json -func ExampleServerVulnerabilityAssessmentClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewServerVulnerabilityAssessmentClient().BeginDelete(ctx, "rg1", "Microsoft.Compute", "virtualMachines", "vm1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessmentssettings_client.go b/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessmentssettings_client.go index 64e0e83334c8..ce0dbf9425f5 100644 --- a/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessmentssettings_client.go +++ b/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessmentssettings_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -74,7 +71,7 @@ func (client *ServerVulnerabilityAssessmentsSettingsClient) CreateOrUpdate(ctx c } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ServerVulnerabilityAssessmentsSettingsClient) createOrUpdateCreateRequest(ctx context.Context, settingKind ServerVulnerabilityAssessmentsSettingKindName, serverVulnerabilityAssessmentsSetting ServerVulnerabilityAssessmentsSettingClassification, options *ServerVulnerabilityAssessmentsSettingsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ServerVulnerabilityAssessmentsSettingsClient) createOrUpdateCreateRequest(ctx context.Context, settingKind ServerVulnerabilityAssessmentsSettingKindName, serverVulnerabilityAssessmentsSetting ServerVulnerabilityAssessmentsSettingClassification, _ *ServerVulnerabilityAssessmentsSettingsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings/{settingKind}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -136,7 +133,7 @@ func (client *ServerVulnerabilityAssessmentsSettingsClient) Delete(ctx context.C } // deleteCreateRequest creates the Delete request. -func (client *ServerVulnerabilityAssessmentsSettingsClient) deleteCreateRequest(ctx context.Context, settingKind ServerVulnerabilityAssessmentsSettingKindName, options *ServerVulnerabilityAssessmentsSettingsClientDeleteOptions) (*policy.Request, error) { +func (client *ServerVulnerabilityAssessmentsSettingsClient) deleteCreateRequest(ctx context.Context, settingKind ServerVulnerabilityAssessmentsSettingKindName, _ *ServerVulnerabilityAssessmentsSettingsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings/{settingKind}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -187,7 +184,7 @@ func (client *ServerVulnerabilityAssessmentsSettingsClient) Get(ctx context.Cont } // getCreateRequest creates the Get request. -func (client *ServerVulnerabilityAssessmentsSettingsClient) getCreateRequest(ctx context.Context, settingKind ServerVulnerabilityAssessmentsSettingKindName, options *ServerVulnerabilityAssessmentsSettingsClientGetOptions) (*policy.Request, error) { +func (client *ServerVulnerabilityAssessmentsSettingsClient) getCreateRequest(ctx context.Context, settingKind ServerVulnerabilityAssessmentsSettingKindName, _ *ServerVulnerabilityAssessmentsSettingsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings/{settingKind}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -247,7 +244,7 @@ func (client *ServerVulnerabilityAssessmentsSettingsClient) NewListBySubscriptio } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *ServerVulnerabilityAssessmentsSettingsClient) listBySubscriptionCreateRequest(ctx context.Context, options *ServerVulnerabilityAssessmentsSettingsClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *ServerVulnerabilityAssessmentsSettingsClient) listBySubscriptionCreateRequest(ctx context.Context, _ *ServerVulnerabilityAssessmentsSettingsClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") diff --git a/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessmentssettings_client_example_test.go b/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessmentssettings_client_example_test.go deleted file mode 100644 index 12885cf6bf2b..000000000000 --- a/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessmentssettings_client_example_test.go +++ /dev/null @@ -1,164 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ServerVulnerabilityAssessmentsSettings/ListServerVulnerabilityAssessmentsSettings_example.json -func ExampleServerVulnerabilityAssessmentsSettingsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewServerVulnerabilityAssessmentsSettingsClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ServerVulnerabilityAssessmentsSettingsList = armsecurity.ServerVulnerabilityAssessmentsSettingsList{ - // Value: []armsecurity.ServerVulnerabilityAssessmentsSettingClassification{ - // &armsecurity.AzureServersSetting{ - // Name: to.Ptr("azureServersSetting"), - // Type: to.Ptr("Microsoft.Security/serverVulnerabilityAssessmentsSettings"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings/azureServersSetting"), - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-12T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-12T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // Kind: to.Ptr(armsecurity.ServerVulnerabilityAssessmentsSettingKindAzureServersSetting), - // Properties: &armsecurity.ServerVulnerabilityAssessmentsAzureSettingProperties{ - // SelectedProvider: to.Ptr(armsecurity.ServerVulnerabilityAssessmentsAzureSettingSelectedProviderMdeTvm), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ServerVulnerabilityAssessmentsSettings/GetServerVulnerabilityAssessmentsSetting_example.json -func ExampleServerVulnerabilityAssessmentsSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerVulnerabilityAssessmentsSettingsClient().Get(ctx, armsecurity.ServerVulnerabilityAssessmentsSettingKindNameAzureServersSetting, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armsecurity.ServerVulnerabilityAssessmentsSettingsClientGetResponse{ - // ServerVulnerabilityAssessmentsSettingClassification: &armsecurity.AzureServersSetting{ - // Name: to.Ptr("azureServersSetting"), - // Type: to.Ptr("Microsoft.Security/serverVulnerabilityAssessmentsSettings"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings/azureServersSetting"), - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-12T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-05-12T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // Kind: to.Ptr(armsecurity.ServerVulnerabilityAssessmentsSettingKindAzureServersSetting), - // Properties: &armsecurity.ServerVulnerabilityAssessmentsAzureSettingProperties{ - // SelectedProvider: to.Ptr(armsecurity.ServerVulnerabilityAssessmentsAzureSettingSelectedProviderMdeTvm), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ServerVulnerabilityAssessmentsSettings/PutServerVulnerabilityAssessmentsSetting_example.json -func ExampleServerVulnerabilityAssessmentsSettingsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewServerVulnerabilityAssessmentsSettingsClient().CreateOrUpdate(ctx, armsecurity.ServerVulnerabilityAssessmentsSettingKindNameAzureServersSetting, &armsecurity.AzureServersSetting{ - Kind: to.Ptr(armsecurity.ServerVulnerabilityAssessmentsSettingKindAzureServersSetting), - Properties: &armsecurity.ServerVulnerabilityAssessmentsAzureSettingProperties{ - SelectedProvider: to.Ptr(armsecurity.ServerVulnerabilityAssessmentsAzureSettingSelectedProviderMdeTvm), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armsecurity.ServerVulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse{ - // ServerVulnerabilityAssessmentsSettingClassification: &armsecurity.AzureServersSetting{ - // Name: to.Ptr("azureServersSetting"), - // Type: to.Ptr("Microsoft.Security/serverVulnerabilityAssessmentsSettings"), - // ID: to.Ptr("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings/azureServersSetting"), - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-12T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-12T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // Kind: to.Ptr(armsecurity.ServerVulnerabilityAssessmentsSettingKindAzureServersSetting), - // Properties: &armsecurity.ServerVulnerabilityAssessmentsAzureSettingProperties{ - // SelectedProvider: to.Ptr(armsecurity.ServerVulnerabilityAssessmentsAzureSettingSelectedProviderMdeTvm), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2023-05-01/examples/ServerVulnerabilityAssessmentsSettings/DeleteServerVulnerabilityAssessmentsSetting_example.json -func ExampleServerVulnerabilityAssessmentsSettingsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewServerVulnerabilityAssessmentsSettingsClient().Delete(ctx, armsecurity.ServerVulnerabilityAssessmentsSettingKindNameAzureServersSetting, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/settings_client.go b/sdk/resourcemanager/security/armsecurity/settings_client.go index 28d96e72c844..8561a75d7d02 100644 --- a/sdk/resourcemanager/security/armsecurity/settings_client.go +++ b/sdk/resourcemanager/security/armsecurity/settings_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -49,7 +46,7 @@ func NewSettingsClient(subscriptionID string, credential azcore.TokenCredential, // Generated from API version 2022-05-01 // - settingName - The name of the setting // - options - SettingsClientGetOptions contains the optional parameters for the SettingsClient.Get method. -func (client *SettingsClient) Get(ctx context.Context, settingName SettingNameAutoGenerated, options *SettingsClientGetOptions) (SettingsClientGetResponse, error) { +func (client *SettingsClient) Get(ctx context.Context, settingName SettingName, options *SettingsClientGetOptions) (SettingsClientGetResponse, error) { var err error const operationName = "SettingsClient.Get" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) @@ -72,7 +69,7 @@ func (client *SettingsClient) Get(ctx context.Context, settingName SettingNameAu } // getCreateRequest creates the Get request. -func (client *SettingsClient) getCreateRequest(ctx context.Context, settingName SettingNameAutoGenerated, options *SettingsClientGetOptions) (*policy.Request, error) { +func (client *SettingsClient) getCreateRequest(ctx context.Context, settingName SettingName, _ *SettingsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -130,7 +127,7 @@ func (client *SettingsClient) NewListPager(options *SettingsClientListOptions) * } // listCreateRequest creates the List request. -func (client *SettingsClient) listCreateRequest(ctx context.Context, options *SettingsClientListOptions) (*policy.Request, error) { +func (client *SettingsClient) listCreateRequest(ctx context.Context, _ *SettingsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -163,7 +160,7 @@ func (client *SettingsClient) listHandleResponse(resp *http.Response) (SettingsC // - settingName - The name of the setting // - setting - Setting object // - options - SettingsClientUpdateOptions contains the optional parameters for the SettingsClient.Update method. -func (client *SettingsClient) Update(ctx context.Context, settingName SettingNameAutoGenerated, setting SettingClassification, options *SettingsClientUpdateOptions) (SettingsClientUpdateResponse, error) { +func (client *SettingsClient) Update(ctx context.Context, settingName SettingName, setting SettingClassification, options *SettingsClientUpdateOptions) (SettingsClientUpdateResponse, error) { var err error const operationName = "SettingsClient.Update" ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) @@ -186,7 +183,7 @@ func (client *SettingsClient) Update(ctx context.Context, settingName SettingNam } // updateCreateRequest creates the Update request. -func (client *SettingsClient) updateCreateRequest(ctx context.Context, settingName SettingNameAutoGenerated, setting SettingClassification, options *SettingsClientUpdateOptions) (*policy.Request, error) { +func (client *SettingsClient) updateCreateRequest(ctx context.Context, settingName SettingName, setting SettingClassification, _ *SettingsClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/settings/{settingName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 18086b262b66..000000000000 --- a/sdk/resourcemanager/security/armsecurity/settings_client_example_test.go +++ /dev/null @@ -1,150 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSettings_example.json -func ExampleSettingsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSettingsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SettingsList = armsecurity.SettingsList{ - // Value: []armsecurity.SettingClassification{ - // &armsecurity.DataExportSettings{ - // Name: to.Ptr("WDATP"), - // Type: to.Ptr("Microsoft.Security/settings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/WDATP"), - // Kind: to.Ptr(armsecurity.SettingKindDataExportSettings), - // Properties: &armsecurity.DataExportSettingProperties{ - // Enabled: to.Ptr(false), - // }, - // }, - // &armsecurity.DataExportSettings{ - // Name: to.Ptr("WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW"), - // Type: to.Ptr("Microsoft.Security/settings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/WDATP_EXCLUDE_LINUX_PUBLIC_PREVIEW"), - // Kind: to.Ptr(armsecurity.SettingKindDataExportSettings), - // Properties: &armsecurity.DataExportSettingProperties{ - // Enabled: to.Ptr(false), - // }, - // }, - // &armsecurity.DataExportSettings{ - // Name: to.Ptr("WDATP_UNIFIED_SOLUTION"), - // Type: to.Ptr("Microsoft.Security/settings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/WDATP_UNIFIED_SOLUTION"), - // Kind: to.Ptr(armsecurity.SettingKindDataExportSettings), - // Properties: &armsecurity.DataExportSettingProperties{ - // Enabled: to.Ptr(false), - // }, - // }, - // &armsecurity.AlertSyncSettings{ - // Name: to.Ptr("Sentinel"), - // Type: to.Ptr("Microsoft.Security/settings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/Sentinel"), - // Kind: to.Ptr(armsecurity.SettingKindAlertSyncSettings), - // Properties: &armsecurity.AlertSyncSettingProperties{ - // Enabled: to.Ptr(false), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSetting_example.json -func ExampleSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSettingsClient().Get(ctx, armsecurity.SettingNameAutoGeneratedWDATP, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armsecurity.SettingsClientGetResponse{ - // SettingClassification: &armsecurity.DataExportSettings{ - // Name: to.Ptr("WDATP"), - // Type: to.Ptr("Microsoft.Security/settings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/WDATP"), - // Kind: to.Ptr(armsecurity.SettingKindDataExportSettings), - // Properties: &armsecurity.DataExportSettingProperties{ - // Enabled: to.Ptr(true), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/UpdateSetting_example.json -func ExampleSettingsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSettingsClient().Update(ctx, armsecurity.SettingNameAutoGeneratedWDATP, &armsecurity.DataExportSettings{ - Kind: to.Ptr(armsecurity.SettingKindDataExportSettings), - Properties: &armsecurity.DataExportSettingProperties{ - Enabled: to.Ptr(true), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armsecurity.SettingsClientUpdateResponse{ - // SettingClassification: &armsecurity.DataExportSettings{ - // Name: to.Ptr("WDATP"), - // Type: to.Ptr("Microsoft.Security/settings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/settings/WDATP"), - // Kind: to.Ptr(armsecurity.SettingKindDataExportSettings), - // Properties: &armsecurity.DataExportSettingProperties{ - // Enabled: to.Ptr(true), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/softwareinventories_client.go b/sdk/resourcemanager/security/armsecurity/softwareinventories_client.go index e133a5de3694..76d35c892422 100644 --- a/sdk/resourcemanager/security/armsecurity/softwareinventories_client.go +++ b/sdk/resourcemanager/security/armsecurity/softwareinventories_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -76,7 +73,7 @@ func (client *SoftwareInventoriesClient) Get(ctx context.Context, resourceGroupN } // getCreateRequest creates the Get request. -func (client *SoftwareInventoriesClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, softwareName string, options *SoftwareInventoriesClientGetOptions) (*policy.Request, error) { +func (client *SoftwareInventoriesClient) getCreateRequest(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, softwareName string, _ *SoftwareInventoriesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories/{softwareName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -155,7 +152,7 @@ func (client *SoftwareInventoriesClient) NewListByExtendedResourcePager(resource } // listByExtendedResourceCreateRequest creates the ListByExtendedResource request. -func (client *SoftwareInventoriesClient) listByExtendedResourceCreateRequest(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, options *SoftwareInventoriesClientListByExtendedResourceOptions) (*policy.Request, error) { +func (client *SoftwareInventoriesClient) listByExtendedResourceCreateRequest(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, _ *SoftwareInventoriesClientListByExtendedResourceOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/softwareInventories" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -226,7 +223,7 @@ func (client *SoftwareInventoriesClient) NewListBySubscriptionPager(options *Sof } // listBySubscriptionCreateRequest creates the ListBySubscription request. -func (client *SoftwareInventoriesClient) listBySubscriptionCreateRequest(ctx context.Context, options *SoftwareInventoriesClientListBySubscriptionOptions) (*policy.Request, error) { +func (client *SoftwareInventoriesClient) listBySubscriptionCreateRequest(ctx context.Context, _ *SoftwareInventoriesClientListBySubscriptionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/softwareInventories" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 5491ccff095e..000000000000 --- a/sdk/resourcemanager/security/armsecurity/softwareinventories_client_example_test.go +++ /dev/null @@ -1,169 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/SoftwareInventories/ListByExtendedResourceSoftwareInventories_example.json -func ExampleSoftwareInventoriesClient_NewListByExtendedResourcePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSoftwareInventoriesClient().NewListByExtendedResourcePager("EITAN-TESTS", "Microsoft.Compute", "virtualMachines", "Eitan-Test1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SoftwaresList = armsecurity.SoftwaresList{ - // Value: []*armsecurity.Software{ - // { - // Name: to.Ptr("outlook_16.0.10371.20060"), - // Type: to.Ptr("Microsoft.Security/softwareInventories"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/EITAN-TESTS/providers/Microsoft.Compute/virtualMachines/Eitan-Test1/providers/Microsoft.Security/softwareInventories/outlook_16.0.10371.20060"), - // Properties: &armsecurity.SoftwareProperties{ - // DeviceID: to.Ptr("7bd19ed6b07553e52a2844451bcec68d25963a53"), - // EndOfSupportStatus: to.Ptr(armsecurity.EndOfSupportStatusNone), - // FirstSeenAt: to.Ptr("2021-01-26 15:48:56"), - // NumberOfKnownVulnerabilities: to.Ptr[int32](0), - // OSPlatform: to.Ptr("Windows10"), - // SoftwareName: to.Ptr("outlook"), - // Vendor: to.Ptr("microsoft"), - // Version: to.Ptr("16.0.10371.20060"), - // }, - // }, - // { - // Name: to.Ptr("windows_10_10.0.19042.746"), - // Type: to.Ptr("Microsoft.Security/softwareInventories"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/EITAN-TESTS/providers/Microsoft.Compute/virtualMachines/Eitan-Test1/providers/Microsoft.Security/softwareInventories/windows_10_10.0.19042.746"), - // Properties: &armsecurity.SoftwareProperties{ - // DeviceID: to.Ptr("7bd19ed6b07553e52a2844451bcec68d25963a53"), - // EndOfSupportStatus: to.Ptr(armsecurity.EndOfSupportStatusNone), - // FirstSeenAt: to.Ptr("2021-01-26 15:51:19"), - // NumberOfKnownVulnerabilities: to.Ptr[int32](26), - // OSPlatform: to.Ptr("Windows10"), - // SoftwareName: to.Ptr("windows_10"), - // Vendor: to.Ptr("microsoft"), - // Version: to.Ptr("10.0.19042.746"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/SoftwareInventories/ListBySubscriptionSoftwareInventories_example.json -func ExampleSoftwareInventoriesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSoftwareInventoriesClient().NewListBySubscriptionPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SoftwaresList = armsecurity.SoftwaresList{ - // Value: []*armsecurity.Software{ - // { - // Name: to.Ptr("outlook_16.0.10371.20060"), - // Type: to.Ptr("Microsoft.Security/softwareInventories"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/EITAN-TESTS/providers/Microsoft.Compute/virtualMachines/Eitan-Test1/providers/Microsoft.Security/softwareInventories/outlook_16.0.10371.20060"), - // Properties: &armsecurity.SoftwareProperties{ - // DeviceID: to.Ptr("7bd19ed6b07553e52a2844451bcec68d25963a53"), - // EndOfSupportStatus: to.Ptr(armsecurity.EndOfSupportStatusNone), - // FirstSeenAt: to.Ptr("2021-01-26 15:48:56"), - // NumberOfKnownVulnerabilities: to.Ptr[int32](0), - // OSPlatform: to.Ptr("Windows10"), - // SoftwareName: to.Ptr("outlook"), - // Vendor: to.Ptr("microsoft"), - // Version: to.Ptr("16.0.10371.20060"), - // }, - // }, - // { - // Name: to.Ptr("windows_10_10.0.19042.746"), - // Type: to.Ptr("Microsoft.Security/softwareInventories"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/EITAN-TESTS/providers/Microsoft.Compute/virtualMachines/Eitan-Test2/providers/Microsoft.Security/softwareInventories/windows_10_10.0.19042.746"), - // Properties: &armsecurity.SoftwareProperties{ - // DeviceID: to.Ptr("7bd19ed6b07553e52a2844451bcec68d25963a53"), - // EndOfSupportStatus: to.Ptr(armsecurity.EndOfSupportStatusNone), - // FirstSeenAt: to.Ptr("2021-01-26 15:51:19"), - // NumberOfKnownVulnerabilities: to.Ptr[int32](26), - // OSPlatform: to.Ptr("Windows10"), - // SoftwareName: to.Ptr("windows_10"), - // Vendor: to.Ptr("microsoft"), - // Version: to.Ptr("10.0.19042.746"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/SoftwareInventories/GetSoftware_example.json -func ExampleSoftwareInventoriesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSoftwareInventoriesClient().Get(ctx, "EITAN-TESTS", "Microsoft.Compute", "virtualMachines", "Eitan-Test1", "outlook_16.0.10371.20060", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Software = armsecurity.Software{ - // Name: to.Ptr("outlook_16.0.10371.20060"), - // Type: to.Ptr("Microsoft.Security/softwareInventories"), - // ID: to.Ptr("/subscriptions/e5d1b86c-3051-44d5-8802-aa65d45a279b/resourcegroups/EITAN-TESTS/providers/Microsoft.Compute/virtualMachines/Eitan-Test1/providers/Microsoft.Security/softwareInventories/outlook_16.0.10371.20060"), - // Properties: &armsecurity.SoftwareProperties{ - // DeviceID: to.Ptr("7bd19ed6b07553e52a2844451bcec68d25963a53"), - // EndOfSupportStatus: to.Ptr(armsecurity.EndOfSupportStatusNone), - // FirstSeenAt: to.Ptr("2021-01-26 15:48:56"), - // NumberOfKnownVulnerabilities: to.Ptr[int32](0), - // OSPlatform: to.Ptr("Windows10"), - // SoftwareName: to.Ptr("outlook"), - // Vendor: to.Ptr("microsoft"), - // Version: to.Ptr("16.0.10371.20060"), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/solutions_client.go b/sdk/resourcemanager/security/armsecurity/solutions_client.go index 29e5951b88a5..b399209d9e76 100644 --- a/sdk/resourcemanager/security/armsecurity/solutions_client.go +++ b/sdk/resourcemanager/security/armsecurity/solutions_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -74,7 +71,7 @@ func (client *SolutionsClient) Get(ctx context.Context, resourceGroupName string } // getCreateRequest creates the Get request. -func (client *SolutionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, securitySolutionName string, options *SolutionsClientGetOptions) (*policy.Request, error) { +func (client *SolutionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, securitySolutionName string, _ *SolutionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutions/{securitySolutionName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -140,7 +137,7 @@ func (client *SolutionsClient) NewListPager(options *SolutionsClientListOptions) } // listCreateRequest creates the List request. -func (client *SolutionsClient) listCreateRequest(ctx context.Context, options *SolutionsClientListOptions) (*policy.Request, error) { +func (client *SolutionsClient) listCreateRequest(ctx context.Context, _ *SolutionsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutions" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 f974bebb65ba..000000000000 --- a/sdk/resourcemanager/security/armsecurity/solutions_client_example_test.go +++ /dev/null @@ -1,102 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutions/GetSecuritySolutionsSubscription_example.json -func ExampleSolutionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSolutionsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SolutionList = armsecurity.SolutionList{ - // Value: []*armsecurity.Solution{ - // { - // Location: to.Ptr("eastus"), - // Name: to.Ptr("MySaasWaf"), - // Type: to.Ptr("Microsoft.Security/locations/securitySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/centralus/securitySolutions/SaasWaf"), - // Properties: &armsecurity.SolutionProperties{ - // ProtectionStatus: to.Ptr("Good"), - // ProvisioningState: to.Ptr(armsecurity.ProvisioningStateSucceeded), - // SecurityFamily: to.Ptr(armsecurity.SecurityFamilySaasWaf), - // Template: to.Ptr("microsoft/ApplicationGateway-ARM"), - // }, - // }, - // { - // Location: to.Ptr("eastus2"), - // Name: to.Ptr("MyVA"), - // Type: to.Ptr("Microsoft.Security/locations/securitySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg2/providers/Microsoft.Security/locations/centralus/securitySolutions/MyVA"), - // Properties: &armsecurity.SolutionProperties{ - // ProtectionStatus: to.Ptr("Good"), - // ProvisioningState: to.Ptr(armsecurity.ProvisioningStateSucceeded), - // SecurityFamily: to.Ptr(armsecurity.SecurityFamilyVa), - // Template: to.Ptr("qualys.qualysAgent"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutions/GetSecuritySolutionsResourceGroupLocation_example.json -func ExampleSolutionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSolutionsClient().Get(ctx, "myRg2", "centralus", "paloalto7", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Solution = armsecurity.Solution{ - // Location: to.Ptr("eastus2"), - // Name: to.Ptr("MyVA"), - // Type: to.Ptr("Microsoft.Security/locations/securitySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg2/providers/Microsoft.Security/locations/centralus/securitySolutions/paloalto7"), - // Properties: &armsecurity.SolutionProperties{ - // ProtectionStatus: to.Ptr("Good"), - // ProvisioningState: to.Ptr(armsecurity.ProvisioningStateSucceeded), - // SecurityFamily: to.Ptr(armsecurity.SecurityFamilyNgfw), - // Template: to.Ptr("paloalto.paloaltofw"), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/solutionsreferencedata_client.go b/sdk/resourcemanager/security/armsecurity/solutionsreferencedata_client.go index 207169c0d204..2a17cd5e2dbf 100644 --- a/sdk/resourcemanager/security/armsecurity/solutionsreferencedata_client.go +++ b/sdk/resourcemanager/security/armsecurity/solutionsreferencedata_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -72,7 +69,7 @@ func (client *SolutionsReferenceDataClient) List(ctx context.Context, options *S } // listCreateRequest creates the List request. -func (client *SolutionsReferenceDataClient) listCreateRequest(ctx context.Context, options *SolutionsReferenceDataClientListOptions) (*policy.Request, error) { +func (client *SolutionsReferenceDataClient) listCreateRequest(ctx context.Context, _ *SolutionsReferenceDataClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/securitySolutionsReferenceData" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -128,7 +125,7 @@ func (client *SolutionsReferenceDataClient) ListByHomeRegion(ctx context.Context } // listByHomeRegionCreateRequest creates the ListByHomeRegion request. -func (client *SolutionsReferenceDataClient) listByHomeRegionCreateRequest(ctx context.Context, ascLocation string, options *SolutionsReferenceDataClientListByHomeRegionOptions) (*policy.Request, error) { +func (client *SolutionsReferenceDataClient) listByHomeRegionCreateRequest(ctx context.Context, ascLocation string, _ *SolutionsReferenceDataClientListByHomeRegionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/securitySolutionsReferenceData" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 bd28952b8540..000000000000 --- a/sdk/resourcemanager/security/armsecurity/solutionsreferencedata_client_example_test.go +++ /dev/null @@ -1,120 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutionsReferenceData/GetSecuritySolutionsReferenceDataSubscription_example.json -func ExampleSolutionsReferenceDataClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSolutionsReferenceDataClient().List(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SolutionsReferenceDataList = armsecurity.SolutionsReferenceDataList{ - // Value: []*armsecurity.SolutionsReferenceData{ - // { - // Name: to.Ptr("microsoft.ApplicationGateway-ARM"), - // Type: to.Ptr("Microsoft.Security/locations/securitySolutionsReferenceData"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/westcentralus/securitySolutionsReferenceData/microsoft.ApplicationGateway-ARM"), - // Properties: &armsecurity.SolutionsReferenceDataProperties{ - // AlertVendorName: to.Ptr("Microsoft"), - // PackageInfoURL: to.Ptr("www.azure.com"), - // ProductName: to.Ptr("Web Application Firewall"), - // Publisher: to.Ptr("microsoft"), - // PublisherDisplayName: to.Ptr("Microsoft Inc."), - // SecurityFamily: to.Ptr(armsecurity.SecurityFamilySaasWaf), - // Template: to.Ptr("microsoft/ApplicationGateway-ARM"), - // }, - // }, - // { - // Name: to.Ptr("qualys.qualysAgent"), - // Type: to.Ptr("Microsoft.Security/locations/SecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/westcentralus/securitySolutionsReferenceData/qualys.qualysAgent"), - // Properties: &armsecurity.SolutionsReferenceDataProperties{ - // AlertVendorName: to.Ptr("Qualys VA"), - // PackageInfoURL: to.Ptr("http://www.qualys.com/"), - // ProductName: to.Ptr("Vulnerability Assessment"), - // Publisher: to.Ptr("qualys"), - // PublisherDisplayName: to.Ptr("Qualys, Inc."), - // SecurityFamily: to.Ptr(armsecurity.SecurityFamilyVa), - // Template: to.Ptr("qualys/qualysAgent"), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutionsReferenceData/GetSecuritySolutionsReferenceDataSubscriptionLocation_example.json -func ExampleSolutionsReferenceDataClient_ListByHomeRegion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSolutionsReferenceDataClient().ListByHomeRegion(ctx, "westcentralus", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SolutionsReferenceDataList = armsecurity.SolutionsReferenceDataList{ - // Value: []*armsecurity.SolutionsReferenceData{ - // { - // Name: to.Ptr("microsoft.ApplicationGateway-ARM"), - // Type: to.Ptr("Microsoft.Security/locations/securitySolutionsReferenceData"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/westcentralus/securitySolutionsReferenceData/microsoft.ApplicationGateway-ARM"), - // Properties: &armsecurity.SolutionsReferenceDataProperties{ - // AlertVendorName: to.Ptr("Microsoft"), - // PackageInfoURL: to.Ptr("www.azure.com"), - // ProductName: to.Ptr("Web Application Firewall"), - // Publisher: to.Ptr("microsoft"), - // PublisherDisplayName: to.Ptr("Microsoft Inc."), - // SecurityFamily: to.Ptr(armsecurity.SecurityFamilySaasWaf), - // Template: to.Ptr("microsoft/ApplicationGateway-ARM"), - // }, - // }, - // { - // Name: to.Ptr("qualys.qualysAgent"), - // Type: to.Ptr("Microsoft.Security/locations/SecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/westcentralus/securitySolutionsReferenceData/qualys.qualysAgent"), - // Properties: &armsecurity.SolutionsReferenceDataProperties{ - // AlertVendorName: to.Ptr("Qualys VA"), - // PackageInfoURL: to.Ptr("http://www.qualys.com/"), - // ProductName: to.Ptr("Vulnerability Assessment"), - // Publisher: to.Ptr("qualys"), - // PublisherDisplayName: to.Ptr("Qualys, Inc."), - // SecurityFamily: to.Ptr(armsecurity.SecurityFamilyVa), - // Template: to.Ptr("qualys/qualysAgent"), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentbaselinerules_client.go b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentbaselinerules_client.go index 9c569607a7c7..833f7844d8b7 100644 --- a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentbaselinerules_client.go +++ b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentbaselinerules_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -198,7 +195,7 @@ func (client *SQLVulnerabilityAssessmentBaselineRulesClient) Delete(ctx context. } // deleteCreateRequest creates the Delete request. -func (client *SQLVulnerabilityAssessmentBaselineRulesClient) deleteCreateRequest(ctx context.Context, ruleID string, workspaceID string, resourceID string, options *SQLVulnerabilityAssessmentBaselineRulesClientDeleteOptions) (*policy.Request, error) { +func (client *SQLVulnerabilityAssessmentBaselineRulesClient) deleteCreateRequest(ctx context.Context, ruleID string, workspaceID string, resourceID string, _ *SQLVulnerabilityAssessmentBaselineRulesClientDeleteOptions) (*policy.Request, error) { urlPath := "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}" if ruleID == "" { return nil, errors.New("parameter ruleID cannot be empty") @@ -249,7 +246,7 @@ func (client *SQLVulnerabilityAssessmentBaselineRulesClient) Get(ctx context.Con } // getCreateRequest creates the Get request. -func (client *SQLVulnerabilityAssessmentBaselineRulesClient) getCreateRequest(ctx context.Context, ruleID string, workspaceID string, resourceID string, options *SQLVulnerabilityAssessmentBaselineRulesClientGetOptions) (*policy.Request, error) { +func (client *SQLVulnerabilityAssessmentBaselineRulesClient) getCreateRequest(ctx context.Context, ruleID string, workspaceID string, resourceID string, _ *SQLVulnerabilityAssessmentBaselineRulesClientGetOptions) (*policy.Request, error) { urlPath := "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}" if ruleID == "" { return nil, errors.New("parameter ruleID cannot be empty") @@ -308,7 +305,7 @@ func (client *SQLVulnerabilityAssessmentBaselineRulesClient) List(ctx context.Co } // listCreateRequest creates the List request. -func (client *SQLVulnerabilityAssessmentBaselineRulesClient) listCreateRequest(ctx context.Context, workspaceID string, resourceID string, options *SQLVulnerabilityAssessmentBaselineRulesClientListOptions) (*policy.Request, error) { +func (client *SQLVulnerabilityAssessmentBaselineRulesClient) listCreateRequest(ctx context.Context, workspaceID string, resourceID string, _ *SQLVulnerabilityAssessmentBaselineRulesClientListOptions) (*policy.Request, error) { urlPath := "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules" urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) 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 195dae3dd56f..000000000000 --- a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentbaselinerules_client_example_test.go +++ /dev/null @@ -1,320 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Put.json -func ExampleSQLVulnerabilityAssessmentBaselineRulesClient_CreateOrUpdate_createABaseline() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentBaselineRulesClient().CreateOrUpdate(ctx, "VA1234", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", &armsecurity.SQLVulnerabilityAssessmentBaselineRulesClientCreateOrUpdateOptions{Body: &armsecurity.RuleResultsInput{ - LatestScan: to.Ptr(false), - Results: [][]*string{ - { - to.Ptr("userA"), - to.Ptr("SELECT")}, - { - to.Ptr("userB"), - to.Ptr("SELECT")}}, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RuleResults = armsecurity.RuleResults{ - // Name: to.Ptr("VA1234"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/baselineRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/VA1234"), - // Properties: &armsecurity.RuleResultsProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("userA"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userB"), - // to.Ptr("SELECT")}}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_PutLatest.json -func ExampleSQLVulnerabilityAssessmentBaselineRulesClient_CreateOrUpdate_createABaselineUsingTheLatestScanResults() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentBaselineRulesClient().CreateOrUpdate(ctx, "VA1234", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", &armsecurity.SQLVulnerabilityAssessmentBaselineRulesClientCreateOrUpdateOptions{Body: &armsecurity.RuleResultsInput{ - LatestScan: to.Ptr(true), - Results: [][]*string{}, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RuleResults = armsecurity.RuleResults{ - // Name: to.Ptr("VA1234"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/baselineRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/VA1234"), - // Properties: &armsecurity.RuleResultsProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("userA"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userB"), - // to.Ptr("SELECT")}}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Get.json -func ExampleSQLVulnerabilityAssessmentBaselineRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentBaselineRulesClient().Get(ctx, "VA1234", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RuleResults = armsecurity.RuleResults{ - // Name: to.Ptr("VA1234"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/baselineRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/VA1234"), - // Properties: &armsecurity.RuleResultsProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("userA"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userB"), - // to.Ptr("SELECT")}}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Delete.json -func ExampleSQLVulnerabilityAssessmentBaselineRulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewSQLVulnerabilityAssessmentBaselineRulesClient().Delete(ctx, "VA1234", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_List.json -func ExampleSQLVulnerabilityAssessmentBaselineRulesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentBaselineRulesClient().List(ctx, "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RulesResults = armsecurity.RulesResults{ - // Value: []*armsecurity.RuleResults{ - // { - // Name: to.Ptr("VA1234"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/baselineRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/VA1234"), - // Properties: &armsecurity.RuleResultsProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("userA"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userB"), - // to.Ptr("SELECT")}}, - // }, - // }, - // { - // Name: to.Ptr("VA5678"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/baselineRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/VA5678"), - // Properties: &armsecurity.RuleResultsProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Add.json -func ExampleSQLVulnerabilityAssessmentBaselineRulesClient_Add_createABaselineForAllRules() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentBaselineRulesClient().Add(ctx, "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", &armsecurity.SQLVulnerabilityAssessmentBaselineRulesClientAddOptions{Body: &armsecurity.RulesResultsInput{ - LatestScan: to.Ptr(false), - Results: map[string][][]*string{ - "VA1234": { - { - to.Ptr("userA"), - to.Ptr("SELECT")}, - { - to.Ptr("userB"), - to.Ptr("SELECT")}}, - "VA5678": { - { - to.Ptr("Test"), - to.Ptr("0.0.0.0"), - to.Ptr("125.125.125.125")}}, - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RulesResults = armsecurity.RulesResults{ - // Value: []*armsecurity.RuleResults{ - // { - // Name: to.Ptr("VA1234"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/baselineRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/VA1234"), - // Properties: &armsecurity.RuleResultsProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("userA"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userB"), - // to.Ptr("SELECT")}}, - // }, - // }, - // { - // Name: to.Ptr("VA5678"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/baselineRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/VA5678"), - // Properties: &armsecurity.RuleResultsProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_AddLatest.json -func ExampleSQLVulnerabilityAssessmentBaselineRulesClient_Add_createABaselineForAllRulesUsingTheLatestScanResults() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentBaselineRulesClient().Add(ctx, "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", &armsecurity.SQLVulnerabilityAssessmentBaselineRulesClientAddOptions{Body: &armsecurity.RulesResultsInput{ - LatestScan: to.Ptr(true), - Results: map[string][][]*string{}, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RulesResults = armsecurity.RulesResults{ - // Value: []*armsecurity.RuleResults{ - // { - // Name: to.Ptr("VA1234"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/baselineRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/VA1234"), - // Properties: &armsecurity.RuleResultsProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("userA"), - // to.Ptr("SELECT")}, - // []*string{ - // to.Ptr("userB"), - // to.Ptr("SELECT")}}, - // }, - // }, - // { - // Name: to.Ptr("VA5678"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/baselineRules"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/VA5678"), - // Properties: &armsecurity.RuleResultsProperties{ - // Results: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscanresults_client.go b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscanresults_client.go index b9913510f888..05229ad6e0db 100644 --- a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscanresults_client.go +++ b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscanresults_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -73,7 +70,7 @@ func (client *SQLVulnerabilityAssessmentScanResultsClient) Get(ctx context.Conte } // getCreateRequest creates the Get request. -func (client *SQLVulnerabilityAssessmentScanResultsClient) getCreateRequest(ctx context.Context, scanID string, scanResultID string, workspaceID string, resourceID string, options *SQLVulnerabilityAssessmentScanResultsClientGetOptions) (*policy.Request, error) { +func (client *SQLVulnerabilityAssessmentScanResultsClient) getCreateRequest(ctx context.Context, scanID string, scanResultID string, workspaceID string, resourceID string, _ *SQLVulnerabilityAssessmentScanResultsClientGetOptions) (*policy.Request, error) { urlPath := "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults/{scanResultId}" if scanID == "" { return nil, errors.New("parameter scanID cannot be empty") @@ -137,7 +134,7 @@ func (client *SQLVulnerabilityAssessmentScanResultsClient) List(ctx context.Cont } // listCreateRequest creates the List request. -func (client *SQLVulnerabilityAssessmentScanResultsClient) listCreateRequest(ctx context.Context, scanID string, workspaceID string, resourceID string, options *SQLVulnerabilityAssessmentScanResultsClientListOptions) (*policy.Request, error) { +func (client *SQLVulnerabilityAssessmentScanResultsClient) listCreateRequest(ctx context.Context, scanID string, workspaceID string, resourceID string, _ *SQLVulnerabilityAssessmentScanResultsClientListOptions) (*policy.Request, error) { urlPath := "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults" if scanID == "" { return nil, errors.New("parameter scanID cannot be empty") 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 27ff7f0bdbec..000000000000 --- a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscanresults_client_example_test.go +++ /dev/null @@ -1,410 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_Get.json -func ExampleSQLVulnerabilityAssessmentScanResultsClient_Get_getScanDetailsOfAScanRecord() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentScanResultsClient().Get(ctx, "Scheduled-20200623", "VA2063", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScanResult = armsecurity.ScanResult{ - // Name: to.Ptr("VA2063"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/scans/scanResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/Scheduled-20200623/scanResults/VA2063"), - // Properties: &armsecurity.ScanResultProperties{ - // BaselineAdjustedResult: &armsecurity.BaselineAdjustedResult{ - // Baseline: &armsecurity.Baseline{ - // ExpectedResults: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // UpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T12:49:41.027Z"); return t}()), - // }, - // ResultsNotInBaseline: [][]*string{ - // }, - // ResultsOnlyInBaseline: [][]*string{ - // }, - // Status: to.Ptr(armsecurity.RuleStatusNonFinding), - // }, - // IsTrimmed: to.Ptr(false), - // QueryResults: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // Remediation: &armsecurity.Remediation{ - // Description: to.Ptr("Remove server firewall rules that grant excessive access"), - // Automated: to.Ptr(false), - // PortalLink: to.Ptr("ReviewServerFirewallRules"), - // Scripts: []*string{ - // to.Ptr("EXECUTE sp_delete_firewall_rule N'Test';")}, - // }, - // RuleID: to.Ptr("VA2063"), - // RuleMetadata: &armsecurity.VaRule{ - // Description: to.Ptr("The Azure SQL server-level firewall helps protect your server by preventing all access to your databases until you specify which IP addresses have permission. Server-level firewall rules grant access to all databases that belong to the server based on the originating IP address of each request.\n\nServer-level firewall rules can only be created and managed through Transact-SQL as well as through the Azure portal or PowerShell. For more details please see: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-firewall-configure\n\nThis check verifies that server-level firewall rules do not grant excessive access."), - // BenchmarkReferences: []*armsecurity.BenchmarkReference{ - // }, - // Category: to.Ptr("SurfaceAreaReduction"), - // QueryCheck: &armsecurity.QueryCheck{ - // ColumnNames: []*string{ - // to.Ptr("Firewall Rule Name"), - // to.Ptr("Start Address"), - // to.Ptr("End Address")}, - // ExpectedResult: [][]*string{ - // }, - // Query: to.Ptr("SELECT name\n ,start_ip_address\n ,end_ip_address\nFROM sys.firewall_rules\nWHERE ( \n (CONVERT(bigint, parsename(end_ip_address, 1)) +\n CONVERT(bigint, parsename(end_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(end_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(end_ip_address, 4)) * 16777216 ) \n - \n (CONVERT(bigint, parsename(start_ip_address, 1)) +\n CONVERT(bigint, parsename(start_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(start_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(start_ip_address, 4)) * 16777216 )\n ) > 255;"), - // }, - // Rationale: to.Ptr("Often, administrators add rules that grant excessive access as part of a troubleshooting process � to eliminate the firewall as the source of a problem, they simply create a rule that allows all traffic to pass to the affected server.\n\nGranting excessive access using server firewall rules is a clear security concern, as it violates the principle of least privilege by allowing unnecessary access to your databases. In fact, it's the equivalent of placing the server outside of the firewall."), - // RuleID: to.Ptr("VA2063"), - // RuleType: to.Ptr(armsecurity.RuleTypeNegativeList), - // Severity: to.Ptr(armsecurity.RuleSeverityHigh), - // Title: to.Ptr("Server-level firewall rules should not grant excessive access"), - // }, - // Status: to.Ptr(armsecurity.RuleStatusFinding), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_GetLatest.json -func ExampleSQLVulnerabilityAssessmentScanResultsClient_Get_getScanDetailsOfTheLatestScanRecord() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentScanResultsClient().Get(ctx, "latest", "VA2063", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScanResult = armsecurity.ScanResult{ - // Name: to.Ptr("VA2063"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/scans/scanResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/Scheduled-20200623/scanResults/VA2063"), - // Properties: &armsecurity.ScanResultProperties{ - // BaselineAdjustedResult: &armsecurity.BaselineAdjustedResult{ - // Baseline: &armsecurity.Baseline{ - // ExpectedResults: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // UpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T12:49:41.027Z"); return t}()), - // }, - // ResultsNotInBaseline: [][]*string{ - // }, - // ResultsOnlyInBaseline: [][]*string{ - // }, - // Status: to.Ptr(armsecurity.RuleStatusNonFinding), - // }, - // IsTrimmed: to.Ptr(false), - // QueryResults: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // Remediation: &armsecurity.Remediation{ - // Description: to.Ptr("Remove server firewall rules that grant excessive access"), - // Automated: to.Ptr(false), - // PortalLink: to.Ptr("ReviewServerFirewallRules"), - // Scripts: []*string{ - // to.Ptr("EXECUTE sp_delete_firewall_rule N'Test';")}, - // }, - // RuleID: to.Ptr("VA2063"), - // RuleMetadata: &armsecurity.VaRule{ - // Description: to.Ptr("The Azure SQL server-level firewall helps protect your server by preventing all access to your databases until you specify which IP addresses have permission. Server-level firewall rules grant access to all databases that belong to the server based on the originating IP address of each request.\n\nServer-level firewall rules can only be created and managed through Transact-SQL as well as through the Azure portal or PowerShell. For more details please see: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-firewall-configure\n\nThis check verifies that server-level firewall rules do not grant excessive access."), - // BenchmarkReferences: []*armsecurity.BenchmarkReference{ - // }, - // Category: to.Ptr("SurfaceAreaReduction"), - // QueryCheck: &armsecurity.QueryCheck{ - // ColumnNames: []*string{ - // to.Ptr("Firewall Rule Name"), - // to.Ptr("Start Address"), - // to.Ptr("End Address")}, - // ExpectedResult: [][]*string{ - // }, - // Query: to.Ptr("SELECT name\n ,start_ip_address\n ,end_ip_address\nFROM sys.firewall_rules\nWHERE ( \n (CONVERT(bigint, parsename(end_ip_address, 1)) +\n CONVERT(bigint, parsename(end_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(end_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(end_ip_address, 4)) * 16777216 ) \n - \n (CONVERT(bigint, parsename(start_ip_address, 1)) +\n CONVERT(bigint, parsename(start_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(start_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(start_ip_address, 4)) * 16777216 )\n ) > 255;"), - // }, - // Rationale: to.Ptr("Often, administrators add rules that grant excessive access as part of a troubleshooting process � to eliminate the firewall as the source of a problem, they simply create a rule that allows all traffic to pass to the affected server.\n\nGranting excessive access using server firewall rules is a clear security concern, as it violates the principle of least privilege by allowing unnecessary access to your databases. In fact, it's the equivalent of placing the server outside of the firewall."), - // RuleID: to.Ptr("VA2063"), - // RuleType: to.Ptr(armsecurity.RuleTypeNegativeList), - // Severity: to.Ptr(armsecurity.RuleSeverityHigh), - // Title: to.Ptr("Server-level firewall rules should not grant excessive access"), - // }, - // Status: to.Ptr(armsecurity.RuleStatusFinding), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_List.json -func ExampleSQLVulnerabilityAssessmentScanResultsClient_List_listScanResults() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentScanResultsClient().List(ctx, "Scheduled-20200623", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScanResults = armsecurity.ScanResults{ - // Value: []*armsecurity.ScanResult{ - // { - // Name: to.Ptr("VA2062"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/scans/scanResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/Scheduled-20200623/scanResults/VA2062"), - // Properties: &armsecurity.ScanResultProperties{ - // IsTrimmed: to.Ptr(false), - // QueryResults: [][]*string{ - // }, - // Remediation: &armsecurity.Remediation{ - // Description: to.Ptr("Remove database firewall rules that grant excessive access"), - // Automated: to.Ptr(false), - // PortalLink: to.Ptr(""), - // Scripts: []*string{ - // }, - // }, - // RuleID: to.Ptr("VA2062"), - // RuleMetadata: &armsecurity.VaRule{ - // Description: to.Ptr("The Azure SQL Database-level firewall helps protect your data by preventing all access to your database until you specify which IP addresses have permission. Database-level firewall rules grant access to the specific database based on the originating IP address of each request.\n\nDatabase-level firewall rules for master and user databases can only be created and managed through Transact-SQL (unlike server-level firewall rules which can also be created and managed using the Azure portal or PowerShell). For more details please see: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-firewall-configure\n\nThis check verifies that database-level firewall rules do not grant excessive access."), - // BenchmarkReferences: []*armsecurity.BenchmarkReference{ - // }, - // Category: to.Ptr("SurfaceAreaReduction"), - // QueryCheck: &armsecurity.QueryCheck{ - // ColumnNames: []*string{ - // to.Ptr("Firewall Rule Name"), - // to.Ptr("Start Address"), - // to.Ptr("End Address")}, - // ExpectedResult: [][]*string{ - // }, - // Query: to.Ptr("SELECT name\n ,start_ip_address\n ,end_ip_address\nFROM sys.database_firewall_rules\nWHERE ( \n (CONVERT(bigint, parsename(end_ip_address, 1)) +\n CONVERT(bigint, parsename(end_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(end_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(end_ip_address, 4)) * 16777216 ) \n - \n (CONVERT(bigint, parsename(start_ip_address, 1)) +\n CONVERT(bigint, parsename(start_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(start_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(start_ip_address, 4)) * 16777216 )\n ) > 255;"), - // }, - // Rationale: to.Ptr("Often, administrators add rules that grant excessive access as part of a troubleshooting process - to eliminate the firewall as the source of a problem, they simply create a rule that allows all traffic to pass to the affected database.\n\nGranting excessive access using database firewall rules is a clear security concern, as it violates the principle of least privilege by allowing unnecessary access to your database. In fact, it's the equivalent of placing the database outside of the firewall."), - // RuleID: to.Ptr("VA2062"), - // RuleType: to.Ptr(armsecurity.RuleTypeNegativeList), - // Severity: to.Ptr(armsecurity.RuleSeverityHigh), - // Title: to.Ptr("Database-level firewall rules should not grant excessive access"), - // }, - // Status: to.Ptr(armsecurity.RuleStatusNonFinding), - // }, - // }, - // { - // Name: to.Ptr("VA2063"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/scans/scanResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/Scheduled-20200623/scanResults/VA2063"), - // Properties: &armsecurity.ScanResultProperties{ - // BaselineAdjustedResult: &armsecurity.BaselineAdjustedResult{ - // Baseline: &armsecurity.Baseline{ - // ExpectedResults: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // UpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T12:49:41.027Z"); return t}()), - // }, - // ResultsNotInBaseline: [][]*string{ - // }, - // ResultsOnlyInBaseline: [][]*string{ - // }, - // Status: to.Ptr(armsecurity.RuleStatusNonFinding), - // }, - // IsTrimmed: to.Ptr(false), - // QueryResults: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // Remediation: &armsecurity.Remediation{ - // Description: to.Ptr("Remove server firewall rules that grant excessive access"), - // Automated: to.Ptr(false), - // PortalLink: to.Ptr("ReviewServerFirewallRules"), - // Scripts: []*string{ - // to.Ptr("EXECUTE sp_delete_firewall_rule N'Test';")}, - // }, - // RuleID: to.Ptr("VA2063"), - // RuleMetadata: &armsecurity.VaRule{ - // Description: to.Ptr("The Azure SQL server-level firewall helps protect your server by preventing all access to your databases until you specify which IP addresses have permission. Server-level firewall rules grant access to all databases that belong to the server based on the originating IP address of each request.\n\nServer-level firewall rules can only be created and managed through Transact-SQL as well as through the Azure portal or PowerShell. For more details please see: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-firewall-configure\n\nThis check verifies that server-level firewall rules do not grant excessive access."), - // BenchmarkReferences: []*armsecurity.BenchmarkReference{ - // }, - // Category: to.Ptr("SurfaceAreaReduction"), - // QueryCheck: &armsecurity.QueryCheck{ - // ColumnNames: []*string{ - // to.Ptr("Firewall Rule Name"), - // to.Ptr("Start Address"), - // to.Ptr("End Address")}, - // ExpectedResult: [][]*string{ - // }, - // Query: to.Ptr("SELECT name\n ,start_ip_address\n ,end_ip_address\nFROM sys.firewall_rules\nWHERE ( \n (CONVERT(bigint, parsename(end_ip_address, 1)) +\n CONVERT(bigint, parsename(end_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(end_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(end_ip_address, 4)) * 16777216 ) \n - \n (CONVERT(bigint, parsename(start_ip_address, 1)) +\n CONVERT(bigint, parsename(start_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(start_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(start_ip_address, 4)) * 16777216 )\n ) > 255;"), - // }, - // Rationale: to.Ptr("Often, administrators add rules that grant excessive access as part of a troubleshooting process � to eliminate the firewall as the source of a problem, they simply create a rule that allows all traffic to pass to the affected server.\n\nGranting excessive access using server firewall rules is a clear security concern, as it violates the principle of least privilege by allowing unnecessary access to your databases. In fact, it's the equivalent of placing the server outside of the firewall."), - // RuleID: to.Ptr("VA2063"), - // RuleType: to.Ptr(armsecurity.RuleTypeNegativeList), - // Severity: to.Ptr(armsecurity.RuleSeverityHigh), - // Title: to.Ptr("Server-level firewall rules should not grant excessive access"), - // }, - // Status: to.Ptr(armsecurity.RuleStatusFinding), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_ListLatest.json -func ExampleSQLVulnerabilityAssessmentScanResultsClient_List_listScanResultsOfTheLatestScan() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentScanResultsClient().List(ctx, "latest", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ScanResults = armsecurity.ScanResults{ - // Value: []*armsecurity.ScanResult{ - // { - // Name: to.Ptr("VA2062"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/scans/scanResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/Scheduled-20200623/scanResults/VA2062"), - // Properties: &armsecurity.ScanResultProperties{ - // IsTrimmed: to.Ptr(false), - // QueryResults: [][]*string{ - // }, - // Remediation: &armsecurity.Remediation{ - // Description: to.Ptr("Remove database firewall rules that grant excessive access"), - // Automated: to.Ptr(false), - // PortalLink: to.Ptr(""), - // Scripts: []*string{ - // }, - // }, - // RuleID: to.Ptr("VA2062"), - // RuleMetadata: &armsecurity.VaRule{ - // Description: to.Ptr("The Azure SQL Database-level firewall helps protect your data by preventing all access to your database until you specify which IP addresses have permission. Database-level firewall rules grant access to the specific database based on the originating IP address of each request.\n\nDatabase-level firewall rules for master and user databases can only be created and managed through Transact-SQL (unlike server-level firewall rules which can also be created and managed using the Azure portal or PowerShell). For more details please see: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-firewall-configure\n\nThis check verifies that database-level firewall rules do not grant excessive access."), - // BenchmarkReferences: []*armsecurity.BenchmarkReference{ - // }, - // Category: to.Ptr("SurfaceAreaReduction"), - // QueryCheck: &armsecurity.QueryCheck{ - // ColumnNames: []*string{ - // to.Ptr("Firewall Rule Name"), - // to.Ptr("Start Address"), - // to.Ptr("End Address")}, - // ExpectedResult: [][]*string{ - // }, - // Query: to.Ptr("SELECT name\n ,start_ip_address\n ,end_ip_address\nFROM sys.database_firewall_rules\nWHERE ( \n (CONVERT(bigint, parsename(end_ip_address, 1)) +\n CONVERT(bigint, parsename(end_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(end_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(end_ip_address, 4)) * 16777216 ) \n - \n (CONVERT(bigint, parsename(start_ip_address, 1)) +\n CONVERT(bigint, parsename(start_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(start_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(start_ip_address, 4)) * 16777216 )\n ) > 255;"), - // }, - // Rationale: to.Ptr("Often, administrators add rules that grant excessive access as part of a troubleshooting process - to eliminate the firewall as the source of a problem, they simply create a rule that allows all traffic to pass to the affected database.\n\nGranting excessive access using database firewall rules is a clear security concern, as it violates the principle of least privilege by allowing unnecessary access to your database. In fact, it's the equivalent of placing the database outside of the firewall."), - // RuleID: to.Ptr("VA2062"), - // RuleType: to.Ptr(armsecurity.RuleTypeNegativeList), - // Severity: to.Ptr(armsecurity.RuleSeverityHigh), - // Title: to.Ptr("Database-level firewall rules should not grant excessive access"), - // }, - // Status: to.Ptr(armsecurity.RuleStatusNonFinding), - // }, - // }, - // { - // Name: to.Ptr("VA2063"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/scans/scanResults"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/Scheduled-20200623/scanResults/VA2063"), - // Properties: &armsecurity.ScanResultProperties{ - // BaselineAdjustedResult: &armsecurity.BaselineAdjustedResult{ - // Baseline: &armsecurity.Baseline{ - // ExpectedResults: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // UpdatedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-04T12:49:41.027Z"); return t}()), - // }, - // ResultsNotInBaseline: [][]*string{ - // }, - // ResultsOnlyInBaseline: [][]*string{ - // }, - // Status: to.Ptr(armsecurity.RuleStatusNonFinding), - // }, - // IsTrimmed: to.Ptr(false), - // QueryResults: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // Remediation: &armsecurity.Remediation{ - // Description: to.Ptr("Remove server firewall rules that grant excessive access"), - // Automated: to.Ptr(false), - // PortalLink: to.Ptr("ReviewServerFirewallRules"), - // Scripts: []*string{ - // to.Ptr("EXECUTE sp_delete_firewall_rule N'Test';")}, - // }, - // RuleID: to.Ptr("VA2063"), - // RuleMetadata: &armsecurity.VaRule{ - // Description: to.Ptr("The Azure SQL server-level firewall helps protect your server by preventing all access to your databases until you specify which IP addresses have permission. Server-level firewall rules grant access to all databases that belong to the server based on the originating IP address of each request.\n\nServer-level firewall rules can only be created and managed through Transact-SQL as well as through the Azure portal or PowerShell. For more details please see: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-firewall-configure\n\nThis check verifies that server-level firewall rules do not grant excessive access."), - // BenchmarkReferences: []*armsecurity.BenchmarkReference{ - // }, - // Category: to.Ptr("SurfaceAreaReduction"), - // QueryCheck: &armsecurity.QueryCheck{ - // ColumnNames: []*string{ - // to.Ptr("Firewall Rule Name"), - // to.Ptr("Start Address"), - // to.Ptr("End Address")}, - // ExpectedResult: [][]*string{ - // }, - // Query: to.Ptr("SELECT name\n ,start_ip_address\n ,end_ip_address\nFROM sys.firewall_rules\nWHERE ( \n (CONVERT(bigint, parsename(end_ip_address, 1)) +\n CONVERT(bigint, parsename(end_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(end_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(end_ip_address, 4)) * 16777216 ) \n - \n (CONVERT(bigint, parsename(start_ip_address, 1)) +\n CONVERT(bigint, parsename(start_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(start_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(start_ip_address, 4)) * 16777216 )\n ) > 255;"), - // }, - // Rationale: to.Ptr("Often, administrators add rules that grant excessive access as part of a troubleshooting process � to eliminate the firewall as the source of a problem, they simply create a rule that allows all traffic to pass to the affected server.\n\nGranting excessive access using server firewall rules is a clear security concern, as it violates the principle of least privilege by allowing unnecessary access to your databases. In fact, it's the equivalent of placing the server outside of the firewall."), - // RuleID: to.Ptr("VA2063"), - // RuleType: to.Ptr(armsecurity.RuleTypeNegativeList), - // Severity: to.Ptr(armsecurity.RuleSeverityHigh), - // Title: to.Ptr("Server-level firewall rules should not grant excessive access"), - // }, - // Status: to.Ptr(armsecurity.RuleStatusFinding), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client.go b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client.go index 39cdc0b37875..a55424097dbf 100644 --- a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client.go +++ b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -72,7 +69,7 @@ func (client *SQLVulnerabilityAssessmentScansClient) Get(ctx context.Context, sc } // getCreateRequest creates the Get request. -func (client *SQLVulnerabilityAssessmentScansClient) getCreateRequest(ctx context.Context, scanID string, workspaceID string, resourceID string, options *SQLVulnerabilityAssessmentScansClientGetOptions) (*policy.Request, error) { +func (client *SQLVulnerabilityAssessmentScansClient) getCreateRequest(ctx context.Context, scanID string, workspaceID string, resourceID string, _ *SQLVulnerabilityAssessmentScansClientGetOptions) (*policy.Request, error) { urlPath := "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}" if scanID == "" { return nil, errors.New("parameter scanID cannot be empty") @@ -131,7 +128,7 @@ func (client *SQLVulnerabilityAssessmentScansClient) List(ctx context.Context, w } // listCreateRequest creates the List request. -func (client *SQLVulnerabilityAssessmentScansClient) listCreateRequest(ctx context.Context, workspaceID string, resourceID string, options *SQLVulnerabilityAssessmentScansClientListOptions) (*policy.Request, error) { +func (client *SQLVulnerabilityAssessmentScansClient) listCreateRequest(ctx context.Context, workspaceID string, resourceID string, _ *SQLVulnerabilityAssessmentScansClientListOptions) (*policy.Request, error) { urlPath := "/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans" urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) 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 d1b8905c5756..000000000000 --- a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client_example_test.go +++ /dev/null @@ -1,169 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_Get.json -func ExampleSQLVulnerabilityAssessmentScansClient_Get_getScanDetailsOfAScanRecord() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentScansClient().Get(ctx, "Scheduled-20200623", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Scan = armsecurity.Scan{ - // Name: to.Ptr("Scheduled-20200623"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/Scheduled-20200623"), - // Properties: &armsecurity.ScanProperties{ - // Database: to.Ptr("master"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.723Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](3), - // IsBaselineApplied: to.Ptr(false), - // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.645Z"); return t}()), - // LowSeverityFailedRulesCount: to.Ptr[int32](1), - // MediumSeverityFailedRulesCount: to.Ptr[int32](2), - // Server: to.Ptr("server1"), - // SQLVersion: to.Ptr("15.0.2000"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.645Z"); return t}()), - // State: to.Ptr(armsecurity.ScanStateFailed), - // TotalFailedRulesCount: to.Ptr[int32](6), - // TotalPassedRulesCount: to.Ptr[int32](20), - // TotalRulesCount: to.Ptr[int32](26), - // TriggerType: to.Ptr(armsecurity.ScanTriggerTypeRecurring), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_GetLatest.json -func ExampleSQLVulnerabilityAssessmentScansClient_Get_getScanDetailsOfTheLatestScanRecord() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentScansClient().Get(ctx, "latest", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Scan = armsecurity.Scan{ - // Name: to.Ptr("Scheduled-20200623"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/Scheduled-20200623"), - // Properties: &armsecurity.ScanProperties{ - // Database: to.Ptr("master"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.723Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](3), - // IsBaselineApplied: to.Ptr(false), - // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.645Z"); return t}()), - // LowSeverityFailedRulesCount: to.Ptr[int32](1), - // MediumSeverityFailedRulesCount: to.Ptr[int32](2), - // Server: to.Ptr("server1"), - // SQLVersion: to.Ptr("15.0.2000"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.645Z"); return t}()), - // State: to.Ptr(armsecurity.ScanStateFailed), - // TotalFailedRulesCount: to.Ptr[int32](6), - // TotalPassedRulesCount: to.Ptr[int32](20), - // TotalRulesCount: to.Ptr[int32](26), - // TriggerType: to.Ptr(armsecurity.ScanTriggerTypeRecurring), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_List.json -func ExampleSQLVulnerabilityAssessmentScansClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSQLVulnerabilityAssessmentScansClient().List(ctx, "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Scans = armsecurity.Scans{ - // Value: []*armsecurity.Scan{ - // { - // Name: to.Ptr("Scheduled-20200225"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/Scheduled-20200225"), - // Properties: &armsecurity.ScanProperties{ - // Database: to.Ptr("master"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-25T11:38:07.860Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](3), - // IsBaselineApplied: to.Ptr(false), - // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.645Z"); return t}()), - // LowSeverityFailedRulesCount: to.Ptr[int32](1), - // MediumSeverityFailedRulesCount: to.Ptr[int32](2), - // Server: to.Ptr("server1"), - // SQLVersion: to.Ptr("15.0.2000"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-25T11:34:29.139Z"); return t}()), - // State: to.Ptr(armsecurity.ScanStateFailed), - // TotalFailedRulesCount: to.Ptr[int32](6), - // TotalPassedRulesCount: to.Ptr[int32](20), - // TotalRulesCount: to.Ptr[int32](26), - // TriggerType: to.Ptr(armsecurity.ScanTriggerTypeRecurring), - // }, - // }, - // { - // Name: to.Ptr("scan_20200226_113429"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/scan_20200226_113429"), - // Properties: &armsecurity.ScanProperties{ - // Database: to.Ptr("master"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-26T11:38:07.860Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](0), - // IsBaselineApplied: to.Ptr(true), - // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.645Z"); return t}()), - // LowSeverityFailedRulesCount: to.Ptr[int32](0), - // MediumSeverityFailedRulesCount: to.Ptr[int32](0), - // Server: to.Ptr("server1"), - // SQLVersion: to.Ptr("15.0.2000"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-26T11:34:29.139Z"); return t}()), - // State: to.Ptr(armsecurity.ScanStatePassed), - // TotalFailedRulesCount: to.Ptr[int32](0), - // TotalPassedRulesCount: to.Ptr[int32](26), - // TotalRulesCount: to.Ptr[int32](26), - // TriggerType: to.Ptr(armsecurity.ScanTriggerTypeOnDemand), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/standardassignments_client.go b/sdk/resourcemanager/security/armsecurity/standardassignments_client.go new file mode 100644 index 000000000000..a26b83ce841f --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/standardassignments_client.go @@ -0,0 +1,268 @@ +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsecurity + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// StandardAssignmentsClient contains the methods for the StandardAssignments group. +// Don't use this type directly, use NewStandardAssignmentsClient() instead. +type StandardAssignmentsClient struct { + internal *arm.Client +} + +// NewStandardAssignmentsClient creates a new instance of StandardAssignmentsClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewStandardAssignmentsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*StandardAssignmentsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &StandardAssignmentsClient{ + internal: cl, + } + return client, nil +} + +// Create - This operation creates or updates a standard assignment with the given scope and name. standard assignments apply +// to all resources contained within their scope. For example, when you assign a policy +// at resource group scope, that policy applies to all resources in the group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-08-01 +// - resourceID - The identifier of the resource. +// - standardAssignmentName - The standard assignments assignment key - unique key for the standard assignment +// - standardAssignment - Custom standard assignment over a pre-defined scope +// - options - StandardAssignmentsClientCreateOptions contains the optional parameters for the StandardAssignmentsClient.Create +// method. +func (client *StandardAssignmentsClient) Create(ctx context.Context, resourceID string, standardAssignmentName string, standardAssignment StandardAssignment, options *StandardAssignmentsClientCreateOptions) (StandardAssignmentsClientCreateResponse, error) { + var err error + const operationName = "StandardAssignmentsClient.Create" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createCreateRequest(ctx, resourceID, standardAssignmentName, standardAssignment, options) + if err != nil { + return StandardAssignmentsClientCreateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return StandardAssignmentsClientCreateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return StandardAssignmentsClientCreateResponse{}, err + } + resp, err := client.createHandleResponse(httpResp) + return resp, err +} + +// createCreateRequest creates the Create request. +func (client *StandardAssignmentsClient) createCreateRequest(ctx context.Context, resourceID string, standardAssignmentName string, standardAssignment StandardAssignment, _ *StandardAssignmentsClientCreateOptions) (*policy.Request, error) { + urlPath := "/{resourceId}/providers/Microsoft.Security/standardAssignments/{standardAssignmentName}" + urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID) + if standardAssignmentName == "" { + return nil, errors.New("parameter standardAssignmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{standardAssignmentName}", url.PathEscape(standardAssignmentName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, standardAssignment); err != nil { + return nil, err + } + return req, nil +} + +// createHandleResponse handles the Create response. +func (client *StandardAssignmentsClient) createHandleResponse(resp *http.Response) (StandardAssignmentsClientCreateResponse, error) { + result := StandardAssignmentsClientCreateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.StandardAssignment); err != nil { + return StandardAssignmentsClientCreateResponse{}, err + } + return result, nil +} + +// Delete - This operation deletes a standard assignment, given its name and the scope it was created in. The scope of a standard +// assignment is the part of its ID preceding +// '/providers/Microsoft.Security/standardAssignments/{standardAssignmentName}'. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-08-01 +// - resourceID - The identifier of the resource. +// - standardAssignmentName - The standard assignments assignment key - unique key for the standard assignment +// - options - StandardAssignmentsClientDeleteOptions contains the optional parameters for the StandardAssignmentsClient.Delete +// method. +func (client *StandardAssignmentsClient) Delete(ctx context.Context, resourceID string, standardAssignmentName string, options *StandardAssignmentsClientDeleteOptions) (StandardAssignmentsClientDeleteResponse, error) { + var err error + const operationName = "StandardAssignmentsClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, resourceID, standardAssignmentName, options) + if err != nil { + return StandardAssignmentsClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return StandardAssignmentsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return StandardAssignmentsClientDeleteResponse{}, err + } + return StandardAssignmentsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *StandardAssignmentsClient) deleteCreateRequest(ctx context.Context, resourceID string, standardAssignmentName string, _ *StandardAssignmentsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/{resourceId}/providers/Microsoft.Security/standardAssignments/{standardAssignmentName}" + urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID) + if standardAssignmentName == "" { + return nil, errors.New("parameter standardAssignmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{standardAssignmentName}", url.PathEscape(standardAssignmentName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - This operation retrieves a single standard assignment, given its name and the scope it was created at. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-08-01 +// - resourceID - The identifier of the resource. +// - standardAssignmentName - The standard assignments assignment key - unique key for the standard assignment +// - options - StandardAssignmentsClientGetOptions contains the optional parameters for the StandardAssignmentsClient.Get method. +func (client *StandardAssignmentsClient) Get(ctx context.Context, resourceID string, standardAssignmentName string, options *StandardAssignmentsClientGetOptions) (StandardAssignmentsClientGetResponse, error) { + var err error + const operationName = "StandardAssignmentsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceID, standardAssignmentName, options) + if err != nil { + return StandardAssignmentsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return StandardAssignmentsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return StandardAssignmentsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *StandardAssignmentsClient) getCreateRequest(ctx context.Context, resourceID string, standardAssignmentName string, _ *StandardAssignmentsClientGetOptions) (*policy.Request, error) { + urlPath := "/{resourceId}/providers/Microsoft.Security/standardAssignments/{standardAssignmentName}" + urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID) + if standardAssignmentName == "" { + return nil, errors.New("parameter standardAssignmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{standardAssignmentName}", url.PathEscape(standardAssignmentName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *StandardAssignmentsClient) getHandleResponse(resp *http.Response) (StandardAssignmentsClientGetResponse, error) { + result := StandardAssignmentsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.StandardAssignment); err != nil { + return StandardAssignmentsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Get a list of all relevant standard assignments over a scope +// +// Generated from API version 2024-08-01 +// - scope - The scope of the standard assignment. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), +// subscription (format: +// 'subscriptions/{subscriptionId}'), or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - options - StandardAssignmentsClientListOptions contains the optional parameters for the StandardAssignmentsClient.NewListPager +// method. +func (client *StandardAssignmentsClient) NewListPager(scope string, options *StandardAssignmentsClientListOptions) *runtime.Pager[StandardAssignmentsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[StandardAssignmentsClientListResponse]{ + More: func(page StandardAssignmentsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *StandardAssignmentsClientListResponse) (StandardAssignmentsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "StandardAssignmentsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, scope, options) + }, nil) + if err != nil { + return StandardAssignmentsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *StandardAssignmentsClient) listCreateRequest(ctx context.Context, scope string, _ *StandardAssignmentsClientListOptions) (*policy.Request, error) { + urlPath := "/{scope}/providers/Microsoft.Security/standardAssignments" + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *StandardAssignmentsClient) listHandleResponse(resp *http.Response) (StandardAssignmentsClientListResponse, error) { + result := StandardAssignmentsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.StandardAssignmentsList); err != nil { + return StandardAssignmentsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/standards_client.go b/sdk/resourcemanager/security/armsecurity/standards_client.go new file mode 100644 index 000000000000..5e19375f3009 --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/standards_client.go @@ -0,0 +1,280 @@ +// 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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armsecurity + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// StandardsClient contains the methods for the SecurityStandards group. +// Don't use this type directly, use NewStandardsClient() instead. +type StandardsClient struct { + internal *arm.Client +} + +// NewStandardsClient creates a new instance of StandardsClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewStandardsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*StandardsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &StandardsClient{ + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a security standard over a given scope +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-08-01 +// - scope - The scope of the security standard. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), +// subscription (format: +// 'subscriptions/{subscriptionId}'), or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - standardID - The Security Standard key - unique key for the standard type +// - standard - Custom security standard over a pre-defined scope +// - options - StandardsClientCreateOrUpdateOptions contains the optional parameters for the StandardsClient.CreateOrUpdate +// method. +func (client *StandardsClient) CreateOrUpdate(ctx context.Context, scope string, standardID string, standard Standard, options *StandardsClientCreateOrUpdateOptions) (StandardsClientCreateOrUpdateResponse, error) { + var err error + const operationName = "StandardsClient.CreateOrUpdate" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.createOrUpdateCreateRequest(ctx, scope, standardID, standard, options) + if err != nil { + return StandardsClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return StandardsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return StandardsClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *StandardsClient) createOrUpdateCreateRequest(ctx context.Context, scope string, standardID string, standard Standard, _ *StandardsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/{scope}/providers/Microsoft.Security/securityStandards/{standardId}" + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) + if standardID == "" { + return nil, errors.New("parameter standardID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{standardId}", url.PathEscape(standardID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, standard); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *StandardsClient) createOrUpdateHandleResponse(resp *http.Response) (StandardsClientCreateOrUpdateResponse, error) { + result := StandardsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Standard); err != nil { + return StandardsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete a security standard over a given scope +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-08-01 +// - scope - The scope of the security standard. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), +// subscription (format: +// 'subscriptions/{subscriptionId}'), or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - standardID - The Security Standard key - unique key for the standard type +// - options - StandardsClientDeleteOptions contains the optional parameters for the StandardsClient.Delete method. +func (client *StandardsClient) Delete(ctx context.Context, scope string, standardID string, options *StandardsClientDeleteOptions) (StandardsClientDeleteResponse, error) { + var err error + const operationName = "StandardsClient.Delete" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.deleteCreateRequest(ctx, scope, standardID, options) + if err != nil { + return StandardsClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return StandardsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return StandardsClientDeleteResponse{}, err + } + return StandardsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *StandardsClient) deleteCreateRequest(ctx context.Context, scope string, standardID string, _ *StandardsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/{scope}/providers/Microsoft.Security/securityStandards/{standardId}" + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) + if standardID == "" { + return nil, errors.New("parameter standardID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{standardId}", url.PathEscape(standardID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a specific security standard for the requested scope by standardId +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2024-08-01 +// - scope - The scope of the security standard. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), +// subscription (format: +// 'subscriptions/{subscriptionId}'), or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - standardID - The Security Standard key - unique key for the standard type +// - options - StandardsClientGetOptions contains the optional parameters for the StandardsClient.Get method. +func (client *StandardsClient) Get(ctx context.Context, scope string, standardID string, options *StandardsClientGetOptions) (StandardsClientGetResponse, error) { + var err error + const operationName = "StandardsClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, scope, standardID, options) + if err != nil { + return StandardsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return StandardsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return StandardsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *StandardsClient) getCreateRequest(ctx context.Context, scope string, standardID string, _ *StandardsClientGetOptions) (*policy.Request, error) { + urlPath := "/{scope}/providers/Microsoft.Security/securityStandards/{standardId}" + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) + if standardID == "" { + return nil, errors.New("parameter standardID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{standardId}", url.PathEscape(standardID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *StandardsClient) getHandleResponse(resp *http.Response) (StandardsClientGetResponse, error) { + result := StandardsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Standard); err != nil { + return StandardsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Get a list of all relevant security standards over a scope +// +// Generated from API version 2024-08-01 +// - scope - The scope of the security standard. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), +// subscription (format: +// 'subscriptions/{subscriptionId}'), or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - options - StandardsClientListOptions contains the optional parameters for the StandardsClient.NewListPager method. +func (client *StandardsClient) NewListPager(scope string, options *StandardsClientListOptions) *runtime.Pager[StandardsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[StandardsClientListResponse]{ + More: func(page StandardsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *StandardsClientListResponse) (StandardsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "StandardsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, scope, options) + }, nil) + if err != nil { + return StandardsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *StandardsClient) listCreateRequest(ctx context.Context, scope string, _ *StandardsClientListOptions) (*policy.Request, error) { + urlPath := "/{scope}/providers/Microsoft.Security/securityStandards" + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2024-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *StandardsClient) listHandleResponse(resp *http.Response) (StandardsClientListResponse, error) { + result := StandardsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.StandardList); err != nil { + return StandardsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/subassessments_client.go b/sdk/resourcemanager/security/armsecurity/subassessments_client.go index 5a16d2fd6900..36ea2ff1ec14 100644 --- a/sdk/resourcemanager/security/armsecurity/subassessments_client.go +++ b/sdk/resourcemanager/security/armsecurity/subassessments_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -72,7 +69,7 @@ func (client *SubAssessmentsClient) Get(ctx context.Context, scope string, asses } // getCreateRequest creates the Get request. -func (client *SubAssessmentsClient) getCreateRequest(ctx context.Context, scope string, assessmentName string, subAssessmentName string, options *SubAssessmentsClientGetOptions) (*policy.Request, error) { +func (client *SubAssessmentsClient) getCreateRequest(ctx context.Context, scope string, assessmentName string, subAssessmentName string, _ *SubAssessmentsClientGetOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments/{subAssessmentName}" urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) if assessmentName == "" { @@ -134,7 +131,7 @@ func (client *SubAssessmentsClient) NewListPager(scope string, assessmentName st } // listCreateRequest creates the List request. -func (client *SubAssessmentsClient) listCreateRequest(ctx context.Context, scope string, assessmentName string, options *SubAssessmentsClientListOptions) (*policy.Request, error) { +func (client *SubAssessmentsClient) listCreateRequest(ctx context.Context, scope string, assessmentName string, _ *SubAssessmentsClientListOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/subAssessments" urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) if assessmentName == "" { @@ -192,7 +189,7 @@ func (client *SubAssessmentsClient) NewListAllPager(scope string, options *SubAs } // listAllCreateRequest creates the ListAll request. -func (client *SubAssessmentsClient) listAllCreateRequest(ctx context.Context, scope string, options *SubAssessmentsClientListAllOptions) (*policy.Request, error) { +func (client *SubAssessmentsClient) listAllCreateRequest(ctx context.Context, scope string, _ *SubAssessmentsClientListAllOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/subAssessments" urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) 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 b45a936ec3c2..000000000000 --- a/sdk/resourcemanager/security/armsecurity/subassessments_client_example_test.go +++ /dev/null @@ -1,225 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/ListSubscriptionSubAssessments_example.json -func ExampleSubAssessmentsClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSubAssessmentsClient().NewListAllPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SubAssessmentList = armsecurity.SubAssessmentList{ - // Value: []*armsecurity.SubAssessment{ - // { - // Name: to.Ptr("8c98f353-8b41-4e77-979b-6adeecd5d168"), - // Type: to.Ptr("Microsoft.Security/assessments/subAssessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.ContainerRegistry/registries/myRegistry/providers/Microsoft.Security/assessments/dbd0cb49-b563-45e7-9724-889e799fa648/subAssessments/8c98f353-8b41-4e77-979b-6adeecd5d168"), - // Properties: &armsecurity.SubAssessmentProperties{ - // Description: to.Ptr("The backdoor 'Back Orifice' was detected on this system. The presence of this backdoor indicates that your system has already been compromised. Unauthorized users can access your host at any time. Unauthorized users can take complete control of the host and manipulate data. They can steal the data or even wipe out the host."), - // AdditionalData: &armsecurity.ContainerRegistryVulnerabilityProperties{ - // AssessedResourceType: to.Ptr(armsecurity.AssessedResourceTypeContainerRegistryVulnerability), - // Type: to.Ptr("Vulnerability"), - // Cve: []*armsecurity.CVE{ - // { - // Link: to.Ptr("http://contoso.com"), - // Title: to.Ptr("CVE-2019-12345"), - // }}, - // Cvss: map[string]*armsecurity.CVSS{ - // "2.0": &armsecurity.CVSS{ - // Base: to.Ptr[float32](10), - // }, - // "3.0": &armsecurity.CVSS{ - // Base: to.Ptr[float32](10), - // }, - // }, - // ImageDigest: to.Ptr("c186fc44-3154-4ce2-ba18-b719d895c3b0"), - // Patchable: to.Ptr(true), - // PublishedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.000Z"); return t}()), - // RepositoryName: to.Ptr("myRepo"), - // VendorReferences: []*armsecurity.VendorReference{ - // { - // Link: to.Ptr("http://contoso.com"), - // Title: to.Ptr("Reference_1"), - // }}, - // }, - // Category: to.Ptr("Backdoors and trojan horses"), - // DisplayName: to.Ptr("'Back Orifice' Backdoor"), - // ID: to.Ptr("1001"), - // Impact: to.Ptr("3"), - // Remediation: to.Ptr("Use a recent anti-virus program to remove this backdoor and check your system regularly with anti-virus software."), - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("repositories/asc/msi-connector/images/sha256:877a6f2a212c44021281f80cb1f4c73a09dce4e99a8cb8efcc03f7ce3c877a6f"), - // }, - // Status: &armsecurity.SubAssessmentStatus{ - // Description: to.Ptr("The resource is unhealthy"), - // Cause: to.Ptr(""), - // Code: to.Ptr(armsecurity.SubAssessmentStatusCodeUnhealthy), - // Severity: to.Ptr(armsecurity.SeverityHigh), - // }, - // TimeGenerated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-23T12:20:08.764Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("8fbe5054-e97c-3a7a-fda7-c8308ca8d3cf"), - // Type: to.Ptr("Microsoft.Security/assessments/subAssessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/ascdemoRG/providers/Microsoft.Sql/servers/sqlserver1demo/providers/Microsoft.Security/assessments/82e20e14-edc5-4373-bfc4-f13121257c37/subassessments/8fbe5054-e97c-3a7a-fda7-c8308ca8d3cf"), - // Properties: &armsecurity.SubAssessmentProperties{ - // Description: to.Ptr("The Azure SQL Database-level firewall helps protect your data by preventing all access to your database until you specify which IP addresses have permission. Database-level firewall rules grant access to the specific database based on the originating IP address of each request.\n\nDatabase-level firewall rules for master"), - // AdditionalData: &armsecurity.SQLServerVulnerabilityProperties{ - // AssessedResourceType: to.Ptr(armsecurity.AssessedResourceTypeSQLServerVulnerability), - // Type: to.Ptr("AzureDatabase"), - // Query: to.Ptr("SELECT name\n ,start_ip_address\n ,end_ip_address\nFROM sys.database_firewall_rules"), - // }, - // Category: to.Ptr("SurfaceAreaReduction"), - // DisplayName: to.Ptr("Database-level firewall rules should be tracked and maintained at a strict minimum"), - // ID: to.Ptr("VA2064"), - // Impact: to.Ptr("Firewall rules should be strictly configured to allow access only to client computers that have a valid need to connect to the database. Any superfluous entries in the firewall may pose a threat by allowing an unauthorized source access to your database."), - // Remediation: to.Ptr("Evaluate each of the database-level firewall rules. Remove any rules that grant unnecessary access and set the rest as a baseline. Deviations from the baseline will be identified and brought to your attention in subsequent scans."), - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("/subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/ascdemoRG/providers/Microsoft.Sql/servers/sqlserver1demo/databases/database1"), - // }, - // Status: &armsecurity.SubAssessmentStatus{ - // Cause: to.Ptr("Unknown"), - // Code: to.Ptr(armsecurity.SubAssessmentStatusCodeHealthy), - // Severity: to.Ptr(armsecurity.SeverityHigh), - // }, - // TimeGenerated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-23T12:20:08.764Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/ListSubAssessments_example.json -func ExampleSubAssessmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSubAssessmentsClient().NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "82e20e14-edc5-4373-bfc4-f13121257c37", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SubAssessmentList = armsecurity.SubAssessmentList{ - // Value: []*armsecurity.SubAssessment{ - // { - // Name: to.Ptr("8fbe5054-e97c-3a7a-fda7-c8308ca8d3cf"), - // Type: to.Ptr("Microsoft.Security/assessments/subAssessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/ascdemoRG/providers/Microsoft.Sql/servers/sqlserver1demo/providers/Microsoft.Security/assessments/82e20e14-edc5-4373-bfc4-f13121257c37/subassessments/8fbe5054-e97c-3a7a-fda7-c8308ca8d3cf"), - // Properties: &armsecurity.SubAssessmentProperties{ - // Description: to.Ptr("The Azure SQL Database-level firewall helps protect your data by preventing all access to your database until you specify which IP addresses have permission. Database-level firewall rules grant access to the specific database based on the originating IP address of each request.\n\nDatabase-level firewall rules for master"), - // AdditionalData: &armsecurity.SQLServerVulnerabilityProperties{ - // AssessedResourceType: to.Ptr(armsecurity.AssessedResourceTypeSQLServerVulnerability), - // Type: to.Ptr("AzureDatabase"), - // Query: to.Ptr("SELECT name\n ,start_ip_address\n ,end_ip_address\nFROM sys.database_firewall_rules"), - // }, - // Category: to.Ptr("SurfaceAreaReduction"), - // DisplayName: to.Ptr("Database-level firewall rules should be tracked and maintained at a strict minimum"), - // ID: to.Ptr("VA2064"), - // Impact: to.Ptr("Firewall rules should be strictly configured to allow access only to client computers that have a valid need to connect to the database. Any superfluous entries in the firewall may pose a threat by allowing an unauthorized source access to your database."), - // Remediation: to.Ptr("Evaluate each of the database-level firewall rules. Remove any rules that grant unnecessary access and set the rest as a baseline. Deviations from the baseline will be identified and brought to your attention in subsequent scans."), - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("/subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/ascdemoRG/providers/Microsoft.Sql/servers/sqlserver1demo/databases/database1"), - // }, - // Status: &armsecurity.SubAssessmentStatus{ - // Cause: to.Ptr("Unknown"), - // Code: to.Ptr(armsecurity.SubAssessmentStatusCodeHealthy), - // Severity: to.Ptr(armsecurity.SeverityHigh), - // }, - // TimeGenerated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-23T12:20:08.764Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/GetSubAssessment_example.json -func ExampleSubAssessmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSubAssessmentsClient().Get(ctx, "subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/DEMORG/providers/Microsoft.Compute/virtualMachines/vm2", "1195afff-c881-495e-9bc5-1486211ae03f", "95f7da9c-a2a4-1322-0758-fcd24ef09b85", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SubAssessment = armsecurity.SubAssessment{ - // Name: to.Ptr("95f7da9c-a2a4-1322-0758-fcd24ef09b85"), - // Type: to.Ptr("Microsoft.Security/assessments/subAssessments"), - // ID: to.Ptr("/subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/DEMORG/providers/Microsoft.Compute/virtualMachines/vm2/providers/Microsoft.Security/assessments/1195afff-c881-495e-9bc5-1486211ae03f/subassessments/95f7da9c-a2a4-1322-0758-fcd24ef09b85"), - // Properties: &armsecurity.SubAssessmentProperties{ - // Description: to.Ptr("PuTTY ssh_agent_channel_data Function Integer Overflow Vulnerability"), - // AdditionalData: &armsecurity.AdditionalData{ - // AssessedResourceType: to.Ptr(armsecurity.AssessedResourceTypeServerVulnerability), - // }, - // Category: to.Ptr("Local"), - // DisplayName: to.Ptr("PuTTY ssh_agent_channel_data Function Integer Overflow Vulnerability"), - // ID: to.Ptr("370361"), - // Impact: to.Ptr("Successful exploitation could allow remote attackers to have unspecified impact via a large length value in an agent protocol message."), - // Remediation: to.Ptr("Customers are advised to upgrade toPuTTY 0.68 or later version in order to remediate this vulnerability."), - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("/subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/DEMORG/providers/Microsoft.Compute/virtualMachines/vm2"), - // }, - // Status: &armsecurity.SubAssessmentStatus{ - // Code: to.Ptr(armsecurity.SubAssessmentStatusCodeUnhealthy), - // Severity: to.Ptr(armsecurity.SeverityMedium), - // }, - // TimeGenerated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-02-02T12:36:50.779Z"); return t}()), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/tasks_client.go b/sdk/resourcemanager/security/armsecurity/tasks_client.go index c23bbfbabc3d..a645ae4406fe 100644 --- a/sdk/resourcemanager/security/armsecurity/tasks_client.go +++ b/sdk/resourcemanager/security/armsecurity/tasks_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -75,7 +72,7 @@ func (client *TasksClient) GetResourceGroupLevelTask(ctx context.Context, resour } // getResourceGroupLevelTaskCreateRequest creates the GetResourceGroupLevelTask request. -func (client *TasksClient) getResourceGroupLevelTaskCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, taskName string, options *TasksClientGetResourceGroupLevelTaskOptions) (*policy.Request, error) { +func (client *TasksClient) getResourceGroupLevelTaskCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, taskName string, _ *TasksClientGetResourceGroupLevelTaskOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -144,7 +141,7 @@ func (client *TasksClient) GetSubscriptionLevelTask(ctx context.Context, ascLoca } // getSubscriptionLevelTaskCreateRequest creates the GetSubscriptionLevelTask request. -func (client *TasksClient) getSubscriptionLevelTaskCreateRequest(ctx context.Context, ascLocation string, taskName string, options *TasksClientGetSubscriptionLevelTaskOptions) (*policy.Request, error) { +func (client *TasksClient) getSubscriptionLevelTaskCreateRequest(ctx context.Context, ascLocation string, taskName string, _ *TasksClientGetSubscriptionLevelTaskOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -398,7 +395,7 @@ func (client *TasksClient) UpdateResourceGroupLevelTaskState(ctx context.Context } // updateResourceGroupLevelTaskStateCreateRequest creates the UpdateResourceGroupLevelTaskState request. -func (client *TasksClient) updateResourceGroupLevelTaskStateCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, taskName string, taskUpdateActionType TaskUpdateActionType, options *TasksClientUpdateResourceGroupLevelTaskStateOptions) (*policy.Request, error) { +func (client *TasksClient) updateResourceGroupLevelTaskStateCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, taskName string, taskUpdateActionType TaskUpdateActionType, _ *TasksClientUpdateResourceGroupLevelTaskStateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -462,7 +459,7 @@ func (client *TasksClient) UpdateSubscriptionLevelTaskState(ctx context.Context, } // updateSubscriptionLevelTaskStateCreateRequest creates the UpdateSubscriptionLevelTaskState request. -func (client *TasksClient) updateSubscriptionLevelTaskStateCreateRequest(ctx context.Context, ascLocation string, taskName string, taskUpdateActionType TaskUpdateActionType, options *TasksClientUpdateSubscriptionLevelTaskStateOptions) (*policy.Request, error) { +func (client *TasksClient) updateSubscriptionLevelTaskStateCreateRequest(ctx context.Context, ascLocation string, taskName string, taskUpdateActionType TaskUpdateActionType, _ *TasksClientUpdateSubscriptionLevelTaskStateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/tasks/{taskName}/{taskUpdateActionType}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 c50f7d59a377..000000000000 --- a/sdk/resourcemanager/security/armsecurity/tasks_client_example_test.go +++ /dev/null @@ -1,337 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTasksSubscription_example.json -func ExampleTasksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTasksClient().NewListPager(&armsecurity.TasksClientListOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TaskList = armsecurity.TaskList{ - // Value: []*armsecurity.Task{ - // { - // Name: to.Ptr("62609ee7-d0a5-8616-9fe4-1df5cca7758d"), - // Type: to.Ptr("Microsoft.Security/locations/tasks"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/westeurope/tasks/62609ee7-d0a5-8616-9fe4-1df5cca7758d"), - // Properties: &armsecurity.TaskProperties{ - // CreationTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-05T10:42:03.993Z"); return t}()), - // LastStateChangeTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-05T10:42:03.993Z"); return t}()), - // SecurityTaskParameters: &armsecurity.TaskParameters{ - // AdditionalProperties: map[string]any{ - // "location": "uksouth", - // "resourceGroup": "myRg", - // "resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/default", - // "resourceName": "default", - // "resourceParent": "vnet1", - // "resourceType": "Subnet", - // "uniqueKey": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/default", - // }, - // Name: to.Ptr("NetworkSecurityGroupMissingOnSubnet"), - // }, - // State: to.Ptr("Active"), - // SubState: to.Ptr("NA"), - // }, - // }, - // { - // Name: to.Ptr("d55b4dc0-779c-c66c-33e5-d7bce24c4222"), - // Type: to.Ptr("Microsoft.Security/locations/tasks"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Security/locations/westeurope/tasks/d55b4dc0-779c-c66c-33e5-d7bce24c4222"), - // Properties: &armsecurity.TaskProperties{ - // CreationTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-02T11:41:27.054Z"); return t}()), - // LastStateChangeTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-02T11:41:27.054Z"); return t}()), - // SecurityTaskParameters: &armsecurity.TaskParameters{ - // AdditionalProperties: map[string]any{ - // "isDataDiskEncrypted": false, - // "isOsDiskEncrypted": false, - // "resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "severity": "High", - // "uniqueKey": "EncryptionOnVmTaskParameters_/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "vmId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "vmName": "vm1", - // }, - // Name: to.Ptr("EncryptionOnVm"), - // }, - // State: to.Ptr("Active"), - // SubState: to.Ptr("NA"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTasksSubscriptionLocation_example.json -func ExampleTasksClient_NewListByHomeRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTasksClient().NewListByHomeRegionPager("westeurope", &armsecurity.TasksClientListByHomeRegionOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TaskList = armsecurity.TaskList{ - // Value: []*armsecurity.Task{ - // { - // Name: to.Ptr("62609ee7-d0a5-8616-9fe4-1df5cca7758d"), - // Type: to.Ptr("Microsoft.Security/locations/tasks"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/westeurope/tasks/62609ee7-d0a5-8616-9fe4-1df5cca7758d"), - // Properties: &armsecurity.TaskProperties{ - // CreationTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-05T10:42:03.993Z"); return t}()), - // LastStateChangeTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-05T10:42:03.993Z"); return t}()), - // SecurityTaskParameters: &armsecurity.TaskParameters{ - // AdditionalProperties: map[string]any{ - // "location": "uksouth", - // "resourceGroup": "myRg", - // "resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/default", - // "resourceName": "default", - // "resourceParent": "vnet1", - // "resourceType": "Subnet", - // "uniqueKey": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/default", - // }, - // Name: to.Ptr("NetworkSecurityGroupMissingOnSubnet"), - // }, - // State: to.Ptr("Active"), - // SubState: to.Ptr("NA"), - // }, - // }, - // { - // Name: to.Ptr("d55b4dc0-779c-c66c-33e5-d7bce24c4222"), - // Type: to.Ptr("Microsoft.Security/locations/tasks"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Security/locations/westeurope/tasks/d55b4dc0-779c-c66c-33e5-d7bce24c4222"), - // Properties: &armsecurity.TaskProperties{ - // CreationTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-02T11:41:27.054Z"); return t}()), - // LastStateChangeTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-02T11:41:27.054Z"); return t}()), - // SecurityTaskParameters: &armsecurity.TaskParameters{ - // AdditionalProperties: map[string]any{ - // "isDataDiskEncrypted": false, - // "isOsDiskEncrypted": false, - // "resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "severity": "High", - // "uniqueKey": "EncryptionOnVmTaskParameters_/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "vmId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "vmName": "vm1", - // }, - // Name: to.Ptr("EncryptionOnVm"), - // }, - // State: to.Ptr("Active"), - // SubState: to.Ptr("NA"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTaskSubscriptionLocation_example.json -func ExampleTasksClient_GetSubscriptionLevelTask() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTasksClient().GetSubscriptionLevelTask(ctx, "westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Task = armsecurity.Task{ - // Name: to.Ptr("62609ee7-d0a5-8616-9fe4-1df5cca7758d"), - // Type: to.Ptr("Microsoft.Security/locations/tasks"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/westeurope/tasks/62609ee7-d0a5-8616-9fe4-1df5cca7758d"), - // Properties: &armsecurity.TaskProperties{ - // CreationTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-05T10:42:03.993Z"); return t}()), - // LastStateChangeTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-05T10:42:03.993Z"); return t}()), - // SecurityTaskParameters: &armsecurity.TaskParameters{ - // AdditionalProperties: map[string]any{ - // "location": "uksouth", - // "resourceGroup": "myRg", - // "resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/default", - // "resourceName": "default", - // "resourceParent": "vnet1", - // "resourceType": "Subnet", - // "uniqueKey": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/default", - // }, - // Name: to.Ptr("NetworkSecurityGroupMissingOnSubnet"), - // }, - // State: to.Ptr("Active"), - // SubState: to.Ptr("NA"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/UpdateTaskSubscriptionLocation_example.json -func ExampleTasksClient_UpdateSubscriptionLevelTaskState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewTasksClient().UpdateSubscriptionLevelTaskState(ctx, "westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", armsecurity.TaskUpdateActionTypeDismiss, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTasksResourceGroupLocation_example.json -func ExampleTasksClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTasksClient().NewListByResourceGroupPager("myRg", "westeurope", &armsecurity.TasksClientListByResourceGroupOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TaskList = armsecurity.TaskList{ - // Value: []*armsecurity.Task{ - // { - // Name: to.Ptr("d55b4dc0-779c-c66c-33e5-d7bce24c4222"), - // Type: to.Ptr("Microsoft.Security/locations/tasks"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Security/locations/westeurope/tasks/d55b4dc0-779c-c66c-33e5-d7bce24c4222"), - // Properties: &armsecurity.TaskProperties{ - // CreationTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-02T11:41:27.054Z"); return t}()), - // LastStateChangeTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-02T11:41:27.054Z"); return t}()), - // SecurityTaskParameters: &armsecurity.TaskParameters{ - // AdditionalProperties: map[string]any{ - // "isDataDiskEncrypted": false, - // "isOsDiskEncrypted": false, - // "resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "severity": "High", - // "uniqueKey": "EncryptionOnVmTaskParameters_/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "vmId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "vmName": "vm1", - // }, - // Name: to.Ptr("EncryptionOnVm"), - // }, - // State: to.Ptr("Active"), - // SubState: to.Ptr("NA"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTaskResourceGroupLocation_example.json -func ExampleTasksClient_GetResourceGroupLevelTask() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTasksClient().GetResourceGroupLevelTask(ctx, "myRg", "westeurope", "d55b4dc0-779c-c66c-33e5-d7bce24c4222", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Task = armsecurity.Task{ - // Name: to.Ptr("d55b4dc0-779c-c66c-33e5-d7bce24c4222"), - // Type: to.Ptr("Microsoft.Security/locations/tasks"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Security/locations/westeurope/tasks/d55b4dc0-779c-c66c-33e5-d7bce24c4222"), - // Properties: &armsecurity.TaskProperties{ - // CreationTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-02T11:41:27.054Z"); return t}()), - // LastStateChangeTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-02T11:41:27.054Z"); return t}()), - // SecurityTaskParameters: &armsecurity.TaskParameters{ - // AdditionalProperties: map[string]any{ - // "isDataDiskEncrypted": false, - // "isOsDiskEncrypted": false, - // "resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "severity": "High", - // "uniqueKey": "EncryptionOnVmTaskParameters_/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "vmId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "vmName": "vm1", - // }, - // Name: to.Ptr("EncryptionOnVm"), - // }, - // State: to.Ptr("Active"), - // SubState: to.Ptr("NA"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/UpdateTaskResourceGroupLocation_example.json -func ExampleTasksClient_UpdateResourceGroupLevelTaskState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewTasksClient().UpdateResourceGroupLevelTaskState(ctx, "myRg", "westeurope", "d55b4dc0-779c-c66c-33e5-d7bce24c4222", armsecurity.TaskUpdateActionTypeDismiss, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/time_rfc3339.go b/sdk/resourcemanager/security/armsecurity/time_rfc3339.go index ab3e710b6b36..01ab6e4dc00d 100644 --- a/sdk/resourcemanager/security/armsecurity/time_rfc3339.go +++ b/sdk/resourcemanager/security/armsecurity/time_rfc3339.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -60,6 +57,9 @@ func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { } func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { + if len(data) == 0 { + return nil + } tzOffset := tzOffsetRegex.Match(data) hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") var layout string diff --git a/sdk/resourcemanager/security/armsecurity/topology_client.go b/sdk/resourcemanager/security/armsecurity/topology_client.go index e93c7eeebfe1..7e9296a7112e 100644 --- a/sdk/resourcemanager/security/armsecurity/topology_client.go +++ b/sdk/resourcemanager/security/armsecurity/topology_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -74,7 +71,7 @@ func (client *TopologyClient) Get(ctx context.Context, resourceGroupName string, } // getCreateRequest creates the Get request. -func (client *TopologyClient) getCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, topologyResourceName string, options *TopologyClientGetOptions) (*policy.Request, error) { +func (client *TopologyClient) getCreateRequest(ctx context.Context, resourceGroupName string, ascLocation string, topologyResourceName string, _ *TopologyClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/topologies/{topologyResourceName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -140,7 +137,7 @@ func (client *TopologyClient) NewListPager(options *TopologyClientListOptions) * } // listCreateRequest creates the List request. -func (client *TopologyClient) listCreateRequest(ctx context.Context, options *TopologyClientListOptions) (*policy.Request, error) { +func (client *TopologyClient) listCreateRequest(ctx context.Context, _ *TopologyClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/topologies" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -196,7 +193,7 @@ func (client *TopologyClient) NewListByHomeRegionPager(ascLocation string, optio } // listByHomeRegionCreateRequest creates the ListByHomeRegion request. -func (client *TopologyClient) listByHomeRegionCreateRequest(ctx context.Context, ascLocation string, options *TopologyClientListByHomeRegionOptions) (*policy.Request, error) { +func (client *TopologyClient) listByHomeRegionCreateRequest(ctx context.Context, ascLocation string, _ *TopologyClientListByHomeRegionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/topologies" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 c0f5248bdf3a..000000000000 --- a/sdk/resourcemanager/security/armsecurity/topology_client_example_test.go +++ /dev/null @@ -1,204 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/GetTopologySubscription_example.json -func ExampleTopologyClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTopologyClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TopologyList = armsecurity.TopologyList{ - // Value: []*armsecurity.TopologyResource{ - // { - // Location: to.Ptr("westus"), - // Name: to.Ptr("vnets"), - // Type: to.Ptr("Microsoft.Security/locations/topologies"), - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Security/locations/centralus/topologies/vnets"), - // Properties: &armsecurity.TopologyResourceProperties{ - // CalculatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-07-10T13:56:10.575Z"); return t}()), - // TopologyResources: []*armsecurity.TopologySingleResource{ - // { - // Children: []*armsecurity.TopologySingleResourceChild{ - // { - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet"), - // }}, - // Location: to.Ptr("westus"), - // NetworkZones: to.Ptr("Internal"), - // RecommendationsExist: to.Ptr(false), - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet"), - // Severity: to.Ptr("Healthy"), - // TopologyScore: to.Ptr[int32](0), - // }}, - // }, - // }, - // { - // Location: to.Ptr("westus"), - // Name: to.Ptr("subnets"), - // Type: to.Ptr("Microsoft.Security/locations/topologies"), - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Security/locations/centralus/topologies/subnets"), - // Properties: &armsecurity.TopologyResourceProperties{ - // CalculatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-07-10T13:56:10.575Z"); return t}()), - // TopologyResources: []*armsecurity.TopologySingleResource{ - // { - // Location: to.Ptr("westus"), - // NetworkZones: to.Ptr("Internal"), - // Parents: []*armsecurity.TopologySingleResourceParent{ - // { - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet"), - // }}, - // RecommendationsExist: to.Ptr(false), - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet"), - // Severity: to.Ptr("Healthy"), - // TopologyScore: to.Ptr[int32](5), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/GetTopologySubscriptionLocation_example.json -func ExampleTopologyClient_NewListByHomeRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTopologyClient().NewListByHomeRegionPager("centralus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TopologyList = armsecurity.TopologyList{ - // Value: []*armsecurity.TopologyResource{ - // { - // Location: to.Ptr("westus"), - // Name: to.Ptr("vnets"), - // Type: to.Ptr("Microsoft.Security/locations/topologies"), - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Security/locations/centralus/topologies/vnets"), - // Properties: &armsecurity.TopologyResourceProperties{ - // CalculatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-07-10T13:56:10.575Z"); return t}()), - // TopologyResources: []*armsecurity.TopologySingleResource{ - // { - // Children: []*armsecurity.TopologySingleResourceChild{ - // { - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet"), - // }}, - // Location: to.Ptr("westus"), - // NetworkZones: to.Ptr("Internal"), - // RecommendationsExist: to.Ptr(false), - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet"), - // Severity: to.Ptr("Healthy"), - // TopologyScore: to.Ptr[int32](0), - // }}, - // }, - // }, - // { - // Location: to.Ptr("westus"), - // Name: to.Ptr("subnets"), - // Type: to.Ptr("Microsoft.Security/locations/topologies"), - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Security/locations/centralus/topologies/subnets"), - // Properties: &armsecurity.TopologyResourceProperties{ - // CalculatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-07-10T13:56:10.575Z"); return t}()), - // TopologyResources: []*armsecurity.TopologySingleResource{ - // { - // Location: to.Ptr("westus"), - // NetworkZones: to.Ptr("Internal"), - // Parents: []*armsecurity.TopologySingleResourceParent{ - // { - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet"), - // }}, - // RecommendationsExist: to.Ptr(false), - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet"), - // Severity: to.Ptr("Healthy"), - // TopologyScore: to.Ptr[int32](5), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/GetTopology_example.json -func ExampleTopologyClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTopologyClient().Get(ctx, "myservers", "centralus", "vnets", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TopologyResource = armsecurity.TopologyResource{ - // Location: to.Ptr("westus"), - // Name: to.Ptr("vnets"), - // Type: to.Ptr("Microsoft.Security/locations/topologies"), - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Security/locations/centralus/topologies/vnets"), - // Properties: &armsecurity.TopologyResourceProperties{ - // CalculatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-07-10T13:56:10.575Z"); return t}()), - // TopologyResources: []*armsecurity.TopologySingleResource{ - // { - // Children: []*armsecurity.TopologySingleResourceChild{ - // { - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet"), - // }}, - // Location: to.Ptr("westus"), - // NetworkZones: to.Ptr("InternetFacing"), - // RecommendationsExist: to.Ptr(false), - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet"), - // Severity: to.Ptr("Healthy"), - // TopologyScore: to.Ptr[int32](0), - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/workspacesettings_client.go b/sdk/resourcemanager/security/armsecurity/workspacesettings_client.go index e1eb0629416f..b1924453275a 100644 --- a/sdk/resourcemanager/security/armsecurity/workspacesettings_client.go +++ b/sdk/resourcemanager/security/armsecurity/workspacesettings_client.go @@ -1,6 +1,3 @@ -//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. DO NOT EDIT. @@ -74,7 +71,7 @@ func (client *WorkspaceSettingsClient) Create(ctx context.Context, workspaceSett } // createCreateRequest creates the Create request. -func (client *WorkspaceSettingsClient) createCreateRequest(ctx context.Context, workspaceSettingName string, workspaceSetting WorkspaceSetting, options *WorkspaceSettingsClientCreateOptions) (*policy.Request, error) { +func (client *WorkspaceSettingsClient) createCreateRequest(ctx context.Context, workspaceSettingName string, workspaceSetting WorkspaceSetting, _ *WorkspaceSettingsClientCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -136,7 +133,7 @@ func (client *WorkspaceSettingsClient) Delete(ctx context.Context, workspaceSett } // deleteCreateRequest creates the Delete request. -func (client *WorkspaceSettingsClient) deleteCreateRequest(ctx context.Context, workspaceSettingName string, options *WorkspaceSettingsClientDeleteOptions) (*policy.Request, error) { +func (client *WorkspaceSettingsClient) deleteCreateRequest(ctx context.Context, workspaceSettingName string, _ *WorkspaceSettingsClientDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -187,7 +184,7 @@ func (client *WorkspaceSettingsClient) Get(ctx context.Context, workspaceSetting } // getCreateRequest creates the Get request. -func (client *WorkspaceSettingsClient) getCreateRequest(ctx context.Context, workspaceSettingName string, options *WorkspaceSettingsClientGetOptions) (*policy.Request, error) { +func (client *WorkspaceSettingsClient) getCreateRequest(ctx context.Context, workspaceSettingName string, _ *WorkspaceSettingsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -247,7 +244,7 @@ func (client *WorkspaceSettingsClient) NewListPager(options *WorkspaceSettingsCl } // listCreateRequest creates the List request. -func (client *WorkspaceSettingsClient) listCreateRequest(ctx context.Context, options *WorkspaceSettingsClientListOptions) (*policy.Request, error) { +func (client *WorkspaceSettingsClient) listCreateRequest(ctx context.Context, _ *WorkspaceSettingsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") @@ -304,7 +301,7 @@ func (client *WorkspaceSettingsClient) Update(ctx context.Context, workspaceSett } // updateCreateRequest creates the Update request. -func (client *WorkspaceSettingsClient) updateCreateRequest(ctx context.Context, workspaceSettingName string, workspaceSetting WorkspaceSetting, options *WorkspaceSettingsClientUpdateOptions) (*policy.Request, error) { +func (client *WorkspaceSettingsClient) updateCreateRequest(ctx context.Context, workspaceSettingName string, workspaceSetting WorkspaceSetting, _ *WorkspaceSettingsClientUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/workspaceSettings/{workspaceSettingName}" if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") 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 007d331775ad..000000000000 --- a/sdk/resourcemanager/security/armsecurity/workspacesettings_client_example_test.go +++ /dev/null @@ -1,184 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/GetWorkspaceSettings_example.json -func ExampleWorkspaceSettingsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewWorkspaceSettingsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkspaceSettingList = armsecurity.WorkspaceSettingList{ - // Value: []*armsecurity.WorkspaceSetting{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/workspaceSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/workspaceSettings/default"), - // Properties: &armsecurity.WorkspaceSettingProperties{ - // Scope: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // WorkspaceID: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // }, - // { - // Name: to.Ptr("myRg"), - // Type: to.Ptr("Microsoft.Security/workspaceSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Security/workspaceSettings/myRg"), - // Properties: &armsecurity.WorkspaceSettingProperties{ - // Scope: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg"), - // WorkspaceID: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myOtherRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace2"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/GetWorkspaceSetting_example.json -func ExampleWorkspaceSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspaceSettingsClient().Get(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkspaceSetting = armsecurity.WorkspaceSetting{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/workspaceSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/workspaceSettings/default"), - // Properties: &armsecurity.WorkspaceSettingProperties{ - // Scope: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // WorkspaceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/CreateWorkspaceSetting_example.json -func ExampleWorkspaceSettingsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspaceSettingsClient().Create(ctx, "default", armsecurity.WorkspaceSetting{ - Name: to.Ptr("default"), - Type: to.Ptr("Microsoft.Security/workspaceSettings"), - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/workspaceSettings/default"), - Properties: &armsecurity.WorkspaceSettingProperties{ - Scope: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - WorkspaceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkspaceSetting = armsecurity.WorkspaceSetting{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/workspaceSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/workspaceSettings/default"), - // Properties: &armsecurity.WorkspaceSettingProperties{ - // Scope: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // WorkspaceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/UpdateWorkspaceSetting_example.json -func ExampleWorkspaceSettingsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewWorkspaceSettingsClient().Update(ctx, "default", armsecurity.WorkspaceSetting{ - Name: to.Ptr("default"), - Type: to.Ptr("Microsoft.Security/workspaceSettings"), - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/workspaceSettings/default"), - Properties: &armsecurity.WorkspaceSettingProperties{ - WorkspaceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.WorkspaceSetting = armsecurity.WorkspaceSetting{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/workspaceSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/workspaceSettings/default"), - // Properties: &armsecurity.WorkspaceSettingProperties{ - // Scope: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // WorkspaceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9ac34f238dd6b9071f486b57e9f9f1a0c43ec6f6/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/DeleteWorkspaceSetting_example.json -func ExampleWorkspaceSettingsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewWorkspaceSettingsClient().Delete(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -}