diff --git a/sdk/resourcemanager/security/armsecurity/CHANGELOG.md b/sdk/resourcemanager/security/armsecurity/CHANGELOG.md index 758bfe469bd7..cd2db17e7572 100644 --- a/sdk/resourcemanager/security/armsecurity/CHANGELOG.md +++ b/sdk/resourcemanager/security/armsecurity/CHANGELOG.md @@ -1,5 +1,199 @@ # Release History +## 0.12.0 (2023-11-06) +### Breaking Changes + +- Type of `HealthDataClassification.Scope` has been changed from `*ScopeName` to `*string` +- Enum `ScopeName` has been removed +- Function `NewAPICollectionClient` has been removed +- Function `*APICollectionClient.Get` has been removed +- Function `*APICollectionClient.NewListPager` has been removed +- Function `NewAPICollectionOffboardingClient` has been removed +- Function `*APICollectionOffboardingClient.Delete` has been removed +- Function `NewAPICollectionOnboardingClient` has been removed +- Function `*APICollectionOnboardingClient.Create` has been removed +- Function `*ClientFactory.NewAPICollectionClient` has been removed +- Function `*ClientFactory.NewAPICollectionOffboardingClient` has been removed +- Function `*ClientFactory.NewAPICollectionOnboardingClient` has been removed +- Function `*ClientFactory.NewHealthReportClient` has been removed +- Function `*ClientFactory.NewIngestionSettingsClient` has been removed +- Function `NewHealthReportClient` has been removed +- Function `*HealthReportClient.Get` has been removed +- Function `NewIngestionSettingsClient` has been removed +- Function `*IngestionSettingsClient.Create` has been removed +- Function `*IngestionSettingsClient.Delete` has been removed +- Function `*IngestionSettingsClient.Get` has been removed +- Function `*IngestionSettingsClient.ListConnectionStrings` has been removed +- Function `*IngestionSettingsClient.NewListPager` has been removed +- Function `*IngestionSettingsClient.ListTokens` has been removed +- Struct `APICollectionResponse` has been removed +- Struct `APICollectionResponseList` has been removed +- Struct `ConnectionStrings` has been removed +- Struct `IngestionConnectionString` has been removed +- Struct `IngestionSetting` has been removed +- Struct `IngestionSettingList` has been removed +- Struct `IngestionSettingToken` has been removed +- Field `AdditionalData` of struct `APICollectionProperties` has been removed + +### Features Added + +- New enum type `ActionableRemediationState` with values `ActionableRemediationStateDisabled`, `ActionableRemediationStateEnabled`, `ActionableRemediationStateNone` +- New enum type `AnnotateDefaultBranchState` with values `AnnotateDefaultBranchStateDisabled`, `AnnotateDefaultBranchStateEnabled` +- New enum type `AutoDiscovery` with values `AutoDiscoveryDisabled`, `AutoDiscoveryEnabled`, `AutoDiscoveryNotApplicable` +- New enum type `DesiredOnboardingState` with values `DesiredOnboardingStateDisabled`, `DesiredOnboardingStateEnabled` +- New enum type `DevOpsProvisioningState` with values `DevOpsProvisioningStateCanceled`, `DevOpsProvisioningStateDeletionFailure`, `DevOpsProvisioningStateDeletionSuccess`, `DevOpsProvisioningStateFailed`, `DevOpsProvisioningStatePending`, `DevOpsProvisioningStatePendingDeletion`, `DevOpsProvisioningStateSucceeded` +- New enum type `InheritFromParentState` with values `InheritFromParentStateDisabled`, `InheritFromParentStateEnabled` +- New enum type `OnboardingState` with values `OnboardingStateNotApplicable`, `OnboardingStateNotOnboarded`, `OnboardingStateOnboarded`, `OnboardingStateOnboardedByOtherConnector` +- New enum type `RuleCategory` with values `RuleCategoryArtifacts`, `RuleCategoryCode`, `RuleCategoryContainers`, `RuleCategoryDependencies`, `RuleCategoryIaC`, `RuleCategorySecrets` +- New enum type `ServerVulnerabilityAssessmentsAzureSettingSelectedProvider` with values `ServerVulnerabilityAssessmentsAzureSettingSelectedProviderMdeTvm` +- New enum type `ServerVulnerabilityAssessmentsSettingKind` with values `ServerVulnerabilityAssessmentsSettingKindAzureServersSetting` +- New enum type `ServerVulnerabilityAssessmentsSettingKindName` with values `ServerVulnerabilityAssessmentsSettingKindNameAzureServersSetting` +- New enum type `SettingNameAutoGenerated` with values `SettingNameAutoGeneratedCurrent` +- New function `NewAPICollectionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*APICollectionsClient, error)` +- New function `*APICollectionsClient.GetByAzureAPIManagementService(context.Context, string, string, string, *APICollectionsClientGetByAzureAPIManagementServiceOptions) (APICollectionsClientGetByAzureAPIManagementServiceResponse, error)` +- New function `*APICollectionsClient.NewListByAzureAPIManagementServicePager(string, string, *APICollectionsClientListByAzureAPIManagementServiceOptions) *runtime.Pager[APICollectionsClientListByAzureAPIManagementServiceResponse]` +- New function `*APICollectionsClient.NewListByResourceGroupPager(string, *APICollectionsClientListByResourceGroupOptions) *runtime.Pager[APICollectionsClientListByResourceGroupResponse]` +- New function `*APICollectionsClient.NewListBySubscriptionPager(*APICollectionsClientListBySubscriptionOptions) *runtime.Pager[APICollectionsClientListBySubscriptionResponse]` +- New function `*APICollectionsClient.OffboardAzureAPIManagementAPI(context.Context, string, string, string, *APICollectionsClientOffboardAzureAPIManagementAPIOptions) (APICollectionsClientOffboardAzureAPIManagementAPIResponse, error)` +- New function `*APICollectionsClient.BeginOnboardAzureAPIManagementAPI(context.Context, string, string, string, *APICollectionsClientBeginOnboardAzureAPIManagementAPIOptions) (*runtime.Poller[APICollectionsClientOnboardAzureAPIManagementAPIResponse], error)` +- New function `NewAzureDevOpsOrgsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AzureDevOpsOrgsClient, error)` +- New function `*AzureDevOpsOrgsClient.BeginCreateOrUpdate(context.Context, string, string, string, AzureDevOpsOrg, *AzureDevOpsOrgsClientBeginCreateOrUpdateOptions) (*runtime.Poller[AzureDevOpsOrgsClientCreateOrUpdateResponse], error)` +- New function `*AzureDevOpsOrgsClient.Get(context.Context, string, string, string, *AzureDevOpsOrgsClientGetOptions) (AzureDevOpsOrgsClientGetResponse, error)` +- New function `*AzureDevOpsOrgsClient.ListAvailable(context.Context, string, string, *AzureDevOpsOrgsClientListAvailableOptions) (AzureDevOpsOrgsClientListAvailableResponse, error)` +- New function `*AzureDevOpsOrgsClient.NewListPager(string, string, *AzureDevOpsOrgsClientListOptions) *runtime.Pager[AzureDevOpsOrgsClientListResponse]` +- New function `*AzureDevOpsOrgsClient.BeginUpdate(context.Context, string, string, string, AzureDevOpsOrg, *AzureDevOpsOrgsClientBeginUpdateOptions) (*runtime.Poller[AzureDevOpsOrgsClientUpdateResponse], error)` +- New function `NewAzureDevOpsProjectsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AzureDevOpsProjectsClient, error)` +- New function `*AzureDevOpsProjectsClient.BeginCreateOrUpdate(context.Context, string, string, string, string, AzureDevOpsProject, *AzureDevOpsProjectsClientBeginCreateOrUpdateOptions) (*runtime.Poller[AzureDevOpsProjectsClientCreateOrUpdateResponse], error)` +- New function `*AzureDevOpsProjectsClient.Get(context.Context, string, string, string, string, *AzureDevOpsProjectsClientGetOptions) (AzureDevOpsProjectsClientGetResponse, error)` +- New function `*AzureDevOpsProjectsClient.NewListPager(string, string, string, *AzureDevOpsProjectsClientListOptions) *runtime.Pager[AzureDevOpsProjectsClientListResponse]` +- New function `*AzureDevOpsProjectsClient.BeginUpdate(context.Context, string, string, string, string, AzureDevOpsProject, *AzureDevOpsProjectsClientBeginUpdateOptions) (*runtime.Poller[AzureDevOpsProjectsClientUpdateResponse], error)` +- New function `NewAzureDevOpsReposClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AzureDevOpsReposClient, error)` +- New function `*AzureDevOpsReposClient.BeginCreateOrUpdate(context.Context, string, string, string, string, string, AzureDevOpsRepository, *AzureDevOpsReposClientBeginCreateOrUpdateOptions) (*runtime.Poller[AzureDevOpsReposClientCreateOrUpdateResponse], error)` +- New function `*AzureDevOpsReposClient.Get(context.Context, string, string, string, string, string, *AzureDevOpsReposClientGetOptions) (AzureDevOpsReposClientGetResponse, error)` +- New function `*AzureDevOpsReposClient.NewListPager(string, string, string, string, *AzureDevOpsReposClientListOptions) *runtime.Pager[AzureDevOpsReposClientListResponse]` +- New function `*AzureDevOpsReposClient.BeginUpdate(context.Context, string, string, string, string, string, AzureDevOpsRepository, *AzureDevOpsReposClientBeginUpdateOptions) (*runtime.Poller[AzureDevOpsReposClientUpdateResponse], error)` +- New function `*AzureServersSetting.GetServerVulnerabilityAssessmentsSetting() *ServerVulnerabilityAssessmentsSetting` +- New function `*ClientFactory.NewAPICollectionsClient() *APICollectionsClient` +- New function `*ClientFactory.NewAzureDevOpsOrgsClient() *AzureDevOpsOrgsClient` +- New function `*ClientFactory.NewAzureDevOpsProjectsClient() *AzureDevOpsProjectsClient` +- New function `*ClientFactory.NewAzureDevOpsReposClient() *AzureDevOpsReposClient` +- New function `*ClientFactory.NewDefenderForStorageClient() *DefenderForStorageClient` +- New function `*ClientFactory.NewDevOpsConfigurationsClient() *DevOpsConfigurationsClient` +- New function `*ClientFactory.NewDevOpsOperationResultsClient() *DevOpsOperationResultsClient` +- New function `*ClientFactory.NewGitHubOwnersClient() *GitHubOwnersClient` +- New function `*ClientFactory.NewGitHubReposClient() *GitHubReposClient` +- New function `*ClientFactory.NewGitLabGroupsClient() *GitLabGroupsClient` +- New function `*ClientFactory.NewGitLabProjectsClient() *GitLabProjectsClient` +- New function `*ClientFactory.NewGitLabSubgroupsClient() *GitLabSubgroupsClient` +- New function `*ClientFactory.NewServerVulnerabilityAssessmentsSettingsClient() *ServerVulnerabilityAssessmentsSettingsClient` +- New function `NewDefenderForStorageClient(azcore.TokenCredential, *arm.ClientOptions) (*DefenderForStorageClient, error)` +- New function `*DefenderForStorageClient.Create(context.Context, string, SettingNameAutoGenerated, DefenderForStorageSetting, *DefenderForStorageClientCreateOptions) (DefenderForStorageClientCreateResponse, error)` +- New function `*DefenderForStorageClient.Get(context.Context, string, SettingNameAutoGenerated, *DefenderForStorageClientGetOptions) (DefenderForStorageClientGetResponse, error)` +- New function `NewDevOpsConfigurationsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DevOpsConfigurationsClient, error)` +- New function `*DevOpsConfigurationsClient.BeginCreateOrUpdate(context.Context, string, string, DevOpsConfiguration, *DevOpsConfigurationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DevOpsConfigurationsClientCreateOrUpdateResponse], error)` +- New function `*DevOpsConfigurationsClient.BeginDelete(context.Context, string, string, *DevOpsConfigurationsClientBeginDeleteOptions) (*runtime.Poller[DevOpsConfigurationsClientDeleteResponse], error)` +- New function `*DevOpsConfigurationsClient.Get(context.Context, string, string, *DevOpsConfigurationsClientGetOptions) (DevOpsConfigurationsClientGetResponse, error)` +- New function `*DevOpsConfigurationsClient.NewListPager(string, string, *DevOpsConfigurationsClientListOptions) *runtime.Pager[DevOpsConfigurationsClientListResponse]` +- New function `*DevOpsConfigurationsClient.BeginUpdate(context.Context, string, string, DevOpsConfiguration, *DevOpsConfigurationsClientBeginUpdateOptions) (*runtime.Poller[DevOpsConfigurationsClientUpdateResponse], error)` +- New function `NewDevOpsOperationResultsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DevOpsOperationResultsClient, error)` +- New function `*DevOpsOperationResultsClient.Get(context.Context, string, string, string, *DevOpsOperationResultsClientGetOptions) (DevOpsOperationResultsClientGetResponse, error)` +- New function `NewGitHubOwnersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*GitHubOwnersClient, error)` +- New function `*GitHubOwnersClient.Get(context.Context, string, string, string, *GitHubOwnersClientGetOptions) (GitHubOwnersClientGetResponse, error)` +- New function `*GitHubOwnersClient.ListAvailable(context.Context, string, string, *GitHubOwnersClientListAvailableOptions) (GitHubOwnersClientListAvailableResponse, error)` +- New function `*GitHubOwnersClient.NewListPager(string, string, *GitHubOwnersClientListOptions) *runtime.Pager[GitHubOwnersClientListResponse]` +- New function `NewGitHubReposClient(string, azcore.TokenCredential, *arm.ClientOptions) (*GitHubReposClient, error)` +- New function `*GitHubReposClient.Get(context.Context, string, string, string, string, *GitHubReposClientGetOptions) (GitHubReposClientGetResponse, error)` +- New function `*GitHubReposClient.NewListPager(string, string, string, *GitHubReposClientListOptions) *runtime.Pager[GitHubReposClientListResponse]` +- New function `NewGitLabGroupsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*GitLabGroupsClient, error)` +- New function `*GitLabGroupsClient.Get(context.Context, string, string, string, *GitLabGroupsClientGetOptions) (GitLabGroupsClientGetResponse, error)` +- New function `*GitLabGroupsClient.ListAvailable(context.Context, string, string, *GitLabGroupsClientListAvailableOptions) (GitLabGroupsClientListAvailableResponse, error)` +- New function `*GitLabGroupsClient.NewListPager(string, string, *GitLabGroupsClientListOptions) *runtime.Pager[GitLabGroupsClientListResponse]` +- New function `NewGitLabProjectsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*GitLabProjectsClient, error)` +- New function `*GitLabProjectsClient.Get(context.Context, string, string, string, string, *GitLabProjectsClientGetOptions) (GitLabProjectsClientGetResponse, error)` +- New function `*GitLabProjectsClient.NewListPager(string, string, string, *GitLabProjectsClientListOptions) *runtime.Pager[GitLabProjectsClientListResponse]` +- New function `NewGitLabSubgroupsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*GitLabSubgroupsClient, error)` +- New function `*GitLabSubgroupsClient.List(context.Context, string, string, string, *GitLabSubgroupsClientListOptions) (GitLabSubgroupsClientListResponse, error)` +- New function `*HealthReportsClient.Get(context.Context, string, string, *HealthReportsClientGetOptions) (HealthReportsClientGetResponse, error)` +- New function `*ServerVulnerabilityAssessmentsSetting.GetServerVulnerabilityAssessmentsSetting() *ServerVulnerabilityAssessmentsSetting` +- New function `NewServerVulnerabilityAssessmentsSettingsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ServerVulnerabilityAssessmentsSettingsClient, error)` +- New function `*ServerVulnerabilityAssessmentsSettingsClient.CreateOrUpdate(context.Context, ServerVulnerabilityAssessmentsSettingKindName, ServerVulnerabilityAssessmentsSettingClassification, *ServerVulnerabilityAssessmentsSettingsClientCreateOrUpdateOptions) (ServerVulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse, error)` +- New function `*ServerVulnerabilityAssessmentsSettingsClient.Delete(context.Context, ServerVulnerabilityAssessmentsSettingKindName, *ServerVulnerabilityAssessmentsSettingsClientDeleteOptions) (ServerVulnerabilityAssessmentsSettingsClientDeleteResponse, error)` +- New function `*ServerVulnerabilityAssessmentsSettingsClient.Get(context.Context, ServerVulnerabilityAssessmentsSettingKindName, *ServerVulnerabilityAssessmentsSettingsClientGetOptions) (ServerVulnerabilityAssessmentsSettingsClientGetResponse, error)` +- New function `*ServerVulnerabilityAssessmentsSettingsClient.NewListBySubscriptionPager(*ServerVulnerabilityAssessmentsSettingsClientListBySubscriptionOptions) *runtime.Pager[ServerVulnerabilityAssessmentsSettingsClientListBySubscriptionResponse]` +- New struct `APICollection` +- New struct `APICollectionList` +- New struct `ActionableRemediation` +- New struct `Authorization` +- New struct `AzureDevOpsOrg` +- New struct `AzureDevOpsOrgListResponse` +- New struct `AzureDevOpsOrgProperties` +- New struct `AzureDevOpsOrganizationConfiguration` +- New struct `AzureDevOpsProject` +- New struct `AzureDevOpsProjectConfiguration` +- New struct `AzureDevOpsProjectListResponse` +- New struct `AzureDevOpsProjectProperties` +- New struct `AzureDevOpsRepository` +- New struct `AzureDevOpsRepositoryListResponse` +- New struct `AzureDevOpsRepositoryProperties` +- New struct `AzureServersSetting` +- New struct `BaseResourceConfiguration` +- New struct `CategoryConfiguration` +- New struct `DefenderCspmAwsOfferingCiem` +- New struct `DefenderCspmAwsOfferingCiemDiscovery` +- New struct `DefenderCspmAwsOfferingCiemOidc` +- New struct `DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S` +- New struct `DefenderCspmAwsOfferingMdcContainersImageAssessment` +- New struct `DefenderCspmGcpOfferingCiemDiscovery` +- New struct `DefenderCspmGcpOfferingDataSensitivityDiscovery` +- New struct `DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S` +- New struct `DefenderCspmGcpOfferingMdcContainersImageAssessment` +- New struct `DefenderCspmGcpOfferingVMScanners` +- New struct `DefenderCspmGcpOfferingVMScannersConfiguration` +- New struct `DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S` +- New struct `DefenderForContainersAwsOfferingMdcContainersImageAssessment` +- New struct `DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S` +- New struct `DefenderForContainersGcpOfferingMdcContainersImageAssessment` +- New struct `DefenderForStorageSetting` +- New struct `DefenderForStorageSettingProperties` +- New struct `DevOpsConfiguration` +- New struct `DevOpsConfigurationListResponse` +- New struct `DevOpsConfigurationProperties` +- New struct `GitHubOwner` +- New struct `GitHubOwnerConfiguration` +- New struct `GitHubOwnerListResponse` +- New struct `GitHubOwnerProperties` +- New struct `GitHubRepository` +- New struct `GitHubRepositoryListResponse` +- New struct `GitHubRepositoryProperties` +- New struct `GitLabGroup` +- New struct `GitLabGroupConfiguration` +- New struct `GitLabGroupListResponse` +- New struct `GitLabGroupProperties` +- New struct `GitLabProject` +- New struct `GitLabProjectListResponse` +- New struct `GitLabProjectProperties` +- New struct `MalwareScanningProperties` +- New struct `OnUploadProperties` +- New struct `OperationStatusAutoGenerated` +- New struct `OperationStatusResult` +- New struct `ProxyResource` +- New struct `ResourceAutoGenerated` +- New struct `ResourceAutoGenerated2` +- New struct `SensitiveDataDiscoveryProperties` +- New struct `ServerVulnerabilityAssessmentsAzureSettingProperties` +- New struct `ServerVulnerabilityAssessmentsSettingsList` +- New struct `TargetBranchConfiguration` +- New field `BaseURL`, `DiscoveredVia`, `NumberOfAPIEndpoints`, `NumberOfAPIEndpointsWithSensitiveDataExposed`, `NumberOfExternalAPIEndpoints`, `NumberOfInactiveAPIEndpoints`, `NumberOfUnauthenticatedAPIEndpoints`, `ProvisioningState`, `SensitivityLabel` in struct `APICollectionProperties` +- New field `ScanInterval` in struct `AwsEnvironmentData` +- New field `Ciem`, `MdcContainersAgentlessDiscoveryK8S`, `MdcContainersImageAssessment` in struct `DefenderCspmAwsOffering` +- New field `CiemDiscovery`, `DataSensitivityDiscovery`, `MdcContainersAgentlessDiscoveryK8S`, `MdcContainersImageAssessment`, `VMScanners` in struct `DefenderCspmGcpOffering` +- New field `MdcContainersAgentlessDiscoveryK8S`, `MdcContainersImageAssessment` in struct `DefenderForContainersAwsOffering` +- New field `MdcContainersAgentlessDiscoveryK8S`, `MdcContainersImageAssessment` in struct `DefenderForContainersGcpOffering` +- New field `ScanInterval` in struct `GcpProjectEnvironmentData` +- New field `AffectedDefendersSubPlans`, `ReportAdditionalData` in struct `HealthReportProperties` +- New field `LastScannedDate`, `Reason` in struct `StatusAutoGenerated` + + ## 0.11.0 (2023-04-28) ### Breaking Changes diff --git a/sdk/resourcemanager/security/armsecurity/accountconnectors_client.go b/sdk/resourcemanager/security/armsecurity/accountconnectors_client.go index 0fb13535b1b4..d316013eb841 100644 --- a/sdk/resourcemanager/security/armsecurity/accountconnectors_client.go +++ b/sdk/resourcemanager/security/armsecurity/accountconnectors_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -55,18 +54,21 @@ func NewAccountConnectorsClient(subscriptionID string, credential azcore.TokenCr // - options - AccountConnectorsClientCreateOrUpdateOptions contains the optional parameters for the AccountConnectorsClient.CreateOrUpdate // method. func (client *AccountConnectorsClient) CreateOrUpdate(ctx context.Context, connectorName string, connectorSetting ConnectorSetting, options *AccountConnectorsClientCreateOrUpdateOptions) (AccountConnectorsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, connectorName, connectorSetting, options) if err != nil { return AccountConnectorsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AccountConnectorsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AccountConnectorsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AccountConnectorsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -88,7 +90,10 @@ func (client *AccountConnectorsClient) createOrUpdateCreateRequest(ctx context.C reqQP.Set("api-version", "2020-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, connectorSetting) + if err := runtime.MarshalAsJSON(req, connectorSetting); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -108,16 +113,18 @@ func (client *AccountConnectorsClient) createOrUpdateHandleResponse(resp *http.R // - options - AccountConnectorsClientDeleteOptions contains the optional parameters for the AccountConnectorsClient.Delete // method. func (client *AccountConnectorsClient) Delete(ctx context.Context, connectorName string, options *AccountConnectorsClientDeleteOptions) (AccountConnectorsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, connectorName, options) if err != nil { return AccountConnectorsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AccountConnectorsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return AccountConnectorsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return AccountConnectorsClientDeleteResponse{}, err } return AccountConnectorsClientDeleteResponse{}, nil } @@ -151,18 +158,21 @@ func (client *AccountConnectorsClient) deleteCreateRequest(ctx context.Context, // - connectorName - Name of the cloud account connector // - options - AccountConnectorsClientGetOptions contains the optional parameters for the AccountConnectorsClient.Get method. func (client *AccountConnectorsClient) Get(ctx context.Context, connectorName string, options *AccountConnectorsClientGetOptions) (AccountConnectorsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, connectorName, options) if err != nil { return AccountConnectorsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AccountConnectorsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AccountConnectorsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AccountConnectorsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 986c43b60652..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/CreateUpdateAwsCredConnectorSubscription_example.json -func ExampleAccountConnectorsClient_CreateOrUpdate_awsCredCreateACloudAccountConnectorForASubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAccountConnectorsClient().CreateOrUpdate(ctx, "aws_dev1", armsecurity.ConnectorSetting{ - Properties: &armsecurity.ConnectorSettingProperties{ - AuthenticationDetails: &armsecurity.AwsCredsAuthenticationDetailsProperties{ - AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeAwsCreds), - AwsAccessKeyID: to.Ptr("AKIARPZCNODDNAEQFSOE"), - AwsSecretAccessKey: to.Ptr(""), - }, - HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - ProxyServer: &armsecurity.ProxyServerProperties{ - IP: to.Ptr("167.220.197.140"), - Port: to.Ptr("34"), - }, - Region: to.Ptr("West US 2"), - ResourceGroupName: to.Ptr("AwsConnectorRG"), - ServicePrincipal: &armsecurity.ServicePrincipalProperties{ - ApplicationID: to.Ptr("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1"), - Secret: to.Ptr(""), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectorSetting = armsecurity.ConnectorSetting{ - // Name: to.Ptr("aws_dev1"), - // Type: to.Ptr("Microsoft.Security/connectors"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/connectors/aws_dev1"), - // Properties: &armsecurity.ConnectorSettingProperties{ - // AuthenticationDetails: &armsecurity.AwsCredsAuthenticationDetailsProperties{ - // AuthenticationProvisioningState: to.Ptr(armsecurity.AuthenticationProvisioningStateValid), - // AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeAwsCreds), - // GrantedPermissions: []*armsecurity.PermissionProperty{ - // to.Ptr(armsecurity.PermissionPropertyAWSAWSSecurityHubReadOnlyAccess), - // to.Ptr(armsecurity.PermissionPropertyAWSSecurityAudit), - // to.Ptr(armsecurity.PermissionPropertyAWSAmazonSSMAutomationRole)}, - // AccountID: to.Ptr("922315681122"), - // AwsAccessKeyID: to.Ptr(""), - // AwsSecretAccessKey: to.Ptr(""), - // }, - // HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - // AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - // HybridComputeProvisioningState: to.Ptr(armsecurity.HybridComputeProvisioningStateValid), - // ProxyServer: &armsecurity.ProxyServerProperties{ - // IP: to.Ptr("287.221.107.152"), - // Port: to.Ptr("34"), - // }, - // Region: to.Ptr("West US 2"), - // ResourceGroupName: to.Ptr("AwsConnectorRG"), - // ServicePrincipal: &armsecurity.ServicePrincipalProperties{ - // ApplicationID: to.Ptr("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1"), - // }, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 index 38a9f78ce371..542b7dd11a16 100644 --- a/sdk/resourcemanager/security/armsecurity/adaptiveapplicationcontrols_client.go +++ b/sdk/resourcemanager/security/armsecurity/adaptiveapplicationcontrols_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -54,16 +53,18 @@ func NewAdaptiveApplicationControlsClient(subscriptionID string, credential azco // - 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 req, err := client.deleteCreateRequest(ctx, ascLocation, groupName, options) if err != nil { return AdaptiveApplicationControlsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AdaptiveApplicationControlsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return AdaptiveApplicationControlsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return AdaptiveApplicationControlsClientDeleteResponse{}, err } return AdaptiveApplicationControlsClientDeleteResponse{}, nil } @@ -103,18 +104,21 @@ func (client *AdaptiveApplicationControlsClient) deleteCreateRequest(ctx context // - 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 req, err := client.getCreateRequest(ctx, ascLocation, groupName, options) if err != nil { return AdaptiveApplicationControlsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AdaptiveApplicationControlsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AdaptiveApplicationControlsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AdaptiveApplicationControlsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -159,18 +163,21 @@ func (client *AdaptiveApplicationControlsClient) getHandleResponse(resp *http.Re // - 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 req, err := client.listCreateRequest(ctx, options) if err != nil { return AdaptiveApplicationControlsClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AdaptiveApplicationControlsClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AdaptiveApplicationControlsClientListResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AdaptiveApplicationControlsClientListResponse{}, err } - return client.listHandleResponse(resp) + resp, err := client.listHandleResponse(httpResp) + return resp, err } // listCreateRequest creates the List request. @@ -215,18 +222,21 @@ func (client *AdaptiveApplicationControlsClient) listHandleResponse(resp *http.R // - 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 req, err := client.putCreateRequest(ctx, ascLocation, groupName, body, options) if err != nil { return AdaptiveApplicationControlsClientPutResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AdaptiveApplicationControlsClientPutResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AdaptiveApplicationControlsClientPutResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AdaptiveApplicationControlsClientPutResponse{}, err } - return client.putHandleResponse(resp) + resp, err := client.putHandleResponse(httpResp) + return resp, err } // putCreateRequest creates the Put request. @@ -252,7 +262,10 @@ func (client *AdaptiveApplicationControlsClient) putCreateRequest(ctx context.Co reqQP.Set("api-version", "2020-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // putHandleResponse handles the Put response. 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 0e11e6310b2f..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 index ddb91e7baca0..5a115826c4e4 100644 --- a/sdk/resourcemanager/security/armsecurity/adaptivenetworkhardenings_client.go +++ b/sdk/resourcemanager/security/armsecurity/adaptivenetworkhardenings_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -61,7 +60,8 @@ func (client *AdaptiveNetworkHardeningsClient) BeginEnforce(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[AdaptiveNetworkHardeningsClientEnforceResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[AdaptiveNetworkHardeningsClientEnforceResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[AdaptiveNetworkHardeningsClientEnforceResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -72,18 +72,20 @@ func (client *AdaptiveNetworkHardeningsClient) BeginEnforce(ctx context.Context, // // 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 req, err := client.enforceCreateRequest(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, body, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // enforceCreateRequest creates the Enforce request. @@ -122,7 +124,10 @@ func (client *AdaptiveNetworkHardeningsClient) enforceCreateRequest(ctx context. reqQP.Set("api-version", "2020-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // Get - Gets a single Adaptive Network Hardening resource @@ -137,18 +142,21 @@ func (client *AdaptiveNetworkHardeningsClient) enforceCreateRequest(ctx context. // - 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 req, err := client.getCreateRequest(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, options) if err != nil { return AdaptiveNetworkHardeningsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AdaptiveNetworkHardeningsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AdaptiveNetworkHardeningsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AdaptiveNetworkHardeningsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 48ac10c027eb..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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/ListByExtendedResourceAdaptiveNetworkHardenings_example.json -func ExampleAdaptiveNetworkHardeningsClient_NewListByExtendedResourcePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAdaptiveNetworkHardeningsClient().NewListByExtendedResourcePager("rg1", "Microsoft.Compute", "virtualMachines", "vm1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AdaptiveNetworkHardeningsList = armsecurity.AdaptiveNetworkHardeningsList{ - // Value: []*armsecurity.AdaptiveNetworkHardening{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/adaptiveNetworkHardenings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Security/adaptiveNetworkHardenings/default"), - // Properties: &armsecurity.AdaptiveNetworkHardeningProperties{ - // EffectiveNetworkSecurityGroups: []*armsecurity.EffectiveNetworkSecurityGroups{ - // { - // NetworkInterface: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/rg1/providers/Microsoft.Network/networkInterfaces/nic1"), - // NetworkSecurityGroups: []*string{ - // to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nicNsg"), - // to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/subnetNsg")}, - // }, - // { - // NetworkInterface: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/rg1/providers/Microsoft.Network/networkInterfaces/nic2"), - // NetworkSecurityGroups: []*string{ - // to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nicNsg2")}, - // }}, - // Rules: []*armsecurity.Rule{ - // { - // Name: to.Ptr("rule1"), - // DestinationPort: to.Ptr[int32](3389), - // Direction: to.Ptr(armsecurity.DirectionInbound), - // IPAddresses: []*string{ - // to.Ptr("100.10.1.1"), - // to.Ptr("200.20.2.2"), - // to.Ptr("81.199.3.0/24")}, - // Protocols: []*armsecurity.TransportProtocol{ - // to.Ptr(armsecurity.TransportProtocolTCP)}, - // }, - // { - // Name: to.Ptr("rule2"), - // DestinationPort: to.Ptr[int32](22), - // Direction: to.Ptr(armsecurity.DirectionInbound), - // IPAddresses: []*string{ - // }, - // Protocols: []*armsecurity.TransportProtocol{ - // to.Ptr(armsecurity.TransportProtocolTCP)}, - // }}, - // RulesCalculationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-15T00:00:00.0000000Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/GetAdaptiveNetworkHardening_example.json -func ExampleAdaptiveNetworkHardeningsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAdaptiveNetworkHardeningsClient().Get(ctx, "rg1", "Microsoft.Compute", "virtualMachines", "vm1", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AdaptiveNetworkHardening = armsecurity.AdaptiveNetworkHardening{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/adaptiveNetworkHardenings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1/providers/Microsoft.Security/adaptiveNetworkHardenings/default"), - // Properties: &armsecurity.AdaptiveNetworkHardeningProperties{ - // EffectiveNetworkSecurityGroups: []*armsecurity.EffectiveNetworkSecurityGroups{ - // { - // NetworkInterface: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/rg1/providers/Microsoft.Network/networkInterfaces/nic1"), - // NetworkSecurityGroups: []*string{ - // to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nicNsg"), - // to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/subnetNsg")}, - // }, - // { - // NetworkInterface: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/rg2/providers/Microsoft.Network/networkInterfaces/nic2"), - // NetworkSecurityGroups: []*string{ - // to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nicNsg")}, - // }}, - // Rules: []*armsecurity.Rule{ - // { - // Name: to.Ptr("rule1"), - // DestinationPort: to.Ptr[int32](3389), - // Direction: to.Ptr(armsecurity.DirectionInbound), - // IPAddresses: []*string{ - // to.Ptr("100.10.1.1"), - // to.Ptr("200.20.2.2"), - // to.Ptr("81.199.3.0/24")}, - // Protocols: []*armsecurity.TransportProtocol{ - // to.Ptr(armsecurity.TransportProtocolTCP)}, - // }, - // { - // Name: to.Ptr("rule2"), - // DestinationPort: to.Ptr[int32](22), - // Direction: to.Ptr(armsecurity.DirectionInbound), - // IPAddresses: []*string{ - // }, - // Protocols: []*armsecurity.TransportProtocol{ - // to.Ptr(armsecurity.TransportProtocolTCP)}, - // }}, - // RulesCalculationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-15T00:00:00.0000000Z"); return t}()), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/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 77f1b1dc0085..669539b4e4c2 100644 --- a/sdk/resourcemanager/security/armsecurity/advancedthreatprotection_client.go +++ b/sdk/resourcemanager/security/armsecurity/advancedthreatprotection_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -49,18 +48,21 @@ func NewAdvancedThreatProtectionClient(credential azcore.TokenCredential, option // - options - AdvancedThreatProtectionClientCreateOptions contains the optional parameters for the AdvancedThreatProtectionClient.Create // method. func (client *AdvancedThreatProtectionClient) Create(ctx context.Context, resourceID string, advancedThreatProtectionSetting AdvancedThreatProtectionSetting, options *AdvancedThreatProtectionClientCreateOptions) (AdvancedThreatProtectionClientCreateResponse, error) { + var err error req, err := client.createCreateRequest(ctx, resourceID, advancedThreatProtectionSetting, options) if err != nil { return AdvancedThreatProtectionClientCreateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AdvancedThreatProtectionClientCreateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AdvancedThreatProtectionClientCreateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AdvancedThreatProtectionClientCreateResponse{}, err } - return client.createHandleResponse(resp) + resp, err := client.createHandleResponse(httpResp) + return resp, err } // createCreateRequest creates the Create request. @@ -76,7 +78,10 @@ func (client *AdvancedThreatProtectionClient) createCreateRequest(ctx context.Co reqQP.Set("api-version", "2019-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, advancedThreatProtectionSetting) + if err := runtime.MarshalAsJSON(req, advancedThreatProtectionSetting); err != nil { + return nil, err + } + return req, nil } // createHandleResponse handles the Create response. @@ -96,18 +101,21 @@ func (client *AdvancedThreatProtectionClient) createHandleResponse(resp *http.Re // - options - AdvancedThreatProtectionClientGetOptions contains the optional parameters for the AdvancedThreatProtectionClient.Get // method. func (client *AdvancedThreatProtectionClient) Get(ctx context.Context, resourceID string, options *AdvancedThreatProtectionClientGetOptions) (AdvancedThreatProtectionClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceID, options) if err != nil { return AdvancedThreatProtectionClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AdvancedThreatProtectionClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AdvancedThreatProtectionClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AdvancedThreatProtectionClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 8da6ba0b122c..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 ff92fdafd2a7..07a164a0dfd5 100644 --- a/sdk/resourcemanager/security/armsecurity/alerts_client.go +++ b/sdk/resourcemanager/security/armsecurity/alerts_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -54,18 +53,21 @@ func NewAlertsClient(subscriptionID string, credential azcore.TokenCredential, o // - options - AlertsClientGetResourceGroupLevelOptions contains the optional parameters for the AlertsClient.GetResourceGroupLevel // method. func (client *AlertsClient) GetResourceGroupLevel(ctx context.Context, resourceGroupName string, ascLocation string, alertName string, options *AlertsClientGetResourceGroupLevelOptions) (AlertsClientGetResourceGroupLevelResponse, error) { + var err error req, err := client.getResourceGroupLevelCreateRequest(ctx, resourceGroupName, ascLocation, alertName, options) if err != nil { return AlertsClientGetResourceGroupLevelResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AlertsClientGetResourceGroupLevelResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AlertsClientGetResourceGroupLevelResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AlertsClientGetResourceGroupLevelResponse{}, err } - return client.getResourceGroupLevelHandleResponse(resp) + resp, err := client.getResourceGroupLevelHandleResponse(httpResp) + return resp, err } // getResourceGroupLevelCreateRequest creates the GetResourceGroupLevel request. @@ -116,18 +118,21 @@ func (client *AlertsClient) getResourceGroupLevelHandleResponse(resp *http.Respo // - options - AlertsClientGetSubscriptionLevelOptions contains the optional parameters for the AlertsClient.GetSubscriptionLevel // method. func (client *AlertsClient) GetSubscriptionLevel(ctx context.Context, ascLocation string, alertName string, options *AlertsClientGetSubscriptionLevelOptions) (AlertsClientGetSubscriptionLevelResponse, error) { + var err error req, err := client.getSubscriptionLevelCreateRequest(ctx, ascLocation, alertName, options) if err != nil { return AlertsClientGetSubscriptionLevelResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AlertsClientGetSubscriptionLevelResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AlertsClientGetSubscriptionLevelResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AlertsClientGetSubscriptionLevelResponse{}, err } - return client.getSubscriptionLevelHandleResponse(resp) + resp, err := client.getSubscriptionLevelHandleResponse(httpResp) + return resp, err } // getSubscriptionLevelCreateRequest creates the GetSubscriptionLevel request. @@ -439,9 +444,10 @@ func (client *AlertsClient) BeginSimulate(ctx context.Context, ascLocation strin if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AlertsClientSimulateResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AlertsClientSimulateResponse]{ FinalStateVia: runtime.FinalStateViaOriginalURI, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[AlertsClientSimulateResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -452,18 +458,20 @@ func (client *AlertsClient) BeginSimulate(ctx context.Context, ascLocation strin // // Generated from API version 2022-01-01 func (client *AlertsClient) simulate(ctx context.Context, ascLocation string, alertSimulatorRequestBody AlertSimulatorRequestBody, options *AlertsClientBeginSimulateOptions) (*http.Response, error) { + var err error req, err := client.simulateCreateRequest(ctx, ascLocation, alertSimulatorRequestBody, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // simulateCreateRequest creates the Simulate request. @@ -485,7 +493,10 @@ func (client *AlertsClient) simulateCreateRequest(ctx context.Context, ascLocati reqQP.Set("api-version", "2022-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, alertSimulatorRequestBody) + if err := runtime.MarshalAsJSON(req, alertSimulatorRequestBody); err != nil { + return nil, err + } + return req, nil } // UpdateResourceGroupLevelStateToActivate - Update the alert's state @@ -498,16 +509,18 @@ func (client *AlertsClient) simulateCreateRequest(ctx context.Context, ascLocati // - options - AlertsClientUpdateResourceGroupLevelStateToActivateOptions contains the optional parameters for the AlertsClient.UpdateResourceGroupLevelStateToActivate // method. func (client *AlertsClient) UpdateResourceGroupLevelStateToActivate(ctx context.Context, resourceGroupName string, ascLocation string, alertName string, options *AlertsClientUpdateResourceGroupLevelStateToActivateOptions) (AlertsClientUpdateResourceGroupLevelStateToActivateResponse, error) { + var err error req, err := client.updateResourceGroupLevelStateToActivateCreateRequest(ctx, resourceGroupName, ascLocation, alertName, options) if err != nil { return AlertsClientUpdateResourceGroupLevelStateToActivateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AlertsClientUpdateResourceGroupLevelStateToActivateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return AlertsClientUpdateResourceGroupLevelStateToActivateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return AlertsClientUpdateResourceGroupLevelStateToActivateResponse{}, err } return AlertsClientUpdateResourceGroupLevelStateToActivateResponse{}, nil } @@ -552,16 +565,18 @@ func (client *AlertsClient) updateResourceGroupLevelStateToActivateCreateRequest // - options - AlertsClientUpdateResourceGroupLevelStateToDismissOptions contains the optional parameters for the AlertsClient.UpdateResourceGroupLevelStateToDismiss // method. func (client *AlertsClient) UpdateResourceGroupLevelStateToDismiss(ctx context.Context, resourceGroupName string, ascLocation string, alertName string, options *AlertsClientUpdateResourceGroupLevelStateToDismissOptions) (AlertsClientUpdateResourceGroupLevelStateToDismissResponse, error) { + var err error req, err := client.updateResourceGroupLevelStateToDismissCreateRequest(ctx, resourceGroupName, ascLocation, alertName, options) if err != nil { return AlertsClientUpdateResourceGroupLevelStateToDismissResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AlertsClientUpdateResourceGroupLevelStateToDismissResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return AlertsClientUpdateResourceGroupLevelStateToDismissResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return AlertsClientUpdateResourceGroupLevelStateToDismissResponse{}, err } return AlertsClientUpdateResourceGroupLevelStateToDismissResponse{}, nil } @@ -606,16 +621,18 @@ func (client *AlertsClient) updateResourceGroupLevelStateToDismissCreateRequest( // - options - AlertsClientUpdateResourceGroupLevelStateToInProgressOptions contains the optional parameters for the AlertsClient.UpdateResourceGroupLevelStateToInProgress // method. func (client *AlertsClient) UpdateResourceGroupLevelStateToInProgress(ctx context.Context, resourceGroupName string, ascLocation string, alertName string, options *AlertsClientUpdateResourceGroupLevelStateToInProgressOptions) (AlertsClientUpdateResourceGroupLevelStateToInProgressResponse, error) { + var err error req, err := client.updateResourceGroupLevelStateToInProgressCreateRequest(ctx, resourceGroupName, ascLocation, alertName, options) if err != nil { return AlertsClientUpdateResourceGroupLevelStateToInProgressResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AlertsClientUpdateResourceGroupLevelStateToInProgressResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return AlertsClientUpdateResourceGroupLevelStateToInProgressResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return AlertsClientUpdateResourceGroupLevelStateToInProgressResponse{}, err } return AlertsClientUpdateResourceGroupLevelStateToInProgressResponse{}, nil } @@ -660,16 +677,18 @@ func (client *AlertsClient) updateResourceGroupLevelStateToInProgressCreateReque // - options - AlertsClientUpdateResourceGroupLevelStateToResolveOptions contains the optional parameters for the AlertsClient.UpdateResourceGroupLevelStateToResolve // method. func (client *AlertsClient) UpdateResourceGroupLevelStateToResolve(ctx context.Context, resourceGroupName string, ascLocation string, alertName string, options *AlertsClientUpdateResourceGroupLevelStateToResolveOptions) (AlertsClientUpdateResourceGroupLevelStateToResolveResponse, error) { + var err error req, err := client.updateResourceGroupLevelStateToResolveCreateRequest(ctx, resourceGroupName, ascLocation, alertName, options) if err != nil { return AlertsClientUpdateResourceGroupLevelStateToResolveResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AlertsClientUpdateResourceGroupLevelStateToResolveResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return AlertsClientUpdateResourceGroupLevelStateToResolveResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return AlertsClientUpdateResourceGroupLevelStateToResolveResponse{}, err } return AlertsClientUpdateResourceGroupLevelStateToResolveResponse{}, nil } @@ -713,16 +732,18 @@ func (client *AlertsClient) updateResourceGroupLevelStateToResolveCreateRequest( // - options - AlertsClientUpdateSubscriptionLevelStateToActivateOptions contains the optional parameters for the AlertsClient.UpdateSubscriptionLevelStateToActivate // method. func (client *AlertsClient) UpdateSubscriptionLevelStateToActivate(ctx context.Context, ascLocation string, alertName string, options *AlertsClientUpdateSubscriptionLevelStateToActivateOptions) (AlertsClientUpdateSubscriptionLevelStateToActivateResponse, error) { + var err error req, err := client.updateSubscriptionLevelStateToActivateCreateRequest(ctx, ascLocation, alertName, options) if err != nil { return AlertsClientUpdateSubscriptionLevelStateToActivateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AlertsClientUpdateSubscriptionLevelStateToActivateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return AlertsClientUpdateSubscriptionLevelStateToActivateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return AlertsClientUpdateSubscriptionLevelStateToActivateResponse{}, err } return AlertsClientUpdateSubscriptionLevelStateToActivateResponse{}, nil } @@ -762,16 +783,18 @@ func (client *AlertsClient) updateSubscriptionLevelStateToActivateCreateRequest( // - options - AlertsClientUpdateSubscriptionLevelStateToDismissOptions contains the optional parameters for the AlertsClient.UpdateSubscriptionLevelStateToDismiss // method. func (client *AlertsClient) UpdateSubscriptionLevelStateToDismiss(ctx context.Context, ascLocation string, alertName string, options *AlertsClientUpdateSubscriptionLevelStateToDismissOptions) (AlertsClientUpdateSubscriptionLevelStateToDismissResponse, error) { + var err error req, err := client.updateSubscriptionLevelStateToDismissCreateRequest(ctx, ascLocation, alertName, options) if err != nil { return AlertsClientUpdateSubscriptionLevelStateToDismissResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AlertsClientUpdateSubscriptionLevelStateToDismissResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return AlertsClientUpdateSubscriptionLevelStateToDismissResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return AlertsClientUpdateSubscriptionLevelStateToDismissResponse{}, err } return AlertsClientUpdateSubscriptionLevelStateToDismissResponse{}, nil } @@ -811,16 +834,18 @@ func (client *AlertsClient) updateSubscriptionLevelStateToDismissCreateRequest(c // - options - AlertsClientUpdateSubscriptionLevelStateToInProgressOptions contains the optional parameters for the AlertsClient.UpdateSubscriptionLevelStateToInProgress // method. func (client *AlertsClient) UpdateSubscriptionLevelStateToInProgress(ctx context.Context, ascLocation string, alertName string, options *AlertsClientUpdateSubscriptionLevelStateToInProgressOptions) (AlertsClientUpdateSubscriptionLevelStateToInProgressResponse, error) { + var err error req, err := client.updateSubscriptionLevelStateToInProgressCreateRequest(ctx, ascLocation, alertName, options) if err != nil { return AlertsClientUpdateSubscriptionLevelStateToInProgressResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AlertsClientUpdateSubscriptionLevelStateToInProgressResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return AlertsClientUpdateSubscriptionLevelStateToInProgressResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return AlertsClientUpdateSubscriptionLevelStateToInProgressResponse{}, err } return AlertsClientUpdateSubscriptionLevelStateToInProgressResponse{}, nil } @@ -860,16 +885,18 @@ func (client *AlertsClient) updateSubscriptionLevelStateToInProgressCreateReques // - options - AlertsClientUpdateSubscriptionLevelStateToResolveOptions contains the optional parameters for the AlertsClient.UpdateSubscriptionLevelStateToResolve // method. func (client *AlertsClient) UpdateSubscriptionLevelStateToResolve(ctx context.Context, ascLocation string, alertName string, options *AlertsClientUpdateSubscriptionLevelStateToResolveOptions) (AlertsClientUpdateSubscriptionLevelStateToResolveResponse, error) { + var err error req, err := client.updateSubscriptionLevelStateToResolveCreateRequest(ctx, ascLocation, alertName, options) if err != nil { return AlertsClientUpdateSubscriptionLevelStateToResolveResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AlertsClientUpdateSubscriptionLevelStateToResolveResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return AlertsClientUpdateSubscriptionLevelStateToResolveResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return AlertsClientUpdateSubscriptionLevelStateToResolveResponse{}, err } return AlertsClientUpdateSubscriptionLevelStateToResolveResponse{}, nil } 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 214c303d6ecc..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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertsSubscription_example.json -func ExampleAlertsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAlertsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AlertList = armsecurity.AlertList{ - // Value: []*armsecurity.Alert{ - // { - // Name: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Type: to.Ptr("Microsoft.Security/Locations/alerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/alerts/2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA"), - // Properties: &armsecurity.AlertProperties{ - // Description: to.Ptr("This is a test alert generated by Azure Security Center. No further action is needed."), - // AlertDisplayName: to.Ptr("Azure Security Center test alert (not a threat)"), - // AlertType: to.Ptr("VM_EICAR"), - // AlertURI: to.Ptr("https://portal.azure.com/#blade/Microsoft_Azure_Security/AlertBlade/alertId/2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a/subscriptionId/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroup/myRg1/referencedFrom/alertDeepLink/location/westeurope"), - // CompromisedEntity: to.Ptr("vm1"), - // CorrelationKey: to.Ptr("kso0LFWxzCll5tqrk5hmrBJ+MY1BX806W6q6+0s9Lk="), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.0000000Z"); return t}()), - // Entities: []*armsecurity.AlertEntity{ - // { - // AdditionalProperties: map[string]any{ - // "address": "192.0.2.1", - // "location": map[string]any{ - // "asn": float64(6584), - // "city": "sonning", - // "countryCode": "gb", - // "latitude": float64(51.468), - // "longitude": float64(-0.909), - // "state": "wokingham", - // }, - // }, - // Type: to.Ptr("ip"), - // }}, - // ExtendedLinks: []map[string]*string{ - // map[string]*string{ - // "Category": to.Ptr("threat_reports"), - // "Href": to.Ptr("https://contoso.com/reports/DisplayReport"), - // "Label": to.Ptr("Report: RDP Brute Forcing"), - // "Type": to.Ptr("webLink"), - // }}, - // ExtendedProperties: map[string]*string{ - // "Property1": to.Ptr("Property1 information"), - // }, - // Intent: to.Ptr(armsecurity.IntentExecution), - // IsIncident: to.Ptr(true), - // ProcessingEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.9205584Z"); return t}()), - // ProductComponentName: to.Ptr("testName"), - // ProductName: to.Ptr("Azure Security Center"), - // RemediationSteps: []*string{ - // to.Ptr("No further action is needed.")}, - // ResourceIdentifiers: []armsecurity.ResourceIdentifierClassification{ - // &armsecurity.AzureResourceIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeAzureResource), - // AzureResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // &armsecurity.LogAnalyticsIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeLogAnalytics), - // AgentID: to.Ptr("75724a01-f021-4aa8-9ec2-329792373e6e"), - // WorkspaceID: to.Ptr("f419f624-acad-4d89-b86d-f62fa387f019"), - // WorkspaceResourceGroup: to.Ptr("myRg1"), - // WorkspaceSubscriptionID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }}, - // Severity: to.Ptr(armsecurity.AlertSeverityHigh), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.0000000Z"); return t}()), - // Status: to.Ptr(armsecurity.AlertStatusActive), - // SubTechniques: []*string{ - // to.Ptr("T1059.001"), - // to.Ptr("T1059.006"), - // to.Ptr("T1053.002")}, - // SupportingEvidence: &armsecurity.AlertPropertiesSupportingEvidence{ - // AdditionalProperties: map[string]any{ - // "columns": []any{ - // "Date", - // "Activity", - // "User", - // "TestedText", - // "TestedValue", - // }, - // "rows": []any{ - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser2", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser3", - // "true", - // true, - // }, - // }, - // "title": "Investigate activity test", - // }, - // Type: to.Ptr("tabularEvidences"), - // }, - // SystemAlertID: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Techniques: []*string{ - // to.Ptr("T1059"), - // to.Ptr("T1053"), - // to.Ptr("T1072")}, - // TimeGeneratedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.0000000Z"); return t}()), - // VendorName: to.Ptr("Microsoft"), - // Version: to.Ptr("2022-01-01"), - // }, - // }, - // { - // Name: to.Ptr("2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22"), - // Type: to.Ptr("Microsoft.Security/Locations/alerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg2/providers/Microsoft.Security/locations/westeurope/alerts/2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22"), - // Properties: &armsecurity.AlertProperties{ - // Description: to.Ptr("The process ‘c:\\users\\contosoUser\\scrsave.scr’ was observed executing from an uncommon location. Files with the .scr extensions are screen saver files and are normally reside and execute from the Windows system directory."), - // AlertDisplayName: to.Ptr("Suspicious Screensaver process executed"), - // AlertType: to.Ptr("VM_SuspiciousScreenSaver"), - // AlertURI: to.Ptr("https://portal.azure.com/#blade/Microsoft_Azure_Security/AlertBlade/alertId/2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a/subscriptionId/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroup/myRg1/referencedFrom/alertDeepLink/location/westeurope"), - // CompromisedEntity: to.Ptr("vm2"), - // CorrelationKey: to.Ptr("4hno6LF0xzCl5tqrk4nrBW+MY1BX816W6q6+0srk4"), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T13:51:45.0045913Z"); return t}()), - // Entities: []*armsecurity.AlertEntity{ - // { - // AdditionalProperties: map[string]any{ - // "OsVersion": nil, - // "azureID": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/myRg2/providers/microsoft.compute/virtualmachines/vm2", - // "dnsDomain": "", - // "hostName": "vm2", - // "netBiosName": "vm2", - // "ntDomain": "", - // "omsAgentID": "45b44640-3b94-4892-a28c-4a5cae27065a", - // "operatingSystem": "Unknown", - // }, - // Type: to.Ptr("host"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "name": "contosoUser", - // "logonId": "0x61450d87", - // "ntDomain": "vm2", - // "sid": "S-1-5-21-2144575486-8928446540-5163864319-500", - // }, - // Type: to.Ptr("account"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "name": "cmd.exe", - // "directory": "c:\\windows\\system32", - // }, - // Type: to.Ptr("file"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "processId": "0x3c44", - // }, - // Type: to.Ptr("process"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "name": "scrsave.scr", - // "directory": "c:\\users\\contosoUser", - // }, - // Type: to.Ptr("file"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "commandLine": "c:\\users\\contosoUser\\scrsave.scr", - // "creationTimeUtc": "2018-05-07T13:51:45.0045913Z", - // "processId": "0x4aec", - // }, - // Type: to.Ptr("process"), - // }}, - // ExtendedLinks: []map[string]*string{ - // map[string]*string{ - // "Category": to.Ptr("threat_reports"), - // "Href": to.Ptr("https://contoso.com/reports/DisplayReport"), - // "Label": to.Ptr("Report: RDP Brute Forcing"), - // "Type": to.Ptr("webLink"), - // }}, - // ExtendedProperties: map[string]*string{ - // "account logon id": to.Ptr("0x61450d87"), - // "command line": to.Ptr("c:\\users\\contosoUser\\scrsave.scr"), - // "domain name": to.Ptr("vm2"), - // "parent process": to.Ptr("cmd.exe"), - // "parent process id": to.Ptr("0x3c44"), - // "process id": to.Ptr("0x4aec"), - // "process name": to.Ptr("c:\\users\\contosoUser\\scrsave.scr"), - // "resourceType": to.Ptr("Virtual Machine"), - // "user SID": to.Ptr("S-1-5-21-2144575486-8928446540-5163864319-500"), - // "user name": to.Ptr("vm2\\contosoUser"), - // }, - // Intent: to.Ptr(armsecurity.IntentExecution), - // IsIncident: to.Ptr(true), - // ProcessingEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T13:51:48.9810457Z"); return t}()), - // ProductComponentName: to.Ptr("testName2"), - // ProductName: to.Ptr("Azure Security Center"), - // RemediationSteps: []*string{ - // to.Ptr("1. Run Process Explorer and try to identify unknown running processes (see https://technet.microsoft.com/en-us/sysinternals/bb896653.aspx)"), - // to.Ptr("2. Make sure the machine is completely updated and has an updated anti-malware application installed"), - // to.Ptr("3. Run a full anti-malware scan and verify that the threat was removed"), - // to.Ptr("4. Install and run Microsoft’s Malicious Software Removal Tool (see https://www.microsoft.com/en-us/download/malicious-software-removal-tool-details.aspx)"), - // to.Ptr("5. Run Microsoft’s Autoruns utility and try to identify unknown applications that are configured to run at login (see https://technet.microsoft.com/en-us/sysinternals/bb963902.aspx)"), - // to.Ptr("6. Escalate the alert to the information security team")}, - // ResourceIdentifiers: []armsecurity.ResourceIdentifierClassification{ - // &armsecurity.AzureResourceIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeAzureResource), - // AzureResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // &armsecurity.LogAnalyticsIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeLogAnalytics), - // AgentID: to.Ptr("75724a01-f021-4aa8-9ec2-329792373e6e"), - // WorkspaceID: to.Ptr("f419f624-acad-4d89-b86d-f62fa387f019"), - // WorkspaceResourceGroup: to.Ptr("myRg1"), - // WorkspaceSubscriptionID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }}, - // Severity: to.Ptr(armsecurity.AlertSeverityMedium), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T13:51:45.0045913Z"); return t}()), - // Status: to.Ptr(armsecurity.AlertStatusActive), - // SubTechniques: []*string{ - // to.Ptr("T1059.001"), - // to.Ptr("T1059.006"), - // to.Ptr("T1053.002")}, - // SupportingEvidence: &armsecurity.AlertPropertiesSupportingEvidence{ - // AdditionalProperties: map[string]any{ - // "supportingEvidenceList": []any{ - // map[string]any{ - // "type": "nestedList", - // "evidenceElements":[]any{ - // map[string]any{ - // "type": "evidenceElement", - // "innerElements": nil, - // "text":map[string]any{ - // "arguments":map[string]any{ - // "domainName":map[string]any{ - // "type": "string", - // "value": "domainName", - // }, - // "sensitiveEnumerationTypes":map[string]any{ - // "type": "string[]", - // "value":[]any{ - // "UseDesKey", - // }, - // }, - // }, - // "fallback": "Actor enumerated UseDesKey on domain1.test.local", - // "localizationKey": "AATP_ALERTS_LDAP_SENSITIVE_ATTRIBUTE_RECONNAISSANCE_SECURITY_ALERT_EVIDENCE_ENUMERATION_DETAIL_A7C00BD7", - // }, - // }, - // }, - // }, - // map[string]any{ - // "type": "tabularEvidences", - // "columns":[]any{ - // "Date", - // "Activity", - // "User", - // "TestedText", - // "TestedValue", - // }, - // "rows":[]any{ - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser2", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser3", - // "true", - // true, - // }, - // }, - // "title": "Investigate activity test", - // }, - // }, - // }, - // Type: to.Ptr("supportingEvidenceList"), - // }, - // SystemAlertID: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Techniques: []*string{ - // to.Ptr("T1059"), - // to.Ptr("T1053"), - // to.Ptr("T1072")}, - // TimeGeneratedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T13:51:48.3810457Z"); return t}()), - // VendorName: to.Ptr("Microsoft"), - // Version: to.Ptr("2022-01-01"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertsResourceGroup_example.json -func ExampleAlertsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAlertsClient().NewListByResourceGroupPager("myRg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AlertList = armsecurity.AlertList{ - // Value: []*armsecurity.Alert{ - // { - // Name: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Type: to.Ptr("Microsoft.Security/Locations/alerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/alerts/2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA"), - // Properties: &armsecurity.AlertProperties{ - // Description: to.Ptr("This is a test alert generated by Azure Security Center. No further action is needed."), - // AlertDisplayName: to.Ptr("Azure Security Center test alert (not a threat)"), - // AlertType: to.Ptr("VM_EICAR"), - // AlertURI: to.Ptr("https://portal.azure.com/#blade/Microsoft_Azure_Security/AlertBlade/alertId/2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a/subscriptionId/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroup/myRg1/referencedFrom/alertDeepLink/location/westeurope"), - // CompromisedEntity: to.Ptr("vm1"), - // CorrelationKey: to.Ptr("kso0LFWxzCll5tqrk5hmrBJ+MY1BX806W6q6+0s9Lk="), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.0000000Z"); return t}()), - // Entities: []*armsecurity.AlertEntity{ - // { - // AdditionalProperties: map[string]any{ - // "address": "192.0.2.1", - // "location": map[string]any{ - // "asn": float64(6584), - // "city": "sonning", - // "countryCode": "gb", - // "latitude": float64(51.468), - // "longitude": float64(-0.909), - // "state": "wokingham", - // }, - // }, - // Type: to.Ptr("ip"), - // }}, - // ExtendedLinks: []map[string]*string{ - // map[string]*string{ - // "Category": to.Ptr("threat_reports"), - // "Href": to.Ptr("https://contoso.com/reports/DisplayReport"), - // "Label": to.Ptr("Report: RDP Brute Forcing"), - // "Type": to.Ptr("webLink"), - // }}, - // ExtendedProperties: map[string]*string{ - // "Property1": to.Ptr("Property1 information"), - // }, - // Intent: to.Ptr(armsecurity.IntentExecution), - // IsIncident: to.Ptr(true), - // ProcessingEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.9205584Z"); return t}()), - // ProductComponentName: to.Ptr("testName"), - // ProductName: to.Ptr("Azure Security Center"), - // RemediationSteps: []*string{ - // to.Ptr("No further action is needed.")}, - // ResourceIdentifiers: []armsecurity.ResourceIdentifierClassification{ - // &armsecurity.AzureResourceIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeAzureResource), - // AzureResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // &armsecurity.LogAnalyticsIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeLogAnalytics), - // AgentID: to.Ptr("75724a01-f021-4aa8-9ec2-329792373e6e"), - // WorkspaceID: to.Ptr("f419f624-acad-4d89-b86d-f62fa387f019"), - // WorkspaceResourceGroup: to.Ptr("myRg1"), - // WorkspaceSubscriptionID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }}, - // Severity: to.Ptr(armsecurity.AlertSeverityHigh), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.0000000Z"); return t}()), - // Status: to.Ptr(armsecurity.AlertStatusActive), - // SubTechniques: []*string{ - // to.Ptr("T1059.001"), - // to.Ptr("T1059.006"), - // to.Ptr("T1053.002")}, - // SupportingEvidence: &armsecurity.AlertPropertiesSupportingEvidence{ - // AdditionalProperties: map[string]any{ - // "supportingEvidenceList": []any{ - // map[string]any{ - // "type": "nestedList", - // "evidenceElements":[]any{ - // map[string]any{ - // "type": "evidenceElement", - // "innerElements": nil, - // "text":map[string]any{ - // "arguments":map[string]any{ - // "domainName":map[string]any{ - // "type": "string", - // "value": "domainName", - // }, - // "sensitiveEnumerationTypes":map[string]any{ - // "type": "string[]", - // "value":[]any{ - // "UseDesKey", - // }, - // }, - // }, - // "fallback": "Actor enumerated UseDesKey on domain1.test.local", - // "localizationKey": "AATP_ALERTS_LDAP_SENSITIVE_ATTRIBUTE_RECONNAISSANCE_SECURITY_ALERT_EVIDENCE_ENUMERATION_DETAIL_A7C00BD7", - // }, - // }, - // }, - // }, - // map[string]any{ - // "type": "tabularEvidences", - // "columns":[]any{ - // "Date", - // "Activity", - // "User", - // "TestedText", - // "TestedValue", - // }, - // "rows":[]any{ - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser2", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser3", - // "true", - // true, - // }, - // }, - // "title": "Investigate activity test", - // }, - // }, - // }, - // Type: to.Ptr("supportingEvidenceList"), - // }, - // SystemAlertID: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Techniques: []*string{ - // to.Ptr("T1059"), - // to.Ptr("T1053"), - // to.Ptr("T1072")}, - // TimeGeneratedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.0000000Z"); return t}()), - // VendorName: to.Ptr("Microsoft"), - // Version: to.Ptr("2022-01-01"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertsSubscriptionsLocation_example.json -func ExampleAlertsClient_NewListSubscriptionLevelByRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAlertsClient().NewListSubscriptionLevelByRegionPager("westeurope", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AlertList = armsecurity.AlertList{ - // Value: []*armsecurity.Alert{ - // { - // Name: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Type: to.Ptr("Microsoft.Security/Locations/alerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/alerts/2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA"), - // Properties: &armsecurity.AlertProperties{ - // Description: to.Ptr("This is a test alert generated by Azure Security Center. No further action is needed."), - // AlertDisplayName: to.Ptr("Azure Security Center test alert (not a threat)"), - // AlertType: to.Ptr("VM_EICAR"), - // AlertURI: to.Ptr("https://portal.azure.com/#blade/Microsoft_Azure_Security/AlertBlade/alertId/2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a/subscriptionId/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroup/myRg1/referencedFrom/alertDeepLink/location/westeurope"), - // CompromisedEntity: to.Ptr("vm1"), - // CorrelationKey: to.Ptr("kso0LFWxzCll5tqrk5hmrBJ+MY1BX806W6q6+0s9Lk="), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.0000000Z"); return t}()), - // Entities: []*armsecurity.AlertEntity{ - // { - // AdditionalProperties: map[string]any{ - // "address": "192.0.2.1", - // "location": map[string]any{ - // "asn": float64(6584), - // "city": "sonning", - // "countryCode": "gb", - // "latitude": float64(51.468), - // "longitude": float64(-0.909), - // "state": "wokingham", - // }, - // }, - // Type: to.Ptr("ip"), - // }}, - // ExtendedLinks: []map[string]*string{ - // map[string]*string{ - // "Category": to.Ptr("threat_reports"), - // "Href": to.Ptr("https://contoso.com/reports/DisplayReport"), - // "Label": to.Ptr("Report: RDP Brute Forcing"), - // "Type": to.Ptr("webLink"), - // }}, - // ExtendedProperties: map[string]*string{ - // "Property1": to.Ptr("Property1 information"), - // }, - // Intent: to.Ptr(armsecurity.IntentExecution), - // IsIncident: to.Ptr(true), - // ProcessingEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.9205584Z"); return t}()), - // ProductComponentName: to.Ptr("testName"), - // ProductName: to.Ptr("Azure Security Center"), - // RemediationSteps: []*string{ - // to.Ptr("No further action is needed.")}, - // ResourceIdentifiers: []armsecurity.ResourceIdentifierClassification{ - // &armsecurity.AzureResourceIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeAzureResource), - // AzureResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // &armsecurity.LogAnalyticsIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeLogAnalytics), - // AgentID: to.Ptr("75724a01-f021-4aa8-9ec2-329792373e6e"), - // WorkspaceID: to.Ptr("f419f624-acad-4d89-b86d-f62fa387f019"), - // WorkspaceResourceGroup: to.Ptr("myRg1"), - // WorkspaceSubscriptionID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }}, - // Severity: to.Ptr(armsecurity.AlertSeverityHigh), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.0000000Z"); return t}()), - // Status: to.Ptr(armsecurity.AlertStatusActive), - // SubTechniques: []*string{ - // to.Ptr("T1059.001"), - // to.Ptr("T1059.006"), - // to.Ptr("T1053.002")}, - // SupportingEvidence: &armsecurity.AlertPropertiesSupportingEvidence{ - // AdditionalProperties: map[string]any{ - // "columns": []any{ - // "Date", - // "Activity", - // "User", - // "TestedText", - // "TestedValue", - // }, - // "rows": []any{ - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser2", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser3", - // "true", - // true, - // }, - // }, - // "title": "Investigate activity test", - // }, - // Type: to.Ptr("tabularEvidences"), - // }, - // SystemAlertID: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Techniques: []*string{ - // to.Ptr("T1059"), - // to.Ptr("T1053"), - // to.Ptr("T1072")}, - // TimeGeneratedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.0000000Z"); return t}()), - // VendorName: to.Ptr("Microsoft"), - // Version: to.Ptr("2022-01-01"), - // }, - // }, - // { - // Name: to.Ptr("2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22"), - // Type: to.Ptr("Microsoft.Security/Locations/alerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg2/providers/Microsoft.Security/locations/westeurope/alerts/2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22"), - // Properties: &armsecurity.AlertProperties{ - // Description: to.Ptr("The process ‘c:\\users\\contosoUser\\scrsave.scr’ was observed executing from an uncommon location. Files with the .scr extensions are screen saver files and are normally reside and execute from the Windows system directory."), - // AlertDisplayName: to.Ptr("Suspicious Screensaver process executed"), - // AlertType: to.Ptr("VM_SuspiciousScreenSaver"), - // AlertURI: to.Ptr("https://portal.azure.com/#blade/Microsoft_Azure_Security/AlertBlade/alertId/2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a/subscriptionId/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroup/myRg1/referencedFrom/alertDeepLink/location/westeurope"), - // CompromisedEntity: to.Ptr("vm2"), - // CorrelationKey: to.Ptr("4hno6LF0xzCl5tqrk4nrBW+MY1BX816W6q6+0srk4"), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T13:51:45.0045913Z"); return t}()), - // Entities: []*armsecurity.AlertEntity{ - // { - // AdditionalProperties: map[string]any{ - // "OsVersion": nil, - // "azureID": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/myRg2/providers/microsoft.compute/virtualmachines/vm2", - // "dnsDomain": "", - // "hostName": "vm2", - // "netBiosName": "vm2", - // "ntDomain": "", - // "omsAgentID": "45b44640-3b94-4892-a28c-4a5cae27065a", - // "operatingSystem": "Unknown", - // }, - // Type: to.Ptr("host"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "name": "contosoUser", - // "logonId": "0x61450d87", - // "ntDomain": "vm2", - // "sid": "S-1-5-21-2144575486-8928446540-5163864319-500", - // }, - // Type: to.Ptr("account"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "name": "cmd.exe", - // "directory": "c:\\windows\\system32", - // }, - // Type: to.Ptr("file"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "processId": "0x3c44", - // }, - // Type: to.Ptr("process"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "name": "scrsave.scr", - // "directory": "c:\\users\\contosoUser", - // }, - // Type: to.Ptr("file"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "commandLine": "c:\\users\\contosoUser\\scrsave.scr", - // "creationTimeUtc": "2018-05-07T13:51:45.0045913Z", - // "processId": "0x4aec", - // }, - // Type: to.Ptr("process"), - // }}, - // ExtendedLinks: []map[string]*string{ - // map[string]*string{ - // "Category": to.Ptr("threat_reports"), - // "Href": to.Ptr("https://contoso.com/reports/DisplayReport"), - // "Label": to.Ptr("Report: RDP Brute Forcing"), - // "Type": to.Ptr("webLink"), - // }}, - // ExtendedProperties: map[string]*string{ - // "account logon id": to.Ptr("0x61450d87"), - // "command line": to.Ptr("c:\\users\\contosoUser\\scrsave.scr"), - // "domainName": to.Ptr("vm2"), - // "parent process": to.Ptr("cmd.exe"), - // "parent process id": to.Ptr("0x3c44"), - // "process id": to.Ptr("0x4aec"), - // "processName": to.Ptr("c:\\users\\contosoUser\\scrsave.scr"), - // "resourceType": to.Ptr("Virtual Machine"), - // "user SID": to.Ptr("S-1-5-21-2144575486-8928446540-5163864319-500"), - // "userName": to.Ptr("vm2\\contosoUser"), - // }, - // Intent: to.Ptr(armsecurity.IntentExecution), - // IsIncident: to.Ptr(true), - // ProcessingEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T13:51:48.9810457Z"); return t}()), - // ProductComponentName: to.Ptr("testName2"), - // ProductName: to.Ptr("Azure Security Center"), - // RemediationSteps: []*string{ - // to.Ptr("1. Run Process Explorer and try to identify unknown running processes (see https://technet.microsoft.com/en-us/sysinternals/bb896653.aspx)"), - // to.Ptr("2. Make sure the machine is completely updated and has an updated anti-malware application installed"), - // to.Ptr("3. Run a full anti-malware scan and verify that the threat was removed"), - // to.Ptr("4. Install and run Microsoft’s Malicious Software Removal Tool (see https://www.microsoft.com/en-us/download/malicious-software-removal-tool-details.aspx)"), - // to.Ptr("5. Run Microsoft’s Autoruns utility and try to identify unknown applications that are configured to run at login (see https://technet.microsoft.com/en-us/sysinternals/bb963902.aspx)"), - // to.Ptr("6. Escalate the alert to the information security team")}, - // ResourceIdentifiers: []armsecurity.ResourceIdentifierClassification{ - // &armsecurity.AzureResourceIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeAzureResource), - // AzureResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // &armsecurity.LogAnalyticsIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeLogAnalytics), - // AgentID: to.Ptr("75724a01-f021-4aa8-9ec2-329792373e6e"), - // WorkspaceID: to.Ptr("f419f624-acad-4d89-b86d-f62fa387f019"), - // WorkspaceResourceGroup: to.Ptr("myRg1"), - // WorkspaceSubscriptionID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }}, - // Severity: to.Ptr(armsecurity.AlertSeverityMedium), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T13:51:45.0045913Z"); return t}()), - // Status: to.Ptr(armsecurity.AlertStatusActive), - // SubTechniques: []*string{ - // to.Ptr("T1059.001"), - // to.Ptr("T1059.006"), - // to.Ptr("T1053.002")}, - // SupportingEvidence: &armsecurity.AlertPropertiesSupportingEvidence{ - // AdditionalProperties: map[string]any{ - // "supportingEvidenceList": []any{ - // map[string]any{ - // "type": "nestedList", - // "evidenceElements":[]any{ - // map[string]any{ - // "type": "evidenceElement", - // "innerElements": nil, - // "text":map[string]any{ - // "arguments":map[string]any{ - // "domainName":map[string]any{ - // "type": "string", - // "value": "domainName", - // }, - // "sensitiveEnumerationTypes":map[string]any{ - // "type": "string[]", - // "value":[]any{ - // "UseDesKey", - // }, - // }, - // }, - // "fallback": "Actor enumerated UseDesKey on domain1.test.local", - // "localizationKey": "AATP_ALERTS_LDAP_SENSITIVE_ATTRIBUTE_RECONNAISSANCE_SECURITY_ALERT_EVIDENCE_ENUMERATION_DETAIL_A7C00BD7", - // }, - // }, - // }, - // }, - // map[string]any{ - // "type": "tabularEvidences", - // "columns":[]any{ - // "Date", - // "Activity", - // "User", - // "TestedText", - // "TestedValue", - // }, - // "rows":[]any{ - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser2", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser3", - // "true", - // true, - // }, - // }, - // "title": "Investigate activity test", - // }, - // }, - // }, - // Type: to.Ptr("supportingEvidenceList"), - // }, - // SystemAlertID: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Techniques: []*string{ - // to.Ptr("T1059"), - // to.Ptr("T1053"), - // to.Ptr("T1072")}, - // TimeGeneratedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-07T13:51:48.3810457Z"); return t}()), - // VendorName: to.Ptr("Microsoft"), - // Version: to.Ptr("2022-01-01"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertsResourceGroupLocation_example.json -func ExampleAlertsClient_NewListResourceGroupLevelByRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAlertsClient().NewListResourceGroupLevelByRegionPager("westeurope", "myRg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AlertList = armsecurity.AlertList{ - // Value: []*armsecurity.Alert{ - // { - // Name: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Type: to.Ptr("Microsoft.Security/Locations/alerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/alerts/2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA"), - // Properties: &armsecurity.AlertProperties{ - // Description: to.Ptr("This is a test alert generated by Azure Security Center. No further action is needed."), - // AlertDisplayName: to.Ptr("Azure Security Center test alert (not a threat)"), - // AlertType: to.Ptr("VM_EICAR"), - // AlertURI: to.Ptr("https://portal.azure.com/#blade/Microsoft_Azure_Security/AlertBlade/alertId/2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a/subscriptionId/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroup/myRg1/referencedFrom/alertDeepLink/location/westeurope"), - // CompromisedEntity: to.Ptr("vm1"), - // CorrelationKey: to.Ptr("kso0LFWxzCll5tqrk5hmrBJ+MY1BX806W6q6+0s9Lk="), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.0000000Z"); return t}()), - // Entities: []*armsecurity.AlertEntity{ - // { - // AdditionalProperties: map[string]any{ - // "address": "192.0.2.1", - // "location": map[string]any{ - // "asn": float64(6584), - // "city": "sonning", - // "countryCode": "gb", - // "latitude": float64(51.468), - // "longitude": float64(-0.909), - // "state": "wokingham", - // }, - // }, - // Type: to.Ptr("ip"), - // }}, - // ExtendedLinks: []map[string]*string{ - // map[string]*string{ - // "Category": to.Ptr("threat_reports"), - // "Href": to.Ptr("https://contoso.com/reports/DisplayReport"), - // "Label": to.Ptr("Report: RDP Brute Forcing"), - // "Type": to.Ptr("webLink"), - // }}, - // ExtendedProperties: map[string]*string{ - // "Property1": to.Ptr("Property1 information"), - // }, - // Intent: to.Ptr(armsecurity.IntentExecution), - // IsIncident: to.Ptr(true), - // ProcessingEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.9205584Z"); return t}()), - // ProductComponentName: to.Ptr("testName"), - // ProductName: to.Ptr("Azure Security Center"), - // RemediationSteps: []*string{ - // to.Ptr("No further action is needed.")}, - // ResourceIdentifiers: []armsecurity.ResourceIdentifierClassification{ - // &armsecurity.AzureResourceIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeAzureResource), - // AzureResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // &armsecurity.LogAnalyticsIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeLogAnalytics), - // AgentID: to.Ptr("75724a01-f021-4aa8-9ec2-329792373e6e"), - // WorkspaceID: to.Ptr("f419f624-acad-4d89-b86d-f62fa387f019"), - // WorkspaceResourceGroup: to.Ptr("myRg1"), - // WorkspaceSubscriptionID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }}, - // Severity: to.Ptr(armsecurity.AlertSeverityHigh), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.0000000Z"); return t}()), - // Status: to.Ptr(armsecurity.AlertStatusActive), - // SubTechniques: []*string{ - // to.Ptr("T1059.001"), - // to.Ptr("T1059.006"), - // to.Ptr("T1053.002")}, - // SupportingEvidence: &armsecurity.AlertPropertiesSupportingEvidence{ - // AdditionalProperties: map[string]any{ - // "supportingEvidenceList": []any{ - // map[string]any{ - // "type": "nestedList", - // "evidenceElements":[]any{ - // map[string]any{ - // "type": "evidenceElement", - // "innerElements": nil, - // "text":map[string]any{ - // "arguments":map[string]any{ - // "domainName":map[string]any{ - // "type": "string", - // "value": "domainName", - // }, - // "sensitiveEnumerationTypes":map[string]any{ - // "type": "string[]", - // "value":[]any{ - // "UseDesKey", - // }, - // }, - // }, - // "fallback": "Actor enumerated UseDesKey on domain1.test.local", - // "localizationKey": "AATP_ALERTS_LDAP_SENSITIVE_ATTRIBUTE_RECONNAISSANCE_SECURITY_ALERT_EVIDENCE_ENUMERATION_DETAIL_A7C00BD7", - // }, - // }, - // }, - // }, - // map[string]any{ - // "type": "tabularEvidences", - // "columns":[]any{ - // "Date", - // "Activity", - // "User", - // "TestedText", - // "TestedValue", - // }, - // "rows":[]any{ - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser2", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser3", - // "true", - // true, - // }, - // }, - // "title": "Investigate activity test", - // }, - // }, - // }, - // Type: to.Ptr("supportingEvidenceList"), - // }, - // SystemAlertID: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Techniques: []*string{ - // to.Ptr("T1059"), - // to.Ptr("T1053"), - // to.Ptr("T1072")}, - // TimeGeneratedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.0000000Z"); return t}()), - // VendorName: to.Ptr("Microsoft"), - // Version: to.Ptr("2022-01-01"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertSubscriptionLocation_example.json -func ExampleAlertsClient_GetSubscriptionLevel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAlertsClient().GetSubscriptionLevel(ctx, "westeurope", "2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Alert = armsecurity.Alert{ - // Name: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Type: to.Ptr("Microsoft.Security/Locations/alerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/alerts/2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA"), - // Properties: &armsecurity.AlertProperties{ - // Description: to.Ptr("This is a test alert generated by Azure Security Center. No further action is needed."), - // AlertDisplayName: to.Ptr("Azure Security Center test alert (not a threat)"), - // AlertType: to.Ptr("VM_EICAR"), - // AlertURI: to.Ptr("https://portal.azure.com/#blade/Microsoft_Azure_Security/AlertBlade/alertId/2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a/subscriptionId/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroup/myRg1/referencedFrom/alertDeepLink/location/westeurope"), - // CompromisedEntity: to.Ptr("vm1"), - // CorrelationKey: to.Ptr("kso0LFWxzCll5tqrk5hmrBJ+MY1BX806W6q6+0s9Lk="), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.0000000Z"); return t}()), - // Entities: []*armsecurity.AlertEntity{ - // { - // AdditionalProperties: map[string]any{ - // "address": "192.0.2.1", - // "location": map[string]any{ - // "asn": float64(6584), - // "city": "sonning", - // "countryCode": "gb", - // "latitude": float64(51.468), - // "longitude": float64(-0.909), - // "state": "wokingham", - // }, - // }, - // Type: to.Ptr("ip"), - // }}, - // ExtendedLinks: []map[string]*string{ - // map[string]*string{ - // "Category": to.Ptr("threat_reports"), - // "Href": to.Ptr("https://contoso.com/reports/DisplayReport"), - // "Label": to.Ptr("Report: RDP Brute Forcing"), - // "Type": to.Ptr("webLink"), - // }}, - // ExtendedProperties: map[string]*string{ - // "Property1": to.Ptr("Property1 information"), - // }, - // Intent: to.Ptr(armsecurity.IntentExecution), - // IsIncident: to.Ptr(true), - // ProcessingEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.9205584Z"); return t}()), - // ProductComponentName: to.Ptr("testName"), - // ProductName: to.Ptr("Azure Security Center"), - // RemediationSteps: []*string{ - // to.Ptr("No further action is needed.")}, - // ResourceIdentifiers: []armsecurity.ResourceIdentifierClassification{ - // &armsecurity.AzureResourceIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeAzureResource), - // AzureResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // &armsecurity.LogAnalyticsIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeLogAnalytics), - // AgentID: to.Ptr("75724a01-f021-4aa8-9ec2-329792373e6e"), - // WorkspaceID: to.Ptr("f419f624-acad-4d89-b86d-f62fa387f019"), - // WorkspaceResourceGroup: to.Ptr("myRg1"), - // WorkspaceSubscriptionID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }}, - // Severity: to.Ptr(armsecurity.AlertSeverityHigh), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.0000000Z"); return t}()), - // Status: to.Ptr(armsecurity.AlertStatusActive), - // SubTechniques: []*string{ - // to.Ptr("T1059.001"), - // to.Ptr("T1059.006"), - // to.Ptr("T1053.002")}, - // SupportingEvidence: &armsecurity.AlertPropertiesSupportingEvidence{ - // AdditionalProperties: map[string]any{ - // "columns": []any{ - // "Date", - // "Activity", - // "User", - // "TestedText", - // "TestedValue", - // }, - // "rows": []any{ - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser2", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser3", - // "true", - // true, - // }, - // }, - // "title": "Investigate activity test", - // }, - // Type: to.Ptr("tabularEvidences"), - // }, - // SystemAlertID: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Techniques: []*string{ - // to.Ptr("T1059"), - // to.Ptr("T1053"), - // to.Ptr("T1072")}, - // TimeGeneratedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.0000000Z"); return t}()), - // VendorName: to.Ptr("Microsoft"), - // Version: to.Ptr("2022-01-01"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertResourceGroupLocation_example.json -func ExampleAlertsClient_GetResourceGroupLevel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAlertsClient().GetResourceGroupLevel(ctx, "myRg1", "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Alert = armsecurity.Alert{ - // Name: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Type: to.Ptr("Microsoft.Security/Locations/alerts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/alerts/2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA"), - // Properties: &armsecurity.AlertProperties{ - // Description: to.Ptr("This is a test alert generated by Azure Security Center. No further action is needed."), - // AlertDisplayName: to.Ptr("Azure Security Center test alert (not a threat)"), - // AlertType: to.Ptr("VM_EICAR"), - // AlertURI: to.Ptr("https://portal.azure.com/#blade/Microsoft_Azure_Security/AlertBlade/alertId/2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a/subscriptionId/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroup/myRg1/referencedFrom/alertDeepLink/location/westeurope"), - // CompromisedEntity: to.Ptr("vm1"), - // CorrelationKey: to.Ptr("kso0LFWxzCll5tqrk5hmrBJ+MY1BX806W6q6+0s9Lk="), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.0000000Z"); return t}()), - // Entities: []*armsecurity.AlertEntity{ - // { - // AdditionalProperties: map[string]any{ - // "address": "192.0.2.1", - // "location": map[string]any{ - // "asn": float64(6584), - // "city": "sonning", - // "countryCode": "gb", - // "latitude": float64(51.468), - // "longitude": float64(-0.909), - // "state": "wokingham", - // }, - // }, - // Type: to.Ptr("ip"), - // }}, - // ExtendedLinks: []map[string]*string{ - // map[string]*string{ - // "Category": to.Ptr("threat_reports"), - // "Href": to.Ptr("https://contoso.com/reports/DisplayReport"), - // "Label": to.Ptr("Report: RDP Brute Forcing"), - // "Type": to.Ptr("webLink"), - // }}, - // ExtendedProperties: map[string]*string{ - // "Property1": to.Ptr("Property1 information"), - // }, - // Intent: to.Ptr(armsecurity.IntentExecution), - // IsIncident: to.Ptr(true), - // ProcessingEndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.9205584Z"); return t}()), - // ProductComponentName: to.Ptr("testName"), - // ProductName: to.Ptr("Azure Security Center"), - // RemediationSteps: []*string{ - // to.Ptr("No further action is needed.")}, - // ResourceIdentifiers: []armsecurity.ResourceIdentifierClassification{ - // &armsecurity.AzureResourceIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeAzureResource), - // AzureResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // }, - // &armsecurity.LogAnalyticsIdentifier{ - // Type: to.Ptr(armsecurity.ResourceIdentifierTypeLogAnalytics), - // AgentID: to.Ptr("75724a01-f021-4aa8-9ec2-329792373e6e"), - // WorkspaceID: to.Ptr("f419f624-acad-4d89-b86d-f62fa387f019"), - // WorkspaceResourceGroup: to.Ptr("myRg1"), - // WorkspaceSubscriptionID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - // }}, - // Severity: to.Ptr(armsecurity.AlertSeverityHigh), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-22T00:00:00.0000000Z"); return t}()), - // Status: to.Ptr(armsecurity.AlertStatusActive), - // SubTechniques: []*string{ - // to.Ptr("T1059.001"), - // to.Ptr("T1059.006"), - // to.Ptr("T1053.002")}, - // SupportingEvidence: &armsecurity.AlertPropertiesSupportingEvidence{ - // AdditionalProperties: map[string]any{ - // "supportingEvidenceList": []any{ - // map[string]any{ - // "type": "nestedList", - // "evidenceElements":[]any{ - // map[string]any{ - // "type": "evidenceElement", - // "innerElements": nil, - // "text":map[string]any{ - // "arguments":map[string]any{ - // "domainName":map[string]any{ - // "type": "string", - // "value": "domainName", - // }, - // "sensitiveEnumerationTypes":map[string]any{ - // "type": "string[]", - // "value":[]any{ - // "UseDesKey", - // }, - // }, - // }, - // "fallback": "Actor enumerated UseDesKey on domain1.test.local", - // "localizationKey": "AATP_ALERTS_LDAP_SENSITIVE_ATTRIBUTE_RECONNAISSANCE_SECURITY_ALERT_EVIDENCE_ENUMERATION_DETAIL_A7C00BD7", - // }, - // }, - // }, - // }, - // map[string]any{ - // "type": "tabularEvidences", - // "columns":[]any{ - // "Date", - // "Activity", - // "User", - // "TestedText", - // "TestedValue", - // }, - // "rows":[]any{ - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser2", - // "false", - // false, - // }, - // []any{ - // "2022-01-17T07:03:52.034Z", - // "Log on", - // "testUser3", - // "true", - // true, - // }, - // }, - // "title": "Investigate activity test", - // }, - // }, - // }, - // Type: to.Ptr("supportingEvidenceList"), - // }, - // SystemAlertID: to.Ptr("2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a"), - // Techniques: []*string{ - // to.Ptr("T1059"), - // to.Ptr("T1053"), - // to.Ptr("T1072")}, - // TimeGeneratedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-23T13:47:58.0000000Z"); return t}()), - // VendorName: to.Ptr("Microsoft"), - // Version: to.Ptr("2022-01-01"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 f30e6761ac9a..f997a243b865 100644 --- a/sdk/resourcemanager/security/armsecurity/alertssuppressionrules_client.go +++ b/sdk/resourcemanager/security/armsecurity/alertssuppressionrules_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -52,16 +51,18 @@ func NewAlertsSuppressionRulesClient(subscriptionID string, credential azcore.To // - options - AlertsSuppressionRulesClientDeleteOptions contains the optional parameters for the AlertsSuppressionRulesClient.Delete // method. func (client *AlertsSuppressionRulesClient) Delete(ctx context.Context, alertsSuppressionRuleName string, options *AlertsSuppressionRulesClientDeleteOptions) (AlertsSuppressionRulesClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, alertsSuppressionRuleName, options) if err != nil { return AlertsSuppressionRulesClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AlertsSuppressionRulesClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return AlertsSuppressionRulesClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return AlertsSuppressionRulesClientDeleteResponse{}, err } return AlertsSuppressionRulesClientDeleteResponse{}, nil } @@ -96,18 +97,21 @@ func (client *AlertsSuppressionRulesClient) deleteCreateRequest(ctx context.Cont // - options - AlertsSuppressionRulesClientGetOptions contains the optional parameters for the AlertsSuppressionRulesClient.Get // method. func (client *AlertsSuppressionRulesClient) Get(ctx context.Context, alertsSuppressionRuleName string, options *AlertsSuppressionRulesClientGetOptions) (AlertsSuppressionRulesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, alertsSuppressionRuleName, options) if err != nil { return AlertsSuppressionRulesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AlertsSuppressionRulesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AlertsSuppressionRulesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AlertsSuppressionRulesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -213,18 +217,21 @@ func (client *AlertsSuppressionRulesClient) listHandleResponse(resp *http.Respon // - options - AlertsSuppressionRulesClientUpdateOptions contains the optional parameters for the AlertsSuppressionRulesClient.Update // method. func (client *AlertsSuppressionRulesClient) Update(ctx context.Context, alertsSuppressionRuleName string, alertsSuppressionRule AlertsSuppressionRule, options *AlertsSuppressionRulesClientUpdateOptions) (AlertsSuppressionRulesClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, alertsSuppressionRuleName, alertsSuppressionRule, options) if err != nil { return AlertsSuppressionRulesClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AlertsSuppressionRulesClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AlertsSuppressionRulesClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AlertsSuppressionRulesClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -246,7 +253,10 @@ func (client *AlertsSuppressionRulesClient) updateCreateRequest(ctx context.Cont reqQP.Set("api-version", "2019-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, alertsSuppressionRule) + if err := runtime.MarshalAsJSON(req, alertsSuppressionRule); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. 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 3bd81ad8a765..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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRulesWithAlertType_example.json -func ExampleAlertsSuppressionRulesClient_NewListPager_getSuppressionAlertRuleForSubscriptionFilteredByAlertType() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAlertsSuppressionRulesClient().NewListPager(&armsecurity.AlertsSuppressionRulesClientListOptions{AlertType: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AlertsSuppressionRulesList = armsecurity.AlertsSuppressionRulesList{ - // Value: []*armsecurity.AlertsSuppressionRule{ - // { - // Name: to.Ptr("dismissIpAnomalyAlerts"), - // Type: to.Ptr("Microsoft.Security/alertsSuppressionRules"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/alertsSuppressionRules/dismissIpAnomalyAlerts"), - // Properties: &armsecurity.AlertsSuppressionRuleProperties{ - // AlertType: to.Ptr("IpAnomaly"), - // Comment: to.Ptr("Test VM"), - // ExpirationDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T19:50:47.083633Z"); return t}()), - // LastModifiedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-31T19:50:47.083633Z"); return t}()), - // Reason: to.Ptr("FalsePositive"), - // State: to.Ptr(armsecurity.RuleStateEnabled), - // SuppressionAlertsScope: &armsecurity.SuppressionAlertsScope{ - // AllOf: []*armsecurity.ScopeElement{ - // { - // AdditionalProperties: map[string]any{ - // "in": []any{ - // "104.215.95.187", - // "52.164.206.56", - // }, - // }, - // Field: to.Ptr("entities.ip.address"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "contains": "POWERSHELL.EXE", - // }, - // Field: to.Ptr("entities.process.commandline"), - // }}, - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRules_example.json -func ExampleAlertsSuppressionRulesClient_NewListPager_getSuppressionRulesForSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAlertsSuppressionRulesClient().NewListPager(&armsecurity.AlertsSuppressionRulesClientListOptions{AlertType: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AlertsSuppressionRulesList = armsecurity.AlertsSuppressionRulesList{ - // Value: []*armsecurity.AlertsSuppressionRule{ - // { - // Name: to.Ptr("dismissIpAnomalyAlerts"), - // Type: to.Ptr("Microsoft.Security/alertsSuppressionRules"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/alertsSuppressionRules/dismissIpAnomalyAlerts"), - // Properties: &armsecurity.AlertsSuppressionRuleProperties{ - // AlertType: to.Ptr("IpAnomaly"), - // Comment: to.Ptr("Test VM"), - // ExpirationDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T19:50:47.083633Z"); return t}()), - // LastModifiedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-31T19:50:47.083633Z"); return t}()), - // Reason: to.Ptr("FalsePositive"), - // State: to.Ptr(armsecurity.RuleStateEnabled), - // SuppressionAlertsScope: &armsecurity.SuppressionAlertsScope{ - // AllOf: []*armsecurity.ScopeElement{ - // { - // AdditionalProperties: map[string]any{ - // "in": []any{ - // "104.215.95.187", - // "52.164.206.56", - // }, - // }, - // Field: to.Ptr("entities.ip.address"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "contains": "POWERSHELL.EXE", - // }, - // Field: to.Ptr("entities.process.commandline"), - // }}, - // }, - // }, - // }, - // { - // Name: to.Ptr("dismissDataExfiltrationAnomalyAlertsOnTestVMs"), - // Type: to.Ptr("Microsoft.Security/alertsSuppressionRules"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/alertsSuppressionRules/dismissDataExfiltrationAnomalyAlertsOnTestVMs"), - // Properties: &armsecurity.AlertsSuppressionRuleProperties{ - // AlertType: to.Ptr("DataExfiltrationAnomaly"), - // ExpirationDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T19:50:47.083633Z"); return t}()), - // LastModifiedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-31T19:50:47.083633Z"); return t}()), - // Reason: to.Ptr("FalsePositive"), - // State: to.Ptr(armsecurity.RuleStateEnabled), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRule_example.json -func ExampleAlertsSuppressionRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAlertsSuppressionRulesClient().Get(ctx, "dismissIpAnomalyAlerts", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AlertsSuppressionRule = armsecurity.AlertsSuppressionRule{ - // Name: to.Ptr("dismissIpAnomalyAlerts"), - // Type: to.Ptr("Microsoft.Security/alertsSuppressionRules"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/alertsSuppressionRules/dismissIpAnomalyAlerts"), - // Properties: &armsecurity.AlertsSuppressionRuleProperties{ - // AlertType: to.Ptr("IpAnomaly"), - // Comment: to.Ptr("Test VM"), - // ExpirationDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T19:50:47.083633Z"); return t}()), - // LastModifiedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-31T19:50:47.083633Z"); return t}()), - // Reason: to.Ptr("FalsePositive"), - // State: to.Ptr(armsecurity.RuleStateEnabled), - // SuppressionAlertsScope: &armsecurity.SuppressionAlertsScope{ - // AllOf: []*armsecurity.ScopeElement{ - // { - // AdditionalProperties: map[string]any{ - // "in": []any{ - // "104.215.95.187", - // "52.164.206.56", - // }, - // }, - // Field: to.Ptr("entities.ip.address"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "contains": "POWERSHELL.EXE", - // }, - // Field: to.Ptr("entities.process.commandline"), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/PutAlertsSuppressionRule_example.json -func ExampleAlertsSuppressionRulesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAlertsSuppressionRulesClient().Update(ctx, "dismissIpAnomalyAlerts", armsecurity.AlertsSuppressionRule{ - Properties: &armsecurity.AlertsSuppressionRuleProperties{ - AlertType: to.Ptr("IpAnomaly"), - Comment: to.Ptr("Test VM"), - ExpirationDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T19:50:47.083633Z"); return t }()), - Reason: to.Ptr("FalsePositive"), - State: to.Ptr(armsecurity.RuleStateEnabled), - SuppressionAlertsScope: &armsecurity.SuppressionAlertsScope{ - AllOf: []*armsecurity.ScopeElement{ - { - AdditionalProperties: map[string]any{ - "in": []any{ - "104.215.95.187", - "52.164.206.56", - }, - }, - Field: to.Ptr("entities.ip.address"), - }, - { - AdditionalProperties: map[string]any{ - "contains": "POWERSHELL.EXE", - }, - Field: to.Ptr("entities.process.commandline"), - }}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AlertsSuppressionRule = armsecurity.AlertsSuppressionRule{ - // Name: to.Ptr("dismissIpAnomalyAlerts"), - // Type: to.Ptr("Microsoft.Security/alertsSuppressionRules"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/alertsSuppressionRules/dismissIpAnomalyAlerts"), - // Properties: &armsecurity.AlertsSuppressionRuleProperties{ - // AlertType: to.Ptr("IpAnomaly"), - // Comment: to.Ptr("Test VM"), - // ExpirationDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T19:50:47.083633Z"); return t}()), - // LastModifiedUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-07-31T19:50:47.083633Z"); return t}()), - // Reason: to.Ptr("FalsePositive"), - // State: to.Ptr(armsecurity.RuleStateEnabled), - // SuppressionAlertsScope: &armsecurity.SuppressionAlertsScope{ - // AllOf: []*armsecurity.ScopeElement{ - // { - // AdditionalProperties: map[string]any{ - // "in": []any{ - // "104.215.95.187", - // "52.164.206.56", - // }, - // }, - // Field: to.Ptr("entities.ip.address"), - // }, - // { - // AdditionalProperties: map[string]any{ - // "contains": "POWERSHELL.EXE", - // }, - // Field: to.Ptr("entities.process.commandline"), - // }}, - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/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 14c83d479266..c36905b6050e 100644 --- a/sdk/resourcemanager/security/armsecurity/allowedconnections_client.go +++ b/sdk/resourcemanager/security/armsecurity/allowedconnections_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -53,18 +52,21 @@ func NewAllowedConnectionsClient(subscriptionID string, credential azcore.TokenC // - connectionType - The type of allowed connections (Internal, External) // - options - AllowedConnectionsClientGetOptions contains the optional parameters for the AllowedConnectionsClient.Get method. func (client *AllowedConnectionsClient) Get(ctx context.Context, resourceGroupName string, ascLocation string, connectionType ConnectionType, options *AllowedConnectionsClientGetOptions) (AllowedConnectionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, ascLocation, connectionType, options) if err != nil { return AllowedConnectionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AllowedConnectionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AllowedConnectionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AllowedConnectionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 0923ee3d9a8f..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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/GetAllowedConnectionsSubscription_example.json -func ExampleAllowedConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAllowedConnectionsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AllowedConnectionsList = armsecurity.AllowedConnectionsList{ - // Value: []*armsecurity.AllowedConnectionsResource{ - // { - // Location: to.Ptr("centralus"), - // Name: to.Ptr("Internal"), - // Type: to.Ptr("Microsoft.Security/locations/allowedConnections"), - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Security/locations/centralus/allowedConnections/Internal"), - // Properties: &armsecurity.AllowedConnectionsResourceProperties{ - // CalculatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-06T14:55:32.3518545Z"); return t}()), - // ConnectableResources: []*armsecurity.ConnectableResource{ - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // }, - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // }, - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine3"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // }, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // }, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/GetAllowedConnectionsSubscriptionLocation_example.json -func ExampleAllowedConnectionsClient_NewListByHomeRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAllowedConnectionsClient().NewListByHomeRegionPager("centralus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AllowedConnectionsList = armsecurity.AllowedConnectionsList{ - // Value: []*armsecurity.AllowedConnectionsResource{ - // { - // Location: to.Ptr("centralus"), - // Name: to.Ptr("Internal"), - // Type: to.Ptr("Microsoft.Security/locations/allowedConnections"), - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Security/locations/centralus/allowedConnections/Internal"), - // Properties: &armsecurity.AllowedConnectionsResourceProperties{ - // CalculatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-06T14:55:32.3518545Z"); return t}()), - // ConnectableResources: []*armsecurity.ConnectableResource{ - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // }, - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // }, - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine3"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // }, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // }, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/GetAllowedConnections_example.json -func ExampleAllowedConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAllowedConnectionsClient().Get(ctx, "myResourceGroup", "centralus", armsecurity.ConnectionTypeInternal, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AllowedConnectionsResource = armsecurity.AllowedConnectionsResource{ - // Location: to.Ptr("centralus"), - // Name: to.Ptr("Internal"), - // Type: to.Ptr("Microsoft.Security/locations/allowedConnections"), - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Security/locations/centralus/allowedConnections/Internal"), - // Properties: &armsecurity.AllowedConnectionsResourceProperties{ - // CalculatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-08-06T14:55:32.3518545Z"); return t}()), - // ConnectableResources: []*armsecurity.ConnectableResource{ - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // }, - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine2"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // { - // ConnectedResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine1"), - // TCPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // UDPPorts: to.Ptr("[0-21,23-3388,3390-5984,5987-65535]"), - // }}, - // }, - // { - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154baf/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachines/virtaulMachine3"), - // InboundConnectedResources: []*armsecurity.ConnectedResource{ - // }, - // OutboundConnectedResources: []*armsecurity.ConnectedResource{ - // }, - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/apicollection_client.go b/sdk/resourcemanager/security/armsecurity/apicollection_client.go deleted file mode 100644 index 95bd4364e6c6..000000000000 --- a/sdk/resourcemanager/security/armsecurity/apicollection_client.go +++ /dev/null @@ -1,181 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// APICollectionClient contains the methods for the APICollection group. -// Don't use this type directly, use NewAPICollectionClient() instead. -type APICollectionClient struct { - internal *arm.Client - subscriptionID string -} - -// NewAPICollectionClient creates a new instance of APICollectionClient with the specified values. -// - subscriptionID - Azure subscription ID -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewAPICollectionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APICollectionClient, error) { - cl, err := arm.NewClient(moduleName+".APICollectionClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &APICollectionClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Get - Gets an Azure API Management API if it has been onboarded to Defender for APIs. If an Azure API Management API is -// onboarded to Defender for APIs, the system will monitor the operations within the -// Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-11-20-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serviceName - The name of the API Management service. -// - apiCollectionID - A string representing the apiCollections resource within the Microsoft.Security provider namespace. This -// string matches the Azure API Management API name. -// - options - APICollectionClientGetOptions contains the optional parameters for the APICollectionClient.Get method. -func (client *APICollectionClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiCollectionID string, options *APICollectionClientGetOptions) (APICollectionClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiCollectionID, options) - if err != nil { - return APICollectionClientGetResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return APICollectionClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APICollectionClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *APICollectionClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiCollectionID string, options *APICollectionClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiCollectionId}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serviceName == "" { - return nil, errors.New("parameter serviceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) - if apiCollectionID == "" { - return nil, errors.New("parameter apiCollectionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{apiCollectionId}", url.PathEscape(apiCollectionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-20-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *APICollectionClient) getHandleResponse(resp *http.Response) (APICollectionClientGetResponse, error) { - result := APICollectionClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.APICollectionResponse); err != nil { - return APICollectionClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Gets a list of Azure API Management APIs that have been onboarded to Defender for APIs. If an Azure API -// Management API is onboarded to Defender for APIs, the system will monitor the operations within -// the Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. -// -// Generated from API version 2022-11-20-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serviceName - The name of the API Management service. -// - options - APICollectionClientListOptions contains the optional parameters for the APICollectionClient.NewListPager method. -func (client *APICollectionClient) NewListPager(resourceGroupName string, serviceName string, options *APICollectionClientListOptions) *runtime.Pager[APICollectionClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[APICollectionClientListResponse]{ - More: func(page APICollectionClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *APICollectionClientListResponse) (APICollectionClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return APICollectionClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return APICollectionClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APICollectionClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *APICollectionClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *APICollectionClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serviceName == "" { - return nil, errors.New("parameter serviceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-20-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *APICollectionClient) listHandleResponse(resp *http.Response) (APICollectionClientListResponse, error) { - result := APICollectionClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.APICollectionResponseList); err != nil { - return APICollectionClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/security/armsecurity/apicollection_client_example_test.go b/sdk/resourcemanager/security/armsecurity/apicollection_client_example_test.go deleted file mode 100644 index 5a7bc8c52271..000000000000 --- a/sdk/resourcemanager/security/armsecurity/apicollection_client_example_test.go +++ /dev/null @@ -1,88 +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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2022-11-20-preview/examples/ApiCollections/APICollection_List_example.json -func ExampleAPICollectionClient_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.NewAPICollectionClient().NewListPager("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.APICollectionResponseList = armsecurity.APICollectionResponseList{ - // Value: []*armsecurity.APICollectionResponse{ - // { - // 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{ - // AdditionalData: map[string]*string{ - // "apiManagementApiId": to.Ptr("/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api"), - // }, - // DisplayName: to.Ptr("echo-api"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2022-11-20-preview/examples/ApiCollections/APICollection_Get_example.json -func ExampleAPICollectionClient_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.NewAPICollectionClient().Get(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.APICollectionResponse = armsecurity.APICollectionResponse{ - // 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{ - // AdditionalData: map[string]*string{ - // "apiManagementApiId": to.Ptr("/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api"), - // }, - // DisplayName: to.Ptr("echo-api"), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/apicollectionoffboarding_client.go b/sdk/resourcemanager/security/armsecurity/apicollectionoffboarding_client.go deleted file mode 100644 index 64a48581312b..000000000000 --- a/sdk/resourcemanager/security/armsecurity/apicollectionoffboarding_client.go +++ /dev/null @@ -1,101 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// APICollectionOffboardingClient contains the methods for the APICollectionOffboarding group. -// Don't use this type directly, use NewAPICollectionOffboardingClient() instead. -type APICollectionOffboardingClient struct { - internal *arm.Client - subscriptionID string -} - -// NewAPICollectionOffboardingClient creates a new instance of APICollectionOffboardingClient with the specified values. -// - subscriptionID - Azure subscription ID -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewAPICollectionOffboardingClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APICollectionOffboardingClient, error) { - cl, err := arm.NewClient(moduleName+".APICollectionOffboardingClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &APICollectionOffboardingClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Delete - Offboard an Azure API Management API from Defender for APIs. The system will stop monitoring the operations within -// the Azure API Management API for intrusive behaviors. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-11-20-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serviceName - The name of the API Management service. -// - apiCollectionID - A string representing the apiCollections resource within the Microsoft.Security provider namespace. This -// string matches the Azure API Management API name. -// - options - APICollectionOffboardingClientDeleteOptions contains the optional parameters for the APICollectionOffboardingClient.Delete -// method. -func (client *APICollectionOffboardingClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiCollectionID string, options *APICollectionOffboardingClientDeleteOptions) (APICollectionOffboardingClientDeleteResponse, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiCollectionID, options) - if err != nil { - return APICollectionOffboardingClientDeleteResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return APICollectionOffboardingClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return APICollectionOffboardingClientDeleteResponse{}, runtime.NewResponseError(resp) - } - return APICollectionOffboardingClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *APICollectionOffboardingClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiCollectionID string, options *APICollectionOffboardingClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiCollectionId}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serviceName == "" { - return nil, errors.New("parameter serviceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) - if apiCollectionID == "" { - return nil, errors.New("parameter apiCollectionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{apiCollectionId}", url.PathEscape(apiCollectionID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-20-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} diff --git a/sdk/resourcemanager/security/armsecurity/apicollectionoffboarding_client_example_test.go b/sdk/resourcemanager/security/armsecurity/apicollectionoffboarding_client_example_test.go deleted file mode 100644 index 94440f3a9f36..000000000000 --- a/sdk/resourcemanager/security/armsecurity/apicollectionoffboarding_client_example_test.go +++ /dev/null @@ -1,35 +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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2022-11-20-preview/examples/ApiCollections/APICollectionOffboarding_Delete_example.json -func ExampleAPICollectionOffboardingClient_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.NewAPICollectionOffboardingClient().Delete(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/apicollectiononboarding_client.go b/sdk/resourcemanager/security/armsecurity/apicollectiononboarding_client.go deleted file mode 100644 index 8e8a521dc71c..000000000000 --- a/sdk/resourcemanager/security/armsecurity/apicollectiononboarding_client.go +++ /dev/null @@ -1,111 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// APICollectionOnboardingClient contains the methods for the APICollectionOnboarding group. -// Don't use this type directly, use NewAPICollectionOnboardingClient() instead. -type APICollectionOnboardingClient struct { - internal *arm.Client - subscriptionID string -} - -// NewAPICollectionOnboardingClient creates a new instance of APICollectionOnboardingClient with the specified values. -// - subscriptionID - Azure subscription ID -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewAPICollectionOnboardingClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APICollectionOnboardingClient, error) { - cl, err := arm.NewClient(moduleName+".APICollectionOnboardingClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &APICollectionOnboardingClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Create - Onboard an Azure API Management API to Defender for APIs. The system will start monitoring the operations within -// the Azure Management API for intrusive behaviors and provide alerts for attacks that -// have been detected. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2022-11-20-preview -// - resourceGroupName - The name of the resource group. The name is case insensitive. -// - serviceName - The name of the API Management service. -// - apiCollectionID - A string representing the apiCollections resource within the Microsoft.Security provider namespace. This -// string matches the Azure API Management API name. -// - options - APICollectionOnboardingClientCreateOptions contains the optional parameters for the APICollectionOnboardingClient.Create -// method. -func (client *APICollectionOnboardingClient) Create(ctx context.Context, resourceGroupName string, serviceName string, apiCollectionID string, options *APICollectionOnboardingClientCreateOptions) (APICollectionOnboardingClientCreateResponse, error) { - req, err := client.createCreateRequest(ctx, resourceGroupName, serviceName, apiCollectionID, options) - if err != nil { - return APICollectionOnboardingClientCreateResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return APICollectionOnboardingClientCreateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return APICollectionOnboardingClientCreateResponse{}, runtime.NewResponseError(resp) - } - return client.createHandleResponse(resp) -} - -// createCreateRequest creates the Create request. -func (client *APICollectionOnboardingClient) createCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiCollectionID string, options *APICollectionOnboardingClientCreateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/providers/Microsoft.Security/apiCollections/{apiCollectionId}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serviceName == "" { - return nil, errors.New("parameter serviceName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) - if apiCollectionID == "" { - return nil, errors.New("parameter apiCollectionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{apiCollectionId}", url.PathEscape(apiCollectionID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-11-20-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// createHandleResponse handles the Create response. -func (client *APICollectionOnboardingClient) createHandleResponse(resp *http.Response) (APICollectionOnboardingClientCreateResponse, error) { - result := APICollectionOnboardingClientCreateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.APICollectionResponse); err != nil { - return APICollectionOnboardingClientCreateResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/security/armsecurity/apicollectiononboarding_client_example_test.go b/sdk/resourcemanager/security/armsecurity/apicollectiononboarding_client_example_test.go deleted file mode 100644 index 58dc27f5920d..000000000000 --- a/sdk/resourcemanager/security/armsecurity/apicollectiononboarding_client_example_test.go +++ /dev/null @@ -1,49 +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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2022-11-20-preview/examples/ApiCollections/APICollectionOnboarding_Create_example.json -func ExampleAPICollectionOnboardingClient_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.NewAPICollectionOnboardingClient().Create(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.APICollectionResponse = armsecurity.APICollectionResponse{ - // 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{ - // AdditionalData: map[string]*string{ - // "apiManagementApiId": to.Ptr("/subscriptions/3fa85f64-5717-4562-b3fc-2c963f66afa6/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/echo-api"), - // }, - // DisplayName: to.Ptr("echo-api"), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/apicollections_client.go b/sdk/resourcemanager/security/armsecurity/apicollections_client.go new file mode 100644 index 000000000000..1ec0c92c8b85 --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/apicollections_client.go @@ -0,0 +1,451 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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" +) + +// APICollectionsClient contains the methods for the APICollections group. +// Don't use this type directly, use NewAPICollectionsClient() instead. +type APICollectionsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAPICollectionsClient creates a new instance of APICollectionsClient 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 NewAPICollectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APICollectionsClient, error) { + cl, err := arm.NewClient(moduleName+".APICollectionsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &APICollectionsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// GetByAzureAPIManagementService - Gets an Azure API Management API if it has been onboarded to Microsoft Defender for APIs. +// If an Azure API Management API is onboarded to Microsoft Defender for APIs, the system will monitor the +// operations within the Azure API Management API for intrusive behaviors and provide alerts for attacks that have been detected. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the API Management service instance. Non-current revision has ;rev=n +// as a suffix where n is the revision number. +// - options - APICollectionsClientGetByAzureAPIManagementServiceOptions contains the optional parameters for the APICollectionsClient.GetByAzureAPIManagementService +// method. +func (client *APICollectionsClient) GetByAzureAPIManagementService(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APICollectionsClientGetByAzureAPIManagementServiceOptions) (APICollectionsClientGetByAzureAPIManagementServiceResponse, error) { + var err error + req, err := client.getByAzureAPIManagementServiceCreateRequest(ctx, resourceGroupName, serviceName, apiID, options) + if err != nil { + return APICollectionsClientGetByAzureAPIManagementServiceResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return APICollectionsClientGetByAzureAPIManagementServiceResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return APICollectionsClientGetByAzureAPIManagementServiceResponse{}, err + } + resp, err := client.getByAzureAPIManagementServiceHandleResponse(httpResp) + return resp, err +} + +// getByAzureAPIManagementServiceCreateRequest creates the GetByAzureAPIManagementService request. +func (client *APICollectionsClient) getByAzureAPIManagementServiceCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-11-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getByAzureAPIManagementServiceHandleResponse handles the GetByAzureAPIManagementService response. +func (client *APICollectionsClient) getByAzureAPIManagementServiceHandleResponse(resp *http.Response) (APICollectionsClientGetByAzureAPIManagementServiceResponse, error) { + result := APICollectionsClientGetByAzureAPIManagementServiceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.APICollection); err != nil { + return APICollectionsClientGetByAzureAPIManagementServiceResponse{}, err + } + return result, nil +} + +// NewListByAzureAPIManagementServicePager - Gets a list of Azure API Management APIs that have been onboarded to Microsoft +// Defender for APIs. If an Azure API Management API is onboarded to Microsoft Defender for APIs, the system will monitor +// the operations within the Azure API Management API for intrusive behaviors and provide alerts for attacks that have been +// detected. +// +// Generated from API version 2023-11-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - APICollectionsClientListByAzureAPIManagementServiceOptions contains the optional parameters for the APICollectionsClient.NewListByAzureAPIManagementServicePager +// method. +func (client *APICollectionsClient) NewListByAzureAPIManagementServicePager(resourceGroupName string, serviceName string, options *APICollectionsClientListByAzureAPIManagementServiceOptions) *runtime.Pager[APICollectionsClientListByAzureAPIManagementServiceResponse] { + return runtime.NewPager(runtime.PagingHandler[APICollectionsClientListByAzureAPIManagementServiceResponse]{ + More: func(page APICollectionsClientListByAzureAPIManagementServiceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *APICollectionsClientListByAzureAPIManagementServiceResponse) (APICollectionsClientListByAzureAPIManagementServiceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByAzureAPIManagementServiceCreateRequest(ctx, resourceGroupName, serviceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return APICollectionsClientListByAzureAPIManagementServiceResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return APICollectionsClientListByAzureAPIManagementServiceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return APICollectionsClientListByAzureAPIManagementServiceResponse{}, runtime.NewResponseError(resp) + } + return client.listByAzureAPIManagementServiceHandleResponse(resp) + }, + }) +} + +// listByAzureAPIManagementServiceCreateRequest creates the ListByAzureAPIManagementService request. +func (client *APICollectionsClient) listByAzureAPIManagementServiceCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-11-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByAzureAPIManagementServiceHandleResponse handles the ListByAzureAPIManagementService response. +func (client *APICollectionsClient) listByAzureAPIManagementServiceHandleResponse(resp *http.Response) (APICollectionsClientListByAzureAPIManagementServiceResponse, error) { + result := APICollectionsClientListByAzureAPIManagementServiceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.APICollectionList); err != nil { + return APICollectionsClientListByAzureAPIManagementServiceResponse{}, err + } + return result, nil +} + +// NewListByResourceGroupPager - Gets a list of API collections within a resource group that have been onboarded to Microsoft +// Defender for APIs. +// +// Generated from API version 2023-11-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - APICollectionsClientListByResourceGroupOptions contains the optional parameters for the APICollectionsClient.NewListByResourceGroupPager +// method. +func (client *APICollectionsClient) NewListByResourceGroupPager(resourceGroupName string, options *APICollectionsClientListByResourceGroupOptions) *runtime.Pager[APICollectionsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PagingHandler[APICollectionsClientListByResourceGroupResponse]{ + More: func(page APICollectionsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *APICollectionsClientListByResourceGroupResponse) (APICollectionsClientListByResourceGroupResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return APICollectionsClientListByResourceGroupResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return APICollectionsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return APICollectionsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) + }, + }) +} + +// listByResourceGroupCreateRequest creates the ListByResourceGroup request. +func (client *APICollectionsClient) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, options *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") + } + 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)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-11-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResourceGroupHandleResponse handles the ListByResourceGroup response. +func (client *APICollectionsClient) listByResourceGroupHandleResponse(resp *http.Response) (APICollectionsClientListByResourceGroupResponse, error) { + result := APICollectionsClientListByResourceGroupResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.APICollectionList); err != nil { + return APICollectionsClientListByResourceGroupResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - Gets a list of API collections within a subscription that have been onboarded to Microsoft +// Defender for APIs. +// +// Generated from API version 2023-11-15 +// - options - APICollectionsClientListBySubscriptionOptions contains the optional parameters for the APICollectionsClient.NewListBySubscriptionPager +// method. +func (client *APICollectionsClient) NewListBySubscriptionPager(options *APICollectionsClientListBySubscriptionOptions) *runtime.Pager[APICollectionsClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[APICollectionsClientListBySubscriptionResponse]{ + More: func(page APICollectionsClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *APICollectionsClientListBySubscriptionResponse) (APICollectionsClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return APICollectionsClientListBySubscriptionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return APICollectionsClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return APICollectionsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *APICollectionsClient) listBySubscriptionCreateRequest(ctx context.Context, options *APICollectionsClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/apiCollections" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-11-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *APICollectionsClient) listBySubscriptionHandleResponse(resp *http.Response) (APICollectionsClientListBySubscriptionResponse, error) { + result := APICollectionsClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.APICollectionList); err != nil { + return APICollectionsClientListBySubscriptionResponse{}, err + } + return result, nil +} + +// OffboardAzureAPIManagementAPI - Offboard an Azure API Management API from Microsoft Defender for APIs. The system will +// stop monitoring the operations within the Azure API Management API for intrusive behaviors. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the API Management service instance. Non-current revision has ;rev=n +// as a suffix where n is the revision number. +// - options - APICollectionsClientOffboardAzureAPIManagementAPIOptions contains the optional parameters for the APICollectionsClient.OffboardAzureAPIManagementAPI +// method. +func (client *APICollectionsClient) OffboardAzureAPIManagementAPI(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APICollectionsClientOffboardAzureAPIManagementAPIOptions) (APICollectionsClientOffboardAzureAPIManagementAPIResponse, error) { + var err error + req, err := client.offboardAzureAPIManagementAPICreateRequest(ctx, resourceGroupName, serviceName, apiID, options) + if err != nil { + return APICollectionsClientOffboardAzureAPIManagementAPIResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return APICollectionsClientOffboardAzureAPIManagementAPIResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return APICollectionsClientOffboardAzureAPIManagementAPIResponse{}, err + } + return APICollectionsClientOffboardAzureAPIManagementAPIResponse{}, nil +} + +// offboardAzureAPIManagementAPICreateRequest creates the OffboardAzureAPIManagementAPI request. +func (client *APICollectionsClient) offboardAzureAPIManagementAPICreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-11-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// BeginOnboardAzureAPIManagementAPI - Onboard an Azure API Management API to Microsoft Defender for APIs. The system will +// start monitoring the operations within the Azure Management API for intrusive behaviors and provide alerts for +// attacks that have been detected. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-15 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the API Management service instance. Non-current revision has ;rev=n +// as a suffix where n is the revision number. +// - options - APICollectionsClientBeginOnboardAzureAPIManagementAPIOptions contains the optional parameters for the APICollectionsClient.BeginOnboardAzureAPIManagementAPI +// method. +func (client *APICollectionsClient) BeginOnboardAzureAPIManagementAPI(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APICollectionsClientBeginOnboardAzureAPIManagementAPIOptions) (*runtime.Poller[APICollectionsClientOnboardAzureAPIManagementAPIResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.onboardAzureAPIManagementAPI(ctx, resourceGroupName, serviceName, apiID, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[APICollectionsClientOnboardAzureAPIManagementAPIResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[APICollectionsClientOnboardAzureAPIManagementAPIResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// OnboardAzureAPIManagementAPI - Onboard an Azure API Management API to Microsoft Defender for APIs. The system will start +// monitoring the operations within the Azure Management API for intrusive behaviors and provide alerts for +// attacks that have been detected. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-15 +func (client *APICollectionsClient) onboardAzureAPIManagementAPI(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APICollectionsClientBeginOnboardAzureAPIManagementAPIOptions) (*http.Response, error) { + var err error + req, err := client.onboardAzureAPIManagementAPICreateRequest(ctx, resourceGroupName, serviceName, apiID, 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.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// onboardAzureAPIManagementAPICreateRequest creates the OnboardAzureAPIManagementAPI request. +func (client *APICollectionsClient) onboardAzureAPIManagementAPICreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-11-15") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/application_client.go b/sdk/resourcemanager/security/armsecurity/application_client.go index d5a1438723e0..df2abf8f74f2 100644 --- a/sdk/resourcemanager/security/armsecurity/application_client.go +++ b/sdk/resourcemanager/security/armsecurity/application_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -53,18 +52,21 @@ func NewApplicationClient(subscriptionID string, credential azcore.TokenCredenti // - options - ApplicationClientCreateOrUpdateOptions contains the optional parameters for the ApplicationClient.CreateOrUpdate // method. func (client *ApplicationClient) CreateOrUpdate(ctx context.Context, applicationID string, application Application, options *ApplicationClientCreateOrUpdateOptions) (ApplicationClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, applicationID, application, options) if err != nil { return ApplicationClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ApplicationClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ApplicationClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ApplicationClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -86,7 +88,10 @@ func (client *ApplicationClient) createOrUpdateCreateRequest(ctx context.Context reqQP.Set("api-version", "2022-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, application) + if err := runtime.MarshalAsJSON(req, application); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -105,16 +110,18 @@ func (client *ApplicationClient) createOrUpdateHandleResponse(resp *http.Respons // - applicationID - The security Application key - unique key for the standard application // - options - ApplicationClientDeleteOptions contains the optional parameters for the ApplicationClient.Delete method. func (client *ApplicationClient) Delete(ctx context.Context, applicationID string, options *ApplicationClientDeleteOptions) (ApplicationClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, applicationID, options) if err != nil { return ApplicationClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ApplicationClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ApplicationClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ApplicationClientDeleteResponse{}, err } return ApplicationClientDeleteResponse{}, nil } @@ -147,18 +154,21 @@ func (client *ApplicationClient) deleteCreateRequest(ctx context.Context, applic // - applicationID - The security Application key - unique key for the standard application // - options - ApplicationClientGetOptions contains the optional parameters for the ApplicationClient.Get method. func (client *ApplicationClient) Get(ctx context.Context, applicationID string, options *ApplicationClientGetOptions) (ApplicationClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, applicationID, options) if err != nil { return ApplicationClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ApplicationClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ApplicationClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ApplicationClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 85ddc36f9805..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 cf4eda222bec..4fbd325ac582 100644 --- a/sdk/resourcemanager/security/armsecurity/applications_client.go +++ b/sdk/resourcemanager/security/armsecurity/applications_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity 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 818744aee926..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 ea74c069e49b..5d3fc7c10897 100644 --- a/sdk/resourcemanager/security/armsecurity/assessments_client.go +++ b/sdk/resourcemanager/security/armsecurity/assessments_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -52,18 +51,21 @@ func NewAssessmentsClient(credential azcore.TokenCredential, options *arm.Client // - options - AssessmentsClientCreateOrUpdateOptions contains the optional parameters for the AssessmentsClient.CreateOrUpdate // method. func (client *AssessmentsClient) CreateOrUpdate(ctx context.Context, resourceID string, assessmentName string, assessment Assessment, options *AssessmentsClientCreateOrUpdateOptions) (AssessmentsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceID, assessmentName, assessment, options) if err != nil { return AssessmentsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AssessmentsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return AssessmentsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return AssessmentsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -82,7 +84,10 @@ func (client *AssessmentsClient) createOrUpdateCreateRequest(ctx context.Context reqQP.Set("api-version", "2021-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, assessment) + if err := runtime.MarshalAsJSON(req, assessment); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -103,16 +108,18 @@ func (client *AssessmentsClient) createOrUpdateHandleResponse(resp *http.Respons // - assessmentName - The Assessment Key - Unique key for the assessment type // - options - AssessmentsClientDeleteOptions contains the optional parameters for the AssessmentsClient.Delete method. func (client *AssessmentsClient) Delete(ctx context.Context, resourceID string, assessmentName string, options *AssessmentsClientDeleteOptions) (AssessmentsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceID, assessmentName, options) if err != nil { return AssessmentsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AssessmentsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return AssessmentsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return AssessmentsClientDeleteResponse{}, err } return AssessmentsClientDeleteResponse{}, nil } @@ -144,18 +151,21 @@ func (client *AssessmentsClient) deleteCreateRequest(ctx context.Context, resour // - assessmentName - The Assessment Key - Unique key for the assessment type // - options - AssessmentsClientGetOptions contains the optional parameters for the AssessmentsClient.Get method. func (client *AssessmentsClient) Get(ctx context.Context, resourceID string, assessmentName string, options *AssessmentsClientGetOptions) (AssessmentsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceID, assessmentName, options) if err != nil { return AssessmentsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AssessmentsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AssessmentsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AssessmentsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 dc6bcd9528e0..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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/ListAssessments_example.json -func ExampleAssessmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAssessmentsClient().NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AssessmentList = armsecurity.AssessmentList{ - // Value: []*armsecurity.AssessmentResponse{ - // { - // Name: to.Ptr("21300918-b2e3-0346-785f-c77ff57d243b"), - // Type: to.Ptr("Microsoft.Security/assessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1/providers/Microsoft.Security/assessments/21300918-b2e3-0346-785f-c77ff57d243b"), - // Properties: &armsecurity.AssessmentPropertiesResponse{ - // DisplayName: to.Ptr("Install endpoint protection solution on virtual machine scale sets"), - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1"), - // }, - // Status: &armsecurity.AssessmentStatusResponse{ - // Code: to.Ptr(armsecurity.AssessmentStatusCodeHealthy), - // FirstEvaluationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-12T09:07:18.6759138Z"); return t}()), - // StatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-12T09:07:18.6759138Z"); return t}()), - // }, - // }, - // }, - // { - // Name: to.Ptr("21300918-b2e3-0346-785f-c77ff57d243b"), - // Type: to.Ptr("Microsoft.Security/assessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2/providers/Microsoft.Security/assessments/21300918-b2e3-0346-785f-c77ff57d243b"), - // Properties: &armsecurity.AssessmentPropertiesResponse{ - // AdditionalData: map[string]*string{ - // "linkedWorkspaceId": to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myLaWorkspace"), - // }, - // DisplayName: to.Ptr("Install endpoint protection solution on virtual machine scale sets"), - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2"), - // }, - // Status: &armsecurity.AssessmentStatusResponse{ - // Description: to.Ptr("The effective policy for the assessment was evaluated to off - use Microsoft.Authorization/policyAssignments to turn this assessment on"), - // Cause: to.Ptr("OffByPolicy"), - // Code: to.Ptr(armsecurity.AssessmentStatusCodeNotApplicable), - // FirstEvaluationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-12T09:07:18.6759138Z"); return t}()), - // StatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-12T09:07:18.6759138Z"); return t}()), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/GetAssessment_example.json -func ExampleAssessmentsClient_Get_getSecurityRecommendationTaskFromSecurityDataLocation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAssessmentsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", "21300918-b2e3-0346-785f-c77ff57d243b", &armsecurity.AssessmentsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AssessmentResponse = armsecurity.AssessmentResponse{ - // Name: to.Ptr("21300918-b2e3-0346-785f-c77ff57d243b"), - // Type: to.Ptr("Microsoft.Security/assessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2/providers/Microsoft.Security/assessments/21300918-b2e3-0346-785f-c77ff57d243b"), - // Properties: &armsecurity.AssessmentPropertiesResponse{ - // AdditionalData: map[string]*string{ - // "linkedWorkspaceId": to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myLaWorkspace"), - // }, - // DisplayName: to.Ptr("Install endpoint protection solution on virtual machine scale sets"), - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2"), - // }, - // Status: &armsecurity.AssessmentStatusResponse{ - // Description: to.Ptr("The effective policy for the assessment was evaluated to off - use Microsoft.Authorization/policyAssignments to turn this assessment on"), - // Cause: to.Ptr("OffByPolicy"), - // Code: to.Ptr(armsecurity.AssessmentStatusCodeNotApplicable), - // FirstEvaluationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-12T09:07:18.6759138Z"); return t}()), - // StatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-12T09:07:18.6759138Z"); return t}()), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/GetAssessmentWithExpand_example.json -func ExampleAssessmentsClient_Get_getSecurityRecommendationTaskFromSecurityDataLocationWithExpandParameter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAssessmentsClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", "21300918-b2e3-0346-785f-c77ff57d243b", &armsecurity.AssessmentsClientGetOptions{Expand: to.Ptr(armsecurity.ExpandEnumLinks)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AssessmentResponse = armsecurity.AssessmentResponse{ - // Name: to.Ptr("21300918-b2e3-0346-785f-c77ff57d243b"), - // Type: to.Ptr("Microsoft.Security/assessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2/providers/Microsoft.Security/assessments/21300918-b2e3-0346-785f-c77ff57d243b"), - // Properties: &armsecurity.AssessmentPropertiesResponse{ - // AdditionalData: map[string]*string{ - // "linkedWorkspaceId": to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myLaWorkspace"), - // }, - // DisplayName: to.Ptr("Install endpoint protection solution on virtual machine scale sets"), - // Links: &armsecurity.AssessmentLinks{ - // AzurePortalURI: to.Ptr("https://www.portal.azure.com/?fea#blade/Microsoft_Azure_Security/RecommendationsBlade/assessmentKey/21300918-b2e3-0346-785f-c77ff57d243b"), - // }, - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2"), - // }, - // Status: &armsecurity.AssessmentStatusResponse{ - // Description: to.Ptr("The effective policy for the assessment was evaluated to off - use Microsoft.Authorization/policyAssignments to turn this assessment on"), - // Cause: to.Ptr("OffByPolicy"), - // Code: to.Ptr(armsecurity.AssessmentStatusCodeNotApplicable), - // FirstEvaluationDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-12T09:07:18.6759138Z"); return t}()), - // StatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-04-12T09:07:18.6759138Z"); return t}()), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 455640b4311f..3ef0a0ce917e 100644 --- a/sdk/resourcemanager/security/armsecurity/assessmentsmetadata_client.go +++ b/sdk/resourcemanager/security/armsecurity/assessmentsmetadata_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -53,18 +52,21 @@ func NewAssessmentsMetadataClient(subscriptionID string, credential azcore.Token // - options - AssessmentsMetadataClientCreateInSubscriptionOptions contains the optional parameters for the AssessmentsMetadataClient.CreateInSubscription // method. func (client *AssessmentsMetadataClient) CreateInSubscription(ctx context.Context, assessmentMetadataName string, assessmentMetadata AssessmentMetadataResponse, options *AssessmentsMetadataClientCreateInSubscriptionOptions) (AssessmentsMetadataClientCreateInSubscriptionResponse, error) { + var err error req, err := client.createInSubscriptionCreateRequest(ctx, assessmentMetadataName, assessmentMetadata, options) if err != nil { return AssessmentsMetadataClientCreateInSubscriptionResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AssessmentsMetadataClientCreateInSubscriptionResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AssessmentsMetadataClientCreateInSubscriptionResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AssessmentsMetadataClientCreateInSubscriptionResponse{}, err } - return client.createInSubscriptionHandleResponse(resp) + resp, err := client.createInSubscriptionHandleResponse(httpResp) + return resp, err } // createInSubscriptionCreateRequest creates the CreateInSubscription request. @@ -86,7 +88,10 @@ func (client *AssessmentsMetadataClient) createInSubscriptionCreateRequest(ctx c reqQP.Set("api-version", "2021-06-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, assessmentMetadata) + if err := runtime.MarshalAsJSON(req, assessmentMetadata); err != nil { + return nil, err + } + return req, nil } // createInSubscriptionHandleResponse handles the CreateInSubscription response. @@ -107,16 +112,18 @@ func (client *AssessmentsMetadataClient) createInSubscriptionHandleResponse(resp // - options - AssessmentsMetadataClientDeleteInSubscriptionOptions contains the optional parameters for the AssessmentsMetadataClient.DeleteInSubscription // method. func (client *AssessmentsMetadataClient) DeleteInSubscription(ctx context.Context, assessmentMetadataName string, options *AssessmentsMetadataClientDeleteInSubscriptionOptions) (AssessmentsMetadataClientDeleteInSubscriptionResponse, error) { + var err error req, err := client.deleteInSubscriptionCreateRequest(ctx, assessmentMetadataName, options) if err != nil { return AssessmentsMetadataClientDeleteInSubscriptionResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AssessmentsMetadataClientDeleteInSubscriptionResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AssessmentsMetadataClientDeleteInSubscriptionResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AssessmentsMetadataClientDeleteInSubscriptionResponse{}, err } return AssessmentsMetadataClientDeleteInSubscriptionResponse{}, nil } @@ -150,18 +157,21 @@ func (client *AssessmentsMetadataClient) deleteInSubscriptionCreateRequest(ctx c // - assessmentMetadataName - The Assessment Key - Unique key for the assessment type // - options - AssessmentsMetadataClientGetOptions contains the optional parameters for the AssessmentsMetadataClient.Get method. func (client *AssessmentsMetadataClient) Get(ctx context.Context, assessmentMetadataName string, options *AssessmentsMetadataClientGetOptions) (AssessmentsMetadataClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, assessmentMetadataName, options) if err != nil { return AssessmentsMetadataClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AssessmentsMetadataClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AssessmentsMetadataClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AssessmentsMetadataClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -199,18 +209,21 @@ func (client *AssessmentsMetadataClient) getHandleResponse(resp *http.Response) // - options - AssessmentsMetadataClientGetInSubscriptionOptions contains the optional parameters for the AssessmentsMetadataClient.GetInSubscription // method. func (client *AssessmentsMetadataClient) GetInSubscription(ctx context.Context, assessmentMetadataName string, options *AssessmentsMetadataClientGetInSubscriptionOptions) (AssessmentsMetadataClientGetInSubscriptionResponse, error) { + var err error req, err := client.getInSubscriptionCreateRequest(ctx, assessmentMetadataName, options) if err != nil { return AssessmentsMetadataClientGetInSubscriptionResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AssessmentsMetadataClientGetInSubscriptionResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AssessmentsMetadataClientGetInSubscriptionResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AssessmentsMetadataClientGetInSubscriptionResponse{}, err } - return client.getInSubscriptionHandleResponse(resp) + resp, err := client.getInSubscriptionHandleResponse(httpResp) + return resp, err } // getInSubscriptionCreateRequest creates the GetInSubscription request. 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 1b2ed2b32d4f..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 2d0dd00fd687..fed1f0697ee5 100644 --- a/sdk/resourcemanager/security/armsecurity/automations_client.go +++ b/sdk/resourcemanager/security/armsecurity/automations_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -55,18 +54,21 @@ func NewAutomationsClient(subscriptionID string, credential azcore.TokenCredenti // - options - AutomationsClientCreateOrUpdateOptions contains the optional parameters for the AutomationsClient.CreateOrUpdate // method. func (client *AutomationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, automationName string, automation Automation, options *AutomationsClientCreateOrUpdateOptions) (AutomationsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, automationName, automation, options) if err != nil { return AutomationsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AutomationsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return AutomationsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return AutomationsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -92,7 +94,10 @@ func (client *AutomationsClient) createOrUpdateCreateRequest(ctx context.Context reqQP.Set("api-version", "2019-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, automation) + if err := runtime.MarshalAsJSON(req, automation); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -112,16 +117,18 @@ func (client *AutomationsClient) createOrUpdateHandleResponse(resp *http.Respons // - automationName - The security automation name. // - options - AutomationsClientDeleteOptions contains the optional parameters for the AutomationsClient.Delete method. func (client *AutomationsClient) Delete(ctx context.Context, resourceGroupName string, automationName string, options *AutomationsClientDeleteOptions) (AutomationsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, automationName, options) if err != nil { return AutomationsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AutomationsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return AutomationsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return AutomationsClientDeleteResponse{}, err } return AutomationsClientDeleteResponse{}, nil } @@ -160,18 +167,21 @@ func (client *AutomationsClient) deleteCreateRequest(ctx context.Context, resour // - automationName - The security automation name. // - options - AutomationsClientGetOptions contains the optional parameters for the AutomationsClient.Get method. func (client *AutomationsClient) Get(ctx context.Context, resourceGroupName string, automationName string, options *AutomationsClientGetOptions) (AutomationsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, automationName, options) if err != nil { return AutomationsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AutomationsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AutomationsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AutomationsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -344,18 +354,21 @@ func (client *AutomationsClient) listByResourceGroupHandleResponse(resp *http.Re // - automation - The security automation resource // - options - AutomationsClientValidateOptions contains the optional parameters for the AutomationsClient.Validate method. func (client *AutomationsClient) Validate(ctx context.Context, resourceGroupName string, automationName string, automation Automation, options *AutomationsClientValidateOptions) (AutomationsClientValidateResponse, error) { + var err error req, err := client.validateCreateRequest(ctx, resourceGroupName, automationName, automation, options) if err != nil { return AutomationsClientValidateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AutomationsClientValidateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AutomationsClientValidateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AutomationsClientValidateResponse{}, err } - return client.validateHandleResponse(resp) + resp, err := client.validateHandleResponse(httpResp) + return resp, err } // validateCreateRequest creates the Validate request. @@ -381,7 +394,10 @@ func (client *AutomationsClient) validateCreateRequest(ctx context.Context, reso reqQP.Set("api-version", "2019-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, automation) + if err := runtime.MarshalAsJSON(req, automation); err != nil { + return nil, err + } + return req, nil } // validateHandleResponse handles the Validate response. 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 9b5549b6c192..000000000000 --- a/sdk/resourcemanager/security/armsecurity/automations_client_example_test.go +++ /dev/null @@ -1,531 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/GetAutomationsSubscription_example.json -func ExampleAutomationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAutomationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AutomationList = armsecurity.AutomationList{ - // Value: []*armsecurity.Automation{ - // { - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Name: to.Ptr("exampleAutomation"), - // Type: to.Ptr("Microsoft.Security/automations"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/automations/exampleAutomation"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.AutomationProperties{ - // Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment"), - // Actions: []armsecurity.AutomationActionClassification{ - // &armsecurity.AutomationActionLogicApp{ - // ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - // LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - // }}, - // IsEnabled: to.Ptr(true), - // Scopes: []*armsecurity.AutomationScope{ - // { - // Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - // ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - // }}, - // Sources: []*armsecurity.AutomationSource{ - // { - // EventSource: to.Ptr(armsecurity.EventSourceAssessments), - // RuleSets: []*armsecurity.AutomationRuleSet{ - // { - // Rules: []*armsecurity.AutomationTriggeringRule{ - // { - // ExpectedValue: to.Ptr("customAssessment"), - // Operator: to.Ptr(armsecurity.OperatorEquals), - // PropertyJPath: to.Ptr("$.Entity.AssessmentType"), - // PropertyType: to.Ptr(armsecurity.PropertyTypeString), - // }}, - // }}, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/GetAutomationsResourceGroup_example.json -func ExampleAutomationsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewAutomationsClient().NewListByResourceGroupPager("exampleResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AutomationList = armsecurity.AutomationList{ - // Value: []*armsecurity.Automation{ - // { - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Name: to.Ptr("exampleAutomation"), - // Type: to.Ptr("Microsoft.Security/automations"), - // ID: to.Ptr("/subscriptions/e4272367-5645-4c4e-9c67-3b74b59a6982/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/automations/exampleAutomation"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.AutomationProperties{ - // Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment"), - // Actions: []armsecurity.AutomationActionClassification{ - // &armsecurity.AutomationActionLogicApp{ - // ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - // LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - // }}, - // IsEnabled: to.Ptr(true), - // Scopes: []*armsecurity.AutomationScope{ - // { - // Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - // ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - // }}, - // Sources: []*armsecurity.AutomationSource{ - // { - // EventSource: to.Ptr(armsecurity.EventSourceAssessments), - // RuleSets: []*armsecurity.AutomationRuleSet{ - // { - // Rules: []*armsecurity.AutomationTriggeringRule{ - // { - // ExpectedValue: to.Ptr("customAssessment"), - // Operator: to.Ptr(armsecurity.OperatorEquals), - // PropertyJPath: to.Ptr("$.Entity.AssessmentType"), - // PropertyType: to.Ptr(armsecurity.PropertyTypeString), - // }}, - // }}, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/GetAutomationResourceGroup_example.json -func ExampleAutomationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutomationsClient().Get(ctx, "exampleResourceGroup", "exampleAutomation", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Automation = armsecurity.Automation{ - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Name: to.Ptr("exampleAutomation"), - // Type: to.Ptr("Microsoft.Security/automations"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/automations/exampleAutomation"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.AutomationProperties{ - // Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment"), - // Actions: []armsecurity.AutomationActionClassification{ - // &armsecurity.AutomationActionLogicApp{ - // ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - // LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - // }}, - // IsEnabled: to.Ptr(true), - // Scopes: []*armsecurity.AutomationScope{ - // { - // Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - // ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - // }}, - // Sources: []*armsecurity.AutomationSource{ - // { - // EventSource: to.Ptr(armsecurity.EventSourceAssessments), - // RuleSets: []*armsecurity.AutomationRuleSet{ - // { - // Rules: []*armsecurity.AutomationTriggeringRule{ - // { - // ExpectedValue: to.Ptr("customAssessment"), - // Operator: to.Ptr(armsecurity.OperatorEquals), - // PropertyJPath: to.Ptr("$.Entity.AssessmentType"), - // PropertyType: to.Ptr(armsecurity.PropertyTypeString), - // }}, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/PutAutomationAllAssessments_example.json -func ExampleAutomationsClient_CreateOrUpdate_createOrUpdateASecurityAutomationForAllAssessmentsIncludingAllSeverities() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutomationsClient().CreateOrUpdate(ctx, "exampleResourceGroup", "exampleAutomation", armsecurity.Automation{ - Location: to.Ptr("Central US"), - Etag: to.Ptr("etag value (must be supplied for update)"), - Tags: map[string]*string{}, - Properties: &armsecurity.AutomationProperties{ - Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment"), - Actions: []armsecurity.AutomationActionClassification{ - &armsecurity.AutomationActionLogicApp{ - ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - URI: to.Ptr("https://exampleTriggerUri1.com"), - }}, - IsEnabled: to.Ptr(true), - Scopes: []*armsecurity.AutomationScope{ - { - Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - }}, - Sources: []*armsecurity.AutomationSource{ - { - EventSource: to.Ptr(armsecurity.EventSourceAssessments), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Automation = armsecurity.Automation{ - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("new etag value"), - // Name: to.Ptr("exampleAutomation"), - // Type: to.Ptr("Microsoft.Security/automations"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/automations/exampleAutomation"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.AutomationProperties{ - // Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment"), - // Actions: []armsecurity.AutomationActionClassification{ - // &armsecurity.AutomationActionLogicApp{ - // ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - // LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - // }}, - // IsEnabled: to.Ptr(true), - // Scopes: []*armsecurity.AutomationScope{ - // { - // Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - // ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - // }}, - // Sources: []*armsecurity.AutomationSource{ - // { - // EventSource: to.Ptr(armsecurity.EventSourceAssessments), - // RuleSets: []*armsecurity.AutomationRuleSet{ - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/PutAutomationHighSeverityAssessments_example.json -func ExampleAutomationsClient_CreateOrUpdate_createOrUpdateASecurityAutomationForAllHighSeverityAssessments() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutomationsClient().CreateOrUpdate(ctx, "exampleResourceGroup", "exampleAutomation", armsecurity.Automation{ - Location: to.Ptr("Central US"), - Etag: to.Ptr("etag value (must be supplied for update)"), - Tags: map[string]*string{}, - Properties: &armsecurity.AutomationProperties{ - Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any high severity security assessment"), - Actions: []armsecurity.AutomationActionClassification{ - &armsecurity.AutomationActionLogicApp{ - ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - URI: to.Ptr("https://exampleTriggerUri1.com"), - }}, - IsEnabled: to.Ptr(true), - Scopes: []*armsecurity.AutomationScope{ - { - Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - }}, - Sources: []*armsecurity.AutomationSource{ - { - EventSource: to.Ptr(armsecurity.EventSourceAssessments), - RuleSets: []*armsecurity.AutomationRuleSet{ - { - Rules: []*armsecurity.AutomationTriggeringRule{ - { - ExpectedValue: to.Ptr("High"), - Operator: to.Ptr(armsecurity.OperatorEquals), - PropertyJPath: to.Ptr("properties.metadata.severity"), - PropertyType: to.Ptr(armsecurity.PropertyTypeString), - }}, - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Automation = armsecurity.Automation{ - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("new etag value"), - // Name: to.Ptr("exampleAutomation"), - // Type: to.Ptr("Microsoft.Security/automations"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/automations/exampleAutomation"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.AutomationProperties{ - // Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any high severity security assessment"), - // Actions: []armsecurity.AutomationActionClassification{ - // &armsecurity.AutomationActionLogicApp{ - // ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - // LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - // }}, - // IsEnabled: to.Ptr(true), - // Scopes: []*armsecurity.AutomationScope{ - // { - // Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - // ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - // }}, - // Sources: []*armsecurity.AutomationSource{ - // { - // EventSource: to.Ptr(armsecurity.EventSourceAssessments), - // RuleSets: []*armsecurity.AutomationRuleSet{ - // { - // Rules: []*armsecurity.AutomationTriggeringRule{ - // { - // ExpectedValue: to.Ptr("High"), - // Operator: to.Ptr(armsecurity.OperatorEquals), - // PropertyJPath: to.Ptr("properties.metadata.severity"), - // PropertyType: to.Ptr(armsecurity.PropertyTypeString), - // }}, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/PutDisableAutomation_example.json -func ExampleAutomationsClient_CreateOrUpdate_disableOrEnableASecurityAutomation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutomationsClient().CreateOrUpdate(ctx, "exampleResourceGroup", "exampleAutomation", armsecurity.Automation{ - Location: to.Ptr("Central US"), - Etag: to.Ptr("etag value (must be supplied for update)"), - Tags: map[string]*string{}, - Properties: &armsecurity.AutomationProperties{ - Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment"), - Actions: []armsecurity.AutomationActionClassification{ - &armsecurity.AutomationActionLogicApp{ - ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - URI: to.Ptr("https://exampleTriggerUri1.com"), - }}, - IsEnabled: to.Ptr(false), - Scopes: []*armsecurity.AutomationScope{ - { - Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - }}, - Sources: []*armsecurity.AutomationSource{ - { - EventSource: to.Ptr(armsecurity.EventSourceAssessments), - RuleSets: []*armsecurity.AutomationRuleSet{ - { - Rules: []*armsecurity.AutomationTriggeringRule{ - { - ExpectedValue: to.Ptr("customAssessment"), - Operator: to.Ptr(armsecurity.OperatorEquals), - PropertyJPath: to.Ptr("$.Entity.AssessmentType"), - PropertyType: to.Ptr(armsecurity.PropertyTypeString), - }}, - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Automation = armsecurity.Automation{ - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("new etag value"), - // Name: to.Ptr("exampleAutomation"), - // Type: to.Ptr("Microsoft.Security/automations"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/automations/exampleAutomation"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.AutomationProperties{ - // Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment"), - // Actions: []armsecurity.AutomationActionClassification{ - // &armsecurity.AutomationActionLogicApp{ - // ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - // LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - // }}, - // IsEnabled: to.Ptr(false), - // Scopes: []*armsecurity.AutomationScope{ - // { - // Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - // ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - // }}, - // Sources: []*armsecurity.AutomationSource{ - // { - // EventSource: to.Ptr(armsecurity.EventSourceAssessments), - // RuleSets: []*armsecurity.AutomationRuleSet{ - // { - // Rules: []*armsecurity.AutomationTriggeringRule{ - // { - // ExpectedValue: to.Ptr("customAssessment"), - // Operator: to.Ptr(armsecurity.OperatorEquals), - // PropertyJPath: to.Ptr("$.Entity.AssessmentType"), - // PropertyType: to.Ptr(armsecurity.PropertyTypeString), - // }}, - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/DeleteAutomation_example.json -func ExampleAutomationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewAutomationsClient().Delete(ctx, "myRg", "myAutomationName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/ValidateAutomation_example.json -func ExampleAutomationsClient_Validate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewAutomationsClient().Validate(ctx, "exampleResourceGroup", "exampleAutomation", armsecurity.Automation{ - Location: to.Ptr("Central US"), - Tags: map[string]*string{}, - Properties: &armsecurity.AutomationProperties{ - Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment"), - Actions: []armsecurity.AutomationActionClassification{ - &armsecurity.AutomationActionLogicApp{ - ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - URI: to.Ptr("https://exampleTriggerUri1.com"), - }}, - IsEnabled: to.Ptr(true), - Scopes: []*armsecurity.AutomationScope{ - { - Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - }}, - Sources: []*armsecurity.AutomationSource{ - { - EventSource: to.Ptr(armsecurity.EventSourceAssessments), - RuleSets: []*armsecurity.AutomationRuleSet{ - { - Rules: []*armsecurity.AutomationTriggeringRule{ - { - ExpectedValue: to.Ptr("customAssessment"), - Operator: to.Ptr(armsecurity.OperatorEquals), - PropertyJPath: to.Ptr("$.Entity.AssessmentType"), - PropertyType: to.Ptr(armsecurity.PropertyTypeString), - }}, - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AutomationValidationStatus = armsecurity.AutomationValidationStatus{ - // IsValid: to.Ptr(true), - // Message: to.Ptr("Validation Successful"), - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/autoprovisioningsettings_client.go b/sdk/resourcemanager/security/armsecurity/autoprovisioningsettings_client.go index 6a16536326fe..5f908d58f98e 100644 --- a/sdk/resourcemanager/security/armsecurity/autoprovisioningsettings_client.go +++ b/sdk/resourcemanager/security/armsecurity/autoprovisioningsettings_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -53,18 +52,21 @@ func NewAutoProvisioningSettingsClient(subscriptionID string, credential azcore. // - options - AutoProvisioningSettingsClientCreateOptions contains the optional parameters for the AutoProvisioningSettingsClient.Create // method. func (client *AutoProvisioningSettingsClient) Create(ctx context.Context, settingName string, setting AutoProvisioningSetting, options *AutoProvisioningSettingsClientCreateOptions) (AutoProvisioningSettingsClientCreateResponse, error) { + var err error req, err := client.createCreateRequest(ctx, settingName, setting, options) if err != nil { return AutoProvisioningSettingsClientCreateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AutoProvisioningSettingsClientCreateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AutoProvisioningSettingsClientCreateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AutoProvisioningSettingsClientCreateResponse{}, err } - return client.createHandleResponse(resp) + resp, err := client.createHandleResponse(httpResp) + return resp, err } // createCreateRequest creates the Create request. @@ -86,7 +88,10 @@ func (client *AutoProvisioningSettingsClient) createCreateRequest(ctx context.Co reqQP.Set("api-version", "2017-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, setting) + if err := runtime.MarshalAsJSON(req, setting); err != nil { + return nil, err + } + return req, nil } // createHandleResponse handles the Create response. @@ -106,18 +111,21 @@ func (client *AutoProvisioningSettingsClient) createHandleResponse(resp *http.Re // - options - AutoProvisioningSettingsClientGetOptions contains the optional parameters for the AutoProvisioningSettingsClient.Get // method. func (client *AutoProvisioningSettingsClient) Get(ctx context.Context, settingName string, options *AutoProvisioningSettingsClientGetOptions) (AutoProvisioningSettingsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, settingName, options) if err != nil { return AutoProvisioningSettingsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return AutoProvisioningSettingsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return AutoProvisioningSettingsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AutoProvisioningSettingsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 58a1b362ff4b..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 b37afc7344af..0802615e1865 100644 --- a/sdk/resourcemanager/security/armsecurity/autorest.md +++ b/sdk/resourcemanager/security/armsecurity/autorest.md @@ -4,10 +4,9 @@ ``` yaml azure-arm: true -tag: package-composite-v3 require: -- https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/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.11.0 +module-version: 0.12.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/security/armsecurity/azuredevopsorgs_client.go b/sdk/resourcemanager/security/armsecurity/azuredevopsorgs_client.go new file mode 100644 index 000000000000..90d39c93efd9 --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/azuredevopsorgs_client.go @@ -0,0 +1,398 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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" +) + +// AzureDevOpsOrgsClient contains the methods for the AzureDevOpsOrgs group. +// Don't use this type directly, use NewAzureDevOpsOrgsClient() instead. +type AzureDevOpsOrgsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAzureDevOpsOrgsClient creates a new instance of AzureDevOpsOrgsClient 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 NewAzureDevOpsOrgsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AzureDevOpsOrgsClient, error) { + cl, err := arm.NewClient(moduleName+".AzureDevOpsOrgsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AzureDevOpsOrgsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - orgName - The Azure DevOps organization name. +// - azureDevOpsOrg - The Azure DevOps organization resource payload. +// - options - AzureDevOpsOrgsClientBeginCreateOrUpdateOptions contains the optional parameters for the AzureDevOpsOrgsClient.BeginCreateOrUpdate +// method. +func (client *AzureDevOpsOrgsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, azureDevOpsOrg AzureDevOpsOrg, options *AzureDevOpsOrgsClientBeginCreateOrUpdateOptions) (*runtime.Poller[AzureDevOpsOrgsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AzureDevOpsOrgsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[AzureDevOpsOrgsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 +func (client *AzureDevOpsOrgsClient) createOrUpdate(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, azureDevOpsOrg AzureDevOpsOrg, options *AzureDevOpsOrgsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, 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.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// 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) { + 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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + if orgName == "" { + return nil, errors.New("parameter orgName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{orgName}", url.PathEscape(orgName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, azureDevOpsOrg); err != nil { + return nil, err + } + return req, nil +} + +// 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 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - orgName - The Azure DevOps organization name. +// - options - AzureDevOpsOrgsClientGetOptions contains the optional parameters for the AzureDevOpsOrgsClient.Get method. +func (client *AzureDevOpsOrgsClient) Get(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, options *AzureDevOpsOrgsClientGetOptions) (AzureDevOpsOrgsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, securityConnectorName, orgName, options) + if err != nil { + return AzureDevOpsOrgsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AzureDevOpsOrgsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AzureDevOpsOrgsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *AzureDevOpsOrgsClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + if orgName == "" { + return nil, errors.New("parameter orgName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{orgName}", url.PathEscape(orgName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AzureDevOpsOrgsClient) getHandleResponse(resp *http.Response) (AzureDevOpsOrgsClientGetResponse, error) { + result := AzureDevOpsOrgsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AzureDevOpsOrg); err != nil { + return AzureDevOpsOrgsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Returns a list of Azure DevOps organizations onboarded to the connector. +// +// Generated from API version 2023-09-01-preview +// - 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 +// method. +func (client *AzureDevOpsOrgsClient) NewListPager(resourceGroupName string, securityConnectorName string, options *AzureDevOpsOrgsClientListOptions) *runtime.Pager[AzureDevOpsOrgsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[AzureDevOpsOrgsClientListResponse]{ + More: func(page AzureDevOpsOrgsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AzureDevOpsOrgsClientListResponse) (AzureDevOpsOrgsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, securityConnectorName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AzureDevOpsOrgsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AzureDevOpsOrgsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AzureDevOpsOrgsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *AzureDevOpsOrgsClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *AzureDevOpsOrgsClient) listHandleResponse(resp *http.Response) (AzureDevOpsOrgsClientListResponse, error) { + result := AzureDevOpsOrgsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AzureDevOpsOrgListResponse); err != nil { + return AzureDevOpsOrgsClientListResponse{}, err + } + return result, nil +} + +// 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 +// - 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 +// method. +func (client *AzureDevOpsOrgsClient) ListAvailable(ctx context.Context, resourceGroupName string, securityConnectorName string, options *AzureDevOpsOrgsClientListAvailableOptions) (AzureDevOpsOrgsClientListAvailableResponse, error) { + var err error + req, err := client.listAvailableCreateRequest(ctx, resourceGroupName, securityConnectorName, options) + if err != nil { + return AzureDevOpsOrgsClientListAvailableResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AzureDevOpsOrgsClientListAvailableResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AzureDevOpsOrgsClientListAvailableResponse{}, err + } + resp, err := client.listAvailableHandleResponse(httpResp) + return resp, err +} + +// listAvailableCreateRequest creates the ListAvailable request. +func (client *AzureDevOpsOrgsClient) listAvailableCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAvailableHandleResponse handles the ListAvailable response. +func (client *AzureDevOpsOrgsClient) listAvailableHandleResponse(resp *http.Response) (AzureDevOpsOrgsClientListAvailableResponse, error) { + result := AzureDevOpsOrgsClientListAvailableResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AzureDevOpsOrgListResponse); err != nil { + return AzureDevOpsOrgsClientListAvailableResponse{}, err + } + return result, nil +} + +// 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 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - orgName - The Azure DevOps organization name. +// - azureDevOpsOrg - The Azure DevOps organization resource payload. +// - options - AzureDevOpsOrgsClientBeginUpdateOptions contains the optional parameters for the AzureDevOpsOrgsClient.BeginUpdate +// method. +func (client *AzureDevOpsOrgsClient) BeginUpdate(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, azureDevOpsOrg AzureDevOpsOrg, options *AzureDevOpsOrgsClientBeginUpdateOptions) (*runtime.Poller[AzureDevOpsOrgsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AzureDevOpsOrgsClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[AzureDevOpsOrgsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 +func (client *AzureDevOpsOrgsClient) update(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, azureDevOpsOrg AzureDevOpsOrg, options *AzureDevOpsOrgsClientBeginUpdateOptions) (*http.Response, error) { + var err error + req, err := client.updateCreateRequest(ctx, resourceGroupName, securityConnectorName, orgName, azureDevOpsOrg, 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 +} + +// 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) { + 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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + if orgName == "" { + return nil, errors.New("parameter orgName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{orgName}", url.PathEscape(orgName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, azureDevOpsOrg); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/azuredevopsprojects_client.go b/sdk/resourcemanager/security/armsecurity/azuredevopsprojects_client.go new file mode 100644 index 000000000000..9cf40ed54cd5 --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/azuredevopsprojects_client.go @@ -0,0 +1,357 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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" +) + +// AzureDevOpsProjectsClient contains the methods for the AzureDevOpsProjects group. +// Don't use this type directly, use NewAzureDevOpsProjectsClient() instead. +type AzureDevOpsProjectsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAzureDevOpsProjectsClient creates a new instance of AzureDevOpsProjectsClient 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 NewAzureDevOpsProjectsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AzureDevOpsProjectsClient, error) { + cl, err := arm.NewClient(moduleName+".AzureDevOpsProjectsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AzureDevOpsProjectsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - orgName - The Azure DevOps organization name. +// - projectName - The project name. +// - azureDevOpsProject - The Azure DevOps project resource payload. +// - options - AzureDevOpsProjectsClientBeginCreateOrUpdateOptions contains the optional parameters for the AzureDevOpsProjectsClient.BeginCreateOrUpdate +// method. +func (client *AzureDevOpsProjectsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, projectName string, azureDevOpsProject AzureDevOpsProject, options *AzureDevOpsProjectsClientBeginCreateOrUpdateOptions) (*runtime.Poller[AzureDevOpsProjectsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AzureDevOpsProjectsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[AzureDevOpsProjectsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 +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 + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject, 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.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// 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) { + 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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + if orgName == "" { + return nil, errors.New("parameter orgName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{orgName}", url.PathEscape(orgName)) + if projectName == "" { + return nil, errors.New("parameter projectName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{projectName}", url.PathEscape(projectName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, azureDevOpsProject); err != nil { + return nil, err + } + return req, nil +} + +// 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 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - orgName - The Azure DevOps organization name. +// - projectName - The project name. +// - options - AzureDevOpsProjectsClientGetOptions contains the optional parameters for the AzureDevOpsProjectsClient.Get method. +func (client *AzureDevOpsProjectsClient) Get(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, projectName string, options *AzureDevOpsProjectsClientGetOptions) (AzureDevOpsProjectsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, securityConnectorName, orgName, projectName, options) + if err != nil { + return AzureDevOpsProjectsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AzureDevOpsProjectsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AzureDevOpsProjectsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// 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) { + 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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + if orgName == "" { + return nil, errors.New("parameter orgName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{orgName}", url.PathEscape(orgName)) + if projectName == "" { + return nil, errors.New("parameter projectName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{projectName}", url.PathEscape(projectName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AzureDevOpsProjectsClient) getHandleResponse(resp *http.Response) (AzureDevOpsProjectsClientGetResponse, error) { + result := AzureDevOpsProjectsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AzureDevOpsProject); err != nil { + return AzureDevOpsProjectsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Returns a list of Azure DevOps projects onboarded to the connector. +// +// Generated from API version 2023-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - orgName - The Azure DevOps organization name. +// - options - AzureDevOpsProjectsClientListOptions contains the optional parameters for the AzureDevOpsProjectsClient.NewListPager +// method. +func (client *AzureDevOpsProjectsClient) NewListPager(resourceGroupName string, securityConnectorName string, orgName string, options *AzureDevOpsProjectsClientListOptions) *runtime.Pager[AzureDevOpsProjectsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[AzureDevOpsProjectsClientListResponse]{ + More: func(page AzureDevOpsProjectsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AzureDevOpsProjectsClientListResponse) (AzureDevOpsProjectsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, securityConnectorName, orgName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AzureDevOpsProjectsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AzureDevOpsProjectsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AzureDevOpsProjectsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *AzureDevOpsProjectsClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + if orgName == "" { + return nil, errors.New("parameter orgName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{orgName}", url.PathEscape(orgName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *AzureDevOpsProjectsClient) listHandleResponse(resp *http.Response) (AzureDevOpsProjectsClientListResponse, error) { + result := AzureDevOpsProjectsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AzureDevOpsProjectListResponse); err != nil { + return AzureDevOpsProjectsClientListResponse{}, err + } + return result, nil +} + +// 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 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - orgName - The Azure DevOps organization name. +// - projectName - The project name. +// - azureDevOpsProject - The Azure DevOps project resource payload. +// - options - AzureDevOpsProjectsClientBeginUpdateOptions contains the optional parameters for the AzureDevOpsProjectsClient.BeginUpdate +// method. +func (client *AzureDevOpsProjectsClient) BeginUpdate(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, projectName string, azureDevOpsProject AzureDevOpsProject, options *AzureDevOpsProjectsClientBeginUpdateOptions) (*runtime.Poller[AzureDevOpsProjectsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AzureDevOpsProjectsClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[AzureDevOpsProjectsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 +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 + req, err := client.updateCreateRequest(ctx, resourceGroupName, securityConnectorName, orgName, projectName, azureDevOpsProject, 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 +} + +// 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) { + 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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + if orgName == "" { + return nil, errors.New("parameter orgName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{orgName}", url.PathEscape(orgName)) + if projectName == "" { + return nil, errors.New("parameter projectName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{projectName}", url.PathEscape(projectName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, azureDevOpsProject); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/azuredevopsrepos_client.go b/sdk/resourcemanager/security/armsecurity/azuredevopsrepos_client.go new file mode 100644 index 000000000000..1a7dc95f8fd7 --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/azuredevopsrepos_client.go @@ -0,0 +1,377 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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" +) + +// AzureDevOpsReposClient contains the methods for the AzureDevOpsRepos group. +// Don't use this type directly, use NewAzureDevOpsReposClient() instead. +type AzureDevOpsReposClient struct { + internal *arm.Client + subscriptionID string +} + +// NewAzureDevOpsReposClient creates a new instance of AzureDevOpsReposClient 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 NewAzureDevOpsReposClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AzureDevOpsReposClient, error) { + cl, err := arm.NewClient(moduleName+".AzureDevOpsReposClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &AzureDevOpsReposClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - orgName - The Azure DevOps organization name. +// - projectName - The project name. +// - repoName - The repository name. +// - azureDevOpsRepository - The Azure DevOps repository resource payload. +// - options - AzureDevOpsReposClientBeginCreateOrUpdateOptions contains the optional parameters for the AzureDevOpsReposClient.BeginCreateOrUpdate +// method. +func (client *AzureDevOpsReposClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, projectName string, repoName string, azureDevOpsRepository AzureDevOpsRepository, options *AzureDevOpsReposClientBeginCreateOrUpdateOptions) (*runtime.Poller[AzureDevOpsReposClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, securityConnectorName, orgName, projectName, repoName, azureDevOpsRepository, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AzureDevOpsReposClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[AzureDevOpsReposClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 +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 + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, securityConnectorName, orgName, projectName, repoName, azureDevOpsRepository, 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.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// 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) { + 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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + if orgName == "" { + return nil, errors.New("parameter orgName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{orgName}", url.PathEscape(orgName)) + if projectName == "" { + return nil, errors.New("parameter projectName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{projectName}", url.PathEscape(projectName)) + if repoName == "" { + return nil, errors.New("parameter repoName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{repoName}", url.PathEscape(repoName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, azureDevOpsRepository); err != nil { + return nil, err + } + return req, nil +} + +// 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 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - orgName - The Azure DevOps organization name. +// - projectName - The project name. +// - repoName - The repository name. +// - options - AzureDevOpsReposClientGetOptions contains the optional parameters for the AzureDevOpsReposClient.Get method. +func (client *AzureDevOpsReposClient) Get(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, projectName string, repoName string, options *AzureDevOpsReposClientGetOptions) (AzureDevOpsReposClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, securityConnectorName, orgName, projectName, repoName, options) + if err != nil { + return AzureDevOpsReposClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AzureDevOpsReposClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return AzureDevOpsReposClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// 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) { + 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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + if orgName == "" { + return nil, errors.New("parameter orgName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{orgName}", url.PathEscape(orgName)) + if projectName == "" { + return nil, errors.New("parameter projectName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{projectName}", url.PathEscape(projectName)) + if repoName == "" { + return nil, errors.New("parameter repoName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{repoName}", url.PathEscape(repoName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AzureDevOpsReposClient) getHandleResponse(resp *http.Response) (AzureDevOpsReposClientGetResponse, error) { + result := AzureDevOpsReposClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AzureDevOpsRepository); err != nil { + return AzureDevOpsReposClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Returns a list of Azure DevOps repositories onboarded to the connector. +// +// Generated from API version 2023-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - orgName - The Azure DevOps organization name. +// - projectName - The project name. +// - options - AzureDevOpsReposClientListOptions contains the optional parameters for the AzureDevOpsReposClient.NewListPager +// method. +func (client *AzureDevOpsReposClient) NewListPager(resourceGroupName string, securityConnectorName string, orgName string, projectName string, options *AzureDevOpsReposClientListOptions) *runtime.Pager[AzureDevOpsReposClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[AzureDevOpsReposClientListResponse]{ + More: func(page AzureDevOpsReposClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AzureDevOpsReposClientListResponse) (AzureDevOpsReposClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, securityConnectorName, orgName, projectName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AzureDevOpsReposClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return AzureDevOpsReposClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AzureDevOpsReposClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// 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) { + 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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + if orgName == "" { + return nil, errors.New("parameter orgName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{orgName}", url.PathEscape(orgName)) + if projectName == "" { + return nil, errors.New("parameter projectName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{projectName}", url.PathEscape(projectName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *AzureDevOpsReposClient) listHandleResponse(resp *http.Response) (AzureDevOpsReposClientListResponse, error) { + result := AzureDevOpsReposClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AzureDevOpsRepositoryListResponse); err != nil { + return AzureDevOpsReposClientListResponse{}, err + } + return result, nil +} + +// 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 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - orgName - The Azure DevOps organization name. +// - projectName - The project name. +// - repoName - The repository name. +// - azureDevOpsRepository - The Azure DevOps repository resource payload. +// - options - AzureDevOpsReposClientBeginUpdateOptions contains the optional parameters for the AzureDevOpsReposClient.BeginUpdate +// method. +func (client *AzureDevOpsReposClient) BeginUpdate(ctx context.Context, resourceGroupName string, securityConnectorName string, orgName string, projectName string, repoName string, azureDevOpsRepository AzureDevOpsRepository, options *AzureDevOpsReposClientBeginUpdateOptions) (*runtime.Poller[AzureDevOpsReposClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, securityConnectorName, orgName, projectName, repoName, azureDevOpsRepository, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[AzureDevOpsReposClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[AzureDevOpsReposClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 +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 + req, err := client.updateCreateRequest(ctx, resourceGroupName, securityConnectorName, orgName, projectName, repoName, azureDevOpsRepository, 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 +} + +// 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) { + 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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + if orgName == "" { + return nil, errors.New("parameter orgName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{orgName}", url.PathEscape(orgName)) + if projectName == "" { + return nil, errors.New("parameter projectName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{projectName}", url.PathEscape(projectName)) + if repoName == "" { + return nil, errors.New("parameter repoName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{repoName}", url.PathEscape(repoName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, azureDevOpsRepository); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/center_client.go b/sdk/resourcemanager/security/armsecurity/center_client.go index 319d90c943e3..484256e3f86a 100644 --- a/sdk/resourcemanager/security/armsecurity/center_client.go +++ b/sdk/resourcemanager/security/armsecurity/center_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -45,18 +44,21 @@ func NewCenterClient(credential azcore.TokenCredential, options *arm.ClientOptio // - options - CenterClientGetSensitivitySettingsOptions contains the optional parameters for the CenterClient.GetSensitivitySettings // method. func (client *CenterClient) GetSensitivitySettings(ctx context.Context, options *CenterClientGetSensitivitySettingsOptions) (CenterClientGetSensitivitySettingsResponse, error) { + var err error req, err := client.getSensitivitySettingsCreateRequest(ctx, options) if err != nil { return CenterClientGetSensitivitySettingsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CenterClientGetSensitivitySettingsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CenterClientGetSensitivitySettingsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CenterClientGetSensitivitySettingsResponse{}, err } - return client.getSensitivitySettingsHandleResponse(resp) + resp, err := client.getSensitivitySettingsHandleResponse(httpResp) + return resp, err } // getSensitivitySettingsCreateRequest creates the GetSensitivitySettings request. @@ -90,18 +92,21 @@ func (client *CenterClient) getSensitivitySettingsHandleResponse(resp *http.Resp // - options - CenterClientUpdateSensitivitySettingsOptions contains the optional parameters for the CenterClient.UpdateSensitivitySettings // method. func (client *CenterClient) UpdateSensitivitySettings(ctx context.Context, sensitivitySettings UpdateSensitivitySettingsRequest, options *CenterClientUpdateSensitivitySettingsOptions) (CenterClientUpdateSensitivitySettingsResponse, error) { + var err error req, err := client.updateSensitivitySettingsCreateRequest(ctx, sensitivitySettings, options) if err != nil { return CenterClientUpdateSensitivitySettingsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CenterClientUpdateSensitivitySettingsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CenterClientUpdateSensitivitySettingsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CenterClientUpdateSensitivitySettingsResponse{}, err } - return client.updateSensitivitySettingsHandleResponse(resp) + resp, err := client.updateSensitivitySettingsHandleResponse(httpResp) + return resp, err } // updateSensitivitySettingsCreateRequest creates the UpdateSensitivitySettings request. @@ -115,7 +120,10 @@ func (client *CenterClient) updateSensitivitySettingsCreateRequest(ctx context.C reqQP.Set("api-version", "2023-02-15-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, sensitivitySettings) + if err := runtime.MarshalAsJSON(req, sensitivitySettings); err != nil { + return nil, err + } + return req, nil } // updateSensitivitySettingsHandleResponse handles the UpdateSensitivitySettings response. diff --git a/sdk/resourcemanager/security/armsecurity/center_client_example_test.go b/sdk/resourcemanager/security/armsecurity/center_client_example_test.go deleted file mode 100644 index cfd3701071d8..000000000000 --- a/sdk/resourcemanager/security/armsecurity/center_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/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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2023-02-15-preview/examples/SensitivitySettings/PutSensitivitySettings_example.json -func ExampleCenterClient_UpdateSensitivitySettings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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.NewCenterClient().UpdateSensitivitySettings(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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2023-02-15-preview/examples/SensitivitySettings/GetSensitivitySettings_example.json -func ExampleCenterClient_GetSensitivitySettings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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.NewCenterClient().GetSensitivitySettings(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), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/client_factory.go b/sdk/resourcemanager/security/armsecurity/client_factory.go index 5cfd759f9327..5d666ce2889c 100644 --- a/sdk/resourcemanager/security/armsecurity/client_factory.go +++ b/sdk/resourcemanager/security/armsecurity/client_factory.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -38,78 +37,98 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -func (c *ClientFactory) NewMdeOnboardingsClient() *MdeOnboardingsClient { - subClient, _ := NewMdeOnboardingsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAPICollectionsClient() *APICollectionsClient { + subClient, _ := NewAPICollectionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewCustomAssessmentAutomationsClient() *CustomAssessmentAutomationsClient { - subClient, _ := NewCustomAssessmentAutomationsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAccountConnectorsClient() *AccountConnectorsClient { + subClient, _ := NewAccountConnectorsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewCustomEntityStoreAssignmentsClient() *CustomEntityStoreAssignmentsClient { - subClient, _ := NewCustomEntityStoreAssignmentsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAdaptiveApplicationControlsClient() *AdaptiveApplicationControlsClient { + subClient, _ := NewAdaptiveApplicationControlsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewComplianceResultsClient() *ComplianceResultsClient { - subClient, _ := NewComplianceResultsClient(c.credential, c.options) +func (c *ClientFactory) NewAdaptiveNetworkHardeningsClient() *AdaptiveNetworkHardeningsClient { + subClient, _ := NewAdaptiveNetworkHardeningsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewPricingsClient() *PricingsClient { - subClient, _ := NewPricingsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAdvancedThreatProtectionClient() *AdvancedThreatProtectionClient { + subClient, _ := NewAdvancedThreatProtectionClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewAdvancedThreatProtectionClient() *AdvancedThreatProtectionClient { - subClient, _ := NewAdvancedThreatProtectionClient(c.credential, c.options) +func (c *ClientFactory) NewAlertsClient() *AlertsClient { + subClient, _ := NewAlertsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDeviceSecurityGroupsClient() *DeviceSecurityGroupsClient { - subClient, _ := NewDeviceSecurityGroupsClient(c.credential, c.options) +func (c *ClientFactory) NewAlertsSuppressionRulesClient() *AlertsSuppressionRulesClient { + subClient, _ := NewAlertsSuppressionRulesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewIotSecuritySolutionClient() *IotSecuritySolutionClient { - subClient, _ := NewIotSecuritySolutionClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAllowedConnectionsClient() *AllowedConnectionsClient { + subClient, _ := NewAllowedConnectionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewIotSecuritySolutionAnalyticsClient() *IotSecuritySolutionAnalyticsClient { - subClient, _ := NewIotSecuritySolutionAnalyticsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewApplicationClient() *ApplicationClient { + subClient, _ := NewApplicationClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewIotSecuritySolutionsAnalyticsAggregatedAlertClient() *IotSecuritySolutionsAnalyticsAggregatedAlertClient { - subClient, _ := NewIotSecuritySolutionsAnalyticsAggregatedAlertClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewApplicationsClient() *ApplicationsClient { + subClient, _ := NewApplicationsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewIotSecuritySolutionsAnalyticsRecommendationClient() *IotSecuritySolutionsAnalyticsRecommendationClient { - subClient, _ := NewIotSecuritySolutionsAnalyticsRecommendationClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAssessmentsClient() *AssessmentsClient { + subClient, _ := NewAssessmentsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewLocationsClient() *LocationsClient { - subClient, _ := NewLocationsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAssessmentsMetadataClient() *AssessmentsMetadataClient { + subClient, _ := NewAssessmentsMetadataClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) +func (c *ClientFactory) NewAutoProvisioningSettingsClient() *AutoProvisioningSettingsClient { + subClient, _ := NewAutoProvisioningSettingsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewTasksClient() *TasksClient { - subClient, _ := NewTasksClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAutomationsClient() *AutomationsClient { + subClient, _ := NewAutomationsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAutoProvisioningSettingsClient() *AutoProvisioningSettingsClient { - subClient, _ := NewAutoProvisioningSettingsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewAzureDevOpsOrgsClient() *AzureDevOpsOrgsClient { + subClient, _ := NewAzureDevOpsOrgsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewAzureDevOpsProjectsClient() *AzureDevOpsProjectsClient { + subClient, _ := NewAzureDevOpsProjectsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewAzureDevOpsReposClient() *AzureDevOpsReposClient { + subClient, _ := NewAzureDevOpsReposClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewCenterClient() *CenterClient { + subClient, _ := NewCenterClient(c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewComplianceResultsClient() *ComplianceResultsClient { + subClient, _ := NewComplianceResultsClient(c.credential, c.options) return subClient } @@ -118,8 +137,18 @@ func (c *ClientFactory) NewCompliancesClient() *CompliancesClient { return subClient } -func (c *ClientFactory) NewInformationProtectionPoliciesClient() *InformationProtectionPoliciesClient { - subClient, _ := NewInformationProtectionPoliciesClient(c.credential, c.options) +func (c *ClientFactory) NewConnectorApplicationClient() *ConnectorApplicationClient { + subClient, _ := NewConnectorApplicationClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewConnectorApplicationsClient() *ConnectorApplicationsClient { + subClient, _ := NewConnectorApplicationsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewConnectorsClient() *ConnectorsClient { + subClient, _ := NewConnectorsClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -128,227 +157,237 @@ func (c *ClientFactory) NewContactsClient() *ContactsClient { return subClient } -func (c *ClientFactory) NewWorkspaceSettingsClient() *WorkspaceSettingsClient { - subClient, _ := NewWorkspaceSettingsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewCustomAssessmentAutomationsClient() *CustomAssessmentAutomationsClient { + subClient, _ := NewCustomAssessmentAutomationsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewRegulatoryComplianceStandardsClient() *RegulatoryComplianceStandardsClient { - subClient, _ := NewRegulatoryComplianceStandardsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewCustomEntityStoreAssignmentsClient() *CustomEntityStoreAssignmentsClient { + subClient, _ := NewCustomEntityStoreAssignmentsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewRegulatoryComplianceControlsClient() *RegulatoryComplianceControlsClient { - subClient, _ := NewRegulatoryComplianceControlsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDefenderForStorageClient() *DefenderForStorageClient { + subClient, _ := NewDefenderForStorageClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewRegulatoryComplianceAssessmentsClient() *RegulatoryComplianceAssessmentsClient { - subClient, _ := NewRegulatoryComplianceAssessmentsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDevOpsConfigurationsClient() *DevOpsConfigurationsClient { + subClient, _ := NewDevOpsConfigurationsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSubAssessmentsClient() *SubAssessmentsClient { - subClient, _ := NewSubAssessmentsClient(c.credential, c.options) +func (c *ClientFactory) NewDevOpsOperationResultsClient() *DevOpsOperationResultsClient { + subClient, _ := NewDevOpsOperationResultsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAutomationsClient() *AutomationsClient { - subClient, _ := NewAutomationsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDeviceSecurityGroupsClient() *DeviceSecurityGroupsClient { + subClient, _ := NewDeviceSecurityGroupsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewAlertsSuppressionRulesClient() *AlertsSuppressionRulesClient { - subClient, _ := NewAlertsSuppressionRulesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDiscoveredSecuritySolutionsClient() *DiscoveredSecuritySolutionsClient { + subClient, _ := NewDiscoveredSecuritySolutionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewServerVulnerabilityAssessmentClient() *ServerVulnerabilityAssessmentClient { - subClient, _ := NewServerVulnerabilityAssessmentClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewExternalSecuritySolutionsClient() *ExternalSecuritySolutionsClient { + subClient, _ := NewExternalSecuritySolutionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAssessmentsMetadataClient() *AssessmentsMetadataClient { - subClient, _ := NewAssessmentsMetadataClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewGitHubOwnersClient() *GitHubOwnersClient { + subClient, _ := NewGitHubOwnersClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAssessmentsClient() *AssessmentsClient { - subClient, _ := NewAssessmentsClient(c.credential, c.options) +func (c *ClientFactory) NewGitHubReposClient() *GitHubReposClient { + subClient, _ := NewGitHubReposClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAdaptiveApplicationControlsClient() *AdaptiveApplicationControlsClient { - subClient, _ := NewAdaptiveApplicationControlsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewGitLabGroupsClient() *GitLabGroupsClient { + subClient, _ := NewGitLabGroupsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAdaptiveNetworkHardeningsClient() *AdaptiveNetworkHardeningsClient { - subClient, _ := NewAdaptiveNetworkHardeningsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewGitLabProjectsClient() *GitLabProjectsClient { + subClient, _ := NewGitLabProjectsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAllowedConnectionsClient() *AllowedConnectionsClient { - subClient, _ := NewAllowedConnectionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewGitLabSubgroupsClient() *GitLabSubgroupsClient { + subClient, _ := NewGitLabSubgroupsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewTopologyClient() *TopologyClient { - subClient, _ := NewTopologyClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewGovernanceAssignmentsClient() *GovernanceAssignmentsClient { + subClient, _ := NewGovernanceAssignmentsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewJitNetworkAccessPoliciesClient() *JitNetworkAccessPoliciesClient { - subClient, _ := NewJitNetworkAccessPoliciesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewGovernanceRulesClient() *GovernanceRulesClient { + subClient, _ := NewGovernanceRulesClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewDiscoveredSecuritySolutionsClient() *DiscoveredSecuritySolutionsClient { - subClient, _ := NewDiscoveredSecuritySolutionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewHealthReportsClient() *HealthReportsClient { + subClient, _ := NewHealthReportsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewSolutionsReferenceDataClient() *SolutionsReferenceDataClient { - subClient, _ := NewSolutionsReferenceDataClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewInformationProtectionPoliciesClient() *InformationProtectionPoliciesClient { + subClient, _ := NewInformationProtectionPoliciesClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewExternalSecuritySolutionsClient() *ExternalSecuritySolutionsClient { - subClient, _ := NewExternalSecuritySolutionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewIotSecuritySolutionAnalyticsClient() *IotSecuritySolutionAnalyticsClient { + subClient, _ := NewIotSecuritySolutionAnalyticsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSecureScoresClient() *SecureScoresClient { - subClient, _ := NewSecureScoresClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewIotSecuritySolutionClient() *IotSecuritySolutionClient { + subClient, _ := NewIotSecuritySolutionClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSecureScoreControlsClient() *SecureScoreControlsClient { - subClient, _ := NewSecureScoreControlsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewIotSecuritySolutionsAnalyticsAggregatedAlertClient() *IotSecuritySolutionsAnalyticsAggregatedAlertClient { + subClient, _ := NewIotSecuritySolutionsAnalyticsAggregatedAlertClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSecureScoreControlDefinitionsClient() *SecureScoreControlDefinitionsClient { - subClient, _ := NewSecureScoreControlDefinitionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewIotSecuritySolutionsAnalyticsRecommendationClient() *IotSecuritySolutionsAnalyticsRecommendationClient { + subClient, _ := NewIotSecuritySolutionsAnalyticsRecommendationClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSolutionsClient() *SolutionsClient { - subClient, _ := NewSolutionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewJitNetworkAccessPoliciesClient() *JitNetworkAccessPoliciesClient { + subClient, _ := NewJitNetworkAccessPoliciesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAccountConnectorsClient() *AccountConnectorsClient { - subClient, _ := NewAccountConnectorsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewLocationsClient() *LocationsClient { + subClient, _ := NewLocationsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewCenterClient() *CenterClient { - subClient, _ := NewCenterClient(c.credential, c.options) +func (c *ClientFactory) NewMdeOnboardingsClient() *MdeOnboardingsClient { + subClient, _ := NewMdeOnboardingsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSensitivitySettingsClient() *SensitivitySettingsClient { - subClient, _ := NewSensitivitySettingsClient(c.credential, c.options) +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewAlertsClient() *AlertsClient { - subClient, _ := NewAlertsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewOperatorsClient() *OperatorsClient { + subClient, _ := NewOperatorsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSettingsClient() *SettingsClient { - subClient, _ := NewSettingsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewPricingsClient() *PricingsClient { + subClient, _ := NewPricingsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewIngestionSettingsClient() *IngestionSettingsClient { - subClient, _ := NewIngestionSettingsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewRegulatoryComplianceAssessmentsClient() *RegulatoryComplianceAssessmentsClient { + subClient, _ := NewRegulatoryComplianceAssessmentsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSoftwareInventoriesClient() *SoftwareInventoriesClient { - subClient, _ := NewSoftwareInventoriesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewRegulatoryComplianceControlsClient() *RegulatoryComplianceControlsClient { + subClient, _ := NewRegulatoryComplianceControlsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewGovernanceRulesClient() *GovernanceRulesClient { - subClient, _ := NewGovernanceRulesClient(c.credential, c.options) +func (c *ClientFactory) NewRegulatoryComplianceStandardsClient() *RegulatoryComplianceStandardsClient { + subClient, _ := NewRegulatoryComplianceStandardsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewGovernanceAssignmentsClient() *GovernanceAssignmentsClient { - subClient, _ := NewGovernanceAssignmentsClient(c.credential, c.options) +func (c *ClientFactory) NewSQLVulnerabilityAssessmentBaselineRulesClient() *SQLVulnerabilityAssessmentBaselineRulesClient { + subClient, _ := NewSQLVulnerabilityAssessmentBaselineRulesClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewApplicationsClient() *ApplicationsClient { - subClient, _ := NewApplicationsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSQLVulnerabilityAssessmentScanResultsClient() *SQLVulnerabilityAssessmentScanResultsClient { + subClient, _ := NewSQLVulnerabilityAssessmentScanResultsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewApplicationClient() *ApplicationClient { - subClient, _ := NewApplicationClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSQLVulnerabilityAssessmentScansClient() *SQLVulnerabilityAssessmentScansClient { + subClient, _ := NewSQLVulnerabilityAssessmentScansClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewConnectorApplicationsClient() *ConnectorApplicationsClient { - subClient, _ := NewConnectorApplicationsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSecureScoreControlDefinitionsClient() *SecureScoreControlDefinitionsClient { + subClient, _ := NewSecureScoreControlDefinitionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewConnectorApplicationClient() *ConnectorApplicationClient { - subClient, _ := NewConnectorApplicationClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSecureScoreControlsClient() *SecureScoreControlsClient { + subClient, _ := NewSecureScoreControlsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAPICollectionClient() *APICollectionClient { - subClient, _ := NewAPICollectionClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSecureScoresClient() *SecureScoresClient { + subClient, _ := NewSecureScoresClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAPICollectionOnboardingClient() *APICollectionOnboardingClient { - subClient, _ := NewAPICollectionOnboardingClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSensitivitySettingsClient() *SensitivitySettingsClient { + subClient, _ := NewSensitivitySettingsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewAPICollectionOffboardingClient() *APICollectionOffboardingClient { - subClient, _ := NewAPICollectionOffboardingClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewServerVulnerabilityAssessmentClient() *ServerVulnerabilityAssessmentClient { + subClient, _ := NewServerVulnerabilityAssessmentClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewHealthReportsClient() *HealthReportsClient { - subClient, _ := NewHealthReportsClient(c.credential, c.options) +func (c *ClientFactory) NewServerVulnerabilityAssessmentsSettingsClient() *ServerVulnerabilityAssessmentsSettingsClient { + subClient, _ := NewServerVulnerabilityAssessmentsSettingsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewSettingsClient() *SettingsClient { + subClient, _ := NewSettingsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewHealthReportClient() *HealthReportClient { - subClient, _ := NewHealthReportClient(c.credential, c.options) +func (c *ClientFactory) NewSoftwareInventoriesClient() *SoftwareInventoriesClient { + subClient, _ := NewSoftwareInventoriesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSQLVulnerabilityAssessmentScansClient() *SQLVulnerabilityAssessmentScansClient { - subClient, _ := NewSQLVulnerabilityAssessmentScansClient(c.credential, c.options) +func (c *ClientFactory) NewSolutionsClient() *SolutionsClient { + subClient, _ := NewSolutionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSQLVulnerabilityAssessmentScanResultsClient() *SQLVulnerabilityAssessmentScanResultsClient { - subClient, _ := NewSQLVulnerabilityAssessmentScanResultsClient(c.credential, c.options) +func (c *ClientFactory) NewSolutionsReferenceDataClient() *SolutionsReferenceDataClient { + subClient, _ := NewSolutionsReferenceDataClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSQLVulnerabilityAssessmentBaselineRulesClient() *SQLVulnerabilityAssessmentBaselineRulesClient { - subClient, _ := NewSQLVulnerabilityAssessmentBaselineRulesClient(c.credential, c.options) +func (c *ClientFactory) NewSubAssessmentsClient() *SubAssessmentsClient { + subClient, _ := NewSubAssessmentsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewConnectorsClient() *ConnectorsClient { - subClient, _ := NewConnectorsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewTasksClient() *TasksClient { + subClient, _ := NewTasksClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewOperatorsClient() *OperatorsClient { - subClient, _ := NewOperatorsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewTopologyClient() *TopologyClient { + subClient, _ := NewTopologyClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewWorkspaceSettingsClient() *WorkspaceSettingsClient { + subClient, _ := NewWorkspaceSettingsClient(c.subscriptionID, c.credential, c.options) return subClient } diff --git a/sdk/resourcemanager/security/armsecurity/complianceresults_client.go b/sdk/resourcemanager/security/armsecurity/complianceresults_client.go index 725d412d6998..fc04134fea4c 100644 --- a/sdk/resourcemanager/security/armsecurity/complianceresults_client.go +++ b/sdk/resourcemanager/security/armsecurity/complianceresults_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -49,18 +48,21 @@ func NewComplianceResultsClient(credential azcore.TokenCredential, options *arm. // - complianceResultName - name of the desired assessment compliance result // - options - ComplianceResultsClientGetOptions contains the optional parameters for the ComplianceResultsClient.Get method. func (client *ComplianceResultsClient) Get(ctx context.Context, resourceID string, complianceResultName string, options *ComplianceResultsClientGetOptions) (ComplianceResultsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceID, complianceResultName, options) if err != nil { return ComplianceResultsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ComplianceResultsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ComplianceResultsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ComplianceResultsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 df25a9b74478..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 392510456567..e9f7182e4feb 100644 --- a/sdk/resourcemanager/security/armsecurity/compliances_client.go +++ b/sdk/resourcemanager/security/armsecurity/compliances_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -50,18 +49,21 @@ func NewCompliancesClient(credential azcore.TokenCredential, options *arm.Client // - complianceName - name of the Compliance // - options - CompliancesClientGetOptions contains the optional parameters for the CompliancesClient.Get method. func (client *CompliancesClient) Get(ctx context.Context, scope string, complianceName string, options *CompliancesClientGetOptions) (CompliancesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, scope, complianceName, options) if err != nil { return CompliancesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CompliancesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CompliancesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CompliancesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 e03e16247982..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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/Compliances/GetCompliances_example.json -func ExampleCompliancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewCompliancesClient().NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ComplianceList = armsecurity.ComplianceList{ - // Value: []*armsecurity.Compliance{ - // { - // Name: to.Ptr("2018-01-01Z"), - // Type: to.Ptr("Microsoft.Security/compliances"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/compliances/2018-01-01Z"), - // Properties: &armsecurity.ComplianceProperties{ - // AssessmentResult: []*armsecurity.ComplianceSegment{ - // { - // Percentage: to.Ptr[float64](77.77777777777779), - // SegmentType: to.Ptr("Compliant"), - // }}, - // AssessmentTimestampUTCDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00Z"); return t}()), - // ResourceCount: to.Ptr[int32](18), - // }, - // }, - // { - // Name: to.Ptr("2018-01-02Z"), - // Type: to.Ptr("Microsoft.Security/compliances"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/compliances/2018-01-02Z"), - // Properties: &armsecurity.ComplianceProperties{ - // AssessmentResult: []*armsecurity.ComplianceSegment{ - // { - // Percentage: to.Ptr[float64](94.44444444444444), - // SegmentType: to.Ptr("Compliant"), - // }}, - // AssessmentTimestampUTCDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-02T00:00:00Z"); return t}()), - // ResourceCount: to.Ptr[int32](18), - // }, - // }, - // { - // Name: to.Ptr("2018-01-03Z"), - // Type: to.Ptr("Microsoft.Security/compliances"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/compliances/2018-01-03Z"), - // Properties: &armsecurity.ComplianceProperties{ - // AssessmentResult: []*armsecurity.ComplianceSegment{ - // { - // Percentage: to.Ptr[float64](100), - // SegmentType: to.Ptr("Compliant"), - // }}, - // AssessmentTimestampUTCDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-03T00:00:00Z"); return t}()), - // ResourceCount: to.Ptr[int32](18), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/Compliances/GetCompliance_example.json -func ExampleCompliancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewCompliancesClient().Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "2018-01-01Z", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Compliance = armsecurity.Compliance{ - // Name: to.Ptr("2018-01-01Z"), - // Type: to.Ptr("Microsoft.Security/compliances"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/compliances/2018-01-01Z"), - // Properties: &armsecurity.ComplianceProperties{ - // AssessmentResult: []*armsecurity.ComplianceSegment{ - // { - // Percentage: to.Ptr[float64](77.77777777777779), - // SegmentType: to.Ptr("Compliant"), - // }}, - // AssessmentTimestampUTCDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00Z"); return t}()), - // ResourceCount: to.Ptr[int32](18), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/connectorapplication_client.go b/sdk/resourcemanager/security/armsecurity/connectorapplication_client.go index 8f56c835f7b9..dece054143fa 100644 --- a/sdk/resourcemanager/security/armsecurity/connectorapplication_client.go +++ b/sdk/resourcemanager/security/armsecurity/connectorapplication_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -55,18 +54,21 @@ func NewConnectorApplicationClient(subscriptionID string, credential azcore.Toke // - options - ConnectorApplicationClientCreateOrUpdateOptions contains the optional parameters for the ConnectorApplicationClient.CreateOrUpdate // method. func (client *ConnectorApplicationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, securityConnectorName string, applicationID string, application Application, options *ConnectorApplicationClientCreateOrUpdateOptions) (ConnectorApplicationClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, securityConnectorName, applicationID, application, options) if err != nil { return ConnectorApplicationClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ConnectorApplicationClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ConnectorApplicationClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ConnectorApplicationClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -96,7 +98,10 @@ func (client *ConnectorApplicationClient) createOrUpdateCreateRequest(ctx contex reqQP.Set("api-version", "2022-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, application) + if err := runtime.MarshalAsJSON(req, application); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -118,16 +123,18 @@ func (client *ConnectorApplicationClient) createOrUpdateHandleResponse(resp *htt // - options - ConnectorApplicationClientDeleteOptions contains the optional parameters for the ConnectorApplicationClient.Delete // method. func (client *ConnectorApplicationClient) Delete(ctx context.Context, resourceGroupName string, securityConnectorName string, applicationID string, options *ConnectorApplicationClientDeleteOptions) (ConnectorApplicationClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, securityConnectorName, applicationID, options) if err != nil { return ConnectorApplicationClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ConnectorApplicationClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ConnectorApplicationClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ConnectorApplicationClientDeleteResponse{}, err } return ConnectorApplicationClientDeleteResponse{}, nil } @@ -171,18 +178,21 @@ func (client *ConnectorApplicationClient) deleteCreateRequest(ctx context.Contex // - options - ConnectorApplicationClientGetOptions contains the optional parameters for the ConnectorApplicationClient.Get // method. func (client *ConnectorApplicationClient) Get(ctx context.Context, resourceGroupName string, securityConnectorName string, applicationID string, options *ConnectorApplicationClientGetOptions) (ConnectorApplicationClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, securityConnectorName, applicationID, options) if err != nil { return ConnectorApplicationClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ConnectorApplicationClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ConnectorApplicationClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ConnectorApplicationClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 d90c2c2f41f7..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 57d1974c93d2..682cfbd0675d 100644 --- a/sdk/resourcemanager/security/armsecurity/connectorapplications_client.go +++ b/sdk/resourcemanager/security/armsecurity/connectorapplications_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity 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 a7f8e1f30d62..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 b9be8a328758..532fc1d6fed0 100644 --- a/sdk/resourcemanager/security/armsecurity/connectors_client.go +++ b/sdk/resourcemanager/security/armsecurity/connectors_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -48,25 +47,28 @@ 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 2023-03-01-preview +// Generated from API version 2023-10-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 // - options - ConnectorsClientCreateOrUpdateOptions contains the optional parameters for the ConnectorsClient.CreateOrUpdate // method. func (client *ConnectorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, securityConnectorName string, securityConnector Connector, options *ConnectorsClientCreateOrUpdateOptions) (ConnectorsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, securityConnectorName, securityConnector, options) if err != nil { return ConnectorsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ConnectorsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ConnectorsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ConnectorsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -89,10 +91,13 @@ func (client *ConnectorsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01-preview") + reqQP.Set("api-version", "2023-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, securityConnector) + if err := runtime.MarshalAsJSON(req, securityConnector); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -107,21 +112,23 @@ 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 2023-03-01-preview +// Generated from API version 2023-10-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. func (client *ConnectorsClient) Delete(ctx context.Context, resourceGroupName string, securityConnectorName string, options *ConnectorsClientDeleteOptions) (ConnectorsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, securityConnectorName, options) if err != nil { return ConnectorsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ConnectorsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ConnectorsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ConnectorsClientDeleteResponse{}, err } return ConnectorsClientDeleteResponse{}, nil } @@ -146,7 +153,7 @@ func (client *ConnectorsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01-preview") + reqQP.Set("api-version", "2023-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -155,23 +162,26 @@ 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 2023-03-01-preview +// Generated from API version 2023-10-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. func (client *ConnectorsClient) Get(ctx context.Context, resourceGroupName string, securityConnectorName string, options *ConnectorsClientGetOptions) (ConnectorsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, securityConnectorName, options) if err != nil { return ConnectorsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ConnectorsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ConnectorsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ConnectorsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -194,7 +204,7 @@ func (client *ConnectorsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01-preview") + reqQP.Set("api-version", "2023-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -212,7 +222,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 2023-03-01-preview +// Generated from API version 2023-10-01-preview // - options - ConnectorsClientListOptions contains the optional parameters for the ConnectorsClient.NewListPager method. func (client *ConnectorsClient) NewListPager(options *ConnectorsClientListOptions) *runtime.Pager[ConnectorsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ConnectorsClientListResponse]{ @@ -254,7 +264,7 @@ func (client *ConnectorsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01-preview") + reqQP.Set("api-version", "2023-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -272,7 +282,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 2023-03-01-preview +// Generated from API version 2023-10-01-preview // - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. // - options - ConnectorsClientListByResourceGroupOptions contains the optional parameters for the ConnectorsClient.NewListByResourceGroupPager // method. @@ -320,7 +330,7 @@ func (client *ConnectorsClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01-preview") + reqQP.Set("api-version", "2023-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -338,24 +348,27 @@ 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 2023-03-01-preview +// Generated from API version 2023-10-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 // - options - ConnectorsClientUpdateOptions contains the optional parameters for the ConnectorsClient.Update method. func (client *ConnectorsClient) Update(ctx context.Context, resourceGroupName string, securityConnectorName string, securityConnector Connector, options *ConnectorsClientUpdateOptions) (ConnectorsClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, securityConnectorName, securityConnector, options) if err != nil { return ConnectorsClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ConnectorsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ConnectorsClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ConnectorsClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -378,10 +391,13 @@ func (client *ConnectorsClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-03-01-preview") + reqQP.Set("api-version", "2023-10-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, securityConnector) + if err := runtime.MarshalAsJSON(req, securityConnector); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. 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 c5162adbf786..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectors_client_example_test.go +++ /dev/null @@ -1,558 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2023-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), - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameAWS), - // HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorAwsOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorAws), - // NativeCloudConnection: &armsecurity.CspmMonitorAwsOfferingNativeCloudConnection{ - // CloudRoleArn: to.Ptr("arn:aws:iam::00000000:role/ASCMonitor"), - // }, - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("exampleSecurityConnectorAwsOrganization"), - // Type: to.Ptr("Microsoft.Security/securityConnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup2/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorAwsOrganization"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.AwsEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeAwsAccount), - // OrganizationalData: &armsecurity.AwsOrganizationalDataMaster{ - // OrganizationMembershipType: to.Ptr(armsecurity.OrganizationMembershipTypeOrganization), - // ExcludedAccountIDs: []*string{ - // to.Ptr("excludedAccountIdExample")}, - // StacksetName: to.Ptr("myStackSetName"), - // }, - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameAWS), - // HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorAwsOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorAws), - // NativeCloudConnection: &armsecurity.CspmMonitorAwsOfferingNativeCloudConnection{ - // CloudRoleArn: to.Ptr("arn:aws:iam::00000000:role/ASCMonitor"), - // }, - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("githubTest"), - // Type: to.Ptr("Microsoft.Security/securityconnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup3/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorGithub"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.GithubScopeEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeGithubScope), - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameGithub), - // HierarchyIdentifier: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup3/providers/Microsoft.SecurityDevops/githubConnectors/exampleGithubConnector"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorGithubOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorGithub), - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Location: to.Ptr("centralus"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("AzureDevOpsTest"), - // Type: to.Ptr("Microsoft.Security/securityconnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup3/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorAzureDevOpsConnectors"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.GithubScopeEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeGithubScope), - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameGithub), - // HierarchyIdentifier: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup3/providers/Microsoft.SecurityDevops/azureDevOpsConnectors/exampleAzureDevOpsConnector"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorGithubOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorGithub), - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("exampleSecurityConnectorGcp"), - // Type: to.Ptr("Microsoft.Security/securityConnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup3/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorGcp"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.GcpProjectEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeGcpProject), - // ProjectDetails: &armsecurity.GcpProjectDetails{ - // ProjectID: to.Ptr("My-0GCP-Project"), - // ProjectNumber: to.Ptr("exampleHierarchyId"), - // WorkloadIdentityPoolID: to.Ptr("6c78da41157548d3b1d8b3c72effdf8c"), - // }, - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameGCP), - // HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorGcpOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorGcp), - // NativeCloudConnection: &armsecurity.CspmMonitorGcpOfferingNativeCloudConnection{ - // ServiceAccountEmailAddress: to.Ptr("capm@projectName.com"), - // WorkloadIdentityProviderID: to.Ptr("My workload identity provider Id"), - // }, - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2023-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), - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameAWS), - // HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorAwsOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorAws), - // NativeCloudConnection: &armsecurity.CspmMonitorAwsOfferingNativeCloudConnection{ - // CloudRoleArn: to.Ptr("arn:aws:iam::00000000:role/ASCMonitor"), - // }, - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-08-31T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("exampleSecurityConnectorAwsOrganization"), - // Type: to.Ptr("Microsoft.Security/securityConnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorAwsOrganization"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.AwsEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeAwsAccount), - // OrganizationalData: &armsecurity.AwsOrganizationalDataMaster{ - // OrganizationMembershipType: to.Ptr(armsecurity.OrganizationMembershipTypeOrganization), - // ExcludedAccountIDs: []*string{ - // to.Ptr("excludedAccountIdExample")}, - // StacksetName: to.Ptr("myStackSetName"), - // }, - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameAWS), - // HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorAwsOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorAws), - // NativeCloudConnection: &armsecurity.CspmMonitorAwsOfferingNativeCloudConnection{ - // CloudRoleArn: to.Ptr("arn:aws:iam::00000000:role/ASCMonitor"), - // }, - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Location: to.Ptr("Central US"), - // Etag: to.Ptr("etag value"), - // Kind: to.Ptr(""), - // Name: to.Ptr("exampleSecurityConnectorGcp"), - // Type: to.Ptr("Microsoft.Security/securityConnectors"), - // ID: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/exampleResourceGroup/providers/Microsoft.Security/securityConnectors/exampleSecurityConnectorGcp"), - // Tags: map[string]*string{ - // }, - // Properties: &armsecurity.ConnectorProperties{ - // EnvironmentData: &armsecurity.GcpProjectEnvironmentData{ - // EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeGcpProject), - // ProjectDetails: &armsecurity.GcpProjectDetails{ - // ProjectID: to.Ptr("My-0GCP-Project"), - // ProjectNumber: to.Ptr("exampleHierarchyId"), - // WorkloadIdentityPoolID: to.Ptr("My-workload-identity-federation-pool-id"), - // }, - // }, - // EnvironmentName: to.Ptr(armsecurity.CloudNameGCP), - // HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - // Offerings: []armsecurity.CloudOfferingClassification{ - // &armsecurity.CspmMonitorGcpOffering{ - // OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorGcp), - // NativeCloudConnection: &armsecurity.CspmMonitorGcpOfferingNativeCloudConnection{ - // ServiceAccountEmailAddress: to.Ptr("capm@projectName.com"), - // WorkloadIdentityProviderID: to.Ptr("My workload identity provider Id"), - // }, - // }}, - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // CreatedBy: to.Ptr("user@contoso.com"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-15T13:47:50.328Z"); return t}()), - // LastModifiedBy: to.Ptr("user@contoso.com"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2023-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), - // }, - // 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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2023-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), - }, - 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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2023-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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2023-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 9def5af8e297..594ac4f4a918 100644 --- a/sdk/resourcemanager/security/armsecurity/constants.go +++ b/sdk/resourcemanager/security/armsecurity/constants.go @@ -3,15 +3,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity const ( moduleName = "armsecurity" - moduleVersion = "v0.11.0" + moduleVersion = "v0.12.0" ) // AADConnectivityState - The connectivity state of the external AAD solution @@ -50,6 +49,25 @@ func PossibleActionTypeValues() []ActionType { } } +// ActionableRemediationState - ActionableRemediation Setting. None - the setting was never set. Enabled - ActionableRemediation +// is enabled. Disabled - ActionableRemediation is disabled. +type ActionableRemediationState string + +const ( + ActionableRemediationStateDisabled ActionableRemediationState = "Disabled" + ActionableRemediationStateEnabled ActionableRemediationState = "Enabled" + ActionableRemediationStateNone ActionableRemediationState = "None" +) + +// PossibleActionableRemediationStateValues returns the possible values for the ActionableRemediationState const type. +func PossibleActionableRemediationStateValues() []ActionableRemediationState { + return []ActionableRemediationState{ + ActionableRemediationStateDisabled, + ActionableRemediationStateEnabled, + ActionableRemediationStateNone, + } +} + // AdaptiveApplicationControlIssue - An alert that machines within a group can have type AdaptiveApplicationControlIssue string @@ -152,6 +170,24 @@ func PossibleAlertStatusValues() []AlertStatus { } } +// AnnotateDefaultBranchState - Configuration of PR Annotations on default branch. +// Enabled - PR Annotations are enabled on the resource's default branch. Disabled - PR Annotations are disabled on the resource's +// default branch. +type AnnotateDefaultBranchState string + +const ( + AnnotateDefaultBranchStateDisabled AnnotateDefaultBranchState = "Disabled" + AnnotateDefaultBranchStateEnabled AnnotateDefaultBranchState = "Enabled" +) + +// PossibleAnnotateDefaultBranchStateValues returns the possible values for the AnnotateDefaultBranchState const type. +func PossibleAnnotateDefaultBranchStateValues() []AnnotateDefaultBranchState { + return []AnnotateDefaultBranchState{ + AnnotateDefaultBranchStateDisabled, + AnnotateDefaultBranchStateEnabled, + } +} + // ApplicationConditionOperator - The application Condition's Operator, for example Contains for id or In for list of possible // IDs, see examples type ApplicationConditionOperator string @@ -303,6 +339,24 @@ func PossibleAuthenticationTypeValues() []AuthenticationType { } } +// AutoDiscovery - AutoDiscovery states. +type AutoDiscovery string + +const ( + AutoDiscoveryDisabled AutoDiscovery = "Disabled" + AutoDiscoveryEnabled AutoDiscovery = "Enabled" + AutoDiscoveryNotApplicable AutoDiscovery = "NotApplicable" +) + +// PossibleAutoDiscoveryValues returns the possible values for the AutoDiscovery const type. +func PossibleAutoDiscoveryValues() []AutoDiscovery { + return []AutoDiscovery{ + AutoDiscoveryDisabled, + AutoDiscoveryEnabled, + AutoDiscoveryNotApplicable, + } +} + // AutoProvision - Describes what kind of security agent provisioning action to take type AutoProvision string @@ -504,6 +558,51 @@ func PossibleDataSourceValues() []DataSource { } } +// DesiredOnboardingState - Onboarding states. +type DesiredOnboardingState string + +const ( + DesiredOnboardingStateDisabled DesiredOnboardingState = "Disabled" + DesiredOnboardingStateEnabled DesiredOnboardingState = "Enabled" +) + +// PossibleDesiredOnboardingStateValues returns the possible values for the DesiredOnboardingState const type. +func PossibleDesiredOnboardingStateValues() []DesiredOnboardingState { + return []DesiredOnboardingState{ + DesiredOnboardingStateDisabled, + DesiredOnboardingStateEnabled, + } +} + +// DevOpsProvisioningState - 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. +type DevOpsProvisioningState string + +const ( + DevOpsProvisioningStateCanceled DevOpsProvisioningState = "Canceled" + DevOpsProvisioningStateDeletionFailure DevOpsProvisioningState = "DeletionFailure" + DevOpsProvisioningStateDeletionSuccess DevOpsProvisioningState = "DeletionSuccess" + DevOpsProvisioningStateFailed DevOpsProvisioningState = "Failed" + DevOpsProvisioningStatePending DevOpsProvisioningState = "Pending" + DevOpsProvisioningStatePendingDeletion DevOpsProvisioningState = "PendingDeletion" + DevOpsProvisioningStateSucceeded DevOpsProvisioningState = "Succeeded" +) + +// PossibleDevOpsProvisioningStateValues returns the possible values for the DevOpsProvisioningState const type. +func PossibleDevOpsProvisioningStateValues() []DevOpsProvisioningState { + return []DevOpsProvisioningState{ + DevOpsProvisioningStateCanceled, + DevOpsProvisioningStateDeletionFailure, + DevOpsProvisioningStateDeletionSuccess, + DevOpsProvisioningStateFailed, + DevOpsProvisioningStatePending, + DevOpsProvisioningStatePendingDeletion, + DevOpsProvisioningStateSucceeded, + } +} + // Direction - The rule's direction type Direction string @@ -847,6 +946,24 @@ func PossibleInformationProtectionPolicyNameValues() []InformationProtectionPoli } } +// InheritFromParentState - Update Settings. +// Enabled - Resource should inherit configurations from parent. Disabled - Resource should not inherit configurations from +// parent. +type InheritFromParentState string + +const ( + InheritFromParentStateDisabled InheritFromParentState = "Disabled" + InheritFromParentStateEnabled InheritFromParentState = "Enabled" +) + +// PossibleInheritFromParentStateValues returns the possible values for the InheritFromParentState const type. +func PossibleInheritFromParentStateValues() []InheritFromParentState { + return []InheritFromParentState{ + InheritFromParentStateDisabled, + InheritFromParentStateEnabled, + } +} + // Intent - The kill chain related intent behind the alert. For list of supported values, and explanations of Azure Security // Center's supported kill chain intents. type Intent string @@ -1043,6 +1160,30 @@ func PossibleOfferingTypeValues() []OfferingType { } } +// OnboardingState - Details about resource onboarding status across all connectors. +// OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only applicable to top-level +// resources. Onboarded - this resource has already been onboarded by the +// specified connector. NotOnboarded - this resource has not been onboarded to any connector. NotApplicable - the onboarding +// state is not applicable to the current endpoint. +type OnboardingState string + +const ( + OnboardingStateNotApplicable OnboardingState = "NotApplicable" + OnboardingStateNotOnboarded OnboardingState = "NotOnboarded" + OnboardingStateOnboarded OnboardingState = "Onboarded" + OnboardingStateOnboardedByOtherConnector OnboardingState = "OnboardedByOtherConnector" +) + +// PossibleOnboardingStateValues returns the possible values for the OnboardingState const type. +func PossibleOnboardingStateValues() []OnboardingState { + return []OnboardingState{ + OnboardingStateNotApplicable, + OnboardingStateNotOnboarded, + OnboardingStateOnboarded, + OnboardingStateOnboardedByOtherConnector, + } +} + // OperationResult - The status of the long run operation result of governance rule type OperationResult string @@ -1223,21 +1364,21 @@ func PossibleProvisioningStateValues() []ProvisioningState { type Rank string const ( - RankNone Rank = "None" + RankCritical Rank = "Critical" + RankHigh Rank = "High" RankLow Rank = "Low" RankMedium Rank = "Medium" - RankHigh Rank = "High" - RankCritical Rank = "Critical" + RankNone Rank = "None" ) // PossibleRankValues returns the possible values for the Rank const type. func PossibleRankValues() []Rank { return []Rank{ - RankNone, + RankCritical, + RankHigh, RankLow, RankMedium, - RankHigh, - RankCritical, + RankNone, } } @@ -1453,6 +1594,31 @@ func PossibleRolesValues() []Roles { } } +// RuleCategory - Rule categories. Code - code scanning results. Artifact scanning results. Dependencies scanning results. +// IaC results. Secrets scanning results. Container scanning results. +type RuleCategory string + +const ( + RuleCategoryArtifacts RuleCategory = "Artifacts" + RuleCategoryCode RuleCategory = "Code" + RuleCategoryContainers RuleCategory = "Containers" + RuleCategoryDependencies RuleCategory = "Dependencies" + RuleCategoryIaC RuleCategory = "IaC" + RuleCategorySecrets RuleCategory = "Secrets" +) + +// PossibleRuleCategoryValues returns the possible values for the RuleCategory const type. +func PossibleRuleCategoryValues() []RuleCategory { + return []RuleCategory{ + RuleCategoryArtifacts, + RuleCategoryCode, + RuleCategoryContainers, + RuleCategoryDependencies, + RuleCategoryIaC, + RuleCategorySecrets, + } +} + // RuleSeverity - The rule severity. type RuleSeverity string @@ -1484,16 +1650,16 @@ func PossibleRuleSeverityValues() []RuleSeverity { type RuleState string const ( - RuleStateEnabled RuleState = "Enabled" RuleStateDisabled RuleState = "Disabled" + RuleStateEnabled RuleState = "Enabled" RuleStateExpired RuleState = "Expired" ) // PossibleRuleStateValues returns the possible values for the RuleState const type. func PossibleRuleStateValues() []RuleState { return []RuleState{ - RuleStateEnabled, RuleStateDisabled, + RuleStateEnabled, RuleStateExpired, } } @@ -1599,26 +1765,6 @@ func PossibleScanningModeValues() []ScanningMode { } } -// ScopeName - The resource scope of the health report -type ScopeName string - -const ( - ScopeNameClusters ScopeName = "Clusters" - ScopeNameConnectors ScopeName = "Connectors" - ScopeNameUnknown ScopeName = "Unknown" - ScopeNameVirtualMachines ScopeName = "VirtualMachines" -) - -// PossibleScopeNameValues returns the possible values for the ScopeName const type. -func PossibleScopeNameValues() []ScopeName { - return []ScopeName{ - ScopeNameClusters, - ScopeNameConnectors, - ScopeNameUnknown, - ScopeNameVirtualMachines, - } -} - // SecurityFamily - The security family of the discovered solution type SecurityFamily string @@ -1678,6 +1824,50 @@ func PossibleServerVulnerabilityAssessmentPropertiesProvisioningStateValues() [] } } +// ServerVulnerabilityAssessmentsAzureSettingSelectedProvider - The selected vulnerability assessments provider on Azure servers +// in the defined scope. +type ServerVulnerabilityAssessmentsAzureSettingSelectedProvider string + +const ( + // ServerVulnerabilityAssessmentsAzureSettingSelectedProviderMdeTvm - Microsoft Defender for Endpoints threat and vulnerability + // management. + ServerVulnerabilityAssessmentsAzureSettingSelectedProviderMdeTvm ServerVulnerabilityAssessmentsAzureSettingSelectedProvider = "MdeTvm" +) + +// PossibleServerVulnerabilityAssessmentsAzureSettingSelectedProviderValues returns the possible values for the ServerVulnerabilityAssessmentsAzureSettingSelectedProvider const type. +func PossibleServerVulnerabilityAssessmentsAzureSettingSelectedProviderValues() []ServerVulnerabilityAssessmentsAzureSettingSelectedProvider { + return []ServerVulnerabilityAssessmentsAzureSettingSelectedProvider{ + ServerVulnerabilityAssessmentsAzureSettingSelectedProviderMdeTvm, + } +} + +// ServerVulnerabilityAssessmentsSettingKind - The kind of the server vulnerability assessments setting +type ServerVulnerabilityAssessmentsSettingKind string + +const ( + ServerVulnerabilityAssessmentsSettingKindAzureServersSetting ServerVulnerabilityAssessmentsSettingKind = "AzureServersSetting" +) + +// PossibleServerVulnerabilityAssessmentsSettingKindValues returns the possible values for the ServerVulnerabilityAssessmentsSettingKind const type. +func PossibleServerVulnerabilityAssessmentsSettingKindValues() []ServerVulnerabilityAssessmentsSettingKind { + return []ServerVulnerabilityAssessmentsSettingKind{ + ServerVulnerabilityAssessmentsSettingKindAzureServersSetting, + } +} + +type ServerVulnerabilityAssessmentsSettingKindName string + +const ( + ServerVulnerabilityAssessmentsSettingKindNameAzureServersSetting ServerVulnerabilityAssessmentsSettingKindName = "azureServersSetting" +) + +// PossibleServerVulnerabilityAssessmentsSettingKindNameValues returns the possible values for the ServerVulnerabilityAssessmentsSettingKindName const type. +func PossibleServerVulnerabilityAssessmentsSettingKindNameValues() []ServerVulnerabilityAssessmentsSettingKindName { + return []ServerVulnerabilityAssessmentsSettingKindName{ + ServerVulnerabilityAssessmentsSettingKindNameAzureServersSetting, + } +} + // SettingKind - the kind of the settings string type SettingKind string @@ -1717,6 +1907,20 @@ func PossibleSettingNameValues() []SettingName { } } +type SettingNameAutoGenerated string + +const ( + // 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{ + SettingNameAutoGeneratedCurrent, + } +} + // Severity - The sub-assessment severity level type Severity string diff --git a/sdk/resourcemanager/security/armsecurity/contacts_client.go b/sdk/resourcemanager/security/armsecurity/contacts_client.go index 76d05611b605..ad1d816a01c7 100644 --- a/sdk/resourcemanager/security/armsecurity/contacts_client.go +++ b/sdk/resourcemanager/security/armsecurity/contacts_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -52,18 +51,21 @@ func NewContactsClient(subscriptionID string, credential azcore.TokenCredential, // - securityContact - Security contact object // - options - ContactsClientCreateOptions contains the optional parameters for the ContactsClient.Create method. func (client *ContactsClient) Create(ctx context.Context, securityContactName string, securityContact Contact, options *ContactsClientCreateOptions) (ContactsClientCreateResponse, error) { + var err error req, err := client.createCreateRequest(ctx, securityContactName, securityContact, options) if err != nil { return ContactsClientCreateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ContactsClientCreateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ContactsClientCreateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ContactsClientCreateResponse{}, err } - return client.createHandleResponse(resp) + resp, err := client.createHandleResponse(httpResp) + return resp, err } // createCreateRequest creates the Create request. @@ -85,7 +87,10 @@ func (client *ContactsClient) createCreateRequest(ctx context.Context, securityC reqQP.Set("api-version", "2020-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, securityContact) + if err := runtime.MarshalAsJSON(req, securityContact); err != nil { + return nil, err + } + return req, nil } // createHandleResponse handles the Create response. @@ -104,16 +109,18 @@ func (client *ContactsClient) createHandleResponse(resp *http.Response) (Contact // - securityContactName - Name of the security contact object // - options - ContactsClientDeleteOptions contains the optional parameters for the ContactsClient.Delete method. func (client *ContactsClient) Delete(ctx context.Context, securityContactName string, options *ContactsClientDeleteOptions) (ContactsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, securityContactName, options) if err != nil { return ContactsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ContactsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ContactsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ContactsClientDeleteResponse{}, err } return ContactsClientDeleteResponse{}, nil } @@ -147,18 +154,21 @@ func (client *ContactsClient) deleteCreateRequest(ctx context.Context, securityC // - securityContactName - Name of the security contact object // - options - ContactsClientGetOptions contains the optional parameters for the ContactsClient.Get method. func (client *ContactsClient) Get(ctx context.Context, securityContactName string, options *ContactsClientGetOptions) (ContactsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, securityContactName, options) if err != nil { return ContactsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ContactsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ContactsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ContactsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 b9b669300083..000000000000 --- a/sdk/resourcemanager/security/armsecurity/contacts_client_example_test.go +++ /dev/null @@ -1,173 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/SecurityContacts/GetSecurityContactsSubscription_example.json -func ExampleContactsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewContactsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ContactList = armsecurity.ContactList{ - // Value: []*armsecurity.Contact{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/securityContact"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/securityContact/default"), - // Properties: &armsecurity.ContactProperties{ - // AlertNotifications: &armsecurity.ContactPropertiesAlertNotifications{ - // MinimalSeverity: to.Ptr(armsecurity.MinimalSeverityLow), - // State: to.Ptr(armsecurity.State("On")), - // }, - // Emails: to.Ptr("john@contoso.com;Jane@contoso.com"), - // NotificationsByRole: &armsecurity.ContactPropertiesNotificationsByRole{ - // Roles: []*armsecurity.Roles{ - // to.Ptr(armsecurity.RolesOwner), - // to.Ptr(armsecurity.Roles("Admin"))}, - // State: to.Ptr(armsecurity.State("On")), - // }, - // Phone: to.Ptr("(214)275-4038"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/SecurityContacts/GetSecurityContact_example.json -func ExampleContactsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewContactsClient().Get(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Contact = armsecurity.Contact{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/securityContacts"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/securityContacts/default"), - // Properties: &armsecurity.ContactProperties{ - // AlertNotifications: &armsecurity.ContactPropertiesAlertNotifications{ - // MinimalSeverity: to.Ptr(armsecurity.MinimalSeverityLow), - // State: to.Ptr(armsecurity.State("On")), - // }, - // Emails: to.Ptr("john@contoso.com;jane@contoso.com"), - // NotificationsByRole: &armsecurity.ContactPropertiesNotificationsByRole{ - // Roles: []*armsecurity.Roles{ - // to.Ptr(armsecurity.RolesOwner)}, - // State: to.Ptr(armsecurity.State("On")), - // }, - // Phone: to.Ptr("(214)275-4038"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/SecurityContacts/CreateSecurityContact_example.json -func ExampleContactsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewContactsClient().Create(ctx, "default", armsecurity.Contact{ - Properties: &armsecurity.ContactProperties{ - AlertNotifications: &armsecurity.ContactPropertiesAlertNotifications{ - MinimalSeverity: to.Ptr(armsecurity.MinimalSeverityLow), - State: to.Ptr(armsecurity.State("On")), - }, - Emails: to.Ptr("john@contoso.com;jane@contoso.com"), - NotificationsByRole: &armsecurity.ContactPropertiesNotificationsByRole{ - Roles: []*armsecurity.Roles{ - to.Ptr(armsecurity.RolesOwner)}, - State: to.Ptr(armsecurity.State("On")), - }, - Phone: to.Ptr("(214)275-4038"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Contact = armsecurity.Contact{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/securityContact"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/securityContacts/default"), - // Properties: &armsecurity.ContactProperties{ - // AlertNotifications: &armsecurity.ContactPropertiesAlertNotifications{ - // MinimalSeverity: to.Ptr(armsecurity.MinimalSeverityLow), - // State: to.Ptr(armsecurity.State("On")), - // }, - // Emails: to.Ptr("john@microsoft.com;jane@microsoft.com"), - // NotificationsByRole: &armsecurity.ContactPropertiesNotificationsByRole{ - // Roles: []*armsecurity.Roles{ - // to.Ptr(armsecurity.RolesOwner)}, - // State: to.Ptr(armsecurity.State("On")), - // }, - // Phone: to.Ptr("(214)275-4038"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/SecurityContacts/DeleteSecurityContact_example.json -func ExampleContactsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewContactsClient().Delete(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/customassessmentautomations_client.go b/sdk/resourcemanager/security/armsecurity/customassessmentautomations_client.go index 1e5e40822e54..5b5b741cba97 100644 --- a/sdk/resourcemanager/security/armsecurity/customassessmentautomations_client.go +++ b/sdk/resourcemanager/security/armsecurity/customassessmentautomations_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -55,18 +54,21 @@ func NewCustomAssessmentAutomationsClient(subscriptionID string, credential azco // - options - CustomAssessmentAutomationsClientCreateOptions contains the optional parameters for the CustomAssessmentAutomationsClient.Create // method. func (client *CustomAssessmentAutomationsClient) Create(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string, customAssessmentAutomationBody CustomAssessmentAutomationRequest, options *CustomAssessmentAutomationsClientCreateOptions) (CustomAssessmentAutomationsClientCreateResponse, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, customAssessmentAutomationName, customAssessmentAutomationBody, options) if err != nil { return CustomAssessmentAutomationsClientCreateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CustomAssessmentAutomationsClientCreateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return CustomAssessmentAutomationsClientCreateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return CustomAssessmentAutomationsClientCreateResponse{}, err } - return client.createHandleResponse(resp) + resp, err := client.createHandleResponse(httpResp) + return resp, err } // createCreateRequest creates the Create request. @@ -92,7 +94,10 @@ func (client *CustomAssessmentAutomationsClient) createCreateRequest(ctx context reqQP.Set("api-version", "2021-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, customAssessmentAutomationBody) + if err := runtime.MarshalAsJSON(req, customAssessmentAutomationBody); err != nil { + return nil, err + } + return req, nil } // createHandleResponse handles the Create response. @@ -113,16 +118,18 @@ func (client *CustomAssessmentAutomationsClient) createHandleResponse(resp *http // - options - CustomAssessmentAutomationsClientDeleteOptions contains the optional parameters for the CustomAssessmentAutomationsClient.Delete // method. func (client *CustomAssessmentAutomationsClient) Delete(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string, options *CustomAssessmentAutomationsClientDeleteOptions) (CustomAssessmentAutomationsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, customAssessmentAutomationName, options) if err != nil { return CustomAssessmentAutomationsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CustomAssessmentAutomationsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return CustomAssessmentAutomationsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return CustomAssessmentAutomationsClientDeleteResponse{}, err } return CustomAssessmentAutomationsClientDeleteResponse{}, nil } @@ -162,18 +169,21 @@ func (client *CustomAssessmentAutomationsClient) deleteCreateRequest(ctx context // - options - CustomAssessmentAutomationsClientGetOptions contains the optional parameters for the CustomAssessmentAutomationsClient.Get // method. func (client *CustomAssessmentAutomationsClient) Get(ctx context.Context, resourceGroupName string, customAssessmentAutomationName string, options *CustomAssessmentAutomationsClientGetOptions) (CustomAssessmentAutomationsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, customAssessmentAutomationName, options) if err != nil { return CustomAssessmentAutomationsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CustomAssessmentAutomationsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CustomAssessmentAutomationsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CustomAssessmentAutomationsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 8769b4aaaaa0..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 72e9617744f9..902f1764d11a 100644 --- a/sdk/resourcemanager/security/armsecurity/customentitystoreassignments_client.go +++ b/sdk/resourcemanager/security/armsecurity/customentitystoreassignments_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -54,18 +53,21 @@ func NewCustomEntityStoreAssignmentsClient(subscriptionID string, credential azc // - options - CustomEntityStoreAssignmentsClientCreateOptions contains the optional parameters for the CustomEntityStoreAssignmentsClient.Create // method. func (client *CustomEntityStoreAssignmentsClient) Create(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string, customEntityStoreAssignmentRequestBody CustomEntityStoreAssignmentRequest, options *CustomEntityStoreAssignmentsClientCreateOptions) (CustomEntityStoreAssignmentsClientCreateResponse, error) { + var err error req, err := client.createCreateRequest(ctx, resourceGroupName, customEntityStoreAssignmentName, customEntityStoreAssignmentRequestBody, options) if err != nil { return CustomEntityStoreAssignmentsClientCreateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CustomEntityStoreAssignmentsClientCreateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return CustomEntityStoreAssignmentsClientCreateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return CustomEntityStoreAssignmentsClientCreateResponse{}, err } - return client.createHandleResponse(resp) + resp, err := client.createHandleResponse(httpResp) + return resp, err } // createCreateRequest creates the Create request. @@ -91,7 +93,10 @@ func (client *CustomEntityStoreAssignmentsClient) createCreateRequest(ctx contex reqQP.Set("api-version", "2021-07-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, customEntityStoreAssignmentRequestBody) + if err := runtime.MarshalAsJSON(req, customEntityStoreAssignmentRequestBody); err != nil { + return nil, err + } + return req, nil } // createHandleResponse handles the Create response. @@ -112,16 +117,18 @@ func (client *CustomEntityStoreAssignmentsClient) createHandleResponse(resp *htt // - options - CustomEntityStoreAssignmentsClientDeleteOptions contains the optional parameters for the CustomEntityStoreAssignmentsClient.Delete // method. func (client *CustomEntityStoreAssignmentsClient) Delete(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string, options *CustomEntityStoreAssignmentsClientDeleteOptions) (CustomEntityStoreAssignmentsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, customEntityStoreAssignmentName, options) if err != nil { return CustomEntityStoreAssignmentsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CustomEntityStoreAssignmentsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return CustomEntityStoreAssignmentsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return CustomEntityStoreAssignmentsClientDeleteResponse{}, err } return CustomEntityStoreAssignmentsClientDeleteResponse{}, nil } @@ -161,18 +168,21 @@ func (client *CustomEntityStoreAssignmentsClient) deleteCreateRequest(ctx contex // - options - CustomEntityStoreAssignmentsClientGetOptions contains the optional parameters for the CustomEntityStoreAssignmentsClient.Get // method. func (client *CustomEntityStoreAssignmentsClient) Get(ctx context.Context, resourceGroupName string, customEntityStoreAssignmentName string, options *CustomEntityStoreAssignmentsClientGetOptions) (CustomEntityStoreAssignmentsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, customEntityStoreAssignmentName, options) if err != nil { return CustomEntityStoreAssignmentsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return CustomEntityStoreAssignmentsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return CustomEntityStoreAssignmentsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return CustomEntityStoreAssignmentsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 8caea9e08610..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/date_type.go b/sdk/resourcemanager/security/armsecurity/date_type.go index 6837d033fb82..f47df433a1ef 100644 --- a/sdk/resourcemanager/security/armsecurity/date_type.go +++ b/sdk/resourcemanager/security/armsecurity/date_type.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity diff --git a/sdk/resourcemanager/security/armsecurity/defenderforstorage_client.go b/sdk/resourcemanager/security/armsecurity/defenderforstorage_client.go new file mode 100644 index 000000000000..2b068caa0258 --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/defenderforstorage_client.go @@ -0,0 +1,152 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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" +) + +// DefenderForStorageClient contains the methods for the DefenderForStorage group. +// Don't use this type directly, use NewDefenderForStorageClient() instead. +type DefenderForStorageClient struct { + internal *arm.Client +} + +// NewDefenderForStorageClient creates a new instance of DefenderForStorageClient with the specified values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDefenderForStorageClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*DefenderForStorageClient, error) { + cl, err := arm.NewClient(moduleName+".DefenderForStorageClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DefenderForStorageClient{ + internal: cl, + } + return client, 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 +// - 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 SettingNameAutoGenerated, defenderForStorageSetting DefenderForStorageSetting, options *DefenderForStorageClientCreateOptions) (DefenderForStorageClientCreateResponse, error) { + var err error + req, err := client.createCreateRequest(ctx, resourceID, settingName, defenderForStorageSetting, options) + if err != nil { + return DefenderForStorageClientCreateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DefenderForStorageClientCreateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return DefenderForStorageClientCreateResponse{}, err + } + resp, err := client.createHandleResponse(httpResp) + return resp, err +} + +// createCreateRequest creates the Create request. +func (client *DefenderForStorageClient) createCreateRequest(ctx context.Context, resourceID string, settingName SettingNameAutoGenerated, defenderForStorageSetting DefenderForStorageSetting, options *DefenderForStorageClientCreateOptions) (*policy.Request, error) { + urlPath := "/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}" + 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.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-12-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, defenderForStorageSetting); err != nil { + return nil, err + } + return req, nil +} + +// createHandleResponse handles the Create response. +func (client *DefenderForStorageClient) createHandleResponse(resp *http.Response) (DefenderForStorageClientCreateResponse, error) { + result := DefenderForStorageClientCreateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DefenderForStorageSetting); err != nil { + return DefenderForStorageClientCreateResponse{}, err + } + return result, nil +} + +// 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 +// - 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 SettingNameAutoGenerated, options *DefenderForStorageClientGetOptions) (DefenderForStorageClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceID, settingName, options) + if err != nil { + return DefenderForStorageClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DefenderForStorageClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DefenderForStorageClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *DefenderForStorageClient) getCreateRequest(ctx context.Context, resourceID string, settingName SettingNameAutoGenerated, options *DefenderForStorageClientGetOptions) (*policy.Request, error) { + urlPath := "/{resourceId}/providers/Microsoft.Security/defenderForStorageSettings/{settingName}" + 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.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-12-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DefenderForStorageClient) getHandleResponse(resp *http.Response) (DefenderForStorageClientGetResponse, error) { + result := DefenderForStorageClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DefenderForStorageSetting); err != nil { + return DefenderForStorageClientGetResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/devicesecuritygroups_client.go b/sdk/resourcemanager/security/armsecurity/devicesecuritygroups_client.go index 5e6648e6a7d6..aec73dd3d5ba 100644 --- a/sdk/resourcemanager/security/armsecurity/devicesecuritygroups_client.go +++ b/sdk/resourcemanager/security/armsecurity/devicesecuritygroups_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -52,18 +51,21 @@ func NewDeviceSecurityGroupsClient(credential azcore.TokenCredential, options *a // - options - DeviceSecurityGroupsClientCreateOrUpdateOptions contains the optional parameters for the DeviceSecurityGroupsClient.CreateOrUpdate // method. func (client *DeviceSecurityGroupsClient) CreateOrUpdate(ctx context.Context, resourceID string, deviceSecurityGroupName string, deviceSecurityGroup DeviceSecurityGroup, options *DeviceSecurityGroupsClientCreateOrUpdateOptions) (DeviceSecurityGroupsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceID, deviceSecurityGroupName, deviceSecurityGroup, options) if err != nil { return DeviceSecurityGroupsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DeviceSecurityGroupsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return DeviceSecurityGroupsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return DeviceSecurityGroupsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -82,7 +84,10 @@ func (client *DeviceSecurityGroupsClient) createOrUpdateCreateRequest(ctx contex reqQP.Set("api-version", "2019-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, deviceSecurityGroup) + if err := runtime.MarshalAsJSON(req, deviceSecurityGroup); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -104,16 +109,18 @@ func (client *DeviceSecurityGroupsClient) createOrUpdateHandleResponse(resp *htt // - options - DeviceSecurityGroupsClientDeleteOptions contains the optional parameters for the DeviceSecurityGroupsClient.Delete // method. func (client *DeviceSecurityGroupsClient) Delete(ctx context.Context, resourceID string, deviceSecurityGroupName string, options *DeviceSecurityGroupsClientDeleteOptions) (DeviceSecurityGroupsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceID, deviceSecurityGroupName, options) if err != nil { return DeviceSecurityGroupsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DeviceSecurityGroupsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return DeviceSecurityGroupsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return DeviceSecurityGroupsClientDeleteResponse{}, err } return DeviceSecurityGroupsClientDeleteResponse{}, nil } @@ -147,18 +154,21 @@ func (client *DeviceSecurityGroupsClient) deleteCreateRequest(ctx context.Contex // - options - DeviceSecurityGroupsClientGetOptions contains the optional parameters for the DeviceSecurityGroupsClient.Get // method. func (client *DeviceSecurityGroupsClient) Get(ctx context.Context, resourceID string, deviceSecurityGroupName string, options *DeviceSecurityGroupsClientGetOptions) (DeviceSecurityGroupsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceID, deviceSecurityGroupName, options) if err != nil { return DeviceSecurityGroupsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DeviceSecurityGroupsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DeviceSecurityGroupsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DeviceSecurityGroupsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 60ce6f9f080d..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 new file mode 100644 index 000000000000..b8b0ecf1789a --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/devopsconfigurations_client.go @@ -0,0 +1,391 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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" +) + +// DevOpsConfigurationsClient contains the methods for the DevOpsConfigurations group. +// Don't use this type directly, use NewDevOpsConfigurationsClient() instead. +type DevOpsConfigurationsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDevOpsConfigurationsClient creates a new instance of DevOpsConfigurationsClient 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 NewDevOpsConfigurationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DevOpsConfigurationsClient, error) { + cl, err := arm.NewClient(moduleName+".DevOpsConfigurationsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DevOpsConfigurationsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - devOpsConfiguration - The DevOps configuration resource payload. +// - options - DevOpsConfigurationsClientBeginCreateOrUpdateOptions contains the optional parameters for the DevOpsConfigurationsClient.BeginCreateOrUpdate +// method. +func (client *DevOpsConfigurationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, securityConnectorName string, devOpsConfiguration DevOpsConfiguration, options *DevOpsConfigurationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DevOpsConfigurationsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, securityConnectorName, devOpsConfiguration, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DevOpsConfigurationsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[DevOpsConfigurationsClientCreateOrUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// 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 +func (client *DevOpsConfigurationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, securityConnectorName string, devOpsConfiguration DevOpsConfiguration, options *DevOpsConfigurationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, securityConnectorName, devOpsConfiguration, 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.StatusCreated, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *DevOpsConfigurationsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, devOpsConfiguration DevOpsConfiguration, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, devOpsConfiguration); err != nil { + return nil, err + } + return req, nil +} + +// BeginDelete - Deletes a DevOps Connector. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01-preview +// - 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 +// method. +func (client *DevOpsConfigurationsClient) BeginDelete(ctx context.Context, resourceGroupName string, securityConnectorName string, options *DevOpsConfigurationsClientBeginDeleteOptions) (*runtime.Poller[DevOpsConfigurationsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, securityConnectorName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller[DevOpsConfigurationsClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[DevOpsConfigurationsClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Delete - Deletes a DevOps Connector. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01-preview +func (client *DevOpsConfigurationsClient) deleteOperation(ctx context.Context, resourceGroupName string, securityConnectorName string, options *DevOpsConfigurationsClientBeginDeleteOptions) (*http.Response, error) { + var err error + req, err := client.deleteCreateRequest(ctx, resourceGroupName, securityConnectorName, 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, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *DevOpsConfigurationsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets a DevOps Configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01-preview +// - 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 +// method. +func (client *DevOpsConfigurationsClient) Get(ctx context.Context, resourceGroupName string, securityConnectorName string, options *DevOpsConfigurationsClientGetOptions) (DevOpsConfigurationsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, securityConnectorName, options) + if err != nil { + return DevOpsConfigurationsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DevOpsConfigurationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DevOpsConfigurationsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *DevOpsConfigurationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DevOpsConfigurationsClient) getHandleResponse(resp *http.Response) (DevOpsConfigurationsClientGetResponse, error) { + result := DevOpsConfigurationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DevOpsConfiguration); err != nil { + return DevOpsConfigurationsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - List DevOps Configurations. +// +// Generated from API version 2023-09-01-preview +// - 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 +// method. +func (client *DevOpsConfigurationsClient) NewListPager(resourceGroupName string, securityConnectorName string, options *DevOpsConfigurationsClientListOptions) *runtime.Pager[DevOpsConfigurationsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[DevOpsConfigurationsClientListResponse]{ + More: func(page DevOpsConfigurationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DevOpsConfigurationsClientListResponse) (DevOpsConfigurationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, securityConnectorName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DevOpsConfigurationsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DevOpsConfigurationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DevOpsConfigurationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *DevOpsConfigurationsClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *DevOpsConfigurationsClient) listHandleResponse(resp *http.Response) (DevOpsConfigurationsClientListResponse, error) { + result := DevOpsConfigurationsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DevOpsConfigurationListResponse); err != nil { + return DevOpsConfigurationsClientListResponse{}, err + } + return result, nil +} + +// BeginUpdate - Updates a DevOps Configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - devOpsConfiguration - The DevOps configuration resource payload. +// - options - DevOpsConfigurationsClientBeginUpdateOptions contains the optional parameters for the DevOpsConfigurationsClient.BeginUpdate +// method. +func (client *DevOpsConfigurationsClient) BeginUpdate(ctx context.Context, resourceGroupName string, securityConnectorName string, devOpsConfiguration DevOpsConfiguration, options *DevOpsConfigurationsClientBeginUpdateOptions) (*runtime.Poller[DevOpsConfigurationsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, securityConnectorName, devOpsConfiguration, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DevOpsConfigurationsClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken[DevOpsConfigurationsClientUpdateResponse](options.ResumeToken, client.internal.Pipeline(), nil) + } +} + +// Update - Updates a DevOps Configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01-preview +func (client *DevOpsConfigurationsClient) update(ctx context.Context, resourceGroupName string, securityConnectorName string, devOpsConfiguration DevOpsConfiguration, options *DevOpsConfigurationsClientBeginUpdateOptions) (*http.Response, error) { + var err error + req, err := client.updateCreateRequest(ctx, resourceGroupName, securityConnectorName, devOpsConfiguration, 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 +} + +// updateCreateRequest creates the Update request. +func (client *DevOpsConfigurationsClient) updateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, devOpsConfiguration DevOpsConfiguration, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, devOpsConfiguration); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/devopsoperationresults_client.go b/sdk/resourcemanager/security/armsecurity/devopsoperationresults_client.go new file mode 100644 index 000000000000..b8ca9652d3ae --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/devopsoperationresults_client.go @@ -0,0 +1,110 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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" +) + +// DevOpsOperationResultsClient contains the methods for the DevOpsOperationResults group. +// Don't use this type directly, use NewDevOpsOperationResultsClient() instead. +type DevOpsOperationResultsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewDevOpsOperationResultsClient creates a new instance of DevOpsOperationResultsClient 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 NewDevOpsOperationResultsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DevOpsOperationResultsClient, error) { + cl, err := arm.NewClient(moduleName+".DevOpsOperationResultsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &DevOpsOperationResultsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - operationResultID - The operation result Id. +// - options - DevOpsOperationResultsClientGetOptions contains the optional parameters for the DevOpsOperationResultsClient.Get +// method. +func (client *DevOpsOperationResultsClient) Get(ctx context.Context, resourceGroupName string, securityConnectorName string, operationResultID string, options *DevOpsOperationResultsClientGetOptions) (DevOpsOperationResultsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, securityConnectorName, operationResultID, options) + if err != nil { + return DevOpsOperationResultsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return DevOpsOperationResultsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DevOpsOperationResultsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *DevOpsOperationResultsClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, operationResultID string, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + if operationResultID == "" { + return nil, errors.New("parameter operationResultID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{operationResultId}", url.PathEscape(operationResultID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DevOpsOperationResultsClient) getHandleResponse(resp *http.Response) (DevOpsOperationResultsClientGetResponse, error) { + result := DevOpsOperationResultsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OperationStatusResult); err != nil { + return DevOpsOperationResultsClientGetResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/discoveredsecuritysolutions_client.go b/sdk/resourcemanager/security/armsecurity/discoveredsecuritysolutions_client.go index 9baefc82af9c..8e2e5c474e07 100644 --- a/sdk/resourcemanager/security/armsecurity/discoveredsecuritysolutions_client.go +++ b/sdk/resourcemanager/security/armsecurity/discoveredsecuritysolutions_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -54,18 +53,21 @@ func NewDiscoveredSecuritySolutionsClient(subscriptionID string, credential azco // - options - DiscoveredSecuritySolutionsClientGetOptions contains the optional parameters for the DiscoveredSecuritySolutionsClient.Get // method. func (client *DiscoveredSecuritySolutionsClient) Get(ctx context.Context, resourceGroupName string, ascLocation string, discoveredSecuritySolutionName string, options *DiscoveredSecuritySolutionsClientGetOptions) (DiscoveredSecuritySolutionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, ascLocation, discoveredSecuritySolutionName, options) if err != nil { return DiscoveredSecuritySolutionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return DiscoveredSecuritySolutionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DiscoveredSecuritySolutionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return DiscoveredSecuritySolutionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 9fbf24a6c403..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 2824a069a91d..ef84a9cfeb6b 100644 --- a/sdk/resourcemanager/security/armsecurity/externalsecuritysolutions_client.go +++ b/sdk/resourcemanager/security/armsecurity/externalsecuritysolutions_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -54,18 +53,21 @@ func NewExternalSecuritySolutionsClient(subscriptionID string, credential azcore // - options - ExternalSecuritySolutionsClientGetOptions contains the optional parameters for the ExternalSecuritySolutionsClient.Get // method. func (client *ExternalSecuritySolutionsClient) Get(ctx context.Context, resourceGroupName string, ascLocation string, externalSecuritySolutionsName string, options *ExternalSecuritySolutionsClientGetOptions) (ExternalSecuritySolutionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, ascLocation, externalSecuritySolutionsName, options) if err != nil { return ExternalSecuritySolutionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ExternalSecuritySolutionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ExternalSecuritySolutionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ExternalSecuritySolutionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 9e153a7d3bb1..000000000000 --- a/sdk/resourcemanager/security/armsecurity/externalsecuritysolutions_client_example_test.go +++ /dev/null @@ -1,199 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolutionsSubscription_example.json -func ExampleExternalSecuritySolutionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExternalSecuritySolutionsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExternalSecuritySolutionList = armsecurity.ExternalSecuritySolutionList{ - // Value: []*armsecurity.ExternalSecuritySolution{ - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Location: to.Ptr("eastus"), - // Name: to.Ptr("aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/defaultresourcegroup-eus/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus"), - // }, - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-weu"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/defaultresourcegroup-weu/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-weu"), - // }, - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindCEF), - // Location: to.Ptr("westcentralus"), - // Name: to.Ptr("cef_omsprd_barracudanetworks_waf_barracuda"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/unificationprod/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/cef_omsprd_barracudanetworks_waf_barracuda"), - // }, - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindCEF), - // Location: to.Ptr("westcentralus"), - // Name: to.Ptr("cef_omsprd_virtualhoneypot_Microsoft_demovm20"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/unificationprod/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/cef_omsprd_virtualhoneypot_Microsoft_demovm20"), - // }, - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindCEF), - // Location: to.Ptr("westcentralus"), - // Name: to.Ptr("cef_omsprd_virtualhoneypot_Microsoft_demovm10"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/unificationprod/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/cef_omsprd_virtualhoneypot_Microsoft_demovm10"), - // }, - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Location: to.Ptr("westcentralus"), - // Name: to.Ptr("aad_omsprd"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/unificationprod/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_omsprd"), - // }, - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Location: to.Ptr("japaneast"), - // Name: to.Ptr("aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-ejp"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/defaultresourcegroup-ejp/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-ejp"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolutionsSubscriptionLocation_example.json -func ExampleExternalSecuritySolutionsClient_NewListByHomeRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewExternalSecuritySolutionsClient().NewListByHomeRegionPager("centralus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ExternalSecuritySolutionList = armsecurity.ExternalSecuritySolutionList{ - // Value: []*armsecurity.ExternalSecuritySolution{ - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Location: to.Ptr("eastus"), - // Name: to.Ptr("aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/defaultresourcegroup-eus/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus"), - // }, - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-weu"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/defaultresourcegroup-weu/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-weu"), - // }, - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindCEF), - // Location: to.Ptr("westcentralus"), - // Name: to.Ptr("cef_omsprd_barracudanetworks_waf_barracuda"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/unificationprod/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/cef_omsprd_barracudanetworks_waf_barracuda"), - // }, - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindCEF), - // Location: to.Ptr("westcentralus"), - // Name: to.Ptr("cef_omsprd_virtualhoneypot_Microsoft_demovm20"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/unificationprod/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/cef_omsprd_virtualhoneypot_Microsoft_demovm20"), - // }, - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindCEF), - // Location: to.Ptr("westcentralus"), - // Name: to.Ptr("cef_omsprd_virtualhoneypot_Microsoft_demovm10"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/unificationprod/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/cef_omsprd_virtualhoneypot_Microsoft_demovm10"), - // }, - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Location: to.Ptr("westcentralus"), - // Name: to.Ptr("aad_omsprd"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/unificationprod/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_omsprd"), - // }, - // { - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Location: to.Ptr("japaneast"), - // Name: to.Ptr("aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-ejp"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/defaultresourcegroup-ejp/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-ejp"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolution_example.json -func ExampleExternalSecuritySolutionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExternalSecuritySolutionsClient().Get(ctx, "defaultresourcegroup-eus", "centralus", "aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ExternalSecuritySolution = armsecurity.ExternalSecuritySolution{ - // Kind: to.Ptr(armsecurity.ExternalSecuritySolutionKindAAD), - // Location: to.Ptr("eastus"), - // Name: to.Ptr("aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus"), - // Type: to.Ptr("Microsoft.Security/locations/externalSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/defaultresourcegroup-eus/providers/Microsoft.Security/locations/centralus/externalSecuritySolutions/aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus"), - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/githubowners_client.go b/sdk/resourcemanager/security/armsecurity/githubowners_client.go new file mode 100644 index 000000000000..ae55bfd5e3f0 --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/githubowners_client.go @@ -0,0 +1,239 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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" +) + +// GitHubOwnersClient contains the methods for the GitHubOwners group. +// Don't use this type directly, use NewGitHubOwnersClient() instead. +type GitHubOwnersClient struct { + internal *arm.Client + subscriptionID string +} + +// NewGitHubOwnersClient creates a new instance of GitHubOwnersClient 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 NewGitHubOwnersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GitHubOwnersClient, error) { + cl, err := arm.NewClient(moduleName+".GitHubOwnersClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &GitHubOwnersClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Returns a monitored GitHub owner. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - ownerName - The GitHub owner name. +// - options - GitHubOwnersClientGetOptions contains the optional parameters for the GitHubOwnersClient.Get method. +func (client *GitHubOwnersClient) Get(ctx context.Context, resourceGroupName string, securityConnectorName string, ownerName string, options *GitHubOwnersClientGetOptions) (GitHubOwnersClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, securityConnectorName, ownerName, options) + if err != nil { + return GitHubOwnersClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GitHubOwnersClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GitHubOwnersClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *GitHubOwnersClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, ownerName string, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + if ownerName == "" { + return nil, errors.New("parameter ownerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ownerName}", url.PathEscape(ownerName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *GitHubOwnersClient) getHandleResponse(resp *http.Response) (GitHubOwnersClientGetResponse, error) { + result := GitHubOwnersClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GitHubOwner); err != nil { + return GitHubOwnersClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Returns a list of GitHub owners onboarded to the connector. +// +// Generated from API version 2023-09-01-preview +// - 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. +func (client *GitHubOwnersClient) NewListPager(resourceGroupName string, securityConnectorName string, options *GitHubOwnersClientListOptions) *runtime.Pager[GitHubOwnersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[GitHubOwnersClientListResponse]{ + More: func(page GitHubOwnersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *GitHubOwnersClientListResponse) (GitHubOwnersClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, securityConnectorName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return GitHubOwnersClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GitHubOwnersClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GitHubOwnersClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *GitHubOwnersClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *GitHubOwnersClient) listHandleResponse(resp *http.Response) (GitHubOwnersClientListResponse, error) { + result := GitHubOwnersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GitHubOwnerListResponse); err != nil { + return GitHubOwnersClientListResponse{}, err + } + return result, nil +} + +// 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 +// - 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 +// method. +func (client *GitHubOwnersClient) ListAvailable(ctx context.Context, resourceGroupName string, securityConnectorName string, options *GitHubOwnersClientListAvailableOptions) (GitHubOwnersClientListAvailableResponse, error) { + var err error + req, err := client.listAvailableCreateRequest(ctx, resourceGroupName, securityConnectorName, options) + if err != nil { + return GitHubOwnersClientListAvailableResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GitHubOwnersClientListAvailableResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GitHubOwnersClientListAvailableResponse{}, err + } + resp, err := client.listAvailableHandleResponse(httpResp) + return resp, err +} + +// listAvailableCreateRequest creates the ListAvailable request. +func (client *GitHubOwnersClient) listAvailableCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAvailableHandleResponse handles the ListAvailable response. +func (client *GitHubOwnersClient) listAvailableHandleResponse(resp *http.Response) (GitHubOwnersClientListAvailableResponse, error) { + result := GitHubOwnersClientListAvailableResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GitHubOwnerListResponse); err != nil { + return GitHubOwnersClientListAvailableResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/githubrepos_client.go b/sdk/resourcemanager/security/armsecurity/githubrepos_client.go new file mode 100644 index 000000000000..796972347b3a --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/githubrepos_client.go @@ -0,0 +1,188 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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" +) + +// GitHubReposClient contains the methods for the GitHubRepos group. +// Don't use this type directly, use NewGitHubReposClient() instead. +type GitHubReposClient struct { + internal *arm.Client + subscriptionID string +} + +// NewGitHubReposClient creates a new instance of GitHubReposClient 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 NewGitHubReposClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GitHubReposClient, error) { + cl, err := arm.NewClient(moduleName+".GitHubReposClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &GitHubReposClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Returns a monitored GitHub repository. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - ownerName - The GitHub owner name. +// - repoName - The repository name. +// - options - GitHubReposClientGetOptions contains the optional parameters for the GitHubReposClient.Get method. +func (client *GitHubReposClient) Get(ctx context.Context, resourceGroupName string, securityConnectorName string, ownerName string, repoName string, options *GitHubReposClientGetOptions) (GitHubReposClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, securityConnectorName, ownerName, repoName, options) + if err != nil { + return GitHubReposClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GitHubReposClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GitHubReposClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// 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) { + 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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + if ownerName == "" { + return nil, errors.New("parameter ownerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ownerName}", url.PathEscape(ownerName)) + if repoName == "" { + return nil, errors.New("parameter repoName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{repoName}", url.PathEscape(repoName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *GitHubReposClient) getHandleResponse(resp *http.Response) (GitHubReposClientGetResponse, error) { + result := GitHubReposClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GitHubRepository); err != nil { + return GitHubReposClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Returns a list of GitHub repositories onboarded to the connector. +// +// Generated from API version 2023-09-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - ownerName - The GitHub owner name. +// - options - GitHubReposClientListOptions contains the optional parameters for the GitHubReposClient.NewListPager method. +func (client *GitHubReposClient) NewListPager(resourceGroupName string, securityConnectorName string, ownerName string, options *GitHubReposClientListOptions) *runtime.Pager[GitHubReposClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[GitHubReposClientListResponse]{ + More: func(page GitHubReposClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *GitHubReposClientListResponse) (GitHubReposClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, securityConnectorName, ownerName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return GitHubReposClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GitHubReposClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GitHubReposClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *GitHubReposClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, ownerName string, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + if ownerName == "" { + return nil, errors.New("parameter ownerName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ownerName}", url.PathEscape(ownerName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *GitHubReposClient) listHandleResponse(resp *http.Response) (GitHubReposClientListResponse, error) { + result := GitHubReposClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GitHubRepositoryListResponse); err != nil { + return GitHubReposClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/gitlabgroups_client.go b/sdk/resourcemanager/security/armsecurity/gitlabgroups_client.go new file mode 100644 index 000000000000..299e0d4e2e21 --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/gitlabgroups_client.go @@ -0,0 +1,239 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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" +) + +// GitLabGroupsClient contains the methods for the GitLabGroups group. +// Don't use this type directly, use NewGitLabGroupsClient() instead. +type GitLabGroupsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewGitLabGroupsClient creates a new instance of GitLabGroupsClient 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 NewGitLabGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GitLabGroupsClient, error) { + cl, err := arm.NewClient(moduleName+".GitLabGroupsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &GitLabGroupsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - groupFQName - The GitLab group fully-qualified name. +// - options - GitLabGroupsClientGetOptions contains the optional parameters for the GitLabGroupsClient.Get method. +func (client *GitLabGroupsClient) Get(ctx context.Context, resourceGroupName string, securityConnectorName string, groupFQName string, options *GitLabGroupsClientGetOptions) (GitLabGroupsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, securityConnectorName, groupFQName, options) + if err != nil { + return GitLabGroupsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GitLabGroupsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GitLabGroupsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *GitLabGroupsClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, groupFQName string, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + if groupFQName == "" { + return nil, errors.New("parameter groupFQName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{groupFQName}", url.PathEscape(groupFQName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *GitLabGroupsClient) getHandleResponse(resp *http.Response) (GitLabGroupsClientGetResponse, error) { + result := GitLabGroupsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GitLabGroup); err != nil { + return GitLabGroupsClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Returns a list of GitLab groups onboarded to the connector. +// +// Generated from API version 2023-09-01-preview +// - 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. +func (client *GitLabGroupsClient) NewListPager(resourceGroupName string, securityConnectorName string, options *GitLabGroupsClientListOptions) *runtime.Pager[GitLabGroupsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[GitLabGroupsClientListResponse]{ + More: func(page GitLabGroupsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *GitLabGroupsClientListResponse) (GitLabGroupsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, securityConnectorName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return GitLabGroupsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GitLabGroupsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GitLabGroupsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *GitLabGroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *GitLabGroupsClient) listHandleResponse(resp *http.Response) (GitLabGroupsClientListResponse, error) { + result := GitLabGroupsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GitLabGroupListResponse); err != nil { + return GitLabGroupsClientListResponse{}, err + } + return result, nil +} + +// 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 +// - 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 +// method. +func (client *GitLabGroupsClient) ListAvailable(ctx context.Context, resourceGroupName string, securityConnectorName string, options *GitLabGroupsClientListAvailableOptions) (GitLabGroupsClientListAvailableResponse, error) { + var err error + req, err := client.listAvailableCreateRequest(ctx, resourceGroupName, securityConnectorName, options) + if err != nil { + return GitLabGroupsClientListAvailableResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GitLabGroupsClientListAvailableResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GitLabGroupsClientListAvailableResponse{}, err + } + resp, err := client.listAvailableHandleResponse(httpResp) + return resp, err +} + +// listAvailableCreateRequest creates the ListAvailable request. +func (client *GitLabGroupsClient) listAvailableCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listAvailableHandleResponse handles the ListAvailable response. +func (client *GitLabGroupsClient) listAvailableHandleResponse(resp *http.Response) (GitLabGroupsClientListAvailableResponse, error) { + result := GitLabGroupsClientListAvailableResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GitLabGroupListResponse); err != nil { + return GitLabGroupsClientListAvailableResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/gitlabprojects_client.go b/sdk/resourcemanager/security/armsecurity/gitlabprojects_client.go new file mode 100644 index 000000000000..58ad7d4620e1 --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/gitlabprojects_client.go @@ -0,0 +1,188 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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" +) + +// GitLabProjectsClient contains the methods for the GitLabProjects group. +// Don't use this type directly, use NewGitLabProjectsClient() instead. +type GitLabProjectsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewGitLabProjectsClient creates a new instance of GitLabProjectsClient 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 NewGitLabProjectsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GitLabProjectsClient, error) { + cl, err := arm.NewClient(moduleName+".GitLabProjectsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &GitLabProjectsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - groupFQName - The GitLab group fully-qualified name. +// - projectName - The project name. +// - options - GitLabProjectsClientGetOptions contains the optional parameters for the GitLabProjectsClient.Get method. +func (client *GitLabProjectsClient) Get(ctx context.Context, resourceGroupName string, securityConnectorName string, groupFQName string, projectName string, options *GitLabProjectsClientGetOptions) (GitLabProjectsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceGroupName, securityConnectorName, groupFQName, projectName, options) + if err != nil { + return GitLabProjectsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GitLabProjectsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GitLabProjectsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// 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) { + 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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + if groupFQName == "" { + return nil, errors.New("parameter groupFQName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{groupFQName}", url.PathEscape(groupFQName)) + if projectName == "" { + return nil, errors.New("parameter projectName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{projectName}", url.PathEscape(projectName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *GitLabProjectsClient) getHandleResponse(resp *http.Response) (GitLabProjectsClientGetResponse, error) { + result := GitLabProjectsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GitLabProject); err != nil { + return GitLabProjectsClientGetResponse{}, err + } + return result, nil +} + +// 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 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - groupFQName - The GitLab group fully-qualified name. +// - options - GitLabProjectsClientListOptions contains the optional parameters for the GitLabProjectsClient.NewListPager method. +func (client *GitLabProjectsClient) NewListPager(resourceGroupName string, securityConnectorName string, groupFQName string, options *GitLabProjectsClientListOptions) *runtime.Pager[GitLabProjectsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[GitLabProjectsClientListResponse]{ + More: func(page GitLabProjectsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *GitLabProjectsClientListResponse) (GitLabProjectsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, securityConnectorName, groupFQName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return GitLabProjectsClientListResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GitLabProjectsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GitLabProjectsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *GitLabProjectsClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, groupFQName string, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + if groupFQName == "" { + return nil, errors.New("parameter groupFQName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{groupFQName}", url.PathEscape(groupFQName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *GitLabProjectsClient) listHandleResponse(resp *http.Response) (GitLabProjectsClientListResponse, error) { + result := GitLabProjectsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GitLabProjectListResponse); err != nil { + return GitLabProjectsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/gitlabsubgroups_client.go b/sdk/resourcemanager/security/armsecurity/gitlabsubgroups_client.go new file mode 100644 index 000000000000..e40f565d9ebd --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/gitlabsubgroups_client.go @@ -0,0 +1,109 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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" +) + +// GitLabSubgroupsClient contains the methods for the GitLabSubgroups group. +// Don't use this type directly, use NewGitLabSubgroupsClient() instead. +type GitLabSubgroupsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewGitLabSubgroupsClient creates a new instance of GitLabSubgroupsClient 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 NewGitLabSubgroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GitLabSubgroupsClient, error) { + cl, err := arm.NewClient(moduleName+".GitLabSubgroupsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &GitLabSubgroupsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// 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 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - groupFQName - The GitLab group fully-qualified name. +// - options - GitLabSubgroupsClientListOptions contains the optional parameters for the GitLabSubgroupsClient.List method. +func (client *GitLabSubgroupsClient) List(ctx context.Context, resourceGroupName string, securityConnectorName string, groupFQName string, options *GitLabSubgroupsClientListOptions) (GitLabSubgroupsClientListResponse, error) { + var err error + req, err := client.listCreateRequest(ctx, resourceGroupName, securityConnectorName, groupFQName, options) + if err != nil { + return GitLabSubgroupsClientListResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return GitLabSubgroupsClientListResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GitLabSubgroupsClientListResponse{}, err + } + resp, err := client.listHandleResponse(httpResp) + return resp, err +} + +// listCreateRequest creates the List request. +func (client *GitLabSubgroupsClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, groupFQName string, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if securityConnectorName == "" { + return nil, errors.New("parameter securityConnectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) + if groupFQName == "" { + return nil, errors.New("parameter groupFQName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{groupFQName}", url.PathEscape(groupFQName)) + 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", "2023-09-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *GitLabSubgroupsClient) listHandleResponse(resp *http.Response) (GitLabSubgroupsClientListResponse, error) { + result := GitLabSubgroupsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GitLabGroupListResponse); err != nil { + return GitLabSubgroupsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/go.mod b/sdk/resourcemanager/security/armsecurity/go.mod index 246ab881c075..7f5bf836bd4b 100644 --- a/sdk/resourcemanager/security/armsecurity/go.mod +++ b/sdk/resourcemanager/security/armsecurity/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurit go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/text v0.8.0 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/security/armsecurity/go.sum b/sdk/resourcemanager/security/armsecurity/go.sum index 8ba445a8c4da..5c6bee428364 100644 --- a/sdk/resourcemanager/security/armsecurity/go.sum +++ b/sdk/resourcemanager/security/armsecurity/go.sum @@ -1,31 +1,15 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/security/armsecurity/governanceassignments_client.go b/sdk/resourcemanager/security/armsecurity/governanceassignments_client.go index 8829044848f2..c42c2186ff2e 100644 --- a/sdk/resourcemanager/security/armsecurity/governanceassignments_client.go +++ b/sdk/resourcemanager/security/armsecurity/governanceassignments_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -54,18 +53,21 @@ func NewGovernanceAssignmentsClient(credential azcore.TokenCredential, options * // - options - GovernanceAssignmentsClientCreateOrUpdateOptions contains the optional parameters for the GovernanceAssignmentsClient.CreateOrUpdate // method. func (client *GovernanceAssignmentsClient) CreateOrUpdate(ctx context.Context, scope string, assessmentName string, assignmentKey string, governanceAssignment GovernanceAssignment, options *GovernanceAssignmentsClientCreateOrUpdateOptions) (GovernanceAssignmentsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, scope, assessmentName, assignmentKey, governanceAssignment, options) if err != nil { return GovernanceAssignmentsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GovernanceAssignmentsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return GovernanceAssignmentsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return GovernanceAssignmentsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -91,7 +93,10 @@ func (client *GovernanceAssignmentsClient) createOrUpdateCreateRequest(ctx conte reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, governanceAssignment) + if err := runtime.MarshalAsJSON(req, governanceAssignment); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -115,16 +120,18 @@ func (client *GovernanceAssignmentsClient) createOrUpdateHandleResponse(resp *ht // - options - GovernanceAssignmentsClientDeleteOptions contains the optional parameters for the GovernanceAssignmentsClient.Delete // method. func (client *GovernanceAssignmentsClient) Delete(ctx context.Context, scope string, assessmentName string, assignmentKey string, options *GovernanceAssignmentsClientDeleteOptions) (GovernanceAssignmentsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, scope, assessmentName, assignmentKey, options) if err != nil { return GovernanceAssignmentsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GovernanceAssignmentsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return GovernanceAssignmentsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return GovernanceAssignmentsClientDeleteResponse{}, err } return GovernanceAssignmentsClientDeleteResponse{}, nil } @@ -166,18 +173,21 @@ func (client *GovernanceAssignmentsClient) deleteCreateRequest(ctx context.Conte // - options - GovernanceAssignmentsClientGetOptions contains the optional parameters for the GovernanceAssignmentsClient.Get // method. func (client *GovernanceAssignmentsClient) Get(ctx context.Context, scope string, assessmentName string, assignmentKey string, options *GovernanceAssignmentsClientGetOptions) (GovernanceAssignmentsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, scope, assessmentName, assignmentKey, options) if err != nil { return GovernanceAssignmentsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GovernanceAssignmentsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GovernanceAssignmentsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GovernanceAssignmentsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 626c212b9d40..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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/ListGovernanceAssignments_example.json -func ExampleGovernanceAssignmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewGovernanceAssignmentsClient().NewListPager("subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd", "6b9421dd-5555-2251-9b3d-2be58e2f82cd", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.GovernanceAssignmentsList = armsecurity.GovernanceAssignmentsList{ - // Value: []*armsecurity.GovernanceAssignment{ - // { - // Name: to.Ptr("6634ff9f-127b-4bf2-8e6e-b1737f5e789c"), - // Type: to.Ptr("Microsoft.Security/assessments/governanceAssignments"), - // ID: to.Ptr("/subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012/providers/Microsoft.Security/assessments/6b9421dd-5555-2251-9b3d-2be58e2f82cd/governanceAssignments/6634ff9f-127b-4bf2-8e6e-b1737f5e789c"), - // Properties: &armsecurity.GovernanceAssignmentProperties{ - // AdditionalData: &armsecurity.GovernanceAssignmentAdditionalData{ - // TicketLink: to.Ptr("https://snow.com"), - // TicketNumber: to.Ptr[int32](123123), - // TicketStatus: to.Ptr("Active"), - // }, - // IsGracePeriod: to.Ptr(true), - // Owner: to.Ptr("user@contoso.com"), - // RemediationDueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-07T13:00:00.0000000Z"); return t}()), - // RemediationEta: &armsecurity.RemediationEta{ - // Eta: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T13:00:00.0000000Z"); return t}()), - // Justification: to.Ptr("Justification of ETA"), - // }, - // }, - // }, - // { - // Name: to.Ptr("41fb92a5-43dc-4c00-a969-469c16cef7a7"), - // Type: to.Ptr("Microsoft.Security/assessments/governanceAssignments"), - // ID: to.Ptr("/subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2011/providers/Microsoft.Security/assessments/6b9421dd-5555-2251-9b3d-2be58e2f82cd/governanceAssignments/41fb92a5-43dc-4c00-a969-469c16cef7a7"), - // Properties: &armsecurity.GovernanceAssignmentProperties{ - // AdditionalData: &armsecurity.GovernanceAssignmentAdditionalData{ - // TicketLink: to.Ptr("https://snow.com"), - // TicketNumber: to.Ptr[int32](653424), - // TicketStatus: to.Ptr("Active"), - // }, - // IsGracePeriod: to.Ptr(true), - // Owner: to.Ptr("user2@contoso.com"), - // RemediationDueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-07T13:00:00.0000000Z"); return t}()), - // RemediationEta: &armsecurity.RemediationEta{ - // Eta: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T13:00:00.0000000Z"); return t}()), - // Justification: to.Ptr("Justification of ETA"), - // }, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/GetGovernanceAssignment_example.json -func ExampleGovernanceAssignmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGovernanceAssignmentsClient().Get(ctx, "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", "6b9421dd-5555-2251-9b3d-2be58e2f82cd", "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GovernanceAssignment = armsecurity.GovernanceAssignment{ - // Name: to.Ptr("6634ff9f-127b-4bf2-8e6e-b1737f5e789c"), - // Type: to.Ptr("Microsoft.Security/assessments/governanceAssignments"), - // ID: to.Ptr("/subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012/providers/Microsoft.Security/assessments/6b9421dd-5555-2251-9b3d-2be58e2f82cd/governanceAssignments/6634ff9f-127b-4bf2-8e6e-b1737f5e789c"), - // Properties: &armsecurity.GovernanceAssignmentProperties{ - // AdditionalData: &armsecurity.GovernanceAssignmentAdditionalData{ - // TicketLink: to.Ptr("https://snow.com"), - // TicketNumber: to.Ptr[int32](123123), - // TicketStatus: to.Ptr("Active"), - // }, - // GovernanceEmailNotification: &armsecurity.GovernanceEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(false), - // DisableOwnerEmailNotification: to.Ptr(false), - // }, - // IsGracePeriod: to.Ptr(true), - // Owner: to.Ptr("user@contoso.com"), - // RemediationDueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-07T13:00:00.0000000Z"); return t}()), - // RemediationEta: &armsecurity.RemediationEta{ - // Eta: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T13:00:00.0000000Z"); return t}()), - // Justification: to.Ptr("Justification of ETA"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/PutGovernanceAssignment_example.json -func ExampleGovernanceAssignmentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewGovernanceAssignmentsClient().CreateOrUpdate(ctx, "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", "6b9421dd-5555-2251-9b3d-2be58e2f82cd", "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", armsecurity.GovernanceAssignment{ - Properties: &armsecurity.GovernanceAssignmentProperties{ - AdditionalData: &armsecurity.GovernanceAssignmentAdditionalData{ - TicketLink: to.Ptr("https://snow.com"), - TicketNumber: to.Ptr[int32](123123), - TicketStatus: to.Ptr("Active"), - }, - GovernanceEmailNotification: &armsecurity.GovernanceEmailNotification{ - DisableManagerEmailNotification: to.Ptr(false), - DisableOwnerEmailNotification: to.Ptr(false), - }, - IsGracePeriod: to.Ptr(true), - Owner: to.Ptr("user@contoso.com"), - RemediationDueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-07T13:00:00.0000000Z"); return t }()), - RemediationEta: &armsecurity.RemediationEta{ - Eta: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T13:00:00.0000000Z"); return t }()), - Justification: to.Ptr("Justification of ETA"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.GovernanceAssignment = armsecurity.GovernanceAssignment{ - // Name: to.Ptr("6634ff9f-127b-4bf2-8e6e-b1737f5e789c"), - // Type: to.Ptr("Microsoft.Security/assessments/governanceAssignments"), - // ID: to.Ptr("/subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012/providers/Microsoft.Security/assessments/6b9421dd-5555-2251-9b3d-2be58e2f82cd/governanceAssignments/6634ff9f-127b-4bf2-8e6e-b1737f5e789c"), - // Properties: &armsecurity.GovernanceAssignmentProperties{ - // AdditionalData: &armsecurity.GovernanceAssignmentAdditionalData{ - // TicketLink: to.Ptr("https://snow.com"), - // TicketNumber: to.Ptr[int32](123123), - // TicketStatus: to.Ptr("Active"), - // }, - // GovernanceEmailNotification: &armsecurity.GovernanceEmailNotification{ - // DisableManagerEmailNotification: to.Ptr(false), - // DisableOwnerEmailNotification: to.Ptr(false), - // }, - // IsGracePeriod: to.Ptr(true), - // Owner: to.Ptr("user@contoso.com"), - // RemediationDueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-07T13:00:00.0000000Z"); return t}()), - // RemediationEta: &armsecurity.RemediationEta{ - // Eta: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T13:00:00.0000000Z"); return t}()), - // Justification: to.Ptr("Justification of ETA"), - // }, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/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 4377ee18c5bd..ef8e6b51cb91 100644 --- a/sdk/resourcemanager/security/armsecurity/governancerules_client.go +++ b/sdk/resourcemanager/security/armsecurity/governancerules_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -54,18 +53,21 @@ func NewGovernanceRulesClient(credential azcore.TokenCredential, options *arm.Cl // - options - GovernanceRulesClientCreateOrUpdateOptions contains the optional parameters for the GovernanceRulesClient.CreateOrUpdate // method. func (client *GovernanceRulesClient) CreateOrUpdate(ctx context.Context, scope string, ruleID string, governanceRule GovernanceRule, options *GovernanceRulesClientCreateOrUpdateOptions) (GovernanceRulesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, scope, ruleID, governanceRule, options) if err != nil { return GovernanceRulesClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GovernanceRulesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return GovernanceRulesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return GovernanceRulesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -87,7 +89,10 @@ func (client *GovernanceRulesClient) createOrUpdateCreateRequest(ctx context.Con reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, governanceRule) + if err := runtime.MarshalAsJSON(req, governanceRule); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -116,9 +121,10 @@ func (client *GovernanceRulesClient) BeginDelete(ctx context.Context, scope stri if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GovernanceRulesClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GovernanceRulesClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[GovernanceRulesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -129,18 +135,20 @@ func (client *GovernanceRulesClient) BeginDelete(ctx context.Context, scope stri // // Generated from API version 2022-01-01-preview func (client *GovernanceRulesClient) deleteOperation(ctx context.Context, scope string, ruleID string, options *GovernanceRulesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, scope, ruleID, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -181,9 +189,10 @@ func (client *GovernanceRulesClient) BeginExecute(ctx context.Context, scope str if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GovernanceRulesClientExecuteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[GovernanceRulesClientExecuteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[GovernanceRulesClientExecuteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -194,18 +203,20 @@ func (client *GovernanceRulesClient) BeginExecute(ctx context.Context, scope str // // Generated from API version 2022-01-01-preview func (client *GovernanceRulesClient) execute(ctx context.Context, scope string, ruleID string, options *GovernanceRulesClientBeginExecuteOptions) (*http.Response, error) { + var err error req, err := client.executeCreateRequest(ctx, scope, ruleID, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // executeCreateRequest creates the Execute request. @@ -228,7 +239,10 @@ func (client *GovernanceRulesClient) executeCreateRequest(ctx context.Context, s req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.ExecuteGovernanceRuleParams != nil { - return req, runtime.MarshalAsJSON(req, *options.ExecuteGovernanceRuleParams) + if err := runtime.MarshalAsJSON(req, *options.ExecuteGovernanceRuleParams); err != nil { + return nil, err + } + return req, nil } return req, nil } @@ -244,18 +258,21 @@ func (client *GovernanceRulesClient) executeCreateRequest(ctx context.Context, s // - ruleID - The governance rule key - unique key for the standard governance rule (GUID) // - options - GovernanceRulesClientGetOptions contains the optional parameters for the GovernanceRulesClient.Get method. func (client *GovernanceRulesClient) Get(ctx context.Context, scope string, ruleID string, options *GovernanceRulesClientGetOptions) (GovernanceRulesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, scope, ruleID, options) if err != nil { return GovernanceRulesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GovernanceRulesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GovernanceRulesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return GovernanceRulesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -366,18 +383,21 @@ func (client *GovernanceRulesClient) listHandleResponse(resp *http.Response) (Go // - options - GovernanceRulesClientOperationResultsOptions contains the optional parameters for the GovernanceRulesClient.OperationResults // method. func (client *GovernanceRulesClient) OperationResults(ctx context.Context, scope string, ruleID string, operationID string, options *GovernanceRulesClientOperationResultsOptions) (GovernanceRulesClientOperationResultsResponse, error) { + var err error req, err := client.operationResultsCreateRequest(ctx, scope, ruleID, operationID, options) if err != nil { return GovernanceRulesClientOperationResultsResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return GovernanceRulesClientOperationResultsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return GovernanceRulesClientOperationResultsResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return GovernanceRulesClientOperationResultsResponse{}, err } - return client.operationResultsHandleResponse(resp) + resp, err := client.operationResultsHandleResponse(httpResp) + return resp, err } // operationResultsCreateRequest creates the OperationResults request. 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 8bcef8974eea..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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.7993124Z"); 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.7993124Z"); 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.7993124Z"); 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.7993124Z"); 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/e716082ac474f182e2220e4f38f1d6191e7636cf/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.7993124Z"); 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.7993124Z"); 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.7993124Z"); 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.7993124Z"); 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/e716082ac474f182e2220e4f38f1d6191e7636cf/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.7993124Z"); 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.7993124Z"); 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.7993124Z"); 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.7993124Z"); 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/e716082ac474f182e2220e4f38f1d6191e7636cf/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.7993124Z"); 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.7993124Z"); 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/e716082ac474f182e2220e4f38f1d6191e7636cf/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.7993124Z"); 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.7993124Z"); 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/e716082ac474f182e2220e4f38f1d6191e7636cf/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.7993124Z"); 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.7993124Z"); 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/e716082ac474f182e2220e4f38f1d6191e7636cf/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.7993124Z"); 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.7993124Z"); 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/e716082ac474f182e2220e4f38f1d6191e7636cf/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.7993124Z"); 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.7993124Z"); 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/e716082ac474f182e2220e4f38f1d6191e7636cf/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.7993124Z"); 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.7993124Z"); 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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/healthreport_client.go b/sdk/resourcemanager/security/armsecurity/healthreport_client.go deleted file mode 100644 index 781f34614bce..000000000000 --- a/sdk/resourcemanager/security/armsecurity/healthreport_client.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 - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// HealthReportClient contains the methods for the HealthReport group. -// Don't use this type directly, use NewHealthReportClient() instead. -type HealthReportClient struct { - internal *arm.Client -} - -// NewHealthReportClient creates a new instance of HealthReportClient with the specified values. -// - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. -func NewHealthReportClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*HealthReportClient, error) { - cl, err := arm.NewClient(moduleName+".HealthReportClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &HealthReportClient{ - internal: cl, - } - return client, nil -} - -// Get - Get health report of resource -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2023-02-01-preview -// - resourceID - The identifier of the resource. -// - healthReportName - The health report Key - Unique key for the health report type -// - options - HealthReportClientGetOptions contains the optional parameters for the HealthReportClient.Get method. -func (client *HealthReportClient) Get(ctx context.Context, resourceID string, healthReportName string, options *HealthReportClientGetOptions) (HealthReportClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceID, healthReportName, options) - if err != nil { - return HealthReportClientGetResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return HealthReportClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return HealthReportClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *HealthReportClient) getCreateRequest(ctx context.Context, resourceID string, healthReportName string, options *HealthReportClientGetOptions) (*policy.Request, error) { - urlPath := "/{resourceId}/providers/Microsoft.Security/healthReports/{healthReportName}" - urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID) - if healthReportName == "" { - return nil, errors.New("parameter healthReportName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{healthReportName}", url.PathEscape(healthReportName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *HealthReportClient) getHandleResponse(resp *http.Response) (HealthReportClientGetResponse, error) { - result := HealthReportClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.HealthReport); err != nil { - return HealthReportClientGetResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/security/armsecurity/healthreport_client_example_test.go b/sdk/resourcemanager/security/armsecurity/healthreport_client_example_test.go deleted file mode 100644 index 84f884dc090c..000000000000 --- a/sdk/resourcemanager/security/armsecurity/healthreport_client_example_test.go +++ /dev/null @@ -1,81 +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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2023-02-01-preview/examples/HealthReports/GetHealthReport_example.json -func ExampleHealthReportClient_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.NewHealthReportClient().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(armsecurity.ScopeNameConnectors), - // }, - // 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.6759138Z"); return t}()), - // StatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-12T09:07:18.6759138Z"); return t}()), - // }, - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/healthreports_client.go b/sdk/resourcemanager/security/armsecurity/healthreports_client.go index 12bb83ab50f2..1ce3251b036b 100644 --- a/sdk/resourcemanager/security/armsecurity/healthreports_client.go +++ b/sdk/resourcemanager/security/armsecurity/healthreports_client.go @@ -3,19 +3,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity import ( "context" + "errors" "github.com/Azure/azure-sdk-for-go/sdk/azcore" "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "net/http" + "net/url" "strings" ) @@ -39,11 +40,64 @@ func NewHealthReportsClient(credential azcore.TokenCredential, options *arm.Clie return client, nil } +// Get - Get health report of resource +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01-preview +// - resourceID - The identifier of the resource. +// - healthReportName - The health report Key - Unique key for the health report type +// - options - HealthReportsClientGetOptions contains the optional parameters for the HealthReportsClient.Get method. +func (client *HealthReportsClient) Get(ctx context.Context, resourceID string, healthReportName string, options *HealthReportsClientGetOptions) (HealthReportsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, resourceID, healthReportName, options) + if err != nil { + return HealthReportsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return HealthReportsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return HealthReportsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *HealthReportsClient) getCreateRequest(ctx context.Context, resourceID string, healthReportName string, options *HealthReportsClientGetOptions) (*policy.Request, error) { + urlPath := "/{resourceId}/providers/Microsoft.Security/healthReports/{healthReportName}" + urlPath = strings.ReplaceAll(urlPath, "{resourceId}", resourceID) + if healthReportName == "" { + return nil, errors.New("parameter healthReportName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{healthReportName}", url.PathEscape(healthReportName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *HealthReportsClient) getHandleResponse(resp *http.Response) (HealthReportsClientGetResponse, error) { + result := HealthReportsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.HealthReport); err != nil { + return HealthReportsClientGetResponse{}, err + } + return result, nil +} + // NewListPager - Get a list of all health reports inside a scope. Valid scopes are: subscription (format: 'subscriptions/{subscriptionId}'), // or security connector (format: // 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' // -// Generated from API version 2023-02-01-preview +// Generated from API version 2023-05-01-preview // - scope - The scope at which the operation is performed. // - options - HealthReportsClientListOptions contains the optional parameters for the HealthReportsClient.NewListPager method. func (client *HealthReportsClient) NewListPager(scope string, options *HealthReportsClientListOptions) *runtime.Pager[HealthReportsClientListResponse] { @@ -83,7 +137,7 @@ func (client *HealthReportsClient) listCreateRequest(ctx context.Context, scope return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01-preview") + reqQP.Set("api-version", "2023-05-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/security/armsecurity/healthreports_client_example_test.go b/sdk/resourcemanager/security/armsecurity/healthreports_client_example_test.go deleted file mode 100644 index aab78a5f6445..000000000000 --- a/sdk/resourcemanager/security/armsecurity/healthreports_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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2023-02-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(armsecurity.ScopeNameVirtualMachines), - // }, - // 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.6759138Z"); return t}()), - // StatusChangeDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-01-12T09:07:18.6759138Z"); return t}()), - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/informationprotectionpolicies_client.go b/sdk/resourcemanager/security/armsecurity/informationprotectionpolicies_client.go index a6a3bbcefbba..91c856a7b21d 100644 --- a/sdk/resourcemanager/security/armsecurity/informationprotectionpolicies_client.go +++ b/sdk/resourcemanager/security/armsecurity/informationprotectionpolicies_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -52,18 +51,21 @@ func NewInformationProtectionPoliciesClient(credential azcore.TokenCredential, o // - options - InformationProtectionPoliciesClientCreateOrUpdateOptions contains the optional parameters for the InformationProtectionPoliciesClient.CreateOrUpdate // method. func (client *InformationProtectionPoliciesClient) CreateOrUpdate(ctx context.Context, scope string, informationProtectionPolicyName InformationProtectionPolicyName, informationProtectionPolicy InformationProtectionPolicy, options *InformationProtectionPoliciesClientCreateOrUpdateOptions) (InformationProtectionPoliciesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, scope, informationProtectionPolicyName, informationProtectionPolicy, options) if err != nil { return InformationProtectionPoliciesClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return InformationProtectionPoliciesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return InformationProtectionPoliciesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return InformationProtectionPoliciesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -82,7 +84,10 @@ func (client *InformationProtectionPoliciesClient) createOrUpdateCreateRequest(c reqQP.Set("api-version", "2017-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, informationProtectionPolicy) + if err := runtime.MarshalAsJSON(req, informationProtectionPolicy); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -104,18 +109,21 @@ func (client *InformationProtectionPoliciesClient) createOrUpdateHandleResponse( // - options - InformationProtectionPoliciesClientGetOptions contains the optional parameters for the InformationProtectionPoliciesClient.Get // method. func (client *InformationProtectionPoliciesClient) Get(ctx context.Context, scope string, informationProtectionPolicyName InformationProtectionPolicyName, options *InformationProtectionPoliciesClientGetOptions) (InformationProtectionPoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, scope, informationProtectionPolicyName, options) if err != nil { return InformationProtectionPoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return InformationProtectionPoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return InformationProtectionPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return InformationProtectionPoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 caadd09dbf16..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/ListInformationProtectionPolicies_example.json -func ExampleInformationProtectionPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewInformationProtectionPoliciesClient().NewListPager("providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.InformationProtectionPolicyList = armsecurity.InformationProtectionPolicyList{ - // Value: []*armsecurity.InformationProtectionPolicy{ - // { - // Name: to.Ptr("effective"), - // Type: to.Ptr("Microsoft.Security/informationProtectionPolicies"), - // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e/providers/Microsoft.Security/informationProtectionPolicies/effective"), - // Properties: &armsecurity.InformationProtectionPolicyProperties{ - // InformationTypes: map[string]*armsecurity.InformationType{ - // "3bf35491-99b8-41f2-86d5-c1200a7df658": &armsecurity.InformationType{ - // Custom: to.Ptr(true), - // DisplayName: to.Ptr("Custom"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(true), - // Pattern: to.Ptr("%networking%"), - // }}, - // Order: to.Ptr[int32](1400), - // RecommendedLabelID: to.Ptr("7aa516c7-5a53-4857-bc6e-6808c6acd542"), - // }, - // "5856f35c-8e08-4d08-9bf7-87a146150569": &armsecurity.InformationType{ - // Custom: to.Ptr(false), - // DisplayName: to.Ptr("Contact Info"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%email%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%e-mail%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%addr%"), - // }, - // { - // CanBeNumeric: to.Ptr(true), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%street%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%city%"), - // }}, - // Order: to.Ptr[int32](200), - // RecommendedLabelID: to.Ptr("575739d2-3d53-4df0-9042-4c7772d5c7b1"), - // }, - // "7fb9419d-2473-4ad8-8e11-b25cc8cf6a07": &armsecurity.InformationType{ - // Custom: to.Ptr(false), - // DisplayName: to.Ptr("Networking"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%ip%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("ip%address%"), - // }, - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(false), - // Pattern: to.Ptr("%mac%address%"), - // }, - // { - // CanBeNumeric: to.Ptr(true), - // Custom: to.Ptr(true), - // Pattern: to.Ptr("%networking%"), - // }}, - // Order: to.Ptr[int32](100), - // RecommendedLabelID: to.Ptr("575739d2-3d53-4df0-9042-4c7772d5c7b1"), - // }, - // }, - // Labels: map[string]*armsecurity.SensitivityLabel{ - // "1345da73-bc5a-4a8f-b7dd-3820eb713da8": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("Public"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](100), - // }, - // "575739d2-3d53-4df0-9042-4c7772d5c7b1": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("Confidential"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](300), - // }, - // "7aa516c7-5a53-4857-bc6e-6808c6acd542": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("General"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](200), - // }, - // }, - // }, - // }, - // { - // Name: to.Ptr("custom"), - // Type: to.Ptr("Microsoft.Security/informationProtectionPolicies"), - // ID: to.Ptr("/providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e/providers/Microsoft.Security/informationProtectionPolicies/custom"), - // Properties: &armsecurity.InformationProtectionPolicyProperties{ - // InformationTypes: map[string]*armsecurity.InformationType{ - // "3bf35491-99b8-41f2-86d5-c1200a7df658": &armsecurity.InformationType{ - // Custom: to.Ptr(true), - // DisplayName: to.Ptr("Custom"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(true), - // Custom: to.Ptr(true), - // Pattern: to.Ptr("%custom%"), - // }}, - // Order: to.Ptr[int32](1400), - // RecommendedLabelID: to.Ptr("7aa516c7-5a53-4857-bc6e-6808c6acd542"), - // }, - // "7fb9419d-2473-4ad8-8e11-b25cc8cf6a07": &armsecurity.InformationType{ - // Custom: to.Ptr(false), - // DisplayName: to.Ptr("Networking"), - // Enabled: to.Ptr(true), - // Keywords: []*armsecurity.InformationProtectionKeyword{ - // { - // CanBeNumeric: to.Ptr(false), - // Custom: to.Ptr(true), - // Pattern: to.Ptr("%networking%"), - // }}, - // Order: to.Ptr[int32](100), - // RecommendedLabelID: to.Ptr("575739d2-3d53-4df0-9042-4c7772d5c7b1"), - // }, - // }, - // Labels: map[string]*armsecurity.SensitivityLabel{ - // "1345da73-bc5a-4a8f-b7dd-3820eb713da8": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("Public"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](100), - // }, - // "575739d2-3d53-4df0-9042-4c7772d5c7b1": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("Confidential"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](300), - // }, - // "7aa516c7-5a53-4857-bc6e-6808c6acd542": &armsecurity.SensitivityLabel{ - // DisplayName: to.Ptr("General"), - // Enabled: to.Ptr(true), - // Order: to.Ptr[int32](200), - // }, - // }, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/ingestionsettings_client.go b/sdk/resourcemanager/security/armsecurity/ingestionsettings_client.go deleted file mode 100644 index 6a17f4ddcd7b..000000000000 --- a/sdk/resourcemanager/security/armsecurity/ingestionsettings_client.go +++ /dev/null @@ -1,361 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// IngestionSettingsClient contains the methods for the IngestionSettings group. -// Don't use this type directly, use NewIngestionSettingsClient() instead. -type IngestionSettingsClient struct { - internal *arm.Client - subscriptionID string -} - -// NewIngestionSettingsClient creates a new instance of IngestionSettingsClient 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 NewIngestionSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IngestionSettingsClient, error) { - cl, err := arm.NewClient(moduleName+".IngestionSettingsClient", moduleVersion, credential, options) - if err != nil { - return nil, err - } - client := &IngestionSettingsClient{ - subscriptionID: subscriptionID, - internal: cl, - } - return client, nil -} - -// Create - Create setting for ingesting security data and logs to correlate with resources associated with the subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-01-15-preview -// - ingestionSettingName - Name of the ingestion setting -// - ingestionSetting - Ingestion setting object -// - options - IngestionSettingsClientCreateOptions contains the optional parameters for the IngestionSettingsClient.Create -// method. -func (client *IngestionSettingsClient) Create(ctx context.Context, ingestionSettingName string, ingestionSetting IngestionSetting, options *IngestionSettingsClientCreateOptions) (IngestionSettingsClientCreateResponse, error) { - req, err := client.createCreateRequest(ctx, ingestionSettingName, ingestionSetting, options) - if err != nil { - return IngestionSettingsClientCreateResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return IngestionSettingsClientCreateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IngestionSettingsClientCreateResponse{}, runtime.NewResponseError(resp) - } - return client.createHandleResponse(resp) -} - -// createCreateRequest creates the Create request. -func (client *IngestionSettingsClient) createCreateRequest(ctx context.Context, ingestionSettingName string, ingestionSetting IngestionSetting, options *IngestionSettingsClientCreateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if ingestionSettingName == "" { - return nil, errors.New("parameter ingestionSettingName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ingestionSettingName}", url.PathEscape(ingestionSettingName)) - 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", "2021-01-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, ingestionSetting) -} - -// createHandleResponse handles the Create response. -func (client *IngestionSettingsClient) createHandleResponse(resp *http.Response) (IngestionSettingsClientCreateResponse, error) { - result := IngestionSettingsClientCreateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.IngestionSetting); err != nil { - return IngestionSettingsClientCreateResponse{}, err - } - return result, nil -} - -// Delete - Deletes the ingestion settings for this subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-01-15-preview -// - ingestionSettingName - Name of the ingestion setting -// - options - IngestionSettingsClientDeleteOptions contains the optional parameters for the IngestionSettingsClient.Delete -// method. -func (client *IngestionSettingsClient) Delete(ctx context.Context, ingestionSettingName string, options *IngestionSettingsClientDeleteOptions) (IngestionSettingsClientDeleteResponse, error) { - req, err := client.deleteCreateRequest(ctx, ingestionSettingName, options) - if err != nil { - return IngestionSettingsClientDeleteResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return IngestionSettingsClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return IngestionSettingsClientDeleteResponse{}, runtime.NewResponseError(resp) - } - return IngestionSettingsClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *IngestionSettingsClient) deleteCreateRequest(ctx context.Context, ingestionSettingName string, options *IngestionSettingsClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if ingestionSettingName == "" { - return nil, errors.New("parameter ingestionSettingName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ingestionSettingName}", url.PathEscape(ingestionSettingName)) - 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", "2021-01-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// Get - Settings for ingesting security data and logs to correlate with resources associated with the subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-01-15-preview -// - ingestionSettingName - Name of the ingestion setting -// - options - IngestionSettingsClientGetOptions contains the optional parameters for the IngestionSettingsClient.Get method. -func (client *IngestionSettingsClient) Get(ctx context.Context, ingestionSettingName string, options *IngestionSettingsClientGetOptions) (IngestionSettingsClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, ingestionSettingName, options) - if err != nil { - return IngestionSettingsClientGetResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return IngestionSettingsClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IngestionSettingsClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *IngestionSettingsClient) getCreateRequest(ctx context.Context, ingestionSettingName string, options *IngestionSettingsClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if ingestionSettingName == "" { - return nil, errors.New("parameter ingestionSettingName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ingestionSettingName}", url.PathEscape(ingestionSettingName)) - 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", "2021-01-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *IngestionSettingsClient) getHandleResponse(resp *http.Response) (IngestionSettingsClientGetResponse, error) { - result := IngestionSettingsClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.IngestionSetting); err != nil { - return IngestionSettingsClientGetResponse{}, err - } - return result, nil -} - -// NewListPager - Settings for ingesting security data and logs to correlate with resources associated with the subscription. -// -// Generated from API version 2021-01-15-preview -// - options - IngestionSettingsClientListOptions contains the optional parameters for the IngestionSettingsClient.NewListPager -// method. -func (client *IngestionSettingsClient) NewListPager(options *IngestionSettingsClientListOptions) *runtime.Pager[IngestionSettingsClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[IngestionSettingsClientListResponse]{ - More: func(page IngestionSettingsClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *IngestionSettingsClientListResponse) (IngestionSettingsClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return IngestionSettingsClientListResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return IngestionSettingsClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IngestionSettingsClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *IngestionSettingsClient) listCreateRequest(ctx context.Context, options *IngestionSettingsClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings" - 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", "2021-01-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *IngestionSettingsClient) listHandleResponse(resp *http.Response) (IngestionSettingsClientListResponse, error) { - result := IngestionSettingsClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.IngestionSettingList); err != nil { - return IngestionSettingsClientListResponse{}, err - } - return result, nil -} - -// ListConnectionStrings - Connection strings for ingesting security scan logs and data. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-01-15-preview -// - ingestionSettingName - Name of the ingestion setting -// - options - IngestionSettingsClientListConnectionStringsOptions contains the optional parameters for the IngestionSettingsClient.ListConnectionStrings -// method. -func (client *IngestionSettingsClient) ListConnectionStrings(ctx context.Context, ingestionSettingName string, options *IngestionSettingsClientListConnectionStringsOptions) (IngestionSettingsClientListConnectionStringsResponse, error) { - req, err := client.listConnectionStringsCreateRequest(ctx, ingestionSettingName, options) - if err != nil { - return IngestionSettingsClientListConnectionStringsResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return IngestionSettingsClientListConnectionStringsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IngestionSettingsClientListConnectionStringsResponse{}, runtime.NewResponseError(resp) - } - return client.listConnectionStringsHandleResponse(resp) -} - -// listConnectionStringsCreateRequest creates the ListConnectionStrings request. -func (client *IngestionSettingsClient) listConnectionStringsCreateRequest(ctx context.Context, ingestionSettingName string, options *IngestionSettingsClientListConnectionStringsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listConnectionStrings" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if ingestionSettingName == "" { - return nil, errors.New("parameter ingestionSettingName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ingestionSettingName}", url.PathEscape(ingestionSettingName)) - 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", "2021-01-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listConnectionStringsHandleResponse handles the ListConnectionStrings response. -func (client *IngestionSettingsClient) listConnectionStringsHandleResponse(resp *http.Response) (IngestionSettingsClientListConnectionStringsResponse, error) { - result := IngestionSettingsClientListConnectionStringsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ConnectionStrings); err != nil { - return IngestionSettingsClientListConnectionStringsResponse{}, err - } - return result, nil -} - -// ListTokens - Returns the token that is used for correlating ingested telemetry with the resources in the subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// -// Generated from API version 2021-01-15-preview -// - ingestionSettingName - Name of the ingestion setting -// - options - IngestionSettingsClientListTokensOptions contains the optional parameters for the IngestionSettingsClient.ListTokens -// method. -func (client *IngestionSettingsClient) ListTokens(ctx context.Context, ingestionSettingName string, options *IngestionSettingsClientListTokensOptions) (IngestionSettingsClientListTokensResponse, error) { - req, err := client.listTokensCreateRequest(ctx, ingestionSettingName, options) - if err != nil { - return IngestionSettingsClientListTokensResponse{}, err - } - resp, err := client.internal.Pipeline().Do(req) - if err != nil { - return IngestionSettingsClientListTokensResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IngestionSettingsClientListTokensResponse{}, runtime.NewResponseError(resp) - } - return client.listTokensHandleResponse(resp) -} - -// listTokensCreateRequest creates the ListTokens request. -func (client *IngestionSettingsClient) listTokensCreateRequest(ctx context.Context, ingestionSettingName string, options *IngestionSettingsClientListTokensOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/ingestionSettings/{ingestionSettingName}/listTokens" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if ingestionSettingName == "" { - return nil, errors.New("parameter ingestionSettingName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ingestionSettingName}", url.PathEscape(ingestionSettingName)) - 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", "2021-01-15-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listTokensHandleResponse handles the ListTokens response. -func (client *IngestionSettingsClient) listTokensHandleResponse(resp *http.Response) (IngestionSettingsClientListTokensResponse, error) { - result := IngestionSettingsClientListTokensResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.IngestionSettingToken); err != nil { - return IngestionSettingsClientListTokensResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/security/armsecurity/ingestionsettings_client_example_test.go b/sdk/resourcemanager/security/armsecurity/ingestionsettings_client_example_test.go deleted file mode 100644 index 5740cc9f8b07..000000000000 --- a/sdk/resourcemanager/security/armsecurity/ingestionsettings_client_example_test.go +++ /dev/null @@ -1,177 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/GetIngestionSettings_example.json -func ExampleIngestionSettingsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIngestionSettingsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IngestionSettingList = armsecurity.IngestionSettingList{ - // Value: []*armsecurity.IngestionSetting{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/ingestionSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/ingestionSettings/default"), - // }, - // { - // Name: to.Ptr("default2"), - // Type: to.Ptr("Microsoft.Security/ingestionSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/ingestionSettings/default2"), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/GetIngestionSetting_example.json -func ExampleIngestionSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIngestionSettingsClient().Get(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IngestionSetting = armsecurity.IngestionSetting{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/ingestionSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/ingestionSettings/default"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/CreateIngestionSetting_example.json -func ExampleIngestionSettingsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIngestionSettingsClient().Create(ctx, "default", armsecurity.IngestionSetting{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IngestionSetting = armsecurity.IngestionSetting{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/ingestionSettings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/ingestionSettings/default"), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/DeleteIngestionSetting_example.json -func ExampleIngestionSettingsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewIngestionSettingsClient().Delete(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/ListTokensIngestionSetting_example.json -func ExampleIngestionSettingsClient_ListTokens() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIngestionSettingsClient().ListTokens(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IngestionSettingToken = armsecurity.IngestionSettingToken{ - // Token: to.Ptr(""), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/ListConnectionStrings_example.json -func ExampleIngestionSettingsClient_ListConnectionStrings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIngestionSettingsClient().ListConnectionStrings(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ConnectionStrings = armsecurity.ConnectionStrings{ - // Value: []*armsecurity.IngestionConnectionString{ - // { - // Location: to.Ptr("CUS"), - // Value: to.Ptr(""), - // }, - // { - // Location: to.Ptr("WEU"), - // Value: to.Ptr(""), - // }}, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/interfaces.go b/sdk/resourcemanager/security/armsecurity/interfaces.go new file mode 100644 index 000000000000..db92b86c1bc8 --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/interfaces.go @@ -0,0 +1,221 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 + +// AdditionalDataClassification provides polymorphic access to related types. +// Call the interface's GetAdditionalData() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AdditionalData, *ContainerRegistryVulnerabilityProperties, *SQLServerVulnerabilityProperties, *ServerVulnerabilityProperties +type AdditionalDataClassification interface { + // GetAdditionalData returns the AdditionalData content of the underlying type. + GetAdditionalData() *AdditionalData +} + +// AlertSimulatorRequestPropertiesClassification provides polymorphic access to related types. +// Call the interface's GetAlertSimulatorRequestProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AlertSimulatorBundlesRequestProperties, *AlertSimulatorRequestProperties +type AlertSimulatorRequestPropertiesClassification interface { + // GetAlertSimulatorRequestProperties returns the AlertSimulatorRequestProperties content of the underlying type. + GetAlertSimulatorRequestProperties() *AlertSimulatorRequestProperties +} + +// AllowlistCustomAlertRuleClassification provides polymorphic access to related types. +// Call the interface's GetAllowlistCustomAlertRule() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AllowlistCustomAlertRule, *ConnectionFromIPNotAllowed, *ConnectionToIPNotAllowed, *LocalUserNotAllowed, *ProcessNotAllowed +type AllowlistCustomAlertRuleClassification interface { + ListCustomAlertRuleClassification + // GetAllowlistCustomAlertRule returns the AllowlistCustomAlertRule content of the underlying type. + GetAllowlistCustomAlertRule() *AllowlistCustomAlertRule +} + +// 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: +// - *AuthenticationDetailsProperties, *AwAssumeRoleAuthenticationDetailsProperties, *AwsCredsAuthenticationDetailsProperties, +// - *GcpCredentialsDetailsProperties +type AuthenticationDetailsPropertiesClassification interface { + // GetAuthenticationDetailsProperties returns the AuthenticationDetailsProperties content of the underlying type. + GetAuthenticationDetailsProperties() *AuthenticationDetailsProperties +} + +// AutomationActionClassification provides polymorphic access to related types. +// Call the interface's GetAutomationAction() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AutomationAction, *AutomationActionEventHub, *AutomationActionLogicApp, *AutomationActionWorkspace +type AutomationActionClassification interface { + // GetAutomationAction returns the AutomationAction content of the underlying type. + GetAutomationAction() *AutomationAction +} + +// AwsOrganizationalDataClassification provides polymorphic access to related types. +// Call the interface's GetAwsOrganizationalData() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AwsOrganizationalData, *AwsOrganizationalDataMaster, *AwsOrganizationalDataMember +type AwsOrganizationalDataClassification interface { + // GetAwsOrganizationalData returns the AwsOrganizationalData content of the underlying type. + GetAwsOrganizationalData() *AwsOrganizationalData +} + +// 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, *DefenderForDevOpsAzureDevOpsOffering, *DefenderForDevOpsGitLabOffering, +// - *DefenderForDevOpsGithubOffering, *DefenderForServersAwsOffering, *DefenderForServersGcpOffering, *InformationProtectionAwsOffering +type CloudOfferingClassification interface { + // GetCloudOffering returns the CloudOffering content of the underlying type. + GetCloudOffering() *CloudOffering +} + +// CustomAlertRuleClassification provides polymorphic access to related types. +// Call the interface's GetCustomAlertRule() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ActiveConnectionsNotInAllowedRange, *AllowlistCustomAlertRule, *AmqpC2DMessagesNotInAllowedRange, *AmqpC2DRejectedMessagesNotInAllowedRange, +// - *AmqpD2CMessagesNotInAllowedRange, *ConnectionFromIPNotAllowed, *ConnectionToIPNotAllowed, *CustomAlertRule, *DenylistCustomAlertRule, +// - *DirectMethodInvokesNotInAllowedRange, *FailedLocalLoginsNotInAllowedRange, *FileUploadsNotInAllowedRange, *HTTPC2DMessagesNotInAllowedRange, +// - *HTTPC2DRejectedMessagesNotInAllowedRange, *HTTPD2CMessagesNotInAllowedRange, *ListCustomAlertRule, *LocalUserNotAllowed, +// - *MqttC2DMessagesNotInAllowedRange, *MqttC2DRejectedMessagesNotInAllowedRange, *MqttD2CMessagesNotInAllowedRange, *ProcessNotAllowed, +// - *QueuePurgesNotInAllowedRange, *ThresholdCustomAlertRule, *TimeWindowCustomAlertRule, *TwinUpdatesNotInAllowedRange, +// - *UnauthorizedOperationsNotInAllowedRange +type CustomAlertRuleClassification interface { + // GetCustomAlertRule returns the CustomAlertRule content of the underlying type. + GetCustomAlertRule() *CustomAlertRule +} + +// 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 +type EnvironmentDataClassification interface { + // GetEnvironmentData returns the EnvironmentData content of the underlying type. + GetEnvironmentData() *EnvironmentData +} + +// GcpOrganizationalDataClassification provides polymorphic access to related types. +// Call the interface's GetGcpOrganizationalData() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *GcpOrganizationalData, *GcpOrganizationalDataMember, *GcpOrganizationalDataOrganization +type GcpOrganizationalDataClassification interface { + // GetGcpOrganizationalData returns the GcpOrganizationalData content of the underlying type. + GetGcpOrganizationalData() *GcpOrganizationalData +} + +// ListCustomAlertRuleClassification provides polymorphic access to related types. +// Call the interface's GetListCustomAlertRule() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AllowlistCustomAlertRule, *ConnectionFromIPNotAllowed, *ConnectionToIPNotAllowed, *DenylistCustomAlertRule, *ListCustomAlertRule, +// - *LocalUserNotAllowed, *ProcessNotAllowed +type ListCustomAlertRuleClassification interface { + CustomAlertRuleClassification + // GetListCustomAlertRule returns the ListCustomAlertRule content of the underlying type. + GetListCustomAlertRule() *ListCustomAlertRule +} + +// ListCustomAlertRuleClassification provides polymorphic access to related types. +// Call the interface's GetListCustomAlertRule() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AllowlistCustomAlertRule, *ConnectionFromIPNotAllowed, *ConnectionToIPNotAllowed, *DenylistCustomAlertRule, *ListCustomAlertRule, +// - *LocalUserNotAllowed, *ProcessNotAllowed +type ListCustomAlertRuleClassification interface { + CustomAlertRuleClassification + // GetListCustomAlertRule returns the ListCustomAlertRule content of the underlying type. + GetListCustomAlertRule() *ListCustomAlertRule +} + +// OnPremiseResourceDetailsClassification provides polymorphic access to related types. +// Call the interface's GetOnPremiseResourceDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *OnPremiseResourceDetails, *OnPremiseSQLResourceDetails +type OnPremiseResourceDetailsClassification interface { + ResourceDetailsClassification + // GetOnPremiseResourceDetails returns the OnPremiseResourceDetails content of the underlying type. + GetOnPremiseResourceDetails() *OnPremiseResourceDetails +} + +// ResourceDetailsClassification provides polymorphic access to related types. +// Call the interface's GetResourceDetails() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureResourceDetails, *OnPremiseResourceDetails, *OnPremiseSQLResourceDetails, *ResourceDetails +type ResourceDetailsClassification interface { + // GetResourceDetails returns the ResourceDetails content of the underlying type. + GetResourceDetails() *ResourceDetails +} + +// ResourceIdentifierClassification provides polymorphic access to related types. +// Call the interface's GetResourceIdentifier() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureResourceIdentifier, *LogAnalyticsIdentifier, *ResourceIdentifier +type ResourceIdentifierClassification interface { + // GetResourceIdentifier returns the ResourceIdentifier content of the underlying type. + GetResourceIdentifier() *ResourceIdentifier +} + +// ServerVulnerabilityAssessmentsSettingClassification provides polymorphic access to related types. +// Call the interface's GetServerVulnerabilityAssessmentsSetting() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureServersSetting, *ServerVulnerabilityAssessmentsSetting +type ServerVulnerabilityAssessmentsSettingClassification interface { + // GetServerVulnerabilityAssessmentsSetting returns the ServerVulnerabilityAssessmentsSetting content of the underlying type. + GetServerVulnerabilityAssessmentsSetting() *ServerVulnerabilityAssessmentsSetting +} + +// SettingClassification provides polymorphic access to related types. +// Call the interface's GetSetting() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AlertSyncSettings, *DataExportSettings, *Setting +type SettingClassification interface { + // GetSetting returns the Setting content of the underlying type. + GetSetting() *Setting +} + +// ThresholdCustomAlertRuleClassification provides polymorphic access to related types. +// Call the interface's GetThresholdCustomAlertRule() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ActiveConnectionsNotInAllowedRange, *AmqpC2DMessagesNotInAllowedRange, *AmqpC2DRejectedMessagesNotInAllowedRange, *AmqpD2CMessagesNotInAllowedRange, +// - *DirectMethodInvokesNotInAllowedRange, *FailedLocalLoginsNotInAllowedRange, *FileUploadsNotInAllowedRange, *HTTPC2DMessagesNotInAllowedRange, +// - *HTTPC2DRejectedMessagesNotInAllowedRange, *HTTPD2CMessagesNotInAllowedRange, *MqttC2DMessagesNotInAllowedRange, *MqttC2DRejectedMessagesNotInAllowedRange, +// - *MqttD2CMessagesNotInAllowedRange, *QueuePurgesNotInAllowedRange, *ThresholdCustomAlertRule, *TimeWindowCustomAlertRule, +// - *TwinUpdatesNotInAllowedRange, *UnauthorizedOperationsNotInAllowedRange +type ThresholdCustomAlertRuleClassification interface { + CustomAlertRuleClassification + // GetThresholdCustomAlertRule returns the ThresholdCustomAlertRule content of the underlying type. + GetThresholdCustomAlertRule() *ThresholdCustomAlertRule +} + +// ThresholdCustomAlertRuleClassification provides polymorphic access to related types. +// Call the interface's GetThresholdCustomAlertRule() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ActiveConnectionsNotInAllowedRange, *AmqpC2DMessagesNotInAllowedRange, *AmqpC2DRejectedMessagesNotInAllowedRange, *AmqpD2CMessagesNotInAllowedRange, +// - *DirectMethodInvokesNotInAllowedRange, *FailedLocalLoginsNotInAllowedRange, *FileUploadsNotInAllowedRange, *HTTPC2DMessagesNotInAllowedRange, +// - *HTTPC2DRejectedMessagesNotInAllowedRange, *HTTPD2CMessagesNotInAllowedRange, *MqttC2DMessagesNotInAllowedRange, *MqttC2DRejectedMessagesNotInAllowedRange, +// - *MqttD2CMessagesNotInAllowedRange, *QueuePurgesNotInAllowedRange, *ThresholdCustomAlertRule, *TimeWindowCustomAlertRule, +// - *TwinUpdatesNotInAllowedRange, *UnauthorizedOperationsNotInAllowedRange +type ThresholdCustomAlertRuleClassification interface { + CustomAlertRuleClassification + // GetThresholdCustomAlertRule returns the ThresholdCustomAlertRule content of the underlying type. + GetThresholdCustomAlertRule() *ThresholdCustomAlertRule +} + +// TimeWindowCustomAlertRuleClassification provides polymorphic access to related types. +// Call the interface's GetTimeWindowCustomAlertRule() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ActiveConnectionsNotInAllowedRange, *AmqpC2DMessagesNotInAllowedRange, *AmqpC2DRejectedMessagesNotInAllowedRange, *AmqpD2CMessagesNotInAllowedRange, +// - *DirectMethodInvokesNotInAllowedRange, *FailedLocalLoginsNotInAllowedRange, *FileUploadsNotInAllowedRange, *HTTPC2DMessagesNotInAllowedRange, +// - *HTTPC2DRejectedMessagesNotInAllowedRange, *HTTPD2CMessagesNotInAllowedRange, *MqttC2DMessagesNotInAllowedRange, *MqttC2DRejectedMessagesNotInAllowedRange, +// - *MqttD2CMessagesNotInAllowedRange, *QueuePurgesNotInAllowedRange, *TimeWindowCustomAlertRule, *TwinUpdatesNotInAllowedRange, +// - *UnauthorizedOperationsNotInAllowedRange +type TimeWindowCustomAlertRuleClassification interface { + ThresholdCustomAlertRuleClassification + // GetTimeWindowCustomAlertRule returns the TimeWindowCustomAlertRule content of the underlying type. + GetTimeWindowCustomAlertRule() *TimeWindowCustomAlertRule +} diff --git a/sdk/resourcemanager/security/armsecurity/iotsecuritysolution_client.go b/sdk/resourcemanager/security/armsecurity/iotsecuritysolution_client.go index 0825a104a098..18c60d5ed4c1 100644 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolution_client.go +++ b/sdk/resourcemanager/security/armsecurity/iotsecuritysolution_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -54,18 +53,21 @@ func NewIotSecuritySolutionClient(subscriptionID string, credential azcore.Token // - options - IotSecuritySolutionClientCreateOrUpdateOptions contains the optional parameters for the IotSecuritySolutionClient.CreateOrUpdate // method. func (client *IotSecuritySolutionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, solutionName string, iotSecuritySolutionData IoTSecuritySolutionModel, options *IotSecuritySolutionClientCreateOrUpdateOptions) (IotSecuritySolutionClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, solutionName, iotSecuritySolutionData, options) if err != nil { return IotSecuritySolutionClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return IotSecuritySolutionClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return IotSecuritySolutionClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return IotSecuritySolutionClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -91,7 +93,10 @@ func (client *IotSecuritySolutionClient) createOrUpdateCreateRequest(ctx context reqQP.Set("api-version", "2019-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, iotSecuritySolutionData) + if err := runtime.MarshalAsJSON(req, iotSecuritySolutionData); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -112,16 +117,18 @@ func (client *IotSecuritySolutionClient) createOrUpdateHandleResponse(resp *http // - options - IotSecuritySolutionClientDeleteOptions contains the optional parameters for the IotSecuritySolutionClient.Delete // method. func (client *IotSecuritySolutionClient) Delete(ctx context.Context, resourceGroupName string, solutionName string, options *IotSecuritySolutionClientDeleteOptions) (IotSecuritySolutionClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, solutionName, options) if err != nil { return IotSecuritySolutionClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return IotSecuritySolutionClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return IotSecuritySolutionClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return IotSecuritySolutionClientDeleteResponse{}, err } return IotSecuritySolutionClientDeleteResponse{}, nil } @@ -160,18 +167,21 @@ func (client *IotSecuritySolutionClient) deleteCreateRequest(ctx context.Context // - solutionName - The name of the IoT Security solution. // - options - IotSecuritySolutionClientGetOptions contains the optional parameters for the IotSecuritySolutionClient.Get method. func (client *IotSecuritySolutionClient) Get(ctx context.Context, resourceGroupName string, solutionName string, options *IotSecuritySolutionClientGetOptions) (IotSecuritySolutionClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, solutionName, options) if err != nil { return IotSecuritySolutionClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return IotSecuritySolutionClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IotSecuritySolutionClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return IotSecuritySolutionClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -351,18 +361,21 @@ func (client *IotSecuritySolutionClient) listBySubscriptionHandleResponse(resp * // - options - IotSecuritySolutionClientUpdateOptions contains the optional parameters for the IotSecuritySolutionClient.Update // method. func (client *IotSecuritySolutionClient) Update(ctx context.Context, resourceGroupName string, solutionName string, updateIotSecuritySolutionData UpdateIotSecuritySolutionData, options *IotSecuritySolutionClientUpdateOptions) (IotSecuritySolutionClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, resourceGroupName, solutionName, updateIotSecuritySolutionData, options) if err != nil { return IotSecuritySolutionClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return IotSecuritySolutionClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IotSecuritySolutionClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return IotSecuritySolutionClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -388,7 +401,10 @@ func (client *IotSecuritySolutionClient) updateCreateRequest(ctx context.Context reqQP.Set("api-version", "2019-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, updateIotSecuritySolutionData) + if err := runtime.MarshalAsJSON(req, updateIotSecuritySolutionData); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. 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 02aeedddb409..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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsListByIotHub.json -func ExampleIotSecuritySolutionClient_NewListBySubscriptionPager_listIoTSecuritySolutionsByIoTHub() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIotSecuritySolutionClient().NewListBySubscriptionPager(&armsecurity.IotSecuritySolutionClientListBySubscriptionOptions{Filter: to.Ptr("properties.iotHubs/any(i eq \"/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub\")")}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IoTSecuritySolutionsList = armsecurity.IoTSecuritySolutionsList{ - // Value: []*armsecurity.IoTSecuritySolutionModel{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/IoTSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East Us"), - // Properties: &armsecurity.IoTSecuritySolutionProperties{ - // AutoDiscoveredResources: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735"), - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // DisabledDataSources: []*armsecurity.DataSource{ - // }, - // DisplayName: to.Ptr("Solution Default"), - // Export: []*armsecurity.ExportData{ - // to.Ptr(armsecurity.ExportDataRawEvents)}, - // IotHubs: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - // { - // Name: to.Ptr("Service Principal Not Used with ACR"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAcrauthentication), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Agent sending underutilized messages"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAgentSendsUnutilizedMessages), - // Status: to.Ptr(armsecurity.RecommendationConfigStatus("TurnedOn")), - // }, - // { - // Name: to.Ptr("Operating system (OS) baseline validation failure"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTBaseline), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Edge Hub memory can be optimized"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeHubMemOptimize), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("No Logging Configured for Edge Module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeLoggingOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Module Settings Inconsistent in SecurityGroup"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInconsistentModuleSettings), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Install the Azure Security of Things Agent"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInstallAgent), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Default IP Filter Policy should be Deny"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterDenyAll), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("IP Filter rule includes large IP range"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterPermissiveRule), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Open Ports On Device"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveFirewallPolicy), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the input chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveInputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the output chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveOutputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPrivilegedDockerOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Same Authentication Credentials used by multiple devices"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("TLS cipher suite upgrade"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTVulnerableTLSCipherSuite), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }}, - // Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - // UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - // UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - // Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - // QuerySubscriptions: []*string{ - // to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - // }, - // Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsList.json -func ExampleIotSecuritySolutionClient_NewListBySubscriptionPager_listIoTSecuritySolutionsBySubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIotSecuritySolutionClient().NewListBySubscriptionPager(&armsecurity.IotSecuritySolutionClientListBySubscriptionOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IoTSecuritySolutionsList = armsecurity.IoTSecuritySolutionsList{ - // Value: []*armsecurity.IoTSecuritySolutionModel{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/IoTSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East Us"), - // Properties: &armsecurity.IoTSecuritySolutionProperties{ - // AutoDiscoveredResources: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735"), - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // DisabledDataSources: []*armsecurity.DataSource{ - // }, - // DisplayName: to.Ptr("Solution Default"), - // Export: []*armsecurity.ExportData{ - // }, - // IotHubs: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - // { - // Name: to.Ptr("Service Principal Not Used with ACR"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAcrauthentication), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Agent sending underutilized messages"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAgentSendsUnutilizedMessages), - // Status: to.Ptr(armsecurity.RecommendationConfigStatus("TurnedOn")), - // }, - // { - // Name: to.Ptr("Operating system (OS) baseline validation failure"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTBaseline), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Edge Hub memory can be optimized"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeHubMemOptimize), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("No Logging Configured for Edge Module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeLoggingOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Module Settings Inconsistent in SecurityGroup"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInconsistentModuleSettings), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Install the Azure Security of Things Agent"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInstallAgent), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Default IP Filter Policy should be Deny"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterDenyAll), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("IP Filter rule includes large IP range"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterPermissiveRule), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Open Ports On Device"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveFirewallPolicy), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the input chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveInputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the output chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveOutputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPrivilegedDockerOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Same Authentication Credentials used by multiple devices"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("TLS cipher suite upgrade"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTVulnerableTLSCipherSuite), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }}, - // Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - // UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - // UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - // Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - // QuerySubscriptions: []*string{ - // to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - // }, - // Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }, - // { - // Name: to.Ptr("sec-solution"), - // Type: to.Ptr("Microsoft.Security/IoTSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SecondGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/sec-solution"), - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East Us"), - // Properties: &armsecurity.IoTSecuritySolutionProperties{ - // AutoDiscoveredResources: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735"), - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/IotHubSecond")}, - // DisabledDataSources: []*armsecurity.DataSource{ - // }, - // DisplayName: to.Ptr("Second Solution"), - // Export: []*armsecurity.ExportData{ - // to.Ptr(armsecurity.ExportDataRawEvents)}, - // IotHubs: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/IotHubSecond")}, - // RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - // { - // Name: to.Ptr("Service Principal Not Used with ACR"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAcrauthentication), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Agent sending underutilized messages"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAgentSendsUnutilizedMessages), - // Status: to.Ptr(armsecurity.RecommendationConfigStatus("TurnedOn")), - // }, - // { - // Name: to.Ptr("Operating system (OS) baseline validation failure"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTBaseline), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Edge Hub memory can be optimized"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeHubMemOptimize), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("No Logging Configured for Edge Module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeLoggingOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Module Settings Inconsistent in SecurityGroup"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInconsistentModuleSettings), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Install the Azure Security of Things Agent"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInstallAgent), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Default IP Filter Policy should be Deny"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterDenyAll), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("IP Filter rule includes large IP range"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterPermissiveRule), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Open Ports On Device"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveFirewallPolicy), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the input chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveInputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the output chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveOutputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPrivilegedDockerOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Same Authentication Credentials used by multiple devices"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("TLS cipher suite upgrade"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTVulnerableTLSCipherSuite), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }}, - // Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - // UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - // UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - // Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - // QuerySubscriptions: []*string{ - // to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - // }, - // Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsListByRg.json -func ExampleIotSecuritySolutionClient_NewListByResourceGroupPager_listIoTSecuritySolutionsByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIotSecuritySolutionClient().NewListByResourceGroupPager("MyGroup", &armsecurity.IotSecuritySolutionClientListByResourceGroupOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IoTSecuritySolutionsList = armsecurity.IoTSecuritySolutionsList{ - // Value: []*armsecurity.IoTSecuritySolutionModel{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/IoTSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East Us"), - // Properties: &armsecurity.IoTSecuritySolutionProperties{ - // AutoDiscoveredResources: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735"), - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // DisabledDataSources: []*armsecurity.DataSource{ - // }, - // DisplayName: to.Ptr("Solution Default"), - // Export: []*armsecurity.ExportData{ - // }, - // IotHubs: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - // { - // Name: to.Ptr("Service Principal Not Used with ACR"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAcrauthentication), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Agent sending underutilized messages"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAgentSendsUnutilizedMessages), - // Status: to.Ptr(armsecurity.RecommendationConfigStatus("TurnedOn")), - // }, - // { - // Name: to.Ptr("Operating system (OS) baseline validation failure"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTBaseline), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Edge Hub memory can be optimized"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeHubMemOptimize), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("No Logging Configured for Edge Module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeLoggingOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Module Settings Inconsistent in SecurityGroup"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInconsistentModuleSettings), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Install the Azure Security of Things Agent"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInstallAgent), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Default IP Filter Policy should be Deny"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterDenyAll), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("IP Filter rule includes large IP range"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterPermissiveRule), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Open Ports On Device"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveFirewallPolicy), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the input chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveInputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the output chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveOutputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPrivilegedDockerOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Same Authentication Credentials used by multiple devices"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("TLS cipher suite upgrade"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTVulnerableTLSCipherSuite), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }}, - // Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - // UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - // UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - // Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - // QuerySubscriptions: []*string{ - // to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - // }, - // Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsListByIotHubAndRg.json -func ExampleIotSecuritySolutionClient_NewListByResourceGroupPager_listIoTSecuritySolutionsByResourceGroupAndIoTHub() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewIotSecuritySolutionClient().NewListByResourceGroupPager("MyRg", &armsecurity.IotSecuritySolutionClientListByResourceGroupOptions{Filter: to.Ptr("properties.iotHubs/any(i eq \"/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub\")")}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.IoTSecuritySolutionsList = armsecurity.IoTSecuritySolutionsList{ - // Value: []*armsecurity.IoTSecuritySolutionModel{ - // { - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/IoTSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyRg/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East Us"), - // Properties: &armsecurity.IoTSecuritySolutionProperties{ - // AutoDiscoveredResources: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735"), - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // DisabledDataSources: []*armsecurity.DataSource{ - // }, - // DisplayName: to.Ptr("Solution Default"), - // Export: []*armsecurity.ExportData{ - // to.Ptr(armsecurity.ExportDataRawEvents)}, - // IotHubs: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - // { - // Name: to.Ptr("Service Principal Not Used with ACR"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAcrauthentication), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Agent sending underutilized messages"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAgentSendsUnutilizedMessages), - // Status: to.Ptr(armsecurity.RecommendationConfigStatus("TurnedOn")), - // }, - // { - // Name: to.Ptr("Operating system (OS) baseline validation failure"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTBaseline), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Edge Hub memory can be optimized"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeHubMemOptimize), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("No Logging Configured for Edge Module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeLoggingOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Module Settings Inconsistent in SecurityGroup"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInconsistentModuleSettings), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Install the Azure Security of Things Agent"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInstallAgent), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Default IP Filter Policy should be Deny"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterDenyAll), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("IP Filter rule includes large IP range"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterPermissiveRule), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Open Ports On Device"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveFirewallPolicy), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the input chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveInputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the output chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveOutputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPrivilegedDockerOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Same Authentication Credentials used by multiple devices"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("TLS cipher suite upgrade"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTVulnerableTLSCipherSuite), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }}, - // Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - // UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - // UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - // Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - // QuerySubscriptions: []*string{ - // to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - // }, - // Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolution.json -func ExampleIotSecuritySolutionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIotSecuritySolutionClient().Get(ctx, "MyGroup", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IoTSecuritySolutionModel = armsecurity.IoTSecuritySolutionModel{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/IoTSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East Us"), - // Properties: &armsecurity.IoTSecuritySolutionProperties{ - // AutoDiscoveredResources: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735"), - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // DisabledDataSources: []*armsecurity.DataSource{ - // }, - // DisplayName: to.Ptr("Solution Default"), - // Export: []*armsecurity.ExportData{ - // }, - // IotHubs: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - // { - // Name: to.Ptr("Service Principal Not Used with ACR"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAcrauthentication), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Agent sending underutilized messages"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAgentSendsUnutilizedMessages), - // Status: to.Ptr(armsecurity.RecommendationConfigStatus("TurnedOn")), - // }, - // { - // Name: to.Ptr("Operating system (OS) baseline validation failure"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTBaseline), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Edge Hub memory can be optimized"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeHubMemOptimize), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("No Logging Configured for Edge Module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeLoggingOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Module Settings Inconsistent in SecurityGroup"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInconsistentModuleSettings), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Install the Azure Security of Things Agent"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInstallAgent), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Default IP Filter Policy should be Deny"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterDenyAll), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("IP Filter rule includes large IP range"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterPermissiveRule), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Open Ports On Device"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveFirewallPolicy), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the input chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveInputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the output chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveOutputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPrivilegedDockerOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Same Authentication Credentials used by multiple devices"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("TLS cipher suite upgrade"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTVulnerableTLSCipherSuite), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }}, - // Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - // UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - // UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - // Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - // QuerySubscriptions: []*string{ - // to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - // }, - // Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/CreateIoTSecuritySolution.json -func ExampleIotSecuritySolutionClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIotSecuritySolutionClient().CreateOrUpdate(ctx, "MyGroup", "default", armsecurity.IoTSecuritySolutionModel{ - Tags: map[string]*string{}, - Location: to.Ptr("East Us"), - Properties: &armsecurity.IoTSecuritySolutionProperties{ - DisabledDataSources: []*armsecurity.DataSource{}, - DisplayName: to.Ptr("Solution Default"), - Export: []*armsecurity.ExportData{}, - IotHubs: []*string{ - to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - { - RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - }, - { - RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - }}, - Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - QuerySubscriptions: []*string{ - to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - }, - Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IoTSecuritySolutionModel = armsecurity.IoTSecuritySolutionModel{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/IoTSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/Locations/eastus/IoTSecuritySolutions/default"), - // Tags: map[string]*string{ - // }, - // Location: to.Ptr("East Us"), - // Properties: &armsecurity.IoTSecuritySolutionProperties{ - // AutoDiscoveredResources: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735"), - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // DisabledDataSources: []*armsecurity.DataSource{ - // }, - // DisplayName: to.Ptr("Solution Default"), - // Export: []*armsecurity.ExportData{ - // }, - // IotHubs: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - // { - // Name: to.Ptr("Service Principal Not Used with ACR"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAcrauthentication), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Agent sending underutilized messages"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAgentSendsUnutilizedMessages), - // Status: to.Ptr(armsecurity.RecommendationConfigStatus("TurnedOn")), - // }, - // { - // Name: to.Ptr("Operating system (OS) baseline validation failure"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTBaseline), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Edge Hub memory can be optimized"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeHubMemOptimize), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("No Logging Configured for Edge Module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeLoggingOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Module Settings Inconsistent in SecurityGroup"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInconsistentModuleSettings), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Install the Azure Security of Things Agent"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInstallAgent), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Default IP Filter Policy should be Deny"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterDenyAll), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("IP Filter rule includes large IP range"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterPermissiveRule), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Open Ports On Device"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveFirewallPolicy), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the input chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveInputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the output chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveOutputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPrivilegedDockerOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Same Authentication Credentials used by multiple devices"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("TLS cipher suite upgrade"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTVulnerableTLSCipherSuite), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }}, - // Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - // UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - // UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - // Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - // QuerySubscriptions: []*string{ - // to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - // }, - // Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/UpdateIoTSecuritySolution.json -func ExampleIotSecuritySolutionClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIotSecuritySolutionClient().Update(ctx, "myRg", "default", armsecurity.UpdateIotSecuritySolutionData{ - Tags: map[string]*string{ - "foo": to.Ptr("bar"), - }, - Properties: &armsecurity.UpdateIoTSecuritySolutionProperties{ - RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - { - RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - }, - { - RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - }}, - UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"v2\""), - QuerySubscriptions: []*string{ - to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IoTSecuritySolutionModel = armsecurity.IoTSecuritySolutionModel{ - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/IoTSecuritySolutions"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/Locations/eastus/IoTSecuritySolutions/default"), - // Tags: map[string]*string{ - // "foo": to.Ptr("bar"), - // }, - // Location: to.Ptr("East Us"), - // Properties: &armsecurity.IoTSecuritySolutionProperties{ - // AutoDiscoveredResources: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735"), - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // DisabledDataSources: []*armsecurity.DataSource{ - // }, - // DisplayName: to.Ptr("Solution Default"), - // Export: []*armsecurity.ExportData{ - // to.Ptr(armsecurity.ExportDataRawEvents)}, - // IotHubs: []*string{ - // to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - // RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - // { - // Name: to.Ptr("Service Principal Not Used with ACR"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAcrauthentication), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Agent sending underutilized messages"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTAgentSendsUnutilizedMessages), - // Status: to.Ptr(armsecurity.RecommendationConfigStatus("TurnedOn")), - // }, - // { - // Name: to.Ptr("Operating system (OS) baseline validation failure"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTBaseline), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Edge Hub memory can be optimized"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeHubMemOptimize), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("No Logging Configured for Edge Module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTEdgeLoggingOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Module Settings Inconsistent in SecurityGroup"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInconsistentModuleSettings), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Install the Azure Security of Things Agent"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTInstallAgent), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Default IP Filter Policy should be Deny"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterDenyAll), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("IP Filter rule includes large IP range"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTIpfilterPermissiveRule), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Open Ports On Device"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("Permissive firewall policy in one of the chains was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveFirewallPolicy), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the input chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveInputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Permissive firewall rule in the output chain was found"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPermissiveOutputFirewallRules), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTPrivilegedDockerOptions), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }, - // { - // Name: to.Ptr("Same Authentication Credentials used by multiple devices"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - // }, - // { - // Name: to.Ptr("TLS cipher suite upgrade"), - // RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTVulnerableTLSCipherSuite), - // Status: to.Ptr(armsecurity.RecommendationConfigStatusEnabled), - // }}, - // Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - // UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - // UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - // Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"v2\""), - // QuerySubscriptions: []*string{ - // to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - // }, - // Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - // }, - // SystemData: &armsecurity.SystemData{ - // CreatedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // CreatedBy: to.Ptr("string"), - // CreatedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // LastModifiedAt: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-27T21:53:29.0928001Z"); return t}()), - // LastModifiedBy: to.Ptr("string"), - // LastModifiedByType: to.Ptr(armsecurity.CreatedByTypeUser), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/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 81628695e672..f0b3740b97a6 100644 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionanalytics_client.go +++ b/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionanalytics_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -53,18 +52,21 @@ func NewIotSecuritySolutionAnalyticsClient(subscriptionID string, credential azc // - options - IotSecuritySolutionAnalyticsClientGetOptions contains the optional parameters for the IotSecuritySolutionAnalyticsClient.Get // method. func (client *IotSecuritySolutionAnalyticsClient) Get(ctx context.Context, resourceGroupName string, solutionName string, options *IotSecuritySolutionAnalyticsClientGetOptions) (IotSecuritySolutionAnalyticsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, solutionName, options) if err != nil { return IotSecuritySolutionAnalyticsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return IotSecuritySolutionAnalyticsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IotSecuritySolutionAnalyticsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return IotSecuritySolutionAnalyticsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -111,18 +113,21 @@ func (client *IotSecuritySolutionAnalyticsClient) getHandleResponse(resp *http.R // - options - IotSecuritySolutionAnalyticsClientListOptions contains the optional parameters for the IotSecuritySolutionAnalyticsClient.List // method. func (client *IotSecuritySolutionAnalyticsClient) List(ctx context.Context, resourceGroupName string, solutionName string, options *IotSecuritySolutionAnalyticsClientListOptions) (IotSecuritySolutionAnalyticsClientListResponse, error) { + var err error req, err := client.listCreateRequest(ctx, resourceGroupName, solutionName, options) if err != nil { return IotSecuritySolutionAnalyticsClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return IotSecuritySolutionAnalyticsClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IotSecuritySolutionAnalyticsClientListResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return IotSecuritySolutionAnalyticsClientListResponse{}, err } - return client.listHandleResponse(resp) + resp, err := client.listHandleResponse(httpResp) + return resp, err } // listCreateRequest creates the List request. 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 fb4d809a0727..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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAnalyticsList.json -func ExampleIotSecuritySolutionAnalyticsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIotSecuritySolutionAnalyticsClient().List(ctx, "MyGroup", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IoTSecuritySolutionAnalyticsModelList = armsecurity.IoTSecuritySolutionAnalyticsModelList{ - // Value: []*armsecurity.IoTSecuritySolutionAnalyticsModel{ - // { - // Name: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Type: to.Ptr("Microsoft.Security/iotSecuritySolutions/analyticsModels"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Properties: &armsecurity.IoTSecuritySolutionAnalyticsModelProperties{ - // DevicesMetrics: []*armsecurity.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem{ - // { - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-02-01T00:00:00Z"); return t}()), - // DevicesMetrics: &armsecurity.IoTSeverityMetrics{ - // High: to.Ptr[int64](3), - // Low: to.Ptr[int64](70), - // Medium: to.Ptr[int64](15), - // }, - // }, - // { - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-02-02T00:00:00Z"); return t}()), - // DevicesMetrics: &armsecurity.IoTSeverityMetrics{ - // High: to.Ptr[int64](3), - // Low: to.Ptr[int64](65), - // Medium: to.Ptr[int64](45), - // }, - // }}, - // Metrics: &armsecurity.IoTSeverityMetrics{ - // High: to.Ptr[int64](5), - // Low: to.Ptr[int64](102), - // Medium: to.Ptr[int64](200), - // }, - // MostPrevalentDeviceAlerts: []*armsecurity.IoTSecurityDeviceAlert{ - // { - // AlertDisplayName: to.Ptr("Custom Alert - number of device to cloud messages in AMQP protocol is not in the allowed range"), - // AlertsCount: to.Ptr[int64](200), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // }, - // { - // AlertDisplayName: to.Ptr("Custom Alert - execution of a process that is not allowed"), - // AlertsCount: to.Ptr[int64](170), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityMedium), - // }, - // { - // AlertDisplayName: to.Ptr("Successful Bruteforce"), - // AlertsCount: to.Ptr[int64](150), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // }}, - // MostPrevalentDeviceRecommendations: []*armsecurity.IoTSecurityDeviceRecommendation{ - // { - // DevicesCount: to.Ptr[int64](200), - // RecommendationDisplayName: to.Ptr("Install the Azure Security of Things Agent"), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // }, - // { - // DevicesCount: to.Ptr[int64](170), - // RecommendationDisplayName: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // }, - // { - // DevicesCount: to.Ptr[int64](150), - // RecommendationDisplayName: to.Ptr("Same Authentication Credentials used by multiple devices"), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityMedium), - // }}, - // TopAlertedDevices: []*armsecurity.IoTSecurityAlertedDevice{ - // { - // AlertsCount: to.Ptr[int64](200), - // DeviceID: to.Ptr("id1"), - // }, - // { - // AlertsCount: to.Ptr[int64](170), - // DeviceID: to.Ptr("id2"), - // }, - // { - // AlertsCount: to.Ptr[int64](150), - // DeviceID: to.Ptr("id3"), - // }}, - // UnhealthyDeviceCount: to.Ptr[int64](1200), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAnalytics.json -func ExampleIotSecuritySolutionAnalyticsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewIotSecuritySolutionAnalyticsClient().Get(ctx, "MyGroup", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.IoTSecuritySolutionAnalyticsModel = armsecurity.IoTSecuritySolutionAnalyticsModel{ - // Name: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Type: to.Ptr("Microsoft.Security/iotSecuritySolutions/analyticsModels"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/MyGroup/providers/Microsoft.Security/IoTSecuritySolutions/Locations/eastus/default"), - // Properties: &armsecurity.IoTSecuritySolutionAnalyticsModelProperties{ - // DevicesMetrics: []*armsecurity.IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem{ - // { - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-02-01T00:00:00Z"); return t}()), - // DevicesMetrics: &armsecurity.IoTSeverityMetrics{ - // High: to.Ptr[int64](3), - // Low: to.Ptr[int64](70), - // Medium: to.Ptr[int64](15), - // }, - // }, - // { - // Date: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-02-02T00:00:00Z"); return t}()), - // DevicesMetrics: &armsecurity.IoTSeverityMetrics{ - // High: to.Ptr[int64](3), - // Low: to.Ptr[int64](65), - // Medium: to.Ptr[int64](45), - // }, - // }}, - // Metrics: &armsecurity.IoTSeverityMetrics{ - // High: to.Ptr[int64](5), - // Low: to.Ptr[int64](102), - // Medium: to.Ptr[int64](200), - // }, - // MostPrevalentDeviceAlerts: []*armsecurity.IoTSecurityDeviceAlert{ - // { - // AlertDisplayName: to.Ptr("Custom Alert - number of device to cloud messages in AMQP protocol is not in the allowed range"), - // AlertsCount: to.Ptr[int64](200), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // }, - // { - // AlertDisplayName: to.Ptr("Custom Alert - execution of a process that is not allowed"), - // AlertsCount: to.Ptr[int64](170), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityMedium), - // }, - // { - // AlertDisplayName: to.Ptr("Successful Bruteforce"), - // AlertsCount: to.Ptr[int64](150), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // }}, - // MostPrevalentDeviceRecommendations: []*armsecurity.IoTSecurityDeviceRecommendation{ - // { - // DevicesCount: to.Ptr[int64](200), - // RecommendationDisplayName: to.Ptr("Install the Azure Security of Things Agent"), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // }, - // { - // DevicesCount: to.Ptr[int64](170), - // RecommendationDisplayName: to.Ptr("High level permissions configured in Edge model twin for Edge module"), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityLow), - // }, - // { - // DevicesCount: to.Ptr[int64](150), - // RecommendationDisplayName: to.Ptr("Same Authentication Credentials used by multiple devices"), - // ReportedSeverity: to.Ptr(armsecurity.ReportedSeverityMedium), - // }}, - // TopAlertedDevices: []*armsecurity.IoTSecurityAlertedDevice{ - // { - // AlertsCount: to.Ptr[int64](200), - // DeviceID: to.Ptr("id1"), - // }, - // { - // AlertsCount: to.Ptr[int64](170), - // DeviceID: to.Ptr("id2"), - // }, - // { - // AlertsCount: to.Ptr[int64](150), - // DeviceID: to.Ptr("id3"), - // }}, - // UnhealthyDeviceCount: to.Ptr[int64](1200), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsaggregatedalert_client.go b/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsaggregatedalert_client.go index 1e8496b9278f..1e21a98a3c78 100644 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsaggregatedalert_client.go +++ b/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsaggregatedalert_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -55,16 +54,18 @@ func NewIotSecuritySolutionsAnalyticsAggregatedAlertClient(subscriptionID string // - options - IotSecuritySolutionsAnalyticsAggregatedAlertClientDismissOptions contains the optional parameters for the IotSecuritySolutionsAnalyticsAggregatedAlertClient.Dismiss // method. func (client *IotSecuritySolutionsAnalyticsAggregatedAlertClient) Dismiss(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string, options *IotSecuritySolutionsAnalyticsAggregatedAlertClientDismissOptions) (IotSecuritySolutionsAnalyticsAggregatedAlertClientDismissResponse, error) { + var err error req, err := client.dismissCreateRequest(ctx, resourceGroupName, solutionName, aggregatedAlertName, options) if err != nil { return IotSecuritySolutionsAnalyticsAggregatedAlertClientDismissResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return IotSecuritySolutionsAnalyticsAggregatedAlertClientDismissResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IotSecuritySolutionsAnalyticsAggregatedAlertClientDismissResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return IotSecuritySolutionsAnalyticsAggregatedAlertClientDismissResponse{}, err } return IotSecuritySolutionsAnalyticsAggregatedAlertClientDismissResponse{}, nil } @@ -110,18 +111,21 @@ func (client *IotSecuritySolutionsAnalyticsAggregatedAlertClient) dismissCreateR // - options - IotSecuritySolutionsAnalyticsAggregatedAlertClientGetOptions contains the optional parameters for the IotSecuritySolutionsAnalyticsAggregatedAlertClient.Get // method. func (client *IotSecuritySolutionsAnalyticsAggregatedAlertClient) Get(ctx context.Context, resourceGroupName string, solutionName string, aggregatedAlertName string, options *IotSecuritySolutionsAnalyticsAggregatedAlertClientGetOptions) (IotSecuritySolutionsAnalyticsAggregatedAlertClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, solutionName, aggregatedAlertName, options) if err != nil { return IotSecuritySolutionsAnalyticsAggregatedAlertClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return IotSecuritySolutionsAnalyticsAggregatedAlertClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IotSecuritySolutionsAnalyticsAggregatedAlertClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return IotSecuritySolutionsAnalyticsAggregatedAlertClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 debc2c0b283c..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 ee38bb28470e..1fd3641598bb 100644 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsrecommendation_client.go +++ b/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsrecommendation_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -56,18 +55,21 @@ func NewIotSecuritySolutionsAnalyticsRecommendationClient(subscriptionID string, // - options - IotSecuritySolutionsAnalyticsRecommendationClientGetOptions contains the optional parameters for the IotSecuritySolutionsAnalyticsRecommendationClient.Get // method. func (client *IotSecuritySolutionsAnalyticsRecommendationClient) Get(ctx context.Context, resourceGroupName string, solutionName string, aggregatedRecommendationName string, options *IotSecuritySolutionsAnalyticsRecommendationClientGetOptions) (IotSecuritySolutionsAnalyticsRecommendationClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, solutionName, aggregatedRecommendationName, options) if err != nil { return IotSecuritySolutionsAnalyticsRecommendationClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return IotSecuritySolutionsAnalyticsRecommendationClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return IotSecuritySolutionsAnalyticsRecommendationClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return IotSecuritySolutionsAnalyticsRecommendationClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 02a80b667565..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 5576ad82089d..6001e25c7ba1 100644 --- a/sdk/resourcemanager/security/armsecurity/jitnetworkaccesspolicies_client.go +++ b/sdk/resourcemanager/security/armsecurity/jitnetworkaccesspolicies_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -54,18 +53,21 @@ func NewJitNetworkAccessPoliciesClient(subscriptionID string, credential azcore. // - options - JitNetworkAccessPoliciesClientCreateOrUpdateOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.CreateOrUpdate // method. func (client *JitNetworkAccessPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicy, options *JitNetworkAccessPoliciesClientCreateOrUpdateOptions) (JitNetworkAccessPoliciesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body, options) if err != nil { return JitNetworkAccessPoliciesClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JitNetworkAccessPoliciesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return JitNetworkAccessPoliciesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return JitNetworkAccessPoliciesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -95,7 +97,10 @@ func (client *JitNetworkAccessPoliciesClient) createOrUpdateCreateRequest(ctx co reqQP.Set("api-version", "2020-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -117,16 +122,18 @@ func (client *JitNetworkAccessPoliciesClient) createOrUpdateHandleResponse(resp // - options - JitNetworkAccessPoliciesClientDeleteOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.Delete // method. func (client *JitNetworkAccessPoliciesClient) Delete(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, options *JitNetworkAccessPoliciesClientDeleteOptions) (JitNetworkAccessPoliciesClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, ascLocation, jitNetworkAccessPolicyName, options) if err != nil { return JitNetworkAccessPoliciesClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JitNetworkAccessPoliciesClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return JitNetworkAccessPoliciesClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return JitNetworkAccessPoliciesClientDeleteResponse{}, err } return JitNetworkAccessPoliciesClientDeleteResponse{}, nil } @@ -171,18 +178,21 @@ func (client *JitNetworkAccessPoliciesClient) deleteCreateRequest(ctx context.Co // - options - JitNetworkAccessPoliciesClientGetOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.Get // method. func (client *JitNetworkAccessPoliciesClient) Get(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, options *JitNetworkAccessPoliciesClientGetOptions) (JitNetworkAccessPoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, ascLocation, jitNetworkAccessPolicyName, options) if err != nil { return JitNetworkAccessPoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JitNetworkAccessPoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return JitNetworkAccessPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return JitNetworkAccessPoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -234,18 +244,21 @@ func (client *JitNetworkAccessPoliciesClient) getHandleResponse(resp *http.Respo // - options - JitNetworkAccessPoliciesClientInitiateOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.Initiate // method. func (client *JitNetworkAccessPoliciesClient) Initiate(ctx context.Context, resourceGroupName string, ascLocation string, jitNetworkAccessPolicyName string, body JitNetworkAccessPolicyInitiateRequest, options *JitNetworkAccessPoliciesClientInitiateOptions) (JitNetworkAccessPoliciesClientInitiateResponse, error) { + var err error req, err := client.initiateCreateRequest(ctx, resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body, options) if err != nil { return JitNetworkAccessPoliciesClientInitiateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JitNetworkAccessPoliciesClientInitiateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return JitNetworkAccessPoliciesClientInitiateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return JitNetworkAccessPoliciesClientInitiateResponse{}, err } - return client.initiateHandleResponse(resp) + resp, err := client.initiateHandleResponse(httpResp) + return resp, err } // initiateCreateRequest creates the Initiate request. @@ -276,7 +289,10 @@ func (client *JitNetworkAccessPoliciesClient) initiateCreateRequest(ctx context. reqQP.Set("api-version", "2020-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, body) + if err := runtime.MarshalAsJSON(req, body); err != nil { + return nil, err + } + return req, nil } // initiateHandleResponse handles the Initiate response. 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 0e6c8b3951a7..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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesSubscription_example.json -func ExampleJitNetworkAccessPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJitNetworkAccessPoliciesClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JitNetworkAccessPoliciesList = armsecurity.JitNetworkAccessPoliciesList{ - // Value: []*armsecurity.JitNetworkAccessPolicy{ - // { - // Kind: to.Ptr("Basic"), - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/locations/jitNetworkAccessPolicies"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/default"), - // Properties: &armsecurity.JitNetworkAccessPolicyProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // Requests: []*armsecurity.JitNetworkAccessRequest{ - // { - // Justification: to.Ptr("testing a new version of the product"), - // Requestor: to.Ptr("barbara@contoso.com"), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T08:06:45.5691611Z"); return t}()), - // VirtualMachines: []*armsecurity.JitNetworkAccessRequestVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessRequestPort{ - // { - // AllowedSourceAddressPrefix: to.Ptr("192.127.0.2"), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T09:06:45.5691611Z"); return t}()), - // Number: to.Ptr[int32](3389), - // Status: to.Ptr(armsecurity.StatusInitiated), - // StatusReason: to.Ptr(armsecurity.StatusReasonUserRequested), - // }}, - // }}, - // }}, - // VirtualMachines: []*armsecurity.JitNetworkAccessPolicyVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessPortRule{ - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](22), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }, - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](3389), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }}, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesSubscriptionLocation_example.json -func ExampleJitNetworkAccessPoliciesClient_NewListByRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJitNetworkAccessPoliciesClient().NewListByRegionPager("westeurope", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JitNetworkAccessPoliciesList = armsecurity.JitNetworkAccessPoliciesList{ - // Value: []*armsecurity.JitNetworkAccessPolicy{ - // { - // Kind: to.Ptr("Basic"), - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/locations/jitNetworkAccessPolicies"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/default"), - // Properties: &armsecurity.JitNetworkAccessPolicyProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // Requests: []*armsecurity.JitNetworkAccessRequest{ - // { - // Justification: to.Ptr("testing a new version of the product"), - // Requestor: to.Ptr("barbara@contoso.com"), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T08:06:45.5691611Z"); return t}()), - // VirtualMachines: []*armsecurity.JitNetworkAccessRequestVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessRequestPort{ - // { - // AllowedSourceAddressPrefix: to.Ptr("192.127.0.2"), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T09:06:45.5691611Z"); return t}()), - // Number: to.Ptr[int32](3389), - // Status: to.Ptr(armsecurity.StatusInitiated), - // StatusReason: to.Ptr(armsecurity.StatusReasonUserRequested), - // }}, - // }}, - // }}, - // VirtualMachines: []*armsecurity.JitNetworkAccessPolicyVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessPortRule{ - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](22), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }, - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](3389), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }}, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesResourceGroup_example.json -func ExampleJitNetworkAccessPoliciesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJitNetworkAccessPoliciesClient().NewListByResourceGroupPager("myRg1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JitNetworkAccessPoliciesList = armsecurity.JitNetworkAccessPoliciesList{ - // Value: []*armsecurity.JitNetworkAccessPolicy{ - // { - // Kind: to.Ptr("Basic"), - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/locations/jitNetworkAccessPolicies"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/default"), - // Properties: &armsecurity.JitNetworkAccessPolicyProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // Requests: []*armsecurity.JitNetworkAccessRequest{ - // { - // Justification: to.Ptr("testing a new version of the product"), - // Requestor: to.Ptr("barbara@contoso.com"), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T08:06:45.5691611Z"); return t}()), - // VirtualMachines: []*armsecurity.JitNetworkAccessRequestVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessRequestPort{ - // { - // AllowedSourceAddressPrefix: to.Ptr("192.127.0.2"), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T09:06:45.5691611Z"); return t}()), - // Number: to.Ptr[int32](3389), - // Status: to.Ptr(armsecurity.StatusInitiated), - // StatusReason: to.Ptr(armsecurity.StatusReasonUserRequested), - // }}, - // }}, - // }}, - // VirtualMachines: []*armsecurity.JitNetworkAccessPolicyVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessPortRule{ - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](22), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }, - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](3389), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }}, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesResourceGroupLocation_example.json -func ExampleJitNetworkAccessPoliciesClient_NewListByResourceGroupAndRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewJitNetworkAccessPoliciesClient().NewListByResourceGroupAndRegionPager("myRg1", "westeurope", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JitNetworkAccessPoliciesList = armsecurity.JitNetworkAccessPoliciesList{ - // Value: []*armsecurity.JitNetworkAccessPolicy{ - // { - // Kind: to.Ptr("Basic"), - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/locations/jitNetworkAccessPolicies"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/default"), - // Properties: &armsecurity.JitNetworkAccessPolicyProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // Requests: []*armsecurity.JitNetworkAccessRequest{ - // { - // Justification: to.Ptr("testing a new version of the product"), - // Requestor: to.Ptr("barbara@contoso.com"), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T08:06:45.5691611Z"); return t}()), - // VirtualMachines: []*armsecurity.JitNetworkAccessRequestVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessRequestPort{ - // { - // AllowedSourceAddressPrefix: to.Ptr("192.127.0.2"), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T09:06:45.5691611Z"); return t}()), - // Number: to.Ptr[int32](3389), - // Status: to.Ptr(armsecurity.StatusInitiated), - // StatusReason: to.Ptr(armsecurity.StatusReasonUserRequested), - // }}, - // }}, - // }}, - // VirtualMachines: []*armsecurity.JitNetworkAccessPolicyVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessPortRule{ - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](22), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }, - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](3389), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }}, - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPolicy_example.json -func ExampleJitNetworkAccessPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJitNetworkAccessPoliciesClient().Get(ctx, "myRg1", "westeurope", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JitNetworkAccessPolicy = armsecurity.JitNetworkAccessPolicy{ - // Kind: to.Ptr("Basic"), - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/locations/jitNetworkAccessPolicies"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/default"), - // Properties: &armsecurity.JitNetworkAccessPolicyProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // Requests: []*armsecurity.JitNetworkAccessRequest{ - // { - // Justification: to.Ptr("testing a new version of the product"), - // Requestor: to.Ptr("barbara@contoso.com"), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T08:06:45.5691611Z"); return t}()), - // VirtualMachines: []*armsecurity.JitNetworkAccessRequestVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessRequestPort{ - // { - // AllowedSourceAddressPrefix: to.Ptr("192.127.0.2"), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T09:06:45.5691611Z"); return t}()), - // Number: to.Ptr[int32](3389), - // Status: to.Ptr(armsecurity.StatusInitiated), - // StatusReason: to.Ptr(armsecurity.StatusReasonUserRequested), - // }}, - // }}, - // }}, - // VirtualMachines: []*armsecurity.JitNetworkAccessPolicyVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessPortRule{ - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](22), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }, - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](3389), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/CreateJitNetworkAccessPolicy_example.json -func ExampleJitNetworkAccessPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJitNetworkAccessPoliciesClient().CreateOrUpdate(ctx, "myRg1", "westeurope", "default", armsecurity.JitNetworkAccessPolicy{ - Kind: to.Ptr("Basic"), - Location: to.Ptr("westeurope"), - Name: to.Ptr("default"), - Type: to.Ptr("Microsoft.Security/locations/jitNetworkAccessPolicies"), - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/default"), - Properties: &armsecurity.JitNetworkAccessPolicyProperties{ - ProvisioningState: to.Ptr("Succeeded"), - Requests: []*armsecurity.JitNetworkAccessRequest{ - { - Requestor: to.Ptr("barbara@contoso.com"), - StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T08:06:45.5691611Z"); return t }()), - VirtualMachines: []*armsecurity.JitNetworkAccessRequestVirtualMachine{ - { - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - Ports: []*armsecurity.JitNetworkAccessRequestPort{ - { - AllowedSourceAddressPrefix: to.Ptr("192.127.0.2"), - EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T09:06:45.5691611Z"); return t }()), - Number: to.Ptr[int32](3389), - Status: to.Ptr(armsecurity.StatusInitiated), - StatusReason: to.Ptr(armsecurity.StatusReasonUserRequested), - }}, - }}, - }}, - VirtualMachines: []*armsecurity.JitNetworkAccessPolicyVirtualMachine{ - { - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - Ports: []*armsecurity.JitNetworkAccessPortRule{ - { - AllowedSourceAddressPrefix: to.Ptr("*"), - MaxRequestAccessDuration: to.Ptr("PT3H"), - Number: to.Ptr[int32](22), - Protocol: to.Ptr(armsecurity.ProtocolAll), - }, - { - AllowedSourceAddressPrefix: to.Ptr("*"), - MaxRequestAccessDuration: to.Ptr("PT3H"), - Number: to.Ptr[int32](3389), - Protocol: to.Ptr(armsecurity.ProtocolAll), - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JitNetworkAccessPolicy = armsecurity.JitNetworkAccessPolicy{ - // Kind: to.Ptr("Basic"), - // Location: to.Ptr("westeurope"), - // Name: to.Ptr("default"), - // Type: to.Ptr("Microsoft.Security/locations/jitNetworkAccessPolicies"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/default"), - // Properties: &armsecurity.JitNetworkAccessPolicyProperties{ - // ProvisioningState: to.Ptr("Succeeded"), - // Requests: []*armsecurity.JitNetworkAccessRequest{ - // { - // Requestor: to.Ptr("barbara@contoso.com"), - // StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T08:06:45.5691611Z"); return t}()), - // VirtualMachines: []*armsecurity.JitNetworkAccessRequestVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessRequestPort{ - // { - // AllowedSourceAddressPrefix: to.Ptr("192.127.0.2"), - // EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T09:06:45.5691611Z"); return t}()), - // Number: to.Ptr[int32](3389), - // Status: to.Ptr(armsecurity.StatusInitiated), - // StatusReason: to.Ptr(armsecurity.StatusReasonUserRequested), - // }}, - // }}, - // }}, - // VirtualMachines: []*armsecurity.JitNetworkAccessPolicyVirtualMachine{ - // { - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - // Ports: []*armsecurity.JitNetworkAccessPortRule{ - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](22), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }, - // { - // AllowedSourceAddressPrefix: to.Ptr("*"), - // MaxRequestAccessDuration: to.Ptr("PT3H"), - // Number: to.Ptr[int32](3389), - // Protocol: to.Ptr(armsecurity.ProtocolAll), - // }}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 44e6850e0d23..bf3d7513719e 100644 --- a/sdk/resourcemanager/security/armsecurity/locations_client.go +++ b/sdk/resourcemanager/security/armsecurity/locations_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -51,18 +50,21 @@ func NewLocationsClient(subscriptionID string, credential azcore.TokenCredential // - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations // - options - LocationsClientGetOptions contains the optional parameters for the LocationsClient.Get method. func (client *LocationsClient) Get(ctx context.Context, ascLocation string, options *LocationsClientGetOptions) (LocationsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, ascLocation, options) if err != nil { return LocationsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return LocationsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return LocationsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return LocationsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 a0d90f20d5b7..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 365b64fda132..4828b2389fb6 100644 --- a/sdk/resourcemanager/security/armsecurity/mdeonboardings_client.go +++ b/sdk/resourcemanager/security/armsecurity/mdeonboardings_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -50,18 +49,21 @@ func NewMdeOnboardingsClient(subscriptionID string, credential azcore.TokenCrede // Generated from API version 2021-10-01-preview // - options - MdeOnboardingsClientGetOptions contains the optional parameters for the MdeOnboardingsClient.Get method. func (client *MdeOnboardingsClient) Get(ctx context.Context, options *MdeOnboardingsClientGetOptions) (MdeOnboardingsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, options) if err != nil { return MdeOnboardingsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MdeOnboardingsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MdeOnboardingsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MdeOnboardingsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -97,18 +99,21 @@ func (client *MdeOnboardingsClient) getHandleResponse(resp *http.Response) (MdeO // Generated from API version 2021-10-01-preview // - options - MdeOnboardingsClientListOptions contains the optional parameters for the MdeOnboardingsClient.List method. func (client *MdeOnboardingsClient) List(ctx context.Context, options *MdeOnboardingsClientListOptions) (MdeOnboardingsClientListResponse, error) { + var err error req, err := client.listCreateRequest(ctx, options) if err != nil { return MdeOnboardingsClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return MdeOnboardingsClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return MdeOnboardingsClientListResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MdeOnboardingsClientListResponse{}, err } - return client.listHandleResponse(resp) + resp, err := client.listHandleResponse(httpResp) + return resp, err } // listCreateRequest creates the List request. 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 c1ca2717fd4b..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 7963d6d4fa20..951766ebb40c 100644 --- a/sdk/resourcemanager/security/armsecurity/models.go +++ b/sdk/resourcemanager/security/armsecurity/models.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -52,39 +51,8 @@ type AADSolutionProperties struct { Workspace *ConnectedWorkspace } -// APICollectionClientGetOptions contains the optional parameters for the APICollectionClient.Get method. -type APICollectionClientGetOptions struct { - // placeholder for future optional parameters -} - -// APICollectionClientListOptions contains the optional parameters for the APICollectionClient.NewListPager method. -type APICollectionClientListOptions struct { - // placeholder for future optional parameters -} - -// APICollectionOffboardingClientDeleteOptions contains the optional parameters for the APICollectionOffboardingClient.Delete -// method. -type APICollectionOffboardingClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// APICollectionOnboardingClientCreateOptions contains the optional parameters for the APICollectionOnboardingClient.Create -// method. -type APICollectionOnboardingClientCreateOptions struct { - // placeholder for future optional parameters -} - -// APICollectionProperties - Describes the properties of an API collection. -type APICollectionProperties struct { - // Additional data regarding the API collection. - AdditionalData map[string]*string - - // The display name of the Azure API Management API. - DisplayName *string -} - -// APICollectionResponse - An API collection as represented by Defender for APIs. -type APICollectionResponse struct { +// APICollection - An API collection as represented by Microsoft Defender for APIs. +type APICollection struct { // Describes the properties of an API collection. Properties *APICollectionProperties @@ -98,34 +66,65 @@ type APICollectionResponse struct { Type *string } -// APICollectionResponseList - Page of a list of API collections as represented by Defender for APIs. -type APICollectionResponseList struct { +// APICollectionList - Page of a list of API collections as represented by Microsoft Defender for APIs. +type APICollectionList struct { // READ-ONLY; The URI to fetch the next page. NextLink *string // READ-ONLY; API collections in this page. - Value []*APICollectionResponse + Value []*APICollection } -// AccountConnectorsClientCreateOrUpdateOptions contains the optional parameters for the AccountConnectorsClient.CreateOrUpdate -// method. -type AccountConnectorsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} +// APICollectionProperties - Describes the properties of an API collection. +type APICollectionProperties struct { + // READ-ONLY; The base URI for this API collection. All endpoints of this API collection extend this base URI. + BaseURL *string -// AccountConnectorsClientDeleteOptions contains the optional parameters for the AccountConnectorsClient.Delete method. -type AccountConnectorsClientDeleteOptions struct { - // placeholder for future optional parameters -} + // READ-ONLY; The resource Id of the resource from where this API collection was discovered. + DiscoveredVia *string + + // READ-ONLY; The display name of the API collection. + DisplayName *string + + // READ-ONLY; The number of API endpoints discovered in this API collection. + NumberOfAPIEndpoints *int64 + + // READ-ONLY; The number of API endpoints in this API collection which are exposing sensitive data in their requests and/or + // responses. + NumberOfAPIEndpointsWithSensitiveDataExposed *int64 + + // READ-ONLY; The number of API endpoints in this API collection for which API traffic from the internet was observed. + NumberOfExternalAPIEndpoints *int64 -// AccountConnectorsClientGetOptions contains the optional parameters for the AccountConnectorsClient.Get method. -type AccountConnectorsClientGetOptions struct { - // placeholder for future optional parameters + // READ-ONLY; The number of API endpoints in this API collection that have not received any API traffic in the last 30 days. + NumberOfInactiveAPIEndpoints *int64 + + // READ-ONLY; The number of API endpoints in this API collection that are unauthenticated. + NumberOfUnauthenticatedAPIEndpoints *int64 + + // READ-ONLY; Gets the provisioning state of the API collection. + ProvisioningState *ProvisioningState + + // READ-ONLY; The highest priority sensitivity label from Microsoft Purview in this API collection. + SensitivityLabel *string } -// AccountConnectorsClientListOptions contains the optional parameters for the AccountConnectorsClient.NewListPager method. -type AccountConnectorsClientListOptions struct { - // placeholder for future optional parameters +// ActionableRemediation - Configuration payload for PR Annotations. +type ActionableRemediation struct { + // Repository branch configuration for PR Annotations. + BranchConfiguration *TargetBranchConfiguration + + // Gets or sets list of categories and severity levels. + CategoryConfigurations []*CategoryConfiguration + + // Update Settings. + // Enabled - Resource should inherit configurations from parent. Disabled - Resource should not inherit configurations from + // parent. + InheritFromParentState *InheritFromParentState + + // ActionableRemediation Setting. None - the setting was never set. Enabled - ActionableRemediation is enabled. Disabled - + // ActionableRemediation is disabled. + State *ActionableRemediationState } // ActiveConnectionsNotInAllowedRange - Number of active connections is not in allowed range. @@ -155,8 +154,8 @@ type ActiveConnectionsNotInAllowedRange struct { // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type ActiveConnectionsNotInAllowedRange. func (a *ActiveConnectionsNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: a.DisplayName, Description: a.Description, + DisplayName: a.DisplayName, IsEnabled: a.IsEnabled, RuleType: a.RuleType, } @@ -165,11 +164,11 @@ func (a *ActiveConnectionsNotInAllowedRange) GetCustomAlertRule() *CustomAlertRu // GetThresholdCustomAlertRule implements the ThresholdCustomAlertRuleClassification interface for type ActiveConnectionsNotInAllowedRange. func (a *ActiveConnectionsNotInAllowedRange) GetThresholdCustomAlertRule() *ThresholdCustomAlertRule { return &ThresholdCustomAlertRule{ - MinThreshold: a.MinThreshold, - MaxThreshold: a.MaxThreshold, - DisplayName: a.DisplayName, Description: a.Description, + DisplayName: a.DisplayName, IsEnabled: a.IsEnabled, + MaxThreshold: a.MaxThreshold, + MinThreshold: a.MinThreshold, RuleType: a.RuleType, } } @@ -177,13 +176,13 @@ func (a *ActiveConnectionsNotInAllowedRange) GetThresholdCustomAlertRule() *Thre // GetTimeWindowCustomAlertRule implements the TimeWindowCustomAlertRuleClassification interface for type ActiveConnectionsNotInAllowedRange. func (a *ActiveConnectionsNotInAllowedRange) GetTimeWindowCustomAlertRule() *TimeWindowCustomAlertRule { return &TimeWindowCustomAlertRule{ - TimeWindowSize: a.TimeWindowSize, - MinThreshold: a.MinThreshold, - MaxThreshold: a.MaxThreshold, - DisplayName: a.DisplayName, Description: a.Description, + DisplayName: a.DisplayName, IsEnabled: a.IsEnabled, + MaxThreshold: a.MaxThreshold, + MinThreshold: a.MinThreshold, RuleType: a.RuleType, + TimeWindowSize: a.TimeWindowSize, } } @@ -242,33 +241,6 @@ type AdaptiveApplicationControlIssueSummary struct { NumberOfVMs *float32 } -// 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 -} - // AdaptiveNetworkHardening - The resource whose properties describes the Adaptive Network Hardening settings for some Azure // resource type AdaptiveNetworkHardening struct { @@ -306,25 +278,6 @@ type AdaptiveNetworkHardeningProperties struct { RulesCalculationTime *time.Time } -// 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 -} - // AdaptiveNetworkHardeningsList - Response for ListAdaptiveNetworkHardenings API service call type AdaptiveNetworkHardeningsList struct { // The URL to get the next set of results @@ -334,15 +287,6 @@ type AdaptiveNetworkHardeningsList struct { Value []*AdaptiveNetworkHardening } -// AdditionalDataClassification provides polymorphic access to related types. -// Call the interface's GetAdditionalData() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AdditionalData, *ContainerRegistryVulnerabilityProperties, *SQLServerVulnerabilityProperties, *ServerVulnerabilityProperties -type AdditionalDataClassification interface { - // GetAdditionalData returns the AdditionalData content of the underlying type. - GetAdditionalData() *AdditionalData -} - // AdditionalData - Details of the sub-assessment type AdditionalData struct { // REQUIRED; Sub-assessment resource type @@ -364,17 +308,6 @@ type AdditionalWorkspacesProperties struct { Workspace *string } -// AdvancedThreatProtectionClientCreateOptions contains the optional parameters for the AdvancedThreatProtectionClient.Create -// method. -type AdvancedThreatProtectionClientCreateOptions struct { - // placeholder for future optional parameters -} - -// AdvancedThreatProtectionClientGetOptions contains the optional parameters for the AdvancedThreatProtectionClient.Get method. -type AdvancedThreatProtectionClientGetOptions struct { - // placeholder for future optional parameters -} - // AdvancedThreatProtectionProperties - The Advanced Threat Protection settings. type AdvancedThreatProtectionProperties struct { // Indicates whether Advanced Threat Protection is enabled. @@ -542,8 +475,8 @@ type AlertSimulatorBundlesRequestProperties struct { // GetAlertSimulatorRequestProperties implements the AlertSimulatorRequestPropertiesClassification interface for type AlertSimulatorBundlesRequestProperties. func (a *AlertSimulatorBundlesRequestProperties) GetAlertSimulatorRequestProperties() *AlertSimulatorRequestProperties { return &AlertSimulatorRequestProperties{ - Kind: a.Kind, AdditionalProperties: a.AdditionalProperties, + Kind: a.Kind, } } @@ -553,15 +486,6 @@ type AlertSimulatorRequestBody struct { Properties AlertSimulatorRequestPropertiesClassification } -// AlertSimulatorRequestPropertiesClassification provides polymorphic access to related types. -// Call the interface's GetAlertSimulatorRequestProperties() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AlertSimulatorBundlesRequestProperties, *AlertSimulatorRequestProperties -type AlertSimulatorRequestPropertiesClassification interface { - // GetAlertSimulatorRequestProperties returns the AlertSimulatorRequestProperties content of the underlying type. - GetAlertSimulatorRequestProperties() *AlertSimulatorRequestProperties -} - // AlertSimulatorRequestProperties - Describes properties of an alert simulation request type AlertSimulatorRequestProperties struct { // REQUIRED; The kind of alert simulation. @@ -603,100 +527,13 @@ type AlertSyncSettings struct { // GetSetting implements the SettingClassification interface for type AlertSyncSettings. func (a *AlertSyncSettings) GetSetting() *Setting { return &Setting{ - Kind: a.Kind, ID: a.ID, + Kind: a.Kind, Name: a.Name, Type: a.Type, } } -// AlertsClientBeginSimulateOptions contains the optional parameters for the AlertsClient.BeginSimulate method. -type AlertsClientBeginSimulateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// AlertsClientGetResourceGroupLevelOptions contains the optional parameters for the AlertsClient.GetResourceGroupLevel method. -type AlertsClientGetResourceGroupLevelOptions struct { - // placeholder for future optional parameters -} - -// AlertsClientGetSubscriptionLevelOptions contains the optional parameters for the AlertsClient.GetSubscriptionLevel method. -type AlertsClientGetSubscriptionLevelOptions struct { - // placeholder for future optional parameters -} - -// AlertsClientListByResourceGroupOptions contains the optional parameters for the AlertsClient.NewListByResourceGroupPager -// method. -type AlertsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// AlertsClientListOptions contains the optional parameters for the AlertsClient.NewListPager method. -type AlertsClientListOptions struct { - // placeholder for future optional parameters -} - -// AlertsClientListResourceGroupLevelByRegionOptions contains the optional parameters for the AlertsClient.NewListResourceGroupLevelByRegionPager -// method. -type AlertsClientListResourceGroupLevelByRegionOptions struct { - // placeholder for future optional parameters -} - -// AlertsClientListSubscriptionLevelByRegionOptions contains the optional parameters for the AlertsClient.NewListSubscriptionLevelByRegionPager -// method. -type AlertsClientListSubscriptionLevelByRegionOptions struct { - // placeholder for future optional parameters -} - -// AlertsClientUpdateResourceGroupLevelStateToActivateOptions contains the optional parameters for the AlertsClient.UpdateResourceGroupLevelStateToActivate -// method. -type AlertsClientUpdateResourceGroupLevelStateToActivateOptions struct { - // placeholder for future optional parameters -} - -// AlertsClientUpdateResourceGroupLevelStateToDismissOptions contains the optional parameters for the AlertsClient.UpdateResourceGroupLevelStateToDismiss -// method. -type AlertsClientUpdateResourceGroupLevelStateToDismissOptions struct { - // placeholder for future optional parameters -} - -// AlertsClientUpdateResourceGroupLevelStateToInProgressOptions contains the optional parameters for the AlertsClient.UpdateResourceGroupLevelStateToInProgress -// method. -type AlertsClientUpdateResourceGroupLevelStateToInProgressOptions struct { - // placeholder for future optional parameters -} - -// AlertsClientUpdateResourceGroupLevelStateToResolveOptions contains the optional parameters for the AlertsClient.UpdateResourceGroupLevelStateToResolve -// method. -type AlertsClientUpdateResourceGroupLevelStateToResolveOptions struct { - // placeholder for future optional parameters -} - -// AlertsClientUpdateSubscriptionLevelStateToActivateOptions contains the optional parameters for the AlertsClient.UpdateSubscriptionLevelStateToActivate -// method. -type AlertsClientUpdateSubscriptionLevelStateToActivateOptions struct { - // placeholder for future optional parameters -} - -// AlertsClientUpdateSubscriptionLevelStateToDismissOptions contains the optional parameters for the AlertsClient.UpdateSubscriptionLevelStateToDismiss -// method. -type AlertsClientUpdateSubscriptionLevelStateToDismissOptions struct { - // placeholder for future optional parameters -} - -// AlertsClientUpdateSubscriptionLevelStateToInProgressOptions contains the optional parameters for the AlertsClient.UpdateSubscriptionLevelStateToInProgress -// method. -type AlertsClientUpdateSubscriptionLevelStateToInProgressOptions struct { - // placeholder for future optional parameters -} - -// AlertsClientUpdateSubscriptionLevelStateToResolveOptions contains the optional parameters for the AlertsClient.UpdateSubscriptionLevelStateToResolve -// method. -type AlertsClientUpdateSubscriptionLevelStateToResolveOptions struct { - // placeholder for future optional parameters -} - // AlertsSuppressionRule - Describes the suppression rule type AlertsSuppressionRule struct { // describes AlertsSuppressionRule properties @@ -726,8 +563,7 @@ type AlertsSuppressionRuleProperties struct { // Any comment regarding the rule Comment *string - // Expiration date of the rule, if value is not provided or provided as null this field will default to the maximum allowed - // expiration date. + // Expiration date of the rule, if value is not provided or provided as null there will no expiration at all ExpirationDateUTC *time.Time // The suppression conditions @@ -737,30 +573,6 @@ type AlertsSuppressionRuleProperties struct { LastModifiedUTC *time.Time } -// AlertsSuppressionRulesClientDeleteOptions contains the optional parameters for the AlertsSuppressionRulesClient.Delete -// method. -type AlertsSuppressionRulesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// AlertsSuppressionRulesClientGetOptions contains the optional parameters for the AlertsSuppressionRulesClient.Get method. -type AlertsSuppressionRulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// AlertsSuppressionRulesClientListOptions contains the optional parameters for the AlertsSuppressionRulesClient.NewListPager -// method. -type AlertsSuppressionRulesClientListOptions struct { - // Type of the alert to get rules for - AlertType *string -} - -// AlertsSuppressionRulesClientUpdateOptions contains the optional parameters for the AlertsSuppressionRulesClient.Update -// method. -type AlertsSuppressionRulesClientUpdateOptions struct { - // placeholder for future optional parameters -} - // AlertsSuppressionRulesList - Suppression rules list for subscription. type AlertsSuppressionRulesList struct { // REQUIRED @@ -770,22 +582,6 @@ type AlertsSuppressionRulesList struct { NextLink *string } -// AllowedConnectionsClientGetOptions contains the optional parameters for the AllowedConnectionsClient.Get method. -type AllowedConnectionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// AllowedConnectionsClientListByHomeRegionOptions contains the optional parameters for the AllowedConnectionsClient.NewListByHomeRegionPager -// method. -type AllowedConnectionsClientListByHomeRegionOptions struct { - // placeholder for future optional parameters -} - -// AllowedConnectionsClientListOptions contains the optional parameters for the AllowedConnectionsClient.NewListPager method. -type AllowedConnectionsClientListOptions struct { - // placeholder for future optional parameters -} - // AllowedConnectionsList - List of all possible traffic between Azure resources type AllowedConnectionsList struct { // READ-ONLY; The URI to fetch the next page. @@ -822,16 +618,6 @@ type AllowedConnectionsResourceProperties struct { ConnectableResources []*ConnectableResource } -// AllowlistCustomAlertRuleClassification provides polymorphic access to related types. -// Call the interface's GetAllowlistCustomAlertRule() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AllowlistCustomAlertRule, *ConnectionFromIPNotAllowed, *ConnectionToIPNotAllowed, *LocalUserNotAllowed, *ProcessNotAllowed -type AllowlistCustomAlertRuleClassification interface { - ListCustomAlertRuleClassification - // GetAllowlistCustomAlertRule returns the AllowlistCustomAlertRule content of the underlying type. - GetAllowlistCustomAlertRule() *AllowlistCustomAlertRule -} - // AllowlistCustomAlertRule - A custom alert rule that checks if a value (depends on the custom alert type) is allowed. type AllowlistCustomAlertRule struct { // REQUIRED; The values to allow. The format of the values depends on the rule type. @@ -859,8 +645,8 @@ func (a *AllowlistCustomAlertRule) GetAllowlistCustomAlertRule() *AllowlistCusto // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type AllowlistCustomAlertRule. func (a *AllowlistCustomAlertRule) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: a.DisplayName, Description: a.Description, + DisplayName: a.DisplayName, IsEnabled: a.IsEnabled, RuleType: a.RuleType, } @@ -869,11 +655,11 @@ func (a *AllowlistCustomAlertRule) GetCustomAlertRule() *CustomAlertRule { // GetListCustomAlertRule implements the ListCustomAlertRuleClassification interface for type AllowlistCustomAlertRule. func (a *AllowlistCustomAlertRule) GetListCustomAlertRule() *ListCustomAlertRule { return &ListCustomAlertRule{ - ValueType: a.ValueType, - DisplayName: a.DisplayName, Description: a.Description, + DisplayName: a.DisplayName, IsEnabled: a.IsEnabled, RuleType: a.RuleType, + ValueType: a.ValueType, } } @@ -904,8 +690,8 @@ type AmqpC2DMessagesNotInAllowedRange struct { // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type AmqpC2DMessagesNotInAllowedRange. func (a *AmqpC2DMessagesNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: a.DisplayName, Description: a.Description, + DisplayName: a.DisplayName, IsEnabled: a.IsEnabled, RuleType: a.RuleType, } @@ -914,11 +700,11 @@ func (a *AmqpC2DMessagesNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule // GetThresholdCustomAlertRule implements the ThresholdCustomAlertRuleClassification interface for type AmqpC2DMessagesNotInAllowedRange. func (a *AmqpC2DMessagesNotInAllowedRange) GetThresholdCustomAlertRule() *ThresholdCustomAlertRule { return &ThresholdCustomAlertRule{ - MinThreshold: a.MinThreshold, - MaxThreshold: a.MaxThreshold, - DisplayName: a.DisplayName, Description: a.Description, + DisplayName: a.DisplayName, IsEnabled: a.IsEnabled, + MaxThreshold: a.MaxThreshold, + MinThreshold: a.MinThreshold, RuleType: a.RuleType, } } @@ -926,13 +712,13 @@ func (a *AmqpC2DMessagesNotInAllowedRange) GetThresholdCustomAlertRule() *Thresh // GetTimeWindowCustomAlertRule implements the TimeWindowCustomAlertRuleClassification interface for type AmqpC2DMessagesNotInAllowedRange. func (a *AmqpC2DMessagesNotInAllowedRange) GetTimeWindowCustomAlertRule() *TimeWindowCustomAlertRule { return &TimeWindowCustomAlertRule{ - TimeWindowSize: a.TimeWindowSize, - MinThreshold: a.MinThreshold, - MaxThreshold: a.MaxThreshold, - DisplayName: a.DisplayName, Description: a.Description, + DisplayName: a.DisplayName, IsEnabled: a.IsEnabled, + MaxThreshold: a.MaxThreshold, + MinThreshold: a.MinThreshold, RuleType: a.RuleType, + TimeWindowSize: a.TimeWindowSize, } } @@ -964,8 +750,8 @@ type AmqpC2DRejectedMessagesNotInAllowedRange struct { // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type AmqpC2DRejectedMessagesNotInAllowedRange. func (a *AmqpC2DRejectedMessagesNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: a.DisplayName, Description: a.Description, + DisplayName: a.DisplayName, IsEnabled: a.IsEnabled, RuleType: a.RuleType, } @@ -974,11 +760,11 @@ func (a *AmqpC2DRejectedMessagesNotInAllowedRange) GetCustomAlertRule() *CustomA // GetThresholdCustomAlertRule implements the ThresholdCustomAlertRuleClassification interface for type AmqpC2DRejectedMessagesNotInAllowedRange. func (a *AmqpC2DRejectedMessagesNotInAllowedRange) GetThresholdCustomAlertRule() *ThresholdCustomAlertRule { return &ThresholdCustomAlertRule{ - MinThreshold: a.MinThreshold, - MaxThreshold: a.MaxThreshold, - DisplayName: a.DisplayName, Description: a.Description, + DisplayName: a.DisplayName, IsEnabled: a.IsEnabled, + MaxThreshold: a.MaxThreshold, + MinThreshold: a.MinThreshold, RuleType: a.RuleType, } } @@ -986,13 +772,13 @@ func (a *AmqpC2DRejectedMessagesNotInAllowedRange) GetThresholdCustomAlertRule() // GetTimeWindowCustomAlertRule implements the TimeWindowCustomAlertRuleClassification interface for type AmqpC2DRejectedMessagesNotInAllowedRange. func (a *AmqpC2DRejectedMessagesNotInAllowedRange) GetTimeWindowCustomAlertRule() *TimeWindowCustomAlertRule { return &TimeWindowCustomAlertRule{ - TimeWindowSize: a.TimeWindowSize, - MinThreshold: a.MinThreshold, - MaxThreshold: a.MaxThreshold, - DisplayName: a.DisplayName, Description: a.Description, + DisplayName: a.DisplayName, IsEnabled: a.IsEnabled, + MaxThreshold: a.MaxThreshold, + MinThreshold: a.MinThreshold, RuleType: a.RuleType, + TimeWindowSize: a.TimeWindowSize, } } @@ -1023,8 +809,8 @@ type AmqpD2CMessagesNotInAllowedRange struct { // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type AmqpD2CMessagesNotInAllowedRange. func (a *AmqpD2CMessagesNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: a.DisplayName, Description: a.Description, + DisplayName: a.DisplayName, IsEnabled: a.IsEnabled, RuleType: a.RuleType, } @@ -1033,11 +819,11 @@ func (a *AmqpD2CMessagesNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule // GetThresholdCustomAlertRule implements the ThresholdCustomAlertRuleClassification interface for type AmqpD2CMessagesNotInAllowedRange. func (a *AmqpD2CMessagesNotInAllowedRange) GetThresholdCustomAlertRule() *ThresholdCustomAlertRule { return &ThresholdCustomAlertRule{ - MinThreshold: a.MinThreshold, - MaxThreshold: a.MaxThreshold, - DisplayName: a.DisplayName, Description: a.Description, + DisplayName: a.DisplayName, IsEnabled: a.IsEnabled, + MaxThreshold: a.MaxThreshold, + MinThreshold: a.MinThreshold, RuleType: a.RuleType, } } @@ -1045,13 +831,13 @@ func (a *AmqpD2CMessagesNotInAllowedRange) GetThresholdCustomAlertRule() *Thresh // GetTimeWindowCustomAlertRule implements the TimeWindowCustomAlertRuleClassification interface for type AmqpD2CMessagesNotInAllowedRange. func (a *AmqpD2CMessagesNotInAllowedRange) GetTimeWindowCustomAlertRule() *TimeWindowCustomAlertRule { return &TimeWindowCustomAlertRule{ - TimeWindowSize: a.TimeWindowSize, - MinThreshold: a.MinThreshold, - MaxThreshold: a.MaxThreshold, - DisplayName: a.DisplayName, Description: a.Description, + DisplayName: a.DisplayName, IsEnabled: a.IsEnabled, + MaxThreshold: a.MaxThreshold, + MinThreshold: a.MinThreshold, RuleType: a.RuleType, + TimeWindowSize: a.TimeWindowSize, } } @@ -1070,21 +856,6 @@ type Application struct { Type *string } -// ApplicationClientCreateOrUpdateOptions contains the optional parameters for the ApplicationClient.CreateOrUpdate method. -type ApplicationClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ApplicationClientDeleteOptions contains the optional parameters for the ApplicationClient.Delete method. -type ApplicationClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ApplicationClientGetOptions contains the optional parameters for the ApplicationClient.Get method. -type ApplicationClientGetOptions struct { - // placeholder for future optional parameters -} - // ApplicationCondition - Application's condition type ApplicationCondition struct { // The application Condition's Operator, for example Contains for id or In for list of possible IDs, see examples @@ -1112,11 +883,6 @@ type ApplicationProperties struct { DisplayName *string } -// ApplicationsClientListOptions contains the optional parameters for the ApplicationsClient.NewListPager method. -type ApplicationsClientListOptions struct { - // placeholder for future optional parameters -} - // ApplicationsList - Page of a security applications list type ApplicationsList struct { // READ-ONLY; The URI to fetch the next page @@ -1436,61 +1202,6 @@ type AssessmentStatusResponse struct { StatusChangeDate *time.Time } -// AssessmentsClientCreateOrUpdateOptions contains the optional parameters for the AssessmentsClient.CreateOrUpdate method. -type AssessmentsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// AssessmentsClientDeleteOptions contains the optional parameters for the AssessmentsClient.Delete method. -type AssessmentsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// AssessmentsClientGetOptions contains the optional parameters for the AssessmentsClient.Get method. -type AssessmentsClientGetOptions struct { - // OData expand. Optional. - Expand *ExpandEnum -} - -// AssessmentsClientListOptions contains the optional parameters for the AssessmentsClient.NewListPager method. -type AssessmentsClientListOptions struct { - // placeholder for future optional parameters -} - -// AssessmentsMetadataClientCreateInSubscriptionOptions contains the optional parameters for the AssessmentsMetadataClient.CreateInSubscription -// method. -type AssessmentsMetadataClientCreateInSubscriptionOptions struct { - // placeholder for future optional parameters -} - -// AssessmentsMetadataClientDeleteInSubscriptionOptions contains the optional parameters for the AssessmentsMetadataClient.DeleteInSubscription -// method. -type AssessmentsMetadataClientDeleteInSubscriptionOptions struct { - // placeholder for future optional parameters -} - -// AssessmentsMetadataClientGetInSubscriptionOptions contains the optional parameters for the AssessmentsMetadataClient.GetInSubscription -// method. -type AssessmentsMetadataClientGetInSubscriptionOptions struct { - // placeholder for future optional parameters -} - -// AssessmentsMetadataClientGetOptions contains the optional parameters for the AssessmentsMetadataClient.Get method. -type AssessmentsMetadataClientGetOptions struct { - // placeholder for future optional parameters -} - -// AssessmentsMetadataClientListBySubscriptionOptions contains the optional parameters for the AssessmentsMetadataClient.NewListBySubscriptionPager -// method. -type AssessmentsMetadataClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// AssessmentsMetadataClientListOptions contains the optional parameters for the AssessmentsMetadataClient.NewListPager method. -type AssessmentsMetadataClientListOptions struct { - // placeholder for future optional parameters -} - // AtaExternalSecuritySolution - Represents an ATA security solution which sends logs to an OMS workspace type AtaExternalSecuritySolution struct { // The kind of the external solution @@ -1524,16 +1235,6 @@ type AtaSolutionProperties struct { Workspace *ConnectedWorkspace } -// 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: -// - *AuthenticationDetailsProperties, *AwAssumeRoleAuthenticationDetailsProperties, *AwsCredsAuthenticationDetailsProperties, -// - *GcpCredentialsDetailsProperties -type AuthenticationDetailsPropertiesClassification interface { - // GetAuthenticationDetailsProperties returns the AuthenticationDetailsProperties content of the underlying type. - GetAuthenticationDetailsProperties() *AuthenticationDetailsProperties -} - // 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 @@ -1552,6 +1253,13 @@ func (a *AuthenticationDetailsProperties) GetAuthenticationDetailsProperties() * return a } +// Authorization payload. +type Authorization struct { + // Gets or sets one-time OAuth code to exchange for refresh and access tokens. + // Only used during PUT/PATCH operations. The secret is cleared during GET. + Code *string +} + // AutoProvisioningSetting - Auto provisioning setting type AutoProvisioningSetting struct { // Auto provisioning setting data @@ -1582,23 +1290,6 @@ type AutoProvisioningSettingProperties struct { AutoProvision *AutoProvision } -// AutoProvisioningSettingsClientCreateOptions contains the optional parameters for the AutoProvisioningSettingsClient.Create -// method. -type AutoProvisioningSettingsClientCreateOptions struct { - // placeholder for future optional parameters -} - -// AutoProvisioningSettingsClientGetOptions contains the optional parameters for the AutoProvisioningSettingsClient.Get method. -type AutoProvisioningSettingsClientGetOptions struct { - // placeholder for future optional parameters -} - -// AutoProvisioningSettingsClientListOptions contains the optional parameters for the AutoProvisioningSettingsClient.NewListPager -// method. -type AutoProvisioningSettingsClientListOptions struct { - // placeholder for future optional parameters -} - // Automation - The security automation resource. type Automation struct { // Entity tag is used for comparing two or more entities from the same requested resource. @@ -1626,15 +1317,6 @@ type Automation struct { Type *string } -// AutomationActionClassification provides polymorphic access to related types. -// Call the interface's GetAutomationAction() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AutomationAction, *AutomationActionEventHub, *AutomationActionLogicApp, *AutomationActionWorkspace -type AutomationActionClassification interface { - // GetAutomationAction returns the AutomationAction content of the underlying type. - GetAutomationAction() *AutomationAction -} - // AutomationAction - The action that should be triggered. type AutomationAction struct { // REQUIRED; The type of the action that will be triggered by the Automation @@ -1793,37 +1475,6 @@ type AutomationValidationStatus struct { Message *string } -// AutomationsClientCreateOrUpdateOptions contains the optional parameters for the AutomationsClient.CreateOrUpdate method. -type AutomationsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// AutomationsClientDeleteOptions contains the optional parameters for the AutomationsClient.Delete method. -type AutomationsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// AutomationsClientGetOptions contains the optional parameters for the AutomationsClient.Get method. -type AutomationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// AutomationsClientListByResourceGroupOptions contains the optional parameters for the AutomationsClient.NewListByResourceGroupPager -// method. -type AutomationsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// AutomationsClientListOptions contains the optional parameters for the AutomationsClient.NewListPager method. -type AutomationsClientListOptions struct { - // placeholder for future optional parameters -} - -// AutomationsClientValidateOptions contains the optional parameters for the AutomationsClient.Validate method. -type AutomationsClientValidateOptions struct { - // placeholder for future optional parameters -} - // AwAssumeRoleAuthenticationDetailsProperties - AWS cloud account connector based assume role, the role enables delegating // access to your AWS resources. The role is composed of role Amazon Resource Name (ARN) and external ID. For more details, // refer to Creating a Role to Delegate Permissions to an IAM User (write only) [https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user.html] @@ -1852,8 +1503,8 @@ type AwAssumeRoleAuthenticationDetailsProperties struct { func (a *AwAssumeRoleAuthenticationDetailsProperties) GetAuthenticationDetailsProperties() *AuthenticationDetailsProperties { return &AuthenticationDetailsProperties{ AuthenticationProvisioningState: a.AuthenticationProvisioningState, - GrantedPermissions: a.GrantedPermissions, AuthenticationType: a.AuthenticationType, + GrantedPermissions: a.GrantedPermissions, } } @@ -1885,8 +1536,8 @@ type AwsCredsAuthenticationDetailsProperties struct { func (a *AwsCredsAuthenticationDetailsProperties) GetAuthenticationDetailsProperties() *AuthenticationDetailsProperties { return &AuthenticationDetailsProperties{ AuthenticationProvisioningState: a.AuthenticationProvisioningState, - GrantedPermissions: a.GrantedPermissions, AuthenticationType: a.AuthenticationType, + GrantedPermissions: a.GrantedPermissions, } } @@ -1901,6 +1552,9 @@ type AwsEnvironmentData struct { // list of regions to scan Regions []*string + // Scan interval in hours (value should be between 1-hour to 24-hours) + ScanInterval *int64 + // READ-ONLY; The AWS account name AccountName *string } @@ -1912,15 +1566,6 @@ func (a *AwsEnvironmentData) GetEnvironmentData() *EnvironmentData { } } -// AwsOrganizationalDataClassification provides polymorphic access to related types. -// Call the interface's GetAwsOrganizationalData() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AwsOrganizationalData, *AwsOrganizationalDataMaster, *AwsOrganizationalDataMember -type AwsOrganizationalDataClassification interface { - // GetAwsOrganizationalData returns the AwsOrganizationalData content of the underlying type. - GetAwsOrganizationalData() *AwsOrganizationalData -} - // AwsOrganizationalData - The AWS organization data type AwsOrganizationalData struct { // REQUIRED; The multi cloud account's membership type in the organization @@ -1965,26 +1610,223 @@ func (a *AwsOrganizationalDataMember) GetAwsOrganizationalData() *AwsOrganizatio } } -// AzureDevOpsScopeEnvironmentData - The AzureDevOps scope connector's environment data -type AzureDevOpsScopeEnvironmentData struct { - // REQUIRED; The type of the environment data. - EnvironmentType *EnvironmentType -} +// AzureDevOpsOrg - Azure DevOps Organization resource. +type AzureDevOpsOrg struct { + // Azure DevOps Organization properties. + Properties *AzureDevOpsOrgProperties -// GetEnvironmentData implements the EnvironmentDataClassification interface for type AzureDevOpsScopeEnvironmentData. -func (a *AzureDevOpsScopeEnvironmentData) GetEnvironmentData() *EnvironmentData { - return &EnvironmentData{ - EnvironmentType: a.EnvironmentType, - } -} + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string -// AzureResourceDetails - Details of the Azure resource that was assessed -type AzureResourceDetails struct { - // REQUIRED; The platform where the assessed resource resides - Source *Source + // READ-ONLY; The name of the resource + Name *string - // READ-ONLY; Azure resource Id of the assessed resource - ID *string + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// AzureDevOpsOrgListResponse - List of RP resources which supports pagination. +type AzureDevOpsOrgListResponse struct { + // Gets or sets next link to scroll over the results. + NextLink *string + + // Gets or sets list of resources. + Value []*AzureDevOpsOrg +} + +// AzureDevOpsOrgProperties - Azure DevOps Organization properties. +type AzureDevOpsOrgProperties struct { + // Configuration payload for PR Annotations. + ActionableRemediation *ActionableRemediation + + // Details about resource onboarding status across all connectors. + // OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only applicable to top-level + // resources. Onboarded - this resource has already been onboarded by the + // specified connector. NotOnboarded - this resource has not been onboarded to any connector. NotApplicable - the onboarding + // 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 resource status message. + ProvisioningStatusMessage *string + + // READ-ONLY; Gets or sets time when resource was last checked. + ProvisioningStatusUpdateTimeUTC *time.Time +} + +// AzureDevOpsOrganizationConfiguration - AzureDevOps Org Inventory Configuration. +type AzureDevOpsOrganizationConfiguration struct { + // AutoDiscovery states. + AutoDiscovery *AutoDiscovery + + // AzureDevOps Project Inventory Configuration. Dictionary of AzureDevOps project name to desired project configuration. If + // AutoDiscovery is Enabled, this field should be empty or null. + ProjectConfigs map[string]*AzureDevOpsProjectConfiguration +} + +// AzureDevOpsProject - Azure DevOps Project resource. +type AzureDevOpsProject struct { + // Azure DevOps Project properties. + Properties *AzureDevOpsProjectProperties + + // 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; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// AzureDevOpsProjectConfiguration - AzureDevOps Project Inventory Configuration. +type AzureDevOpsProjectConfiguration struct { + // AutoDiscovery states. + AutoDiscovery *AutoDiscovery + + // AzureDevOps Repository Inventory Configuration. Dictionary of AzureDevOps repository name to desired repository configuration. + // If AutoDiscovery is Enabled, this field should be null or empty. + RepositoryConfigs map[string]*BaseResourceConfiguration +} + +// AzureDevOpsProjectListResponse - List of RP resources which supports pagination. +type AzureDevOpsProjectListResponse struct { + // Gets or sets next link to scroll over the results. + NextLink *string + + // Gets or sets list of resources. + Value []*AzureDevOpsProject +} + +// AzureDevOpsProjectProperties - Azure DevOps Project properties. +type AzureDevOpsProjectProperties struct { + // Configuration payload for PR Annotations. + ActionableRemediation *ActionableRemediation + + // Details about resource onboarding status across all connectors. + // OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only applicable to top-level + // resources. Onboarded - this resource has already been onboarded by the + // specified connector. NotOnboarded - this resource has not been onboarded to any connector. NotApplicable - the onboarding + // state is not applicable to the current endpoint. + OnboardingState *OnboardingState + + // Gets or sets parent Azure DevOps Organization name. + ParentOrgName *string + + // 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. + ProvisioningStatusMessage *string + + // READ-ONLY; Gets or sets time when resource was last checked. + ProvisioningStatusUpdateTimeUTC *time.Time +} + +// AzureDevOpsRepository - Azure DevOps Repository resource. +type AzureDevOpsRepository struct { + // Azure DevOps Repository properties. + Properties *AzureDevOpsRepositoryProperties + + // 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; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// AzureDevOpsRepositoryListResponse - List of RP resources which supports pagination. +type AzureDevOpsRepositoryListResponse struct { + // Gets or sets next link to scroll over the results. + NextLink *string + + // Gets or sets list of resources. + Value []*AzureDevOpsRepository +} + +// AzureDevOpsRepositoryProperties - Azure DevOps Repository properties. +type AzureDevOpsRepositoryProperties struct { + // Configuration payload for PR Annotations. + ActionableRemediation *ActionableRemediation + + // Details about resource onboarding status across all connectors. + // OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only applicable to top-level + // resources. Onboarded - this resource has already been onboarded by the + // specified connector. NotOnboarded - this resource has not been onboarded to any connector. NotApplicable - the onboarding + // state is not applicable to the current endpoint. + OnboardingState *OnboardingState + + // Gets or sets parent Azure DevOps Organization name. + ParentOrgName *string + + // Gets or sets parent Azure DevOps Project name. + ParentProjectName *string + + // 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. + ProvisioningStatusMessage *string + + // READ-ONLY; Gets or sets time when resource was last checked. + ProvisioningStatusUpdateTimeUTC *time.Time + + // READ-ONLY; Gets or sets Azure DevOps Repository id. + RepoID *string + + // READ-ONLY; Gets or sets Azure DevOps Repository url. + RepoURL *string + + // READ-ONLY; Gets or sets Azure DevOps repository visibility, whether it is public or private etc. + Visibility *string +} + +// AzureDevOpsScopeEnvironmentData - The AzureDevOps scope connector's environment data +type AzureDevOpsScopeEnvironmentData struct { + // REQUIRED; The type of the environment data. + EnvironmentType *EnvironmentType +} + +// GetEnvironmentData implements the EnvironmentDataClassification interface for type AzureDevOpsScopeEnvironmentData. +func (a *AzureDevOpsScopeEnvironmentData) GetEnvironmentData() *EnvironmentData { + return &EnvironmentData{ + EnvironmentType: a.EnvironmentType, + } +} + +// AzureResourceDetails - Details of the Azure resource that was assessed +type AzureResourceDetails struct { + // REQUIRED; The platform where the assessed resource resides + Source *Source + + // READ-ONLY; Azure resource Id of the assessed resource + ID *string } // GetResourceDetails implements the ResourceDetailsClassification interface for type AzureResourceDetails. @@ -2016,12 +1858,51 @@ type AzureResourceLink struct { ID *string } +// AzureServersSetting - A vulnerability assessments setting on Azure servers in the defined scope. +type AzureServersSetting struct { + // REQUIRED; The kind of the server vulnerability assessments setting. + Kind *ServerVulnerabilityAssessmentsSettingKind + + // The vulnerability assessments setting properties on Azure servers in the defined scope. + Properties *ServerVulnerabilityAssessmentsAzureSettingProperties + + // 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 +} + +// GetServerVulnerabilityAssessmentsSetting implements the ServerVulnerabilityAssessmentsSettingClassification interface for +// type AzureServersSetting. +func (a *AzureServersSetting) GetServerVulnerabilityAssessmentsSetting() *ServerVulnerabilityAssessmentsSetting { + return &ServerVulnerabilityAssessmentsSetting{ + ID: a.ID, + Kind: a.Kind, + Name: a.Name, + SystemData: a.SystemData, + Type: a.Type, + } +} + // AzureTrackedResourceLocation - Describes an Azure resource with location type AzureTrackedResourceLocation struct { // Location where the resource is stored Location *string } +// BaseResourceConfiguration - Base Resource Inventory configuration changes. +type BaseResourceConfiguration struct { + // Onboarding states. + DesiredOnboardingState *DesiredOnboardingState +} + // Baseline details. type Baseline struct { // Expected results. @@ -2082,6 +1963,16 @@ type CVSS struct { Base *float32 } +// CategoryConfiguration - Severity level per category configuration for PR Annotations. +type CategoryConfiguration struct { + // Rule categories. Code - code scanning results. Artifact scanning results. Dependencies scanning results. IaC results. Secrets + // scanning results. Container scanning results. + Category *RuleCategory + + // Gets or sets minimum severity level for a given category. + MinimumSeverityLevel *string +} + // CefExternalSecuritySolution - Represents a security solution which sends CEF logs to an OMS workspace type CefExternalSecuritySolution struct { // The kind of the external solution @@ -2117,30 +2008,6 @@ type CefSolutionProperties struct { Workspace *ConnectedWorkspace } -// CenterClientGetSensitivitySettingsOptions contains the optional parameters for the CenterClient.GetSensitivitySettings -// method. -type CenterClientGetSensitivitySettingsOptions struct { - // placeholder for future optional parameters -} - -// CenterClientUpdateSensitivitySettingsOptions contains the optional parameters for the CenterClient.UpdateSensitivitySettings -// method. -type CenterClientUpdateSensitivitySettingsOptions struct { - // placeholder for future optional parameters -} - -// 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, *DefenderForDevOpsAzureDevOpsOffering, *DefenderForDevOpsGitLabOffering, -// - *DefenderForDevOpsGithubOffering, *DefenderForServersAwsOffering, *DefenderForServersGcpOffering, *InformationProtectionAwsOffering -type CloudOfferingClassification interface { - // GetCloudOffering returns the CloudOffering content of the underlying type. - GetCloudOffering() *CloudOffering -} - // CloudOffering - The security offering details type CloudOffering struct { // REQUIRED; The type of the security offering. @@ -2222,16 +2089,6 @@ type ComplianceResultProperties struct { ResourceStatus *ResourceStatus } -// ComplianceResultsClientGetOptions contains the optional parameters for the ComplianceResultsClient.Get method. -type ComplianceResultsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ComplianceResultsClientListOptions contains the optional parameters for the ComplianceResultsClient.NewListPager method. -type ComplianceResultsClientListOptions struct { - // placeholder for future optional parameters -} - // ComplianceSegment - A segment of a compliance assessment. type ComplianceSegment struct { // READ-ONLY; The size (%) of the segment. @@ -2241,16 +2098,6 @@ type ComplianceSegment struct { SegmentType *string } -// CompliancesClientGetOptions contains the optional parameters for the CompliancesClient.Get method. -type CompliancesClientGetOptions struct { - // placeholder for future optional parameters -} - -// CompliancesClientListOptions contains the optional parameters for the CompliancesClient.NewListPager method. -type CompliancesClientListOptions struct { - // placeholder for future optional parameters -} - // Condition - Governance rule's condition type Condition struct { // The governance rule Condition's Operator, for example Equals for severity or In for list of assessments, see examples @@ -2319,19 +2166,19 @@ type ConnectionFromIPNotAllowed struct { func (c *ConnectionFromIPNotAllowed) GetAllowlistCustomAlertRule() *AllowlistCustomAlertRule { return &AllowlistCustomAlertRule{ AllowlistValues: c.AllowlistValues, - ValueType: c.ValueType, - DisplayName: c.DisplayName, Description: c.Description, + DisplayName: c.DisplayName, IsEnabled: c.IsEnabled, RuleType: c.RuleType, + ValueType: c.ValueType, } } // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type ConnectionFromIPNotAllowed. func (c *ConnectionFromIPNotAllowed) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: c.DisplayName, Description: c.Description, + DisplayName: c.DisplayName, IsEnabled: c.IsEnabled, RuleType: c.RuleType, } @@ -2340,20 +2187,14 @@ func (c *ConnectionFromIPNotAllowed) GetCustomAlertRule() *CustomAlertRule { // GetListCustomAlertRule implements the ListCustomAlertRuleClassification interface for type ConnectionFromIPNotAllowed. func (c *ConnectionFromIPNotAllowed) GetListCustomAlertRule() *ListCustomAlertRule { return &ListCustomAlertRule{ - ValueType: c.ValueType, - DisplayName: c.DisplayName, Description: c.Description, + DisplayName: c.DisplayName, IsEnabled: c.IsEnabled, RuleType: c.RuleType, + ValueType: c.ValueType, } } -// ConnectionStrings - Connection string for ingesting security data and logs -type ConnectionStrings struct { - // REQUIRED; Connection strings - Value []*IngestionConnectionString -} - // ConnectionToIPNotAllowed - Outbound connection to an ip that isn't allowed. Allow list consists of ipv4 or ipv6 range in // CIDR notation. type ConnectionToIPNotAllowed struct { @@ -2380,19 +2221,19 @@ type ConnectionToIPNotAllowed struct { func (c *ConnectionToIPNotAllowed) GetAllowlistCustomAlertRule() *AllowlistCustomAlertRule { return &AllowlistCustomAlertRule{ AllowlistValues: c.AllowlistValues, - ValueType: c.ValueType, - DisplayName: c.DisplayName, Description: c.Description, + DisplayName: c.DisplayName, IsEnabled: c.IsEnabled, RuleType: c.RuleType, + ValueType: c.ValueType, } } // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type ConnectionToIPNotAllowed. func (c *ConnectionToIPNotAllowed) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: c.DisplayName, Description: c.Description, + DisplayName: c.DisplayName, IsEnabled: c.IsEnabled, RuleType: c.RuleType, } @@ -2401,11 +2242,11 @@ func (c *ConnectionToIPNotAllowed) GetCustomAlertRule() *CustomAlertRule { // GetListCustomAlertRule implements the ListCustomAlertRuleClassification interface for type ConnectionToIPNotAllowed. func (c *ConnectionToIPNotAllowed) GetListCustomAlertRule() *ListCustomAlertRule { return &ListCustomAlertRule{ - ValueType: c.ValueType, - DisplayName: c.DisplayName, Description: c.Description, + DisplayName: c.DisplayName, IsEnabled: c.IsEnabled, RuleType: c.RuleType, + ValueType: c.ValueType, } } @@ -2439,28 +2280,6 @@ type Connector struct { Type *string } -// ConnectorApplicationClientCreateOrUpdateOptions contains the optional parameters for the ConnectorApplicationClient.CreateOrUpdate -// method. -type ConnectorApplicationClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ConnectorApplicationClientDeleteOptions contains the optional parameters for the ConnectorApplicationClient.Delete method. -type ConnectorApplicationClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ConnectorApplicationClientGetOptions contains the optional parameters for the ConnectorApplicationClient.Get method. -type ConnectorApplicationClientGetOptions struct { - // placeholder for future optional parameters -} - -// ConnectorApplicationsClientListOptions contains the optional parameters for the ConnectorApplicationsClient.NewListPager -// method. -type ConnectorApplicationsClientListOptions struct { - // placeholder for future optional parameters -} - // ConnectorProperties - A set of properties that defines the security connector configuration. type ConnectorProperties struct { // The security connector environment data. @@ -2513,37 +2332,6 @@ type ConnectorSettingProperties struct { HybridComputeSettings *HybridComputeSettingsProperties } -// ConnectorsClientCreateOrUpdateOptions contains the optional parameters for the ConnectorsClient.CreateOrUpdate method. -type ConnectorsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ConnectorsClientDeleteOptions contains the optional parameters for the ConnectorsClient.Delete method. -type ConnectorsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ConnectorsClientGetOptions contains the optional parameters for the ConnectorsClient.Get method. -type ConnectorsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ConnectorsClientListByResourceGroupOptions contains the optional parameters for the ConnectorsClient.NewListByResourceGroupPager -// method. -type ConnectorsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ConnectorsClientListOptions contains the optional parameters for the ConnectorsClient.NewListPager method. -type ConnectorsClientListOptions struct { - // placeholder for future optional parameters -} - -// ConnectorsClientUpdateOptions contains the optional parameters for the ConnectorsClient.Update method. -type ConnectorsClientUpdateOptions struct { - // placeholder for future optional parameters -} - // ConnectorsList - List of security connectors response. type ConnectorsList struct { // REQUIRED; The list of security connectors under the given scope. @@ -2614,26 +2402,6 @@ type ContactPropertiesNotificationsByRole struct { State *State } -// ContactsClientCreateOptions contains the optional parameters for the ContactsClient.Create method. -type ContactsClientCreateOptions struct { - // placeholder for future optional parameters -} - -// ContactsClientDeleteOptions contains the optional parameters for the ContactsClient.Delete method. -type ContactsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ContactsClientGetOptions contains the optional parameters for the ContactsClient.Get method. -type ContactsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ContactsClientListOptions contains the optional parameters for the ContactsClient.NewListPager method. -type ContactsClientListOptions struct { - // placeholder for future optional parameters -} - // ContainerRegistryVulnerabilityProperties - Additional context fields for container registry Vulnerability assessment type ContainerRegistryVulnerabilityProperties struct { // REQUIRED; Sub-assessment resource type @@ -2686,8 +2454,8 @@ type CspmMonitorAwsOffering struct { // GetCloudOffering implements the CloudOfferingClassification interface for type CspmMonitorAwsOffering. func (c *CspmMonitorAwsOffering) GetCloudOffering() *CloudOffering { return &CloudOffering{ - OfferingType: c.OfferingType, Description: c.Description, + OfferingType: c.OfferingType, } } @@ -2709,8 +2477,8 @@ type CspmMonitorAzureDevOpsOffering struct { // GetCloudOffering implements the CloudOfferingClassification interface for type CspmMonitorAzureDevOpsOffering. func (c *CspmMonitorAzureDevOpsOffering) GetCloudOffering() *CloudOffering { return &CloudOffering{ - OfferingType: c.OfferingType, Description: c.Description, + OfferingType: c.OfferingType, } } @@ -2729,8 +2497,8 @@ type CspmMonitorGcpOffering struct { // GetCloudOffering implements the CloudOfferingClassification interface for type CspmMonitorGcpOffering. func (c *CspmMonitorGcpOffering) GetCloudOffering() *CloudOffering { return &CloudOffering{ - OfferingType: c.OfferingType, Description: c.Description, + OfferingType: c.OfferingType, } } @@ -2755,8 +2523,8 @@ type CspmMonitorGitLabOffering struct { // GetCloudOffering implements the CloudOfferingClassification interface for type CspmMonitorGitLabOffering. func (c *CspmMonitorGitLabOffering) GetCloudOffering() *CloudOffering { return &CloudOffering{ - OfferingType: c.OfferingType, Description: c.Description, + OfferingType: c.OfferingType, } } @@ -2772,26 +2540,11 @@ type CspmMonitorGithubOffering struct { // GetCloudOffering implements the CloudOfferingClassification interface for type CspmMonitorGithubOffering. func (c *CspmMonitorGithubOffering) GetCloudOffering() *CloudOffering { return &CloudOffering{ - OfferingType: c.OfferingType, Description: c.Description, + OfferingType: c.OfferingType, } } -// CustomAlertRuleClassification provides polymorphic access to related types. -// Call the interface's GetCustomAlertRule() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ActiveConnectionsNotInAllowedRange, *AllowlistCustomAlertRule, *AmqpC2DMessagesNotInAllowedRange, *AmqpC2DRejectedMessagesNotInAllowedRange, -// - *AmqpD2CMessagesNotInAllowedRange, *ConnectionFromIPNotAllowed, *ConnectionToIPNotAllowed, *CustomAlertRule, *DenylistCustomAlertRule, -// - *DirectMethodInvokesNotInAllowedRange, *FailedLocalLoginsNotInAllowedRange, *FileUploadsNotInAllowedRange, *HTTPC2DMessagesNotInAllowedRange, -// - *HTTPC2DRejectedMessagesNotInAllowedRange, *HTTPD2CMessagesNotInAllowedRange, *ListCustomAlertRule, *LocalUserNotAllowed, -// - *MqttC2DMessagesNotInAllowedRange, *MqttC2DRejectedMessagesNotInAllowedRange, *MqttD2CMessagesNotInAllowedRange, *ProcessNotAllowed, -// - *QueuePurgesNotInAllowedRange, *ThresholdCustomAlertRule, *TimeWindowCustomAlertRule, *TwinUpdatesNotInAllowedRange, -// - *UnauthorizedOperationsNotInAllowedRange -type CustomAlertRuleClassification interface { - // GetCustomAlertRule returns the CustomAlertRule content of the underlying type. - GetCustomAlertRule() *CustomAlertRule -} - // CustomAlertRule - A custom alert rule. type CustomAlertRule struct { // REQUIRED; Status of the custom alert. @@ -2888,36 +2641,6 @@ type CustomAssessmentAutomationRequestProperties struct { SupportedCloud *SupportedCloudEnum } -// CustomAssessmentAutomationsClientCreateOptions contains the optional parameters for the CustomAssessmentAutomationsClient.Create -// method. -type CustomAssessmentAutomationsClientCreateOptions struct { - // placeholder for future optional parameters -} - -// CustomAssessmentAutomationsClientDeleteOptions contains the optional parameters for the CustomAssessmentAutomationsClient.Delete -// method. -type CustomAssessmentAutomationsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// CustomAssessmentAutomationsClientGetOptions contains the optional parameters for the CustomAssessmentAutomationsClient.Get -// method. -type CustomAssessmentAutomationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// CustomAssessmentAutomationsClientListByResourceGroupOptions contains the optional parameters for the CustomAssessmentAutomationsClient.NewListByResourceGroupPager -// method. -type CustomAssessmentAutomationsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// CustomAssessmentAutomationsClientListBySubscriptionOptions contains the optional parameters for the CustomAssessmentAutomationsClient.NewListBySubscriptionPager -// method. -type CustomAssessmentAutomationsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - // CustomAssessmentAutomationsListResult - A list of Custom Assessment Automations type CustomAssessmentAutomationsListResult struct { // The link used to get the next page of operations. @@ -2966,36 +2689,6 @@ type CustomEntityStoreAssignmentRequestProperties struct { Principal *string } -// CustomEntityStoreAssignmentsClientCreateOptions contains the optional parameters for the CustomEntityStoreAssignmentsClient.Create -// method. -type CustomEntityStoreAssignmentsClientCreateOptions struct { - // placeholder for future optional parameters -} - -// CustomEntityStoreAssignmentsClientDeleteOptions contains the optional parameters for the CustomEntityStoreAssignmentsClient.Delete -// method. -type CustomEntityStoreAssignmentsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// CustomEntityStoreAssignmentsClientGetOptions contains the optional parameters for the CustomEntityStoreAssignmentsClient.Get -// method. -type CustomEntityStoreAssignmentsClientGetOptions struct { - // placeholder for future optional parameters -} - -// CustomEntityStoreAssignmentsClientListByResourceGroupOptions contains the optional parameters for the CustomEntityStoreAssignmentsClient.NewListByResourceGroupPager -// method. -type CustomEntityStoreAssignmentsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// CustomEntityStoreAssignmentsClientListBySubscriptionOptions contains the optional parameters for the CustomEntityStoreAssignmentsClient.NewListBySubscriptionPager -// method. -type CustomEntityStoreAssignmentsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - // CustomEntityStoreAssignmentsListResult - A list of custom entity store assignments type CustomEntityStoreAssignmentsListResult struct { // The link used to get the next page of operations. @@ -3032,8 +2725,8 @@ type DataExportSettings struct { // GetSetting implements the SettingClassification interface for type DataExportSettings. func (d *DataExportSettings) GetSetting() *Setting { return &Setting{ - Kind: d.Kind, ID: d.ID, + Kind: d.Kind, Name: d.Name, Type: d.Type, } @@ -3044,12 +2737,21 @@ type DefenderCspmAwsOffering struct { // REQUIRED; The type of the security offering. OfferingType *OfferingType + // Defenders CSPM Cloud infrastructure entitlement management (CIEM) offering configurations + Ciem *DefenderCspmAwsOfferingCiem + // The Microsoft Defender Data Sensitivity discovery configuration DataSensitivityDiscovery *DefenderCspmAwsOfferingDataSensitivityDiscovery // The databases DSPM configuration DatabasesDspm *DefenderCspmAwsOfferingDatabasesDspm + // The Microsoft Defender container agentless discovery K8s configuration + MdcContainersAgentlessDiscoveryK8S *DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S + + // The Microsoft Defender container image assessment configuration + MdcContainersImageAssessment *DefenderCspmAwsOfferingMdcContainersImageAssessment + // The Microsoft Defender for Server VM scanning configuration VMScanners *DefenderCspmAwsOfferingVMScanners @@ -3060,11 +2762,35 @@ type DefenderCspmAwsOffering struct { // GetCloudOffering implements the CloudOfferingClassification interface for type DefenderCspmAwsOffering. func (d *DefenderCspmAwsOffering) GetCloudOffering() *CloudOffering { return &CloudOffering{ - OfferingType: d.OfferingType, Description: d.Description, + OfferingType: d.OfferingType, } } +// DefenderCspmAwsOfferingCiem - Defenders CSPM Cloud infrastructure entitlement management (CIEM) offering configurations +type DefenderCspmAwsOfferingCiem struct { + // Defender CSPM CIEM discovery configuration + CiemDiscovery *DefenderCspmAwsOfferingCiemDiscovery + + // Defender CSPM CIEM AWS OIDC (open id connect) configuration + CiemOidc *DefenderCspmAwsOfferingCiemOidc +} + +// DefenderCspmAwsOfferingCiemDiscovery - Defender CSPM CIEM discovery configuration +type DefenderCspmAwsOfferingCiemDiscovery struct { + // The cloud role ARN in AWS for CIEM discovery + CloudRoleArn *string +} + +// DefenderCspmAwsOfferingCiemOidc - Defender CSPM CIEM AWS OIDC (open id connect) configuration +type DefenderCspmAwsOfferingCiemOidc struct { + // the azure active directory app name used of authenticating against AWS + AzureActiveDirectoryAppName *string + + // The cloud role ARN in AWS for CIEM oidc connection + CloudRoleArn *string +} + // DefenderCspmAwsOfferingDataSensitivityDiscovery - The Microsoft Defender Data Sensitivity discovery configuration type DefenderCspmAwsOfferingDataSensitivityDiscovery struct { // The cloud role ARN in AWS for this feature @@ -3083,6 +2809,24 @@ type DefenderCspmAwsOfferingDatabasesDspm struct { Enabled *bool } +// DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S - The Microsoft Defender container agentless discovery K8s configuration +type DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S struct { + // The cloud role ARN in AWS for this feature + CloudRoleArn *string + + // Is Microsoft Defender container agentless discovery K8s enabled + Enabled *bool +} + +// DefenderCspmAwsOfferingMdcContainersImageAssessment - The Microsoft Defender container image assessment configuration +type DefenderCspmAwsOfferingMdcContainersImageAssessment struct { + // The cloud role ARN in AWS for this feature + CloudRoleArn *string + + // Is Microsoft Defender container image assessment enabled + Enabled *bool +} + // DefenderCspmAwsOfferingVMScanners - The Microsoft Defender for Server VM scanning configuration type DefenderCspmAwsOfferingVMScanners struct { // configuration for Microsoft Defender for Server VM scanning @@ -3109,6 +2853,21 @@ type DefenderCspmGcpOffering struct { // REQUIRED; The type of the security offering. OfferingType *OfferingType + // GCP Defenders CSPM Cloud infrastructure entitlement management (CIEM) discovery offering configurations + CiemDiscovery *DefenderCspmGcpOfferingCiemDiscovery + + // The Microsoft Defender Data Sensitivity discovery configuration + DataSensitivityDiscovery *DefenderCspmGcpOfferingDataSensitivityDiscovery + + // The Microsoft Defender Container agentless discovery configuration + MdcContainersAgentlessDiscoveryK8S *DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S + + // The Microsoft Defender Container image assessment configuration + MdcContainersImageAssessment *DefenderCspmGcpOfferingMdcContainersImageAssessment + + // The Microsoft Defender for Server VM scanning configuration + VMScanners *DefenderCspmGcpOfferingVMScanners + // READ-ONLY; The offering description. Description *string } @@ -3116,11 +2875,78 @@ type DefenderCspmGcpOffering struct { // GetCloudOffering implements the CloudOfferingClassification interface for type DefenderCspmGcpOffering. func (d *DefenderCspmGcpOffering) GetCloudOffering() *CloudOffering { return &CloudOffering{ - OfferingType: d.OfferingType, Description: d.Description, + OfferingType: d.OfferingType, } } +// DefenderCspmGcpOfferingCiemDiscovery - GCP Defenders CSPM Cloud infrastructure entitlement management (CIEM) discovery +// offering configurations +type DefenderCspmGcpOfferingCiemDiscovery struct { + // the azure active directory app name used of authenticating against GCP workload identity federation + AzureActiveDirectoryAppName *string + + // The service account email address in GCP for CIEM discovery offering + ServiceAccountEmailAddress *string + + // The GCP workload identity provider id for CIEM discovery offering + WorkloadIdentityProviderID *string +} + +// DefenderCspmGcpOfferingDataSensitivityDiscovery - The Microsoft Defender Data Sensitivity discovery configuration +type DefenderCspmGcpOfferingDataSensitivityDiscovery struct { + // Is Microsoft Defender Data Sensitivity discovery enabled + Enabled *bool + + // The service account email address in GCP for this feature + ServiceAccountEmailAddress *string + + // The workload identity provider id in GCP for this feature + WorkloadIdentityProviderID *string +} + +// DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S - The Microsoft Defender Container agentless discovery configuration +type DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S struct { + // Is Microsoft Defender container agentless discovery enabled + Enabled *bool + + // The service account email address in GCP for this feature + ServiceAccountEmailAddress *string + + // The workload identity provider id in GCP for this feature + WorkloadIdentityProviderID *string +} + +// DefenderCspmGcpOfferingMdcContainersImageAssessment - The Microsoft Defender Container image assessment configuration +type DefenderCspmGcpOfferingMdcContainersImageAssessment struct { + // Is Microsoft Defender container image assessment enabled + Enabled *bool + + // The service account email address in GCP for this feature + ServiceAccountEmailAddress *string + + // The workload identity provider id in GCP for this feature + WorkloadIdentityProviderID *string +} + +// DefenderCspmGcpOfferingVMScanners - The Microsoft Defender for Server VM scanning configuration +type DefenderCspmGcpOfferingVMScanners struct { + // configuration for Microsoft Defender for Server VM scanning + Configuration *DefenderCspmGcpOfferingVMScannersConfiguration + + // Is Microsoft Defender for Server VM scanning enabled + Enabled *bool +} + +// DefenderCspmGcpOfferingVMScannersConfiguration - configuration for Microsoft Defender for Server VM scanning +type DefenderCspmGcpOfferingVMScannersConfiguration struct { + // VM tags that indicates that VM should not be scanned + ExclusionTags map[string]*string + + // The scanning mode for the VM scan. + ScanningMode *ScanningMode +} + // DefenderFoDatabasesAwsOffering - The Defender for Databases AWS offering type DefenderFoDatabasesAwsOffering struct { // REQUIRED; The type of the security offering. @@ -3142,8 +2968,8 @@ type DefenderFoDatabasesAwsOffering struct { // GetCloudOffering implements the CloudOfferingClassification interface for type DefenderFoDatabasesAwsOffering. func (d *DefenderFoDatabasesAwsOffering) GetCloudOffering() *CloudOffering { return &CloudOffering{ - OfferingType: d.OfferingType, Description: d.Description, + OfferingType: d.OfferingType, } } @@ -3218,6 +3044,12 @@ type DefenderForContainersAwsOffering struct { // The kubernetes service connection configuration KubernetesService *DefenderForContainersAwsOfferingKubernetesService + // The Microsoft Defender container agentless discovery K8s configuration + MdcContainersAgentlessDiscoveryK8S *DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S + + // The Microsoft Defender container image assessment configuration + MdcContainersImageAssessment *DefenderForContainersAwsOfferingMdcContainersImageAssessment + // The externalId used by the data reader to prevent the confused deputy attack ScubaExternalID *string @@ -3228,8 +3060,8 @@ type DefenderForContainersAwsOffering struct { // GetCloudOffering implements the CloudOfferingClassification interface for type DefenderForContainersAwsOffering. func (d *DefenderForContainersAwsOffering) GetCloudOffering() *CloudOffering { return &CloudOffering{ - OfferingType: d.OfferingType, Description: d.Description, + OfferingType: d.OfferingType, } } @@ -3269,6 +3101,25 @@ type DefenderForContainersAwsOfferingKubernetesService struct { CloudRoleArn *string } +// DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S - The Microsoft Defender container agentless discovery +// K8s configuration +type DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S struct { + // The cloud role ARN in AWS for this feature + CloudRoleArn *string + + // Is Microsoft Defender container agentless discovery K8s enabled + Enabled *bool +} + +// DefenderForContainersAwsOfferingMdcContainersImageAssessment - The Microsoft Defender container image assessment configuration +type DefenderForContainersAwsOfferingMdcContainersImageAssessment struct { + // The cloud role ARN in AWS for this feature + CloudRoleArn *string + + // Is Microsoft Defender container image assessment enabled + Enabled *bool +} + // DefenderForContainersGcpOffering - The containers GCP offering type DefenderForContainersGcpOffering struct { // REQUIRED; The type of the security offering. @@ -3283,6 +3134,12 @@ type DefenderForContainersGcpOffering struct { // Is Microsoft Defender for Cloud Kubernetes agent auto provisioning enabled DefenderAgentAutoProvisioningFlag *bool + // The Microsoft Defender Container agentless discovery configuration + MdcContainersAgentlessDiscoveryK8S *DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S + + // The Microsoft Defender Container image assessment configuration + MdcContainersImageAssessment *DefenderForContainersGcpOfferingMdcContainersImageAssessment + // The native cloud connection configuration NativeCloudConnection *DefenderForContainersGcpOfferingNativeCloudConnection @@ -3296,8 +3153,8 @@ type DefenderForContainersGcpOffering struct { // GetCloudOffering implements the CloudOfferingClassification interface for type DefenderForContainersGcpOffering. func (d *DefenderForContainersGcpOffering) GetCloudOffering() *CloudOffering { return &CloudOffering{ - OfferingType: d.OfferingType, Description: d.Description, + OfferingType: d.OfferingType, } } @@ -3306,7 +3163,32 @@ type DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection struct { // The data collection service account email address in GCP for this offering ServiceAccountEmailAddress *string - // The data collection GCP workload identity provider id for this offering + // The data collection GCP workload identity provider id for this offering + WorkloadIdentityProviderID *string +} + +// DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S - The Microsoft Defender Container agentless discovery +// configuration +type DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S struct { + // Is Microsoft Defender container agentless discovery enabled + Enabled *bool + + // The service account email address in GCP for this feature + ServiceAccountEmailAddress *string + + // The workload identity provider id in GCP for this feature + WorkloadIdentityProviderID *string +} + +// DefenderForContainersGcpOfferingMdcContainersImageAssessment - The Microsoft Defender Container image assessment configuration +type DefenderForContainersGcpOfferingMdcContainersImageAssessment struct { + // Is Microsoft Defender container image assessment enabled + Enabled *bool + + // The service account email address in GCP for this feature + ServiceAccountEmailAddress *string + + // The workload identity provider id in GCP for this feature WorkloadIdentityProviderID *string } @@ -3337,8 +3219,8 @@ type DefenderForDatabasesGcpOffering struct { // GetCloudOffering implements the CloudOfferingClassification interface for type DefenderForDatabasesGcpOffering. func (d *DefenderForDatabasesGcpOffering) GetCloudOffering() *CloudOffering { return &CloudOffering{ - OfferingType: d.OfferingType, Description: d.Description, + OfferingType: d.OfferingType, } } @@ -3381,8 +3263,8 @@ type DefenderForDevOpsAzureDevOpsOffering struct { // GetCloudOffering implements the CloudOfferingClassification interface for type DefenderForDevOpsAzureDevOpsOffering. func (d *DefenderForDevOpsAzureDevOpsOffering) GetCloudOffering() *CloudOffering { return &CloudOffering{ - OfferingType: d.OfferingType, Description: d.Description, + OfferingType: d.OfferingType, } } @@ -3398,8 +3280,8 @@ type DefenderForDevOpsGitLabOffering struct { // GetCloudOffering implements the CloudOfferingClassification interface for type DefenderForDevOpsGitLabOffering. func (d *DefenderForDevOpsGitLabOffering) GetCloudOffering() *CloudOffering { return &CloudOffering{ - OfferingType: d.OfferingType, Description: d.Description, + OfferingType: d.OfferingType, } } @@ -3415,8 +3297,8 @@ type DefenderForDevOpsGithubOffering struct { // GetCloudOffering implements the CloudOfferingClassification interface for type DefenderForDevOpsGithubOffering. func (d *DefenderForDevOpsGithubOffering) GetCloudOffering() *CloudOffering { return &CloudOffering{ - OfferingType: d.OfferingType, Description: d.Description, + OfferingType: d.OfferingType, } } @@ -3450,8 +3332,8 @@ type DefenderForServersAwsOffering struct { // GetCloudOffering implements the CloudOfferingClassification interface for type DefenderForServersAwsOffering. func (d *DefenderForServersAwsOffering) GetCloudOffering() *CloudOffering { return &CloudOffering{ - OfferingType: d.OfferingType, Description: d.Description, + OfferingType: d.OfferingType, } } @@ -3563,8 +3445,8 @@ type DefenderForServersGcpOffering struct { // GetCloudOffering implements the CloudOfferingClassification interface for type DefenderForServersGcpOffering. func (d *DefenderForServersGcpOffering) GetCloudOffering() *CloudOffering { return &CloudOffering{ - OfferingType: d.OfferingType, Description: d.Description, + OfferingType: d.OfferingType, } } @@ -3643,6 +3525,36 @@ type DefenderForServersGcpOfferingVaAutoProvisioningConfiguration struct { Type *Type } +// DefenderForStorageSetting - The Defender for Storage resource. +type DefenderForStorageSetting struct { + // Defender for Storage resource properties. + Properties *DefenderForStorageSettingProperties + + // READ-ONLY; Resource Id + ID *string + + // READ-ONLY; Resource name + Name *string + + // READ-ONLY; Resource type + Type *string +} + +// DefenderForStorageSettingProperties - Defender for Storage resource properties. +type DefenderForStorageSettingProperties struct { + // Indicates whether Defender for Storage is enabled on this storage account. + IsEnabled *bool + + // Properties of Malware Scanning. + MalwareScanning *MalwareScanningProperties + + // Indicates whether the settings defined for this storage account should override the settings defined for the subscription. + OverrideSubscriptionLevelSettings *bool + + // Properties of Sensitive Data Discovery. + SensitiveDataDiscovery *SensitiveDataDiscoveryProperties +} + // DenylistCustomAlertRule - A custom alert rule that checks if a value (depends on the custom alert type) is denied. type DenylistCustomAlertRule struct { // REQUIRED; The values to deny. The format of the values depends on the rule type. @@ -3667,8 +3579,8 @@ type DenylistCustomAlertRule struct { // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type DenylistCustomAlertRule. func (d *DenylistCustomAlertRule) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: d.DisplayName, Description: d.Description, + DisplayName: d.DisplayName, IsEnabled: d.IsEnabled, RuleType: d.RuleType, } @@ -3677,14 +3589,65 @@ func (d *DenylistCustomAlertRule) GetCustomAlertRule() *CustomAlertRule { // GetListCustomAlertRule implements the ListCustomAlertRuleClassification interface for type DenylistCustomAlertRule. func (d *DenylistCustomAlertRule) GetListCustomAlertRule() *ListCustomAlertRule { return &ListCustomAlertRule{ - ValueType: d.ValueType, - DisplayName: d.DisplayName, Description: d.Description, + DisplayName: d.DisplayName, IsEnabled: d.IsEnabled, RuleType: d.RuleType, + ValueType: d.ValueType, } } +// DevOpsConfiguration - DevOps Configuration resource. +type DevOpsConfiguration struct { + // DevOps Configuration properties. + Properties *DevOpsConfigurationProperties + + // 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; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// DevOpsConfigurationListResponse - List of RP resources which supports pagination. +type DevOpsConfigurationListResponse struct { + // Gets or sets next link to scroll over the results. + NextLink *string + + // Gets or sets list of resources. + Value []*DevOpsConfiguration +} + +// DevOpsConfigurationProperties - DevOps Configuration properties. +type DevOpsConfigurationProperties struct { + // Authorization payload. + Authorization *Authorization + + // AutoDiscovery states. + AutoDiscovery *AutoDiscovery + + // 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. + ProvisioningStatusMessage *string + + // READ-ONLY; Gets or sets time when resource was last checked. + ProvisioningStatusUpdateTimeUTC *time.Time +} + // DeviceSecurityGroup - The device security group resource type DeviceSecurityGroup struct { // Device Security group data @@ -3724,28 +3687,6 @@ type DeviceSecurityGroupProperties struct { TimeWindowRules []TimeWindowCustomAlertRuleClassification } -// DeviceSecurityGroupsClientCreateOrUpdateOptions contains the optional parameters for the DeviceSecurityGroupsClient.CreateOrUpdate -// method. -type DeviceSecurityGroupsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// DeviceSecurityGroupsClientDeleteOptions contains the optional parameters for the DeviceSecurityGroupsClient.Delete method. -type DeviceSecurityGroupsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// DeviceSecurityGroupsClientGetOptions contains the optional parameters for the DeviceSecurityGroupsClient.Get method. -type DeviceSecurityGroupsClientGetOptions struct { - // placeholder for future optional parameters -} - -// DeviceSecurityGroupsClientListOptions contains the optional parameters for the DeviceSecurityGroupsClient.NewListPager -// method. -type DeviceSecurityGroupsClientListOptions struct { - // placeholder for future optional parameters -} - // DirectMethodInvokesNotInAllowedRange - Number of direct method invokes is not in allowed range. type DirectMethodInvokesNotInAllowedRange struct { // REQUIRED; Status of the custom alert. @@ -3773,8 +3714,8 @@ type DirectMethodInvokesNotInAllowedRange struct { // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type DirectMethodInvokesNotInAllowedRange. func (d *DirectMethodInvokesNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: d.DisplayName, Description: d.Description, + DisplayName: d.DisplayName, IsEnabled: d.IsEnabled, RuleType: d.RuleType, } @@ -3783,11 +3724,11 @@ func (d *DirectMethodInvokesNotInAllowedRange) GetCustomAlertRule() *CustomAlert // GetThresholdCustomAlertRule implements the ThresholdCustomAlertRuleClassification interface for type DirectMethodInvokesNotInAllowedRange. func (d *DirectMethodInvokesNotInAllowedRange) GetThresholdCustomAlertRule() *ThresholdCustomAlertRule { return &ThresholdCustomAlertRule{ - MinThreshold: d.MinThreshold, - MaxThreshold: d.MaxThreshold, - DisplayName: d.DisplayName, Description: d.Description, + DisplayName: d.DisplayName, IsEnabled: d.IsEnabled, + MaxThreshold: d.MaxThreshold, + MinThreshold: d.MinThreshold, RuleType: d.RuleType, } } @@ -3795,13 +3736,13 @@ func (d *DirectMethodInvokesNotInAllowedRange) GetThresholdCustomAlertRule() *Th // GetTimeWindowCustomAlertRule implements the TimeWindowCustomAlertRuleClassification interface for type DirectMethodInvokesNotInAllowedRange. func (d *DirectMethodInvokesNotInAllowedRange) GetTimeWindowCustomAlertRule() *TimeWindowCustomAlertRule { return &TimeWindowCustomAlertRule{ - TimeWindowSize: d.TimeWindowSize, - MinThreshold: d.MinThreshold, - MaxThreshold: d.MaxThreshold, - DisplayName: d.DisplayName, Description: d.Description, + DisplayName: d.DisplayName, IsEnabled: d.IsEnabled, + MaxThreshold: d.MaxThreshold, + MinThreshold: d.MinThreshold, RuleType: d.RuleType, + TimeWindowSize: d.TimeWindowSize, } } @@ -3843,24 +3784,6 @@ type DiscoveredSecuritySolutionProperties struct { SecurityFamily *SecurityFamily } -// DiscoveredSecuritySolutionsClientGetOptions contains the optional parameters for the DiscoveredSecuritySolutionsClient.Get -// method. -type DiscoveredSecuritySolutionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// DiscoveredSecuritySolutionsClientListByHomeRegionOptions contains the optional parameters for the DiscoveredSecuritySolutionsClient.NewListByHomeRegionPager -// method. -type DiscoveredSecuritySolutionsClientListByHomeRegionOptions struct { - // placeholder for future optional parameters -} - -// DiscoveredSecuritySolutionsClientListOptions contains the optional parameters for the DiscoveredSecuritySolutionsClient.NewListPager -// method. -type DiscoveredSecuritySolutionsClientListOptions struct { - // placeholder for future optional parameters -} - // 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. @@ -3876,16 +3799,6 @@ type EffectiveNetworkSecurityGroups struct { NetworkSecurityGroups []*string } -// 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 -type EnvironmentDataClassification interface { - // GetEnvironmentData returns the EnvironmentData content of the underlying type. - GetEnvironmentData() *EnvironmentData -} - // EnvironmentData - The security connector environment data. type EnvironmentData struct { // REQUIRED; The type of the environment data. @@ -4049,24 +3962,6 @@ type ExternalSecuritySolutionProperties struct { Workspace *ConnectedWorkspace } -// ExternalSecuritySolutionsClientGetOptions contains the optional parameters for the ExternalSecuritySolutionsClient.Get -// method. -type ExternalSecuritySolutionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ExternalSecuritySolutionsClientListByHomeRegionOptions contains the optional parameters for the ExternalSecuritySolutionsClient.NewListByHomeRegionPager -// method. -type ExternalSecuritySolutionsClientListByHomeRegionOptions struct { - // placeholder for future optional parameters -} - -// ExternalSecuritySolutionsClientListOptions contains the optional parameters for the ExternalSecuritySolutionsClient.NewListPager -// method. -type ExternalSecuritySolutionsClientListOptions struct { - // placeholder for future optional parameters -} - // FailedLocalLoginsNotInAllowedRange - Number of failed local logins is not in allowed range. type FailedLocalLoginsNotInAllowedRange struct { // REQUIRED; Status of the custom alert. @@ -4094,8 +3989,8 @@ type FailedLocalLoginsNotInAllowedRange struct { // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type FailedLocalLoginsNotInAllowedRange. func (f *FailedLocalLoginsNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: f.DisplayName, Description: f.Description, + DisplayName: f.DisplayName, IsEnabled: f.IsEnabled, RuleType: f.RuleType, } @@ -4104,11 +3999,11 @@ func (f *FailedLocalLoginsNotInAllowedRange) GetCustomAlertRule() *CustomAlertRu // GetThresholdCustomAlertRule implements the ThresholdCustomAlertRuleClassification interface for type FailedLocalLoginsNotInAllowedRange. func (f *FailedLocalLoginsNotInAllowedRange) GetThresholdCustomAlertRule() *ThresholdCustomAlertRule { return &ThresholdCustomAlertRule{ - MinThreshold: f.MinThreshold, - MaxThreshold: f.MaxThreshold, - DisplayName: f.DisplayName, Description: f.Description, + DisplayName: f.DisplayName, IsEnabled: f.IsEnabled, + MaxThreshold: f.MaxThreshold, + MinThreshold: f.MinThreshold, RuleType: f.RuleType, } } @@ -4116,13 +4011,13 @@ func (f *FailedLocalLoginsNotInAllowedRange) GetThresholdCustomAlertRule() *Thre // GetTimeWindowCustomAlertRule implements the TimeWindowCustomAlertRuleClassification interface for type FailedLocalLoginsNotInAllowedRange. func (f *FailedLocalLoginsNotInAllowedRange) GetTimeWindowCustomAlertRule() *TimeWindowCustomAlertRule { return &TimeWindowCustomAlertRule{ - TimeWindowSize: f.TimeWindowSize, - MinThreshold: f.MinThreshold, - MaxThreshold: f.MaxThreshold, - DisplayName: f.DisplayName, Description: f.Description, + DisplayName: f.DisplayName, IsEnabled: f.IsEnabled, + MaxThreshold: f.MaxThreshold, + MinThreshold: f.MinThreshold, RuleType: f.RuleType, + TimeWindowSize: f.TimeWindowSize, } } @@ -4153,8 +4048,8 @@ type FileUploadsNotInAllowedRange struct { // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type FileUploadsNotInAllowedRange. func (f *FileUploadsNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: f.DisplayName, Description: f.Description, + DisplayName: f.DisplayName, IsEnabled: f.IsEnabled, RuleType: f.RuleType, } @@ -4163,11 +4058,11 @@ func (f *FileUploadsNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule { // GetThresholdCustomAlertRule implements the ThresholdCustomAlertRuleClassification interface for type FileUploadsNotInAllowedRange. func (f *FileUploadsNotInAllowedRange) GetThresholdCustomAlertRule() *ThresholdCustomAlertRule { return &ThresholdCustomAlertRule{ - MinThreshold: f.MinThreshold, - MaxThreshold: f.MaxThreshold, - DisplayName: f.DisplayName, Description: f.Description, + DisplayName: f.DisplayName, IsEnabled: f.IsEnabled, + MaxThreshold: f.MaxThreshold, + MinThreshold: f.MinThreshold, RuleType: f.RuleType, } } @@ -4175,13 +4070,13 @@ func (f *FileUploadsNotInAllowedRange) GetThresholdCustomAlertRule() *ThresholdC // GetTimeWindowCustomAlertRule implements the TimeWindowCustomAlertRuleClassification interface for type FileUploadsNotInAllowedRange. func (f *FileUploadsNotInAllowedRange) GetTimeWindowCustomAlertRule() *TimeWindowCustomAlertRule { return &TimeWindowCustomAlertRule{ - TimeWindowSize: f.TimeWindowSize, - MinThreshold: f.MinThreshold, - MaxThreshold: f.MaxThreshold, - DisplayName: f.DisplayName, Description: f.Description, + DisplayName: f.DisplayName, IsEnabled: f.IsEnabled, + MaxThreshold: f.MaxThreshold, + MinThreshold: f.MinThreshold, RuleType: f.RuleType, + TimeWindowSize: f.TimeWindowSize, } } @@ -4236,20 +4131,11 @@ type GcpCredentialsDetailsProperties struct { func (g *GcpCredentialsDetailsProperties) GetAuthenticationDetailsProperties() *AuthenticationDetailsProperties { return &AuthenticationDetailsProperties{ AuthenticationProvisioningState: g.AuthenticationProvisioningState, - GrantedPermissions: g.GrantedPermissions, AuthenticationType: g.AuthenticationType, + GrantedPermissions: g.GrantedPermissions, } } -// GcpOrganizationalDataClassification provides polymorphic access to related types. -// Call the interface's GetGcpOrganizationalData() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *GcpOrganizationalData, *GcpOrganizationalDataMember, *GcpOrganizationalDataOrganization -type GcpOrganizationalDataClassification interface { - // GetGcpOrganizationalData returns the GcpOrganizationalData content of the underlying type. - GetGcpOrganizationalData() *GcpOrganizationalData -} - // GcpOrganizationalData - The gcpOrganization data type GcpOrganizationalData struct { // REQUIRED; The multi cloud account's membership type in the organization @@ -4328,6 +4214,9 @@ type GcpProjectEnvironmentData struct { // The Gcp project's details ProjectDetails *GcpProjectDetails + + // Scan interval in hours (value should be between 1-hour to 24-hours) + ScanInterval *int64 } // GetEnvironmentData implements the EnvironmentDataClassification interface for type GcpProjectEnvironmentData. @@ -4389,6 +4278,270 @@ type GetSensitivitySettingsResponsePropertiesMipInformation struct { MipIntegrationStatus *MipIntegrationStatus } +// GitHubOwner - GitHub Owner resource. +type GitHubOwner struct { + // GitHub Owner properties. + Properties *GitHubOwnerProperties + + // 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; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// GitHubOwnerConfiguration - GitHub Owner Inventory Configuration. +type GitHubOwnerConfiguration struct { + // AutoDiscovery states. + AutoDiscovery *AutoDiscovery + + // GitHub Repository Inventory Configuration. Dictionary of GitHub repository name to desired repository configuration. If + // AutoDiscovery is Enabled, this field should be null or empty. + RepositoryConfigs map[string]*BaseResourceConfiguration +} + +// GitHubOwnerListResponse - List of RP resources which supports pagination. +type GitHubOwnerListResponse struct { + // Gets or sets next link to scroll over the results. + NextLink *string + + // Gets or sets list of resources. + Value []*GitHubOwner +} + +// GitHubOwnerProperties - GitHub Owner properties. +type GitHubOwnerProperties struct { + // Details about resource onboarding status across all connectors. + // OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only applicable to top-level + // resources. Onboarded - this resource has already been onboarded by the + // specified connector. NotOnboarded - this resource has not been onboarded to any connector. NotApplicable - the onboarding + // 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. + ProvisioningStatusMessage *string + + // READ-ONLY; Gets or sets time when resource was last checked. + ProvisioningStatusUpdateTimeUTC *time.Time +} + +// GitHubRepository - GitHub Repository resource. +type GitHubRepository struct { + // GitHub Repository properties. + Properties *GitHubRepositoryProperties + + // 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; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// GitHubRepositoryListResponse - List of RP resources which supports pagination. +type GitHubRepositoryListResponse struct { + // Gets or sets next link to scroll over the results. + NextLink *string + + // Gets or sets list of resources. + Value []*GitHubRepository +} + +// GitHubRepositoryProperties - GitHub Repository properties. +type GitHubRepositoryProperties struct { + // Details about resource onboarding status across all connectors. + // OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only applicable to top-level + // resources. Onboarded - this resource has already been onboarded by the + // specified connector. NotOnboarded - this resource has not been onboarded to any connector. NotApplicable - the onboarding + // state is not applicable to the current endpoint. + OnboardingState *OnboardingState + + // Gets or sets parent GitHub Owner name. + ParentOwnerName *string + + // 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. + ProvisioningStatusMessage *string + + // READ-ONLY; Gets or sets 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". + RepoFullName *string + + // READ-ONLY; Gets or sets GitHub Repository id. + // This is a numeric id defined by Github. Eg: "123456". + RepoID *string + + // READ-ONLY; Gets or sets GitHub Repository name. Eg: "new-repo-1". + RepoName *string + + // READ-ONLY; Gets or sets GitHub Repository url. + RepoURL *string +} + +// GitLabGroup - GitLab Group resource. +type GitLabGroup struct { + // GitLab Group properties. + Properties *GitLabGroupProperties + + // 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; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// GitLabGroupConfiguration - GitLab Group Inventory Configuration. +type GitLabGroupConfiguration struct { + // AutoDiscovery states. + AutoDiscovery *AutoDiscovery + + // GitLab Project Inventory Configuration. Dictionary of GitLab fully-qualified project name to desired project configuration. + // If AutoDiscovery is Enabled, this field should be null or empty. + ProjectConfigs map[string]*BaseResourceConfiguration +} + +// GitLabGroupListResponse - List of RP resources which supports pagination. +type GitLabGroupListResponse struct { + // Gets or sets next link to scroll over the results. + NextLink *string + + // Gets or sets list of resources. + Value []*GitLabGroup +} + +// GitLabGroupProperties - GitLab Group properties. +type GitLabGroupProperties struct { + // Details about resource onboarding status across all connectors. + // OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only applicable to top-level + // resources. Onboarded - this resource has already been onboarded by the + // specified connector. NotOnboarded - this resource has not been onboarded to any connector. NotApplicable - the onboarding + // 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 + + // READ-ONLY; Gets or sets the fully-qualified name of the Group object. + // This contains the entire namespace hierarchy where namespaces are separated by the '$' character. + FullyQualifiedName *string + + // READ-ONLY; Gets or sets resource status message. + ProvisioningStatusMessage *string + + // READ-ONLY; Gets or sets time when resource was last checked. + ProvisioningStatusUpdateTimeUTC *time.Time + + // READ-ONLY; Gets or sets the url of the GitLab Group. + URL *string +} + +// GitLabProject - GitLab Project resource. +type GitLabProject struct { + // GitLab Project properties. + Properties *GitLabProjectProperties + + // 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; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// GitLabProjectListResponse - List of RP resources which supports pagination. +type GitLabProjectListResponse struct { + // Gets or sets next link to scroll over the results. + NextLink *string + + // Gets or sets list of resources. + Value []*GitLabProject +} + +// GitLabProjectProperties - GitLab Project properties. +type GitLabProjectProperties struct { + // Details about resource onboarding status across all connectors. + // OnboardedByOtherConnector - this resource has already been onboarded to another connector. This is only applicable to top-level + // resources. Onboarded - this resource has already been onboarded by the + // specified connector. NotOnboarded - this resource has not been onboarded to any connector. NotApplicable - the onboarding + // 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 + + // READ-ONLY; Gets or sets the fully-qualified name of the project object. + // This contains the entire hierarchy where entities are separated by the '$' character. + FullyQualifiedName *string + + // READ-ONLY; Gets or sets the fully-qualified name of the project's parent group object. + // This contains the entire hierarchy where namespaces are separated by the '$' character. + FullyQualifiedParentGroupName *string + + // READ-ONLY; Gets or sets resource status message. + ProvisioningStatusMessage *string + + // READ-ONLY; Gets or sets time when resource was last checked. + ProvisioningStatusUpdateTimeUTC *time.Time + + // READ-ONLY; Gets or sets the url of the GitLab Project. + URL *string +} + // GithubScopeEnvironmentData - The github scope connector's environment data type GithubScopeEnvironmentData struct { // REQUIRED; The type of the environment data. @@ -4463,28 +4616,6 @@ type GovernanceAssignmentProperties struct { RemediationEta *RemediationEta } -// GovernanceAssignmentsClientCreateOrUpdateOptions contains the optional parameters for the GovernanceAssignmentsClient.CreateOrUpdate -// method. -type GovernanceAssignmentsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// GovernanceAssignmentsClientDeleteOptions contains the optional parameters for the GovernanceAssignmentsClient.Delete method. -type GovernanceAssignmentsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// GovernanceAssignmentsClientGetOptions contains the optional parameters for the GovernanceAssignmentsClient.Get method. -type GovernanceAssignmentsClientGetOptions struct { - // placeholder for future optional parameters -} - -// GovernanceAssignmentsClientListOptions contains the optional parameters for the GovernanceAssignmentsClient.NewListPager -// method. -type GovernanceAssignmentsClientListOptions struct { - // placeholder for future optional parameters -} - // GovernanceAssignmentsList - Page of a governance assignments list type GovernanceAssignmentsList struct { // READ-ONLY; The URI to fetch the next page @@ -4602,48 +4733,12 @@ type GovernanceRuleProperties struct { // The governance rule metadata Metadata *GovernanceRuleMetadata - // Governance rule remediation timeframe - this is the time that will affect on the grace-period duration e.g. 7.00:00:00 - // - means 7 days - RemediationTimeframe *string - - // READ-ONLY; The tenantId (GUID) - TenantID *string -} - -// GovernanceRulesClientBeginDeleteOptions contains the optional parameters for the GovernanceRulesClient.BeginDelete method. -type GovernanceRulesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GovernanceRulesClientBeginExecuteOptions contains the optional parameters for the GovernanceRulesClient.BeginExecute method. -type GovernanceRulesClientBeginExecuteOptions struct { - // Execute governance rule over a given scope - ExecuteGovernanceRuleParams *ExecuteGovernanceRuleParams - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GovernanceRulesClientCreateOrUpdateOptions contains the optional parameters for the GovernanceRulesClient.CreateOrUpdate -// method. -type GovernanceRulesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// GovernanceRulesClientGetOptions contains the optional parameters for the GovernanceRulesClient.Get method. -type GovernanceRulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// GovernanceRulesClientListOptions contains the optional parameters for the GovernanceRulesClient.NewListPager method. -type GovernanceRulesClientListOptions struct { - // placeholder for future optional parameters -} + // Governance rule remediation timeframe - this is the time that will affect on the grace-period duration e.g. 7.00:00:00 + // - means 7 days + RemediationTimeframe *string -// GovernanceRulesClientOperationResultsOptions contains the optional parameters for the GovernanceRulesClient.OperationResults -// method. -type GovernanceRulesClientOperationResultsOptions struct { - // placeholder for future optional parameters + // READ-ONLY; The tenantId (GUID) + TenantID *string } // HTTPC2DMessagesNotInAllowedRange - Number of cloud to device messages (HTTP protocol) is not in allowed range. @@ -4673,8 +4768,8 @@ type HTTPC2DMessagesNotInAllowedRange struct { // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type HTTPC2DMessagesNotInAllowedRange. func (h *HTTPC2DMessagesNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: h.DisplayName, Description: h.Description, + DisplayName: h.DisplayName, IsEnabled: h.IsEnabled, RuleType: h.RuleType, } @@ -4683,11 +4778,11 @@ func (h *HTTPC2DMessagesNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule // GetThresholdCustomAlertRule implements the ThresholdCustomAlertRuleClassification interface for type HTTPC2DMessagesNotInAllowedRange. func (h *HTTPC2DMessagesNotInAllowedRange) GetThresholdCustomAlertRule() *ThresholdCustomAlertRule { return &ThresholdCustomAlertRule{ - MinThreshold: h.MinThreshold, - MaxThreshold: h.MaxThreshold, - DisplayName: h.DisplayName, Description: h.Description, + DisplayName: h.DisplayName, IsEnabled: h.IsEnabled, + MaxThreshold: h.MaxThreshold, + MinThreshold: h.MinThreshold, RuleType: h.RuleType, } } @@ -4695,13 +4790,13 @@ func (h *HTTPC2DMessagesNotInAllowedRange) GetThresholdCustomAlertRule() *Thresh // GetTimeWindowCustomAlertRule implements the TimeWindowCustomAlertRuleClassification interface for type HTTPC2DMessagesNotInAllowedRange. func (h *HTTPC2DMessagesNotInAllowedRange) GetTimeWindowCustomAlertRule() *TimeWindowCustomAlertRule { return &TimeWindowCustomAlertRule{ - TimeWindowSize: h.TimeWindowSize, - MinThreshold: h.MinThreshold, - MaxThreshold: h.MaxThreshold, - DisplayName: h.DisplayName, Description: h.Description, + DisplayName: h.DisplayName, IsEnabled: h.IsEnabled, + MaxThreshold: h.MaxThreshold, + MinThreshold: h.MinThreshold, RuleType: h.RuleType, + TimeWindowSize: h.TimeWindowSize, } } @@ -4733,8 +4828,8 @@ type HTTPC2DRejectedMessagesNotInAllowedRange struct { // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type HTTPC2DRejectedMessagesNotInAllowedRange. func (h *HTTPC2DRejectedMessagesNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: h.DisplayName, Description: h.Description, + DisplayName: h.DisplayName, IsEnabled: h.IsEnabled, RuleType: h.RuleType, } @@ -4743,11 +4838,11 @@ func (h *HTTPC2DRejectedMessagesNotInAllowedRange) GetCustomAlertRule() *CustomA // GetThresholdCustomAlertRule implements the ThresholdCustomAlertRuleClassification interface for type HTTPC2DRejectedMessagesNotInAllowedRange. func (h *HTTPC2DRejectedMessagesNotInAllowedRange) GetThresholdCustomAlertRule() *ThresholdCustomAlertRule { return &ThresholdCustomAlertRule{ - MinThreshold: h.MinThreshold, - MaxThreshold: h.MaxThreshold, - DisplayName: h.DisplayName, Description: h.Description, + DisplayName: h.DisplayName, IsEnabled: h.IsEnabled, + MaxThreshold: h.MaxThreshold, + MinThreshold: h.MinThreshold, RuleType: h.RuleType, } } @@ -4755,13 +4850,13 @@ func (h *HTTPC2DRejectedMessagesNotInAllowedRange) GetThresholdCustomAlertRule() // GetTimeWindowCustomAlertRule implements the TimeWindowCustomAlertRuleClassification interface for type HTTPC2DRejectedMessagesNotInAllowedRange. func (h *HTTPC2DRejectedMessagesNotInAllowedRange) GetTimeWindowCustomAlertRule() *TimeWindowCustomAlertRule { return &TimeWindowCustomAlertRule{ - TimeWindowSize: h.TimeWindowSize, - MinThreshold: h.MinThreshold, - MaxThreshold: h.MaxThreshold, - DisplayName: h.DisplayName, Description: h.Description, + DisplayName: h.DisplayName, IsEnabled: h.IsEnabled, + MaxThreshold: h.MaxThreshold, + MinThreshold: h.MinThreshold, RuleType: h.RuleType, + TimeWindowSize: h.TimeWindowSize, } } @@ -4792,8 +4887,8 @@ type HTTPD2CMessagesNotInAllowedRange struct { // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type HTTPD2CMessagesNotInAllowedRange. func (h *HTTPD2CMessagesNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: h.DisplayName, Description: h.Description, + DisplayName: h.DisplayName, IsEnabled: h.IsEnabled, RuleType: h.RuleType, } @@ -4802,11 +4897,11 @@ func (h *HTTPD2CMessagesNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule // GetThresholdCustomAlertRule implements the ThresholdCustomAlertRuleClassification interface for type HTTPD2CMessagesNotInAllowedRange. func (h *HTTPD2CMessagesNotInAllowedRange) GetThresholdCustomAlertRule() *ThresholdCustomAlertRule { return &ThresholdCustomAlertRule{ - MinThreshold: h.MinThreshold, - MaxThreshold: h.MaxThreshold, - DisplayName: h.DisplayName, Description: h.Description, + DisplayName: h.DisplayName, IsEnabled: h.IsEnabled, + MaxThreshold: h.MaxThreshold, + MinThreshold: h.MinThreshold, RuleType: h.RuleType, } } @@ -4814,13 +4909,13 @@ func (h *HTTPD2CMessagesNotInAllowedRange) GetThresholdCustomAlertRule() *Thresh // GetTimeWindowCustomAlertRule implements the TimeWindowCustomAlertRuleClassification interface for type HTTPD2CMessagesNotInAllowedRange. func (h *HTTPD2CMessagesNotInAllowedRange) GetTimeWindowCustomAlertRule() *TimeWindowCustomAlertRule { return &TimeWindowCustomAlertRule{ - TimeWindowSize: h.TimeWindowSize, - MinThreshold: h.MinThreshold, - MaxThreshold: h.MaxThreshold, - DisplayName: h.DisplayName, Description: h.Description, + DisplayName: h.DisplayName, IsEnabled: h.IsEnabled, + MaxThreshold: h.MaxThreshold, + MinThreshold: h.MinThreshold, RuleType: h.RuleType, + TimeWindowSize: h.TimeWindowSize, } } @@ -4833,7 +4928,7 @@ type HealthDataClassification struct { Scenario *string // The resource scope of the health report - Scope *ScopeName + Scope *string } // HealthReport - The health report resource @@ -4851,16 +4946,14 @@ type HealthReport struct { Type *string } -// HealthReportClientGetOptions contains the optional parameters for the HealthReportClient.Get method. -type HealthReportClientGetOptions struct { - // placeholder for future optional parameters -} - // HealthReportProperties - Describes properties of the health report type HealthReportProperties struct { // The affected defenders plans by unhealthy report AffectedDefendersPlans []*string + // The affected defenders sub plans by unhealthy report + AffectedDefendersSubPlans []*string + // The environment details of the resource EnvironmentDetails *EnvironmentDetails @@ -4875,11 +4968,10 @@ type HealthReportProperties struct { // The status of the health report Status *StatusAutoGenerated -} -// HealthReportsClientListOptions contains the optional parameters for the HealthReportsClient.NewListPager method. -type HealthReportsClientListOptions struct { - // placeholder for future optional parameters + // READ-ONLY; Additional data for the given health report, this field can include more details on the resource and the health + // scenario. + ReportAdditionalData map[string]*string } // HealthReportsList - Page of health reports list @@ -4952,8 +5044,8 @@ type InformationProtectionAwsOffering struct { // GetCloudOffering implements the CloudOfferingClassification interface for type InformationProtectionAwsOffering. func (i *InformationProtectionAwsOffering) GetCloudOffering() *CloudOffering { return &CloudOffering{ - OfferingType: i.OfferingType, Description: i.Description, + OfferingType: i.OfferingType, } } @@ -4978,24 +5070,6 @@ type InformationProtectionKeyword struct { Pattern *string } -// InformationProtectionPoliciesClientCreateOrUpdateOptions contains the optional parameters for the InformationProtectionPoliciesClient.CreateOrUpdate -// method. -type InformationProtectionPoliciesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// InformationProtectionPoliciesClientGetOptions contains the optional parameters for the InformationProtectionPoliciesClient.Get -// method. -type InformationProtectionPoliciesClientGetOptions struct { - // placeholder for future optional parameters -} - -// InformationProtectionPoliciesClientListOptions contains the optional parameters for the InformationProtectionPoliciesClient.NewListPager -// method. -type InformationProtectionPoliciesClientListOptions struct { - // placeholder for future optional parameters -} - // InformationProtectionPolicy - Information protection policy. type InformationProtectionPolicy struct { // Information protection policy data @@ -5059,76 +5133,6 @@ type InformationType struct { RecommendedLabelID *string } -// IngestionConnectionString - Connection string for ingesting security data and logs -type IngestionConnectionString struct { - // READ-ONLY; The region where ingested logs and data resides - Location *string - - // READ-ONLY; Connection string value - Value *string -} - -// IngestionSetting - Configures how to correlate scan data and logs with resources associated with the subscription. -type IngestionSetting struct { - // Ingestion setting data - Properties any - - // READ-ONLY; Resource Id - ID *string - - // READ-ONLY; Resource name - Name *string - - // READ-ONLY; Resource type - Type *string -} - -// IngestionSettingList - List of ingestion settings -type IngestionSettingList struct { - // READ-ONLY; The URI to fetch the next page. - NextLink *string - - // READ-ONLY; List of ingestion settings - Value []*IngestionSetting -} - -// IngestionSettingToken - Configures how to correlate scan data and logs with resources associated with the subscription. -type IngestionSettingToken struct { - // READ-ONLY; The token is used for correlating security data and logs with the resources in the subscription. - Token *string -} - -// IngestionSettingsClientCreateOptions contains the optional parameters for the IngestionSettingsClient.Create method. -type IngestionSettingsClientCreateOptions struct { - // placeholder for future optional parameters -} - -// IngestionSettingsClientDeleteOptions contains the optional parameters for the IngestionSettingsClient.Delete method. -type IngestionSettingsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// IngestionSettingsClientGetOptions contains the optional parameters for the IngestionSettingsClient.Get method. -type IngestionSettingsClientGetOptions struct { - // placeholder for future optional parameters -} - -// IngestionSettingsClientListConnectionStringsOptions contains the optional parameters for the IngestionSettingsClient.ListConnectionStrings -// method. -type IngestionSettingsClientListConnectionStringsOptions struct { - // placeholder for future optional parameters -} - -// IngestionSettingsClientListOptions contains the optional parameters for the IngestionSettingsClient.NewListPager method. -type IngestionSettingsClientListOptions struct { - // placeholder for future optional parameters -} - -// IngestionSettingsClientListTokensOptions contains the optional parameters for the IngestionSettingsClient.ListTokens method. -type IngestionSettingsClientListTokensOptions struct { - // placeholder for future optional parameters -} - // IoTSecurityAggregatedAlert - Security Solution Aggregated Alert information type IoTSecurityAggregatedAlert struct { // IoT Security solution aggregated alert details. @@ -5437,85 +5441,6 @@ type IoTSeverityMetrics struct { Medium *int64 } -// IotSecuritySolutionAnalyticsClientGetOptions contains the optional parameters for the IotSecuritySolutionAnalyticsClient.Get -// method. -type IotSecuritySolutionAnalyticsClientGetOptions struct { - // placeholder for future optional parameters -} - -// IotSecuritySolutionAnalyticsClientListOptions contains the optional parameters for the IotSecuritySolutionAnalyticsClient.List -// method. -type IotSecuritySolutionAnalyticsClientListOptions struct { - // placeholder for future optional parameters -} - -// IotSecuritySolutionClientCreateOrUpdateOptions contains the optional parameters for the IotSecuritySolutionClient.CreateOrUpdate -// method. -type IotSecuritySolutionClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// IotSecuritySolutionClientDeleteOptions contains the optional parameters for the IotSecuritySolutionClient.Delete method. -type IotSecuritySolutionClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// IotSecuritySolutionClientGetOptions contains the optional parameters for the IotSecuritySolutionClient.Get method. -type IotSecuritySolutionClientGetOptions struct { - // placeholder for future optional parameters -} - -// IotSecuritySolutionClientListByResourceGroupOptions contains the optional parameters for the IotSecuritySolutionClient.NewListByResourceGroupPager -// method. -type IotSecuritySolutionClientListByResourceGroupOptions struct { - // Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - Filter *string -} - -// IotSecuritySolutionClientListBySubscriptionOptions contains the optional parameters for the IotSecuritySolutionClient.NewListBySubscriptionPager -// method. -type IotSecuritySolutionClientListBySubscriptionOptions struct { - // Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. - Filter *string -} - -// IotSecuritySolutionClientUpdateOptions contains the optional parameters for the IotSecuritySolutionClient.Update method. -type IotSecuritySolutionClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// IotSecuritySolutionsAnalyticsAggregatedAlertClientDismissOptions contains the optional parameters for the IotSecuritySolutionsAnalyticsAggregatedAlertClient.Dismiss -// method. -type IotSecuritySolutionsAnalyticsAggregatedAlertClientDismissOptions struct { - // placeholder for future optional parameters -} - -// IotSecuritySolutionsAnalyticsAggregatedAlertClientGetOptions contains the optional parameters for the IotSecuritySolutionsAnalyticsAggregatedAlertClient.Get -// method. -type IotSecuritySolutionsAnalyticsAggregatedAlertClientGetOptions struct { - // placeholder for future optional parameters -} - -// IotSecuritySolutionsAnalyticsAggregatedAlertClientListOptions contains the optional parameters for the IotSecuritySolutionsAnalyticsAggregatedAlertClient.NewListPager -// method. -type IotSecuritySolutionsAnalyticsAggregatedAlertClientListOptions struct { - // Number of results to retrieve. - Top *int32 -} - -// IotSecuritySolutionsAnalyticsRecommendationClientGetOptions contains the optional parameters for the IotSecuritySolutionsAnalyticsRecommendationClient.Get -// method. -type IotSecuritySolutionsAnalyticsRecommendationClientGetOptions struct { - // placeholder for future optional parameters -} - -// IotSecuritySolutionsAnalyticsRecommendationClientListOptions contains the optional parameters for the IotSecuritySolutionsAnalyticsRecommendationClient.NewListPager -// method. -type IotSecuritySolutionsAnalyticsRecommendationClientListOptions struct { - // Number of results to retrieve. - Top *int32 -} - // Issue - The issue that caused the resource to by unhealthy type Issue struct { // REQUIRED; The unique issue key @@ -5541,53 +5466,6 @@ type Issue struct { SecurityValues []*string } -// JitNetworkAccessPoliciesClientCreateOrUpdateOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.CreateOrUpdate -// method. -type JitNetworkAccessPoliciesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// JitNetworkAccessPoliciesClientDeleteOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.Delete -// method. -type JitNetworkAccessPoliciesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// JitNetworkAccessPoliciesClientGetOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.Get method. -type JitNetworkAccessPoliciesClientGetOptions struct { - // placeholder for future optional parameters -} - -// JitNetworkAccessPoliciesClientInitiateOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.Initiate -// method. -type JitNetworkAccessPoliciesClientInitiateOptions struct { - // placeholder for future optional parameters -} - -// JitNetworkAccessPoliciesClientListByRegionOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.NewListByRegionPager -// method. -type JitNetworkAccessPoliciesClientListByRegionOptions struct { - // placeholder for future optional parameters -} - -// JitNetworkAccessPoliciesClientListByResourceGroupAndRegionOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.NewListByResourceGroupAndRegionPager -// method. -type JitNetworkAccessPoliciesClientListByResourceGroupAndRegionOptions struct { - // placeholder for future optional parameters -} - -// JitNetworkAccessPoliciesClientListByResourceGroupOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.NewListByResourceGroupPager -// method. -type JitNetworkAccessPoliciesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// JitNetworkAccessPoliciesClientListOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.NewListPager -// method. -type JitNetworkAccessPoliciesClientListOptions struct { - // placeholder for future optional parameters -} - type JitNetworkAccessPoliciesList struct { Value []*JitNetworkAccessPolicy @@ -5744,17 +5622,6 @@ type Label struct { Order *float32 } -// ListCustomAlertRuleClassification provides polymorphic access to related types. -// Call the interface's GetListCustomAlertRule() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AllowlistCustomAlertRule, *ConnectionFromIPNotAllowed, *ConnectionToIPNotAllowed, *DenylistCustomAlertRule, *ListCustomAlertRule, -// - *LocalUserNotAllowed, *ProcessNotAllowed -type ListCustomAlertRuleClassification interface { - CustomAlertRuleClassification - // GetListCustomAlertRule returns the ListCustomAlertRule content of the underlying type. - GetListCustomAlertRule() *ListCustomAlertRule -} - // ListCustomAlertRule - A List custom alert rule. type ListCustomAlertRule struct { // REQUIRED; Status of the custom alert. @@ -5776,8 +5643,8 @@ type ListCustomAlertRule struct { // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type ListCustomAlertRule. func (l *ListCustomAlertRule) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: l.DisplayName, Description: l.Description, + DisplayName: l.DisplayName, IsEnabled: l.IsEnabled, RuleType: l.RuleType, } @@ -5811,19 +5678,19 @@ type LocalUserNotAllowed struct { func (l *LocalUserNotAllowed) GetAllowlistCustomAlertRule() *AllowlistCustomAlertRule { return &AllowlistCustomAlertRule{ AllowlistValues: l.AllowlistValues, - ValueType: l.ValueType, - DisplayName: l.DisplayName, Description: l.Description, + DisplayName: l.DisplayName, IsEnabled: l.IsEnabled, RuleType: l.RuleType, + ValueType: l.ValueType, } } // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type LocalUserNotAllowed. func (l *LocalUserNotAllowed) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: l.DisplayName, Description: l.Description, + DisplayName: l.DisplayName, IsEnabled: l.IsEnabled, RuleType: l.RuleType, } @@ -5832,11 +5699,11 @@ func (l *LocalUserNotAllowed) GetCustomAlertRule() *CustomAlertRule { // GetListCustomAlertRule implements the ListCustomAlertRuleClassification interface for type LocalUserNotAllowed. func (l *LocalUserNotAllowed) GetListCustomAlertRule() *ListCustomAlertRule { return &ListCustomAlertRule{ - ValueType: l.ValueType, - DisplayName: l.DisplayName, Description: l.Description, + DisplayName: l.DisplayName, IsEnabled: l.IsEnabled, RuleType: l.RuleType, + ValueType: l.ValueType, } } @@ -5846,16 +5713,6 @@ type Location struct { Location *string } -// LocationsClientGetOptions contains the optional parameters for the LocationsClient.Get method. -type LocationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// LocationsClientListOptions contains the optional parameters for the LocationsClient.NewListPager method. -type LocationsClientListOptions struct { - // placeholder for future optional parameters -} - // LogAnalyticsIdentifier - Represents a Log Analytics workspace scope identifier. type LogAnalyticsIdentifier struct { // REQUIRED; There can be multiple identifiers of different type per alert, this field specify the identifier type. @@ -5881,6 +5738,18 @@ func (l *LogAnalyticsIdentifier) GetResourceIdentifier() *ResourceIdentifier { } } +// MalwareScanningProperties - Properties of Malware Scanning. +type MalwareScanningProperties struct { + // Properties of On Upload malware scanning. + OnUpload *OnUploadProperties + + // Optional. Resource id of an Event Grid Topic to send scan results to. + ScanResultsEventGridTopicResourceID *string + + // READ-ONLY; Upon failure or partial success. Additional data describing Malware Scanning enable/disable operation. + OperationStatus *OperationStatusAutoGenerated +} + // MdeOnboardingData - The resource of the configuration or data needed to onboard the machine to MDE type MdeOnboardingData struct { // Properties of the MDE configuration or data parameter needed to onboard the machine to MDE @@ -5913,16 +5782,6 @@ type MdeOnboardingDataProperties struct { OnboardingPackageWindows []byte } -// MdeOnboardingsClientGetOptions contains the optional parameters for the MdeOnboardingsClient.Get method. -type MdeOnboardingsClientGetOptions struct { - // placeholder for future optional parameters -} - -// MdeOnboardingsClientListOptions contains the optional parameters for the MdeOnboardingsClient.List method. -type MdeOnboardingsClientListOptions struct { - // placeholder for future optional parameters -} - // MqttC2DMessagesNotInAllowedRange - Number of cloud to device messages (MQTT protocol) is not in allowed range. type MqttC2DMessagesNotInAllowedRange struct { // REQUIRED; Status of the custom alert. @@ -5950,8 +5809,8 @@ type MqttC2DMessagesNotInAllowedRange struct { // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type MqttC2DMessagesNotInAllowedRange. func (m *MqttC2DMessagesNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: m.DisplayName, Description: m.Description, + DisplayName: m.DisplayName, IsEnabled: m.IsEnabled, RuleType: m.RuleType, } @@ -5960,11 +5819,11 @@ func (m *MqttC2DMessagesNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule // GetThresholdCustomAlertRule implements the ThresholdCustomAlertRuleClassification interface for type MqttC2DMessagesNotInAllowedRange. func (m *MqttC2DMessagesNotInAllowedRange) GetThresholdCustomAlertRule() *ThresholdCustomAlertRule { return &ThresholdCustomAlertRule{ - MinThreshold: m.MinThreshold, - MaxThreshold: m.MaxThreshold, - DisplayName: m.DisplayName, Description: m.Description, + DisplayName: m.DisplayName, IsEnabled: m.IsEnabled, + MaxThreshold: m.MaxThreshold, + MinThreshold: m.MinThreshold, RuleType: m.RuleType, } } @@ -5972,13 +5831,13 @@ func (m *MqttC2DMessagesNotInAllowedRange) GetThresholdCustomAlertRule() *Thresh // GetTimeWindowCustomAlertRule implements the TimeWindowCustomAlertRuleClassification interface for type MqttC2DMessagesNotInAllowedRange. func (m *MqttC2DMessagesNotInAllowedRange) GetTimeWindowCustomAlertRule() *TimeWindowCustomAlertRule { return &TimeWindowCustomAlertRule{ - TimeWindowSize: m.TimeWindowSize, - MinThreshold: m.MinThreshold, - MaxThreshold: m.MaxThreshold, - DisplayName: m.DisplayName, Description: m.Description, + DisplayName: m.DisplayName, IsEnabled: m.IsEnabled, + MaxThreshold: m.MaxThreshold, + MinThreshold: m.MinThreshold, RuleType: m.RuleType, + TimeWindowSize: m.TimeWindowSize, } } @@ -6010,8 +5869,8 @@ type MqttC2DRejectedMessagesNotInAllowedRange struct { // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type MqttC2DRejectedMessagesNotInAllowedRange. func (m *MqttC2DRejectedMessagesNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: m.DisplayName, Description: m.Description, + DisplayName: m.DisplayName, IsEnabled: m.IsEnabled, RuleType: m.RuleType, } @@ -6020,11 +5879,11 @@ func (m *MqttC2DRejectedMessagesNotInAllowedRange) GetCustomAlertRule() *CustomA // GetThresholdCustomAlertRule implements the ThresholdCustomAlertRuleClassification interface for type MqttC2DRejectedMessagesNotInAllowedRange. func (m *MqttC2DRejectedMessagesNotInAllowedRange) GetThresholdCustomAlertRule() *ThresholdCustomAlertRule { return &ThresholdCustomAlertRule{ - MinThreshold: m.MinThreshold, - MaxThreshold: m.MaxThreshold, - DisplayName: m.DisplayName, Description: m.Description, + DisplayName: m.DisplayName, IsEnabled: m.IsEnabled, + MaxThreshold: m.MaxThreshold, + MinThreshold: m.MinThreshold, RuleType: m.RuleType, } } @@ -6032,13 +5891,13 @@ func (m *MqttC2DRejectedMessagesNotInAllowedRange) GetThresholdCustomAlertRule() // GetTimeWindowCustomAlertRule implements the TimeWindowCustomAlertRuleClassification interface for type MqttC2DRejectedMessagesNotInAllowedRange. func (m *MqttC2DRejectedMessagesNotInAllowedRange) GetTimeWindowCustomAlertRule() *TimeWindowCustomAlertRule { return &TimeWindowCustomAlertRule{ - TimeWindowSize: m.TimeWindowSize, - MinThreshold: m.MinThreshold, - MaxThreshold: m.MaxThreshold, - DisplayName: m.DisplayName, Description: m.Description, + DisplayName: m.DisplayName, IsEnabled: m.IsEnabled, + MaxThreshold: m.MaxThreshold, + MinThreshold: m.MinThreshold, RuleType: m.RuleType, + TimeWindowSize: m.TimeWindowSize, } } @@ -6069,8 +5928,8 @@ type MqttD2CMessagesNotInAllowedRange struct { // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type MqttD2CMessagesNotInAllowedRange. func (m *MqttD2CMessagesNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: m.DisplayName, Description: m.Description, + DisplayName: m.DisplayName, IsEnabled: m.IsEnabled, RuleType: m.RuleType, } @@ -6079,11 +5938,11 @@ func (m *MqttD2CMessagesNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule // GetThresholdCustomAlertRule implements the ThresholdCustomAlertRuleClassification interface for type MqttD2CMessagesNotInAllowedRange. func (m *MqttD2CMessagesNotInAllowedRange) GetThresholdCustomAlertRule() *ThresholdCustomAlertRule { return &ThresholdCustomAlertRule{ - MinThreshold: m.MinThreshold, - MaxThreshold: m.MaxThreshold, - DisplayName: m.DisplayName, Description: m.Description, + DisplayName: m.DisplayName, IsEnabled: m.IsEnabled, + MaxThreshold: m.MaxThreshold, + MinThreshold: m.MinThreshold, RuleType: m.RuleType, } } @@ -6091,26 +5950,16 @@ func (m *MqttD2CMessagesNotInAllowedRange) GetThresholdCustomAlertRule() *Thresh // GetTimeWindowCustomAlertRule implements the TimeWindowCustomAlertRuleClassification interface for type MqttD2CMessagesNotInAllowedRange. func (m *MqttD2CMessagesNotInAllowedRange) GetTimeWindowCustomAlertRule() *TimeWindowCustomAlertRule { return &TimeWindowCustomAlertRule{ - TimeWindowSize: m.TimeWindowSize, - MinThreshold: m.MinThreshold, - MaxThreshold: m.MaxThreshold, - DisplayName: m.DisplayName, Description: m.Description, + DisplayName: m.DisplayName, IsEnabled: m.IsEnabled, + MaxThreshold: m.MaxThreshold, + MinThreshold: m.MinThreshold, RuleType: m.RuleType, + TimeWindowSize: m.TimeWindowSize, } } -// OnPremiseResourceDetailsClassification provides polymorphic access to related types. -// Call the interface's GetOnPremiseResourceDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *OnPremiseResourceDetails, *OnPremiseSQLResourceDetails -type OnPremiseResourceDetailsClassification interface { - ResourceDetailsClassification - // GetOnPremiseResourceDetails returns the OnPremiseResourceDetails content of the underlying type. - GetOnPremiseResourceDetails() *OnPremiseResourceDetails -} - // OnPremiseResourceDetails - Details of the On Premise resource that was assessed type OnPremiseResourceDetails struct { // REQUIRED; The name of the machine @@ -6166,11 +6015,11 @@ type OnPremiseSQLResourceDetails struct { // GetOnPremiseResourceDetails implements the OnPremiseResourceDetailsClassification interface for type OnPremiseSQLResourceDetails. func (o *OnPremiseSQLResourceDetails) GetOnPremiseResourceDetails() *OnPremiseResourceDetails { return &OnPremiseResourceDetails{ - WorkspaceID: o.WorkspaceID, - Vmuuid: o.Vmuuid, - SourceComputerID: o.SourceComputerID, MachineName: o.MachineName, Source: o.Source, + SourceComputerID: o.SourceComputerID, + Vmuuid: o.Vmuuid, + WorkspaceID: o.WorkspaceID, } } @@ -6181,6 +6030,15 @@ 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. + CapGBPerMonth *int32 + + // Indicates whether On Upload malware scanning should be enabled. + IsEnabled *bool +} + // Operation - Possible operation in the REST API of Microsoft.Security type Operation struct { // Security operation display @@ -6223,18 +6081,49 @@ type OperationResultAutoGenerated struct { Status *OperationResult } -// OperationStatus - A status describing the success/failure of the extension's enablement/disablement operation. -type OperationStatus struct { - // The operation status code. - Code *Code +// OperationStatus - A status describing the success/failure of the extension's enablement/disablement operation. +type OperationStatus struct { + // The operation status code. + Code *Code + + // Additional information regarding the success/failure of the operation. + Message *string +} + +// OperationStatusAutoGenerated - A status describing the success/failure of the enablement/disablement operation. +type OperationStatusAutoGenerated struct { + // The operation status code. + Code *string + + // Additional information regarding the success/failure of the operation. + Message *string +} + +// OperationStatusResult - The current status of an async operation. +type OperationStatusResult struct { + // REQUIRED; Operation status. + Status *string + + // The end time of the operation. + EndTime *time.Time + + // If present, details of the operation error. + Error *ErrorDetailAutoGenerated + + // Fully qualified ID for the async operation. + ID *string + + // Name of the async operation. + Name *string + + // The operations list. + Operations []*OperationStatusResult - // Additional information regarding the success/failure of the operation. - Message *string -} + // Percent of the operation that is complete. + PercentComplete *float32 -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters + // The start time of the operation. + StartTime *time.Time } // OperatorList - List of SecurityOperator response. @@ -6258,26 +6147,6 @@ type OperatorResource struct { Type *string } -// OperatorsClientCreateOrUpdateOptions contains the optional parameters for the OperatorsClient.CreateOrUpdate method. -type OperatorsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// OperatorsClientDeleteOptions contains the optional parameters for the OperatorsClient.Delete method. -type OperatorsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// OperatorsClientGetOptions contains the optional parameters for the OperatorsClient.Get method. -type OperatorsClientGetOptions struct { - // placeholder for future optional parameters -} - -// OperatorsClientListOptions contains the optional parameters for the OperatorsClient.List method. -type OperatorsClientListOptions struct { - // placeholder for future optional parameters -} - // PathRecommendation - Represents a path that is recommended to be allowed and its properties type PathRecommendation struct { // The recommendation action of the machine or rule @@ -6354,21 +6223,6 @@ type PricingProperties struct { ReplacedBy []*string } -// PricingsClientGetOptions contains the optional parameters for the PricingsClient.Get method. -type PricingsClientGetOptions struct { - // placeholder for future optional parameters -} - -// PricingsClientListOptions contains the optional parameters for the PricingsClient.List method. -type PricingsClientListOptions struct { - // placeholder for future optional parameters -} - -// PricingsClientUpdateOptions contains the optional parameters for the PricingsClient.Update method. -type PricingsClientUpdateOptions struct { - // placeholder for future optional parameters -} - // ProcessNotAllowed - Execution of a process that isn't allowed. Allow list consists of process names to allow. type ProcessNotAllowed struct { // REQUIRED; The values to allow. The format of the values depends on the rule type. @@ -6394,19 +6248,19 @@ type ProcessNotAllowed struct { func (p *ProcessNotAllowed) GetAllowlistCustomAlertRule() *AllowlistCustomAlertRule { return &AllowlistCustomAlertRule{ AllowlistValues: p.AllowlistValues, - ValueType: p.ValueType, - DisplayName: p.DisplayName, Description: p.Description, + DisplayName: p.DisplayName, IsEnabled: p.IsEnabled, RuleType: p.RuleType, + ValueType: p.ValueType, } } // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type ProcessNotAllowed. func (p *ProcessNotAllowed) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: p.DisplayName, Description: p.Description, + DisplayName: p.DisplayName, IsEnabled: p.IsEnabled, RuleType: p.RuleType, } @@ -6415,11 +6269,11 @@ func (p *ProcessNotAllowed) GetCustomAlertRule() *CustomAlertRule { // GetListCustomAlertRule implements the ListCustomAlertRuleClassification interface for type ProcessNotAllowed. func (p *ProcessNotAllowed) GetListCustomAlertRule() *ListCustomAlertRule { return &ListCustomAlertRule{ - ValueType: p.ValueType, - DisplayName: p.DisplayName, Description: p.Description, + DisplayName: p.DisplayName, IsEnabled: p.IsEnabled, RuleType: p.RuleType, + ValueType: p.ValueType, } } @@ -6439,6 +6293,19 @@ type ProtectionMode struct { 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 { + // 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; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + // ProxyServerProperties - For a non-Azure machine that is not connected directly to the internet, specify a proxy server // that the non-Azure machine can use. type ProxyServerProperties struct { @@ -6504,8 +6371,8 @@ type QueuePurgesNotInAllowedRange struct { // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type QueuePurgesNotInAllowedRange. func (q *QueuePurgesNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: q.DisplayName, Description: q.Description, + DisplayName: q.DisplayName, IsEnabled: q.IsEnabled, RuleType: q.RuleType, } @@ -6514,11 +6381,11 @@ func (q *QueuePurgesNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule { // GetThresholdCustomAlertRule implements the ThresholdCustomAlertRuleClassification interface for type QueuePurgesNotInAllowedRange. func (q *QueuePurgesNotInAllowedRange) GetThresholdCustomAlertRule() *ThresholdCustomAlertRule { return &ThresholdCustomAlertRule{ - MinThreshold: q.MinThreshold, - MaxThreshold: q.MaxThreshold, - DisplayName: q.DisplayName, Description: q.Description, + DisplayName: q.DisplayName, IsEnabled: q.IsEnabled, + MaxThreshold: q.MaxThreshold, + MinThreshold: q.MinThreshold, RuleType: q.RuleType, } } @@ -6526,13 +6393,13 @@ func (q *QueuePurgesNotInAllowedRange) GetThresholdCustomAlertRule() *ThresholdC // GetTimeWindowCustomAlertRule implements the TimeWindowCustomAlertRuleClassification interface for type QueuePurgesNotInAllowedRange. func (q *QueuePurgesNotInAllowedRange) GetTimeWindowCustomAlertRule() *TimeWindowCustomAlertRule { return &TimeWindowCustomAlertRule{ - TimeWindowSize: q.TimeWindowSize, - MinThreshold: q.MinThreshold, - MaxThreshold: q.MaxThreshold, - DisplayName: q.DisplayName, Description: q.Description, + DisplayName: q.DisplayName, IsEnabled: q.IsEnabled, + MaxThreshold: q.MaxThreshold, + MinThreshold: q.MinThreshold, RuleType: q.RuleType, + TimeWindowSize: q.TimeWindowSize, } } @@ -6599,19 +6466,6 @@ type RegulatoryComplianceAssessmentProperties struct { UnsupportedResources *int32 } -// RegulatoryComplianceAssessmentsClientGetOptions contains the optional parameters for the RegulatoryComplianceAssessmentsClient.Get -// method. -type RegulatoryComplianceAssessmentsClientGetOptions struct { - // placeholder for future optional parameters -} - -// RegulatoryComplianceAssessmentsClientListOptions contains the optional parameters for the RegulatoryComplianceAssessmentsClient.NewListPager -// method. -type RegulatoryComplianceAssessmentsClientListOptions struct { - // OData filter. Optional. - Filter *string -} - // RegulatoryComplianceControl - Regulatory compliance control details and state type RegulatoryComplianceControl struct { // Regulatory compliance control data @@ -6654,19 +6508,6 @@ type RegulatoryComplianceControlProperties struct { SkippedAssessments *int32 } -// RegulatoryComplianceControlsClientGetOptions contains the optional parameters for the RegulatoryComplianceControlsClient.Get -// method. -type RegulatoryComplianceControlsClientGetOptions struct { - // placeholder for future optional parameters -} - -// RegulatoryComplianceControlsClientListOptions contains the optional parameters for the RegulatoryComplianceControlsClient.NewListPager -// method. -type RegulatoryComplianceControlsClientListOptions struct { - // OData filter. Optional. - Filter *string -} - // RegulatoryComplianceStandard - Regulatory compliance standard details and state type RegulatoryComplianceStandard struct { // Regulatory compliance standard data @@ -6709,19 +6550,6 @@ type RegulatoryComplianceStandardProperties struct { UnsupportedControls *int32 } -// RegulatoryComplianceStandardsClientGetOptions contains the optional parameters for the RegulatoryComplianceStandardsClient.Get -// method. -type RegulatoryComplianceStandardsClientGetOptions struct { - // placeholder for future optional parameters -} - -// RegulatoryComplianceStandardsClientListOptions contains the optional parameters for the RegulatoryComplianceStandardsClient.NewListPager -// method. -type RegulatoryComplianceStandardsClientListOptions struct { - // OData filter. Optional. - Filter *string -} - // Remediation details. type Remediation struct { // Is remediation automated. @@ -6758,13 +6586,31 @@ type Resource struct { Type *string } -// ResourceDetailsClassification provides polymorphic access to related types. -// Call the interface's GetResourceDetails() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureResourceDetails, *OnPremiseResourceDetails, *OnPremiseSQLResourceDetails, *ResourceDetails -type ResourceDetailsClassification interface { - // GetResourceDetails returns the ResourceDetails content of the underlying type. - GetResourceDetails() *ResourceDetails +// 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. 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. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string } // ResourceDetails - Details of the resource that was assessed @@ -6788,15 +6634,6 @@ type ResourceDetailsAutoGenerated struct { ID *string } -// ResourceIdentifierClassification provides polymorphic access to related types. -// Call the interface's GetResourceIdentifier() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureResourceIdentifier, *LogAnalyticsIdentifier, *ResourceIdentifier -type ResourceIdentifierClassification interface { - // GetResourceIdentifier returns the ResourceIdentifier content of the underlying type. - GetResourceIdentifier() *ResourceIdentifier -} - // ResourceIdentifier - A resource identifier for an alert which can be used to direct the alert to the right product exposure // group (tenant, workspace, subscription etc.). type ResourceIdentifier struct { @@ -6890,62 +6727,6 @@ func (s *SQLServerVulnerabilityProperties) GetAdditionalData() *AdditionalData { } } -// SQLVulnerabilityAssessmentBaselineRulesClientAddOptions contains the optional parameters for the SQLVulnerabilityAssessmentBaselineRulesClient.Add -// method. -type SQLVulnerabilityAssessmentBaselineRulesClientAddOptions struct { - // The baseline rules. - Body *RulesResultsInput -} - -// SQLVulnerabilityAssessmentBaselineRulesClientCreateOrUpdateOptions contains the optional parameters for the SQLVulnerabilityAssessmentBaselineRulesClient.CreateOrUpdate -// method. -type SQLVulnerabilityAssessmentBaselineRulesClientCreateOrUpdateOptions struct { - // The baseline results for this rule. - Body *RuleResultsInput -} - -// SQLVulnerabilityAssessmentBaselineRulesClientDeleteOptions contains the optional parameters for the SQLVulnerabilityAssessmentBaselineRulesClient.Delete -// method. -type SQLVulnerabilityAssessmentBaselineRulesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// SQLVulnerabilityAssessmentBaselineRulesClientGetOptions contains the optional parameters for the SQLVulnerabilityAssessmentBaselineRulesClient.Get -// method. -type SQLVulnerabilityAssessmentBaselineRulesClientGetOptions struct { - // placeholder for future optional parameters -} - -// SQLVulnerabilityAssessmentBaselineRulesClientListOptions contains the optional parameters for the SQLVulnerabilityAssessmentBaselineRulesClient.List -// method. -type SQLVulnerabilityAssessmentBaselineRulesClientListOptions struct { - // placeholder for future optional parameters -} - -// SQLVulnerabilityAssessmentScanResultsClientGetOptions contains the optional parameters for the SQLVulnerabilityAssessmentScanResultsClient.Get -// method. -type SQLVulnerabilityAssessmentScanResultsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SQLVulnerabilityAssessmentScanResultsClientListOptions contains the optional parameters for the SQLVulnerabilityAssessmentScanResultsClient.List -// method. -type SQLVulnerabilityAssessmentScanResultsClientListOptions struct { - // placeholder for future optional parameters -} - -// SQLVulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the SQLVulnerabilityAssessmentScansClient.Get -// method. -type SQLVulnerabilityAssessmentScansClientGetOptions struct { - // placeholder for future optional parameters -} - -// SQLVulnerabilityAssessmentScansClientListOptions contains the optional parameters for the SQLVulnerabilityAssessmentScansClient.List -// method. -type SQLVulnerabilityAssessmentScansClientListOptions struct { - // placeholder for future optional parameters -} - // Scan - A vulnerability assessment scan record. type Scan struct { // A vulnerability assessment scan record properties. @@ -7129,18 +6910,6 @@ type SecureScoreControlDefinitionSource struct { SourceType *ControlType } -// SecureScoreControlDefinitionsClientListBySubscriptionOptions contains the optional parameters for the SecureScoreControlDefinitionsClient.NewListBySubscriptionPager -// method. -type SecureScoreControlDefinitionsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// SecureScoreControlDefinitionsClientListOptions contains the optional parameters for the SecureScoreControlDefinitionsClient.NewListPager -// method. -type SecureScoreControlDefinitionsClientListOptions struct { - // placeholder for future optional parameters -} - // SecureScoreControlDetails - Details of the security control, its score, and the health status of the relevant resources. type SecureScoreControlDetails struct { // Calculation result data in control level @@ -7203,19 +6972,6 @@ type SecureScoreControlScoreDetails struct { Weight *int64 } -// SecureScoreControlsClientListBySecureScoreOptions contains the optional parameters for the SecureScoreControlsClient.NewListBySecureScorePager -// method. -type SecureScoreControlsClientListBySecureScoreOptions struct { - // OData expand. Optional. - Expand *ExpandControlsEnum -} - -// SecureScoreControlsClientListOptions contains the optional parameters for the SecureScoreControlsClient.NewListPager method. -type SecureScoreControlsClientListOptions struct { - // OData expand. Optional. - Expand *ExpandControlsEnum -} - // SecureScoreItem - Secure score item data model type SecureScoreItem struct { // READ-ONLY; Resource Id @@ -7243,16 +6999,6 @@ type SecureScoreItemProperties struct { Weight *int64 } -// SecureScoresClientGetOptions contains the optional parameters for the SecureScoresClient.Get method. -type SecureScoresClientGetOptions struct { - // placeholder for future optional parameters -} - -// SecureScoresClientListOptions contains the optional parameters for the SecureScoresClient.NewListPager method. -type SecureScoresClientListOptions struct { - // placeholder for future optional parameters -} - // SecureScoresList - List of secure scores type SecureScoresList struct { // READ-ONLY; The URI to fetch the next page. @@ -7262,6 +7008,15 @@ type SecureScoresList struct { Value []*SecureScoreItem } +// SensitiveDataDiscoveryProperties - Properties of Sensitive Data Discovery. +type SensitiveDataDiscoveryProperties struct { + // Indicates whether Sensitive Data Discovery should be enabled. + IsEnabled *bool + + // READ-ONLY; Upon failure or partial success. Additional data describing Sensitive Data Discovery enable/disable operation. + OperationStatus *OperationStatusAutoGenerated +} + // SensitivityLabel - The sensitivity label. type SensitivityLabel struct { // The description of the sensitivity label. @@ -7280,11 +7035,6 @@ type SensitivityLabel struct { Rank *Rank } -// SensitivitySettingsClientListOptions contains the optional parameters for the SensitivitySettingsClient.List method. -type SensitivitySettingsClientListOptions struct { - // placeholder for future optional parameters -} - // ServerVulnerabilityAssessment - Describes the server vulnerability assessment details on a resource type ServerVulnerabilityAssessment struct { // describes ServerVulnerabilityAssessment properties. @@ -7300,40 +7050,55 @@ type ServerVulnerabilityAssessment struct { Type *string } -// ServerVulnerabilityAssessmentClientBeginDeleteOptions contains the optional parameters for the ServerVulnerabilityAssessmentClient.BeginDelete -// method. -type ServerVulnerabilityAssessmentClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string +// ServerVulnerabilityAssessmentProperties - describes ServerVulnerabilityAssessment properties. +type ServerVulnerabilityAssessmentProperties struct { + // READ-ONLY; The provisioningState of the vulnerability assessment capability on the VM + ProvisioningState *ServerVulnerabilityAssessmentPropertiesProvisioningState } -// ServerVulnerabilityAssessmentClientCreateOrUpdateOptions contains the optional parameters for the ServerVulnerabilityAssessmentClient.CreateOrUpdate -// method. -type ServerVulnerabilityAssessmentClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters +// ServerVulnerabilityAssessmentsAzureSettingProperties - Describes the vulnerability assessments setting properties on Azure +// servers in the defined scope. +type ServerVulnerabilityAssessmentsAzureSettingProperties struct { + // REQUIRED; The selected vulnerability assessments provider on Azure servers in the defined scope. + SelectedProvider *ServerVulnerabilityAssessmentsAzureSettingSelectedProvider } -// ServerVulnerabilityAssessmentClientGetOptions contains the optional parameters for the ServerVulnerabilityAssessmentClient.Get -// method. -type ServerVulnerabilityAssessmentClientGetOptions struct { - // placeholder for future optional parameters +// ServerVulnerabilityAssessmentsList - List of server vulnerability assessments +type ServerVulnerabilityAssessmentsList struct { + Value []*ServerVulnerabilityAssessment } -// ServerVulnerabilityAssessmentClientListByExtendedResourceOptions contains the optional parameters for the ServerVulnerabilityAssessmentClient.ListByExtendedResource -// method. -type ServerVulnerabilityAssessmentClientListByExtendedResourceOptions struct { - // placeholder for future optional parameters +// ServerVulnerabilityAssessmentsSetting - A base vulnerability assessments setting on servers in the defined scope. +type ServerVulnerabilityAssessmentsSetting struct { + // REQUIRED; The kind of the server vulnerability assessments setting. + Kind *ServerVulnerabilityAssessmentsSettingKind + + // 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 } -// ServerVulnerabilityAssessmentProperties - describes ServerVulnerabilityAssessment properties. -type ServerVulnerabilityAssessmentProperties struct { - // READ-ONLY; The provisioningState of the vulnerability assessment capability on the VM - ProvisioningState *ServerVulnerabilityAssessmentPropertiesProvisioningState +// GetServerVulnerabilityAssessmentsSetting implements the ServerVulnerabilityAssessmentsSettingClassification interface for +// type ServerVulnerabilityAssessmentsSetting. +func (s *ServerVulnerabilityAssessmentsSetting) GetServerVulnerabilityAssessmentsSetting() *ServerVulnerabilityAssessmentsSetting { + return s } -// ServerVulnerabilityAssessmentsList - List of server vulnerability assessments -type ServerVulnerabilityAssessmentsList struct { - Value []*ServerVulnerabilityAssessment +// ServerVulnerabilityAssessmentsSettingsList - A page of a server vulnerability assessments settings list +type ServerVulnerabilityAssessmentsSettingsList struct { + // READ-ONLY; The URI to fetch the next page + NextLink *string + + // READ-ONLY; A collection of server vulnerability assessments settings in this page + Value []ServerVulnerabilityAssessmentsSettingClassification } // ServerVulnerabilityProperties - Additional context fields for server vulnerability assessment @@ -7380,15 +7145,6 @@ type ServicePrincipalProperties struct { Secret *string } -// SettingClassification provides polymorphic access to related types. -// Call the interface's GetSetting() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AlertSyncSettings, *DataExportSettings, *Setting -type SettingClassification interface { - // GetSetting returns the Setting content of the underlying type. - GetSetting() *Setting -} - // Setting - The kind of the security setting type Setting struct { // REQUIRED; the kind of the settings string @@ -7407,21 +7163,6 @@ type Setting struct { // GetSetting implements the SettingClassification interface for type Setting. func (s *Setting) GetSetting() *Setting { return s } -// SettingsClientGetOptions contains the optional parameters for the SettingsClient.Get method. -type SettingsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SettingsClientListOptions contains the optional parameters for the SettingsClient.NewListPager method. -type SettingsClientListOptions struct { - // placeholder for future optional parameters -} - -// SettingsClientUpdateOptions contains the optional parameters for the SettingsClient.Update method. -type SettingsClientUpdateOptions struct { - // placeholder for future optional parameters -} - // SettingsList - Subscription settings list. type SettingsList struct { // The settings list. @@ -7446,23 +7187,6 @@ type Software struct { Type *string } -// SoftwareInventoriesClientGetOptions contains the optional parameters for the SoftwareInventoriesClient.Get method. -type SoftwareInventoriesClientGetOptions struct { - // placeholder for future optional parameters -} - -// SoftwareInventoriesClientListByExtendedResourceOptions contains the optional parameters for the SoftwareInventoriesClient.NewListByExtendedResourcePager -// method. -type SoftwareInventoriesClientListByExtendedResourceOptions struct { - // placeholder for future optional parameters -} - -// SoftwareInventoriesClientListBySubscriptionOptions contains the optional parameters for the SoftwareInventoriesClient.NewListBySubscriptionPager -// method. -type SoftwareInventoriesClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - // SoftwareProperties - Software Inventory resource properties type SoftwareProperties struct { // Unique identifier for the virtual machine in the service. @@ -7538,16 +7262,6 @@ type SolutionProperties struct { Template *string } -// SolutionsClientGetOptions contains the optional parameters for the SolutionsClient.Get method. -type SolutionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SolutionsClientListOptions contains the optional parameters for the SolutionsClient.NewListPager method. -type SolutionsClientListOptions struct { - // placeholder for future optional parameters -} - type SolutionsReferenceData struct { // REQUIRED Properties *SolutionsReferenceDataProperties @@ -7565,17 +7279,6 @@ type SolutionsReferenceData struct { Type *string } -// SolutionsReferenceDataClientListByHomeRegionOptions contains the optional parameters for the SolutionsReferenceDataClient.ListByHomeRegion -// method. -type SolutionsReferenceDataClientListByHomeRegionOptions struct { - // placeholder for future optional parameters -} - -// SolutionsReferenceDataClientListOptions contains the optional parameters for the SolutionsReferenceDataClient.List method. -type SolutionsReferenceDataClientListOptions struct { - // placeholder for future optional parameters -} - type SolutionsReferenceDataList struct { Value []*SolutionsReferenceData } @@ -7611,6 +7314,12 @@ type StatusAutoGenerated struct { // READ-ONLY; The date of when the resource of the health report was scanned in the first time FirstEvaluationDate *time.Time + // READ-ONLY; The date of when the resource was scanned in the last time + LastScannedDate *time.Time + + // READ-ONLY; The reason of the given status + Reason *string + // READ-ONLY; The date of when the status of the health report was changed in the last time StatusChangeDate *time.Time } @@ -7687,21 +7396,6 @@ type SubAssessmentStatus struct { Severity *Severity } -// SubAssessmentsClientGetOptions contains the optional parameters for the SubAssessmentsClient.Get method. -type SubAssessmentsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SubAssessmentsClientListAllOptions contains the optional parameters for the SubAssessmentsClient.NewListAllPager method. -type SubAssessmentsClientListAllOptions struct { - // placeholder for future optional parameters -} - -// SubAssessmentsClientListOptions contains the optional parameters for the SubAssessmentsClient.NewListPager method. -type SubAssessmentsClientListOptions struct { - // placeholder for future optional parameters -} - type SuppressionAlertsScope struct { // REQUIRED; All the conditions inside need to be true in order to suppress the alert AllOf []*ScopeElement @@ -7740,6 +7434,17 @@ type TagsResource struct { Tags map[string]*string } +// TargetBranchConfiguration - Repository branch configuration for PR Annotations. +type TargetBranchConfiguration struct { + // Configuration of PR Annotations on default branch. + // Enabled - PR Annotations are enabled on the resource's default branch. Disabled - PR Annotations are disabled on the resource's + // default branch. + AnnotateDefaultBranch *AnnotateDefaultBranchState + + // Gets or sets branches that should have annotations. + BranchNames []*string +} + // Task - Security task that we recommend to do in order to strengthen security type Task struct { // Describes properties of a task. @@ -7791,63 +7496,6 @@ type TaskProperties struct { SubState *string } -// TasksClientGetResourceGroupLevelTaskOptions contains the optional parameters for the TasksClient.GetResourceGroupLevelTask -// method. -type TasksClientGetResourceGroupLevelTaskOptions struct { - // placeholder for future optional parameters -} - -// TasksClientGetSubscriptionLevelTaskOptions contains the optional parameters for the TasksClient.GetSubscriptionLevelTask -// method. -type TasksClientGetSubscriptionLevelTaskOptions struct { - // placeholder for future optional parameters -} - -// TasksClientListByHomeRegionOptions contains the optional parameters for the TasksClient.NewListByHomeRegionPager method. -type TasksClientListByHomeRegionOptions struct { - // OData filter. Optional. - Filter *string -} - -// TasksClientListByResourceGroupOptions contains the optional parameters for the TasksClient.NewListByResourceGroupPager -// method. -type TasksClientListByResourceGroupOptions struct { - // OData filter. Optional. - Filter *string -} - -// TasksClientListOptions contains the optional parameters for the TasksClient.NewListPager method. -type TasksClientListOptions struct { - // OData filter. Optional. - Filter *string -} - -// TasksClientUpdateResourceGroupLevelTaskStateOptions contains the optional parameters for the TasksClient.UpdateResourceGroupLevelTaskState -// method. -type TasksClientUpdateResourceGroupLevelTaskStateOptions struct { - // placeholder for future optional parameters -} - -// TasksClientUpdateSubscriptionLevelTaskStateOptions contains the optional parameters for the TasksClient.UpdateSubscriptionLevelTaskState -// method. -type TasksClientUpdateSubscriptionLevelTaskStateOptions struct { - // placeholder for future optional parameters -} - -// ThresholdCustomAlertRuleClassification provides polymorphic access to related types. -// Call the interface's GetThresholdCustomAlertRule() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ActiveConnectionsNotInAllowedRange, *AmqpC2DMessagesNotInAllowedRange, *AmqpC2DRejectedMessagesNotInAllowedRange, *AmqpD2CMessagesNotInAllowedRange, -// - *DirectMethodInvokesNotInAllowedRange, *FailedLocalLoginsNotInAllowedRange, *FileUploadsNotInAllowedRange, *HTTPC2DMessagesNotInAllowedRange, -// - *HTTPC2DRejectedMessagesNotInAllowedRange, *HTTPD2CMessagesNotInAllowedRange, *MqttC2DMessagesNotInAllowedRange, *MqttC2DRejectedMessagesNotInAllowedRange, -// - *MqttD2CMessagesNotInAllowedRange, *QueuePurgesNotInAllowedRange, *ThresholdCustomAlertRule, *TimeWindowCustomAlertRule, -// - *TwinUpdatesNotInAllowedRange, *UnauthorizedOperationsNotInAllowedRange -type ThresholdCustomAlertRuleClassification interface { - CustomAlertRuleClassification - // GetThresholdCustomAlertRule returns the ThresholdCustomAlertRule content of the underlying type. - GetThresholdCustomAlertRule() *ThresholdCustomAlertRule -} - // ThresholdCustomAlertRule - A custom alert rule that checks if a value (depends on the custom alert type) is within the // given range. type ThresholdCustomAlertRule struct { @@ -7873,8 +7521,8 @@ type ThresholdCustomAlertRule struct { // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type ThresholdCustomAlertRule. func (t *ThresholdCustomAlertRule) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: t.DisplayName, Description: t.Description, + DisplayName: t.DisplayName, IsEnabled: t.IsEnabled, RuleType: t.RuleType, } @@ -7883,20 +7531,6 @@ func (t *ThresholdCustomAlertRule) GetCustomAlertRule() *CustomAlertRule { // GetThresholdCustomAlertRule implements the ThresholdCustomAlertRuleClassification interface for type ThresholdCustomAlertRule. func (t *ThresholdCustomAlertRule) GetThresholdCustomAlertRule() *ThresholdCustomAlertRule { return t } -// TimeWindowCustomAlertRuleClassification provides polymorphic access to related types. -// Call the interface's GetTimeWindowCustomAlertRule() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ActiveConnectionsNotInAllowedRange, *AmqpC2DMessagesNotInAllowedRange, *AmqpC2DRejectedMessagesNotInAllowedRange, *AmqpD2CMessagesNotInAllowedRange, -// - *DirectMethodInvokesNotInAllowedRange, *FailedLocalLoginsNotInAllowedRange, *FileUploadsNotInAllowedRange, *HTTPC2DMessagesNotInAllowedRange, -// - *HTTPC2DRejectedMessagesNotInAllowedRange, *HTTPD2CMessagesNotInAllowedRange, *MqttC2DMessagesNotInAllowedRange, *MqttC2DRejectedMessagesNotInAllowedRange, -// - *MqttD2CMessagesNotInAllowedRange, *QueuePurgesNotInAllowedRange, *TimeWindowCustomAlertRule, *TwinUpdatesNotInAllowedRange, -// - *UnauthorizedOperationsNotInAllowedRange -type TimeWindowCustomAlertRuleClassification interface { - ThresholdCustomAlertRuleClassification - // GetTimeWindowCustomAlertRule returns the TimeWindowCustomAlertRule content of the underlying type. - GetTimeWindowCustomAlertRule() *TimeWindowCustomAlertRule -} - // TimeWindowCustomAlertRule - A custom alert rule that checks if the number of activities (depends on the custom alert type) // in a time window is within the given range. type TimeWindowCustomAlertRule struct { @@ -7925,8 +7559,8 @@ type TimeWindowCustomAlertRule struct { // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type TimeWindowCustomAlertRule. func (t *TimeWindowCustomAlertRule) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: t.DisplayName, Description: t.Description, + DisplayName: t.DisplayName, IsEnabled: t.IsEnabled, RuleType: t.RuleType, } @@ -7935,11 +7569,11 @@ func (t *TimeWindowCustomAlertRule) GetCustomAlertRule() *CustomAlertRule { // GetThresholdCustomAlertRule implements the ThresholdCustomAlertRuleClassification interface for type TimeWindowCustomAlertRule. func (t *TimeWindowCustomAlertRule) GetThresholdCustomAlertRule() *ThresholdCustomAlertRule { return &ThresholdCustomAlertRule{ - MinThreshold: t.MinThreshold, - MaxThreshold: t.MaxThreshold, - DisplayName: t.DisplayName, Description: t.Description, + DisplayName: t.DisplayName, IsEnabled: t.IsEnabled, + MaxThreshold: t.MaxThreshold, + MinThreshold: t.MinThreshold, RuleType: t.RuleType, } } @@ -7949,22 +7583,6 @@ func (t *TimeWindowCustomAlertRule) GetTimeWindowCustomAlertRule() *TimeWindowCu return t } -// TopologyClientGetOptions contains the optional parameters for the TopologyClient.Get method. -type TopologyClientGetOptions struct { - // placeholder for future optional parameters -} - -// TopologyClientListByHomeRegionOptions contains the optional parameters for the TopologyClient.NewListByHomeRegionPager -// method. -type TopologyClientListByHomeRegionOptions struct { - // placeholder for future optional parameters -} - -// TopologyClientListOptions contains the optional parameters for the TopologyClient.NewListPager method. -type TopologyClientListOptions struct { - // placeholder for future optional parameters -} - type TopologyList struct { // READ-ONLY; The URI to fetch the next page. NextLink *string @@ -8085,8 +7703,8 @@ type TwinUpdatesNotInAllowedRange struct { // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type TwinUpdatesNotInAllowedRange. func (t *TwinUpdatesNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: t.DisplayName, Description: t.Description, + DisplayName: t.DisplayName, IsEnabled: t.IsEnabled, RuleType: t.RuleType, } @@ -8095,11 +7713,11 @@ func (t *TwinUpdatesNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule { // GetThresholdCustomAlertRule implements the ThresholdCustomAlertRuleClassification interface for type TwinUpdatesNotInAllowedRange. func (t *TwinUpdatesNotInAllowedRange) GetThresholdCustomAlertRule() *ThresholdCustomAlertRule { return &ThresholdCustomAlertRule{ - MinThreshold: t.MinThreshold, - MaxThreshold: t.MaxThreshold, - DisplayName: t.DisplayName, Description: t.Description, + DisplayName: t.DisplayName, IsEnabled: t.IsEnabled, + MaxThreshold: t.MaxThreshold, + MinThreshold: t.MinThreshold, RuleType: t.RuleType, } } @@ -8107,13 +7725,13 @@ func (t *TwinUpdatesNotInAllowedRange) GetThresholdCustomAlertRule() *ThresholdC // GetTimeWindowCustomAlertRule implements the TimeWindowCustomAlertRuleClassification interface for type TwinUpdatesNotInAllowedRange. func (t *TwinUpdatesNotInAllowedRange) GetTimeWindowCustomAlertRule() *TimeWindowCustomAlertRule { return &TimeWindowCustomAlertRule{ - TimeWindowSize: t.TimeWindowSize, - MinThreshold: t.MinThreshold, - MaxThreshold: t.MaxThreshold, - DisplayName: t.DisplayName, Description: t.Description, + DisplayName: t.DisplayName, IsEnabled: t.IsEnabled, + MaxThreshold: t.MaxThreshold, + MinThreshold: t.MinThreshold, RuleType: t.RuleType, + TimeWindowSize: t.TimeWindowSize, } } @@ -8144,8 +7762,8 @@ type UnauthorizedOperationsNotInAllowedRange struct { // GetCustomAlertRule implements the CustomAlertRuleClassification interface for type UnauthorizedOperationsNotInAllowedRange. func (u *UnauthorizedOperationsNotInAllowedRange) GetCustomAlertRule() *CustomAlertRule { return &CustomAlertRule{ - DisplayName: u.DisplayName, Description: u.Description, + DisplayName: u.DisplayName, IsEnabled: u.IsEnabled, RuleType: u.RuleType, } @@ -8154,11 +7772,11 @@ func (u *UnauthorizedOperationsNotInAllowedRange) GetCustomAlertRule() *CustomAl // GetThresholdCustomAlertRule implements the ThresholdCustomAlertRuleClassification interface for type UnauthorizedOperationsNotInAllowedRange. func (u *UnauthorizedOperationsNotInAllowedRange) GetThresholdCustomAlertRule() *ThresholdCustomAlertRule { return &ThresholdCustomAlertRule{ - MinThreshold: u.MinThreshold, - MaxThreshold: u.MaxThreshold, - DisplayName: u.DisplayName, Description: u.Description, + DisplayName: u.DisplayName, IsEnabled: u.IsEnabled, + MaxThreshold: u.MaxThreshold, + MinThreshold: u.MinThreshold, RuleType: u.RuleType, } } @@ -8166,13 +7784,13 @@ func (u *UnauthorizedOperationsNotInAllowedRange) GetThresholdCustomAlertRule() // GetTimeWindowCustomAlertRule implements the TimeWindowCustomAlertRuleClassification interface for type UnauthorizedOperationsNotInAllowedRange. func (u *UnauthorizedOperationsNotInAllowedRange) GetTimeWindowCustomAlertRule() *TimeWindowCustomAlertRule { return &TimeWindowCustomAlertRule{ - TimeWindowSize: u.TimeWindowSize, - MinThreshold: u.MinThreshold, - MaxThreshold: u.MaxThreshold, - DisplayName: u.DisplayName, Description: u.Description, + DisplayName: u.DisplayName, IsEnabled: u.IsEnabled, + MaxThreshold: u.MaxThreshold, + MinThreshold: u.MinThreshold, RuleType: u.RuleType, + TimeWindowSize: u.TimeWindowSize, } } @@ -8312,28 +7930,3 @@ type WorkspaceSettingProperties struct { // REQUIRED; The full Azure ID of the workspace to save the data in WorkspaceID *string } - -// WorkspaceSettingsClientCreateOptions contains the optional parameters for the WorkspaceSettingsClient.Create method. -type WorkspaceSettingsClientCreateOptions struct { - // placeholder for future optional parameters -} - -// WorkspaceSettingsClientDeleteOptions contains the optional parameters for the WorkspaceSettingsClient.Delete method. -type WorkspaceSettingsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// WorkspaceSettingsClientGetOptions contains the optional parameters for the WorkspaceSettingsClient.Get method. -type WorkspaceSettingsClientGetOptions struct { - // placeholder for future optional parameters -} - -// WorkspaceSettingsClientListOptions contains the optional parameters for the WorkspaceSettingsClient.NewListPager method. -type WorkspaceSettingsClientListOptions struct { - // placeholder for future optional parameters -} - -// WorkspaceSettingsClientUpdateOptions contains the optional parameters for the WorkspaceSettingsClient.Update method. -type WorkspaceSettingsClientUpdateOptions struct { - // placeholder for future optional parameters -} diff --git a/sdk/resourcemanager/security/armsecurity/models_serde.go b/sdk/resourcemanager/security/armsecurity/models_serde.go index 1457dac4d586..f4c26bc511d1 100644 --- a/sdk/resourcemanager/security/armsecurity/models_serde.go +++ b/sdk/resourcemanager/security/armsecurity/models_serde.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -146,16 +145,18 @@ func (a *AADSolutionProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type APICollectionProperties. -func (a APICollectionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type APICollection. +func (a APICollection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "additionalData", a.AdditionalData) - populate(objectMap, "displayName", a.DisplayName) + 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 APICollectionProperties. -func (a *APICollectionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type APICollection. +func (a *APICollection) 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) @@ -163,11 +164,17 @@ func (a *APICollectionProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "additionalData": - err = unpopulate(val, "AdditionalData", &a.AdditionalData) + case "id": + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &a.DisplayName) + 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 { @@ -177,18 +184,16 @@ func (a *APICollectionProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type APICollectionResponse. -func (a APICollectionResponse) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type APICollectionList. +func (a APICollectionList) 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) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type APICollectionResponse. -func (a *APICollectionResponse) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type APICollectionList. +func (a *APICollectionList) 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) @@ -196,17 +201,74 @@ func (a *APICollectionResponse) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &a.ID) + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &a.Name) + case "value": + err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &a.Properties) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type APICollectionProperties. +func (a APICollectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "baseUrl", a.BaseURL) + populate(objectMap, "discoveredVia", a.DiscoveredVia) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "numberOfApiEndpoints", a.NumberOfAPIEndpoints) + populate(objectMap, "numberOfApiEndpointsWithSensitiveDataExposed", a.NumberOfAPIEndpointsWithSensitiveDataExposed) + populate(objectMap, "numberOfExternalApiEndpoints", a.NumberOfExternalAPIEndpoints) + populate(objectMap, "numberOfInactiveApiEndpoints", a.NumberOfInactiveAPIEndpoints) + populate(objectMap, "numberOfUnauthenticatedApiEndpoints", a.NumberOfUnauthenticatedAPIEndpoints) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "sensitivityLabel", a.SensitivityLabel) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APICollectionProperties. +func (a *APICollectionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "baseUrl": + err = unpopulate(val, "BaseURL", &a.BaseURL) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) + case "discoveredVia": + err = unpopulate(val, "DiscoveredVia", &a.DiscoveredVia) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) + delete(rawMsg, key) + case "numberOfApiEndpoints": + err = unpopulate(val, "NumberOfAPIEndpoints", &a.NumberOfAPIEndpoints) + delete(rawMsg, key) + case "numberOfApiEndpointsWithSensitiveDataExposed": + err = unpopulate(val, "NumberOfAPIEndpointsWithSensitiveDataExposed", &a.NumberOfAPIEndpointsWithSensitiveDataExposed) + delete(rawMsg, key) + case "numberOfExternalApiEndpoints": + err = unpopulate(val, "NumberOfExternalAPIEndpoints", &a.NumberOfExternalAPIEndpoints) + delete(rawMsg, key) + case "numberOfInactiveApiEndpoints": + err = unpopulate(val, "NumberOfInactiveAPIEndpoints", &a.NumberOfInactiveAPIEndpoints) + delete(rawMsg, key) + case "numberOfUnauthenticatedApiEndpoints": + err = unpopulate(val, "NumberOfUnauthenticatedAPIEndpoints", &a.NumberOfUnauthenticatedAPIEndpoints) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "sensitivityLabel": + err = unpopulate(val, "SensitivityLabel", &a.SensitivityLabel) delete(rawMsg, key) } if err != nil { @@ -216,16 +278,18 @@ func (a *APICollectionResponse) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type APICollectionResponseList. -func (a APICollectionResponseList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ActionableRemediation. +func (a ActionableRemediation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) + populate(objectMap, "branchConfiguration", a.BranchConfiguration) + populate(objectMap, "categoryConfigurations", a.CategoryConfigurations) + populate(objectMap, "inheritFromParentState", a.InheritFromParentState) + populate(objectMap, "state", a.State) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type APICollectionResponseList. -func (a *APICollectionResponseList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ActionableRemediation. +func (a *ActionableRemediation) 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) @@ -233,11 +297,17 @@ func (a *APICollectionResponseList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &a.NextLink) + case "branchConfiguration": + err = unpopulate(val, "BranchConfiguration", &a.BranchConfiguration) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &a.Value) + case "categoryConfigurations": + err = unpopulate(val, "CategoryConfigurations", &a.CategoryConfigurations) + delete(rawMsg, key) + case "inheritFromParentState": + err = unpopulate(val, "InheritFromParentState", &a.InheritFromParentState) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &a.State) delete(rawMsg, key) } if err != nil { @@ -2691,6 +2761,33 @@ func (a *AuthenticationDetailsProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type Authorization. +func (a Authorization) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", a.Code) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Authorization. +func (a *Authorization) 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 "code": + err = unpopulate(val, "Code", &a.Code) + 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 AutoProvisioningSetting. func (a AutoProvisioningSetting) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3309,6 +3406,7 @@ func (a AwsEnvironmentData) MarshalJSON() ([]byte, error) { objectMap["environmentType"] = EnvironmentTypeAwsAccount populate(objectMap, "organizationalData", a.OrganizationalData) populate(objectMap, "regions", a.Regions) + populate(objectMap, "scanInterval", a.ScanInterval) return json.Marshal(objectMap) } @@ -3333,6 +3431,9 @@ func (a *AwsEnvironmentData) UnmarshalJSON(data []byte) error { case "regions": err = unpopulate(val, "Regions", &a.Regions) delete(rawMsg, key) + case "scanInterval": + err = unpopulate(val, "ScanInterval", &a.ScanInterval) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", a, err) @@ -3434,15 +3535,19 @@ func (a *AwsOrganizationalDataMember) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureDevOpsScopeEnvironmentData. -func (a AzureDevOpsScopeEnvironmentData) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureDevOpsOrg. +func (a AzureDevOpsOrg) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["environmentType"] = EnvironmentTypeAzureDevOpsScope + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDevOpsScopeEnvironmentData. -func (a *AzureDevOpsScopeEnvironmentData) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDevOpsOrg. +func (a *AzureDevOpsOrg) 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) @@ -3450,8 +3555,20 @@ func (a *AzureDevOpsScopeEnvironmentData) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "environmentType": - err = unpopulate(val, "EnvironmentType", &a.EnvironmentType) + 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 "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { @@ -3461,16 +3578,16 @@ func (a *AzureDevOpsScopeEnvironmentData) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureResourceDetails. -func (a AzureResourceDetails) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureDevOpsOrgListResponse. +func (a AzureDevOpsOrgListResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", a.ID) - objectMap["source"] = SourceAzure + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureResourceDetails. -func (a *AzureResourceDetails) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDevOpsOrgListResponse. +func (a *AzureDevOpsOrgListResponse) 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) @@ -3478,11 +3595,11 @@ func (a *AzureResourceDetails) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &a.ID) + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &a.Source) + case "value": + err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) } if err != nil { @@ -3492,16 +3609,19 @@ func (a *AzureResourceDetails) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureResourceIdentifier. -func (a AzureResourceIdentifier) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureDevOpsOrgProperties. +func (a AzureDevOpsOrgProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "azureResourceId", a.AzureResourceID) - objectMap["type"] = ResourceIdentifierTypeAzureResource + populate(objectMap, "actionableRemediation", a.ActionableRemediation) + populate(objectMap, "onboardingState", a.OnboardingState) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "provisioningStatusMessage", a.ProvisioningStatusMessage) + populateTimeRFC3339(objectMap, "provisioningStatusUpdateTimeUtc", a.ProvisioningStatusUpdateTimeUTC) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureResourceIdentifier. -func (a *AzureResourceIdentifier) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDevOpsOrgProperties. +func (a *AzureDevOpsOrgProperties) 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) @@ -3509,11 +3629,20 @@ func (a *AzureResourceIdentifier) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "azureResourceId": - err = unpopulate(val, "AzureResourceID", &a.AzureResourceID) + case "actionableRemediation": + err = unpopulate(val, "ActionableRemediation", &a.ActionableRemediation) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) + case "onboardingState": + err = unpopulate(val, "OnboardingState", &a.OnboardingState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "provisioningStatusMessage": + err = unpopulate(val, "ProvisioningStatusMessage", &a.ProvisioningStatusMessage) + delete(rawMsg, key) + case "provisioningStatusUpdateTimeUtc": + err = unpopulateTimeRFC3339(val, "ProvisioningStatusUpdateTimeUTC", &a.ProvisioningStatusUpdateTimeUTC) delete(rawMsg, key) } if err != nil { @@ -3523,15 +3652,16 @@ func (a *AzureResourceIdentifier) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureResourceLink. -func (a AzureResourceLink) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureDevOpsOrganizationConfiguration. +func (a AzureDevOpsOrganizationConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", a.ID) + populate(objectMap, "autoDiscovery", a.AutoDiscovery) + populate(objectMap, "projectConfigs", a.ProjectConfigs) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureResourceLink. -func (a *AzureResourceLink) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDevOpsOrganizationConfiguration. +func (a *AzureDevOpsOrganizationConfiguration) 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) @@ -3539,8 +3669,11 @@ func (a *AzureResourceLink) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &a.ID) + case "autoDiscovery": + err = unpopulate(val, "AutoDiscovery", &a.AutoDiscovery) + delete(rawMsg, key) + case "projectConfigs": + err = unpopulate(val, "ProjectConfigs", &a.ProjectConfigs) delete(rawMsg, key) } if err != nil { @@ -3550,15 +3683,19 @@ func (a *AzureResourceLink) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureTrackedResourceLocation. -func (a AzureTrackedResourceLocation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureDevOpsProject. +func (a AzureDevOpsProject) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "location", a.Location) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureTrackedResourceLocation. -func (a *AzureTrackedResourceLocation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDevOpsProject. +func (a *AzureDevOpsProject) 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) @@ -3566,8 +3703,20 @@ func (a *AzureTrackedResourceLocation) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "location": - err = unpopulate(val, "Location", &a.Location) + 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 "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { @@ -3577,619 +3726,619 @@ func (a *AzureTrackedResourceLocation) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Baseline. -func (b Baseline) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureDevOpsProjectConfiguration. +func (a AzureDevOpsProjectConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "expectedResults", b.ExpectedResults) - populateTimeRFC3339(objectMap, "updatedTime", b.UpdatedTime) + populate(objectMap, "autoDiscovery", a.AutoDiscovery) + populate(objectMap, "repositoryConfigs", a.RepositoryConfigs) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Baseline. -func (b *Baseline) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDevOpsProjectConfiguration. +func (a *AzureDevOpsProjectConfiguration) 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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "expectedResults": - err = unpopulate(val, "ExpectedResults", &b.ExpectedResults) + case "autoDiscovery": + err = unpopulate(val, "AutoDiscovery", &a.AutoDiscovery) delete(rawMsg, key) - case "updatedTime": - err = unpopulateTimeRFC3339(val, "UpdatedTime", &b.UpdatedTime) + case "repositoryConfigs": + err = unpopulate(val, "RepositoryConfigs", &a.RepositoryConfigs) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BaselineAdjustedResult. -func (b BaselineAdjustedResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureDevOpsProjectListResponse. +func (a AzureDevOpsProjectListResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "baseline", b.Baseline) - populate(objectMap, "resultsNotInBaseline", b.ResultsNotInBaseline) - populate(objectMap, "resultsOnlyInBaseline", b.ResultsOnlyInBaseline) - populate(objectMap, "status", b.Status) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BaselineAdjustedResult. -func (b *BaselineAdjustedResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDevOpsProjectListResponse. +func (a *AzureDevOpsProjectListResponse) 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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "baseline": - err = unpopulate(val, "Baseline", &b.Baseline) - delete(rawMsg, key) - case "resultsNotInBaseline": - err = unpopulate(val, "ResultsNotInBaseline", &b.ResultsNotInBaseline) - delete(rawMsg, key) - case "resultsOnlyInBaseline": - err = unpopulate(val, "ResultsOnlyInBaseline", &b.ResultsOnlyInBaseline) + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &b.Status) + case "value": + err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type BenchmarkReference. -func (b BenchmarkReference) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureDevOpsProjectProperties. +func (a AzureDevOpsProjectProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "benchmark", b.Benchmark) - populate(objectMap, "reference", b.Reference) + populate(objectMap, "actionableRemediation", a.ActionableRemediation) + populate(objectMap, "onboardingState", a.OnboardingState) + populate(objectMap, "parentOrgName", a.ParentOrgName) + populate(objectMap, "projectId", a.ProjectID) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "provisioningStatusMessage", a.ProvisioningStatusMessage) + populateTimeRFC3339(objectMap, "provisioningStatusUpdateTimeUtc", a.ProvisioningStatusUpdateTimeUTC) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BenchmarkReference. -func (b *BenchmarkReference) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDevOpsProjectProperties. +func (a *AzureDevOpsProjectProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "benchmark": - err = unpopulate(val, "Benchmark", &b.Benchmark) + case "actionableRemediation": + err = unpopulate(val, "ActionableRemediation", &a.ActionableRemediation) delete(rawMsg, key) - case "reference": - err = unpopulate(val, "Reference", &b.Reference) + case "onboardingState": + err = unpopulate(val, "OnboardingState", &a.OnboardingState) delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) - } + case "parentOrgName": + err = unpopulate(val, "ParentOrgName", &a.ParentOrgName) + delete(rawMsg, key) + case "projectId": + err = unpopulate(val, "ProjectID", &a.ProjectID) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "provisioningStatusMessage": + err = unpopulate(val, "ProvisioningStatusMessage", &a.ProvisioningStatusMessage) + delete(rawMsg, key) + case "provisioningStatusUpdateTimeUtc": + err = unpopulateTimeRFC3339(val, "ProvisioningStatusUpdateTimeUTC", &a.ProvisioningStatusUpdateTimeUTC) + 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 BuiltInInfoType. -func (b BuiltInInfoType) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureDevOpsRepository. +func (a AzureDevOpsRepository) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", b.ID) - populate(objectMap, "name", b.Name) - populate(objectMap, "type", b.Type) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BuiltInInfoType. -func (b *BuiltInInfoType) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDevOpsRepository. +func (a *AzureDevOpsRepository) 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) + 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", &b.ID) + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &b.Name) + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &b.Type) + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", b, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CVE. -func (c CVE) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureDevOpsRepositoryListResponse. +func (a AzureDevOpsRepositoryListResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "link", c.Link) - populate(objectMap, "title", c.Title) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CVE. -func (c *CVE) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDevOpsRepositoryListResponse. +func (a *AzureDevOpsRepositoryListResponse) 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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "link": - err = unpopulate(val, "Link", &c.Link) + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) delete(rawMsg, key) - case "title": - err = unpopulate(val, "Title", &c.Title) + case "value": + err = unpopulate(val, "Value", &a.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CVSS. -func (c CVSS) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureDevOpsRepositoryProperties. +func (a AzureDevOpsRepositoryProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "base", c.Base) + populate(objectMap, "actionableRemediation", a.ActionableRemediation) + populate(objectMap, "onboardingState", a.OnboardingState) + populate(objectMap, "parentOrgName", a.ParentOrgName) + populate(objectMap, "parentProjectName", a.ParentProjectName) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "provisioningStatusMessage", a.ProvisioningStatusMessage) + populateTimeRFC3339(objectMap, "provisioningStatusUpdateTimeUtc", a.ProvisioningStatusUpdateTimeUTC) + populate(objectMap, "repoId", a.RepoID) + populate(objectMap, "repoUrl", a.RepoURL) + populate(objectMap, "visibility", a.Visibility) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CVSS. -func (c *CVSS) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDevOpsRepositoryProperties. +func (a *AzureDevOpsRepositoryProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "base": - err = unpopulate(val, "Base", &c.Base) + case "actionableRemediation": + err = unpopulate(val, "ActionableRemediation", &a.ActionableRemediation) + delete(rawMsg, key) + case "onboardingState": + err = unpopulate(val, "OnboardingState", &a.OnboardingState) + delete(rawMsg, key) + case "parentOrgName": + err = unpopulate(val, "ParentOrgName", &a.ParentOrgName) + delete(rawMsg, key) + case "parentProjectName": + err = unpopulate(val, "ParentProjectName", &a.ParentProjectName) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "provisioningStatusMessage": + err = unpopulate(val, "ProvisioningStatusMessage", &a.ProvisioningStatusMessage) + delete(rawMsg, key) + case "provisioningStatusUpdateTimeUtc": + err = unpopulateTimeRFC3339(val, "ProvisioningStatusUpdateTimeUTC", &a.ProvisioningStatusUpdateTimeUTC) + delete(rawMsg, key) + case "repoId": + err = unpopulate(val, "RepoID", &a.RepoID) + delete(rawMsg, key) + case "repoUrl": + err = unpopulate(val, "RepoURL", &a.RepoURL) + delete(rawMsg, key) + case "visibility": + err = unpopulate(val, "Visibility", &a.Visibility) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CefExternalSecuritySolution. -func (c CefExternalSecuritySolution) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureDevOpsScopeEnvironmentData. +func (a AzureDevOpsScopeEnvironmentData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "kind", c.Kind) - populate(objectMap, "location", c.Location) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "type", c.Type) + objectMap["environmentType"] = EnvironmentTypeAzureDevOpsScope return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CefExternalSecuritySolution. -func (c *CefExternalSecuritySolution) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureDevOpsScopeEnvironmentData. +func (a *AzureDevOpsScopeEnvironmentData) 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) + 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", &c.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &c.Kind) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - 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 "type": - err = unpopulate(val, "Type", &c.Type) + case "environmentType": + err = unpopulate(val, "EnvironmentType", &a.EnvironmentType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CefSolutionProperties. -func (c CefSolutionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureResourceDetails. +func (a AzureResourceDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "agent", c.Agent) - populate(objectMap, "deviceType", c.DeviceType) - populate(objectMap, "deviceVendor", c.DeviceVendor) - populate(objectMap, "hostname", c.Hostname) - populate(objectMap, "lastEventReceived", c.LastEventReceived) - populate(objectMap, "workspace", c.Workspace) - if c.AdditionalProperties != nil { - for key, val := range c.AdditionalProperties { - objectMap[key] = val - } - } + populate(objectMap, "id", a.ID) + objectMap["source"] = SourceAzure return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CefSolutionProperties. -func (c *CefSolutionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureResourceDetails. +func (a *AzureResourceDetails) 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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "agent": - err = unpopulate(val, "Agent", &c.Agent) - delete(rawMsg, key) - case "deviceType": - err = unpopulate(val, "DeviceType", &c.DeviceType) - delete(rawMsg, key) - case "deviceVendor": - err = unpopulate(val, "DeviceVendor", &c.DeviceVendor) - delete(rawMsg, key) - case "hostname": - err = unpopulate(val, "Hostname", &c.Hostname) - delete(rawMsg, key) - case "lastEventReceived": - err = unpopulate(val, "LastEventReceived", &c.LastEventReceived) - delete(rawMsg, key) - case "workspace": - err = unpopulate(val, "Workspace", &c.Workspace) + case "id": + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) - default: - if c.AdditionalProperties == nil { - c.AdditionalProperties = map[string]any{} - } - if val != nil { - var aux any - err = json.Unmarshal(val, &aux) - c.AdditionalProperties[key] = aux - } + case "source": + err = unpopulate(val, "Source", &a.Source) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type CloudOffering. -func (c CloudOffering) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureResourceIdentifier. +func (a AzureResourceIdentifier) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", c.Description) - objectMap["offeringType"] = c.OfferingType + populate(objectMap, "azureResourceId", a.AzureResourceID) + objectMap["type"] = ResourceIdentifierTypeAzureResource return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CloudOffering. -func (c *CloudOffering) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureResourceIdentifier. +func (a *AzureResourceIdentifier) 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) + 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", &c.Description) + case "azureResourceId": + err = unpopulate(val, "AzureResourceID", &a.AzureResourceID) delete(rawMsg, key) - case "offeringType": - err = unpopulate(val, "OfferingType", &c.OfferingType) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Compliance. -func (c Compliance) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureResourceLink. +func (a AzureResourceLink) 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, "type", c.Type) + populate(objectMap, "id", a.ID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Compliance. -func (c *Compliance) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureResourceLink. +func (a *AzureResourceLink) 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) + 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", &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 "type": - err = unpopulate(val, "Type", &c.Type) + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ComplianceList. -func (c ComplianceList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureServersSetting. +func (a AzureServersSetting) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populate(objectMap, "id", a.ID) + objectMap["kind"] = ServerVulnerabilityAssessmentsSettingKindAzureServersSetting + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComplianceList. -func (c *ComplianceList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureServersSetting. +func (a *AzureServersSetting) 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) + 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", &c.NextLink) + case "id": + err = unpopulate(val, "ID", &a.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "kind": + err = unpopulate(val, "Kind", &a.Kind) + 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 "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ComplianceProperties. -func (c ComplianceProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureTrackedResourceLocation. +func (a AzureTrackedResourceLocation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "assessmentResult", c.AssessmentResult) - populateTimeRFC3339(objectMap, "assessmentTimestampUtcDate", c.AssessmentTimestampUTCDate) - populate(objectMap, "resourceCount", c.ResourceCount) + populate(objectMap, "location", a.Location) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComplianceProperties. -func (c *ComplianceProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureTrackedResourceLocation. +func (a *AzureTrackedResourceLocation) 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) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } for key, val := range rawMsg { var err error switch key { - case "assessmentResult": - err = unpopulate(val, "AssessmentResult", &c.AssessmentResult) - delete(rawMsg, key) - case "assessmentTimestampUtcDate": - err = unpopulateTimeRFC3339(val, "AssessmentTimestampUTCDate", &c.AssessmentTimestampUTCDate) - delete(rawMsg, key) - case "resourceCount": - err = unpopulate(val, "ResourceCount", &c.ResourceCount) + case "location": + err = unpopulate(val, "Location", &a.Location) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", a, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ComplianceResult. -func (c ComplianceResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BaseResourceConfiguration. +func (b BaseResourceConfiguration) 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, "type", c.Type) + populate(objectMap, "desiredOnboardingState", b.DesiredOnboardingState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComplianceResult. -func (c *ComplianceResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BaseResourceConfiguration. +func (b *BaseResourceConfiguration) 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) + return fmt.Errorf("unmarshalling type %T: %v", b, 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 "type": - err = unpopulate(val, "Type", &c.Type) + case "desiredOnboardingState": + err = unpopulate(val, "DesiredOnboardingState", &b.DesiredOnboardingState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ComplianceResultList. -func (c ComplianceResultList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Baseline. +func (b Baseline) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populate(objectMap, "expectedResults", b.ExpectedResults) + populateTimeRFC3339(objectMap, "updatedTime", b.UpdatedTime) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComplianceResultList. -func (c *ComplianceResultList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Baseline. +func (b *Baseline) 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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) + case "expectedResults": + err = unpopulate(val, "ExpectedResults", &b.ExpectedResults) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "updatedTime": + err = unpopulateTimeRFC3339(val, "UpdatedTime", &b.UpdatedTime) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ComplianceResultProperties. -func (c ComplianceResultProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BaselineAdjustedResult. +func (b BaselineAdjustedResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "resourceStatus", c.ResourceStatus) + populate(objectMap, "baseline", b.Baseline) + populate(objectMap, "resultsNotInBaseline", b.ResultsNotInBaseline) + populate(objectMap, "resultsOnlyInBaseline", b.ResultsOnlyInBaseline) + populate(objectMap, "status", b.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComplianceResultProperties. -func (c *ComplianceResultProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BaselineAdjustedResult. +func (b *BaselineAdjustedResult) 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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "resourceStatus": - err = unpopulate(val, "ResourceStatus", &c.ResourceStatus) + case "baseline": + err = unpopulate(val, "Baseline", &b.Baseline) + delete(rawMsg, key) + case "resultsNotInBaseline": + err = unpopulate(val, "ResultsNotInBaseline", &b.ResultsNotInBaseline) + delete(rawMsg, key) + case "resultsOnlyInBaseline": + err = unpopulate(val, "ResultsOnlyInBaseline", &b.ResultsOnlyInBaseline) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &b.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ComplianceSegment. -func (c ComplianceSegment) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BenchmarkReference. +func (b BenchmarkReference) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "percentage", c.Percentage) - populate(objectMap, "segmentType", c.SegmentType) + populate(objectMap, "benchmark", b.Benchmark) + populate(objectMap, "reference", b.Reference) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ComplianceSegment. -func (c *ComplianceSegment) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BenchmarkReference. +func (b *BenchmarkReference) 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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "percentage": - err = unpopulate(val, "Percentage", &c.Percentage) + case "benchmark": + err = unpopulate(val, "Benchmark", &b.Benchmark) delete(rawMsg, key) - case "segmentType": - err = unpopulate(val, "SegmentType", &c.SegmentType) + case "reference": + err = unpopulate(val, "Reference", &b.Reference) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type Condition. -func (c Condition) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type BuiltInInfoType. +func (b BuiltInInfoType) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "operator", c.Operator) - populate(objectMap, "property", c.Property) - populate(objectMap, "value", c.Value) + populate(objectMap, "id", b.ID) + populate(objectMap, "name", b.Name) + populate(objectMap, "type", b.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Condition. -func (c *Condition) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BuiltInInfoType. +func (b *BuiltInInfoType) 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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "operator": - err = unpopulate(val, "Operator", &c.Operator) + case "id": + err = unpopulate(val, "ID", &b.ID) delete(rawMsg, key) - case "property": - err = unpopulate(val, "Property", &c.Property) + case "name": + err = unpopulate(val, "Name", &b.Name) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "type": + err = unpopulate(val, "Type", &b.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectableResource. -func (c ConnectableResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CVE. +func (c CVE) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) - populate(objectMap, "inboundConnectedResources", c.InboundConnectedResources) - populate(objectMap, "outboundConnectedResources", c.OutboundConnectedResources) + populate(objectMap, "link", c.Link) + populate(objectMap, "title", c.Title) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectableResource. -func (c *ConnectableResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CVE. +func (c *CVE) 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) @@ -4197,14 +4346,11 @@ func (c *ConnectableResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) - delete(rawMsg, key) - case "inboundConnectedResources": - err = unpopulate(val, "InboundConnectedResources", &c.InboundConnectedResources) + case "link": + err = unpopulate(val, "Link", &c.Link) delete(rawMsg, key) - case "outboundConnectedResources": - err = unpopulate(val, "OutboundConnectedResources", &c.OutboundConnectedResources) + case "title": + err = unpopulate(val, "Title", &c.Title) delete(rawMsg, key) } if err != nil { @@ -4214,17 +4360,15 @@ func (c *ConnectableResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectedResource. -func (c ConnectedResource) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CVSS. +func (c CVSS) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "connectedResourceId", c.ConnectedResourceID) - populate(objectMap, "tcpPorts", c.TCPPorts) - populate(objectMap, "udpPorts", c.UDPPorts) + populate(objectMap, "base", c.Base) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedResource. -func (c *ConnectedResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CVSS. +func (c *CVSS) 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) @@ -4232,14 +4376,8 @@ func (c *ConnectedResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "connectedResourceId": - err = unpopulate(val, "ConnectedResourceID", &c.ConnectedResourceID) - delete(rawMsg, key) - case "tcpPorts": - err = unpopulate(val, "TCPPorts", &c.TCPPorts) - delete(rawMsg, key) - case "udpPorts": - err = unpopulate(val, "UDPPorts", &c.UDPPorts) + case "base": + err = unpopulate(val, "Base", &c.Base) delete(rawMsg, key) } if err != nil { @@ -4249,15 +4387,16 @@ func (c *ConnectedResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectedWorkspace. -func (c ConnectedWorkspace) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CategoryConfiguration. +func (c CategoryConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", c.ID) + populate(objectMap, "category", c.Category) + populate(objectMap, "minimumSeverityLevel", c.MinimumSeverityLevel) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedWorkspace. -func (c *ConnectedWorkspace) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CategoryConfiguration. +func (c *CategoryConfiguration) 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) @@ -4265,8 +4404,11 @@ func (c *ConnectedWorkspace) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &c.ID) + case "category": + err = unpopulate(val, "Category", &c.Category) + delete(rawMsg, key) + case "minimumSeverityLevel": + err = unpopulate(val, "MinimumSeverityLevel", &c.MinimumSeverityLevel) delete(rawMsg, key) } if err != nil { @@ -4276,20 +4418,20 @@ func (c *ConnectedWorkspace) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectionFromIPNotAllowed. -func (c ConnectionFromIPNotAllowed) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CefExternalSecuritySolution. +func (c CefExternalSecuritySolution) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allowlistValues", c.AllowlistValues) - populate(objectMap, "description", c.Description) - populate(objectMap, "displayName", c.DisplayName) - populate(objectMap, "isEnabled", c.IsEnabled) - objectMap["ruleType"] = "ConnectionFromIpNotAllowed" - populate(objectMap, "valueType", c.ValueType) + populate(objectMap, "id", c.ID) + populate(objectMap, "kind", c.Kind) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionFromIPNotAllowed. -func (c *ConnectionFromIPNotAllowed) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CefExternalSecuritySolution. +func (c *CefExternalSecuritySolution) 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) @@ -4297,23 +4439,23 @@ func (c *ConnectionFromIPNotAllowed) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "allowlistValues": - err = unpopulate(val, "AllowlistValues", &c.AllowlistValues) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &c.Description) + case "kind": + err = unpopulate(val, "Kind", &c.Kind) delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &c.DisplayName) + case "location": + err = unpopulate(val, "Location", &c.Location) delete(rawMsg, key) - case "isEnabled": - err = unpopulate(val, "IsEnabled", &c.IsEnabled) + case "name": + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) - case "ruleType": - err = unpopulate(val, "RuleType", &c.RuleType) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) - case "valueType": - err = unpopulate(val, "ValueType", &c.ValueType) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { @@ -4323,15 +4465,25 @@ func (c *ConnectionFromIPNotAllowed) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectionStrings. -func (c ConnectionStrings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CefSolutionProperties. +func (c CefSolutionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", c.Value) + populate(objectMap, "agent", c.Agent) + populate(objectMap, "deviceType", c.DeviceType) + populate(objectMap, "deviceVendor", c.DeviceVendor) + populate(objectMap, "hostname", c.Hostname) + populate(objectMap, "lastEventReceived", c.LastEventReceived) + populate(objectMap, "workspace", c.Workspace) + if c.AdditionalProperties != nil { + for key, val := range c.AdditionalProperties { + objectMap[key] = val + } + } return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionStrings. -func (c *ConnectionStrings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CefSolutionProperties. +func (c *CefSolutionProperties) 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) @@ -4339,8 +4491,33 @@ func (c *ConnectionStrings) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &c.Value) + case "agent": + err = unpopulate(val, "Agent", &c.Agent) + delete(rawMsg, key) + case "deviceType": + err = unpopulate(val, "DeviceType", &c.DeviceType) + delete(rawMsg, key) + case "deviceVendor": + err = unpopulate(val, "DeviceVendor", &c.DeviceVendor) + delete(rawMsg, key) + case "hostname": + err = unpopulate(val, "Hostname", &c.Hostname) + delete(rawMsg, key) + case "lastEventReceived": + err = unpopulate(val, "LastEventReceived", &c.LastEventReceived) + delete(rawMsg, key) + case "workspace": + err = unpopulate(val, "Workspace", &c.Workspace) + delete(rawMsg, key) + default: + if c.AdditionalProperties == nil { + c.AdditionalProperties = map[string]any{} + } + if val != nil { + var aux any + err = json.Unmarshal(val, &aux) + c.AdditionalProperties[key] = aux + } delete(rawMsg, key) } if err != nil { @@ -4350,20 +4527,16 @@ func (c *ConnectionStrings) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectionToIPNotAllowed. -func (c ConnectionToIPNotAllowed) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CloudOffering. +func (c CloudOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allowlistValues", c.AllowlistValues) populate(objectMap, "description", c.Description) - populate(objectMap, "displayName", c.DisplayName) - populate(objectMap, "isEnabled", c.IsEnabled) - objectMap["ruleType"] = "ConnectionToIpNotAllowed" - populate(objectMap, "valueType", c.ValueType) + objectMap["offeringType"] = c.OfferingType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionToIPNotAllowed. -func (c *ConnectionToIPNotAllowed) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CloudOffering. +func (c *CloudOffering) 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) @@ -4371,23 +4544,11 @@ func (c *ConnectionToIPNotAllowed) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "allowlistValues": - err = unpopulate(val, "AllowlistValues", &c.AllowlistValues) - 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 "isEnabled": - err = unpopulate(val, "IsEnabled", &c.IsEnabled) - delete(rawMsg, key) - case "ruleType": - err = unpopulate(val, "RuleType", &c.RuleType) - delete(rawMsg, key) - case "valueType": - err = unpopulate(val, "ValueType", &c.ValueType) + case "offeringType": + err = unpopulate(val, "OfferingType", &c.OfferingType) delete(rawMsg, key) } if err != nil { @@ -4397,23 +4558,18 @@ func (c *ConnectionToIPNotAllowed) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Connector. -func (c Connector) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Compliance. +func (c Compliance) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "etag", c.Etag) populate(objectMap, "id", c.ID) - populate(objectMap, "kind", c.Kind) - populate(objectMap, "location", c.Location) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) - populate(objectMap, "systemData", c.SystemData) - populate(objectMap, "tags", c.Tags) populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Connector. -func (c *Connector) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Compliance. +func (c *Compliance) 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) @@ -4421,30 +4577,15 @@ func (c *Connector) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "etag": - err = unpopulate(val, "Etag", &c.Etag) - delete(rawMsg, key) case "id": err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &c.Kind) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &c.Location) - 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 "tags": - err = unpopulate(val, "Tags", &c.Tags) - delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) @@ -4456,19 +4597,16 @@ func (c *Connector) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectorProperties. -func (c ConnectorProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComplianceList. +func (c ComplianceList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "environmentData", c.EnvironmentData) - populate(objectMap, "environmentName", c.EnvironmentName) - populate(objectMap, "hierarchyIdentifier", c.HierarchyIdentifier) - populateTimeRFC3339(objectMap, "hierarchyIdentifierTrialEndDate", c.HierarchyIdentifierTrialEndDate) - populate(objectMap, "offerings", c.Offerings) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectorProperties. -func (c *ConnectorProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComplianceList. +func (c *ComplianceList) 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) @@ -4476,20 +4614,46 @@ func (c *ConnectorProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "environmentData": - c.EnvironmentData, err = unmarshalEnvironmentDataClassification(val) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) - case "environmentName": - err = unpopulate(val, "EnvironmentName", &c.EnvironmentName) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) - case "hierarchyIdentifier": - err = unpopulate(val, "HierarchyIdentifier", &c.HierarchyIdentifier) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ComplianceProperties. +func (c ComplianceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "assessmentResult", c.AssessmentResult) + populateTimeRFC3339(objectMap, "assessmentTimestampUtcDate", c.AssessmentTimestampUTCDate) + populate(objectMap, "resourceCount", c.ResourceCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ComplianceProperties. +func (c *ComplianceProperties) 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 "assessmentResult": + err = unpopulate(val, "AssessmentResult", &c.AssessmentResult) delete(rawMsg, key) - case "hierarchyIdentifierTrialEndDate": - err = unpopulateTimeRFC3339(val, "HierarchyIdentifierTrialEndDate", &c.HierarchyIdentifierTrialEndDate) + case "assessmentTimestampUtcDate": + err = unpopulateTimeRFC3339(val, "AssessmentTimestampUTCDate", &c.AssessmentTimestampUTCDate) delete(rawMsg, key) - case "offerings": - c.Offerings, err = unmarshalCloudOfferingClassificationArray(val) + case "resourceCount": + err = unpopulate(val, "ResourceCount", &c.ResourceCount) delete(rawMsg, key) } if err != nil { @@ -4499,8 +4663,8 @@ func (c *ConnectorProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectorSetting. -func (c ConnectorSetting) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComplianceResult. +func (c ComplianceResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) @@ -4509,8 +4673,8 @@ func (c ConnectorSetting) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectorSetting. -func (c *ConnectorSetting) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComplianceResult. +func (c *ComplianceResult) 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) @@ -4538,16 +4702,16 @@ func (c *ConnectorSetting) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectorSettingList. -func (c ConnectorSettingList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComplianceResultList. +func (c ComplianceResultList) 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 ConnectorSettingList. -func (c *ConnectorSettingList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComplianceResultList. +func (c *ComplianceResultList) 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) @@ -4569,16 +4733,15 @@ func (c *ConnectorSettingList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectorSettingProperties. -func (c ConnectorSettingProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComplianceResultProperties. +func (c ComplianceResultProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "authenticationDetails", c.AuthenticationDetails) - populate(objectMap, "hybridComputeSettings", c.HybridComputeSettings) + populate(objectMap, "resourceStatus", c.ResourceStatus) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectorSettingProperties. -func (c *ConnectorSettingProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComplianceResultProperties. +func (c *ComplianceResultProperties) 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) @@ -4586,11 +4749,8 @@ func (c *ConnectorSettingProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "authenticationDetails": - c.AuthenticationDetails, err = unmarshalAuthenticationDetailsPropertiesClassification(val) - delete(rawMsg, key) - case "hybridComputeSettings": - err = unpopulate(val, "HybridComputeSettings", &c.HybridComputeSettings) + case "resourceStatus": + err = unpopulate(val, "ResourceStatus", &c.ResourceStatus) delete(rawMsg, key) } if err != nil { @@ -4600,16 +4760,16 @@ func (c *ConnectorSettingProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ConnectorsList. -func (c ConnectorsList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ComplianceSegment. +func (c ComplianceSegment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populate(objectMap, "percentage", c.Percentage) + populate(objectMap, "segmentType", c.SegmentType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectorsList. -func (c *ConnectorsList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ComplianceSegment. +func (c *ComplianceSegment) 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) @@ -4617,11 +4777,11 @@ func (c *ConnectorsList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) + case "percentage": + err = unpopulate(val, "Percentage", &c.Percentage) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "segmentType": + err = unpopulate(val, "SegmentType", &c.SegmentType) delete(rawMsg, key) } if err != nil { @@ -4631,18 +4791,17 @@ func (c *ConnectorsList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Contact. -func (c Contact) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Condition. +func (c Condition) 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, "type", c.Type) + populate(objectMap, "operator", c.Operator) + populate(objectMap, "property", c.Property) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Contact. -func (c *Contact) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Condition. +func (c *Condition) 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) @@ -4650,17 +4809,14 @@ func (c *Contact) UnmarshalJSON(data []byte) error { 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) + case "operator": + err = unpopulate(val, "Operator", &c.Operator) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "property": + err = unpopulate(val, "Property", &c.Property) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { @@ -4670,16 +4826,17 @@ func (c *Contact) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ContactList. -func (c ContactList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectableResource. +func (c ConnectableResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} + populate(objectMap, "id", c.ID) + populate(objectMap, "inboundConnectedResources", c.InboundConnectedResources) + populate(objectMap, "outboundConnectedResources", c.OutboundConnectedResources) + return json.Marshal(objectMap) +} -// UnmarshalJSON implements the json.Unmarshaller interface for type ContactList. -func (c *ContactList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectableResource. +func (c *ConnectableResource) 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) @@ -4687,11 +4844,14 @@ func (c *ContactList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "inboundConnectedResources": + err = unpopulate(val, "InboundConnectedResources", &c.InboundConnectedResources) + delete(rawMsg, key) + case "outboundConnectedResources": + err = unpopulate(val, "OutboundConnectedResources", &c.OutboundConnectedResources) delete(rawMsg, key) } if err != nil { @@ -4701,18 +4861,17 @@ func (c *ContactList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ContactProperties. -func (c ContactProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectedResource. +func (c ConnectedResource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "alertNotifications", c.AlertNotifications) - populate(objectMap, "emails", c.Emails) - populate(objectMap, "notificationsByRole", c.NotificationsByRole) - populate(objectMap, "phone", c.Phone) + populate(objectMap, "connectedResourceId", c.ConnectedResourceID) + populate(objectMap, "tcpPorts", c.TCPPorts) + populate(objectMap, "udpPorts", c.UDPPorts) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContactProperties. -func (c *ContactProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedResource. +func (c *ConnectedResource) 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) @@ -4720,17 +4879,14 @@ func (c *ContactProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "alertNotifications": - err = unpopulate(val, "AlertNotifications", &c.AlertNotifications) - delete(rawMsg, key) - case "emails": - err = unpopulate(val, "Emails", &c.Emails) + case "connectedResourceId": + err = unpopulate(val, "ConnectedResourceID", &c.ConnectedResourceID) delete(rawMsg, key) - case "notificationsByRole": - err = unpopulate(val, "NotificationsByRole", &c.NotificationsByRole) + case "tcpPorts": + err = unpopulate(val, "TCPPorts", &c.TCPPorts) delete(rawMsg, key) - case "phone": - err = unpopulate(val, "Phone", &c.Phone) + case "udpPorts": + err = unpopulate(val, "UDPPorts", &c.UDPPorts) delete(rawMsg, key) } if err != nil { @@ -4740,16 +4896,15 @@ func (c *ContactProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ContactPropertiesAlertNotifications. -func (c ContactPropertiesAlertNotifications) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectedWorkspace. +func (c ConnectedWorkspace) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "minimalSeverity", c.MinimalSeverity) - populate(objectMap, "state", c.State) + populate(objectMap, "id", c.ID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContactPropertiesAlertNotifications. -func (c *ContactPropertiesAlertNotifications) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectedWorkspace. +func (c *ConnectedWorkspace) 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) @@ -4757,11 +4912,8 @@ func (c *ContactPropertiesAlertNotifications) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "minimalSeverity": - err = unpopulate(val, "MinimalSeverity", &c.MinimalSeverity) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &c.State) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) } if err != nil { @@ -4771,16 +4923,20 @@ func (c *ContactPropertiesAlertNotifications) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ContactPropertiesNotificationsByRole. -func (c ContactPropertiesNotificationsByRole) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectionFromIPNotAllowed. +func (c ConnectionFromIPNotAllowed) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "roles", c.Roles) - populate(objectMap, "state", c.State) + populate(objectMap, "allowlistValues", c.AllowlistValues) + populate(objectMap, "description", c.Description) + populate(objectMap, "displayName", c.DisplayName) + populate(objectMap, "isEnabled", c.IsEnabled) + objectMap["ruleType"] = "ConnectionFromIpNotAllowed" + populate(objectMap, "valueType", c.ValueType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContactPropertiesNotificationsByRole. -func (c *ContactPropertiesNotificationsByRole) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionFromIPNotAllowed. +func (c *ConnectionFromIPNotAllowed) 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) @@ -4788,11 +4944,23 @@ func (c *ContactPropertiesNotificationsByRole) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "roles": - err = unpopulate(val, "Roles", &c.Roles) + case "allowlistValues": + err = unpopulate(val, "AllowlistValues", &c.AllowlistValues) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &c.State) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &c.DisplayName) + delete(rawMsg, key) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &c.IsEnabled) + delete(rawMsg, key) + case "ruleType": + err = unpopulate(val, "RuleType", &c.RuleType) + delete(rawMsg, key) + case "valueType": + err = unpopulate(val, "ValueType", &c.ValueType) delete(rawMsg, key) } if err != nil { @@ -4802,23 +4970,20 @@ func (c *ContactPropertiesNotificationsByRole) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type ContainerRegistryVulnerabilityProperties. -func (c ContainerRegistryVulnerabilityProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectionToIPNotAllowed. +func (c ConnectionToIPNotAllowed) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["assessedResourceType"] = AssessedResourceTypeContainerRegistryVulnerability - populate(objectMap, "cve", c.Cve) - populate(objectMap, "cvss", c.Cvss) - populate(objectMap, "imageDigest", c.ImageDigest) - populate(objectMap, "patchable", c.Patchable) - populateTimeRFC3339(objectMap, "publishedTime", c.PublishedTime) - populate(objectMap, "repositoryName", c.RepositoryName) - populate(objectMap, "type", c.Type) - populate(objectMap, "vendorReferences", c.VendorReferences) + populate(objectMap, "allowlistValues", c.AllowlistValues) + populate(objectMap, "description", c.Description) + populate(objectMap, "displayName", c.DisplayName) + populate(objectMap, "isEnabled", c.IsEnabled) + objectMap["ruleType"] = "ConnectionToIpNotAllowed" + populate(objectMap, "valueType", c.ValueType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerRegistryVulnerabilityProperties. -func (c *ContainerRegistryVulnerabilityProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectionToIPNotAllowed. +func (c *ConnectionToIPNotAllowed) 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) @@ -4826,32 +4991,23 @@ func (c *ContainerRegistryVulnerabilityProperties) UnmarshalJSON(data []byte) er for key, val := range rawMsg { var err error switch key { - case "assessedResourceType": - err = unpopulate(val, "AssessedResourceType", &c.AssessedResourceType) - delete(rawMsg, key) - case "cve": - err = unpopulate(val, "Cve", &c.Cve) - delete(rawMsg, key) - case "cvss": - err = unpopulate(val, "Cvss", &c.Cvss) - delete(rawMsg, key) - case "imageDigest": - err = unpopulate(val, "ImageDigest", &c.ImageDigest) + case "allowlistValues": + err = unpopulate(val, "AllowlistValues", &c.AllowlistValues) delete(rawMsg, key) - case "patchable": - err = unpopulate(val, "Patchable", &c.Patchable) + case "description": + err = unpopulate(val, "Description", &c.Description) delete(rawMsg, key) - case "publishedTime": - err = unpopulateTimeRFC3339(val, "PublishedTime", &c.PublishedTime) + case "displayName": + err = unpopulate(val, "DisplayName", &c.DisplayName) delete(rawMsg, key) - case "repositoryName": - err = unpopulate(val, "RepositoryName", &c.RepositoryName) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &c.IsEnabled) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "ruleType": + err = unpopulate(val, "RuleType", &c.RuleType) delete(rawMsg, key) - case "vendorReferences": - err = unpopulate(val, "VendorReferences", &c.VendorReferences) + case "valueType": + err = unpopulate(val, "ValueType", &c.ValueType) delete(rawMsg, key) } if err != nil { @@ -4861,17 +5017,23 @@ func (c *ContainerRegistryVulnerabilityProperties) UnmarshalJSON(data []byte) er return nil } -// MarshalJSON implements the json.Marshaller interface for type CspmMonitorAwsOffering. -func (c CspmMonitorAwsOffering) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Connector. +func (c Connector) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", c.Description) - populate(objectMap, "nativeCloudConnection", c.NativeCloudConnection) - objectMap["offeringType"] = OfferingTypeCspmMonitorAws + populate(objectMap, "etag", c.Etag) + populate(objectMap, "id", c.ID) + populate(objectMap, "kind", c.Kind) + populate(objectMap, "location", c.Location) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "systemData", c.SystemData) + populate(objectMap, "tags", c.Tags) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CspmMonitorAwsOffering. -func (c *CspmMonitorAwsOffering) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Connector. +func (c *Connector) 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) @@ -4879,14 +5041,32 @@ func (c *CspmMonitorAwsOffering) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &c.Description) + case "etag": + err = unpopulate(val, "Etag", &c.Etag) delete(rawMsg, key) - case "nativeCloudConnection": - err = unpopulate(val, "NativeCloudConnection", &c.NativeCloudConnection) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "offeringType": - err = unpopulate(val, "OfferingType", &c.OfferingType) + case "kind": + err = unpopulate(val, "Kind", &c.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &c.Location) + 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 "tags": + err = unpopulate(val, "Tags", &c.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { @@ -4896,15 +5076,19 @@ func (c *CspmMonitorAwsOffering) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CspmMonitorAwsOfferingNativeCloudConnection. -func (c CspmMonitorAwsOfferingNativeCloudConnection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectorProperties. +func (c ConnectorProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cloudRoleArn", c.CloudRoleArn) + populate(objectMap, "environmentData", c.EnvironmentData) + populate(objectMap, "environmentName", c.EnvironmentName) + populate(objectMap, "hierarchyIdentifier", c.HierarchyIdentifier) + populateTimeRFC3339(objectMap, "hierarchyIdentifierTrialEndDate", c.HierarchyIdentifierTrialEndDate) + populate(objectMap, "offerings", c.Offerings) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CspmMonitorAwsOfferingNativeCloudConnection. -func (c *CspmMonitorAwsOfferingNativeCloudConnection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectorProperties. +func (c *ConnectorProperties) 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) @@ -4912,8 +5096,20 @@ func (c *CspmMonitorAwsOfferingNativeCloudConnection) UnmarshalJSON(data []byte) for key, val := range rawMsg { var err error switch key { - case "cloudRoleArn": - err = unpopulate(val, "CloudRoleArn", &c.CloudRoleArn) + case "environmentData": + c.EnvironmentData, err = unmarshalEnvironmentDataClassification(val) + delete(rawMsg, key) + case "environmentName": + err = unpopulate(val, "EnvironmentName", &c.EnvironmentName) + delete(rawMsg, key) + case "hierarchyIdentifier": + err = unpopulate(val, "HierarchyIdentifier", &c.HierarchyIdentifier) + delete(rawMsg, key) + case "hierarchyIdentifierTrialEndDate": + err = unpopulateTimeRFC3339(val, "HierarchyIdentifierTrialEndDate", &c.HierarchyIdentifierTrialEndDate) + delete(rawMsg, key) + case "offerings": + c.Offerings, err = unmarshalCloudOfferingClassificationArray(val) delete(rawMsg, key) } if err != nil { @@ -4923,16 +5119,18 @@ func (c *CspmMonitorAwsOfferingNativeCloudConnection) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type CspmMonitorAzureDevOpsOffering. -func (c CspmMonitorAzureDevOpsOffering) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectorSetting. +func (c ConnectorSetting) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", c.Description) - objectMap["offeringType"] = OfferingTypeCspmMonitorAzureDevOps + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CspmMonitorAzureDevOpsOffering. -func (c *CspmMonitorAzureDevOpsOffering) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectorSetting. +func (c *ConnectorSetting) 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) @@ -4940,11 +5138,17 @@ func (c *CspmMonitorAzureDevOpsOffering) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &c.Description) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "offeringType": - err = unpopulate(val, "OfferingType", &c.OfferingType) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { @@ -4954,17 +5158,16 @@ func (c *CspmMonitorAzureDevOpsOffering) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CspmMonitorGcpOffering. -func (c CspmMonitorGcpOffering) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectorSettingList. +func (c ConnectorSettingList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", c.Description) - populate(objectMap, "nativeCloudConnection", c.NativeCloudConnection) - objectMap["offeringType"] = OfferingTypeCspmMonitorGcp + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CspmMonitorGcpOffering. -func (c *CspmMonitorGcpOffering) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectorSettingList. +func (c *ConnectorSettingList) 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) @@ -4972,14 +5175,11 @@ func (c *CspmMonitorGcpOffering) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &c.Description) - delete(rawMsg, key) - case "nativeCloudConnection": - err = unpopulate(val, "NativeCloudConnection", &c.NativeCloudConnection) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) - case "offeringType": - err = unpopulate(val, "OfferingType", &c.OfferingType) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { @@ -4989,16 +5189,16 @@ func (c *CspmMonitorGcpOffering) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CspmMonitorGcpOfferingNativeCloudConnection. -func (c CspmMonitorGcpOfferingNativeCloudConnection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectorSettingProperties. +func (c ConnectorSettingProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "serviceAccountEmailAddress", c.ServiceAccountEmailAddress) - populate(objectMap, "workloadIdentityProviderId", c.WorkloadIdentityProviderID) + populate(objectMap, "authenticationDetails", c.AuthenticationDetails) + populate(objectMap, "hybridComputeSettings", c.HybridComputeSettings) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CspmMonitorGcpOfferingNativeCloudConnection. -func (c *CspmMonitorGcpOfferingNativeCloudConnection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectorSettingProperties. +func (c *ConnectorSettingProperties) 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) @@ -5006,11 +5206,11 @@ func (c *CspmMonitorGcpOfferingNativeCloudConnection) UnmarshalJSON(data []byte) for key, val := range rawMsg { var err error switch key { - case "serviceAccountEmailAddress": - err = unpopulate(val, "ServiceAccountEmailAddress", &c.ServiceAccountEmailAddress) + case "authenticationDetails": + c.AuthenticationDetails, err = unmarshalAuthenticationDetailsPropertiesClassification(val) delete(rawMsg, key) - case "workloadIdentityProviderId": - err = unpopulate(val, "WorkloadIdentityProviderID", &c.WorkloadIdentityProviderID) + case "hybridComputeSettings": + err = unpopulate(val, "HybridComputeSettings", &c.HybridComputeSettings) delete(rawMsg, key) } if err != nil { @@ -5020,16 +5220,16 @@ func (c *CspmMonitorGcpOfferingNativeCloudConnection) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type CspmMonitorGitLabOffering. -func (c CspmMonitorGitLabOffering) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ConnectorsList. +func (c ConnectorsList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", c.Description) - objectMap["offeringType"] = OfferingTypeCspmMonitorGitLab + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CspmMonitorGitLabOffering. -func (c *CspmMonitorGitLabOffering) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectorsList. +func (c *ConnectorsList) 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) @@ -5037,11 +5237,11 @@ func (c *CspmMonitorGitLabOffering) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &c.Description) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) - case "offeringType": - err = unpopulate(val, "OfferingType", &c.OfferingType) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { @@ -5051,16 +5251,18 @@ func (c *CspmMonitorGitLabOffering) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CspmMonitorGithubOffering. -func (c CspmMonitorGithubOffering) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Contact. +func (c Contact) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", c.Description) - objectMap["offeringType"] = OfferingTypeCspmMonitorGithub + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CspmMonitorGithubOffering. -func (c *CspmMonitorGithubOffering) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Contact. +func (c *Contact) 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) @@ -5068,11 +5270,17 @@ func (c *CspmMonitorGithubOffering) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &c.Description) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "offeringType": - err = unpopulate(val, "OfferingType", &c.OfferingType) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { @@ -5082,18 +5290,16 @@ func (c *CspmMonitorGithubOffering) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomAlertRule. -func (c CustomAlertRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContactList. +func (c ContactList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", c.Description) - populate(objectMap, "displayName", c.DisplayName) - populate(objectMap, "isEnabled", c.IsEnabled) - objectMap["ruleType"] = c.RuleType + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomAlertRule. -func (c *CustomAlertRule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContactList. +func (c *ContactList) 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) @@ -5101,17 +5307,11 @@ func (c *CustomAlertRule) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &c.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &c.DisplayName) - delete(rawMsg, key) - case "isEnabled": - err = unpopulate(val, "IsEnabled", &c.IsEnabled) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) - case "ruleType": - err = unpopulate(val, "RuleType", &c.RuleType) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { @@ -5121,19 +5321,18 @@ func (c *CustomAlertRule) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomAssessmentAutomation. -func (c CustomAssessmentAutomation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContactProperties. +func (c ContactProperties) 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) + populate(objectMap, "alertNotifications", c.AlertNotifications) + populate(objectMap, "emails", c.Emails) + populate(objectMap, "notificationsByRole", c.NotificationsByRole) + populate(objectMap, "phone", c.Phone) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomAssessmentAutomation. -func (c *CustomAssessmentAutomation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContactProperties. +func (c *ContactProperties) 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) @@ -5141,20 +5340,17 @@ func (c *CustomAssessmentAutomation) UnmarshalJSON(data []byte) error { 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) + case "alertNotifications": + err = unpopulate(val, "AlertNotifications", &c.AlertNotifications) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "emails": + err = unpopulate(val, "Emails", &c.Emails) delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &c.SystemData) + case "notificationsByRole": + err = unpopulate(val, "NotificationsByRole", &c.NotificationsByRole) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "phone": + err = unpopulate(val, "Phone", &c.Phone) delete(rawMsg, key) } if err != nil { @@ -5164,27 +5360,16 @@ func (c *CustomAssessmentAutomation) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomAssessmentAutomationProperties. -func (c CustomAssessmentAutomationProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContactPropertiesAlertNotifications. +func (c ContactPropertiesAlertNotifications) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "assessmentKey", c.AssessmentKey) - populate(objectMap, "compressedQuery", c.CompressedQuery) - populate(objectMap, "description", c.Description) - populate(objectMap, "displayName", c.DisplayName) - populate(objectMap, "remediationDescription", c.RemediationDescription) - if c.Severity == nil { - c.Severity = to.Ptr(SeverityEnumLow) - } - populate(objectMap, "severity", c.Severity) - if c.SupportedCloud == nil { - c.SupportedCloud = to.Ptr(SupportedCloudEnumAWS) - } - populate(objectMap, "supportedCloud", c.SupportedCloud) + populate(objectMap, "minimalSeverity", c.MinimalSeverity) + populate(objectMap, "state", c.State) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomAssessmentAutomationProperties. -func (c *CustomAssessmentAutomationProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContactPropertiesAlertNotifications. +func (c *ContactPropertiesAlertNotifications) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -5192,26 +5377,11 @@ func (c *CustomAssessmentAutomationProperties) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "assessmentKey": - err = unpopulate(val, "AssessmentKey", &c.AssessmentKey) - delete(rawMsg, key) - case "compressedQuery": - err = unpopulate(val, "CompressedQuery", &c.CompressedQuery) - 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 "remediationDescription": - err = unpopulate(val, "RemediationDescription", &c.RemediationDescription) - delete(rawMsg, key) - case "severity": - err = unpopulate(val, "Severity", &c.Severity) + case "minimalSeverity": + err = unpopulate(val, "MinimalSeverity", &c.MinimalSeverity) delete(rawMsg, key) - case "supportedCloud": - err = unpopulate(val, "SupportedCloud", &c.SupportedCloud) + case "state": + err = unpopulate(val, "State", &c.State) delete(rawMsg, key) } if err != nil { @@ -5221,18 +5391,16 @@ func (c *CustomAssessmentAutomationProperties) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomAssessmentAutomationRequest. -func (c CustomAssessmentAutomationRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContactPropertiesNotificationsByRole. +func (c ContactPropertiesNotificationsByRole) 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, "type", c.Type) + populate(objectMap, "roles", c.Roles) + populate(objectMap, "state", c.State) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomAssessmentAutomationRequest. -func (c *CustomAssessmentAutomationRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContactPropertiesNotificationsByRole. +func (c *ContactPropertiesNotificationsByRole) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -5240,17 +5408,11 @@ func (c *CustomAssessmentAutomationRequest) UnmarshalJSON(data []byte) error { 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) + case "roles": + err = unpopulate(val, "Roles", &c.Roles) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &c.Type) + case "state": + err = unpopulate(val, "State", &c.State) delete(rawMsg, key) } if err != nil { @@ -5260,26 +5422,23 @@ func (c *CustomAssessmentAutomationRequest) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomAssessmentAutomationRequestProperties. -func (c CustomAssessmentAutomationRequestProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ContainerRegistryVulnerabilityProperties. +func (c ContainerRegistryVulnerabilityProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "compressedQuery", c.CompressedQuery) - populate(objectMap, "description", c.Description) - populate(objectMap, "displayName", c.DisplayName) - populate(objectMap, "remediationDescription", c.RemediationDescription) - if c.Severity == nil { - c.Severity = to.Ptr(SeverityEnumLow) - } - populate(objectMap, "severity", c.Severity) - if c.SupportedCloud == nil { - c.SupportedCloud = to.Ptr(SupportedCloudEnumAWS) - } - populate(objectMap, "supportedCloud", c.SupportedCloud) + objectMap["assessedResourceType"] = AssessedResourceTypeContainerRegistryVulnerability + populate(objectMap, "cve", c.Cve) + populate(objectMap, "cvss", c.Cvss) + populate(objectMap, "imageDigest", c.ImageDigest) + populate(objectMap, "patchable", c.Patchable) + populateTimeRFC3339(objectMap, "publishedTime", c.PublishedTime) + populate(objectMap, "repositoryName", c.RepositoryName) + populate(objectMap, "type", c.Type) + populate(objectMap, "vendorReferences", c.VendorReferences) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomAssessmentAutomationRequestProperties. -func (c *CustomAssessmentAutomationRequestProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerRegistryVulnerabilityProperties. +func (c *ContainerRegistryVulnerabilityProperties) 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) @@ -5287,23 +5446,32 @@ func (c *CustomAssessmentAutomationRequestProperties) UnmarshalJSON(data []byte) for key, val := range rawMsg { var err error switch key { - case "compressedQuery": - err = unpopulate(val, "CompressedQuery", &c.CompressedQuery) + case "assessedResourceType": + err = unpopulate(val, "AssessedResourceType", &c.AssessedResourceType) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &c.Description) + case "cve": + err = unpopulate(val, "Cve", &c.Cve) delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &c.DisplayName) + case "cvss": + err = unpopulate(val, "Cvss", &c.Cvss) delete(rawMsg, key) - case "remediationDescription": - err = unpopulate(val, "RemediationDescription", &c.RemediationDescription) + case "imageDigest": + err = unpopulate(val, "ImageDigest", &c.ImageDigest) delete(rawMsg, key) - case "severity": - err = unpopulate(val, "Severity", &c.Severity) + case "patchable": + err = unpopulate(val, "Patchable", &c.Patchable) delete(rawMsg, key) - case "supportedCloud": - err = unpopulate(val, "SupportedCloud", &c.SupportedCloud) + case "publishedTime": + err = unpopulateTimeRFC3339(val, "PublishedTime", &c.PublishedTime) + delete(rawMsg, key) + case "repositoryName": + err = unpopulate(val, "RepositoryName", &c.RepositoryName) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + case "vendorReferences": + err = unpopulate(val, "VendorReferences", &c.VendorReferences) delete(rawMsg, key) } if err != nil { @@ -5313,16 +5481,17 @@ func (c *CustomAssessmentAutomationRequestProperties) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomAssessmentAutomationsListResult. -func (c CustomAssessmentAutomationsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CspmMonitorAwsOffering. +func (c CspmMonitorAwsOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populate(objectMap, "description", c.Description) + populate(objectMap, "nativeCloudConnection", c.NativeCloudConnection) + objectMap["offeringType"] = OfferingTypeCspmMonitorAws return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomAssessmentAutomationsListResult. -func (c *CustomAssessmentAutomationsListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CspmMonitorAwsOffering. +func (c *CspmMonitorAwsOffering) 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) @@ -5330,11 +5499,14 @@ func (c *CustomAssessmentAutomationsListResult) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) + case "description": + err = unpopulate(val, "Description", &c.Description) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "nativeCloudConnection": + err = unpopulate(val, "NativeCloudConnection", &c.NativeCloudConnection) + delete(rawMsg, key) + case "offeringType": + err = unpopulate(val, "OfferingType", &c.OfferingType) delete(rawMsg, key) } if err != nil { @@ -5344,19 +5516,15 @@ func (c *CustomAssessmentAutomationsListResult) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomEntityStoreAssignment. -func (c CustomEntityStoreAssignment) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CspmMonitorAwsOfferingNativeCloudConnection. +func (c CspmMonitorAwsOfferingNativeCloudConnection) 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) + populate(objectMap, "cloudRoleArn", c.CloudRoleArn) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomEntityStoreAssignment. -func (c *CustomEntityStoreAssignment) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CspmMonitorAwsOfferingNativeCloudConnection. +func (c *CspmMonitorAwsOfferingNativeCloudConnection) 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) @@ -5364,20 +5532,8 @@ func (c *CustomEntityStoreAssignment) UnmarshalJSON(data []byte) error { 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) + case "cloudRoleArn": + err = unpopulate(val, "CloudRoleArn", &c.CloudRoleArn) delete(rawMsg, key) } if err != nil { @@ -5387,16 +5543,16 @@ func (c *CustomEntityStoreAssignment) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomEntityStoreAssignmentProperties. -func (c CustomEntityStoreAssignmentProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CspmMonitorAzureDevOpsOffering. +func (c CspmMonitorAzureDevOpsOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "entityStoreDatabaseLink", c.EntityStoreDatabaseLink) - populate(objectMap, "principal", c.Principal) + populate(objectMap, "description", c.Description) + objectMap["offeringType"] = OfferingTypeCspmMonitorAzureDevOps return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomEntityStoreAssignmentProperties. -func (c *CustomEntityStoreAssignmentProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CspmMonitorAzureDevOpsOffering. +func (c *CspmMonitorAzureDevOpsOffering) 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) @@ -5404,11 +5560,11 @@ func (c *CustomEntityStoreAssignmentProperties) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "entityStoreDatabaseLink": - err = unpopulate(val, "EntityStoreDatabaseLink", &c.EntityStoreDatabaseLink) + case "description": + err = unpopulate(val, "Description", &c.Description) delete(rawMsg, key) - case "principal": - err = unpopulate(val, "Principal", &c.Principal) + case "offeringType": + err = unpopulate(val, "OfferingType", &c.OfferingType) delete(rawMsg, key) } if err != nil { @@ -5418,15 +5574,17 @@ func (c *CustomEntityStoreAssignmentProperties) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomEntityStoreAssignmentRequest. -func (c CustomEntityStoreAssignmentRequest) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CspmMonitorGcpOffering. +func (c CspmMonitorGcpOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "properties", c.Properties) + populate(objectMap, "description", c.Description) + populate(objectMap, "nativeCloudConnection", c.NativeCloudConnection) + objectMap["offeringType"] = OfferingTypeCspmMonitorGcp return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomEntityStoreAssignmentRequest. -func (c *CustomEntityStoreAssignmentRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CspmMonitorGcpOffering. +func (c *CspmMonitorGcpOffering) 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) @@ -5434,8 +5592,14 @@ func (c *CustomEntityStoreAssignmentRequest) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "properties": - err = unpopulate(val, "Properties", &c.Properties) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "nativeCloudConnection": + err = unpopulate(val, "NativeCloudConnection", &c.NativeCloudConnection) + delete(rawMsg, key) + case "offeringType": + err = unpopulate(val, "OfferingType", &c.OfferingType) delete(rawMsg, key) } if err != nil { @@ -5445,15 +5609,16 @@ func (c *CustomEntityStoreAssignmentRequest) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomEntityStoreAssignmentRequestProperties. -func (c CustomEntityStoreAssignmentRequestProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CspmMonitorGcpOfferingNativeCloudConnection. +func (c CspmMonitorGcpOfferingNativeCloudConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "principal", c.Principal) + populate(objectMap, "serviceAccountEmailAddress", c.ServiceAccountEmailAddress) + populate(objectMap, "workloadIdentityProviderId", c.WorkloadIdentityProviderID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomEntityStoreAssignmentRequestProperties. -func (c *CustomEntityStoreAssignmentRequestProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CspmMonitorGcpOfferingNativeCloudConnection. +func (c *CspmMonitorGcpOfferingNativeCloudConnection) 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) @@ -5461,8 +5626,11 @@ func (c *CustomEntityStoreAssignmentRequestProperties) UnmarshalJSON(data []byte for key, val := range rawMsg { var err error switch key { - case "principal": - err = unpopulate(val, "Principal", &c.Principal) + case "serviceAccountEmailAddress": + err = unpopulate(val, "ServiceAccountEmailAddress", &c.ServiceAccountEmailAddress) + delete(rawMsg, key) + case "workloadIdentityProviderId": + err = unpopulate(val, "WorkloadIdentityProviderID", &c.WorkloadIdentityProviderID) delete(rawMsg, key) } if err != nil { @@ -5472,16 +5640,16 @@ func (c *CustomEntityStoreAssignmentRequestProperties) UnmarshalJSON(data []byte return nil } -// MarshalJSON implements the json.Marshaller interface for type CustomEntityStoreAssignmentsListResult. -func (c CustomEntityStoreAssignmentsListResult) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CspmMonitorGitLabOffering. +func (c CspmMonitorGitLabOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populate(objectMap, "description", c.Description) + objectMap["offeringType"] = OfferingTypeCspmMonitorGitLab return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type CustomEntityStoreAssignmentsListResult. -func (c *CustomEntityStoreAssignmentsListResult) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CspmMonitorGitLabOffering. +func (c *CspmMonitorGitLabOffering) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -5489,11 +5657,11 @@ func (c *CustomEntityStoreAssignmentsListResult) UnmarshalJSON(data []byte) erro for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) + case "description": + err = unpopulate(val, "Description", &c.Description) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "offeringType": + err = unpopulate(val, "OfferingType", &c.OfferingType) delete(rawMsg, key) } if err != nil { @@ -5503,397 +5671,467 @@ func (c *CustomEntityStoreAssignmentsListResult) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type DataExportSettingProperties. -func (d DataExportSettingProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CspmMonitorGithubOffering. +func (c CspmMonitorGithubOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "enabled", d.Enabled) + populate(objectMap, "description", c.Description) + objectMap["offeringType"] = OfferingTypeCspmMonitorGithub return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DataExportSettingProperties. -func (d *DataExportSettingProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CspmMonitorGithubOffering. +func (c *CspmMonitorGithubOffering) 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) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "enabled": - err = unpopulate(val, "Enabled", &d.Enabled) + 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DataExportSettings. -func (d DataExportSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomAlertRule. +func (c CustomAlertRule) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - objectMap["kind"] = SettingKindDataExportSettings - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "type", d.Type) + populate(objectMap, "description", c.Description) + populate(objectMap, "displayName", c.DisplayName) + populate(objectMap, "isEnabled", c.IsEnabled) + objectMap["ruleType"] = c.RuleType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DataExportSettings. -func (d *DataExportSettings) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomAlertRule. +func (c *CustomAlertRule) 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) + 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", &d.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &d.Kind) + case "description": + err = unpopulate(val, "Description", &c.Description) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) + case "displayName": + err = unpopulate(val, "DisplayName", &c.DisplayName) delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &c.IsEnabled) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) + case "ruleType": + err = unpopulate(val, "RuleType", &c.RuleType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderCspmAwsOffering. -func (d DefenderCspmAwsOffering) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomAssessmentAutomation. +func (c CustomAssessmentAutomation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "dataSensitivityDiscovery", d.DataSensitivityDiscovery) - populate(objectMap, "databasesDspm", d.DatabasesDspm) - populate(objectMap, "description", d.Description) - objectMap["offeringType"] = OfferingTypeDefenderCspmAws - populate(objectMap, "vmScanners", d.VMScanners) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmAwsOffering. -func (d *DefenderCspmAwsOffering) UnmarshalJSON(data []byte) error { + 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 CustomAssessmentAutomation. +func (c *CustomAssessmentAutomation) 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) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "dataSensitivityDiscovery": - err = unpopulate(val, "DataSensitivityDiscovery", &d.DataSensitivityDiscovery) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "databasesDspm": - err = unpopulate(val, "DatabasesDspm", &d.DatabasesDspm) + case "name": + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &d.Description) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) - case "offeringType": - err = unpopulate(val, "OfferingType", &d.OfferingType) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) delete(rawMsg, key) - case "vmScanners": - err = unpopulate(val, "VMScanners", &d.VMScanners) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderCspmAwsOfferingDataSensitivityDiscovery. -func (d DefenderCspmAwsOfferingDataSensitivityDiscovery) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomAssessmentAutomationProperties. +func (c CustomAssessmentAutomationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cloudRoleArn", d.CloudRoleArn) - populate(objectMap, "enabled", d.Enabled) + populate(objectMap, "assessmentKey", c.AssessmentKey) + populate(objectMap, "compressedQuery", c.CompressedQuery) + populate(objectMap, "description", c.Description) + populate(objectMap, "displayName", c.DisplayName) + populate(objectMap, "remediationDescription", c.RemediationDescription) + if c.Severity == nil { + c.Severity = to.Ptr(SeverityEnumLow) + } + populate(objectMap, "severity", c.Severity) + if c.SupportedCloud == nil { + c.SupportedCloud = to.Ptr(SupportedCloudEnumAWS) + } + populate(objectMap, "supportedCloud", c.SupportedCloud) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmAwsOfferingDataSensitivityDiscovery. -func (d *DefenderCspmAwsOfferingDataSensitivityDiscovery) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomAssessmentAutomationProperties. +func (c *CustomAssessmentAutomationProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "cloudRoleArn": - err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) + case "assessmentKey": + err = unpopulate(val, "AssessmentKey", &c.AssessmentKey) delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &d.Enabled) + case "compressedQuery": + err = unpopulate(val, "CompressedQuery", &c.CompressedQuery) + 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 "remediationDescription": + err = unpopulate(val, "RemediationDescription", &c.RemediationDescription) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &c.Severity) + delete(rawMsg, key) + case "supportedCloud": + err = unpopulate(val, "SupportedCloud", &c.SupportedCloud) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderCspmAwsOfferingDatabasesDspm. -func (d DefenderCspmAwsOfferingDatabasesDspm) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomAssessmentAutomationRequest. +func (c CustomAssessmentAutomationRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cloudRoleArn", d.CloudRoleArn) - populate(objectMap, "enabled", d.Enabled) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmAwsOfferingDatabasesDspm. -func (d *DefenderCspmAwsOfferingDatabasesDspm) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomAssessmentAutomationRequest. +func (c *CustomAssessmentAutomationRequest) 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) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "cloudRoleArn": - err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &d.Enabled) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderCspmAwsOfferingVMScanners. -func (d DefenderCspmAwsOfferingVMScanners) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomAssessmentAutomationRequestProperties. +func (c CustomAssessmentAutomationRequestProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "configuration", d.Configuration) - populate(objectMap, "enabled", d.Enabled) + populate(objectMap, "compressedQuery", c.CompressedQuery) + populate(objectMap, "description", c.Description) + populate(objectMap, "displayName", c.DisplayName) + populate(objectMap, "remediationDescription", c.RemediationDescription) + if c.Severity == nil { + c.Severity = to.Ptr(SeverityEnumLow) + } + populate(objectMap, "severity", c.Severity) + if c.SupportedCloud == nil { + c.SupportedCloud = to.Ptr(SupportedCloudEnumAWS) + } + populate(objectMap, "supportedCloud", c.SupportedCloud) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmAwsOfferingVMScanners. -func (d *DefenderCspmAwsOfferingVMScanners) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomAssessmentAutomationRequestProperties. +func (c *CustomAssessmentAutomationRequestProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "configuration": - err = unpopulate(val, "Configuration", &d.Configuration) + case "compressedQuery": + err = unpopulate(val, "CompressedQuery", &c.CompressedQuery) delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &d.Enabled) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &c.DisplayName) + delete(rawMsg, key) + case "remediationDescription": + err = unpopulate(val, "RemediationDescription", &c.RemediationDescription) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &c.Severity) + delete(rawMsg, key) + case "supportedCloud": + err = unpopulate(val, "SupportedCloud", &c.SupportedCloud) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderCspmAwsOfferingVMScannersConfiguration. -func (d DefenderCspmAwsOfferingVMScannersConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomAssessmentAutomationsListResult. +func (c CustomAssessmentAutomationsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cloudRoleArn", d.CloudRoleArn) - populate(objectMap, "exclusionTags", d.ExclusionTags) - populate(objectMap, "scanningMode", d.ScanningMode) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmAwsOfferingVMScannersConfiguration. -func (d *DefenderCspmAwsOfferingVMScannersConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomAssessmentAutomationsListResult. +func (c *CustomAssessmentAutomationsListResult) 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) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "cloudRoleArn": - err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) - delete(rawMsg, key) - case "exclusionTags": - err = unpopulate(val, "ExclusionTags", &d.ExclusionTags) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) - case "scanningMode": - err = unpopulate(val, "ScanningMode", &d.ScanningMode) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } 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 CustomEntityStoreAssignment. +func (c CustomEntityStoreAssignment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", d.Description) - objectMap["offeringType"] = OfferingTypeDefenderCspmGcp + 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 DefenderCspmGcpOffering. -func (d *DefenderCspmGcpOffering) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomEntityStoreAssignment. +func (c *CustomEntityStoreAssignment) 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) + 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", &d.Description) + case "id": + err = unpopulate(val, "ID", &c.ID) delete(rawMsg, key) - case "offeringType": - err = unpopulate(val, "OfferingType", &d.OfferingType) + 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", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderFoDatabasesAwsOffering. -func (d DefenderFoDatabasesAwsOffering) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomEntityStoreAssignmentProperties. +func (c CustomEntityStoreAssignmentProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "arcAutoProvisioning", d.ArcAutoProvisioning) - populate(objectMap, "databasesDspm", d.DatabasesDspm) - populate(objectMap, "description", d.Description) - objectMap["offeringType"] = OfferingTypeDefenderForDatabasesAws - populate(objectMap, "rds", d.Rds) + populate(objectMap, "entityStoreDatabaseLink", c.EntityStoreDatabaseLink) + populate(objectMap, "principal", c.Principal) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderFoDatabasesAwsOffering. -func (d *DefenderFoDatabasesAwsOffering) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomEntityStoreAssignmentProperties. +func (c *CustomEntityStoreAssignmentProperties) 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) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "arcAutoProvisioning": - err = unpopulate(val, "ArcAutoProvisioning", &d.ArcAutoProvisioning) - delete(rawMsg, key) - case "databasesDspm": - err = unpopulate(val, "DatabasesDspm", &d.DatabasesDspm) + case "entityStoreDatabaseLink": + err = unpopulate(val, "EntityStoreDatabaseLink", &c.EntityStoreDatabaseLink) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &d.Description) - delete(rawMsg, key) - case "offeringType": - err = unpopulate(val, "OfferingType", &d.OfferingType) - delete(rawMsg, key) - case "rds": - err = unpopulate(val, "Rds", &d.Rds) + case "principal": + err = unpopulate(val, "Principal", &c.Principal) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderFoDatabasesAwsOfferingArcAutoProvisioning. -func (d DefenderFoDatabasesAwsOfferingArcAutoProvisioning) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomEntityStoreAssignmentRequest. +func (c CustomEntityStoreAssignmentRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cloudRoleArn", d.CloudRoleArn) - populate(objectMap, "configuration", d.Configuration) - populate(objectMap, "enabled", d.Enabled) + populate(objectMap, "properties", c.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderFoDatabasesAwsOfferingArcAutoProvisioning. -func (d *DefenderFoDatabasesAwsOfferingArcAutoProvisioning) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomEntityStoreAssignmentRequest. +func (c *CustomEntityStoreAssignmentRequest) 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) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "cloudRoleArn": - err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) - delete(rawMsg, key) - case "configuration": - err = unpopulate(val, "Configuration", &d.Configuration) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &d.Enabled) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CustomEntityStoreAssignmentRequestProperties. +func (c CustomEntityStoreAssignmentRequestProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "principal", c.Principal) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomEntityStoreAssignmentRequestProperties. +func (c *CustomEntityStoreAssignmentRequestProperties) 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 "principal": + err = unpopulate(val, "Principal", &c.Principal) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration. -func (d DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type CustomEntityStoreAssignmentsListResult. +func (c CustomEntityStoreAssignmentsListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "privateLinkScope", d.PrivateLinkScope) - populate(objectMap, "proxy", d.Proxy) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration. -func (d *DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type CustomEntityStoreAssignmentsListResult. +func (c *CustomEntityStoreAssignmentsListResult) 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) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "privateLinkScope": - err = unpopulate(val, "PrivateLinkScope", &d.PrivateLinkScope) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) - case "proxy": - err = unpopulate(val, "Proxy", &d.Proxy) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderFoDatabasesAwsOfferingDatabasesDspm. -func (d DefenderFoDatabasesAwsOfferingDatabasesDspm) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataExportSettingProperties. +func (d DataExportSettingProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cloudRoleArn", d.CloudRoleArn) populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderFoDatabasesAwsOfferingDatabasesDspm. -func (d *DefenderFoDatabasesAwsOfferingDatabasesDspm) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataExportSettingProperties. +func (d *DataExportSettingProperties) 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) @@ -5901,9 +6139,6 @@ func (d *DefenderFoDatabasesAwsOfferingDatabasesDspm) UnmarshalJSON(data []byte) for key, val := range rawMsg { var err error switch key { - case "cloudRoleArn": - err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) - delete(rawMsg, key) case "enabled": err = unpopulate(val, "Enabled", &d.Enabled) delete(rawMsg, key) @@ -5915,16 +6150,19 @@ func (d *DefenderFoDatabasesAwsOfferingDatabasesDspm) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderFoDatabasesAwsOfferingRds. -func (d DefenderFoDatabasesAwsOfferingRds) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DataExportSettings. +func (d DataExportSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cloudRoleArn", d.CloudRoleArn) - populate(objectMap, "enabled", d.Enabled) + populate(objectMap, "id", d.ID) + objectMap["kind"] = SettingKindDataExportSettings + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderFoDatabasesAwsOfferingRds. -func (d *DefenderFoDatabasesAwsOfferingRds) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DataExportSettings. +func (d *DataExportSettings) 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) @@ -5932,11 +6170,20 @@ func (d *DefenderFoDatabasesAwsOfferingRds) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "cloudRoleArn": - err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) + case "id": + err = unpopulate(val, "ID", &d.ID) delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &d.Enabled) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) delete(rawMsg, key) } if err != nil { @@ -5946,26 +6193,22 @@ func (d *DefenderFoDatabasesAwsOfferingRds) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersAwsOffering. -func (d DefenderForContainersAwsOffering) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderCspmAwsOffering. +func (d DefenderCspmAwsOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "autoProvisioning", d.AutoProvisioning) - populate(objectMap, "cloudWatchToKinesis", d.CloudWatchToKinesis) - populate(objectMap, "containerVulnerabilityAssessment", d.ContainerVulnerabilityAssessment) - populate(objectMap, "containerVulnerabilityAssessmentTask", d.ContainerVulnerabilityAssessmentTask) + populate(objectMap, "ciem", d.Ciem) + populate(objectMap, "dataSensitivityDiscovery", d.DataSensitivityDiscovery) + populate(objectMap, "databasesDspm", d.DatabasesDspm) populate(objectMap, "description", d.Description) - populate(objectMap, "enableContainerVulnerabilityAssessment", d.EnableContainerVulnerabilityAssessment) - populate(objectMap, "kinesisToS3", d.KinesisToS3) - populate(objectMap, "kubeAuditRetentionTime", d.KubeAuditRetentionTime) - populate(objectMap, "kubernetesScubaReader", d.KubernetesScubaReader) - populate(objectMap, "kubernetesService", d.KubernetesService) - objectMap["offeringType"] = OfferingTypeDefenderForContainersAws - populate(objectMap, "scubaExternalId", d.ScubaExternalID) + populate(objectMap, "mdcContainersAgentlessDiscoveryK8s", d.MdcContainersAgentlessDiscoveryK8S) + populate(objectMap, "mdcContainersImageAssessment", d.MdcContainersImageAssessment) + objectMap["offeringType"] = OfferingTypeDefenderCspmAws + populate(objectMap, "vmScanners", d.VMScanners) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersAwsOffering. -func (d *DefenderForContainersAwsOffering) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmAwsOffering. +func (d *DefenderCspmAwsOffering) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -5973,41 +6216,29 @@ func (d *DefenderForContainersAwsOffering) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "autoProvisioning": - err = unpopulate(val, "AutoProvisioning", &d.AutoProvisioning) + case "ciem": + err = unpopulate(val, "Ciem", &d.Ciem) delete(rawMsg, key) - case "cloudWatchToKinesis": - err = unpopulate(val, "CloudWatchToKinesis", &d.CloudWatchToKinesis) - delete(rawMsg, key) - case "containerVulnerabilityAssessment": - err = unpopulate(val, "ContainerVulnerabilityAssessment", &d.ContainerVulnerabilityAssessment) + case "dataSensitivityDiscovery": + err = unpopulate(val, "DataSensitivityDiscovery", &d.DataSensitivityDiscovery) delete(rawMsg, key) - case "containerVulnerabilityAssessmentTask": - err = unpopulate(val, "ContainerVulnerabilityAssessmentTask", &d.ContainerVulnerabilityAssessmentTask) + case "databasesDspm": + err = unpopulate(val, "DatabasesDspm", &d.DatabasesDspm) delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &d.Description) delete(rawMsg, key) - case "enableContainerVulnerabilityAssessment": - err = unpopulate(val, "EnableContainerVulnerabilityAssessment", &d.EnableContainerVulnerabilityAssessment) - delete(rawMsg, key) - case "kinesisToS3": - err = unpopulate(val, "KinesisToS3", &d.KinesisToS3) - delete(rawMsg, key) - case "kubeAuditRetentionTime": - err = unpopulate(val, "KubeAuditRetentionTime", &d.KubeAuditRetentionTime) - delete(rawMsg, key) - case "kubernetesScubaReader": - err = unpopulate(val, "KubernetesScubaReader", &d.KubernetesScubaReader) + case "mdcContainersAgentlessDiscoveryK8s": + err = unpopulate(val, "MdcContainersAgentlessDiscoveryK8S", &d.MdcContainersAgentlessDiscoveryK8S) delete(rawMsg, key) - case "kubernetesService": - err = unpopulate(val, "KubernetesService", &d.KubernetesService) + case "mdcContainersImageAssessment": + err = unpopulate(val, "MdcContainersImageAssessment", &d.MdcContainersImageAssessment) delete(rawMsg, key) case "offeringType": err = unpopulate(val, "OfferingType", &d.OfferingType) delete(rawMsg, key) - case "scubaExternalId": - err = unpopulate(val, "ScubaExternalID", &d.ScubaExternalID) + case "vmScanners": + err = unpopulate(val, "VMScanners", &d.VMScanners) delete(rawMsg, key) } if err != nil { @@ -6017,15 +6248,16 @@ func (d *DefenderForContainersAwsOffering) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersAwsOfferingCloudWatchToKinesis. -func (d DefenderForContainersAwsOfferingCloudWatchToKinesis) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderCspmAwsOfferingCiem. +func (d DefenderCspmAwsOfferingCiem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "cloudRoleArn", d.CloudRoleArn) + populate(objectMap, "ciemDiscovery", d.CiemDiscovery) + populate(objectMap, "ciemOidc", d.CiemOidc) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersAwsOfferingCloudWatchToKinesis. -func (d *DefenderForContainersAwsOfferingCloudWatchToKinesis) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmAwsOfferingCiem. +func (d *DefenderCspmAwsOfferingCiem) 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) @@ -6033,8 +6265,11 @@ func (d *DefenderForContainersAwsOfferingCloudWatchToKinesis) UnmarshalJSON(data for key, val := range rawMsg { var err error switch key { - case "cloudRoleArn": - err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) + case "ciemDiscovery": + err = unpopulate(val, "CiemDiscovery", &d.CiemDiscovery) + delete(rawMsg, key) + case "ciemOidc": + err = unpopulate(val, "CiemOidc", &d.CiemOidc) delete(rawMsg, key) } if err != nil { @@ -6044,15 +6279,15 @@ func (d *DefenderForContainersAwsOfferingCloudWatchToKinesis) UnmarshalJSON(data return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersAwsOfferingContainerVulnerabilityAssessment. -func (d DefenderForContainersAwsOfferingContainerVulnerabilityAssessment) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderCspmAwsOfferingCiemDiscovery. +func (d DefenderCspmAwsOfferingCiemDiscovery) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersAwsOfferingContainerVulnerabilityAssessment. -func (d *DefenderForContainersAwsOfferingContainerVulnerabilityAssessment) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmAwsOfferingCiemDiscovery. +func (d *DefenderCspmAwsOfferingCiemDiscovery) 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) @@ -6071,15 +6306,16 @@ func (d *DefenderForContainersAwsOfferingContainerVulnerabilityAssessment) Unmar return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask. -func (d DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderCspmAwsOfferingCiemOidc. +func (d DefenderCspmAwsOfferingCiemOidc) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "azureActiveDirectoryAppName", d.AzureActiveDirectoryAppName) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask. -func (d *DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmAwsOfferingCiemOidc. +func (d *DefenderCspmAwsOfferingCiemOidc) 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) @@ -6087,6 +6323,9 @@ func (d *DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask) U for key, val := range rawMsg { var err error switch key { + case "azureActiveDirectoryAppName": + err = unpopulate(val, "AzureActiveDirectoryAppName", &d.AzureActiveDirectoryAppName) + delete(rawMsg, key) case "cloudRoleArn": err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) delete(rawMsg, key) @@ -6098,15 +6337,16 @@ func (d *DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask) U return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersAwsOfferingKinesisToS3. -func (d DefenderForContainersAwsOfferingKinesisToS3) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderCspmAwsOfferingDataSensitivityDiscovery. +func (d DefenderCspmAwsOfferingDataSensitivityDiscovery) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) + populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersAwsOfferingKinesisToS3. -func (d *DefenderForContainersAwsOfferingKinesisToS3) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmAwsOfferingDataSensitivityDiscovery. +func (d *DefenderCspmAwsOfferingDataSensitivityDiscovery) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -6117,6 +6357,9 @@ func (d *DefenderForContainersAwsOfferingKinesisToS3) UnmarshalJSON(data []byte) case "cloudRoleArn": err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -6125,15 +6368,16 @@ func (d *DefenderForContainersAwsOfferingKinesisToS3) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersAwsOfferingKubernetesScubaReader. -func (d DefenderForContainersAwsOfferingKubernetesScubaReader) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderCspmAwsOfferingDatabasesDspm. +func (d DefenderCspmAwsOfferingDatabasesDspm) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) + populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersAwsOfferingKubernetesScubaReader. -func (d *DefenderForContainersAwsOfferingKubernetesScubaReader) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmAwsOfferingDatabasesDspm. +func (d *DefenderCspmAwsOfferingDatabasesDspm) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -6144,6 +6388,9 @@ func (d *DefenderForContainersAwsOfferingKubernetesScubaReader) UnmarshalJSON(da case "cloudRoleArn": err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -6152,15 +6399,16 @@ func (d *DefenderForContainersAwsOfferingKubernetesScubaReader) UnmarshalJSON(da return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersAwsOfferingKubernetesService. -func (d DefenderForContainersAwsOfferingKubernetesService) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S. +func (d DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) + populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersAwsOfferingKubernetesService. -func (d *DefenderForContainersAwsOfferingKubernetesService) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S. +func (d *DefenderCspmAwsOfferingMdcContainersAgentlessDiscoveryK8S) 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) @@ -6171,6 +6419,9 @@ func (d *DefenderForContainersAwsOfferingKubernetesService) UnmarshalJSON(data [ case "cloudRoleArn": err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -6179,21 +6430,16 @@ func (d *DefenderForContainersAwsOfferingKubernetesService) UnmarshalJSON(data [ return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersGcpOffering. -func (d DefenderForContainersGcpOffering) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderCspmAwsOfferingMdcContainersImageAssessment. +func (d DefenderCspmAwsOfferingMdcContainersImageAssessment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "auditLogsAutoProvisioningFlag", d.AuditLogsAutoProvisioningFlag) - populate(objectMap, "dataPipelineNativeCloudConnection", d.DataPipelineNativeCloudConnection) - populate(objectMap, "defenderAgentAutoProvisioningFlag", d.DefenderAgentAutoProvisioningFlag) - populate(objectMap, "description", d.Description) - populate(objectMap, "nativeCloudConnection", d.NativeCloudConnection) - objectMap["offeringType"] = OfferingTypeDefenderForContainersGcp - populate(objectMap, "policyAgentAutoProvisioningFlag", d.PolicyAgentAutoProvisioningFlag) + populate(objectMap, "cloudRoleArn", d.CloudRoleArn) + populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersGcpOffering. -func (d *DefenderForContainersGcpOffering) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmAwsOfferingMdcContainersImageAssessment. +func (d *DefenderCspmAwsOfferingMdcContainersImageAssessment) 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) @@ -6201,26 +6447,11 @@ func (d *DefenderForContainersGcpOffering) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "auditLogsAutoProvisioningFlag": - err = unpopulate(val, "AuditLogsAutoProvisioningFlag", &d.AuditLogsAutoProvisioningFlag) - delete(rawMsg, key) - case "dataPipelineNativeCloudConnection": - err = unpopulate(val, "DataPipelineNativeCloudConnection", &d.DataPipelineNativeCloudConnection) - delete(rawMsg, key) - case "defenderAgentAutoProvisioningFlag": - err = unpopulate(val, "DefenderAgentAutoProvisioningFlag", &d.DefenderAgentAutoProvisioningFlag) + case "cloudRoleArn": + err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &d.Description) - delete(rawMsg, key) - case "nativeCloudConnection": - err = unpopulate(val, "NativeCloudConnection", &d.NativeCloudConnection) - delete(rawMsg, key) - case "offeringType": - err = unpopulate(val, "OfferingType", &d.OfferingType) - delete(rawMsg, key) - case "policyAgentAutoProvisioningFlag": - err = unpopulate(val, "PolicyAgentAutoProvisioningFlag", &d.PolicyAgentAutoProvisioningFlag) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) delete(rawMsg, key) } if err != nil { @@ -6230,16 +6461,16 @@ func (d *DefenderForContainersGcpOffering) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection. -func (d DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderCspmAwsOfferingVMScanners. +func (d DefenderCspmAwsOfferingVMScanners) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "serviceAccountEmailAddress", d.ServiceAccountEmailAddress) - populate(objectMap, "workloadIdentityProviderId", d.WorkloadIdentityProviderID) + populate(objectMap, "configuration", d.Configuration) + populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection. -func (d *DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmAwsOfferingVMScanners. +func (d *DefenderCspmAwsOfferingVMScanners) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -6247,11 +6478,11 @@ func (d *DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection) Unma for key, val := range rawMsg { var err error switch key { - case "serviceAccountEmailAddress": - err = unpopulate(val, "ServiceAccountEmailAddress", &d.ServiceAccountEmailAddress) + case "configuration": + err = unpopulate(val, "Configuration", &d.Configuration) delete(rawMsg, key) - case "workloadIdentityProviderId": - err = unpopulate(val, "WorkloadIdentityProviderID", &d.WorkloadIdentityProviderID) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) delete(rawMsg, key) } if err != nil { @@ -6261,16 +6492,17 @@ func (d *DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection) Unma return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersGcpOfferingNativeCloudConnection. -func (d DefenderForContainersGcpOfferingNativeCloudConnection) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderCspmAwsOfferingVMScannersConfiguration. +func (d DefenderCspmAwsOfferingVMScannersConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "serviceAccountEmailAddress", d.ServiceAccountEmailAddress) - populate(objectMap, "workloadIdentityProviderId", d.WorkloadIdentityProviderID) + populate(objectMap, "cloudRoleArn", d.CloudRoleArn) + populate(objectMap, "exclusionTags", d.ExclusionTags) + populate(objectMap, "scanningMode", d.ScanningMode) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersGcpOfferingNativeCloudConnection. -func (d *DefenderForContainersGcpOfferingNativeCloudConnection) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmAwsOfferingVMScannersConfiguration. +func (d *DefenderCspmAwsOfferingVMScannersConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -6278,11 +6510,14 @@ func (d *DefenderForContainersGcpOfferingNativeCloudConnection) UnmarshalJSON(da for key, val := range rawMsg { var err error switch key { - case "serviceAccountEmailAddress": - err = unpopulate(val, "ServiceAccountEmailAddress", &d.ServiceAccountEmailAddress) + case "cloudRoleArn": + err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) delete(rawMsg, key) - case "workloadIdentityProviderId": - err = unpopulate(val, "WorkloadIdentityProviderID", &d.WorkloadIdentityProviderID) + case "exclusionTags": + err = unpopulate(val, "ExclusionTags", &d.ExclusionTags) + delete(rawMsg, key) + case "scanningMode": + err = unpopulate(val, "ScanningMode", &d.ScanningMode) delete(rawMsg, key) } if err != nil { @@ -6292,18 +6527,21 @@ func (d *DefenderForContainersGcpOfferingNativeCloudConnection) UnmarshalJSON(da return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForDatabasesGcpOffering. -func (d DefenderForDatabasesGcpOffering) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderCspmGcpOffering. +func (d DefenderCspmGcpOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "arcAutoProvisioning", d.ArcAutoProvisioning) - populate(objectMap, "defenderForDatabasesArcAutoProvisioning", d.DefenderForDatabasesArcAutoProvisioning) + populate(objectMap, "ciemDiscovery", d.CiemDiscovery) + populate(objectMap, "dataSensitivityDiscovery", d.DataSensitivityDiscovery) populate(objectMap, "description", d.Description) - objectMap["offeringType"] = OfferingTypeDefenderForDatabasesGcp + 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 DefenderForDatabasesGcpOffering. -func (d *DefenderForDatabasesGcpOffering) UnmarshalJSON(data []byte) error { +// 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) @@ -6311,18 +6549,27 @@ func (d *DefenderForDatabasesGcpOffering) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "arcAutoProvisioning": - err = unpopulate(val, "ArcAutoProvisioning", &d.ArcAutoProvisioning) + case "ciemDiscovery": + err = unpopulate(val, "CiemDiscovery", &d.CiemDiscovery) delete(rawMsg, key) - case "defenderForDatabasesArcAutoProvisioning": - err = unpopulate(val, "DefenderForDatabasesArcAutoProvisioning", &d.DefenderForDatabasesArcAutoProvisioning) + 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) + delete(rawMsg, key) case "offeringType": err = unpopulate(val, "OfferingType", &d.OfferingType) delete(rawMsg, key) + case "vmScanners": + err = unpopulate(val, "VMScanners", &d.VMScanners) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -6331,16 +6578,17 @@ func (d *DefenderForDatabasesGcpOffering) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForDatabasesGcpOfferingArcAutoProvisioning. -func (d DefenderForDatabasesGcpOfferingArcAutoProvisioning) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderCspmGcpOfferingCiemDiscovery. +func (d DefenderCspmGcpOfferingCiemDiscovery) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "configuration", d.Configuration) - populate(objectMap, "enabled", d.Enabled) + populate(objectMap, "azureActiveDirectoryAppName", d.AzureActiveDirectoryAppName) + populate(objectMap, "serviceAccountEmailAddress", d.ServiceAccountEmailAddress) + populate(objectMap, "workloadIdentityProviderId", d.WorkloadIdentityProviderID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForDatabasesGcpOfferingArcAutoProvisioning. -func (d *DefenderForDatabasesGcpOfferingArcAutoProvisioning) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmGcpOfferingCiemDiscovery. +func (d *DefenderCspmGcpOfferingCiemDiscovery) 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) @@ -6348,11 +6596,14 @@ func (d *DefenderForDatabasesGcpOfferingArcAutoProvisioning) UnmarshalJSON(data for key, val := range rawMsg { var err error switch key { - case "configuration": - err = unpopulate(val, "Configuration", &d.Configuration) + case "azureActiveDirectoryAppName": + err = unpopulate(val, "AzureActiveDirectoryAppName", &d.AzureActiveDirectoryAppName) delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &d.Enabled) + case "serviceAccountEmailAddress": + err = unpopulate(val, "ServiceAccountEmailAddress", &d.ServiceAccountEmailAddress) + delete(rawMsg, key) + case "workloadIdentityProviderId": + err = unpopulate(val, "WorkloadIdentityProviderID", &d.WorkloadIdentityProviderID) delete(rawMsg, key) } if err != nil { @@ -6362,16 +6613,17 @@ func (d *DefenderForDatabasesGcpOfferingArcAutoProvisioning) UnmarshalJSON(data return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration. -func (d DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderCspmGcpOfferingDataSensitivityDiscovery. +func (d DefenderCspmGcpOfferingDataSensitivityDiscovery) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "privateLinkScope", d.PrivateLinkScope) - populate(objectMap, "proxy", d.Proxy) + populate(objectMap, "enabled", d.Enabled) + populate(objectMap, "serviceAccountEmailAddress", d.ServiceAccountEmailAddress) + populate(objectMap, "workloadIdentityProviderId", d.WorkloadIdentityProviderID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration. -func (d *DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmGcpOfferingDataSensitivityDiscovery. +func (d *DefenderCspmGcpOfferingDataSensitivityDiscovery) 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) @@ -6379,11 +6631,14 @@ func (d *DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration) Unmars for key, val := range rawMsg { var err error switch key { - case "privateLinkScope": - err = unpopulate(val, "PrivateLinkScope", &d.PrivateLinkScope) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) delete(rawMsg, key) - case "proxy": - err = unpopulate(val, "Proxy", &d.Proxy) + case "serviceAccountEmailAddress": + err = unpopulate(val, "ServiceAccountEmailAddress", &d.ServiceAccountEmailAddress) + delete(rawMsg, key) + case "workloadIdentityProviderId": + err = unpopulate(val, "WorkloadIdentityProviderID", &d.WorkloadIdentityProviderID) delete(rawMsg, key) } if err != nil { @@ -6393,16 +6648,17 @@ func (d *DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration) Unmars return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning. -func (d DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S. +func (d DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "enabled", d.Enabled) populate(objectMap, "serviceAccountEmailAddress", d.ServiceAccountEmailAddress) populate(objectMap, "workloadIdentityProviderId", d.WorkloadIdentityProviderID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning. -func (d *DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S. +func (d *DefenderCspmGcpOfferingMdcContainersAgentlessDiscoveryK8S) 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) @@ -6410,6 +6666,9 @@ func (d *DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning) for key, val := range rawMsg { var err error switch key { + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) + delete(rawMsg, key) case "serviceAccountEmailAddress": err = unpopulate(val, "ServiceAccountEmailAddress", &d.ServiceAccountEmailAddress) delete(rawMsg, key) @@ -6424,16 +6683,17 @@ func (d *DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning) return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForDevOpsAzureDevOpsOffering. -func (d DefenderForDevOpsAzureDevOpsOffering) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderCspmGcpOfferingMdcContainersImageAssessment. +func (d DefenderCspmGcpOfferingMdcContainersImageAssessment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", d.Description) - objectMap["offeringType"] = OfferingTypeDefenderForDevOpsAzureDevOps + populate(objectMap, "enabled", d.Enabled) + populate(objectMap, "serviceAccountEmailAddress", d.ServiceAccountEmailAddress) + populate(objectMap, "workloadIdentityProviderId", d.WorkloadIdentityProviderID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForDevOpsAzureDevOpsOffering. -func (d *DefenderForDevOpsAzureDevOpsOffering) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmGcpOfferingMdcContainersImageAssessment. +func (d *DefenderCspmGcpOfferingMdcContainersImageAssessment) 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) @@ -6441,11 +6701,14 @@ func (d *DefenderForDevOpsAzureDevOpsOffering) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &d.Description) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) delete(rawMsg, key) - case "offeringType": - err = unpopulate(val, "OfferingType", &d.OfferingType) + case "serviceAccountEmailAddress": + err = unpopulate(val, "ServiceAccountEmailAddress", &d.ServiceAccountEmailAddress) + delete(rawMsg, key) + case "workloadIdentityProviderId": + err = unpopulate(val, "WorkloadIdentityProviderID", &d.WorkloadIdentityProviderID) delete(rawMsg, key) } if err != nil { @@ -6455,16 +6718,16 @@ func (d *DefenderForDevOpsAzureDevOpsOffering) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForDevOpsGitLabOffering. -func (d DefenderForDevOpsGitLabOffering) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderCspmGcpOfferingVMScanners. +func (d DefenderCspmGcpOfferingVMScanners) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", d.Description) - objectMap["offeringType"] = OfferingTypeDefenderForDevOpsGitLab + populate(objectMap, "configuration", d.Configuration) + populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForDevOpsGitLabOffering. -func (d *DefenderForDevOpsGitLabOffering) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmGcpOfferingVMScanners. +func (d *DefenderCspmGcpOfferingVMScanners) 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) @@ -6472,11 +6735,11 @@ func (d *DefenderForDevOpsGitLabOffering) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &d.Description) + case "configuration": + err = unpopulate(val, "Configuration", &d.Configuration) delete(rawMsg, key) - case "offeringType": - err = unpopulate(val, "OfferingType", &d.OfferingType) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) delete(rawMsg, key) } if err != nil { @@ -6486,16 +6749,16 @@ func (d *DefenderForDevOpsGitLabOffering) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForDevOpsGithubOffering. -func (d DefenderForDevOpsGithubOffering) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderCspmGcpOfferingVMScannersConfiguration. +func (d DefenderCspmGcpOfferingVMScannersConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", d.Description) - objectMap["offeringType"] = OfferingTypeDefenderForDevOpsGithub + populate(objectMap, "exclusionTags", d.ExclusionTags) + populate(objectMap, "scanningMode", d.ScanningMode) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForDevOpsGithubOffering. -func (d *DefenderForDevOpsGithubOffering) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderCspmGcpOfferingVMScannersConfiguration. +func (d *DefenderCspmGcpOfferingVMScannersConfiguration) 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) @@ -6503,11 +6766,11 @@ func (d *DefenderForDevOpsGithubOffering) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &d.Description) + case "exclusionTags": + err = unpopulate(val, "ExclusionTags", &d.ExclusionTags) delete(rawMsg, key) - case "offeringType": - err = unpopulate(val, "OfferingType", &d.OfferingType) + case "scanningMode": + err = unpopulate(val, "ScanningMode", &d.ScanningMode) delete(rawMsg, key) } if err != nil { @@ -6517,22 +6780,19 @@ func (d *DefenderForDevOpsGithubOffering) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOffering. -func (d DefenderForServersAwsOffering) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderFoDatabasesAwsOffering. +func (d DefenderFoDatabasesAwsOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "arcAutoProvisioning", d.ArcAutoProvisioning) - populate(objectMap, "defenderForServers", d.DefenderForServers) + populate(objectMap, "databasesDspm", d.DatabasesDspm) populate(objectMap, "description", d.Description) - populate(objectMap, "mdeAutoProvisioning", d.MdeAutoProvisioning) - objectMap["offeringType"] = OfferingTypeDefenderForServersAws - populate(objectMap, "subPlan", d.SubPlan) - populate(objectMap, "vmScanners", d.VMScanners) - populate(objectMap, "vaAutoProvisioning", d.VaAutoProvisioning) + objectMap["offeringType"] = OfferingTypeDefenderForDatabasesAws + populate(objectMap, "rds", d.Rds) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersAwsOffering. -func (d *DefenderForServersAwsOffering) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderFoDatabasesAwsOffering. +func (d *DefenderFoDatabasesAwsOffering) 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) @@ -6543,26 +6803,17 @@ func (d *DefenderForServersAwsOffering) UnmarshalJSON(data []byte) error { case "arcAutoProvisioning": err = unpopulate(val, "ArcAutoProvisioning", &d.ArcAutoProvisioning) delete(rawMsg, key) - case "defenderForServers": - err = unpopulate(val, "DefenderForServers", &d.DefenderForServers) + case "databasesDspm": + err = unpopulate(val, "DatabasesDspm", &d.DatabasesDspm) delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &d.Description) delete(rawMsg, key) - case "mdeAutoProvisioning": - err = unpopulate(val, "MdeAutoProvisioning", &d.MdeAutoProvisioning) - delete(rawMsg, key) case "offeringType": err = unpopulate(val, "OfferingType", &d.OfferingType) delete(rawMsg, key) - case "subPlan": - err = unpopulate(val, "SubPlan", &d.SubPlan) - delete(rawMsg, key) - case "vmScanners": - err = unpopulate(val, "VMScanners", &d.VMScanners) - delete(rawMsg, key) - case "vaAutoProvisioning": - err = unpopulate(val, "VaAutoProvisioning", &d.VaAutoProvisioning) + case "rds": + err = unpopulate(val, "Rds", &d.Rds) delete(rawMsg, key) } if err != nil { @@ -6572,8 +6823,8 @@ func (d *DefenderForServersAwsOffering) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingArcAutoProvisioning. -func (d DefenderForServersAwsOfferingArcAutoProvisioning) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderFoDatabasesAwsOfferingArcAutoProvisioning. +func (d DefenderFoDatabasesAwsOfferingArcAutoProvisioning) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) populate(objectMap, "configuration", d.Configuration) @@ -6581,8 +6832,8 @@ func (d DefenderForServersAwsOfferingArcAutoProvisioning) MarshalJSON() ([]byte, return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersAwsOfferingArcAutoProvisioning. -func (d *DefenderForServersAwsOfferingArcAutoProvisioning) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderFoDatabasesAwsOfferingArcAutoProvisioning. +func (d *DefenderFoDatabasesAwsOfferingArcAutoProvisioning) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -6607,16 +6858,16 @@ func (d *DefenderForServersAwsOfferingArcAutoProvisioning) UnmarshalJSON(data [] return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingArcAutoProvisioningConfiguration. -func (d DefenderForServersAwsOfferingArcAutoProvisioningConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration. +func (d DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "privateLinkScope", d.PrivateLinkScope) populate(objectMap, "proxy", d.Proxy) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersAwsOfferingArcAutoProvisioningConfiguration. -func (d *DefenderForServersAwsOfferingArcAutoProvisioningConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration. +func (d *DefenderFoDatabasesAwsOfferingArcAutoProvisioningConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -6638,15 +6889,16 @@ func (d *DefenderForServersAwsOfferingArcAutoProvisioningConfiguration) Unmarsha return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingDefenderForServers. -func (d DefenderForServersAwsOfferingDefenderForServers) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderFoDatabasesAwsOfferingDatabasesDspm. +func (d DefenderFoDatabasesAwsOfferingDatabasesDspm) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) + populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersAwsOfferingDefenderForServers. -func (d *DefenderForServersAwsOfferingDefenderForServers) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderFoDatabasesAwsOfferingDatabasesDspm. +func (d *DefenderFoDatabasesAwsOfferingDatabasesDspm) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -6657,6 +6909,9 @@ func (d *DefenderForServersAwsOfferingDefenderForServers) UnmarshalJSON(data []b case "cloudRoleArn": err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -6665,16 +6920,16 @@ func (d *DefenderForServersAwsOfferingDefenderForServers) UnmarshalJSON(data []b return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingMdeAutoProvisioning. -func (d DefenderForServersAwsOfferingMdeAutoProvisioning) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderFoDatabasesAwsOfferingRds. +func (d DefenderFoDatabasesAwsOfferingRds) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateAny(objectMap, "configuration", d.Configuration) + populate(objectMap, "cloudRoleArn", d.CloudRoleArn) populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersAwsOfferingMdeAutoProvisioning. -func (d *DefenderForServersAwsOfferingMdeAutoProvisioning) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderFoDatabasesAwsOfferingRds. +func (d *DefenderFoDatabasesAwsOfferingRds) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -6682,8 +6937,8 @@ func (d *DefenderForServersAwsOfferingMdeAutoProvisioning) UnmarshalJSON(data [] for key, val := range rawMsg { var err error switch key { - case "configuration": - err = unpopulate(val, "Configuration", &d.Configuration) + case "cloudRoleArn": + err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) delete(rawMsg, key) case "enabled": err = unpopulate(val, "Enabled", &d.Enabled) @@ -6696,15 +6951,28 @@ func (d *DefenderForServersAwsOfferingMdeAutoProvisioning) UnmarshalJSON(data [] return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingSubPlan. -func (d DefenderForServersAwsOfferingSubPlan) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersAwsOffering. +func (d DefenderForContainersAwsOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "type", d.Type) + populate(objectMap, "autoProvisioning", d.AutoProvisioning) + populate(objectMap, "cloudWatchToKinesis", d.CloudWatchToKinesis) + populate(objectMap, "containerVulnerabilityAssessment", d.ContainerVulnerabilityAssessment) + populate(objectMap, "containerVulnerabilityAssessmentTask", d.ContainerVulnerabilityAssessmentTask) + populate(objectMap, "description", d.Description) + populate(objectMap, "enableContainerVulnerabilityAssessment", d.EnableContainerVulnerabilityAssessment) + populate(objectMap, "kinesisToS3", d.KinesisToS3) + populate(objectMap, "kubeAuditRetentionTime", d.KubeAuditRetentionTime) + populate(objectMap, "kubernetesScubaReader", d.KubernetesScubaReader) + populate(objectMap, "kubernetesService", d.KubernetesService) + populate(objectMap, "mdcContainersAgentlessDiscoveryK8s", d.MdcContainersAgentlessDiscoveryK8S) + populate(objectMap, "mdcContainersImageAssessment", d.MdcContainersImageAssessment) + objectMap["offeringType"] = OfferingTypeDefenderForContainersAws + populate(objectMap, "scubaExternalId", d.ScubaExternalID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersAwsOfferingSubPlan. -func (d *DefenderForServersAwsOfferingSubPlan) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersAwsOffering. +func (d *DefenderForContainersAwsOffering) 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) @@ -6712,8 +6980,47 @@ func (d *DefenderForServersAwsOfferingSubPlan) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "type": - err = unpopulate(val, "Type", &d.Type) + case "autoProvisioning": + err = unpopulate(val, "AutoProvisioning", &d.AutoProvisioning) + delete(rawMsg, key) + case "cloudWatchToKinesis": + err = unpopulate(val, "CloudWatchToKinesis", &d.CloudWatchToKinesis) + delete(rawMsg, key) + case "containerVulnerabilityAssessment": + err = unpopulate(val, "ContainerVulnerabilityAssessment", &d.ContainerVulnerabilityAssessment) + delete(rawMsg, key) + case "containerVulnerabilityAssessmentTask": + err = unpopulate(val, "ContainerVulnerabilityAssessmentTask", &d.ContainerVulnerabilityAssessmentTask) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "enableContainerVulnerabilityAssessment": + err = unpopulate(val, "EnableContainerVulnerabilityAssessment", &d.EnableContainerVulnerabilityAssessment) + delete(rawMsg, key) + case "kinesisToS3": + err = unpopulate(val, "KinesisToS3", &d.KinesisToS3) + delete(rawMsg, key) + case "kubeAuditRetentionTime": + err = unpopulate(val, "KubeAuditRetentionTime", &d.KubeAuditRetentionTime) + delete(rawMsg, key) + case "kubernetesScubaReader": + err = unpopulate(val, "KubernetesScubaReader", &d.KubernetesScubaReader) + delete(rawMsg, key) + case "kubernetesService": + err = unpopulate(val, "KubernetesService", &d.KubernetesService) + delete(rawMsg, key) + case "mdcContainersAgentlessDiscoveryK8s": + err = unpopulate(val, "MdcContainersAgentlessDiscoveryK8S", &d.MdcContainersAgentlessDiscoveryK8S) + 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) + case "scubaExternalId": + err = unpopulate(val, "ScubaExternalID", &d.ScubaExternalID) delete(rawMsg, key) } if err != nil { @@ -6723,16 +7030,15 @@ func (d *DefenderForServersAwsOfferingSubPlan) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingVMScanners. -func (d DefenderForServersAwsOfferingVMScanners) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersAwsOfferingCloudWatchToKinesis. +func (d DefenderForContainersAwsOfferingCloudWatchToKinesis) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "configuration", d.Configuration) - populate(objectMap, "enabled", d.Enabled) + populate(objectMap, "cloudRoleArn", d.CloudRoleArn) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersAwsOfferingVMScanners. -func (d *DefenderForServersAwsOfferingVMScanners) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersAwsOfferingCloudWatchToKinesis. +func (d *DefenderForContainersAwsOfferingCloudWatchToKinesis) 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) @@ -6740,11 +7046,8 @@ func (d *DefenderForServersAwsOfferingVMScanners) UnmarshalJSON(data []byte) err for key, val := range rawMsg { var err error switch key { - case "configuration": - err = unpopulate(val, "Configuration", &d.Configuration) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &d.Enabled) + case "cloudRoleArn": + err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) delete(rawMsg, key) } if err != nil { @@ -6754,17 +7057,15 @@ func (d *DefenderForServersAwsOfferingVMScanners) UnmarshalJSON(data []byte) err return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingVMScannersConfiguration. -func (d DefenderForServersAwsOfferingVMScannersConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersAwsOfferingContainerVulnerabilityAssessment. +func (d DefenderForContainersAwsOfferingContainerVulnerabilityAssessment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) - populate(objectMap, "exclusionTags", d.ExclusionTags) - populate(objectMap, "scanningMode", d.ScanningMode) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersAwsOfferingVMScannersConfiguration. -func (d *DefenderForServersAwsOfferingVMScannersConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersAwsOfferingContainerVulnerabilityAssessment. +func (d *DefenderForContainersAwsOfferingContainerVulnerabilityAssessment) 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) @@ -6775,12 +7076,6 @@ func (d *DefenderForServersAwsOfferingVMScannersConfiguration) UnmarshalJSON(dat case "cloudRoleArn": err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) delete(rawMsg, key) - case "exclusionTags": - err = unpopulate(val, "ExclusionTags", &d.ExclusionTags) - delete(rawMsg, key) - case "scanningMode": - err = unpopulate(val, "ScanningMode", &d.ScanningMode) - delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -6789,16 +7084,15 @@ func (d *DefenderForServersAwsOfferingVMScannersConfiguration) UnmarshalJSON(dat return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingVaAutoProvisioning. -func (d DefenderForServersAwsOfferingVaAutoProvisioning) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask. +func (d DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "configuration", d.Configuration) - populate(objectMap, "enabled", d.Enabled) + populate(objectMap, "cloudRoleArn", d.CloudRoleArn) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersAwsOfferingVaAutoProvisioning. -func (d *DefenderForServersAwsOfferingVaAutoProvisioning) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask. +func (d *DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask) 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) @@ -6806,11 +7100,8 @@ func (d *DefenderForServersAwsOfferingVaAutoProvisioning) UnmarshalJSON(data []b for key, val := range rawMsg { var err error switch key { - case "configuration": - err = unpopulate(val, "Configuration", &d.Configuration) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &d.Enabled) + case "cloudRoleArn": + err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) delete(rawMsg, key) } if err != nil { @@ -6820,15 +7111,15 @@ func (d *DefenderForServersAwsOfferingVaAutoProvisioning) UnmarshalJSON(data []b return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingVaAutoProvisioningConfiguration. -func (d DefenderForServersAwsOfferingVaAutoProvisioningConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersAwsOfferingKinesisToS3. +func (d DefenderForContainersAwsOfferingKinesisToS3) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "type", d.Type) + populate(objectMap, "cloudRoleArn", d.CloudRoleArn) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersAwsOfferingVaAutoProvisioningConfiguration. -func (d *DefenderForServersAwsOfferingVaAutoProvisioningConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersAwsOfferingKinesisToS3. +func (d *DefenderForContainersAwsOfferingKinesisToS3) 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) @@ -6836,8 +7127,8 @@ func (d *DefenderForServersAwsOfferingVaAutoProvisioningConfiguration) Unmarshal for key, val := range rawMsg { var err error switch key { - case "type": - err = unpopulate(val, "Type", &d.Type) + case "cloudRoleArn": + err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) delete(rawMsg, key) } if err != nil { @@ -6847,22 +7138,15 @@ func (d *DefenderForServersAwsOfferingVaAutoProvisioningConfiguration) Unmarshal return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOffering. -func (d DefenderForServersGcpOffering) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersAwsOfferingKubernetesScubaReader. +func (d DefenderForContainersAwsOfferingKubernetesScubaReader) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "arcAutoProvisioning", d.ArcAutoProvisioning) - populate(objectMap, "defenderForServers", d.DefenderForServers) - populate(objectMap, "description", d.Description) - populate(objectMap, "mdeAutoProvisioning", d.MdeAutoProvisioning) - objectMap["offeringType"] = OfferingTypeDefenderForServersGcp - populate(objectMap, "subPlan", d.SubPlan) - populate(objectMap, "vmScanners", d.VMScanners) - populate(objectMap, "vaAutoProvisioning", d.VaAutoProvisioning) + populate(objectMap, "cloudRoleArn", d.CloudRoleArn) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersGcpOffering. -func (d *DefenderForServersGcpOffering) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersAwsOfferingKubernetesScubaReader. +func (d *DefenderForContainersAwsOfferingKubernetesScubaReader) 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) @@ -6870,29 +7154,8 @@ func (d *DefenderForServersGcpOffering) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "arcAutoProvisioning": - err = unpopulate(val, "ArcAutoProvisioning", &d.ArcAutoProvisioning) - delete(rawMsg, key) - case "defenderForServers": - err = unpopulate(val, "DefenderForServers", &d.DefenderForServers) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &d.Description) - delete(rawMsg, key) - case "mdeAutoProvisioning": - err = unpopulate(val, "MdeAutoProvisioning", &d.MdeAutoProvisioning) - delete(rawMsg, key) - case "offeringType": - err = unpopulate(val, "OfferingType", &d.OfferingType) - delete(rawMsg, key) - case "subPlan": - err = unpopulate(val, "SubPlan", &d.SubPlan) - delete(rawMsg, key) - case "vmScanners": - err = unpopulate(val, "VMScanners", &d.VMScanners) - delete(rawMsg, key) - case "vaAutoProvisioning": - err = unpopulate(val, "VaAutoProvisioning", &d.VaAutoProvisioning) + case "cloudRoleArn": + err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) delete(rawMsg, key) } if err != nil { @@ -6902,16 +7165,15 @@ func (d *DefenderForServersGcpOffering) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingArcAutoProvisioning. -func (d DefenderForServersGcpOfferingArcAutoProvisioning) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersAwsOfferingKubernetesService. +func (d DefenderForContainersAwsOfferingKubernetesService) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "configuration", d.Configuration) - populate(objectMap, "enabled", d.Enabled) + populate(objectMap, "cloudRoleArn", d.CloudRoleArn) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersGcpOfferingArcAutoProvisioning. -func (d *DefenderForServersGcpOfferingArcAutoProvisioning) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersAwsOfferingKubernetesService. +func (d *DefenderForContainersAwsOfferingKubernetesService) 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) @@ -6919,11 +7181,8 @@ func (d *DefenderForServersGcpOfferingArcAutoProvisioning) UnmarshalJSON(data [] for key, val := range rawMsg { var err error switch key { - case "configuration": - err = unpopulate(val, "Configuration", &d.Configuration) - delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &d.Enabled) + case "cloudRoleArn": + err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) delete(rawMsg, key) } if err != nil { @@ -6933,16 +7192,16 @@ func (d *DefenderForServersGcpOfferingArcAutoProvisioning) UnmarshalJSON(data [] return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingArcAutoProvisioningConfiguration. -func (d DefenderForServersGcpOfferingArcAutoProvisioningConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S. +func (d DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "privateLinkScope", d.PrivateLinkScope) - populate(objectMap, "proxy", d.Proxy) + populate(objectMap, "cloudRoleArn", d.CloudRoleArn) + populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersGcpOfferingArcAutoProvisioningConfiguration. -func (d *DefenderForServersGcpOfferingArcAutoProvisioningConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S. +func (d *DefenderForContainersAwsOfferingMdcContainersAgentlessDiscoveryK8S) 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) @@ -6950,11 +7209,11 @@ func (d *DefenderForServersGcpOfferingArcAutoProvisioningConfiguration) Unmarsha for key, val := range rawMsg { var err error switch key { - case "privateLinkScope": - err = unpopulate(val, "PrivateLinkScope", &d.PrivateLinkScope) + case "cloudRoleArn": + err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) delete(rawMsg, key) - case "proxy": - err = unpopulate(val, "Proxy", &d.Proxy) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) delete(rawMsg, key) } if err != nil { @@ -6964,16 +7223,16 @@ func (d *DefenderForServersGcpOfferingArcAutoProvisioningConfiguration) Unmarsha return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingDefenderForServers. -func (d DefenderForServersGcpOfferingDefenderForServers) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersAwsOfferingMdcContainersImageAssessment. +func (d DefenderForContainersAwsOfferingMdcContainersImageAssessment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "serviceAccountEmailAddress", d.ServiceAccountEmailAddress) - populate(objectMap, "workloadIdentityProviderId", d.WorkloadIdentityProviderID) + populate(objectMap, "cloudRoleArn", d.CloudRoleArn) + populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersGcpOfferingDefenderForServers. -func (d *DefenderForServersGcpOfferingDefenderForServers) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersAwsOfferingMdcContainersImageAssessment. +func (d *DefenderForContainersAwsOfferingMdcContainersImageAssessment) 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) @@ -6981,11 +7240,11 @@ func (d *DefenderForServersGcpOfferingDefenderForServers) UnmarshalJSON(data []b for key, val := range rawMsg { var err error switch key { - case "serviceAccountEmailAddress": - err = unpopulate(val, "ServiceAccountEmailAddress", &d.ServiceAccountEmailAddress) + case "cloudRoleArn": + err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) delete(rawMsg, key) - case "workloadIdentityProviderId": - err = unpopulate(val, "WorkloadIdentityProviderID", &d.WorkloadIdentityProviderID) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) delete(rawMsg, key) } if err != nil { @@ -6995,16 +7254,23 @@ func (d *DefenderForServersGcpOfferingDefenderForServers) UnmarshalJSON(data []b return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingMdeAutoProvisioning. -func (d DefenderForServersGcpOfferingMdeAutoProvisioning) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersGcpOffering. +func (d DefenderForContainersGcpOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateAny(objectMap, "configuration", d.Configuration) - populate(objectMap, "enabled", d.Enabled) + populate(objectMap, "auditLogsAutoProvisioningFlag", d.AuditLogsAutoProvisioningFlag) + populate(objectMap, "dataPipelineNativeCloudConnection", d.DataPipelineNativeCloudConnection) + populate(objectMap, "defenderAgentAutoProvisioningFlag", d.DefenderAgentAutoProvisioningFlag) + populate(objectMap, "description", d.Description) + populate(objectMap, "mdcContainersAgentlessDiscoveryK8s", d.MdcContainersAgentlessDiscoveryK8S) + populate(objectMap, "mdcContainersImageAssessment", d.MdcContainersImageAssessment) + populate(objectMap, "nativeCloudConnection", d.NativeCloudConnection) + objectMap["offeringType"] = OfferingTypeDefenderForContainersGcp + populate(objectMap, "policyAgentAutoProvisioningFlag", d.PolicyAgentAutoProvisioningFlag) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersGcpOfferingMdeAutoProvisioning. -func (d *DefenderForServersGcpOfferingMdeAutoProvisioning) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersGcpOffering. +func (d *DefenderForContainersGcpOffering) 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) @@ -7012,11 +7278,32 @@ func (d *DefenderForServersGcpOfferingMdeAutoProvisioning) UnmarshalJSON(data [] for key, val := range rawMsg { var err error switch key { - case "configuration": - err = unpopulate(val, "Configuration", &d.Configuration) + case "auditLogsAutoProvisioningFlag": + err = unpopulate(val, "AuditLogsAutoProvisioningFlag", &d.AuditLogsAutoProvisioningFlag) delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &d.Enabled) + case "dataPipelineNativeCloudConnection": + err = unpopulate(val, "DataPipelineNativeCloudConnection", &d.DataPipelineNativeCloudConnection) + delete(rawMsg, key) + case "defenderAgentAutoProvisioningFlag": + err = unpopulate(val, "DefenderAgentAutoProvisioningFlag", &d.DefenderAgentAutoProvisioningFlag) + 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) + delete(rawMsg, key) + case "nativeCloudConnection": + err = unpopulate(val, "NativeCloudConnection", &d.NativeCloudConnection) + delete(rawMsg, key) + case "offeringType": + err = unpopulate(val, "OfferingType", &d.OfferingType) + delete(rawMsg, key) + case "policyAgentAutoProvisioningFlag": + err = unpopulate(val, "PolicyAgentAutoProvisioningFlag", &d.PolicyAgentAutoProvisioningFlag) delete(rawMsg, key) } if err != nil { @@ -7026,15 +7313,16 @@ func (d *DefenderForServersGcpOfferingMdeAutoProvisioning) UnmarshalJSON(data [] return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingSubPlan. -func (d DefenderForServersGcpOfferingSubPlan) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection. +func (d DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "type", d.Type) + populate(objectMap, "serviceAccountEmailAddress", d.ServiceAccountEmailAddress) + populate(objectMap, "workloadIdentityProviderId", d.WorkloadIdentityProviderID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersGcpOfferingSubPlan. -func (d *DefenderForServersGcpOfferingSubPlan) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection. +func (d *DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection) 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) @@ -7042,8 +7330,11 @@ func (d *DefenderForServersGcpOfferingSubPlan) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "type": - err = unpopulate(val, "Type", &d.Type) + case "serviceAccountEmailAddress": + err = unpopulate(val, "ServiceAccountEmailAddress", &d.ServiceAccountEmailAddress) + delete(rawMsg, key) + case "workloadIdentityProviderId": + err = unpopulate(val, "WorkloadIdentityProviderID", &d.WorkloadIdentityProviderID) delete(rawMsg, key) } if err != nil { @@ -7053,16 +7344,17 @@ func (d *DefenderForServersGcpOfferingSubPlan) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingVMScanners. -func (d DefenderForServersGcpOfferingVMScanners) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S. +func (d DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "configuration", d.Configuration) populate(objectMap, "enabled", d.Enabled) + populate(objectMap, "serviceAccountEmailAddress", d.ServiceAccountEmailAddress) + populate(objectMap, "workloadIdentityProviderId", d.WorkloadIdentityProviderID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersGcpOfferingVMScanners. -func (d *DefenderForServersGcpOfferingVMScanners) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S. +func (d *DefenderForContainersGcpOfferingMdcContainersAgentlessDiscoveryK8S) 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) @@ -7070,12 +7362,15 @@ func (d *DefenderForServersGcpOfferingVMScanners) UnmarshalJSON(data []byte) err for key, val := range rawMsg { var err error switch key { - case "configuration": - err = unpopulate(val, "Configuration", &d.Configuration) - delete(rawMsg, key) case "enabled": err = unpopulate(val, "Enabled", &d.Enabled) delete(rawMsg, key) + case "serviceAccountEmailAddress": + err = unpopulate(val, "ServiceAccountEmailAddress", &d.ServiceAccountEmailAddress) + delete(rawMsg, key) + case "workloadIdentityProviderId": + err = unpopulate(val, "WorkloadIdentityProviderID", &d.WorkloadIdentityProviderID) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -7084,16 +7379,17 @@ func (d *DefenderForServersGcpOfferingVMScanners) UnmarshalJSON(data []byte) err return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingVMScannersConfiguration. -func (d DefenderForServersGcpOfferingVMScannersConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersGcpOfferingMdcContainersImageAssessment. +func (d DefenderForContainersGcpOfferingMdcContainersImageAssessment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "exclusionTags", d.ExclusionTags) - populate(objectMap, "scanningMode", d.ScanningMode) + populate(objectMap, "enabled", d.Enabled) + populate(objectMap, "serviceAccountEmailAddress", d.ServiceAccountEmailAddress) + populate(objectMap, "workloadIdentityProviderId", d.WorkloadIdentityProviderID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersGcpOfferingVMScannersConfiguration. -func (d *DefenderForServersGcpOfferingVMScannersConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersGcpOfferingMdcContainersImageAssessment. +func (d *DefenderForContainersGcpOfferingMdcContainersImageAssessment) 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) @@ -7101,11 +7397,14 @@ func (d *DefenderForServersGcpOfferingVMScannersConfiguration) UnmarshalJSON(dat for key, val := range rawMsg { var err error switch key { - case "exclusionTags": - err = unpopulate(val, "ExclusionTags", &d.ExclusionTags) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) delete(rawMsg, key) - case "scanningMode": - err = unpopulate(val, "ScanningMode", &d.ScanningMode) + case "serviceAccountEmailAddress": + err = unpopulate(val, "ServiceAccountEmailAddress", &d.ServiceAccountEmailAddress) + delete(rawMsg, key) + case "workloadIdentityProviderId": + err = unpopulate(val, "WorkloadIdentityProviderID", &d.WorkloadIdentityProviderID) delete(rawMsg, key) } if err != nil { @@ -7115,16 +7414,16 @@ func (d *DefenderForServersGcpOfferingVMScannersConfiguration) UnmarshalJSON(dat return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingVaAutoProvisioning. -func (d DefenderForServersGcpOfferingVaAutoProvisioning) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForContainersGcpOfferingNativeCloudConnection. +func (d DefenderForContainersGcpOfferingNativeCloudConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "configuration", d.Configuration) - populate(objectMap, "enabled", d.Enabled) + populate(objectMap, "serviceAccountEmailAddress", d.ServiceAccountEmailAddress) + populate(objectMap, "workloadIdentityProviderId", d.WorkloadIdentityProviderID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersGcpOfferingVaAutoProvisioning. -func (d *DefenderForServersGcpOfferingVaAutoProvisioning) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForContainersGcpOfferingNativeCloudConnection. +func (d *DefenderForContainersGcpOfferingNativeCloudConnection) 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) @@ -7132,11 +7431,11 @@ func (d *DefenderForServersGcpOfferingVaAutoProvisioning) UnmarshalJSON(data []b for key, val := range rawMsg { var err error switch key { - case "configuration": - err = unpopulate(val, "Configuration", &d.Configuration) + case "serviceAccountEmailAddress": + err = unpopulate(val, "ServiceAccountEmailAddress", &d.ServiceAccountEmailAddress) delete(rawMsg, key) - case "enabled": - err = unpopulate(val, "Enabled", &d.Enabled) + case "workloadIdentityProviderId": + err = unpopulate(val, "WorkloadIdentityProviderID", &d.WorkloadIdentityProviderID) delete(rawMsg, key) } if err != nil { @@ -7146,15 +7445,18 @@ func (d *DefenderForServersGcpOfferingVaAutoProvisioning) UnmarshalJSON(data []b return nil } -// MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingVaAutoProvisioningConfiguration. -func (d DefenderForServersGcpOfferingVaAutoProvisioningConfiguration) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForDatabasesGcpOffering. +func (d DefenderForDatabasesGcpOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "type", d.Type) + populate(objectMap, "arcAutoProvisioning", d.ArcAutoProvisioning) + populate(objectMap, "defenderForDatabasesArcAutoProvisioning", d.DefenderForDatabasesArcAutoProvisioning) + populate(objectMap, "description", d.Description) + objectMap["offeringType"] = OfferingTypeDefenderForDatabasesGcp return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersGcpOfferingVaAutoProvisioningConfiguration. -func (d *DefenderForServersGcpOfferingVaAutoProvisioningConfiguration) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForDatabasesGcpOffering. +func (d *DefenderForDatabasesGcpOffering) 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) @@ -7162,8 +7464,17 @@ func (d *DefenderForServersGcpOfferingVaAutoProvisioningConfiguration) Unmarshal for key, val := range rawMsg { var err error switch key { - case "type": - err = unpopulate(val, "Type", &d.Type) + case "arcAutoProvisioning": + err = unpopulate(val, "ArcAutoProvisioning", &d.ArcAutoProvisioning) + delete(rawMsg, key) + case "defenderForDatabasesArcAutoProvisioning": + err = unpopulate(val, "DefenderForDatabasesArcAutoProvisioning", &d.DefenderForDatabasesArcAutoProvisioning) + delete(rawMsg, 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 { @@ -7173,20 +7484,16 @@ func (d *DefenderForServersGcpOfferingVaAutoProvisioningConfiguration) Unmarshal return nil } -// MarshalJSON implements the json.Marshaller interface for type DenylistCustomAlertRule. -func (d DenylistCustomAlertRule) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForDatabasesGcpOfferingArcAutoProvisioning. +func (d DefenderForDatabasesGcpOfferingArcAutoProvisioning) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "denylistValues", d.DenylistValues) - populate(objectMap, "description", d.Description) - populate(objectMap, "displayName", d.DisplayName) - populate(objectMap, "isEnabled", d.IsEnabled) - objectMap["ruleType"] = "DenylistCustomAlertRule" - populate(objectMap, "valueType", d.ValueType) + populate(objectMap, "configuration", d.Configuration) + populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DenylistCustomAlertRule. -func (d *DenylistCustomAlertRule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForDatabasesGcpOfferingArcAutoProvisioning. +func (d *DefenderForDatabasesGcpOfferingArcAutoProvisioning) 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) @@ -7194,23 +7501,11 @@ func (d *DenylistCustomAlertRule) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "denylistValues": - err = unpopulate(val, "DenylistValues", &d.DenylistValues) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &d.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &d.DisplayName) - delete(rawMsg, key) - case "isEnabled": - err = unpopulate(val, "IsEnabled", &d.IsEnabled) - delete(rawMsg, key) - case "ruleType": - err = unpopulate(val, "RuleType", &d.RuleType) + case "configuration": + err = unpopulate(val, "Configuration", &d.Configuration) delete(rawMsg, key) - case "valueType": - err = unpopulate(val, "ValueType", &d.ValueType) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) delete(rawMsg, key) } if err != nil { @@ -7220,18 +7515,16 @@ func (d *DenylistCustomAlertRule) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DeviceSecurityGroup. -func (d DeviceSecurityGroup) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration. +func (d DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "type", d.Type) + populate(objectMap, "privateLinkScope", d.PrivateLinkScope) + populate(objectMap, "proxy", d.Proxy) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeviceSecurityGroup. -func (d *DeviceSecurityGroup) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration. +func (d *DefenderForDatabasesGcpOfferingArcAutoProvisioningConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -7239,17 +7532,11 @@ func (d *DeviceSecurityGroup) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) + case "privateLinkScope": + err = unpopulate(val, "PrivateLinkScope", &d.PrivateLinkScope) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) + case "proxy": + err = unpopulate(val, "Proxy", &d.Proxy) delete(rawMsg, key) } if err != nil { @@ -7259,16 +7546,16 @@ func (d *DeviceSecurityGroup) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DeviceSecurityGroupList. -func (d DeviceSecurityGroupList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning. +func (d DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + populate(objectMap, "serviceAccountEmailAddress", d.ServiceAccountEmailAddress) + populate(objectMap, "workloadIdentityProviderId", d.WorkloadIdentityProviderID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeviceSecurityGroupList. -func (d *DeviceSecurityGroupList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning. +func (d *DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -7276,11 +7563,11 @@ func (d *DeviceSecurityGroupList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) + case "serviceAccountEmailAddress": + err = unpopulate(val, "ServiceAccountEmailAddress", &d.ServiceAccountEmailAddress) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) + case "workloadIdentityProviderId": + err = unpopulate(val, "WorkloadIdentityProviderID", &d.WorkloadIdentityProviderID) delete(rawMsg, key) } if err != nil { @@ -7290,18 +7577,16 @@ func (d *DeviceSecurityGroupList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DeviceSecurityGroupProperties. -func (d DeviceSecurityGroupProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForDevOpsAzureDevOpsOffering. +func (d DefenderForDevOpsAzureDevOpsOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "allowlistRules", d.AllowlistRules) - populate(objectMap, "denylistRules", d.DenylistRules) - populate(objectMap, "thresholdRules", d.ThresholdRules) - populate(objectMap, "timeWindowRules", d.TimeWindowRules) + populate(objectMap, "description", d.Description) + objectMap["offeringType"] = OfferingTypeDefenderForDevOpsAzureDevOps return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DeviceSecurityGroupProperties. -func (d *DeviceSecurityGroupProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForDevOpsAzureDevOpsOffering. +func (d *DefenderForDevOpsAzureDevOpsOffering) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -7309,17 +7594,11 @@ func (d *DeviceSecurityGroupProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "allowlistRules": - d.AllowlistRules, err = unmarshalAllowlistCustomAlertRuleClassificationArray(val) - delete(rawMsg, key) - case "denylistRules": - err = unpopulate(val, "DenylistRules", &d.DenylistRules) - delete(rawMsg, key) - case "thresholdRules": - d.ThresholdRules, err = unmarshalThresholdCustomAlertRuleClassificationArray(val) + case "description": + err = unpopulate(val, "Description", &d.Description) delete(rawMsg, key) - case "timeWindowRules": - d.TimeWindowRules, err = unmarshalTimeWindowCustomAlertRuleClassificationArray(val) + case "offeringType": + err = unpopulate(val, "OfferingType", &d.OfferingType) delete(rawMsg, key) } if err != nil { @@ -7329,21 +7608,16 @@ func (d *DeviceSecurityGroupProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DirectMethodInvokesNotInAllowedRange. -func (d DirectMethodInvokesNotInAllowedRange) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForDevOpsGitLabOffering. +func (d DefenderForDevOpsGitLabOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "description", d.Description) - populate(objectMap, "displayName", d.DisplayName) - populate(objectMap, "isEnabled", d.IsEnabled) - populate(objectMap, "maxThreshold", d.MaxThreshold) - populate(objectMap, "minThreshold", d.MinThreshold) - objectMap["ruleType"] = "DirectMethodInvokesNotInAllowedRange" - populate(objectMap, "timeWindowSize", d.TimeWindowSize) + objectMap["offeringType"] = OfferingTypeDefenderForDevOpsGitLab return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DirectMethodInvokesNotInAllowedRange. -func (d *DirectMethodInvokesNotInAllowedRange) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForDevOpsGitLabOffering. +func (d *DefenderForDevOpsGitLabOffering) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -7354,23 +7628,8 @@ func (d *DirectMethodInvokesNotInAllowedRange) UnmarshalJSON(data []byte) error case "description": err = unpopulate(val, "Description", &d.Description) delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &d.DisplayName) - delete(rawMsg, key) - case "isEnabled": - err = unpopulate(val, "IsEnabled", &d.IsEnabled) - delete(rawMsg, key) - case "maxThreshold": - err = unpopulate(val, "MaxThreshold", &d.MaxThreshold) - delete(rawMsg, key) - case "minThreshold": - err = unpopulate(val, "MinThreshold", &d.MinThreshold) - delete(rawMsg, key) - case "ruleType": - err = unpopulate(val, "RuleType", &d.RuleType) - delete(rawMsg, key) - case "timeWindowSize": - err = unpopulate(val, "TimeWindowSize", &d.TimeWindowSize) + case "offeringType": + err = unpopulate(val, "OfferingType", &d.OfferingType) delete(rawMsg, key) } if err != nil { @@ -7380,19 +7639,16 @@ func (d *DirectMethodInvokesNotInAllowedRange) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type DiscoveredSecuritySolution. -func (d DiscoveredSecuritySolution) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForDevOpsGithubOffering. +func (d DefenderForDevOpsGithubOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", d.ID) - populate(objectMap, "location", d.Location) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "type", d.Type) + populate(objectMap, "description", d.Description) + objectMap["offeringType"] = OfferingTypeDefenderForDevOpsGithub return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DiscoveredSecuritySolution. -func (d *DiscoveredSecuritySolution) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForDevOpsGithubOffering. +func (d *DefenderForDevOpsGithubOffering) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -7400,20 +7656,11 @@ func (d *DiscoveredSecuritySolution) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &d.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &d.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &d.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &d.Properties) + case "description": + err = unpopulate(val, "Description", &d.Description) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &d.Type) + case "offeringType": + err = unpopulate(val, "OfferingType", &d.OfferingType) delete(rawMsg, key) } if err != nil { @@ -7423,16 +7670,22 @@ func (d *DiscoveredSecuritySolution) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DiscoveredSecuritySolutionList. -func (d DiscoveredSecuritySolutionList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOffering. +func (d DefenderForServersAwsOffering) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + populate(objectMap, "arcAutoProvisioning", d.ArcAutoProvisioning) + populate(objectMap, "defenderForServers", d.DefenderForServers) + populate(objectMap, "description", d.Description) + populate(objectMap, "mdeAutoProvisioning", d.MdeAutoProvisioning) + objectMap["offeringType"] = OfferingTypeDefenderForServersAws + populate(objectMap, "subPlan", d.SubPlan) + populate(objectMap, "vmScanners", d.VMScanners) + populate(objectMap, "vaAutoProvisioning", d.VaAutoProvisioning) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DiscoveredSecuritySolutionList. -func (d *DiscoveredSecuritySolutionList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersAwsOffering. +func (d *DefenderForServersAwsOffering) 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) @@ -7440,11 +7693,29 @@ func (d *DiscoveredSecuritySolutionList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) + case "arcAutoProvisioning": + err = unpopulate(val, "ArcAutoProvisioning", &d.ArcAutoProvisioning) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) + case "defenderForServers": + err = unpopulate(val, "DefenderForServers", &d.DefenderForServers) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "mdeAutoProvisioning": + err = unpopulate(val, "MdeAutoProvisioning", &d.MdeAutoProvisioning) + delete(rawMsg, key) + case "offeringType": + err = unpopulate(val, "OfferingType", &d.OfferingType) + delete(rawMsg, key) + case "subPlan": + err = unpopulate(val, "SubPlan", &d.SubPlan) + delete(rawMsg, key) + case "vmScanners": + err = unpopulate(val, "VMScanners", &d.VMScanners) + delete(rawMsg, key) + case "vaAutoProvisioning": + err = unpopulate(val, "VaAutoProvisioning", &d.VaAutoProvisioning) delete(rawMsg, key) } if err != nil { @@ -7454,18 +7725,17 @@ func (d *DiscoveredSecuritySolutionList) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DiscoveredSecuritySolutionProperties. -func (d DiscoveredSecuritySolutionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingArcAutoProvisioning. +func (d DefenderForServersAwsOfferingArcAutoProvisioning) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "offer", d.Offer) - populate(objectMap, "publisher", d.Publisher) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "securityFamily", d.SecurityFamily) + populate(objectMap, "cloudRoleArn", d.CloudRoleArn) + populate(objectMap, "configuration", d.Configuration) + populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DiscoveredSecuritySolutionProperties. -func (d *DiscoveredSecuritySolutionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersAwsOfferingArcAutoProvisioning. +func (d *DefenderForServersAwsOfferingArcAutoProvisioning) 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) @@ -7473,17 +7743,14 @@ func (d *DiscoveredSecuritySolutionProperties) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "offer": - err = unpopulate(val, "Offer", &d.Offer) - delete(rawMsg, key) - case "publisher": - err = unpopulate(val, "Publisher", &d.Publisher) + case "cloudRoleArn": + err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) delete(rawMsg, key) - case "sku": - err = unpopulate(val, "SKU", &d.SKU) + case "configuration": + err = unpopulate(val, "Configuration", &d.Configuration) delete(rawMsg, key) - case "securityFamily": - err = unpopulate(val, "SecurityFamily", &d.SecurityFamily) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) delete(rawMsg, key) } if err != nil { @@ -7493,646 +7760,2280 @@ 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 DefenderForServersAwsOfferingArcAutoProvisioningConfiguration. +func (d DefenderForServersAwsOfferingArcAutoProvisioningConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "etag", e.Etag) + populate(objectMap, "privateLinkScope", d.PrivateLinkScope) + populate(objectMap, "proxy", d.Proxy) 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 DefenderForServersAwsOfferingArcAutoProvisioningConfiguration. +func (d *DefenderForServersAwsOfferingArcAutoProvisioningConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", 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 "privateLinkScope": + err = unpopulate(val, "PrivateLinkScope", &d.PrivateLinkScope) + delete(rawMsg, key) + case "proxy": + err = unpopulate(val, "Proxy", &d.Proxy) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", 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 DefenderForServersAwsOfferingDefenderForServers. +func (d DefenderForServersAwsOfferingDefenderForServers) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "networkInterface", e.NetworkInterface) - populate(objectMap, "networkSecurityGroups", e.NetworkSecurityGroups) + populate(objectMap, "cloudRoleArn", d.CloudRoleArn) 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 DefenderForServersAwsOfferingDefenderForServers. +func (d *DefenderForServersAwsOfferingDefenderForServers) 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 "networkInterface": - err = unpopulate(val, "NetworkInterface", &e.NetworkInterface) - delete(rawMsg, key) - case "networkSecurityGroups": - err = unpopulate(val, "NetworkSecurityGroups", &e.NetworkSecurityGroups) + case "cloudRoleArn": + err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) 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 EnvironmentData. -func (e EnvironmentData) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingMdeAutoProvisioning. +func (d DefenderForServersAwsOfferingMdeAutoProvisioning) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["environmentType"] = e.EnvironmentType + populateAny(objectMap, "configuration", d.Configuration) + populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentData. -func (e *EnvironmentData) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersAwsOfferingMdeAutoProvisioning. +func (d *DefenderForServersAwsOfferingMdeAutoProvisioning) 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 "environmentType": - err = unpopulate(val, "EnvironmentType", &e.EnvironmentType) + case "configuration": + err = unpopulate(val, "Configuration", &d.Configuration) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type EnvironmentDetails. -func (e EnvironmentDetails) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingSubPlan. +func (d DefenderForServersAwsOfferingSubPlan) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "environmentHierarchyId", e.EnvironmentHierarchyID) - populate(objectMap, "nativeResourceId", e.NativeResourceID) - populate(objectMap, "organizationalHierarchyId", e.OrganizationalHierarchyID) - populate(objectMap, "subscriptionId", e.SubscriptionID) - populate(objectMap, "tenantId", e.TenantID) + populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentDetails. -func (e *EnvironmentDetails) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersAwsOfferingSubPlan. +func (d *DefenderForServersAwsOfferingSubPlan) 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 "environmentHierarchyId": - err = unpopulate(val, "EnvironmentHierarchyID", &e.EnvironmentHierarchyID) - delete(rawMsg, key) - case "nativeResourceId": - err = unpopulate(val, "NativeResourceID", &e.NativeResourceID) - delete(rawMsg, key) - case "organizationalHierarchyId": - err = unpopulate(val, "OrganizationalHierarchyID", &e.OrganizationalHierarchyID) - delete(rawMsg, key) - case "subscriptionId": - err = unpopulate(val, "SubscriptionID", &e.SubscriptionID) - delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &e.TenantID) + case "type": + err = unpopulate(val, "Type", &d.Type) 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 ErrorAdditionalInfo. -func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingVMScanners. +func (d DefenderForServersAwsOfferingVMScanners) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateAny(objectMap, "info", e.Info) - populate(objectMap, "type", e.Type) + populate(objectMap, "configuration", d.Configuration) + populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. -func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersAwsOfferingVMScanners. +func (d *DefenderForServersAwsOfferingVMScanners) 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 "info": - err = unpopulate(val, "Info", &e.Info) + case "configuration": + err = unpopulate(val, "Configuration", &d.Configuration) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) 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 ErrorDetail. -func (e ErrorDetail) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingVMScannersConfiguration. +func (d DefenderForServersAwsOfferingVMScannersConfiguration) 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) + populate(objectMap, "cloudRoleArn", d.CloudRoleArn) + populate(objectMap, "exclusionTags", d.ExclusionTags) + populate(objectMap, "scanningMode", d.ScanningMode) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. -func (e *ErrorDetail) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersAwsOfferingVMScannersConfiguration. +func (d *DefenderForServersAwsOfferingVMScannersConfiguration) 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 "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) + case "cloudRoleArn": + err = unpopulate(val, "CloudRoleArn", &d.CloudRoleArn) delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &e.Message) + case "exclusionTags": + err = unpopulate(val, "ExclusionTags", &d.ExclusionTags) delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &e.Target) + case "scanningMode": + err = unpopulate(val, "ScanningMode", &d.ScanningMode) 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 DefenderForServersAwsOfferingVaAutoProvisioning. +func (d DefenderForServersAwsOfferingVaAutoProvisioning) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "configuration", d.Configuration) + populate(objectMap, "enabled", d.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersAwsOfferingVaAutoProvisioning. +func (d *DefenderForServersAwsOfferingVaAutoProvisioning) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "configuration": + err = unpopulate(val, "Configuration", &d.Configuration) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingVaAutoProvisioningConfiguration. +func (d DefenderForServersAwsOfferingVaAutoProvisioningConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersAwsOfferingVaAutoProvisioningConfiguration. +func (d *DefenderForServersAwsOfferingVaAutoProvisioningConfiguration) 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 "type": + err = unpopulate(val, "Type", &d.Type) + 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 DefenderForServersGcpOffering. +func (d DefenderForServersGcpOffering) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "arcAutoProvisioning", d.ArcAutoProvisioning) + populate(objectMap, "defenderForServers", d.DefenderForServers) + populate(objectMap, "description", d.Description) + populate(objectMap, "mdeAutoProvisioning", d.MdeAutoProvisioning) + objectMap["offeringType"] = OfferingTypeDefenderForServersGcp + populate(objectMap, "subPlan", d.SubPlan) + populate(objectMap, "vmScanners", d.VMScanners) + populate(objectMap, "vaAutoProvisioning", d.VaAutoProvisioning) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersGcpOffering. +func (d *DefenderForServersGcpOffering) 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 "arcAutoProvisioning": + err = unpopulate(val, "ArcAutoProvisioning", &d.ArcAutoProvisioning) + delete(rawMsg, key) + case "defenderForServers": + err = unpopulate(val, "DefenderForServers", &d.DefenderForServers) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "mdeAutoProvisioning": + err = unpopulate(val, "MdeAutoProvisioning", &d.MdeAutoProvisioning) + delete(rawMsg, key) + case "offeringType": + err = unpopulate(val, "OfferingType", &d.OfferingType) + delete(rawMsg, key) + case "subPlan": + err = unpopulate(val, "SubPlan", &d.SubPlan) + delete(rawMsg, key) + case "vmScanners": + err = unpopulate(val, "VMScanners", &d.VMScanners) + delete(rawMsg, key) + case "vaAutoProvisioning": + err = unpopulate(val, "VaAutoProvisioning", &d.VaAutoProvisioning) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingArcAutoProvisioning. +func (d DefenderForServersGcpOfferingArcAutoProvisioning) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "configuration", d.Configuration) + populate(objectMap, "enabled", d.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersGcpOfferingArcAutoProvisioning. +func (d *DefenderForServersGcpOfferingArcAutoProvisioning) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "configuration": + err = unpopulate(val, "Configuration", &d.Configuration) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingArcAutoProvisioningConfiguration. +func (d DefenderForServersGcpOfferingArcAutoProvisioningConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "privateLinkScope", d.PrivateLinkScope) + populate(objectMap, "proxy", d.Proxy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersGcpOfferingArcAutoProvisioningConfiguration. +func (d *DefenderForServersGcpOfferingArcAutoProvisioningConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "privateLinkScope": + err = unpopulate(val, "PrivateLinkScope", &d.PrivateLinkScope) + delete(rawMsg, key) + case "proxy": + err = unpopulate(val, "Proxy", &d.Proxy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingDefenderForServers. +func (d DefenderForServersGcpOfferingDefenderForServers) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serviceAccountEmailAddress", d.ServiceAccountEmailAddress) + populate(objectMap, "workloadIdentityProviderId", d.WorkloadIdentityProviderID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersGcpOfferingDefenderForServers. +func (d *DefenderForServersGcpOfferingDefenderForServers) 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 "serviceAccountEmailAddress": + err = unpopulate(val, "ServiceAccountEmailAddress", &d.ServiceAccountEmailAddress) + delete(rawMsg, key) + case "workloadIdentityProviderId": + err = unpopulate(val, "WorkloadIdentityProviderID", &d.WorkloadIdentityProviderID) + 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 DefenderForServersGcpOfferingMdeAutoProvisioning. +func (d DefenderForServersGcpOfferingMdeAutoProvisioning) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateAny(objectMap, "configuration", d.Configuration) + populate(objectMap, "enabled", d.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersGcpOfferingMdeAutoProvisioning. +func (d *DefenderForServersGcpOfferingMdeAutoProvisioning) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "configuration": + err = unpopulate(val, "Configuration", &d.Configuration) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingSubPlan. +func (d DefenderForServersGcpOfferingSubPlan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersGcpOfferingSubPlan. +func (d *DefenderForServersGcpOfferingSubPlan) 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 "type": + err = unpopulate(val, "Type", &d.Type) + 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 DefenderForServersGcpOfferingVMScanners. +func (d DefenderForServersGcpOfferingVMScanners) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "configuration", d.Configuration) + populate(objectMap, "enabled", d.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersGcpOfferingVMScanners. +func (d *DefenderForServersGcpOfferingVMScanners) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "configuration": + err = unpopulate(val, "Configuration", &d.Configuration) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingVMScannersConfiguration. +func (d DefenderForServersGcpOfferingVMScannersConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "exclusionTags", d.ExclusionTags) + populate(objectMap, "scanningMode", d.ScanningMode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersGcpOfferingVMScannersConfiguration. +func (d *DefenderForServersGcpOfferingVMScannersConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "exclusionTags": + err = unpopulate(val, "ExclusionTags", &d.ExclusionTags) + delete(rawMsg, key) + case "scanningMode": + err = unpopulate(val, "ScanningMode", &d.ScanningMode) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingVaAutoProvisioning. +func (d DefenderForServersGcpOfferingVaAutoProvisioning) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "configuration", d.Configuration) + populate(objectMap, "enabled", d.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersGcpOfferingVaAutoProvisioning. +func (d *DefenderForServersGcpOfferingVaAutoProvisioning) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "configuration": + err = unpopulate(val, "Configuration", &d.Configuration) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &d.Enabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingVaAutoProvisioningConfiguration. +func (d DefenderForServersGcpOfferingVaAutoProvisioningConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForServersGcpOfferingVaAutoProvisioningConfiguration. +func (d *DefenderForServersGcpOfferingVaAutoProvisioningConfiguration) 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 "type": + err = unpopulate(val, "Type", &d.Type) + 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 DefenderForStorageSetting. +func (d DefenderForStorageSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForStorageSetting. +func (d *DefenderForStorageSetting) 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 "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + 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 DefenderForStorageSettingProperties. +func (d DefenderForStorageSettingProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "isEnabled", d.IsEnabled) + populate(objectMap, "malwareScanning", d.MalwareScanning) + populate(objectMap, "overrideSubscriptionLevelSettings", d.OverrideSubscriptionLevelSettings) + populate(objectMap, "sensitiveDataDiscovery", d.SensitiveDataDiscovery) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefenderForStorageSettingProperties. +func (d *DefenderForStorageSettingProperties) 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 "isEnabled": + err = unpopulate(val, "IsEnabled", &d.IsEnabled) + delete(rawMsg, key) + case "malwareScanning": + err = unpopulate(val, "MalwareScanning", &d.MalwareScanning) + delete(rawMsg, key) + case "overrideSubscriptionLevelSettings": + err = unpopulate(val, "OverrideSubscriptionLevelSettings", &d.OverrideSubscriptionLevelSettings) + delete(rawMsg, key) + case "sensitiveDataDiscovery": + err = unpopulate(val, "SensitiveDataDiscovery", &d.SensitiveDataDiscovery) + 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 DenylistCustomAlertRule. +func (d DenylistCustomAlertRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "denylistValues", d.DenylistValues) + populate(objectMap, "description", d.Description) + populate(objectMap, "displayName", d.DisplayName) + populate(objectMap, "isEnabled", d.IsEnabled) + objectMap["ruleType"] = "DenylistCustomAlertRule" + populate(objectMap, "valueType", d.ValueType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DenylistCustomAlertRule. +func (d *DenylistCustomAlertRule) 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 "denylistValues": + err = unpopulate(val, "DenylistValues", &d.DenylistValues) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &d.DisplayName) + delete(rawMsg, key) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &d.IsEnabled) + delete(rawMsg, key) + case "ruleType": + err = unpopulate(val, "RuleType", &d.RuleType) + delete(rawMsg, key) + case "valueType": + err = unpopulate(val, "ValueType", &d.ValueType) + 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) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DevOpsConfiguration. +func (d *DevOpsConfiguration) 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 "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + 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 DevOpsConfigurationListResponse. +func (d DevOpsConfigurationListResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DevOpsConfigurationListResponse. +func (d *DevOpsConfigurationListResponse) 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 "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + 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 DevOpsConfigurationProperties. +func (d DevOpsConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authorization", d.Authorization) + populate(objectMap, "autoDiscovery", d.AutoDiscovery) + populate(objectMap, "provisioningState", d.ProvisioningState) + populate(objectMap, "provisioningStatusMessage", d.ProvisioningStatusMessage) + populateTimeRFC3339(objectMap, "provisioningStatusUpdateTimeUtc", d.ProvisioningStatusUpdateTimeUTC) + populate(objectMap, "topLevelInventoryList", d.TopLevelInventoryList) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DevOpsConfigurationProperties. +func (d *DevOpsConfigurationProperties) 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 "authorization": + err = unpopulate(val, "Authorization", &d.Authorization) + delete(rawMsg, key) + case "autoDiscovery": + err = unpopulate(val, "AutoDiscovery", &d.AutoDiscovery) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) + delete(rawMsg, key) + case "provisioningStatusMessage": + err = unpopulate(val, "ProvisioningStatusMessage", &d.ProvisioningStatusMessage) + delete(rawMsg, key) + case "provisioningStatusUpdateTimeUtc": + err = unpopulateTimeRFC3339(val, "ProvisioningStatusUpdateTimeUTC", &d.ProvisioningStatusUpdateTimeUTC) + delete(rawMsg, key) + case "topLevelInventoryList": + err = unpopulate(val, "TopLevelInventoryList", &d.TopLevelInventoryList) + 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 DeviceSecurityGroup. +func (d DeviceSecurityGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeviceSecurityGroup. +func (d *DeviceSecurityGroup) 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 "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + 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 DeviceSecurityGroupList. +func (d DeviceSecurityGroupList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeviceSecurityGroupList. +func (d *DeviceSecurityGroupList) 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 "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + 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 DeviceSecurityGroupProperties. +func (d DeviceSecurityGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowlistRules", d.AllowlistRules) + populate(objectMap, "denylistRules", d.DenylistRules) + populate(objectMap, "thresholdRules", d.ThresholdRules) + populate(objectMap, "timeWindowRules", d.TimeWindowRules) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeviceSecurityGroupProperties. +func (d *DeviceSecurityGroupProperties) 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 "allowlistRules": + d.AllowlistRules, err = unmarshalAllowlistCustomAlertRuleClassificationArray(val) + delete(rawMsg, key) + case "denylistRules": + err = unpopulate(val, "DenylistRules", &d.DenylistRules) + delete(rawMsg, key) + case "thresholdRules": + d.ThresholdRules, err = unmarshalThresholdCustomAlertRuleClassificationArray(val) + delete(rawMsg, key) + case "timeWindowRules": + d.TimeWindowRules, err = unmarshalTimeWindowCustomAlertRuleClassificationArray(val) + 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 DirectMethodInvokesNotInAllowedRange. +func (d DirectMethodInvokesNotInAllowedRange) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", d.Description) + populate(objectMap, "displayName", d.DisplayName) + populate(objectMap, "isEnabled", d.IsEnabled) + populate(objectMap, "maxThreshold", d.MaxThreshold) + populate(objectMap, "minThreshold", d.MinThreshold) + objectMap["ruleType"] = "DirectMethodInvokesNotInAllowedRange" + populate(objectMap, "timeWindowSize", d.TimeWindowSize) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DirectMethodInvokesNotInAllowedRange. +func (d *DirectMethodInvokesNotInAllowedRange) 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 "displayName": + err = unpopulate(val, "DisplayName", &d.DisplayName) + delete(rawMsg, key) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &d.IsEnabled) + delete(rawMsg, key) + case "maxThreshold": + err = unpopulate(val, "MaxThreshold", &d.MaxThreshold) + delete(rawMsg, key) + case "minThreshold": + err = unpopulate(val, "MinThreshold", &d.MinThreshold) + delete(rawMsg, key) + case "ruleType": + err = unpopulate(val, "RuleType", &d.RuleType) + delete(rawMsg, key) + case "timeWindowSize": + err = unpopulate(val, "TimeWindowSize", &d.TimeWindowSize) + 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 DiscoveredSecuritySolution. +func (d DiscoveredSecuritySolution) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "location", d.Location) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiscoveredSecuritySolution. +func (d *DiscoveredSecuritySolution) 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 "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &d.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + 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 DiscoveredSecuritySolutionList. +func (d DiscoveredSecuritySolutionList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiscoveredSecuritySolutionList. +func (d *DiscoveredSecuritySolutionList) 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 "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + 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 DiscoveredSecuritySolutionProperties. +func (d DiscoveredSecuritySolutionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "offer", d.Offer) + populate(objectMap, "publisher", d.Publisher) + populate(objectMap, "sku", d.SKU) + populate(objectMap, "securityFamily", d.SecurityFamily) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiscoveredSecuritySolutionProperties. +func (d *DiscoveredSecuritySolutionProperties) 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 "offer": + err = unpopulate(val, "Offer", &d.Offer) + delete(rawMsg, key) + case "publisher": + err = unpopulate(val, "Publisher", &d.Publisher) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &d.SKU) + delete(rawMsg, key) + case "securityFamily": + err = unpopulate(val, "SecurityFamily", &d.SecurityFamily) + 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 ETag. +func (e ETag) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", e.Etag) + return json.Marshal(objectMap) +} + +// 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) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &e.Etag) + 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 EffectiveNetworkSecurityGroups. +func (e EffectiveNetworkSecurityGroups) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "networkInterface", e.NetworkInterface) + populate(objectMap, "networkSecurityGroups", e.NetworkSecurityGroups) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EffectiveNetworkSecurityGroups. +func (e *EffectiveNetworkSecurityGroups) 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 "networkInterface": + err = unpopulate(val, "NetworkInterface", &e.NetworkInterface) + delete(rawMsg, key) + case "networkSecurityGroups": + err = unpopulate(val, "NetworkSecurityGroups", &e.NetworkSecurityGroups) + 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 EnvironmentData. +func (e EnvironmentData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["environmentType"] = e.EnvironmentType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentData. +func (e *EnvironmentData) 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 "environmentType": + err = unpopulate(val, "EnvironmentType", &e.EnvironmentType) + 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 EnvironmentDetails. +func (e EnvironmentDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "environmentHierarchyId", e.EnvironmentHierarchyID) + populate(objectMap, "nativeResourceId", e.NativeResourceID) + populate(objectMap, "organizationalHierarchyId", e.OrganizationalHierarchyID) + populate(objectMap, "subscriptionId", e.SubscriptionID) + populate(objectMap, "tenantId", e.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EnvironmentDetails. +func (e *EnvironmentDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "environmentHierarchyId": + err = unpopulate(val, "EnvironmentHierarchyID", &e.EnvironmentHierarchyID) + delete(rawMsg, key) + case "nativeResourceId": + err = unpopulate(val, "NativeResourceID", &e.NativeResourceID) + delete(rawMsg, key) + case "organizationalHierarchyId": + err = unpopulate(val, "OrganizationalHierarchyID", &e.OrganizationalHierarchyID) + delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &e.SubscriptionID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &e.TenantID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateAny(objectMap, "info", e.Info) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) 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 "info": + err = unpopulate(val, "Info", &e.Info) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + 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 ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorDetailAutoGenerated. +func (e ErrorDetailAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetailAutoGenerated. +func (e *ErrorDetailAutoGenerated) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. +func (e *ErrorResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &e.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponseAutoGenerated. +func (e ErrorResponseAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseAutoGenerated. +func (e *ErrorResponseAutoGenerated) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &e.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExecuteGovernanceRuleParams. +func (e ExecuteGovernanceRuleParams) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Extension. +func (e *Extension) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalExtensionProperties": + err = unpopulate(val, "AdditionalExtensionProperties", &e.AdditionalExtensionProperties) + delete(rawMsg, key) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &e.IsEnabled) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "operationStatus": + err = unpopulate(val, "OperationStatus", &e.OperationStatus) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExternalSecuritySolution. +func (e ExternalSecuritySolution) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + populate(objectMap, "kind", e.Kind) + populate(objectMap, "location", e.Location) + populate(objectMap, "name", e.Name) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalSecuritySolution. +func (e *ExternalSecuritySolution) 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 "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &e.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &e.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + 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 ExternalSecuritySolutionKindAutoGenerated. +func (e ExternalSecuritySolutionKindAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "kind", e.Kind) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalSecuritySolutionKindAutoGenerated. +func (e *ExternalSecuritySolutionKindAutoGenerated) 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 "kind": + err = unpopulate(val, "Kind", &e.Kind) + 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 ExternalSecuritySolutionList. +func (e ExternalSecuritySolutionList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalSecuritySolutionList. +func (e *ExternalSecuritySolutionList) 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 "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + 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 ExternalSecuritySolutionProperties. +func (e ExternalSecuritySolutionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "deviceType", e.DeviceType) + populate(objectMap, "deviceVendor", e.DeviceVendor) + populate(objectMap, "workspace", e.Workspace) + if e.AdditionalProperties != nil { + for key, val := range e.AdditionalProperties { + objectMap[key] = val + } + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalSecuritySolutionProperties. +func (e *ExternalSecuritySolutionProperties) 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 "deviceType": + err = unpopulate(val, "DeviceType", &e.DeviceType) + delete(rawMsg, key) + case "deviceVendor": + err = unpopulate(val, "DeviceVendor", &e.DeviceVendor) + delete(rawMsg, key) + case "workspace": + err = unpopulate(val, "Workspace", &e.Workspace) + delete(rawMsg, key) + default: + if e.AdditionalProperties == nil { + e.AdditionalProperties = map[string]any{} + } + if val != nil { + var aux any + err = json.Unmarshal(val, &aux) + e.AdditionalProperties[key] = aux + } + 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 FailedLocalLoginsNotInAllowedRange. +func (f FailedLocalLoginsNotInAllowedRange) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", f.Description) + populate(objectMap, "displayName", f.DisplayName) + populate(objectMap, "isEnabled", f.IsEnabled) + populate(objectMap, "maxThreshold", f.MaxThreshold) + populate(objectMap, "minThreshold", f.MinThreshold) + objectMap["ruleType"] = "FailedLocalLoginsNotInAllowedRange" + populate(objectMap, "timeWindowSize", f.TimeWindowSize) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FailedLocalLoginsNotInAllowedRange. +func (f *FailedLocalLoginsNotInAllowedRange) 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", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &f.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &f.DisplayName) + delete(rawMsg, key) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &f.IsEnabled) + delete(rawMsg, key) + case "maxThreshold": + err = unpopulate(val, "MaxThreshold", &f.MaxThreshold) + delete(rawMsg, key) + case "minThreshold": + err = unpopulate(val, "MinThreshold", &f.MinThreshold) + delete(rawMsg, key) + case "ruleType": + err = unpopulate(val, "RuleType", &f.RuleType) + delete(rawMsg, key) + case "timeWindowSize": + err = unpopulate(val, "TimeWindowSize", &f.TimeWindowSize) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorDetailAutoGenerated. -func (e ErrorDetailAutoGenerated) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type FileUploadsNotInAllowedRange. +func (f FileUploadsNotInAllowedRange) 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) + populate(objectMap, "description", f.Description) + populate(objectMap, "displayName", f.DisplayName) + populate(objectMap, "isEnabled", f.IsEnabled) + populate(objectMap, "maxThreshold", f.MaxThreshold) + populate(objectMap, "minThreshold", f.MinThreshold) + objectMap["ruleType"] = "FileUploadsNotInAllowedRange" + populate(objectMap, "timeWindowSize", f.TimeWindowSize) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetailAutoGenerated. -func (e *ErrorDetailAutoGenerated) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type FileUploadsNotInAllowedRange. +func (f *FileUploadsNotInAllowedRange) 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", f, err) } for key, val := range rawMsg { var err error switch key { - case "additionalInfo": - err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + case "description": + err = unpopulate(val, "Description", &f.Description) delete(rawMsg, key) - case "code": - err = unpopulate(val, "Code", &e.Code) + case "displayName": + err = unpopulate(val, "DisplayName", &f.DisplayName) delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &e.Details) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &f.IsEnabled) + delete(rawMsg, key) + case "maxThreshold": + err = unpopulate(val, "MaxThreshold", &f.MaxThreshold) + delete(rawMsg, key) + case "minThreshold": + err = unpopulate(val, "MinThreshold", &f.MinThreshold) + delete(rawMsg, key) + case "ruleType": + err = unpopulate(val, "RuleType", &f.RuleType) + delete(rawMsg, key) + case "timeWindowSize": + err = unpopulate(val, "TimeWindowSize", &f.TimeWindowSize) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GcpCredentialsDetailsProperties. +func (g GcpCredentialsDetailsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authProviderX509CertUrl", g.AuthProviderX509CertURL) + populate(objectMap, "authUri", g.AuthURI) + populate(objectMap, "authenticationProvisioningState", g.AuthenticationProvisioningState) + objectMap["authenticationType"] = AuthenticationTypeGcpCredentials + populate(objectMap, "clientEmail", g.ClientEmail) + populate(objectMap, "clientId", g.ClientID) + populate(objectMap, "clientX509CertUrl", g.ClientX509CertURL) + populate(objectMap, "grantedPermissions", g.GrantedPermissions) + populate(objectMap, "organizationId", g.OrganizationID) + populate(objectMap, "privateKey", g.PrivateKey) + populate(objectMap, "privateKeyId", g.PrivateKeyID) + populate(objectMap, "projectId", g.ProjectID) + populate(objectMap, "tokenUri", g.TokenURI) + populate(objectMap, "type", g.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GcpCredentialsDetailsProperties. +func (g *GcpCredentialsDetailsProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "authProviderX509CertUrl": + err = unpopulate(val, "AuthProviderX509CertURL", &g.AuthProviderX509CertURL) + delete(rawMsg, key) + case "authUri": + err = unpopulate(val, "AuthURI", &g.AuthURI) + delete(rawMsg, key) + case "authenticationProvisioningState": + err = unpopulate(val, "AuthenticationProvisioningState", &g.AuthenticationProvisioningState) + delete(rawMsg, key) + case "authenticationType": + err = unpopulate(val, "AuthenticationType", &g.AuthenticationType) + delete(rawMsg, key) + case "clientEmail": + err = unpopulate(val, "ClientEmail", &g.ClientEmail) + delete(rawMsg, key) + case "clientId": + err = unpopulate(val, "ClientID", &g.ClientID) + delete(rawMsg, key) + case "clientX509CertUrl": + err = unpopulate(val, "ClientX509CertURL", &g.ClientX509CertURL) + delete(rawMsg, key) + case "grantedPermissions": + err = unpopulate(val, "GrantedPermissions", &g.GrantedPermissions) + delete(rawMsg, key) + case "organizationId": + err = unpopulate(val, "OrganizationID", &g.OrganizationID) + delete(rawMsg, key) + case "privateKey": + err = unpopulate(val, "PrivateKey", &g.PrivateKey) + delete(rawMsg, key) + case "privateKeyId": + err = unpopulate(val, "PrivateKeyID", &g.PrivateKeyID) + delete(rawMsg, key) + case "projectId": + err = unpopulate(val, "ProjectID", &g.ProjectID) + delete(rawMsg, key) + case "tokenUri": + err = unpopulate(val, "TokenURI", &g.TokenURI) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GcpOrganizationalData. +func (g GcpOrganizationalData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["organizationMembershipType"] = g.OrganizationMembershipType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GcpOrganizationalData. +func (g *GcpOrganizationalData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "organizationMembershipType": + err = unpopulate(val, "OrganizationMembershipType", &g.OrganizationMembershipType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GcpOrganizationalDataMember. +func (g GcpOrganizationalDataMember) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "managementProjectNumber", g.ManagementProjectNumber) + objectMap["organizationMembershipType"] = OrganizationMembershipTypeMember + populate(objectMap, "parentHierarchyId", g.ParentHierarchyID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GcpOrganizationalDataMember. +func (g *GcpOrganizationalDataMember) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "managementProjectNumber": + err = unpopulate(val, "ManagementProjectNumber", &g.ManagementProjectNumber) + delete(rawMsg, key) + case "organizationMembershipType": + err = unpopulate(val, "OrganizationMembershipType", &g.OrganizationMembershipType) + delete(rawMsg, key) + case "parentHierarchyId": + err = unpopulate(val, "ParentHierarchyID", &g.ParentHierarchyID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GcpOrganizationalDataOrganization. +func (g GcpOrganizationalDataOrganization) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "excludedProjectNumbers", g.ExcludedProjectNumbers) + objectMap["organizationMembershipType"] = OrganizationMembershipTypeOrganization + populate(objectMap, "organizationName", g.OrganizationName) + populate(objectMap, "serviceAccountEmailAddress", g.ServiceAccountEmailAddress) + populate(objectMap, "workloadIdentityProviderId", g.WorkloadIdentityProviderID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GcpOrganizationalDataOrganization. +func (g *GcpOrganizationalDataOrganization) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "excludedProjectNumbers": + err = unpopulate(val, "ExcludedProjectNumbers", &g.ExcludedProjectNumbers) + delete(rawMsg, key) + case "organizationMembershipType": + err = unpopulate(val, "OrganizationMembershipType", &g.OrganizationMembershipType) + delete(rawMsg, key) + case "organizationName": + err = unpopulate(val, "OrganizationName", &g.OrganizationName) delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &e.Message) + case "serviceAccountEmailAddress": + err = unpopulate(val, "ServiceAccountEmailAddress", &g.ServiceAccountEmailAddress) delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &e.Target) + case "workloadIdentityProviderId": + err = unpopulate(val, "WorkloadIdentityProviderID", &g.WorkloadIdentityProviderID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. -func (e ErrorResponse) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GcpProjectDetails. +func (g GcpProjectDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "error", e.Error) + populate(objectMap, "projectId", g.ProjectID) + populate(objectMap, "projectName", g.ProjectName) + populate(objectMap, "projectNumber", g.ProjectNumber) + populate(objectMap, "workloadIdentityPoolId", g.WorkloadIdentityPoolID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. -func (e *ErrorResponse) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GcpProjectDetails. +func (g *GcpProjectDetails) 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", g, err) } for key, val := range rawMsg { var err error switch key { - case "error": - err = unpopulate(val, "Error", &e.Error) + case "projectId": + err = unpopulate(val, "ProjectID", &g.ProjectID) + delete(rawMsg, key) + case "projectName": + err = unpopulate(val, "ProjectName", &g.ProjectName) + delete(rawMsg, key) + case "projectNumber": + err = unpopulate(val, "ProjectNumber", &g.ProjectNumber) + delete(rawMsg, key) + case "workloadIdentityPoolId": + err = unpopulate(val, "WorkloadIdentityPoolID", &g.WorkloadIdentityPoolID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorResponseAutoGenerated. -func (e ErrorResponseAutoGenerated) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GcpProjectEnvironmentData. +func (g GcpProjectEnvironmentData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "error", e.Error) + objectMap["environmentType"] = EnvironmentTypeGcpProject + populate(objectMap, "organizationalData", g.OrganizationalData) + populate(objectMap, "projectDetails", g.ProjectDetails) + populate(objectMap, "scanInterval", g.ScanInterval) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseAutoGenerated. -func (e *ErrorResponseAutoGenerated) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GcpProjectEnvironmentData. +func (g *GcpProjectEnvironmentData) 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", g, err) } for key, val := range rawMsg { var err error switch key { - case "error": - err = unpopulate(val, "Error", &e.Error) + case "environmentType": + err = unpopulate(val, "EnvironmentType", &g.EnvironmentType) + delete(rawMsg, key) + case "organizationalData": + g.OrganizationalData, err = unmarshalGcpOrganizationalDataClassification(val) + delete(rawMsg, key) + case "projectDetails": + err = unpopulate(val, "ProjectDetails", &g.ProjectDetails) + delete(rawMsg, key) + case "scanInterval": + err = unpopulate(val, "ScanInterval", &g.ScanInterval) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } 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 GetSensitivitySettingsListResponse. +func (g GetSensitivitySettingsListResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "override", e.Override) + populate(objectMap, "value", g.Value) 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 GetSensitivitySettingsListResponse. +func (g *GetSensitivitySettingsListResponse) 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", g, err) } for key, val := range rawMsg { var err error switch key { - case "override": - err = unpopulate(val, "Override", &e.Override) + case "value": + err = unpopulate(val, "Value", &g.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } 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 GetSensitivitySettingsResponse. +func (g GetSensitivitySettingsResponse) 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, "id", g.ID) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "type", g.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Extension. -func (e *Extension) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GetSensitivitySettingsResponse. +func (g *GetSensitivitySettingsResponse) 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", g, err) } for key, val := range rawMsg { var err error switch key { - case "additionalExtensionProperties": - err = unpopulate(val, "AdditionalExtensionProperties", &e.AdditionalExtensionProperties) - delete(rawMsg, key) - case "isEnabled": - err = unpopulate(val, "IsEnabled", &e.IsEnabled) + case "id": + err = unpopulate(val, "ID", &g.ID) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &e.Name) + err = unpopulate(val, "Name", &g.Name) delete(rawMsg, key) - case "operationStatus": - err = unpopulate(val, "OperationStatus", &e.OperationStatus) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ExternalSecuritySolution. -func (e ExternalSecuritySolution) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GetSensitivitySettingsResponseProperties. +func (g GetSensitivitySettingsResponseProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", e.ID) - populate(objectMap, "kind", e.Kind) - populate(objectMap, "location", e.Location) - populate(objectMap, "name", e.Name) - populate(objectMap, "type", e.Type) + populate(objectMap, "mipInformation", g.MipInformation) + populate(objectMap, "sensitiveInfoTypesIds", g.SensitiveInfoTypesIDs) + populate(objectMap, "sensitivityThresholdLabelId", g.SensitivityThresholdLabelID) + populate(objectMap, "sensitivityThresholdLabelOrder", g.SensitivityThresholdLabelOrder) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalSecuritySolution. -func (e *ExternalSecuritySolution) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GetSensitivitySettingsResponseProperties. +func (g *GetSensitivitySettingsResponseProperties) 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", g, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &e.ID) - delete(rawMsg, key) - case "kind": - err = unpopulate(val, "Kind", &e.Kind) + case "mipInformation": + err = unpopulate(val, "MipInformation", &g.MipInformation) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &e.Location) + case "sensitiveInfoTypesIds": + err = unpopulate(val, "SensitiveInfoTypesIDs", &g.SensitiveInfoTypesIDs) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &e.Name) + case "sensitivityThresholdLabelId": + err = unpopulate(val, "SensitivityThresholdLabelID", &g.SensitivityThresholdLabelID) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &e.Type) + case "sensitivityThresholdLabelOrder": + err = unpopulate(val, "SensitivityThresholdLabelOrder", &g.SensitivityThresholdLabelOrder) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ExternalSecuritySolutionKindAutoGenerated. -func (e ExternalSecuritySolutionKindAutoGenerated) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GetSensitivitySettingsResponsePropertiesMipInformation. +func (g GetSensitivitySettingsResponsePropertiesMipInformation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "kind", e.Kind) + populate(objectMap, "builtInInfoTypes", g.BuiltInInfoTypes) + populate(objectMap, "customInfoTypes", g.CustomInfoTypes) + populate(objectMap, "labels", g.Labels) + populate(objectMap, "mipIntegrationStatus", g.MipIntegrationStatus) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalSecuritySolutionKindAutoGenerated. -func (e *ExternalSecuritySolutionKindAutoGenerated) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GetSensitivitySettingsResponsePropertiesMipInformation. +func (g *GetSensitivitySettingsResponsePropertiesMipInformation) 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", g, err) } for key, val := range rawMsg { var err error switch key { - case "kind": - err = unpopulate(val, "Kind", &e.Kind) + case "builtInInfoTypes": + err = unpopulate(val, "BuiltInInfoTypes", &g.BuiltInInfoTypes) + delete(rawMsg, key) + case "customInfoTypes": + err = unpopulate(val, "CustomInfoTypes", &g.CustomInfoTypes) + delete(rawMsg, key) + case "labels": + err = unpopulate(val, "Labels", &g.Labels) + delete(rawMsg, key) + case "mipIntegrationStatus": + err = unpopulate(val, "MipIntegrationStatus", &g.MipIntegrationStatus) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ExternalSecuritySolutionList. -func (e ExternalSecuritySolutionList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GitHubOwner. +func (g GitHubOwner) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) + populate(objectMap, "id", g.ID) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "systemData", g.SystemData) + populate(objectMap, "type", g.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalSecuritySolutionList. -func (e *ExternalSecuritySolutionList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GitHubOwner. +func (g *GitHubOwner) 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", g, err) } for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &e.NextLink) + case "id": + err = unpopulate(val, "ID", &g.ID) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &e.Value) + case "name": + err = unpopulate(val, "Name", &g.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &g.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ExternalSecuritySolutionProperties. -func (e ExternalSecuritySolutionProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GitHubOwnerConfiguration. +func (g GitHubOwnerConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "deviceType", e.DeviceType) - populate(objectMap, "deviceVendor", e.DeviceVendor) - populate(objectMap, "workspace", e.Workspace) - if e.AdditionalProperties != nil { - for key, val := range e.AdditionalProperties { - objectMap[key] = val - } - } + populate(objectMap, "autoDiscovery", g.AutoDiscovery) + populate(objectMap, "repositoryConfigs", g.RepositoryConfigs) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExternalSecuritySolutionProperties. -func (e *ExternalSecuritySolutionProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GitHubOwnerConfiguration. +func (g *GitHubOwnerConfiguration) 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", g, err) } for key, val := range rawMsg { var err error switch key { - case "deviceType": - err = unpopulate(val, "DeviceType", &e.DeviceType) - delete(rawMsg, key) - case "deviceVendor": - err = unpopulate(val, "DeviceVendor", &e.DeviceVendor) - delete(rawMsg, key) - case "workspace": - err = unpopulate(val, "Workspace", &e.Workspace) + case "autoDiscovery": + err = unpopulate(val, "AutoDiscovery", &g.AutoDiscovery) delete(rawMsg, key) - default: - if e.AdditionalProperties == nil { - e.AdditionalProperties = map[string]any{} - } - if val != nil { - var aux any - err = json.Unmarshal(val, &aux) - e.AdditionalProperties[key] = aux - } + case "repositoryConfigs": + err = unpopulate(val, "RepositoryConfigs", &g.RepositoryConfigs) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FailedLocalLoginsNotInAllowedRange. -func (f FailedLocalLoginsNotInAllowedRange) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GitHubOwnerListResponse. +func (g GitHubOwnerListResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", f.Description) - populate(objectMap, "displayName", f.DisplayName) - populate(objectMap, "isEnabled", f.IsEnabled) - populate(objectMap, "maxThreshold", f.MaxThreshold) - populate(objectMap, "minThreshold", f.MinThreshold) - objectMap["ruleType"] = "FailedLocalLoginsNotInAllowedRange" - populate(objectMap, "timeWindowSize", f.TimeWindowSize) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FailedLocalLoginsNotInAllowedRange. -func (f *FailedLocalLoginsNotInAllowedRange) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GitHubOwnerListResponse. +func (g *GitHubOwnerListResponse) 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", f, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &f.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &f.DisplayName) - delete(rawMsg, key) - case "isEnabled": - err = unpopulate(val, "IsEnabled", &f.IsEnabled) - delete(rawMsg, key) - case "maxThreshold": - err = unpopulate(val, "MaxThreshold", &f.MaxThreshold) - delete(rawMsg, key) - case "minThreshold": - err = unpopulate(val, "MinThreshold", &f.MinThreshold) - delete(rawMsg, key) - case "ruleType": - err = unpopulate(val, "RuleType", &f.RuleType) + case "nextLink": + err = unpopulate(val, "NextLink", &g.NextLink) delete(rawMsg, key) - case "timeWindowSize": - err = unpopulate(val, "TimeWindowSize", &f.TimeWindowSize) + case "value": + err = unpopulate(val, "Value", &g.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type FileUploadsNotInAllowedRange. -func (f FileUploadsNotInAllowedRange) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GitHubOwnerProperties. +func (g GitHubOwnerProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "description", f.Description) - populate(objectMap, "displayName", f.DisplayName) - populate(objectMap, "isEnabled", f.IsEnabled) - populate(objectMap, "maxThreshold", f.MaxThreshold) - populate(objectMap, "minThreshold", f.MinThreshold) - objectMap["ruleType"] = "FileUploadsNotInAllowedRange" - populate(objectMap, "timeWindowSize", f.TimeWindowSize) + populate(objectMap, "gitHubInternalId", g.GitHubInternalID) + populate(objectMap, "onboardingState", g.OnboardingState) + populate(objectMap, "ownerUrl", g.OwnerURL) + populate(objectMap, "provisioningState", g.ProvisioningState) + populate(objectMap, "provisioningStatusMessage", g.ProvisioningStatusMessage) + populateTimeRFC3339(objectMap, "provisioningStatusUpdateTimeUtc", g.ProvisioningStatusUpdateTimeUTC) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type FileUploadsNotInAllowedRange. -func (f *FileUploadsNotInAllowedRange) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GitHubOwnerProperties. +func (g *GitHubOwnerProperties) 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", f, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } for key, val := range rawMsg { var err error switch key { - case "description": - err = unpopulate(val, "Description", &f.Description) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &f.DisplayName) + case "gitHubInternalId": + err = unpopulate(val, "GitHubInternalID", &g.GitHubInternalID) delete(rawMsg, key) - case "isEnabled": - err = unpopulate(val, "IsEnabled", &f.IsEnabled) + case "onboardingState": + err = unpopulate(val, "OnboardingState", &g.OnboardingState) delete(rawMsg, key) - case "maxThreshold": - err = unpopulate(val, "MaxThreshold", &f.MaxThreshold) + case "ownerUrl": + err = unpopulate(val, "OwnerURL", &g.OwnerURL) delete(rawMsg, key) - case "minThreshold": - err = unpopulate(val, "MinThreshold", &f.MinThreshold) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) delete(rawMsg, key) - case "ruleType": - err = unpopulate(val, "RuleType", &f.RuleType) + case "provisioningStatusMessage": + err = unpopulate(val, "ProvisioningStatusMessage", &g.ProvisioningStatusMessage) delete(rawMsg, key) - case "timeWindowSize": - err = unpopulate(val, "TimeWindowSize", &f.TimeWindowSize) + case "provisioningStatusUpdateTimeUtc": + err = unpopulateTimeRFC3339(val, "ProvisioningStatusUpdateTimeUTC", &g.ProvisioningStatusUpdateTimeUTC) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", g, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GcpCredentialsDetailsProperties. -func (g GcpCredentialsDetailsProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GitHubRepository. +func (g GitHubRepository) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "authProviderX509CertUrl", g.AuthProviderX509CertURL) - populate(objectMap, "authUri", g.AuthURI) - populate(objectMap, "authenticationProvisioningState", g.AuthenticationProvisioningState) - objectMap["authenticationType"] = AuthenticationTypeGcpCredentials - populate(objectMap, "clientEmail", g.ClientEmail) - populate(objectMap, "clientId", g.ClientID) - populate(objectMap, "clientX509CertUrl", g.ClientX509CertURL) - populate(objectMap, "grantedPermissions", g.GrantedPermissions) - populate(objectMap, "organizationId", g.OrganizationID) - populate(objectMap, "privateKey", g.PrivateKey) - populate(objectMap, "privateKeyId", g.PrivateKeyID) - populate(objectMap, "projectId", g.ProjectID) - populate(objectMap, "tokenUri", g.TokenURI) + populate(objectMap, "id", g.ID) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "systemData", g.SystemData) populate(objectMap, "type", g.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GcpCredentialsDetailsProperties. -func (g *GcpCredentialsDetailsProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GitHubRepository. +func (g *GitHubRepository) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) @@ -8140,44 +10041,17 @@ func (g *GcpCredentialsDetailsProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "authProviderX509CertUrl": - err = unpopulate(val, "AuthProviderX509CertURL", &g.AuthProviderX509CertURL) - delete(rawMsg, key) - case "authUri": - err = unpopulate(val, "AuthURI", &g.AuthURI) - delete(rawMsg, key) - case "authenticationProvisioningState": - err = unpopulate(val, "AuthenticationProvisioningState", &g.AuthenticationProvisioningState) - delete(rawMsg, key) - case "authenticationType": - err = unpopulate(val, "AuthenticationType", &g.AuthenticationType) - delete(rawMsg, key) - case "clientEmail": - err = unpopulate(val, "ClientEmail", &g.ClientEmail) - delete(rawMsg, key) - case "clientId": - err = unpopulate(val, "ClientID", &g.ClientID) - delete(rawMsg, key) - case "clientX509CertUrl": - err = unpopulate(val, "ClientX509CertURL", &g.ClientX509CertURL) - delete(rawMsg, key) - case "grantedPermissions": - err = unpopulate(val, "GrantedPermissions", &g.GrantedPermissions) - delete(rawMsg, key) - case "organizationId": - err = unpopulate(val, "OrganizationID", &g.OrganizationID) - delete(rawMsg, key) - case "privateKey": - err = unpopulate(val, "PrivateKey", &g.PrivateKey) + case "id": + err = unpopulate(val, "ID", &g.ID) delete(rawMsg, key) - case "privateKeyId": - err = unpopulate(val, "PrivateKeyID", &g.PrivateKeyID) + case "name": + err = unpopulate(val, "Name", &g.Name) delete(rawMsg, key) - case "projectId": - err = unpopulate(val, "ProjectID", &g.ProjectID) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) delete(rawMsg, key) - case "tokenUri": - err = unpopulate(val, "TokenURI", &g.TokenURI) + case "systemData": + err = unpopulate(val, "SystemData", &g.SystemData) delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &g.Type) @@ -8190,15 +10064,16 @@ func (g *GcpCredentialsDetailsProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type GcpOrganizationalData. -func (g GcpOrganizationalData) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GitHubRepositoryListResponse. +func (g GitHubRepositoryListResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["organizationMembershipType"] = g.OrganizationMembershipType + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GcpOrganizationalData. -func (g *GcpOrganizationalData) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GitHubRepositoryListResponse. +func (g *GitHubRepositoryListResponse) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) @@ -8206,8 +10081,11 @@ func (g *GcpOrganizationalData) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "organizationMembershipType": - err = unpopulate(val, "OrganizationMembershipType", &g.OrganizationMembershipType) + case "nextLink": + err = unpopulate(val, "NextLink", &g.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &g.Value) delete(rawMsg, key) } if err != nil { @@ -8217,17 +10095,23 @@ func (g *GcpOrganizationalData) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type GcpOrganizationalDataMember. -func (g GcpOrganizationalDataMember) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GitHubRepositoryProperties. +func (g GitHubRepositoryProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "managementProjectNumber", g.ManagementProjectNumber) - objectMap["organizationMembershipType"] = OrganizationMembershipTypeMember - populate(objectMap, "parentHierarchyId", g.ParentHierarchyID) + populate(objectMap, "onboardingState", g.OnboardingState) + populate(objectMap, "parentOwnerName", g.ParentOwnerName) + populate(objectMap, "provisioningState", g.ProvisioningState) + populate(objectMap, "provisioningStatusMessage", g.ProvisioningStatusMessage) + populateTimeRFC3339(objectMap, "provisioningStatusUpdateTimeUtc", g.ProvisioningStatusUpdateTimeUTC) + populate(objectMap, "repoFullName", g.RepoFullName) + populate(objectMap, "repoId", g.RepoID) + populate(objectMap, "repoName", g.RepoName) + populate(objectMap, "repoUrl", g.RepoURL) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GcpOrganizationalDataMember. -func (g *GcpOrganizationalDataMember) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GitHubRepositoryProperties. +func (g *GitHubRepositoryProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) @@ -8235,14 +10119,32 @@ func (g *GcpOrganizationalDataMember) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "managementProjectNumber": - err = unpopulate(val, "ManagementProjectNumber", &g.ManagementProjectNumber) + case "onboardingState": + err = unpopulate(val, "OnboardingState", &g.OnboardingState) delete(rawMsg, key) - case "organizationMembershipType": - err = unpopulate(val, "OrganizationMembershipType", &g.OrganizationMembershipType) + case "parentOwnerName": + err = unpopulate(val, "ParentOwnerName", &g.ParentOwnerName) delete(rawMsg, key) - case "parentHierarchyId": - err = unpopulate(val, "ParentHierarchyID", &g.ParentHierarchyID) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) + delete(rawMsg, key) + case "provisioningStatusMessage": + err = unpopulate(val, "ProvisioningStatusMessage", &g.ProvisioningStatusMessage) + delete(rawMsg, key) + case "provisioningStatusUpdateTimeUtc": + err = unpopulateTimeRFC3339(val, "ProvisioningStatusUpdateTimeUTC", &g.ProvisioningStatusUpdateTimeUTC) + delete(rawMsg, key) + case "repoFullName": + err = unpopulate(val, "RepoFullName", &g.RepoFullName) + delete(rawMsg, key) + case "repoId": + err = unpopulate(val, "RepoID", &g.RepoID) + delete(rawMsg, key) + case "repoName": + err = unpopulate(val, "RepoName", &g.RepoName) + delete(rawMsg, key) + case "repoUrl": + err = unpopulate(val, "RepoURL", &g.RepoURL) delete(rawMsg, key) } if err != nil { @@ -8252,19 +10154,19 @@ func (g *GcpOrganizationalDataMember) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type GcpOrganizationalDataOrganization. -func (g GcpOrganizationalDataOrganization) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GitLabGroup. +func (g GitLabGroup) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "excludedProjectNumbers", g.ExcludedProjectNumbers) - objectMap["organizationMembershipType"] = OrganizationMembershipTypeOrganization - populate(objectMap, "organizationName", g.OrganizationName) - populate(objectMap, "serviceAccountEmailAddress", g.ServiceAccountEmailAddress) - populate(objectMap, "workloadIdentityProviderId", g.WorkloadIdentityProviderID) + populate(objectMap, "id", g.ID) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "systemData", g.SystemData) + populate(objectMap, "type", g.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GcpOrganizationalDataOrganization. -func (g *GcpOrganizationalDataOrganization) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GitLabGroup. +func (g *GitLabGroup) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) @@ -8272,20 +10174,20 @@ func (g *GcpOrganizationalDataOrganization) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "excludedProjectNumbers": - err = unpopulate(val, "ExcludedProjectNumbers", &g.ExcludedProjectNumbers) + case "id": + err = unpopulate(val, "ID", &g.ID) delete(rawMsg, key) - case "organizationMembershipType": - err = unpopulate(val, "OrganizationMembershipType", &g.OrganizationMembershipType) + case "name": + err = unpopulate(val, "Name", &g.Name) delete(rawMsg, key) - case "organizationName": - err = unpopulate(val, "OrganizationName", &g.OrganizationName) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) delete(rawMsg, key) - case "serviceAccountEmailAddress": - err = unpopulate(val, "ServiceAccountEmailAddress", &g.ServiceAccountEmailAddress) + case "systemData": + err = unpopulate(val, "SystemData", &g.SystemData) delete(rawMsg, key) - case "workloadIdentityProviderId": - err = unpopulate(val, "WorkloadIdentityProviderID", &g.WorkloadIdentityProviderID) + case "type": + err = unpopulate(val, "Type", &g.Type) delete(rawMsg, key) } if err != nil { @@ -8295,18 +10197,16 @@ func (g *GcpOrganizationalDataOrganization) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type GcpProjectDetails. -func (g GcpProjectDetails) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GitLabGroupConfiguration. +func (g GitLabGroupConfiguration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "projectId", g.ProjectID) - populate(objectMap, "projectName", g.ProjectName) - populate(objectMap, "projectNumber", g.ProjectNumber) - populate(objectMap, "workloadIdentityPoolId", g.WorkloadIdentityPoolID) + populate(objectMap, "autoDiscovery", g.AutoDiscovery) + populate(objectMap, "projectConfigs", g.ProjectConfigs) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GcpProjectDetails. -func (g *GcpProjectDetails) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GitLabGroupConfiguration. +func (g *GitLabGroupConfiguration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) @@ -8314,17 +10214,11 @@ func (g *GcpProjectDetails) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "projectId": - err = unpopulate(val, "ProjectID", &g.ProjectID) - delete(rawMsg, key) - case "projectName": - err = unpopulate(val, "ProjectName", &g.ProjectName) + case "autoDiscovery": + err = unpopulate(val, "AutoDiscovery", &g.AutoDiscovery) delete(rawMsg, key) - case "projectNumber": - err = unpopulate(val, "ProjectNumber", &g.ProjectNumber) - delete(rawMsg, key) - case "workloadIdentityPoolId": - err = unpopulate(val, "WorkloadIdentityPoolID", &g.WorkloadIdentityPoolID) + case "projectConfigs": + err = unpopulate(val, "ProjectConfigs", &g.ProjectConfigs) delete(rawMsg, key) } if err != nil { @@ -8334,17 +10228,16 @@ func (g *GcpProjectDetails) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type GcpProjectEnvironmentData. -func (g GcpProjectEnvironmentData) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GitLabGroupListResponse. +func (g GitLabGroupListResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - objectMap["environmentType"] = EnvironmentTypeGcpProject - populate(objectMap, "organizationalData", g.OrganizationalData) - populate(objectMap, "projectDetails", g.ProjectDetails) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GcpProjectEnvironmentData. -func (g *GcpProjectEnvironmentData) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GitLabGroupListResponse. +func (g *GitLabGroupListResponse) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) @@ -8352,14 +10245,11 @@ func (g *GcpProjectEnvironmentData) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "environmentType": - err = unpopulate(val, "EnvironmentType", &g.EnvironmentType) - delete(rawMsg, key) - case "organizationalData": - g.OrganizationalData, err = unmarshalGcpOrganizationalDataClassification(val) + case "nextLink": + err = unpopulate(val, "NextLink", &g.NextLink) delete(rawMsg, key) - case "projectDetails": - err = unpopulate(val, "ProjectDetails", &g.ProjectDetails) + case "value": + err = unpopulate(val, "Value", &g.Value) delete(rawMsg, key) } if err != nil { @@ -8369,15 +10259,21 @@ func (g *GcpProjectEnvironmentData) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type GetSensitivitySettingsListResponse. -func (g GetSensitivitySettingsListResponse) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GitLabGroupProperties. +func (g GitLabGroupProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "value", g.Value) + populate(objectMap, "fullyQualifiedFriendlyName", g.FullyQualifiedFriendlyName) + populate(objectMap, "fullyQualifiedName", g.FullyQualifiedName) + populate(objectMap, "onboardingState", g.OnboardingState) + populate(objectMap, "provisioningState", g.ProvisioningState) + populate(objectMap, "provisioningStatusMessage", g.ProvisioningStatusMessage) + populateTimeRFC3339(objectMap, "provisioningStatusUpdateTimeUtc", g.ProvisioningStatusUpdateTimeUTC) + populate(objectMap, "url", g.URL) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetSensitivitySettingsListResponse. -func (g *GetSensitivitySettingsListResponse) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GitLabGroupProperties. +func (g *GitLabGroupProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) @@ -8385,8 +10281,26 @@ func (g *GetSensitivitySettingsListResponse) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "value": - err = unpopulate(val, "Value", &g.Value) + case "fullyQualifiedFriendlyName": + err = unpopulate(val, "FullyQualifiedFriendlyName", &g.FullyQualifiedFriendlyName) + delete(rawMsg, key) + case "fullyQualifiedName": + err = unpopulate(val, "FullyQualifiedName", &g.FullyQualifiedName) + delete(rawMsg, key) + case "onboardingState": + err = unpopulate(val, "OnboardingState", &g.OnboardingState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) + delete(rawMsg, key) + case "provisioningStatusMessage": + err = unpopulate(val, "ProvisioningStatusMessage", &g.ProvisioningStatusMessage) + delete(rawMsg, key) + case "provisioningStatusUpdateTimeUtc": + err = unpopulateTimeRFC3339(val, "ProvisioningStatusUpdateTimeUTC", &g.ProvisioningStatusUpdateTimeUTC) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &g.URL) delete(rawMsg, key) } if err != nil { @@ -8396,18 +10310,19 @@ func (g *GetSensitivitySettingsListResponse) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type GetSensitivitySettingsResponse. -func (g GetSensitivitySettingsResponse) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GitLabProject. +func (g GitLabProject) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "id", g.ID) populate(objectMap, "name", g.Name) populate(objectMap, "properties", g.Properties) + populate(objectMap, "systemData", g.SystemData) populate(objectMap, "type", g.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetSensitivitySettingsResponse. -func (g *GetSensitivitySettingsResponse) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GitLabProject. +func (g *GitLabProject) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) @@ -8424,6 +10339,9 @@ func (g *GetSensitivitySettingsResponse) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &g.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &g.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &g.Type) delete(rawMsg, key) @@ -8435,18 +10353,16 @@ func (g *GetSensitivitySettingsResponse) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type GetSensitivitySettingsResponseProperties. -func (g GetSensitivitySettingsResponseProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GitLabProjectListResponse. +func (g GitLabProjectListResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "mipInformation", g.MipInformation) - populate(objectMap, "sensitiveInfoTypesIds", g.SensitiveInfoTypesIDs) - populate(objectMap, "sensitivityThresholdLabelId", g.SensitivityThresholdLabelID) - populate(objectMap, "sensitivityThresholdLabelOrder", g.SensitivityThresholdLabelOrder) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetSensitivitySettingsResponseProperties. -func (g *GetSensitivitySettingsResponseProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GitLabProjectListResponse. +func (g *GitLabProjectListResponse) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) @@ -8454,17 +10370,11 @@ func (g *GetSensitivitySettingsResponseProperties) UnmarshalJSON(data []byte) er for key, val := range rawMsg { var err error switch key { - case "mipInformation": - err = unpopulate(val, "MipInformation", &g.MipInformation) - delete(rawMsg, key) - case "sensitiveInfoTypesIds": - err = unpopulate(val, "SensitiveInfoTypesIDs", &g.SensitiveInfoTypesIDs) - delete(rawMsg, key) - case "sensitivityThresholdLabelId": - err = unpopulate(val, "SensitivityThresholdLabelID", &g.SensitivityThresholdLabelID) + case "nextLink": + err = unpopulate(val, "NextLink", &g.NextLink) delete(rawMsg, key) - case "sensitivityThresholdLabelOrder": - err = unpopulate(val, "SensitivityThresholdLabelOrder", &g.SensitivityThresholdLabelOrder) + case "value": + err = unpopulate(val, "Value", &g.Value) delete(rawMsg, key) } if err != nil { @@ -8474,18 +10384,22 @@ func (g *GetSensitivitySettingsResponseProperties) UnmarshalJSON(data []byte) er return nil } -// MarshalJSON implements the json.Marshaller interface for type GetSensitivitySettingsResponsePropertiesMipInformation. -func (g GetSensitivitySettingsResponsePropertiesMipInformation) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type GitLabProjectProperties. +func (g GitLabProjectProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "builtInInfoTypes", g.BuiltInInfoTypes) - populate(objectMap, "customInfoTypes", g.CustomInfoTypes) - populate(objectMap, "labels", g.Labels) - populate(objectMap, "mipIntegrationStatus", g.MipIntegrationStatus) + populate(objectMap, "fullyQualifiedFriendlyName", g.FullyQualifiedFriendlyName) + populate(objectMap, "fullyQualifiedName", g.FullyQualifiedName) + populate(objectMap, "fullyQualifiedParentGroupName", g.FullyQualifiedParentGroupName) + populate(objectMap, "onboardingState", g.OnboardingState) + populate(objectMap, "provisioningState", g.ProvisioningState) + populate(objectMap, "provisioningStatusMessage", g.ProvisioningStatusMessage) + populateTimeRFC3339(objectMap, "provisioningStatusUpdateTimeUtc", g.ProvisioningStatusUpdateTimeUTC) + populate(objectMap, "url", g.URL) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GetSensitivitySettingsResponsePropertiesMipInformation. -func (g *GetSensitivitySettingsResponsePropertiesMipInformation) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type GitLabProjectProperties. +func (g *GitLabProjectProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) @@ -8493,17 +10407,29 @@ func (g *GetSensitivitySettingsResponsePropertiesMipInformation) UnmarshalJSON(d for key, val := range rawMsg { var err error switch key { - case "builtInInfoTypes": - err = unpopulate(val, "BuiltInInfoTypes", &g.BuiltInInfoTypes) + case "fullyQualifiedFriendlyName": + err = unpopulate(val, "FullyQualifiedFriendlyName", &g.FullyQualifiedFriendlyName) delete(rawMsg, key) - case "customInfoTypes": - err = unpopulate(val, "CustomInfoTypes", &g.CustomInfoTypes) + case "fullyQualifiedName": + err = unpopulate(val, "FullyQualifiedName", &g.FullyQualifiedName) delete(rawMsg, key) - case "labels": - err = unpopulate(val, "Labels", &g.Labels) + case "fullyQualifiedParentGroupName": + err = unpopulate(val, "FullyQualifiedParentGroupName", &g.FullyQualifiedParentGroupName) delete(rawMsg, key) - case "mipIntegrationStatus": - err = unpopulate(val, "MipIntegrationStatus", &g.MipIntegrationStatus) + case "onboardingState": + err = unpopulate(val, "OnboardingState", &g.OnboardingState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &g.ProvisioningState) + delete(rawMsg, key) + case "provisioningStatusMessage": + err = unpopulate(val, "ProvisioningStatusMessage", &g.ProvisioningStatusMessage) + delete(rawMsg, key) + case "provisioningStatusUpdateTimeUtc": + err = unpopulateTimeRFC3339(val, "ProvisioningStatusUpdateTimeUTC", &g.ProvisioningStatusUpdateTimeUTC) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &g.URL) delete(rawMsg, key) } if err != nil { @@ -9235,9 +11161,11 @@ func (h *HealthReport) UnmarshalJSON(data []byte) error { func (h HealthReportProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "affectedDefendersPlans", h.AffectedDefendersPlans) + populate(objectMap, "affectedDefendersSubPlans", h.AffectedDefendersSubPlans) populate(objectMap, "environmentDetails", h.EnvironmentDetails) populate(objectMap, "healthDataClassification", h.HealthDataClassification) populate(objectMap, "issues", h.Issues) + populate(objectMap, "reportAdditionalData", h.ReportAdditionalData) populate(objectMap, "resourceDetails", h.ResourceDetails) populate(objectMap, "status", h.Status) return json.Marshal(objectMap) @@ -9255,6 +11183,9 @@ func (h *HealthReportProperties) UnmarshalJSON(data []byte) error { case "affectedDefendersPlans": err = unpopulate(val, "AffectedDefendersPlans", &h.AffectedDefendersPlans) delete(rawMsg, key) + case "affectedDefendersSubPlans": + err = unpopulate(val, "AffectedDefendersSubPlans", &h.AffectedDefendersSubPlans) + delete(rawMsg, key) case "environmentDetails": err = unpopulate(val, "EnvironmentDetails", &h.EnvironmentDetails) delete(rawMsg, key) @@ -9264,6 +11195,9 @@ func (h *HealthReportProperties) UnmarshalJSON(data []byte) error { case "issues": err = unpopulate(val, "Issues", &h.Issues) delete(rawMsg, key) + case "reportAdditionalData": + err = unpopulate(val, "ReportAdditionalData", &h.ReportAdditionalData) + delete(rawMsg, key) case "resourceDetails": err = unpopulate(val, "ResourceDetails", &h.ResourceDetails) delete(rawMsg, key) @@ -9687,134 +11621,6 @@ func (i *InformationType) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type IngestionConnectionString. -func (i IngestionConnectionString) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "location", i.Location) - populate(objectMap, "value", i.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IngestionConnectionString. -func (i *IngestionConnectionString) 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 "location": - err = unpopulate(val, "Location", &i.Location) - 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 IngestionSetting. -func (i IngestionSetting) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", i.ID) - populate(objectMap, "name", i.Name) - populateAny(objectMap, "properties", i.Properties) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IngestionSetting. -func (i *IngestionSetting) 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 "id": - err = unpopulate(val, "ID", &i.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &i.Name) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, "Properties", &i.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &i.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type IngestionSettingList. -func (i IngestionSettingList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IngestionSettingList. -func (i *IngestionSettingList) 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 "nextLink": - err = unpopulate(val, "NextLink", &i.NextLink) - 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 IngestionSettingToken. -func (i IngestionSettingToken) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "token", i.Token) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IngestionSettingToken. -func (i *IngestionSettingToken) 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 "token": - err = unpopulate(val, "Token", &i.Token) - 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) @@ -11251,6 +13057,41 @@ func (l *LogAnalyticsIdentifier) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type MalwareScanningProperties. +func (m MalwareScanningProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "onUpload", m.OnUpload) + populate(objectMap, "operationStatus", m.OperationStatus) + populate(objectMap, "scanResultsEventGridTopicResourceId", m.ScanResultsEventGridTopicResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MalwareScanningProperties. +func (m *MalwareScanningProperties) 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 "onUpload": + err = unpopulate(val, "OnUpload", &m.OnUpload) + delete(rawMsg, key) + case "operationStatus": + err = unpopulate(val, "OperationStatus", &m.OperationStatus) + delete(rawMsg, key) + case "scanResultsEventGridTopicResourceId": + err = unpopulate(val, "ScanResultsEventGridTopicResourceID", &m.ScanResultsEventGridTopicResourceID) + 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 MdeOnboardingData. func (m MdeOnboardingData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -11595,6 +13436,37 @@ func (o *OnPremiseSQLResourceDetails) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type OnUploadProperties. +func (o OnUploadProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "capGBPerMonth", o.CapGBPerMonth) + populate(objectMap, "isEnabled", o.IsEnabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OnUploadProperties. +func (o *OnUploadProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capGBPerMonth": + err = unpopulate(val, "CapGBPerMonth", &o.CapGBPerMonth) + delete(rawMsg, key) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &o.IsEnabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -11727,16 +13599,84 @@ func (o *OperationResultAutoGenerated) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type OperationStatus. -func (o OperationStatus) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type OperationStatus. +func (o OperationStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", o.Code) + populate(objectMap, "message", o.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatus. +func (o *OperationStatus) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &o.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &o.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationStatusAutoGenerated. +func (o OperationStatusAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", o.Code) + populate(objectMap, "message", o.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusAutoGenerated. +func (o *OperationStatusAutoGenerated) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &o.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &o.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationStatusResult. +func (o OperationStatusResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "code", o.Code) - populate(objectMap, "message", o.Message) + populateTimeRFC3339(objectMap, "endTime", o.EndTime) + populate(objectMap, "error", o.Error) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "operations", o.Operations) + populate(objectMap, "percentComplete", o.PercentComplete) + populateTimeRFC3339(objectMap, "startTime", o.StartTime) + populate(objectMap, "status", o.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatus. -func (o *OperationStatus) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusResult. +func (o *OperationStatusResult) 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) @@ -11744,11 +13684,29 @@ func (o *OperationStatus) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "code": - err = unpopulate(val, "Code", &o.Code) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &o.EndTime) delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &o.Message) + case "error": + err = unpopulate(val, "Error", &o.Error) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "operations": + err = unpopulate(val, "Operations", &o.Operations) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, "PercentComplete", &o.PercentComplete) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &o.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &o.Status) delete(rawMsg, key) } if err != nil { @@ -12086,6 +14044,41 @@ func (p *ProtectionMode) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) 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 "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + 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 ProxyServerProperties. func (p ProxyServerProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -12733,6 +14726,80 @@ func (r *Resource) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ResourceAutoGenerated. +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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAutoGenerated. +func (r *ResourceAutoGenerated) 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 "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceAutoGenerated2. +func (r ResourceAutoGenerated2) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAutoGenerated2. +func (r *ResourceAutoGenerated2) 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 "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + 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 ResourceDetails. func (r ResourceDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -13799,6 +15866,37 @@ func (s *SecureScoresList) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type SensitiveDataDiscoveryProperties. +func (s SensitiveDataDiscoveryProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "isEnabled", s.IsEnabled) + populate(objectMap, "operationStatus", s.OperationStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SensitiveDataDiscoveryProperties. +func (s *SensitiveDataDiscoveryProperties) 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 "isEnabled": + err = unpopulate(val, "IsEnabled", &s.IsEnabled) + delete(rawMsg, key) + case "operationStatus": + err = unpopulate(val, "OperationStatus", &s.OperationStatus) + 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 SensitivityLabel. func (s SensitivityLabel) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -13908,6 +16006,33 @@ func (s *ServerVulnerabilityAssessmentProperties) UnmarshalJSON(data []byte) err return nil } +// MarshalJSON implements the json.Marshaller interface for type ServerVulnerabilityAssessmentsAzureSettingProperties. +func (s ServerVulnerabilityAssessmentsAzureSettingProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "selectedProvider", s.SelectedProvider) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerVulnerabilityAssessmentsAzureSettingProperties. +func (s *ServerVulnerabilityAssessmentsAzureSettingProperties) 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 "selectedProvider": + err = unpopulate(val, "SelectedProvider", &s.SelectedProvider) + 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 ServerVulnerabilityAssessmentsList. func (s ServerVulnerabilityAssessmentsList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -13935,6 +16060,80 @@ func (s *ServerVulnerabilityAssessmentsList) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ServerVulnerabilityAssessmentsSetting. +func (s ServerVulnerabilityAssessmentsSetting) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + objectMap["kind"] = s.Kind + populate(objectMap, "name", s.Name) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerVulnerabilityAssessmentsSetting. +func (s *ServerVulnerabilityAssessmentsSetting) 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 "kind": + err = unpopulate(val, "Kind", &s.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + 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 ServerVulnerabilityAssessmentsSettingsList. +func (s ServerVulnerabilityAssessmentsSettingsList) 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 ServerVulnerabilityAssessmentsSettingsList. +func (s *ServerVulnerabilityAssessmentsSettingsList) 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": + s.Value, err = unmarshalServerVulnerabilityAssessmentsSettingClassificationArray(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 ServerVulnerabilityProperties. func (s ServerVulnerabilityProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -14459,6 +16658,8 @@ func (s StatusAutoGenerated) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "code", s.Code) populateTimeRFC3339(objectMap, "firstEvaluationDate", s.FirstEvaluationDate) + populateTimeRFC3339(objectMap, "lastScannedDate", s.LastScannedDate) + populate(objectMap, "reason", s.Reason) populateTimeRFC3339(objectMap, "statusChangeDate", s.StatusChangeDate) return json.Marshal(objectMap) } @@ -14478,6 +16679,12 @@ func (s *StatusAutoGenerated) UnmarshalJSON(data []byte) error { case "firstEvaluationDate": err = unpopulateTimeRFC3339(val, "FirstEvaluationDate", &s.FirstEvaluationDate) delete(rawMsg, key) + case "lastScannedDate": + err = unpopulateTimeRFC3339(val, "LastScannedDate", &s.LastScannedDate) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &s.Reason) + delete(rawMsg, key) case "statusChangeDate": err = unpopulateTimeRFC3339(val, "StatusChangeDate", &s.StatusChangeDate) delete(rawMsg, key) @@ -14789,6 +16996,37 @@ func (t *TagsResource) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type TargetBranchConfiguration. +func (t TargetBranchConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "annotateDefaultBranch", t.AnnotateDefaultBranch) + populate(objectMap, "branchNames", t.BranchNames) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TargetBranchConfiguration. +func (t *TargetBranchConfiguration) 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", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "annotateDefaultBranch": + err = unpopulate(val, "AnnotateDefaultBranch", &t.AnnotateDefaultBranch) + delete(rawMsg, key) + case "branchNames": + err = unpopulate(val, "BranchNames", &t.BranchNames) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Task. func (t Task) 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 e1a589d2c1d5..f0551ec95e49 100644 --- a/sdk/resourcemanager/security/armsecurity/operations_client.go +++ b/sdk/resourcemanager/security/armsecurity/operations_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity diff --git a/sdk/resourcemanager/security/armsecurity/operators_client.go b/sdk/resourcemanager/security/armsecurity/operators_client.go index 81c68fc2ce16..024920787a5a 100644 --- a/sdk/resourcemanager/security/armsecurity/operators_client.go +++ b/sdk/resourcemanager/security/armsecurity/operators_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -53,18 +52,21 @@ func NewOperatorsClient(subscriptionID string, credential azcore.TokenCredential // - options - OperatorsClientCreateOrUpdateOptions contains the optional parameters for the OperatorsClient.CreateOrUpdate // method. func (client *OperatorsClient) CreateOrUpdate(ctx context.Context, pricingName string, securityOperatorName string, options *OperatorsClientCreateOrUpdateOptions) (OperatorsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, pricingName, securityOperatorName, options) if err != nil { return OperatorsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return OperatorsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OperatorsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return OperatorsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -110,16 +112,18 @@ func (client *OperatorsClient) createOrUpdateHandleResponse(resp *http.Response) // - securityOperatorName - name of the securityOperator // - options - OperatorsClientDeleteOptions contains the optional parameters for the OperatorsClient.Delete method. func (client *OperatorsClient) Delete(ctx context.Context, pricingName string, securityOperatorName string, options *OperatorsClientDeleteOptions) (OperatorsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, pricingName, securityOperatorName, options) if err != nil { return OperatorsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return OperatorsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return OperatorsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return OperatorsClientDeleteResponse{}, err } return OperatorsClientDeleteResponse{}, nil } @@ -158,18 +162,21 @@ func (client *OperatorsClient) deleteCreateRequest(ctx context.Context, pricingN // - securityOperatorName - name of the securityOperator // - options - OperatorsClientGetOptions contains the optional parameters for the OperatorsClient.Get method. func (client *OperatorsClient) Get(ctx context.Context, pricingName string, securityOperatorName string, options *OperatorsClientGetOptions) (OperatorsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, pricingName, securityOperatorName, options) if err != nil { return OperatorsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return OperatorsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OperatorsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return OperatorsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -214,18 +221,21 @@ func (client *OperatorsClient) getHandleResponse(resp *http.Response) (Operators // - pricingName - name of the pricing configuration // - options - OperatorsClientListOptions contains the optional parameters for the OperatorsClient.List method. func (client *OperatorsClient) List(ctx context.Context, pricingName string, options *OperatorsClientListOptions) (OperatorsClientListResponse, error) { + var err error req, err := client.listCreateRequest(ctx, pricingName, options) if err != nil { return OperatorsClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return OperatorsClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OperatorsClientListResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return OperatorsClientListResponse{}, err } - return client.listHandleResponse(resp) + resp, err := client.listHandleResponse(httpResp) + return resp, err } // listCreateRequest creates the List request. 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 7368c2360eef..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 new file mode 100644 index 000000000000..134452d7f595 --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/options.go @@ -0,0 +1,1385 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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 + +// APICollectionsClientBeginOnboardAzureAPIManagementAPIOptions contains the optional parameters for the APICollectionsClient.BeginOnboardAzureAPIManagementAPI +// method. +type APICollectionsClientBeginOnboardAzureAPIManagementAPIOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// APICollectionsClientGetByAzureAPIManagementServiceOptions contains the optional parameters for the APICollectionsClient.GetByAzureAPIManagementService +// method. +type APICollectionsClientGetByAzureAPIManagementServiceOptions struct { + // placeholder for future optional parameters +} + +// APICollectionsClientListByAzureAPIManagementServiceOptions contains the optional parameters for the APICollectionsClient.NewListByAzureAPIManagementServicePager +// method. +type APICollectionsClientListByAzureAPIManagementServiceOptions struct { + // placeholder for future optional parameters +} + +// APICollectionsClientListByResourceGroupOptions contains the optional parameters for the APICollectionsClient.NewListByResourceGroupPager +// method. +type APICollectionsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// APICollectionsClientListBySubscriptionOptions contains the optional parameters for the APICollectionsClient.NewListBySubscriptionPager +// method. +type APICollectionsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// APICollectionsClientOffboardAzureAPIManagementAPIOptions contains the optional parameters for the APICollectionsClient.OffboardAzureAPIManagementAPI +// method. +type APICollectionsClientOffboardAzureAPIManagementAPIOptions struct { + // placeholder for future optional parameters +} + +// AccountConnectorsClientCreateOrUpdateOptions contains the optional parameters for the AccountConnectorsClient.CreateOrUpdate +// method. +type AccountConnectorsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// AccountConnectorsClientDeleteOptions contains the optional parameters for the AccountConnectorsClient.Delete method. +type AccountConnectorsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// AccountConnectorsClientGetOptions contains the optional parameters for the AccountConnectorsClient.Get method. +type AccountConnectorsClientGetOptions struct { + // placeholder for future optional parameters +} + +// AccountConnectorsClientListOptions contains the optional parameters for the AccountConnectorsClient.NewListPager method. +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 { + // placeholder for future optional parameters +} + +// AdvancedThreatProtectionClientGetOptions contains the optional parameters for the AdvancedThreatProtectionClient.Get method. +type AdvancedThreatProtectionClientGetOptions struct { + // placeholder for future optional parameters +} + +// AlertsClientBeginSimulateOptions contains the optional parameters for the AlertsClient.BeginSimulate method. +type AlertsClientBeginSimulateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// AlertsClientGetResourceGroupLevelOptions contains the optional parameters for the AlertsClient.GetResourceGroupLevel method. +type AlertsClientGetResourceGroupLevelOptions struct { + // placeholder for future optional parameters +} + +// AlertsClientGetSubscriptionLevelOptions contains the optional parameters for the AlertsClient.GetSubscriptionLevel method. +type AlertsClientGetSubscriptionLevelOptions struct { + // placeholder for future optional parameters +} + +// AlertsClientListByResourceGroupOptions contains the optional parameters for the AlertsClient.NewListByResourceGroupPager +// method. +type AlertsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// AlertsClientListOptions contains the optional parameters for the AlertsClient.NewListPager method. +type AlertsClientListOptions struct { + // placeholder for future optional parameters +} + +// AlertsClientListResourceGroupLevelByRegionOptions contains the optional parameters for the AlertsClient.NewListResourceGroupLevelByRegionPager +// method. +type AlertsClientListResourceGroupLevelByRegionOptions struct { + // placeholder for future optional parameters +} + +// AlertsClientListSubscriptionLevelByRegionOptions contains the optional parameters for the AlertsClient.NewListSubscriptionLevelByRegionPager +// method. +type AlertsClientListSubscriptionLevelByRegionOptions struct { + // placeholder for future optional parameters +} + +// AlertsClientUpdateResourceGroupLevelStateToActivateOptions contains the optional parameters for the AlertsClient.UpdateResourceGroupLevelStateToActivate +// method. +type AlertsClientUpdateResourceGroupLevelStateToActivateOptions struct { + // placeholder for future optional parameters +} + +// AlertsClientUpdateResourceGroupLevelStateToDismissOptions contains the optional parameters for the AlertsClient.UpdateResourceGroupLevelStateToDismiss +// method. +type AlertsClientUpdateResourceGroupLevelStateToDismissOptions struct { + // placeholder for future optional parameters +} + +// AlertsClientUpdateResourceGroupLevelStateToInProgressOptions contains the optional parameters for the AlertsClient.UpdateResourceGroupLevelStateToInProgress +// method. +type AlertsClientUpdateResourceGroupLevelStateToInProgressOptions struct { + // placeholder for future optional parameters +} + +// AlertsClientUpdateResourceGroupLevelStateToResolveOptions contains the optional parameters for the AlertsClient.UpdateResourceGroupLevelStateToResolve +// method. +type AlertsClientUpdateResourceGroupLevelStateToResolveOptions struct { + // placeholder for future optional parameters +} + +// AlertsClientUpdateSubscriptionLevelStateToActivateOptions contains the optional parameters for the AlertsClient.UpdateSubscriptionLevelStateToActivate +// method. +type AlertsClientUpdateSubscriptionLevelStateToActivateOptions struct { + // placeholder for future optional parameters +} + +// AlertsClientUpdateSubscriptionLevelStateToDismissOptions contains the optional parameters for the AlertsClient.UpdateSubscriptionLevelStateToDismiss +// method. +type AlertsClientUpdateSubscriptionLevelStateToDismissOptions struct { + // placeholder for future optional parameters +} + +// AlertsClientUpdateSubscriptionLevelStateToInProgressOptions contains the optional parameters for the AlertsClient.UpdateSubscriptionLevelStateToInProgress +// method. +type AlertsClientUpdateSubscriptionLevelStateToInProgressOptions struct { + // placeholder for future optional parameters +} + +// AlertsClientUpdateSubscriptionLevelStateToResolveOptions contains the optional parameters for the AlertsClient.UpdateSubscriptionLevelStateToResolve +// method. +type AlertsClientUpdateSubscriptionLevelStateToResolveOptions struct { + // placeholder for future optional parameters +} + +// AlertsSuppressionRulesClientDeleteOptions contains the optional parameters for the AlertsSuppressionRulesClient.Delete +// method. +type AlertsSuppressionRulesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// AlertsSuppressionRulesClientGetOptions contains the optional parameters for the AlertsSuppressionRulesClient.Get method. +type AlertsSuppressionRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// AlertsSuppressionRulesClientListOptions contains the optional parameters for the AlertsSuppressionRulesClient.NewListPager +// method. +type AlertsSuppressionRulesClientListOptions struct { + // Type of the alert to get rules for + AlertType *string +} + +// AlertsSuppressionRulesClientUpdateOptions contains the optional parameters for the AlertsSuppressionRulesClient.Update +// method. +type AlertsSuppressionRulesClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// AllowedConnectionsClientGetOptions contains the optional parameters for the AllowedConnectionsClient.Get method. +type AllowedConnectionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// AllowedConnectionsClientListByHomeRegionOptions contains the optional parameters for the AllowedConnectionsClient.NewListByHomeRegionPager +// method. +type AllowedConnectionsClientListByHomeRegionOptions struct { + // placeholder for future optional parameters +} + +// AllowedConnectionsClientListOptions contains the optional parameters for the AllowedConnectionsClient.NewListPager method. +type AllowedConnectionsClientListOptions struct { + // placeholder for future optional parameters +} + +// ApplicationClientCreateOrUpdateOptions contains the optional parameters for the ApplicationClient.CreateOrUpdate method. +type ApplicationClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ApplicationClientDeleteOptions contains the optional parameters for the ApplicationClient.Delete method. +type ApplicationClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ApplicationClientGetOptions contains the optional parameters for the ApplicationClient.Get method. +type ApplicationClientGetOptions struct { + // placeholder for future optional parameters +} + +// ApplicationsClientListOptions contains the optional parameters for the ApplicationsClient.NewListPager method. +type ApplicationsClientListOptions struct { + // placeholder for future optional parameters +} + +// AssessmentsClientCreateOrUpdateOptions contains the optional parameters for the AssessmentsClient.CreateOrUpdate method. +type AssessmentsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// AssessmentsClientDeleteOptions contains the optional parameters for the AssessmentsClient.Delete method. +type AssessmentsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// AssessmentsClientGetOptions contains the optional parameters for the AssessmentsClient.Get method. +type AssessmentsClientGetOptions struct { + // OData expand. Optional. + Expand *ExpandEnum +} + +// AssessmentsClientListOptions contains the optional parameters for the AssessmentsClient.NewListPager method. +type AssessmentsClientListOptions struct { + // placeholder for future optional parameters +} + +// AssessmentsMetadataClientCreateInSubscriptionOptions contains the optional parameters for the AssessmentsMetadataClient.CreateInSubscription +// method. +type AssessmentsMetadataClientCreateInSubscriptionOptions struct { + // placeholder for future optional parameters +} + +// AssessmentsMetadataClientDeleteInSubscriptionOptions contains the optional parameters for the AssessmentsMetadataClient.DeleteInSubscription +// method. +type AssessmentsMetadataClientDeleteInSubscriptionOptions struct { + // placeholder for future optional parameters +} + +// AssessmentsMetadataClientGetInSubscriptionOptions contains the optional parameters for the AssessmentsMetadataClient.GetInSubscription +// method. +type AssessmentsMetadataClientGetInSubscriptionOptions struct { + // placeholder for future optional parameters +} + +// AssessmentsMetadataClientGetOptions contains the optional parameters for the AssessmentsMetadataClient.Get method. +type AssessmentsMetadataClientGetOptions struct { + // placeholder for future optional parameters +} + +// AssessmentsMetadataClientListBySubscriptionOptions contains the optional parameters for the AssessmentsMetadataClient.NewListBySubscriptionPager +// method. +type AssessmentsMetadataClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// AssessmentsMetadataClientListOptions contains the optional parameters for the AssessmentsMetadataClient.NewListPager method. +type AssessmentsMetadataClientListOptions struct { + // placeholder for future optional parameters +} + +// AutoProvisioningSettingsClientCreateOptions contains the optional parameters for the AutoProvisioningSettingsClient.Create +// method. +type AutoProvisioningSettingsClientCreateOptions struct { + // placeholder for future optional parameters +} + +// AutoProvisioningSettingsClientGetOptions contains the optional parameters for the AutoProvisioningSettingsClient.Get method. +type AutoProvisioningSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// AutoProvisioningSettingsClientListOptions contains the optional parameters for the AutoProvisioningSettingsClient.NewListPager +// method. +type AutoProvisioningSettingsClientListOptions struct { + // placeholder for future optional parameters +} + +// AutomationsClientCreateOrUpdateOptions contains the optional parameters for the AutomationsClient.CreateOrUpdate method. +type AutomationsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// AutomationsClientDeleteOptions contains the optional parameters for the AutomationsClient.Delete method. +type AutomationsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// AutomationsClientGetOptions contains the optional parameters for the AutomationsClient.Get method. +type AutomationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// AutomationsClientListByResourceGroupOptions contains the optional parameters for the AutomationsClient.NewListByResourceGroupPager +// method. +type AutomationsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// AutomationsClientListOptions contains the optional parameters for the AutomationsClient.NewListPager method. +type AutomationsClientListOptions struct { + // placeholder for future optional parameters +} + +// AutomationsClientValidateOptions contains the optional parameters for the AutomationsClient.Validate method. +type AutomationsClientValidateOptions struct { + // placeholder for future optional parameters +} + +// AzureDevOpsOrgsClientBeginCreateOrUpdateOptions contains the optional parameters for the AzureDevOpsOrgsClient.BeginCreateOrUpdate +// method. +type AzureDevOpsOrgsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO 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. + ResumeToken string +} + +// AzureDevOpsOrgsClientGetOptions contains the optional parameters for the AzureDevOpsOrgsClient.Get method. +type AzureDevOpsOrgsClientGetOptions struct { + // placeholder for future optional parameters +} + +// AzureDevOpsOrgsClientListAvailableOptions contains the optional parameters for the AzureDevOpsOrgsClient.ListAvailable +// method. +type AzureDevOpsOrgsClientListAvailableOptions struct { + // placeholder for future optional parameters +} + +// AzureDevOpsOrgsClientListOptions contains the optional parameters for the AzureDevOpsOrgsClient.NewListPager method. +type AzureDevOpsOrgsClientListOptions struct { + // placeholder for future optional parameters +} + +// AzureDevOpsProjectsClientBeginCreateOrUpdateOptions contains the optional parameters for the AzureDevOpsProjectsClient.BeginCreateOrUpdate +// method. +type AzureDevOpsProjectsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO 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. + ResumeToken string +} + +// AzureDevOpsProjectsClientGetOptions contains the optional parameters for the AzureDevOpsProjectsClient.Get method. +type AzureDevOpsProjectsClientGetOptions struct { + // placeholder for future optional parameters +} + +// AzureDevOpsProjectsClientListOptions contains the optional parameters for the AzureDevOpsProjectsClient.NewListPager method. +type AzureDevOpsProjectsClientListOptions struct { + // placeholder for future optional parameters +} + +// AzureDevOpsReposClientBeginCreateOrUpdateOptions contains the optional parameters for the AzureDevOpsReposClient.BeginCreateOrUpdate +// method. +type AzureDevOpsReposClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO 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. + ResumeToken string +} + +// AzureDevOpsReposClientGetOptions contains the optional parameters for the AzureDevOpsReposClient.Get method. +type AzureDevOpsReposClientGetOptions struct { + // placeholder for future optional parameters +} + +// AzureDevOpsReposClientListOptions contains the optional parameters for the AzureDevOpsReposClient.NewListPager method. +type AzureDevOpsReposClientListOptions struct { + // placeholder for future optional parameters +} + +// CenterClientGetSensitivitySettingsOptions contains the optional parameters for the CenterClient.GetSensitivitySettings +// method. +type CenterClientGetSensitivitySettingsOptions struct { + // placeholder for future optional parameters +} + +// CenterClientUpdateSensitivitySettingsOptions contains the optional parameters for the CenterClient.UpdateSensitivitySettings +// method. +type CenterClientUpdateSensitivitySettingsOptions struct { + // placeholder for future optional parameters +} + +// ComplianceResultsClientGetOptions contains the optional parameters for the ComplianceResultsClient.Get method. +type ComplianceResultsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ComplianceResultsClientListOptions contains the optional parameters for the ComplianceResultsClient.NewListPager method. +type ComplianceResultsClientListOptions struct { + // placeholder for future optional parameters +} + +// CompliancesClientGetOptions contains the optional parameters for the CompliancesClient.Get method. +type CompliancesClientGetOptions struct { + // placeholder for future optional parameters +} + +// CompliancesClientListOptions contains the optional parameters for the CompliancesClient.NewListPager method. +type CompliancesClientListOptions struct { + // placeholder for future optional parameters +} + +// ConnectorApplicationClientCreateOrUpdateOptions contains the optional parameters for the ConnectorApplicationClient.CreateOrUpdate +// method. +type ConnectorApplicationClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ConnectorApplicationClientDeleteOptions contains the optional parameters for the ConnectorApplicationClient.Delete method. +type ConnectorApplicationClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ConnectorApplicationClientGetOptions contains the optional parameters for the ConnectorApplicationClient.Get method. +type ConnectorApplicationClientGetOptions struct { + // placeholder for future optional parameters +} + +// ConnectorApplicationsClientListOptions contains the optional parameters for the ConnectorApplicationsClient.NewListPager +// method. +type ConnectorApplicationsClientListOptions struct { + // placeholder for future optional parameters +} + +// ConnectorsClientCreateOrUpdateOptions contains the optional parameters for the ConnectorsClient.CreateOrUpdate method. +type ConnectorsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ConnectorsClientDeleteOptions contains the optional parameters for the ConnectorsClient.Delete method. +type ConnectorsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ConnectorsClientGetOptions contains the optional parameters for the ConnectorsClient.Get method. +type ConnectorsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ConnectorsClientListByResourceGroupOptions contains the optional parameters for the ConnectorsClient.NewListByResourceGroupPager +// method. +type ConnectorsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ConnectorsClientListOptions contains the optional parameters for the ConnectorsClient.NewListPager method. +type ConnectorsClientListOptions struct { + // placeholder for future optional parameters +} + +// ConnectorsClientUpdateOptions contains the optional parameters for the ConnectorsClient.Update method. +type ConnectorsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// ContactsClientCreateOptions contains the optional parameters for the ContactsClient.Create method. +type ContactsClientCreateOptions struct { + // placeholder for future optional parameters +} + +// ContactsClientDeleteOptions contains the optional parameters for the ContactsClient.Delete method. +type ContactsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ContactsClientGetOptions contains the optional parameters for the ContactsClient.Get method. +type ContactsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ContactsClientListOptions contains the optional parameters for the ContactsClient.NewListPager method. +type ContactsClientListOptions struct { + // placeholder for future optional parameters +} + +// CustomAssessmentAutomationsClientCreateOptions contains the optional parameters for the CustomAssessmentAutomationsClient.Create +// method. +type CustomAssessmentAutomationsClientCreateOptions struct { + // placeholder for future optional parameters +} + +// CustomAssessmentAutomationsClientDeleteOptions contains the optional parameters for the CustomAssessmentAutomationsClient.Delete +// method. +type CustomAssessmentAutomationsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// CustomAssessmentAutomationsClientGetOptions contains the optional parameters for the CustomAssessmentAutomationsClient.Get +// method. +type CustomAssessmentAutomationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// CustomAssessmentAutomationsClientListByResourceGroupOptions contains the optional parameters for the CustomAssessmentAutomationsClient.NewListByResourceGroupPager +// method. +type CustomAssessmentAutomationsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// CustomAssessmentAutomationsClientListBySubscriptionOptions contains the optional parameters for the CustomAssessmentAutomationsClient.NewListBySubscriptionPager +// method. +type CustomAssessmentAutomationsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// CustomEntityStoreAssignmentsClientCreateOptions contains the optional parameters for the CustomEntityStoreAssignmentsClient.Create +// method. +type CustomEntityStoreAssignmentsClientCreateOptions struct { + // placeholder for future optional parameters +} + +// CustomEntityStoreAssignmentsClientDeleteOptions contains the optional parameters for the CustomEntityStoreAssignmentsClient.Delete +// method. +type CustomEntityStoreAssignmentsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// CustomEntityStoreAssignmentsClientGetOptions contains the optional parameters for the CustomEntityStoreAssignmentsClient.Get +// method. +type CustomEntityStoreAssignmentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// CustomEntityStoreAssignmentsClientListByResourceGroupOptions contains the optional parameters for the CustomEntityStoreAssignmentsClient.NewListByResourceGroupPager +// method. +type CustomEntityStoreAssignmentsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// CustomEntityStoreAssignmentsClientListBySubscriptionOptions contains the optional parameters for the CustomEntityStoreAssignmentsClient.NewListBySubscriptionPager +// method. +type CustomEntityStoreAssignmentsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// DefenderForStorageClientCreateOptions contains the optional parameters for the DefenderForStorageClient.Create method. +type DefenderForStorageClientCreateOptions struct { + // placeholder for future optional parameters +} + +// DefenderForStorageClientGetOptions contains the optional parameters for the DefenderForStorageClient.Get method. +type DefenderForStorageClientGetOptions 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. + ResumeToken string +} + +// DevOpsConfigurationsClientBeginDeleteOptions contains the optional parameters for the DevOpsConfigurationsClient.BeginDelete +// method. +type DevOpsConfigurationsClientBeginDeleteOptions struct { + // Resumes the LRO 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. + ResumeToken string +} + +// DevOpsConfigurationsClientGetOptions contains the optional parameters for the DevOpsConfigurationsClient.Get method. +type DevOpsConfigurationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DevOpsConfigurationsClientListOptions contains the optional parameters for the DevOpsConfigurationsClient.NewListPager +// method. +type DevOpsConfigurationsClientListOptions struct { + // placeholder for future optional parameters +} + +// DevOpsOperationResultsClientGetOptions contains the optional parameters for the DevOpsOperationResultsClient.Get method. +type DevOpsOperationResultsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DeviceSecurityGroupsClientCreateOrUpdateOptions contains the optional parameters for the DeviceSecurityGroupsClient.CreateOrUpdate +// method. +type DeviceSecurityGroupsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// DeviceSecurityGroupsClientDeleteOptions contains the optional parameters for the DeviceSecurityGroupsClient.Delete method. +type DeviceSecurityGroupsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// DeviceSecurityGroupsClientGetOptions contains the optional parameters for the DeviceSecurityGroupsClient.Get method. +type DeviceSecurityGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DeviceSecurityGroupsClientListOptions contains the optional parameters for the DeviceSecurityGroupsClient.NewListPager +// method. +type DeviceSecurityGroupsClientListOptions struct { + // placeholder for future optional parameters +} + +// DiscoveredSecuritySolutionsClientGetOptions contains the optional parameters for the DiscoveredSecuritySolutionsClient.Get +// method. +type DiscoveredSecuritySolutionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DiscoveredSecuritySolutionsClientListByHomeRegionOptions contains the optional parameters for the DiscoveredSecuritySolutionsClient.NewListByHomeRegionPager +// method. +type DiscoveredSecuritySolutionsClientListByHomeRegionOptions struct { + // placeholder for future optional parameters +} + +// DiscoveredSecuritySolutionsClientListOptions contains the optional parameters for the DiscoveredSecuritySolutionsClient.NewListPager +// method. +type DiscoveredSecuritySolutionsClientListOptions struct { + // placeholder for future optional parameters +} + +// ExternalSecuritySolutionsClientGetOptions contains the optional parameters for the ExternalSecuritySolutionsClient.Get +// method. +type ExternalSecuritySolutionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ExternalSecuritySolutionsClientListByHomeRegionOptions contains the optional parameters for the ExternalSecuritySolutionsClient.NewListByHomeRegionPager +// method. +type ExternalSecuritySolutionsClientListByHomeRegionOptions struct { + // placeholder for future optional parameters +} + +// ExternalSecuritySolutionsClientListOptions contains the optional parameters for the ExternalSecuritySolutionsClient.NewListPager +// method. +type ExternalSecuritySolutionsClientListOptions struct { + // placeholder for future optional parameters +} + +// GitHubOwnersClientGetOptions contains the optional parameters for the GitHubOwnersClient.Get method. +type GitHubOwnersClientGetOptions struct { + // placeholder for future optional parameters +} + +// GitHubOwnersClientListAvailableOptions contains the optional parameters for the GitHubOwnersClient.ListAvailable method. +type GitHubOwnersClientListAvailableOptions struct { + // placeholder for future optional parameters +} + +// GitHubOwnersClientListOptions contains the optional parameters for the GitHubOwnersClient.NewListPager method. +type GitHubOwnersClientListOptions struct { + // placeholder for future optional parameters +} + +// GitHubReposClientGetOptions contains the optional parameters for the GitHubReposClient.Get method. +type GitHubReposClientGetOptions struct { + // placeholder for future optional parameters +} + +// GitHubReposClientListOptions contains the optional parameters for the GitHubReposClient.NewListPager method. +type GitHubReposClientListOptions struct { + // placeholder for future optional parameters +} + +// GitLabGroupsClientGetOptions contains the optional parameters for the GitLabGroupsClient.Get method. +type GitLabGroupsClientGetOptions struct { + // placeholder for future optional parameters +} + +// GitLabGroupsClientListAvailableOptions contains the optional parameters for the GitLabGroupsClient.ListAvailable method. +type GitLabGroupsClientListAvailableOptions struct { + // placeholder for future optional parameters +} + +// GitLabGroupsClientListOptions contains the optional parameters for the GitLabGroupsClient.NewListPager method. +type GitLabGroupsClientListOptions struct { + // placeholder for future optional parameters +} + +// GitLabProjectsClientGetOptions contains the optional parameters for the GitLabProjectsClient.Get method. +type GitLabProjectsClientGetOptions struct { + // placeholder for future optional parameters +} + +// GitLabProjectsClientListOptions contains the optional parameters for the GitLabProjectsClient.NewListPager method. +type GitLabProjectsClientListOptions struct { + // placeholder for future optional parameters +} + +// GitLabSubgroupsClientListOptions contains the optional parameters for the GitLabSubgroupsClient.List method. +type GitLabSubgroupsClientListOptions struct { + // placeholder for future optional parameters +} + +// GovernanceAssignmentsClientCreateOrUpdateOptions contains the optional parameters for the GovernanceAssignmentsClient.CreateOrUpdate +// method. +type GovernanceAssignmentsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// GovernanceAssignmentsClientDeleteOptions contains the optional parameters for the GovernanceAssignmentsClient.Delete method. +type GovernanceAssignmentsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// GovernanceAssignmentsClientGetOptions contains the optional parameters for the GovernanceAssignmentsClient.Get method. +type GovernanceAssignmentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// GovernanceAssignmentsClientListOptions contains the optional parameters for the GovernanceAssignmentsClient.NewListPager +// method. +type GovernanceAssignmentsClientListOptions struct { + // placeholder for future optional parameters +} + +// GovernanceRulesClientBeginDeleteOptions contains the optional parameters for the GovernanceRulesClient.BeginDelete method. +type GovernanceRulesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GovernanceRulesClientBeginExecuteOptions contains the optional parameters for the GovernanceRulesClient.BeginExecute method. +type GovernanceRulesClientBeginExecuteOptions struct { + // Execute governance rule over a given scope + ExecuteGovernanceRuleParams *ExecuteGovernanceRuleParams + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GovernanceRulesClientCreateOrUpdateOptions contains the optional parameters for the GovernanceRulesClient.CreateOrUpdate +// method. +type GovernanceRulesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// GovernanceRulesClientGetOptions contains the optional parameters for the GovernanceRulesClient.Get method. +type GovernanceRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// GovernanceRulesClientListOptions contains the optional parameters for the GovernanceRulesClient.NewListPager method. +type GovernanceRulesClientListOptions struct { + // placeholder for future optional parameters +} + +// GovernanceRulesClientOperationResultsOptions contains the optional parameters for the GovernanceRulesClient.OperationResults +// method. +type GovernanceRulesClientOperationResultsOptions struct { + // placeholder for future optional parameters +} + +// HealthReportsClientGetOptions contains the optional parameters for the HealthReportsClient.Get method. +type HealthReportsClientGetOptions struct { + // placeholder for future optional parameters +} + +// HealthReportsClientListOptions contains the optional parameters for the HealthReportsClient.NewListPager method. +type HealthReportsClientListOptions struct { + // placeholder for future optional parameters +} + +// InformationProtectionPoliciesClientCreateOrUpdateOptions contains the optional parameters for the InformationProtectionPoliciesClient.CreateOrUpdate +// method. +type InformationProtectionPoliciesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// InformationProtectionPoliciesClientGetOptions contains the optional parameters for the InformationProtectionPoliciesClient.Get +// method. +type InformationProtectionPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// InformationProtectionPoliciesClientListOptions contains the optional parameters for the InformationProtectionPoliciesClient.NewListPager +// method. +type InformationProtectionPoliciesClientListOptions struct { + // placeholder for future optional parameters +} + +// IotSecuritySolutionAnalyticsClientGetOptions contains the optional parameters for the IotSecuritySolutionAnalyticsClient.Get +// method. +type IotSecuritySolutionAnalyticsClientGetOptions struct { + // placeholder for future optional parameters +} + +// IotSecuritySolutionAnalyticsClientListOptions contains the optional parameters for the IotSecuritySolutionAnalyticsClient.List +// method. +type IotSecuritySolutionAnalyticsClientListOptions struct { + // placeholder for future optional parameters +} + +// IotSecuritySolutionClientCreateOrUpdateOptions contains the optional parameters for the IotSecuritySolutionClient.CreateOrUpdate +// method. +type IotSecuritySolutionClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// IotSecuritySolutionClientDeleteOptions contains the optional parameters for the IotSecuritySolutionClient.Delete method. +type IotSecuritySolutionClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// IotSecuritySolutionClientGetOptions contains the optional parameters for the IotSecuritySolutionClient.Get method. +type IotSecuritySolutionClientGetOptions struct { + // placeholder for future optional parameters +} + +// IotSecuritySolutionClientListByResourceGroupOptions contains the optional parameters for the IotSecuritySolutionClient.NewListByResourceGroupPager +// method. +type IotSecuritySolutionClientListByResourceGroupOptions struct { + // Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. + Filter *string +} + +// IotSecuritySolutionClientListBySubscriptionOptions contains the optional parameters for the IotSecuritySolutionClient.NewListBySubscriptionPager +// method. +type IotSecuritySolutionClientListBySubscriptionOptions struct { + // Filter the IoT Security solution with OData syntax. Supports filtering by iotHubs. + Filter *string +} + +// IotSecuritySolutionClientUpdateOptions contains the optional parameters for the IotSecuritySolutionClient.Update method. +type IotSecuritySolutionClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// IotSecuritySolutionsAnalyticsAggregatedAlertClientDismissOptions contains the optional parameters for the IotSecuritySolutionsAnalyticsAggregatedAlertClient.Dismiss +// method. +type IotSecuritySolutionsAnalyticsAggregatedAlertClientDismissOptions struct { + // placeholder for future optional parameters +} + +// IotSecuritySolutionsAnalyticsAggregatedAlertClientGetOptions contains the optional parameters for the IotSecuritySolutionsAnalyticsAggregatedAlertClient.Get +// method. +type IotSecuritySolutionsAnalyticsAggregatedAlertClientGetOptions struct { + // placeholder for future optional parameters +} + +// IotSecuritySolutionsAnalyticsAggregatedAlertClientListOptions contains the optional parameters for the IotSecuritySolutionsAnalyticsAggregatedAlertClient.NewListPager +// method. +type IotSecuritySolutionsAnalyticsAggregatedAlertClientListOptions struct { + // Number of results to retrieve. + Top *int32 +} + +// IotSecuritySolutionsAnalyticsRecommendationClientGetOptions contains the optional parameters for the IotSecuritySolutionsAnalyticsRecommendationClient.Get +// method. +type IotSecuritySolutionsAnalyticsRecommendationClientGetOptions struct { + // placeholder for future optional parameters +} + +// IotSecuritySolutionsAnalyticsRecommendationClientListOptions contains the optional parameters for the IotSecuritySolutionsAnalyticsRecommendationClient.NewListPager +// method. +type IotSecuritySolutionsAnalyticsRecommendationClientListOptions struct { + // Number of results to retrieve. + Top *int32 +} + +// JitNetworkAccessPoliciesClientCreateOrUpdateOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.CreateOrUpdate +// method. +type JitNetworkAccessPoliciesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// JitNetworkAccessPoliciesClientDeleteOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.Delete +// method. +type JitNetworkAccessPoliciesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// JitNetworkAccessPoliciesClientGetOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.Get method. +type JitNetworkAccessPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// JitNetworkAccessPoliciesClientInitiateOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.Initiate +// method. +type JitNetworkAccessPoliciesClientInitiateOptions struct { + // placeholder for future optional parameters +} + +// JitNetworkAccessPoliciesClientListByRegionOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.NewListByRegionPager +// method. +type JitNetworkAccessPoliciesClientListByRegionOptions struct { + // placeholder for future optional parameters +} + +// JitNetworkAccessPoliciesClientListByResourceGroupAndRegionOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.NewListByResourceGroupAndRegionPager +// method. +type JitNetworkAccessPoliciesClientListByResourceGroupAndRegionOptions struct { + // placeholder for future optional parameters +} + +// JitNetworkAccessPoliciesClientListByResourceGroupOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.NewListByResourceGroupPager +// method. +type JitNetworkAccessPoliciesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// JitNetworkAccessPoliciesClientListOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.NewListPager +// method. +type JitNetworkAccessPoliciesClientListOptions struct { + // placeholder for future optional parameters +} + +// LocationsClientGetOptions contains the optional parameters for the LocationsClient.Get method. +type LocationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// LocationsClientListOptions contains the optional parameters for the LocationsClient.NewListPager method. +type LocationsClientListOptions struct { + // placeholder for future optional parameters +} + +// MdeOnboardingsClientGetOptions contains the optional parameters for the MdeOnboardingsClient.Get method. +type MdeOnboardingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// MdeOnboardingsClientListOptions contains the optional parameters for the MdeOnboardingsClient.List method. +type MdeOnboardingsClientListOptions struct { + // placeholder for future optional parameters +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// OperatorsClientCreateOrUpdateOptions contains the optional parameters for the OperatorsClient.CreateOrUpdate method. +type OperatorsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// OperatorsClientDeleteOptions contains the optional parameters for the OperatorsClient.Delete method. +type OperatorsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// OperatorsClientGetOptions contains the optional parameters for the OperatorsClient.Get method. +type OperatorsClientGetOptions struct { + // placeholder for future optional parameters +} + +// OperatorsClientListOptions contains the optional parameters for the OperatorsClient.List method. +type OperatorsClientListOptions struct { + // placeholder for future optional parameters +} + +// PricingsClientGetOptions contains the optional parameters for the PricingsClient.Get method. +type PricingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// PricingsClientListOptions contains the optional parameters for the PricingsClient.List method. +type PricingsClientListOptions struct { + // placeholder for future optional parameters +} + +// PricingsClientUpdateOptions contains the optional parameters for the PricingsClient.Update method. +type PricingsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// RegulatoryComplianceAssessmentsClientGetOptions contains the optional parameters for the RegulatoryComplianceAssessmentsClient.Get +// method. +type RegulatoryComplianceAssessmentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// RegulatoryComplianceAssessmentsClientListOptions contains the optional parameters for the RegulatoryComplianceAssessmentsClient.NewListPager +// method. +type RegulatoryComplianceAssessmentsClientListOptions struct { + // OData filter. Optional. + Filter *string +} + +// RegulatoryComplianceControlsClientGetOptions contains the optional parameters for the RegulatoryComplianceControlsClient.Get +// method. +type RegulatoryComplianceControlsClientGetOptions struct { + // placeholder for future optional parameters +} + +// RegulatoryComplianceControlsClientListOptions contains the optional parameters for the RegulatoryComplianceControlsClient.NewListPager +// method. +type RegulatoryComplianceControlsClientListOptions struct { + // OData filter. Optional. + Filter *string +} + +// RegulatoryComplianceStandardsClientGetOptions contains the optional parameters for the RegulatoryComplianceStandardsClient.Get +// method. +type RegulatoryComplianceStandardsClientGetOptions struct { + // placeholder for future optional parameters +} + +// RegulatoryComplianceStandardsClientListOptions contains the optional parameters for the RegulatoryComplianceStandardsClient.NewListPager +// method. +type RegulatoryComplianceStandardsClientListOptions struct { + // OData filter. Optional. + Filter *string +} + +// SQLVulnerabilityAssessmentBaselineRulesClientAddOptions contains the optional parameters for the SQLVulnerabilityAssessmentBaselineRulesClient.Add +// method. +type SQLVulnerabilityAssessmentBaselineRulesClientAddOptions struct { + // The baseline rules. + Body *RulesResultsInput +} + +// SQLVulnerabilityAssessmentBaselineRulesClientCreateOrUpdateOptions contains the optional parameters for the SQLVulnerabilityAssessmentBaselineRulesClient.CreateOrUpdate +// method. +type SQLVulnerabilityAssessmentBaselineRulesClientCreateOrUpdateOptions struct { + // The baseline results for this rule. + Body *RuleResultsInput +} + +// SQLVulnerabilityAssessmentBaselineRulesClientDeleteOptions contains the optional parameters for the SQLVulnerabilityAssessmentBaselineRulesClient.Delete +// method. +type SQLVulnerabilityAssessmentBaselineRulesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// SQLVulnerabilityAssessmentBaselineRulesClientGetOptions contains the optional parameters for the SQLVulnerabilityAssessmentBaselineRulesClient.Get +// method. +type SQLVulnerabilityAssessmentBaselineRulesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SQLVulnerabilityAssessmentBaselineRulesClientListOptions contains the optional parameters for the SQLVulnerabilityAssessmentBaselineRulesClient.List +// method. +type SQLVulnerabilityAssessmentBaselineRulesClientListOptions struct { + // placeholder for future optional parameters +} + +// SQLVulnerabilityAssessmentScanResultsClientGetOptions contains the optional parameters for the SQLVulnerabilityAssessmentScanResultsClient.Get +// method. +type SQLVulnerabilityAssessmentScanResultsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SQLVulnerabilityAssessmentScanResultsClientListOptions contains the optional parameters for the SQLVulnerabilityAssessmentScanResultsClient.List +// method. +type SQLVulnerabilityAssessmentScanResultsClientListOptions struct { + // placeholder for future optional parameters +} + +// SQLVulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the SQLVulnerabilityAssessmentScansClient.Get +// method. +type SQLVulnerabilityAssessmentScansClientGetOptions struct { + // placeholder for future optional parameters +} + +// SQLVulnerabilityAssessmentScansClientListOptions contains the optional parameters for the SQLVulnerabilityAssessmentScansClient.List +// method. +type SQLVulnerabilityAssessmentScansClientListOptions struct { + // placeholder for future optional parameters +} + +// SecureScoreControlDefinitionsClientListBySubscriptionOptions contains the optional parameters for the SecureScoreControlDefinitionsClient.NewListBySubscriptionPager +// method. +type SecureScoreControlDefinitionsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// SecureScoreControlDefinitionsClientListOptions contains the optional parameters for the SecureScoreControlDefinitionsClient.NewListPager +// method. +type SecureScoreControlDefinitionsClientListOptions struct { + // placeholder for future optional parameters +} + +// SecureScoreControlsClientListBySecureScoreOptions contains the optional parameters for the SecureScoreControlsClient.NewListBySecureScorePager +// method. +type SecureScoreControlsClientListBySecureScoreOptions struct { + // OData expand. Optional. + Expand *ExpandControlsEnum +} + +// SecureScoreControlsClientListOptions contains the optional parameters for the SecureScoreControlsClient.NewListPager method. +type SecureScoreControlsClientListOptions struct { + // OData expand. Optional. + Expand *ExpandControlsEnum +} + +// SecureScoresClientGetOptions contains the optional parameters for the SecureScoresClient.Get method. +type SecureScoresClientGetOptions struct { + // placeholder for future optional parameters +} + +// SecureScoresClientListOptions contains the optional parameters for the SecureScoresClient.NewListPager method. +type SecureScoresClientListOptions struct { + // placeholder for future optional parameters +} + +// SensitivitySettingsClientListOptions contains the optional parameters for the SensitivitySettingsClient.List method. +type SensitivitySettingsClientListOptions struct { + // placeholder for future optional parameters +} + +// ServerVulnerabilityAssessmentClientBeginDeleteOptions contains the optional parameters for the ServerVulnerabilityAssessmentClient.BeginDelete +// method. +type ServerVulnerabilityAssessmentClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ServerVulnerabilityAssessmentClientCreateOrUpdateOptions contains the optional parameters for the ServerVulnerabilityAssessmentClient.CreateOrUpdate +// method. +type ServerVulnerabilityAssessmentClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ServerVulnerabilityAssessmentClientGetOptions contains the optional parameters for the ServerVulnerabilityAssessmentClient.Get +// method. +type ServerVulnerabilityAssessmentClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServerVulnerabilityAssessmentClientListByExtendedResourceOptions contains the optional parameters for the ServerVulnerabilityAssessmentClient.ListByExtendedResource +// method. +type ServerVulnerabilityAssessmentClientListByExtendedResourceOptions struct { + // placeholder for future optional parameters +} + +// ServerVulnerabilityAssessmentsSettingsClientCreateOrUpdateOptions contains the optional parameters for the ServerVulnerabilityAssessmentsSettingsClient.CreateOrUpdate +// method. +type ServerVulnerabilityAssessmentsSettingsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ServerVulnerabilityAssessmentsSettingsClientDeleteOptions contains the optional parameters for the ServerVulnerabilityAssessmentsSettingsClient.Delete +// method. +type ServerVulnerabilityAssessmentsSettingsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ServerVulnerabilityAssessmentsSettingsClientGetOptions contains the optional parameters for the ServerVulnerabilityAssessmentsSettingsClient.Get +// method. +type ServerVulnerabilityAssessmentsSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ServerVulnerabilityAssessmentsSettingsClientListBySubscriptionOptions contains the optional parameters for the ServerVulnerabilityAssessmentsSettingsClient.NewListBySubscriptionPager +// method. +type ServerVulnerabilityAssessmentsSettingsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// SettingsClientGetOptions contains the optional parameters for the SettingsClient.Get method. +type SettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SettingsClientListOptions contains the optional parameters for the SettingsClient.NewListPager method. +type SettingsClientListOptions struct { + // placeholder for future optional parameters +} + +// SettingsClientUpdateOptions contains the optional parameters for the SettingsClient.Update method. +type SettingsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// SoftwareInventoriesClientGetOptions contains the optional parameters for the SoftwareInventoriesClient.Get method. +type SoftwareInventoriesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SoftwareInventoriesClientListByExtendedResourceOptions contains the optional parameters for the SoftwareInventoriesClient.NewListByExtendedResourcePager +// method. +type SoftwareInventoriesClientListByExtendedResourceOptions struct { + // placeholder for future optional parameters +} + +// SoftwareInventoriesClientListBySubscriptionOptions contains the optional parameters for the SoftwareInventoriesClient.NewListBySubscriptionPager +// method. +type SoftwareInventoriesClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// SolutionsClientGetOptions contains the optional parameters for the SolutionsClient.Get method. +type SolutionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SolutionsClientListOptions contains the optional parameters for the SolutionsClient.NewListPager method. +type SolutionsClientListOptions struct { + // placeholder for future optional parameters +} + +// SolutionsReferenceDataClientListByHomeRegionOptions contains the optional parameters for the SolutionsReferenceDataClient.ListByHomeRegion +// method. +type SolutionsReferenceDataClientListByHomeRegionOptions struct { + // placeholder for future optional parameters +} + +// SolutionsReferenceDataClientListOptions contains the optional parameters for the SolutionsReferenceDataClient.List method. +type SolutionsReferenceDataClientListOptions struct { + // placeholder for future optional parameters +} + +// SubAssessmentsClientGetOptions contains the optional parameters for the SubAssessmentsClient.Get method. +type SubAssessmentsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SubAssessmentsClientListAllOptions contains the optional parameters for the SubAssessmentsClient.NewListAllPager method. +type SubAssessmentsClientListAllOptions struct { + // placeholder for future optional parameters +} + +// SubAssessmentsClientListOptions contains the optional parameters for the SubAssessmentsClient.NewListPager method. +type SubAssessmentsClientListOptions struct { + // placeholder for future optional parameters +} + +// TasksClientGetResourceGroupLevelTaskOptions contains the optional parameters for the TasksClient.GetResourceGroupLevelTask +// method. +type TasksClientGetResourceGroupLevelTaskOptions struct { + // placeholder for future optional parameters +} + +// TasksClientGetSubscriptionLevelTaskOptions contains the optional parameters for the TasksClient.GetSubscriptionLevelTask +// method. +type TasksClientGetSubscriptionLevelTaskOptions struct { + // placeholder for future optional parameters +} + +// TasksClientListByHomeRegionOptions contains the optional parameters for the TasksClient.NewListByHomeRegionPager method. +type TasksClientListByHomeRegionOptions struct { + // OData filter. Optional. + Filter *string +} + +// TasksClientListByResourceGroupOptions contains the optional parameters for the TasksClient.NewListByResourceGroupPager +// method. +type TasksClientListByResourceGroupOptions struct { + // OData filter. Optional. + Filter *string +} + +// TasksClientListOptions contains the optional parameters for the TasksClient.NewListPager method. +type TasksClientListOptions struct { + // OData filter. Optional. + Filter *string +} + +// TasksClientUpdateResourceGroupLevelTaskStateOptions contains the optional parameters for the TasksClient.UpdateResourceGroupLevelTaskState +// method. +type TasksClientUpdateResourceGroupLevelTaskStateOptions struct { + // placeholder for future optional parameters +} + +// TasksClientUpdateSubscriptionLevelTaskStateOptions contains the optional parameters for the TasksClient.UpdateSubscriptionLevelTaskState +// method. +type TasksClientUpdateSubscriptionLevelTaskStateOptions struct { + // placeholder for future optional parameters +} + +// TopologyClientGetOptions contains the optional parameters for the TopologyClient.Get method. +type TopologyClientGetOptions struct { + // placeholder for future optional parameters +} + +// TopologyClientListByHomeRegionOptions contains the optional parameters for the TopologyClient.NewListByHomeRegionPager +// method. +type TopologyClientListByHomeRegionOptions struct { + // placeholder for future optional parameters +} + +// TopologyClientListOptions contains the optional parameters for the TopologyClient.NewListPager method. +type TopologyClientListOptions struct { + // placeholder for future optional parameters +} + +// WorkspaceSettingsClientCreateOptions contains the optional parameters for the WorkspaceSettingsClient.Create method. +type WorkspaceSettingsClientCreateOptions struct { + // placeholder for future optional parameters +} + +// WorkspaceSettingsClientDeleteOptions contains the optional parameters for the WorkspaceSettingsClient.Delete method. +type WorkspaceSettingsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// WorkspaceSettingsClientGetOptions contains the optional parameters for the WorkspaceSettingsClient.Get method. +type WorkspaceSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// WorkspaceSettingsClientListOptions contains the optional parameters for the WorkspaceSettingsClient.NewListPager method. +type WorkspaceSettingsClientListOptions struct { + // placeholder for future optional parameters +} + +// WorkspaceSettingsClientUpdateOptions contains the optional parameters for the WorkspaceSettingsClient.Update method. +type WorkspaceSettingsClientUpdateOptions 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 fd445fd35bcd..bf50f6f73ce6 100644 --- a/sdk/resourcemanager/security/armsecurity/polymorphic_helpers.go +++ b/sdk/resourcemanager/security/armsecurity/polymorphic_helpers.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -30,7 +29,10 @@ func unmarshalAdditionalDataClassification(rawMsg json.RawMessage) (AdditionalDa default: b = &AdditionalData{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalAlertSimulatorRequestPropertiesClassification(rawMsg json.RawMessage) (AlertSimulatorRequestPropertiesClassification, error) { @@ -48,7 +50,10 @@ func unmarshalAlertSimulatorRequestPropertiesClassification(rawMsg json.RawMessa default: b = &AlertSimulatorRequestProperties{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalAllowlistCustomAlertRuleClassification(rawMsg json.RawMessage) (AllowlistCustomAlertRuleClassification, error) { @@ -72,7 +77,10 @@ func unmarshalAllowlistCustomAlertRuleClassification(rawMsg json.RawMessage) (Al default: b = &AllowlistCustomAlertRule{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalAllowlistCustomAlertRuleClassificationArray(rawMsg json.RawMessage) ([]AllowlistCustomAlertRuleClassification, error) { @@ -113,7 +121,10 @@ func unmarshalAuthenticationDetailsPropertiesClassification(rawMsg json.RawMessa default: b = &AuthenticationDetailsProperties{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalAutomationActionClassification(rawMsg json.RawMessage) (AutomationActionClassification, error) { @@ -135,7 +146,10 @@ func unmarshalAutomationActionClassification(rawMsg json.RawMessage) (Automation default: b = &AutomationAction{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalAutomationActionClassificationArray(rawMsg json.RawMessage) ([]AutomationActionClassification, error) { @@ -174,7 +188,10 @@ func unmarshalAwsOrganizationalDataClassification(rawMsg json.RawMessage) (AwsOr default: b = &AwsOrganizationalData{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalCloudOfferingClassification(rawMsg json.RawMessage) (CloudOfferingClassification, error) { @@ -224,7 +241,10 @@ func unmarshalCloudOfferingClassification(rawMsg json.RawMessage) (CloudOffering default: b = &CloudOffering{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalCloudOfferingClassificationArray(rawMsg json.RawMessage) ([]CloudOfferingClassification, error) { @@ -269,7 +289,10 @@ func unmarshalEnvironmentDataClassification(rawMsg json.RawMessage) (Environment default: b = &EnvironmentData{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalGcpOrganizationalDataClassification(rawMsg json.RawMessage) (GcpOrganizationalDataClassification, error) { @@ -289,7 +312,10 @@ func unmarshalGcpOrganizationalDataClassification(rawMsg json.RawMessage) (GcpOr default: b = &GcpOrganizationalData{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalResourceDetailsClassification(rawMsg json.RawMessage) (ResourceDetailsClassification, error) { @@ -311,7 +337,10 @@ func unmarshalResourceDetailsClassification(rawMsg json.RawMessage) (ResourceDet default: b = &ResourceDetails{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalResourceIdentifierClassification(rawMsg json.RawMessage) (ResourceIdentifierClassification, error) { @@ -331,7 +360,10 @@ func unmarshalResourceIdentifierClassification(rawMsg json.RawMessage) (Resource default: b = &ResourceIdentifier{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalResourceIdentifierClassificationArray(rawMsg json.RawMessage) ([]ResourceIdentifierClassification, error) { @@ -353,6 +385,46 @@ func unmarshalResourceIdentifierClassificationArray(rawMsg json.RawMessage) ([]R return fArray, nil } +func unmarshalServerVulnerabilityAssessmentsSettingClassification(rawMsg json.RawMessage) (ServerVulnerabilityAssessmentsSettingClassification, error) { + if rawMsg == nil { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b ServerVulnerabilityAssessmentsSettingClassification + switch m["kind"] { + case string(ServerVulnerabilityAssessmentsSettingKindAzureServersSetting): + b = &AzureServersSetting{} + default: + b = &ServerVulnerabilityAssessmentsSetting{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} + +func unmarshalServerVulnerabilityAssessmentsSettingClassificationArray(rawMsg json.RawMessage) ([]ServerVulnerabilityAssessmentsSettingClassification, error) { + if rawMsg == nil { + return nil, nil + } + var rawMessages []json.RawMessage + if err := json.Unmarshal(rawMsg, &rawMessages); err != nil { + return nil, err + } + fArray := make([]ServerVulnerabilityAssessmentsSettingClassification, len(rawMessages)) + for index, rawMessage := range rawMessages { + f, err := unmarshalServerVulnerabilityAssessmentsSettingClassification(rawMessage) + if err != nil { + return nil, err + } + fArray[index] = f + } + return fArray, nil +} + func unmarshalSettingClassification(rawMsg json.RawMessage) (SettingClassification, error) { if rawMsg == nil { return nil, nil @@ -370,7 +442,10 @@ func unmarshalSettingClassification(rawMsg json.RawMessage) (SettingClassificati default: b = &Setting{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalSettingClassificationArray(rawMsg json.RawMessage) ([]SettingClassification, error) { @@ -439,7 +514,10 @@ func unmarshalThresholdCustomAlertRuleClassification(rawMsg json.RawMessage) (Th default: b = &ThresholdCustomAlertRule{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalThresholdCustomAlertRuleClassificationArray(rawMsg json.RawMessage) ([]ThresholdCustomAlertRuleClassification, error) { @@ -506,7 +584,10 @@ func unmarshalTimeWindowCustomAlertRuleClassification(rawMsg json.RawMessage) (T default: b = &TimeWindowCustomAlertRule{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalTimeWindowCustomAlertRuleClassificationArray(rawMsg json.RawMessage) ([]TimeWindowCustomAlertRuleClassification, error) { diff --git a/sdk/resourcemanager/security/armsecurity/pricings_client.go b/sdk/resourcemanager/security/armsecurity/pricings_client.go index 2c5bada66914..44e32e90b3e6 100644 --- a/sdk/resourcemanager/security/armsecurity/pricings_client.go +++ b/sdk/resourcemanager/security/armsecurity/pricings_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -51,18 +50,21 @@ func NewPricingsClient(subscriptionID string, credential azcore.TokenCredential, // - pricingName - name of the pricing configuration // - options - PricingsClientGetOptions contains the optional parameters for the PricingsClient.Get method. func (client *PricingsClient) Get(ctx context.Context, pricingName string, options *PricingsClientGetOptions) (PricingsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, pricingName, options) if err != nil { return PricingsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PricingsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PricingsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PricingsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -102,18 +104,21 @@ func (client *PricingsClient) getHandleResponse(resp *http.Response) (PricingsCl // Generated from API version 2023-01-01 // - options - PricingsClientListOptions contains the optional parameters for the PricingsClient.List method. func (client *PricingsClient) List(ctx context.Context, options *PricingsClientListOptions) (PricingsClientListResponse, error) { + var err error req, err := client.listCreateRequest(ctx, options) if err != nil { return PricingsClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PricingsClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PricingsClientListResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PricingsClientListResponse{}, err } - return client.listHandleResponse(resp) + resp, err := client.listHandleResponse(httpResp) + return resp, err } // listCreateRequest creates the List request. @@ -151,18 +156,21 @@ func (client *PricingsClient) listHandleResponse(resp *http.Response) (PricingsC // - pricing - Pricing object // - options - PricingsClientUpdateOptions contains the optional parameters for the PricingsClient.Update method. func (client *PricingsClient) Update(ctx context.Context, pricingName string, pricing Pricing, options *PricingsClientUpdateOptions) (PricingsClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, pricingName, pricing, options) if err != nil { return PricingsClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PricingsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PricingsClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PricingsClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -184,7 +192,10 @@ func (client *PricingsClient) updateCreateRequest(ctx context.Context, pricingNa reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, pricing) + if err := runtime.MarshalAsJSON(req, pricing); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. 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 d3828d3bc840..000000000000 --- a/sdk/resourcemanager/security/armsecurity/pricings_client_example_test.go +++ /dev/null @@ -1,540 +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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/ListPricings_example.json -func ExamplePricingsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPricingsClient().List(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PricingList = armsecurity.PricingList{ - // Value: []*armsecurity.Pricing{ - // { - // Name: to.Ptr("VirtualMachines"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/VirtualMachines"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.1921106Z"); return t}()), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // SubPlan: to.Ptr("P2"), - // Extensions: []*armsecurity.Extension{ - // { - // Name: to.Ptr("AgentlessVmScanning"), - // 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.1921106Z"); return t}()), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // }, - // }, - // { - // Name: to.Ptr("AppServices"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/AppServices"), - // Properties: &armsecurity.PricingProperties{ - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierFree), - // }, - // }, - // { - // Name: to.Ptr("StorageAccounts"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/pricings/StorageAccounts"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.1921106Z"); return t}()), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // 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), - // }}, - // }, - // }, - // { - // 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.1921106Z"); return t}()), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // }, - // }, - // { - // Name: to.Ptr("KubernetesService"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/KubernetesService"), - // Properties: &armsecurity.PricingProperties{ - // Deprecated: to.Ptr(true), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierFree), - // ReplacedBy: []*string{ - // to.Ptr("Containers")}, - // }, - // }, - // { - // Name: to.Ptr("ContainerRegistry"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/ContainerRegistry"), - // Properties: &armsecurity.PricingProperties{ - // Deprecated: to.Ptr(true), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierFree), - // ReplacedBy: []*string{ - // to.Ptr("Containers")}, - // }, - // }, - // { - // Name: to.Ptr("KeyVaults"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/KeyVaults"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.1921106Z"); return t}()), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // }, - // }, - // { - // Name: to.Ptr("Dns"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/Dns"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.1921106Z"); return t}()), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // }, - // }, - // { - // Name: to.Ptr("Arm"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/Arm"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.1921106Z"); return t}()), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // }, - // }, - // { - // Name: to.Ptr("OpenSourceRelationalDatabases"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/OpenSourceRelationalDatabases"), - // Properties: &armsecurity.PricingProperties{ - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierFree), - // }, - // }, - // { - // Name: to.Ptr("Containers"), - // Type: to.Ptr("Microsoft.Security/pricings"), - // ID: to.Ptr("/subscriptions/d34fd44c-ebfa-4a9c-bceb-9eeafe72ac15/providers/Microsoft.Security/pricings/Containers"), - // Properties: &armsecurity.PricingProperties{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.1921106Z"); return t}()), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // 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.1921106Z"); return t}()), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // Extensions: []*armsecurity.Extension{ - // { - // Name: to.Ptr("AgentlessVmScanning"), - // 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), - // }}, - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2023-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, "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.1921106Z"); return t}()), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // Extensions: []*armsecurity.Extension{ - // { - // Name: to.Ptr("AgentlessVmScanning"), - // 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), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2023-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, "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.1921106Z"); return t}()), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // 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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2023-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, "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{ - // EnablementTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T12:42:42.1921106Z"); return t}()), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2023-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, "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.1921106Z"); return t}()), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // 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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2023-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, "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.1921106Z"); return t}()), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // SubPlan: to.Ptr("P2"), - // Extensions: []*armsecurity.Extension{ - // { - // Name: to.Ptr("AgentlessVmScanning"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/PutPricingByName_example.json -func ExamplePricingsClient_Update_updatePricingOnSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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, "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.1921106Z"); return t}()), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // Extensions: []*armsecurity.Extension{ - // { - // Name: to.Ptr("AgentlessVmScanning"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // OperationStatus: &armsecurity.OperationStatus{ - // Code: to.Ptr(armsecurity.CodeSucceeded), - // Message: to.Ptr(""), - // }, - // }, - // { - // Name: to.Ptr("AgentlessDiscoveryForKubernetes"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // OperationStatus: &armsecurity.OperationStatus{ - // Code: to.Ptr(armsecurity.CodeSucceeded), - // Message: to.Ptr(""), - // }, - // }, - // { - // Name: to.Ptr("SensitiveDataDiscovery"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // OperationStatus: &armsecurity.OperationStatus{ - // Code: to.Ptr(armsecurity.CodeSucceeded), - // Message: to.Ptr(""), - // }, - // }, - // { - // Name: to.Ptr("ContainerRegistriesVulnerabilityAssessments"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // OperationStatus: &armsecurity.OperationStatus{ - // Code: to.Ptr(armsecurity.CodeSucceeded), - // Message: to.Ptr(""), - // }, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2023-01-01/examples/Pricings/PutPricingByNamePartialSuccess_example.json -func ExamplePricingsClient_Update_updatePricingOnSubscriptionPartialSuccess() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain 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, "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.1921106Z"); return t}()), - // FreeTrialRemainingTime: to.Ptr("PT0S"), - // PricingTier: to.Ptr(armsecurity.PricingTierStandard), - // Extensions: []*armsecurity.Extension{ - // { - // Name: to.Ptr("AgentlessVmScanning"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // OperationStatus: &armsecurity.OperationStatus{ - // Code: to.Ptr(armsecurity.CodeSucceeded), - // Message: to.Ptr(""), - // }, - // }, - // { - // Name: to.Ptr("AgentlessDiscoveryForKubernetes"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // OperationStatus: &armsecurity.OperationStatus{ - // Code: to.Ptr(armsecurity.CodeSucceeded), - // Message: to.Ptr(""), - // }, - // }, - // { - // Name: to.Ptr("SensitiveDataDiscovery"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // OperationStatus: &armsecurity.OperationStatus{ - // Code: to.Ptr(armsecurity.CodeSucceeded), - // Message: to.Ptr(""), - // }, - // }, - // { - // Name: to.Ptr("ContainerRegistriesVulnerabilityAssessments"), - // IsEnabled: to.Ptr(armsecurity.IsEnabledTrue), - // OperationStatus: &armsecurity.OperationStatus{ - // Code: to.Ptr(armsecurity.CodeFailed), - // Message: to.Ptr("Extension enablemment failed due to missing permissions."), - // }, - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/regulatorycomplianceassessments_client.go b/sdk/resourcemanager/security/armsecurity/regulatorycomplianceassessments_client.go index 54ffaececc20..c9f3c927d10b 100644 --- a/sdk/resourcemanager/security/armsecurity/regulatorycomplianceassessments_client.go +++ b/sdk/resourcemanager/security/armsecurity/regulatorycomplianceassessments_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -54,18 +53,21 @@ func NewRegulatoryComplianceAssessmentsClient(subscriptionID string, credential // - options - RegulatoryComplianceAssessmentsClientGetOptions contains the optional parameters for the RegulatoryComplianceAssessmentsClient.Get // method. func (client *RegulatoryComplianceAssessmentsClient) Get(ctx context.Context, regulatoryComplianceStandardName string, regulatoryComplianceControlName string, regulatoryComplianceAssessmentName string, options *RegulatoryComplianceAssessmentsClientGetOptions) (RegulatoryComplianceAssessmentsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, regulatoryComplianceStandardName, regulatoryComplianceControlName, regulatoryComplianceAssessmentName, options) if err != nil { return RegulatoryComplianceAssessmentsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RegulatoryComplianceAssessmentsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RegulatoryComplianceAssessmentsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RegulatoryComplianceAssessmentsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 8b1a52c924cf..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 3dd419d23a7f..cd130c995b40 100644 --- a/sdk/resourcemanager/security/armsecurity/regulatorycompliancecontrols_client.go +++ b/sdk/resourcemanager/security/armsecurity/regulatorycompliancecontrols_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -53,18 +52,21 @@ func NewRegulatoryComplianceControlsClient(subscriptionID string, credential azc // - options - RegulatoryComplianceControlsClientGetOptions contains the optional parameters for the RegulatoryComplianceControlsClient.Get // method. func (client *RegulatoryComplianceControlsClient) Get(ctx context.Context, regulatoryComplianceStandardName string, regulatoryComplianceControlName string, options *RegulatoryComplianceControlsClientGetOptions) (RegulatoryComplianceControlsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, regulatoryComplianceStandardName, regulatoryComplianceControlName, options) if err != nil { return RegulatoryComplianceControlsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RegulatoryComplianceControlsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RegulatoryComplianceControlsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RegulatoryComplianceControlsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 09d4b5034998..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 6e1ccfb68235..650fb1690362 100644 --- a/sdk/resourcemanager/security/armsecurity/regulatorycompliancestandards_client.go +++ b/sdk/resourcemanager/security/armsecurity/regulatorycompliancestandards_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -52,18 +51,21 @@ func NewRegulatoryComplianceStandardsClient(subscriptionID string, credential az // - options - RegulatoryComplianceStandardsClientGetOptions contains the optional parameters for the RegulatoryComplianceStandardsClient.Get // method. func (client *RegulatoryComplianceStandardsClient) Get(ctx context.Context, regulatoryComplianceStandardName string, options *RegulatoryComplianceStandardsClientGetOptions) (RegulatoryComplianceStandardsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, regulatoryComplianceStandardName, options) if err != nil { return RegulatoryComplianceStandardsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RegulatoryComplianceStandardsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RegulatoryComplianceStandardsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RegulatoryComplianceStandardsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 6838f2939bc1..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceStandard_example.json -func ExampleRegulatoryComplianceStandardsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRegulatoryComplianceStandardsClient().Get(ctx, "PCI-DSS-3.2", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RegulatoryComplianceStandard = armsecurity.RegulatoryComplianceStandard{ - // Name: to.Ptr("PCI-DSS-3.2"), - // Type: to.Ptr("Microsoft.Security/regulatoryComplianceStandard"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/regulatoryComplianceStandards/PCI-DSS-3.2"), - // Properties: &armsecurity.RegulatoryComplianceStandardProperties{ - // FailedControls: to.Ptr[int32](4), - // PassedControls: to.Ptr[int32](7), - // SkippedControls: to.Ptr[int32](0), - // State: to.Ptr(armsecurity.StateFailed), - // UnsupportedControls: to.Ptr[int32](0), - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/response_types.go b/sdk/resourcemanager/security/armsecurity/response_types.go index 678f639950fc..b025b8b4f88d 100644 --- a/sdk/resourcemanager/security/armsecurity/response_types.go +++ b/sdk/resourcemanager/security/armsecurity/response_types.go @@ -3,34 +3,49 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity -// APICollectionClientGetResponse contains the response from method APICollectionClient.Get. -type APICollectionClientGetResponse struct { - APICollectionResponse +// APICollectionsClientGetByAzureAPIManagementServiceResponse contains the response from method APICollectionsClient.GetByAzureAPIManagementService. +type APICollectionsClientGetByAzureAPIManagementServiceResponse struct { + // An API collection as represented by Microsoft Defender for APIs. + APICollection } -// APICollectionClientListResponse contains the response from method APICollectionClient.NewListPager. -type APICollectionClientListResponse struct { - APICollectionResponseList +// APICollectionsClientListByAzureAPIManagementServiceResponse contains the response from method APICollectionsClient.NewListByAzureAPIManagementServicePager. +type APICollectionsClientListByAzureAPIManagementServiceResponse struct { + // Page of a list of API collections as represented by Microsoft Defender for APIs. + APICollectionList } -// APICollectionOffboardingClientDeleteResponse contains the response from method APICollectionOffboardingClient.Delete. -type APICollectionOffboardingClientDeleteResponse struct { +// APICollectionsClientListByResourceGroupResponse contains the response from method APICollectionsClient.NewListByResourceGroupPager. +type APICollectionsClientListByResourceGroupResponse struct { + // Page of a list of API collections as represented by Microsoft Defender for APIs. + APICollectionList +} + +// APICollectionsClientListBySubscriptionResponse contains the response from method APICollectionsClient.NewListBySubscriptionPager. +type APICollectionsClientListBySubscriptionResponse struct { + // Page of a list of API collections as represented by Microsoft Defender for APIs. + APICollectionList +} + +// APICollectionsClientOffboardAzureAPIManagementAPIResponse contains the response from method APICollectionsClient.OffboardAzureAPIManagementAPI. +type APICollectionsClientOffboardAzureAPIManagementAPIResponse struct { // placeholder for future response values } -// APICollectionOnboardingClientCreateResponse contains the response from method APICollectionOnboardingClient.Create. -type APICollectionOnboardingClientCreateResponse struct { - APICollectionResponse +// APICollectionsClientOnboardAzureAPIManagementAPIResponse contains the response from method APICollectionsClient.BeginOnboardAzureAPIManagementAPI. +type APICollectionsClientOnboardAzureAPIManagementAPIResponse struct { + // An API collection as represented by Microsoft Defender for APIs. + APICollection } // AccountConnectorsClientCreateOrUpdateResponse contains the response from method AccountConnectorsClient.CreateOrUpdate. type AccountConnectorsClientCreateOrUpdateResponse struct { + // The connector setting ConnectorSetting } @@ -41,11 +56,13 @@ type AccountConnectorsClientDeleteResponse struct { // AccountConnectorsClientGetResponse contains the response from method AccountConnectorsClient.Get. type AccountConnectorsClientGetResponse struct { + // The connector setting ConnectorSetting } // AccountConnectorsClientListResponse contains the response from method AccountConnectorsClient.NewListPager. type AccountConnectorsClientListResponse struct { + // For a subscription, list of all cloud account connectors and their settings ConnectorSettingList } @@ -61,6 +78,7 @@ type AdaptiveApplicationControlsClientGetResponse struct { // 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 } @@ -76,51 +94,61 @@ type AdaptiveNetworkHardeningsClientEnforceResponse struct { // 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. AdvancedThreatProtectionSetting } // AdvancedThreatProtectionClientGetResponse contains the response from method AdvancedThreatProtectionClient.Get. type AdvancedThreatProtectionClientGetResponse struct { + // The Advanced Threat Protection resource. AdvancedThreatProtectionSetting } // AlertsClientGetResourceGroupLevelResponse contains the response from method AlertsClient.GetResourceGroupLevel. type AlertsClientGetResourceGroupLevelResponse struct { + // Security alert Alert } // AlertsClientGetSubscriptionLevelResponse contains the response from method AlertsClient.GetSubscriptionLevel. type AlertsClientGetSubscriptionLevelResponse struct { + // Security alert Alert } // AlertsClientListByResourceGroupResponse contains the response from method AlertsClient.NewListByResourceGroupPager. type AlertsClientListByResourceGroupResponse struct { + // List of security alerts AlertList } // AlertsClientListResourceGroupLevelByRegionResponse contains the response from method AlertsClient.NewListResourceGroupLevelByRegionPager. type AlertsClientListResourceGroupLevelByRegionResponse struct { + // List of security alerts AlertList } // AlertsClientListResponse contains the response from method AlertsClient.NewListPager. type AlertsClientListResponse struct { + // List of security alerts AlertList } // AlertsClientListSubscriptionLevelByRegionResponse contains the response from method AlertsClient.NewListSubscriptionLevelByRegionPager. type AlertsClientListSubscriptionLevelByRegionResponse struct { + // List of security alerts AlertList } @@ -176,36 +204,43 @@ type AlertsSuppressionRulesClientDeleteResponse struct { // AlertsSuppressionRulesClientGetResponse contains the response from method AlertsSuppressionRulesClient.Get. type AlertsSuppressionRulesClientGetResponse struct { + // Describes the suppression rule AlertsSuppressionRule } // AlertsSuppressionRulesClientListResponse contains the response from method AlertsSuppressionRulesClient.NewListPager. type AlertsSuppressionRulesClientListResponse struct { + // Suppression rules list for subscription. AlertsSuppressionRulesList } // AlertsSuppressionRulesClientUpdateResponse contains the response from method AlertsSuppressionRulesClient.Update. type AlertsSuppressionRulesClientUpdateResponse struct { + // Describes the suppression rule AlertsSuppressionRule } // AllowedConnectionsClientGetResponse contains the response from method AllowedConnectionsClient.Get. type AllowedConnectionsClientGetResponse struct { + // The resource whose properties describes the allowed traffic between Azure resources AllowedConnectionsResource } // AllowedConnectionsClientListByHomeRegionResponse contains the response from method AllowedConnectionsClient.NewListByHomeRegionPager. type AllowedConnectionsClientListByHomeRegionResponse struct { + // List of all possible traffic between Azure resources AllowedConnectionsList } // AllowedConnectionsClientListResponse contains the response from method AllowedConnectionsClient.NewListPager. type AllowedConnectionsClientListResponse struct { + // List of all possible traffic between Azure resources AllowedConnectionsList } // ApplicationClientCreateOrUpdateResponse contains the response from method ApplicationClient.CreateOrUpdate. type ApplicationClientCreateOrUpdateResponse struct { + // Security Application over a given scope Application } @@ -216,16 +251,19 @@ type ApplicationClientDeleteResponse struct { // ApplicationClientGetResponse contains the response from method ApplicationClient.Get. type ApplicationClientGetResponse struct { + // Security Application over a given scope Application } // ApplicationsClientListResponse contains the response from method ApplicationsClient.NewListPager. type ApplicationsClientListResponse struct { + // Page of a security applications list ApplicationsList } // AssessmentsClientCreateOrUpdateResponse contains the response from method AssessmentsClient.CreateOrUpdate. type AssessmentsClientCreateOrUpdateResponse struct { + // Security assessment on a resource - response format AssessmentResponse } @@ -236,16 +274,19 @@ type AssessmentsClientDeleteResponse struct { // AssessmentsClientGetResponse contains the response from method AssessmentsClient.Get. type AssessmentsClientGetResponse struct { + // Security assessment on a resource - response format AssessmentResponse } // AssessmentsClientListResponse contains the response from method AssessmentsClient.NewListPager. type AssessmentsClientListResponse struct { + // Page of a security assessments list AssessmentList } // AssessmentsMetadataClientCreateInSubscriptionResponse contains the response from method AssessmentsMetadataClient.CreateInSubscription. type AssessmentsMetadataClientCreateInSubscriptionResponse struct { + // Security assessment metadata response AssessmentMetadataResponse } @@ -256,41 +297,49 @@ type AssessmentsMetadataClientDeleteInSubscriptionResponse struct { // AssessmentsMetadataClientGetInSubscriptionResponse contains the response from method AssessmentsMetadataClient.GetInSubscription. type AssessmentsMetadataClientGetInSubscriptionResponse struct { + // Security assessment metadata response AssessmentMetadataResponse } // AssessmentsMetadataClientGetResponse contains the response from method AssessmentsMetadataClient.Get. type AssessmentsMetadataClientGetResponse struct { + // Security assessment metadata response AssessmentMetadataResponse } // AssessmentsMetadataClientListBySubscriptionResponse contains the response from method AssessmentsMetadataClient.NewListBySubscriptionPager. type AssessmentsMetadataClientListBySubscriptionResponse struct { + // List of security assessment metadata AssessmentMetadataResponseList } // AssessmentsMetadataClientListResponse contains the response from method AssessmentsMetadataClient.NewListPager. type AssessmentsMetadataClientListResponse struct { + // List of security assessment metadata AssessmentMetadataResponseList } // AutoProvisioningSettingsClientCreateResponse contains the response from method AutoProvisioningSettingsClient.Create. type AutoProvisioningSettingsClientCreateResponse struct { + // Auto provisioning setting AutoProvisioningSetting } // AutoProvisioningSettingsClientGetResponse contains the response from method AutoProvisioningSettingsClient.Get. type AutoProvisioningSettingsClientGetResponse struct { + // Auto provisioning setting AutoProvisioningSetting } // AutoProvisioningSettingsClientListResponse contains the response from method AutoProvisioningSettingsClient.NewListPager. type AutoProvisioningSettingsClientListResponse struct { + // List of all the auto provisioning settings response AutoProvisioningSettingList } // AutomationsClientCreateOrUpdateResponse contains the response from method AutomationsClient.CreateOrUpdate. type AutomationsClientCreateOrUpdateResponse struct { + // The security automation resource. Automation } @@ -301,56 +350,145 @@ type AutomationsClientDeleteResponse struct { // AutomationsClientGetResponse contains the response from method AutomationsClient.Get. type AutomationsClientGetResponse struct { + // The security automation resource. Automation } // AutomationsClientListByResourceGroupResponse contains the response from method AutomationsClient.NewListByResourceGroupPager. type AutomationsClientListByResourceGroupResponse struct { + // List of security automations response. AutomationList } // AutomationsClientListResponse contains the response from method AutomationsClient.NewListPager. type AutomationsClientListResponse struct { + // List of security automations response. AutomationList } // AutomationsClientValidateResponse contains the response from method AutomationsClient.Validate. type AutomationsClientValidateResponse struct { + // The security automation model state property bag. AutomationValidationStatus } +// AzureDevOpsOrgsClientCreateOrUpdateResponse contains the response from method AzureDevOpsOrgsClient.BeginCreateOrUpdate. +type AzureDevOpsOrgsClientCreateOrUpdateResponse struct { + // Azure DevOps Organization resource. + AzureDevOpsOrg +} + +// AzureDevOpsOrgsClientGetResponse contains the response from method AzureDevOpsOrgsClient.Get. +type AzureDevOpsOrgsClientGetResponse struct { + // Azure DevOps Organization resource. + AzureDevOpsOrg +} + +// AzureDevOpsOrgsClientListAvailableResponse contains the response from method AzureDevOpsOrgsClient.ListAvailable. +type AzureDevOpsOrgsClientListAvailableResponse struct { + // List of RP resources which supports pagination. + AzureDevOpsOrgListResponse +} + +// AzureDevOpsOrgsClientListResponse contains the response from method AzureDevOpsOrgsClient.NewListPager. +type AzureDevOpsOrgsClientListResponse struct { + // List of RP resources which supports pagination. + AzureDevOpsOrgListResponse +} + +// AzureDevOpsOrgsClientUpdateResponse contains the response from method AzureDevOpsOrgsClient.BeginUpdate. +type AzureDevOpsOrgsClientUpdateResponse struct { + // Azure DevOps Organization resource. + AzureDevOpsOrg +} + +// AzureDevOpsProjectsClientCreateOrUpdateResponse contains the response from method AzureDevOpsProjectsClient.BeginCreateOrUpdate. +type AzureDevOpsProjectsClientCreateOrUpdateResponse struct { + // Azure DevOps Project resource. + AzureDevOpsProject +} + +// AzureDevOpsProjectsClientGetResponse contains the response from method AzureDevOpsProjectsClient.Get. +type AzureDevOpsProjectsClientGetResponse struct { + // Azure DevOps Project resource. + AzureDevOpsProject +} + +// AzureDevOpsProjectsClientListResponse contains the response from method AzureDevOpsProjectsClient.NewListPager. +type AzureDevOpsProjectsClientListResponse struct { + // List of RP resources which supports pagination. + AzureDevOpsProjectListResponse +} + +// AzureDevOpsProjectsClientUpdateResponse contains the response from method AzureDevOpsProjectsClient.BeginUpdate. +type AzureDevOpsProjectsClientUpdateResponse struct { + // Azure DevOps Project resource. + AzureDevOpsProject +} + +// AzureDevOpsReposClientCreateOrUpdateResponse contains the response from method AzureDevOpsReposClient.BeginCreateOrUpdate. +type AzureDevOpsReposClientCreateOrUpdateResponse struct { + // Azure DevOps Repository resource. + AzureDevOpsRepository +} + +// AzureDevOpsReposClientGetResponse contains the response from method AzureDevOpsReposClient.Get. +type AzureDevOpsReposClientGetResponse struct { + // Azure DevOps Repository resource. + AzureDevOpsRepository +} + +// AzureDevOpsReposClientListResponse contains the response from method AzureDevOpsReposClient.NewListPager. +type AzureDevOpsReposClientListResponse struct { + // List of RP resources which supports pagination. + AzureDevOpsRepositoryListResponse +} + +// AzureDevOpsReposClientUpdateResponse contains the response from method AzureDevOpsReposClient.BeginUpdate. +type AzureDevOpsReposClientUpdateResponse struct { + // Azure DevOps Repository resource. + AzureDevOpsRepository +} + // CenterClientGetSensitivitySettingsResponse contains the response from method CenterClient.GetSensitivitySettings. type CenterClientGetSensitivitySettingsResponse struct { + // Data sensitivity settings for sensitive data discovery GetSensitivitySettingsResponse } // CenterClientUpdateSensitivitySettingsResponse contains the response from method CenterClient.UpdateSensitivitySettings. type CenterClientUpdateSensitivitySettingsResponse struct { + // Data sensitivity settings for sensitive data discovery GetSensitivitySettingsResponse } // ComplianceResultsClientGetResponse contains the response from method ComplianceResultsClient.Get. type ComplianceResultsClientGetResponse struct { + // a compliance result ComplianceResult } // ComplianceResultsClientListResponse contains the response from method ComplianceResultsClient.NewListPager. type ComplianceResultsClientListResponse struct { + // List of compliance results response ComplianceResultList } // CompliancesClientGetResponse contains the response from method CompliancesClient.Get. type CompliancesClientGetResponse struct { + // Compliance of a scope Compliance } // CompliancesClientListResponse contains the response from method CompliancesClient.NewListPager. type CompliancesClientListResponse struct { + // List of Compliance objects response ComplianceList } // ConnectorApplicationClientCreateOrUpdateResponse contains the response from method ConnectorApplicationClient.CreateOrUpdate. type ConnectorApplicationClientCreateOrUpdateResponse struct { + // Security Application over a given scope Application } @@ -361,16 +499,19 @@ type ConnectorApplicationClientDeleteResponse struct { // ConnectorApplicationClientGetResponse contains the response from method ConnectorApplicationClient.Get. type ConnectorApplicationClientGetResponse struct { + // Security Application over a given scope Application } // ConnectorApplicationsClientListResponse contains the response from method ConnectorApplicationsClient.NewListPager. type ConnectorApplicationsClientListResponse struct { + // Page of a security applications list ApplicationsList } // ConnectorsClientCreateOrUpdateResponse contains the response from method ConnectorsClient.CreateOrUpdate. type ConnectorsClientCreateOrUpdateResponse struct { + // The security connector resource. Connector } @@ -381,26 +522,31 @@ type ConnectorsClientDeleteResponse struct { // ConnectorsClientGetResponse contains the response from method ConnectorsClient.Get. type ConnectorsClientGetResponse struct { + // The security connector resource. Connector } // ConnectorsClientListByResourceGroupResponse contains the response from method ConnectorsClient.NewListByResourceGroupPager. type ConnectorsClientListByResourceGroupResponse struct { + // List of security connectors response. ConnectorsList } // ConnectorsClientListResponse contains the response from method ConnectorsClient.NewListPager. type ConnectorsClientListResponse struct { + // List of security connectors response. ConnectorsList } // ConnectorsClientUpdateResponse contains the response from method ConnectorsClient.Update. type ConnectorsClientUpdateResponse struct { + // The security connector resource. Connector } // ContactsClientCreateResponse contains the response from method ContactsClient.Create. type ContactsClientCreateResponse struct { + // Contact details and configurations for notifications coming from Microsoft Defender for Cloud. Contact } @@ -411,16 +557,19 @@ type ContactsClientDeleteResponse struct { // ContactsClientGetResponse contains the response from method ContactsClient.Get. type ContactsClientGetResponse struct { + // Contact details and configurations for notifications coming from Microsoft Defender for Cloud. Contact } // ContactsClientListResponse contains the response from method ContactsClient.NewListPager. type ContactsClientListResponse struct { + // List of security contacts response ContactList } // CustomAssessmentAutomationsClientCreateResponse contains the response from method CustomAssessmentAutomationsClient.Create. type CustomAssessmentAutomationsClientCreateResponse struct { + // Custom Assessment Automation CustomAssessmentAutomation } @@ -431,21 +580,25 @@ type CustomAssessmentAutomationsClientDeleteResponse struct { // CustomAssessmentAutomationsClientGetResponse contains the response from method CustomAssessmentAutomationsClient.Get. type CustomAssessmentAutomationsClientGetResponse struct { + // Custom Assessment Automation CustomAssessmentAutomation } // CustomAssessmentAutomationsClientListByResourceGroupResponse contains the response from method CustomAssessmentAutomationsClient.NewListByResourceGroupPager. type CustomAssessmentAutomationsClientListByResourceGroupResponse struct { + // A list of Custom Assessment Automations CustomAssessmentAutomationsListResult } // CustomAssessmentAutomationsClientListBySubscriptionResponse contains the response from method CustomAssessmentAutomationsClient.NewListBySubscriptionPager. type CustomAssessmentAutomationsClientListBySubscriptionResponse struct { + // A list of Custom Assessment Automations CustomAssessmentAutomationsListResult } // CustomEntityStoreAssignmentsClientCreateResponse contains the response from method CustomEntityStoreAssignmentsClient.Create. type CustomEntityStoreAssignmentsClientCreateResponse struct { + // Custom entity store assignment CustomEntityStoreAssignment } @@ -456,21 +609,72 @@ type CustomEntityStoreAssignmentsClientDeleteResponse struct { // CustomEntityStoreAssignmentsClientGetResponse contains the response from method CustomEntityStoreAssignmentsClient.Get. type CustomEntityStoreAssignmentsClientGetResponse struct { + // Custom entity store assignment CustomEntityStoreAssignment } // CustomEntityStoreAssignmentsClientListByResourceGroupResponse contains the response from method CustomEntityStoreAssignmentsClient.NewListByResourceGroupPager. type CustomEntityStoreAssignmentsClientListByResourceGroupResponse struct { + // A list of custom entity store assignments CustomEntityStoreAssignmentsListResult } // CustomEntityStoreAssignmentsClientListBySubscriptionResponse contains the response from method CustomEntityStoreAssignmentsClient.NewListBySubscriptionPager. type CustomEntityStoreAssignmentsClientListBySubscriptionResponse struct { + // A list of custom entity store assignments CustomEntityStoreAssignmentsListResult } +// DefenderForStorageClientCreateResponse contains the response from method DefenderForStorageClient.Create. +type DefenderForStorageClientCreateResponse struct { + // The Defender for Storage resource. + DefenderForStorageSetting +} + +// DefenderForStorageClientGetResponse contains the response from method DefenderForStorageClient.Get. +type DefenderForStorageClientGetResponse struct { + // The Defender for Storage resource. + DefenderForStorageSetting +} + +// DevOpsConfigurationsClientCreateOrUpdateResponse contains the response from method DevOpsConfigurationsClient.BeginCreateOrUpdate. +type DevOpsConfigurationsClientCreateOrUpdateResponse struct { + // DevOps Configuration resource. + DevOpsConfiguration +} + +// DevOpsConfigurationsClientDeleteResponse contains the response from method DevOpsConfigurationsClient.BeginDelete. +type DevOpsConfigurationsClientDeleteResponse struct { + // placeholder for future response values +} + +// DevOpsConfigurationsClientGetResponse contains the response from method DevOpsConfigurationsClient.Get. +type DevOpsConfigurationsClientGetResponse struct { + // DevOps Configuration resource. + DevOpsConfiguration +} + +// DevOpsConfigurationsClientListResponse contains the response from method DevOpsConfigurationsClient.NewListPager. +type DevOpsConfigurationsClientListResponse struct { + // List of RP resources which supports pagination. + DevOpsConfigurationListResponse +} + +// DevOpsConfigurationsClientUpdateResponse contains the response from method DevOpsConfigurationsClient.BeginUpdate. +type DevOpsConfigurationsClientUpdateResponse struct { + // DevOps Configuration resource. + DevOpsConfiguration +} + +// DevOpsOperationResultsClientGetResponse contains the response from method DevOpsOperationResultsClient.Get. +type DevOpsOperationResultsClientGetResponse struct { + // The current status of an async operation. + OperationStatusResult +} + // DeviceSecurityGroupsClientCreateOrUpdateResponse contains the response from method DeviceSecurityGroupsClient.CreateOrUpdate. type DeviceSecurityGroupsClientCreateOrUpdateResponse struct { + // The device security group resource DeviceSecurityGroup } @@ -481,11 +685,13 @@ type DeviceSecurityGroupsClientDeleteResponse struct { // DeviceSecurityGroupsClientGetResponse contains the response from method DeviceSecurityGroupsClient.Get. type DeviceSecurityGroupsClientGetResponse struct { + // The device security group resource DeviceSecurityGroup } // DeviceSecurityGroupsClientListResponse contains the response from method DeviceSecurityGroupsClient.NewListPager. type DeviceSecurityGroupsClientListResponse struct { + // List of device security groups DeviceSecurityGroupList } @@ -506,6 +712,8 @@ type DiscoveredSecuritySolutionsClientListResponse struct { // ExternalSecuritySolutionsClientGetResponse contains the response from method ExternalSecuritySolutionsClient.Get. type ExternalSecuritySolutionsClientGetResponse struct { + // Represents a security solution external to Microsoft Defender for Cloud which sends information to an OMS workspace and + // whose data is displayed by Microsoft Defender for Cloud. ExternalSecuritySolution } @@ -519,8 +727,75 @@ type ExternalSecuritySolutionsClientListResponse struct { ExternalSecuritySolutionList } +// GitHubOwnersClientGetResponse contains the response from method GitHubOwnersClient.Get. +type GitHubOwnersClientGetResponse struct { + // GitHub Owner resource. + GitHubOwner +} + +// GitHubOwnersClientListAvailableResponse contains the response from method GitHubOwnersClient.ListAvailable. +type GitHubOwnersClientListAvailableResponse struct { + // List of RP resources which supports pagination. + GitHubOwnerListResponse +} + +// GitHubOwnersClientListResponse contains the response from method GitHubOwnersClient.NewListPager. +type GitHubOwnersClientListResponse struct { + // List of RP resources which supports pagination. + GitHubOwnerListResponse +} + +// GitHubReposClientGetResponse contains the response from method GitHubReposClient.Get. +type GitHubReposClientGetResponse struct { + // GitHub Repository resource. + GitHubRepository +} + +// GitHubReposClientListResponse contains the response from method GitHubReposClient.NewListPager. +type GitHubReposClientListResponse struct { + // List of RP resources which supports pagination. + GitHubRepositoryListResponse +} + +// GitLabGroupsClientGetResponse contains the response from method GitLabGroupsClient.Get. +type GitLabGroupsClientGetResponse struct { + // GitLab Group resource. + GitLabGroup +} + +// GitLabGroupsClientListAvailableResponse contains the response from method GitLabGroupsClient.ListAvailable. +type GitLabGroupsClientListAvailableResponse struct { + // List of RP resources which supports pagination. + GitLabGroupListResponse +} + +// GitLabGroupsClientListResponse contains the response from method GitLabGroupsClient.NewListPager. +type GitLabGroupsClientListResponse struct { + // List of RP resources which supports pagination. + GitLabGroupListResponse +} + +// GitLabProjectsClientGetResponse contains the response from method GitLabProjectsClient.Get. +type GitLabProjectsClientGetResponse struct { + // GitLab Project resource. + GitLabProject +} + +// GitLabProjectsClientListResponse contains the response from method GitLabProjectsClient.NewListPager. +type GitLabProjectsClientListResponse struct { + // List of RP resources which supports pagination. + GitLabProjectListResponse +} + +// GitLabSubgroupsClientListResponse contains the response from method GitLabSubgroupsClient.List. +type GitLabSubgroupsClientListResponse struct { + // List of RP resources which supports pagination. + GitLabGroupListResponse +} + // GovernanceAssignmentsClientCreateOrUpdateResponse contains the response from method GovernanceAssignmentsClient.CreateOrUpdate. type GovernanceAssignmentsClientCreateOrUpdateResponse struct { + // Governance assignment over a given scope GovernanceAssignment } @@ -531,16 +806,19 @@ type GovernanceAssignmentsClientDeleteResponse struct { // GovernanceAssignmentsClientGetResponse contains the response from method GovernanceAssignmentsClient.Get. type GovernanceAssignmentsClientGetResponse struct { + // Governance assignment over a given scope GovernanceAssignment } // GovernanceAssignmentsClientListResponse contains the response from method GovernanceAssignmentsClient.NewListPager. type GovernanceAssignmentsClientListResponse struct { + // Page of a governance assignments list GovernanceAssignmentsList } // GovernanceRulesClientCreateOrUpdateResponse contains the response from method GovernanceRulesClient.CreateOrUpdate. type GovernanceRulesClientCreateOrUpdateResponse struct { + // Governance rule over a given scope GovernanceRule } @@ -556,88 +834,70 @@ type GovernanceRulesClientExecuteResponse struct { // GovernanceRulesClientGetResponse contains the response from method GovernanceRulesClient.Get. type GovernanceRulesClientGetResponse struct { + // Governance rule over a given scope GovernanceRule } // GovernanceRulesClientListResponse contains the response from method GovernanceRulesClient.NewListPager. type GovernanceRulesClientListResponse struct { + // Page of a governance rules list GovernanceRuleList } // GovernanceRulesClientOperationResultsResponse contains the response from method GovernanceRulesClient.OperationResults. type GovernanceRulesClientOperationResultsResponse struct { + // Long run operation status of governance rule over a given scope OperationResultAutoGenerated + // Location contains the information returned from the location header response. Location *string } -// HealthReportClientGetResponse contains the response from method HealthReportClient.Get. -type HealthReportClientGetResponse struct { +// HealthReportsClientGetResponse contains the response from method HealthReportsClient.Get. +type HealthReportsClientGetResponse struct { + // The health report resource HealthReport } // HealthReportsClientListResponse contains the response from method HealthReportsClient.NewListPager. type HealthReportsClientListResponse struct { + // Page of health reports list HealthReportsList } // InformationProtectionPoliciesClientCreateOrUpdateResponse contains the response from method InformationProtectionPoliciesClient.CreateOrUpdate. type InformationProtectionPoliciesClientCreateOrUpdateResponse struct { + // Information protection policy. InformationProtectionPolicy } // InformationProtectionPoliciesClientGetResponse contains the response from method InformationProtectionPoliciesClient.Get. type InformationProtectionPoliciesClientGetResponse struct { + // Information protection policy. InformationProtectionPolicy } // InformationProtectionPoliciesClientListResponse contains the response from method InformationProtectionPoliciesClient.NewListPager. type InformationProtectionPoliciesClientListResponse struct { + // Information protection policies response. InformationProtectionPolicyList } -// IngestionSettingsClientCreateResponse contains the response from method IngestionSettingsClient.Create. -type IngestionSettingsClientCreateResponse struct { - IngestionSetting -} - -// IngestionSettingsClientDeleteResponse contains the response from method IngestionSettingsClient.Delete. -type IngestionSettingsClientDeleteResponse struct { - // placeholder for future response values -} - -// IngestionSettingsClientGetResponse contains the response from method IngestionSettingsClient.Get. -type IngestionSettingsClientGetResponse struct { - IngestionSetting -} - -// IngestionSettingsClientListConnectionStringsResponse contains the response from method IngestionSettingsClient.ListConnectionStrings. -type IngestionSettingsClientListConnectionStringsResponse struct { - ConnectionStrings -} - -// IngestionSettingsClientListResponse contains the response from method IngestionSettingsClient.NewListPager. -type IngestionSettingsClientListResponse struct { - IngestionSettingList -} - -// IngestionSettingsClientListTokensResponse contains the response from method IngestionSettingsClient.ListTokens. -type IngestionSettingsClientListTokensResponse struct { - IngestionSettingToken -} - // IotSecuritySolutionAnalyticsClientGetResponse contains the response from method IotSecuritySolutionAnalyticsClient.Get. type IotSecuritySolutionAnalyticsClientGetResponse struct { + // Security analytics of your IoT Security solution IoTSecuritySolutionAnalyticsModel } // IotSecuritySolutionAnalyticsClientListResponse contains the response from method IotSecuritySolutionAnalyticsClient.List. type IotSecuritySolutionAnalyticsClientListResponse struct { + // List of Security analytics of your IoT Security solution IoTSecuritySolutionAnalyticsModelList } // IotSecuritySolutionClientCreateOrUpdateResponse contains the response from method IotSecuritySolutionClient.CreateOrUpdate. type IotSecuritySolutionClientCreateOrUpdateResponse struct { + // IoT Security solution configuration and resource information. IoTSecuritySolutionModel } @@ -648,21 +908,25 @@ type IotSecuritySolutionClientDeleteResponse struct { // IotSecuritySolutionClientGetResponse contains the response from method IotSecuritySolutionClient.Get. type IotSecuritySolutionClientGetResponse struct { + // IoT Security solution configuration and resource information. IoTSecuritySolutionModel } // IotSecuritySolutionClientListByResourceGroupResponse contains the response from method IotSecuritySolutionClient.NewListByResourceGroupPager. type IotSecuritySolutionClientListByResourceGroupResponse struct { + // List of IoT Security solutions. IoTSecuritySolutionsList } // IotSecuritySolutionClientListBySubscriptionResponse contains the response from method IotSecuritySolutionClient.NewListBySubscriptionPager. type IotSecuritySolutionClientListBySubscriptionResponse struct { + // List of IoT Security solutions. IoTSecuritySolutionsList } // IotSecuritySolutionClientUpdateResponse contains the response from method IotSecuritySolutionClient.Update. type IotSecuritySolutionClientUpdateResponse struct { + // IoT Security solution configuration and resource information. IoTSecuritySolutionModel } @@ -673,21 +937,25 @@ type IotSecuritySolutionsAnalyticsAggregatedAlertClientDismissResponse struct { // IotSecuritySolutionsAnalyticsAggregatedAlertClientGetResponse contains the response from method IotSecuritySolutionsAnalyticsAggregatedAlertClient.Get. type IotSecuritySolutionsAnalyticsAggregatedAlertClientGetResponse struct { + // Security Solution Aggregated Alert information IoTSecurityAggregatedAlert } // IotSecuritySolutionsAnalyticsAggregatedAlertClientListResponse contains the response from method IotSecuritySolutionsAnalyticsAggregatedAlertClient.NewListPager. type IotSecuritySolutionsAnalyticsAggregatedAlertClientListResponse struct { + // List of IoT Security solution aggregated alert data. IoTSecurityAggregatedAlertList } // IotSecuritySolutionsAnalyticsRecommendationClientGetResponse contains the response from method IotSecuritySolutionsAnalyticsRecommendationClient.Get. type IotSecuritySolutionsAnalyticsRecommendationClientGetResponse struct { + // IoT Security solution recommendation information. IoTSecurityAggregatedRecommendation } // IotSecuritySolutionsAnalyticsRecommendationClientListResponse contains the response from method IotSecuritySolutionsAnalyticsRecommendationClient.NewListPager. type IotSecuritySolutionsAnalyticsRecommendationClientListResponse struct { + // List of IoT Security solution aggregated recommendations. IoTSecurityAggregatedRecommendationList } @@ -733,31 +1001,37 @@ type JitNetworkAccessPoliciesClientListResponse struct { // LocationsClientGetResponse contains the response from method LocationsClient.Get. type LocationsClientGetResponse struct { + // The ASC location of the subscription is in the "name" field AscLocation } // LocationsClientListResponse contains the response from method LocationsClient.NewListPager. type LocationsClientListResponse struct { + // List of locations where ASC saves your data AscLocationList } // MdeOnboardingsClientGetResponse contains the response from method MdeOnboardingsClient.Get. type MdeOnboardingsClientGetResponse struct { + // The resource of the configuration or data needed to onboard the machine to MDE MdeOnboardingData } // MdeOnboardingsClientListResponse contains the response from method MdeOnboardingsClient.List. type MdeOnboardingsClientListResponse struct { + // List of all MDE onboarding data resources MdeOnboardingDataList } // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // List of possible operations for Microsoft.Security resource provider OperationList } // OperatorsClientCreateOrUpdateResponse contains the response from method OperatorsClient.CreateOrUpdate. type OperatorsClientCreateOrUpdateResponse struct { + // Security operator under a given subscription and pricing OperatorResource } @@ -768,66 +1042,81 @@ type OperatorsClientDeleteResponse struct { // OperatorsClientGetResponse contains the response from method OperatorsClient.Get. type OperatorsClientGetResponse struct { + // Security operator under a given subscription and pricing OperatorResource } // OperatorsClientListResponse contains the response from method OperatorsClient.List. type OperatorsClientListResponse struct { + // List of SecurityOperator response. OperatorList } // PricingsClientGetResponse contains the response from method PricingsClient.Get. type PricingsClientGetResponse struct { + // Microsoft Defender for Cloud is provided in two pricing tiers: free and standard. The standard tier offers advanced security + // capabilities, while the free tier offers basic security features. Pricing } // PricingsClientListResponse contains the response from method PricingsClient.List. type PricingsClientListResponse struct { + // List of pricing configurations response. PricingList } // PricingsClientUpdateResponse contains the response from method PricingsClient.Update. type PricingsClientUpdateResponse struct { + // Microsoft Defender for Cloud is provided in two pricing tiers: free and standard. The standard tier offers advanced security + // capabilities, while the free tier offers basic security features. Pricing } // RegulatoryComplianceAssessmentsClientGetResponse contains the response from method RegulatoryComplianceAssessmentsClient.Get. type RegulatoryComplianceAssessmentsClientGetResponse struct { + // Regulatory compliance assessment details and state RegulatoryComplianceAssessment } // RegulatoryComplianceAssessmentsClientListResponse contains the response from method RegulatoryComplianceAssessmentsClient.NewListPager. type RegulatoryComplianceAssessmentsClientListResponse struct { + // List of regulatory compliance assessment response RegulatoryComplianceAssessmentList } // RegulatoryComplianceControlsClientGetResponse contains the response from method RegulatoryComplianceControlsClient.Get. type RegulatoryComplianceControlsClientGetResponse struct { + // Regulatory compliance control details and state RegulatoryComplianceControl } // RegulatoryComplianceControlsClientListResponse contains the response from method RegulatoryComplianceControlsClient.NewListPager. type RegulatoryComplianceControlsClientListResponse struct { + // List of regulatory compliance controls response RegulatoryComplianceControlList } // RegulatoryComplianceStandardsClientGetResponse contains the response from method RegulatoryComplianceStandardsClient.Get. type RegulatoryComplianceStandardsClientGetResponse struct { + // Regulatory compliance standard details and state RegulatoryComplianceStandard } // RegulatoryComplianceStandardsClientListResponse contains the response from method RegulatoryComplianceStandardsClient.NewListPager. type RegulatoryComplianceStandardsClientListResponse struct { + // List of regulatory compliance standards response RegulatoryComplianceStandardList } // SQLVulnerabilityAssessmentBaselineRulesClientAddResponse contains the response from method SQLVulnerabilityAssessmentBaselineRulesClient.Add. type SQLVulnerabilityAssessmentBaselineRulesClientAddResponse struct { + // A list of rules results. RulesResults } // SQLVulnerabilityAssessmentBaselineRulesClientCreateOrUpdateResponse contains the response from method SQLVulnerabilityAssessmentBaselineRulesClient.CreateOrUpdate. type SQLVulnerabilityAssessmentBaselineRulesClientCreateOrUpdateResponse struct { + // Rule results. RuleResults } @@ -838,71 +1127,85 @@ type SQLVulnerabilityAssessmentBaselineRulesClientDeleteResponse struct { // SQLVulnerabilityAssessmentBaselineRulesClientGetResponse contains the response from method SQLVulnerabilityAssessmentBaselineRulesClient.Get. type SQLVulnerabilityAssessmentBaselineRulesClientGetResponse struct { + // Rule results. RuleResults } // SQLVulnerabilityAssessmentBaselineRulesClientListResponse contains the response from method SQLVulnerabilityAssessmentBaselineRulesClient.List. type SQLVulnerabilityAssessmentBaselineRulesClientListResponse struct { + // A list of rules results. RulesResults } // SQLVulnerabilityAssessmentScanResultsClientGetResponse contains the response from method SQLVulnerabilityAssessmentScanResultsClient.Get. type SQLVulnerabilityAssessmentScanResultsClientGetResponse struct { + // A vulnerability assessment scan result for a single rule. ScanResult } // SQLVulnerabilityAssessmentScanResultsClientListResponse contains the response from method SQLVulnerabilityAssessmentScanResultsClient.List. type SQLVulnerabilityAssessmentScanResultsClientListResponse struct { + // A list of vulnerability assessment scan results. ScanResults } // SQLVulnerabilityAssessmentScansClientGetResponse contains the response from method SQLVulnerabilityAssessmentScansClient.Get. type SQLVulnerabilityAssessmentScansClientGetResponse struct { + // A vulnerability assessment scan record. Scan } // SQLVulnerabilityAssessmentScansClientListResponse contains the response from method SQLVulnerabilityAssessmentScansClient.List. type SQLVulnerabilityAssessmentScansClientListResponse struct { + // A list of vulnerability assessment scan records. Scans } // SecureScoreControlDefinitionsClientListBySubscriptionResponse contains the response from method SecureScoreControlDefinitionsClient.NewListBySubscriptionPager. type SecureScoreControlDefinitionsClientListBySubscriptionResponse struct { + // List of security controls definition SecureScoreControlDefinitionList } // SecureScoreControlDefinitionsClientListResponse contains the response from method SecureScoreControlDefinitionsClient.NewListPager. type SecureScoreControlDefinitionsClientListResponse struct { + // List of security controls definition SecureScoreControlDefinitionList } // SecureScoreControlsClientListBySecureScoreResponse contains the response from method SecureScoreControlsClient.NewListBySecureScorePager. type SecureScoreControlsClientListBySecureScoreResponse struct { + // List of security controls SecureScoreControlList } // SecureScoreControlsClientListResponse contains the response from method SecureScoreControlsClient.NewListPager. type SecureScoreControlsClientListResponse struct { + // List of security controls SecureScoreControlList } // SecureScoresClientGetResponse contains the response from method SecureScoresClient.Get. type SecureScoresClientGetResponse struct { + // Secure score item data model SecureScoreItem } // SecureScoresClientListResponse contains the response from method SecureScoresClient.NewListPager. type SecureScoresClientListResponse struct { + // List of secure scores SecureScoresList } // SensitivitySettingsClientListResponse contains the response from method SensitivitySettingsClient.List. type SensitivitySettingsClientListResponse struct { + // A list with a single sensitivity settings resource GetSensitivitySettingsListResponse } // ServerVulnerabilityAssessmentClientCreateOrUpdateResponse contains the response from method ServerVulnerabilityAssessmentClient.CreateOrUpdate. type ServerVulnerabilityAssessmentClientCreateOrUpdateResponse struct { + // Describes the server vulnerability assessment details on a resource ServerVulnerabilityAssessment } @@ -913,16 +1216,62 @@ type ServerVulnerabilityAssessmentClientDeleteResponse struct { // ServerVulnerabilityAssessmentClientGetResponse contains the response from method ServerVulnerabilityAssessmentClient.Get. type ServerVulnerabilityAssessmentClientGetResponse struct { + // Describes the server vulnerability assessment details on a resource ServerVulnerabilityAssessment } // ServerVulnerabilityAssessmentClientListByExtendedResourceResponse contains the response from method ServerVulnerabilityAssessmentClient.ListByExtendedResource. type ServerVulnerabilityAssessmentClientListByExtendedResourceResponse struct { + // List of server vulnerability assessments ServerVulnerabilityAssessmentsList } +// ServerVulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse contains the response from method ServerVulnerabilityAssessmentsSettingsClient.CreateOrUpdate. +type ServerVulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse struct { + // A base vulnerability assessments setting on servers in the defined scope. + 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 +} + +// ServerVulnerabilityAssessmentsSettingsClientGetResponse contains the response from method ServerVulnerabilityAssessmentsSettingsClient.Get. +type ServerVulnerabilityAssessmentsSettingsClientGetResponse struct { + // A base vulnerability assessments setting on servers in the defined scope. + 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 + ServerVulnerabilityAssessmentsSettingsList +} + // SettingsClientGetResponse contains the response from method SettingsClient.Get. type SettingsClientGetResponse struct { + // The kind of the security setting SettingClassification } @@ -938,11 +1287,13 @@ func (s *SettingsClientGetResponse) UnmarshalJSON(data []byte) error { // SettingsClientListResponse contains the response from method SettingsClient.NewListPager. type SettingsClientListResponse struct { + // Subscription settings list. SettingsList } // SettingsClientUpdateResponse contains the response from method SettingsClient.Update. type SettingsClientUpdateResponse struct { + // The kind of the security setting SettingClassification } @@ -958,16 +1309,19 @@ func (s *SettingsClientUpdateResponse) UnmarshalJSON(data []byte) error { // SoftwareInventoriesClientGetResponse contains the response from method SoftwareInventoriesClient.Get. type SoftwareInventoriesClientGetResponse struct { + // Represents a software data Software } // SoftwareInventoriesClientListByExtendedResourceResponse contains the response from method SoftwareInventoriesClient.NewListByExtendedResourcePager. type SoftwareInventoriesClientListByExtendedResourceResponse struct { + // Represents the software inventory of the virtual machine. SoftwaresList } // SoftwareInventoriesClientListBySubscriptionResponse contains the response from method SoftwareInventoriesClient.NewListBySubscriptionPager. type SoftwareInventoriesClientListBySubscriptionResponse struct { + // Represents the software inventory of the virtual machine. SoftwaresList } @@ -993,41 +1347,49 @@ type SolutionsReferenceDataClientListResponse struct { // SubAssessmentsClientGetResponse contains the response from method SubAssessmentsClient.Get. type SubAssessmentsClientGetResponse struct { + // Security sub-assessment on a resource SubAssessment } // SubAssessmentsClientListAllResponse contains the response from method SubAssessmentsClient.NewListAllPager. type SubAssessmentsClientListAllResponse struct { + // List of security sub-assessments SubAssessmentList } // SubAssessmentsClientListResponse contains the response from method SubAssessmentsClient.NewListPager. type SubAssessmentsClientListResponse struct { + // List of security sub-assessments SubAssessmentList } // TasksClientGetResourceGroupLevelTaskResponse contains the response from method TasksClient.GetResourceGroupLevelTask. type TasksClientGetResourceGroupLevelTaskResponse struct { + // Security task that we recommend to do in order to strengthen security Task } // TasksClientGetSubscriptionLevelTaskResponse contains the response from method TasksClient.GetSubscriptionLevelTask. type TasksClientGetSubscriptionLevelTaskResponse struct { + // Security task that we recommend to do in order to strengthen security Task } // TasksClientListByHomeRegionResponse contains the response from method TasksClient.NewListByHomeRegionPager. type TasksClientListByHomeRegionResponse struct { + // List of security task recommendations TaskList } // TasksClientListByResourceGroupResponse contains the response from method TasksClient.NewListByResourceGroupPager. type TasksClientListByResourceGroupResponse struct { + // List of security task recommendations TaskList } // TasksClientListResponse contains the response from method TasksClient.NewListPager. type TasksClientListResponse struct { + // List of security task recommendations TaskList } @@ -1058,6 +1420,7 @@ type TopologyClientListResponse struct { // WorkspaceSettingsClientCreateResponse contains the response from method WorkspaceSettingsClient.Create. type WorkspaceSettingsClientCreateResponse struct { + // Configures where to store the OMS agent data for workspaces under a scope WorkspaceSetting } @@ -1068,15 +1431,18 @@ type WorkspaceSettingsClientDeleteResponse struct { // WorkspaceSettingsClientGetResponse contains the response from method WorkspaceSettingsClient.Get. type WorkspaceSettingsClientGetResponse struct { + // Configures where to store the OMS agent data for workspaces under a scope WorkspaceSetting } // WorkspaceSettingsClientListResponse contains the response from method WorkspaceSettingsClient.NewListPager. type WorkspaceSettingsClientListResponse struct { + // List of workspace settings response WorkspaceSettingList } // WorkspaceSettingsClientUpdateResponse contains the response from method WorkspaceSettingsClient.Update. type WorkspaceSettingsClientUpdateResponse struct { + // Configures where to store the OMS agent data for workspaces under a scope WorkspaceSetting } diff --git a/sdk/resourcemanager/security/armsecurity/securescorecontroldefinitions_client.go b/sdk/resourcemanager/security/armsecurity/securescorecontroldefinitions_client.go index 7e7bd0cce743..ad6399a8ca09 100644 --- a/sdk/resourcemanager/security/armsecurity/securescorecontroldefinitions_client.go +++ b/sdk/resourcemanager/security/armsecurity/securescorecontroldefinitions_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity 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 e01712f5abf0..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 a0410c68e37c..9a493979d4d8 100644 --- a/sdk/resourcemanager/security/armsecurity/securescorecontrols_client.go +++ b/sdk/resourcemanager/security/armsecurity/securescorecontrols_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity 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 d5abf7bbb677..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 e2bad3ca5e7e..32f0f5bbe6a4 100644 --- a/sdk/resourcemanager/security/armsecurity/securescores_client.go +++ b/sdk/resourcemanager/security/armsecurity/securescores_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -52,18 +51,21 @@ func NewSecureScoresClient(subscriptionID string, credential azcore.TokenCredent // - secureScoreName - The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below. // - options - SecureScoresClientGetOptions contains the optional parameters for the SecureScoresClient.Get method. func (client *SecureScoresClient) Get(ctx context.Context, secureScoreName string, options *SecureScoresClientGetOptions) (SecureScoresClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, secureScoreName, options) if err != nil { return SecureScoresClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SecureScoresClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SecureScoresClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SecureScoresClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 6655a28baae9..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 60ae6cd8d5dd..7df1dcabf910 100644 --- a/sdk/resourcemanager/security/armsecurity/sensitivitysettings_client.go +++ b/sdk/resourcemanager/security/armsecurity/sensitivitysettings_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -45,18 +44,21 @@ func NewSensitivitySettingsClient(credential azcore.TokenCredential, options *ar // - options - SensitivitySettingsClientListOptions contains the optional parameters for the SensitivitySettingsClient.List // method. func (client *SensitivitySettingsClient) List(ctx context.Context, options *SensitivitySettingsClientListOptions) (SensitivitySettingsClientListResponse, error) { + var err error req, err := client.listCreateRequest(ctx, options) if err != nil { return SensitivitySettingsClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SensitivitySettingsClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SensitivitySettingsClientListResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SensitivitySettingsClientListResponse{}, err } - return client.listHandleResponse(resp) + resp, err := client.listHandleResponse(httpResp) + return resp, err } // listCreateRequest creates the List request. 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 d60fd0efda41..000000000000 --- a/sdk/resourcemanager/security/armsecurity/sensitivitysettings_client_example_test.go +++ /dev/null @@ -1,110 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package armsecurity_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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 d6a3372858b7..548c2eec73df 100644 --- a/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessment_client.go +++ b/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessment_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -56,18 +55,21 @@ func NewServerVulnerabilityAssessmentClient(subscriptionID string, credential az // - options - ServerVulnerabilityAssessmentClientCreateOrUpdateOptions contains the optional parameters for the ServerVulnerabilityAssessmentClient.CreateOrUpdate // method. func (client *ServerVulnerabilityAssessmentClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, options *ServerVulnerabilityAssessmentClientCreateOrUpdateOptions) (ServerVulnerabilityAssessmentClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, options) if err != nil { return ServerVulnerabilityAssessmentClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServerVulnerabilityAssessmentClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return ServerVulnerabilityAssessmentClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return ServerVulnerabilityAssessmentClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -130,9 +132,10 @@ func (client *ServerVulnerabilityAssessmentClient) BeginDelete(ctx context.Conte if err != nil { return nil, err } - return runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServerVulnerabilityAssessmentClientDeleteResponse]{ + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[ServerVulnerabilityAssessmentClientDeleteResponse]{ FinalStateVia: runtime.FinalStateViaLocation, }) + return poller, err } else { return runtime.NewPollerFromResumeToken[ServerVulnerabilityAssessmentClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -143,18 +146,20 @@ func (client *ServerVulnerabilityAssessmentClient) BeginDelete(ctx context.Conte // // Generated from API version 2020-01-01 func (client *ServerVulnerabilityAssessmentClient) deleteOperation(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, options *ServerVulnerabilityAssessmentClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -203,18 +208,21 @@ func (client *ServerVulnerabilityAssessmentClient) deleteCreateRequest(ctx conte // - options - ServerVulnerabilityAssessmentClientGetOptions contains the optional parameters for the ServerVulnerabilityAssessmentClient.Get // method. func (client *ServerVulnerabilityAssessmentClient) Get(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, options *ServerVulnerabilityAssessmentClientGetOptions) (ServerVulnerabilityAssessmentClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, options) if err != nil { return ServerVulnerabilityAssessmentClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServerVulnerabilityAssessmentClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerVulnerabilityAssessmentClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerVulnerabilityAssessmentClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -272,18 +280,21 @@ func (client *ServerVulnerabilityAssessmentClient) getHandleResponse(resp *http. // - options - ServerVulnerabilityAssessmentClientListByExtendedResourceOptions contains the optional parameters for the ServerVulnerabilityAssessmentClient.ListByExtendedResource // method. func (client *ServerVulnerabilityAssessmentClient) ListByExtendedResource(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, options *ServerVulnerabilityAssessmentClientListByExtendedResourceOptions) (ServerVulnerabilityAssessmentClientListByExtendedResourceResponse, error) { + var err error req, err := client.listByExtendedResourceCreateRequest(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, options) if err != nil { return ServerVulnerabilityAssessmentClientListByExtendedResourceResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ServerVulnerabilityAssessmentClientListByExtendedResourceResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerVulnerabilityAssessmentClientListByExtendedResourceResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerVulnerabilityAssessmentClientListByExtendedResourceResponse{}, err } - return client.listByExtendedResourceHandleResponse(resp) + resp, err := client.listByExtendedResourceHandleResponse(httpResp) + return resp, err } // listByExtendedResourceCreateRequest creates the ListByExtendedResource request. 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 751fcd1ae3cb..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 new file mode 100644 index 000000000000..b9abe5a64b45 --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessmentssettings_client.go @@ -0,0 +1,267 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights 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" +) + +// ServerVulnerabilityAssessmentsSettingsClient contains the methods for the ServerVulnerabilityAssessmentsSettings group. +// Don't use this type directly, use NewServerVulnerabilityAssessmentsSettingsClient() instead. +type ServerVulnerabilityAssessmentsSettingsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewServerVulnerabilityAssessmentsSettingsClient creates a new instance of ServerVulnerabilityAssessmentsSettingsClient 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 NewServerVulnerabilityAssessmentsSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerVulnerabilityAssessmentsSettingsClient, error) { + cl, err := arm.NewClient(moduleName+".ServerVulnerabilityAssessmentsSettingsClient", moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &ServerVulnerabilityAssessmentsSettingsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// CreateOrUpdate - Create or update a server vulnerability assessments setting of the requested kind on the subscription +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - settingKind - The kind of the server vulnerability assessments setting +// - serverVulnerabilityAssessmentsSetting - A server vulnerability assessments setting over a predefined scope +// - options - ServerVulnerabilityAssessmentsSettingsClientCreateOrUpdateOptions contains the optional parameters for the ServerVulnerabilityAssessmentsSettingsClient.CreateOrUpdate +// method. +func (client *ServerVulnerabilityAssessmentsSettingsClient) CreateOrUpdate(ctx context.Context, settingKind ServerVulnerabilityAssessmentsSettingKindName, serverVulnerabilityAssessmentsSetting ServerVulnerabilityAssessmentsSettingClassification, options *ServerVulnerabilityAssessmentsSettingsClientCreateOrUpdateOptions) (ServerVulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse, error) { + var err error + req, err := client.createOrUpdateCreateRequest(ctx, settingKind, serverVulnerabilityAssessmentsSetting, options) + if err != nil { + return ServerVulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServerVulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return ServerVulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse{}, err + } + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ServerVulnerabilityAssessmentsSettingsClient) createOrUpdateCreateRequest(ctx context.Context, settingKind ServerVulnerabilityAssessmentsSettingKindName, serverVulnerabilityAssessmentsSetting ServerVulnerabilityAssessmentsSettingClassification, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if settingKind == "" { + return nil, errors.New("parameter settingKind cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{settingKind}", url.PathEscape(string(settingKind))) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, serverVulnerabilityAssessmentsSetting); err != nil { + return nil, err + } + return req, nil +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *ServerVulnerabilityAssessmentsSettingsClient) createOrUpdateHandleResponse(resp *http.Response) (ServerVulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse, error) { + result := ServerVulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { + return ServerVulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Delete the server vulnerability assessments setting of the requested kind from the subscription +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - settingKind - The kind of the server vulnerability assessments setting +// - options - ServerVulnerabilityAssessmentsSettingsClientDeleteOptions contains the optional parameters for the ServerVulnerabilityAssessmentsSettingsClient.Delete +// method. +func (client *ServerVulnerabilityAssessmentsSettingsClient) Delete(ctx context.Context, settingKind ServerVulnerabilityAssessmentsSettingKindName, options *ServerVulnerabilityAssessmentsSettingsClientDeleteOptions) (ServerVulnerabilityAssessmentsSettingsClientDeleteResponse, error) { + var err error + req, err := client.deleteCreateRequest(ctx, settingKind, options) + if err != nil { + return ServerVulnerabilityAssessmentsSettingsClientDeleteResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServerVulnerabilityAssessmentsSettingsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ServerVulnerabilityAssessmentsSettingsClientDeleteResponse{}, err + } + return ServerVulnerabilityAssessmentsSettingsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ServerVulnerabilityAssessmentsSettingsClient) deleteCreateRequest(ctx context.Context, settingKind ServerVulnerabilityAssessmentsSettingKindName, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if settingKind == "" { + return nil, errors.New("parameter settingKind cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{settingKind}", url.PathEscape(string(settingKind))) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get a server vulnerability assessments setting of the requested kind, that is set on the subscription +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-05-01 +// - settingKind - The kind of the server vulnerability assessments setting +// - options - ServerVulnerabilityAssessmentsSettingsClientGetOptions contains the optional parameters for the ServerVulnerabilityAssessmentsSettingsClient.Get +// method. +func (client *ServerVulnerabilityAssessmentsSettingsClient) Get(ctx context.Context, settingKind ServerVulnerabilityAssessmentsSettingKindName, options *ServerVulnerabilityAssessmentsSettingsClientGetOptions) (ServerVulnerabilityAssessmentsSettingsClientGetResponse, error) { + var err error + req, err := client.getCreateRequest(ctx, settingKind, options) + if err != nil { + return ServerVulnerabilityAssessmentsSettingsClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServerVulnerabilityAssessmentsSettingsClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ServerVulnerabilityAssessmentsSettingsClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *ServerVulnerabilityAssessmentsSettingsClient) getCreateRequest(ctx context.Context, settingKind ServerVulnerabilityAssessmentsSettingKindName, options *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") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if settingKind == "" { + return nil, errors.New("parameter settingKind cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{settingKind}", url.PathEscape(string(settingKind))) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ServerVulnerabilityAssessmentsSettingsClient) getHandleResponse(resp *http.Response) (ServerVulnerabilityAssessmentsSettingsClientGetResponse, error) { + result := ServerVulnerabilityAssessmentsSettingsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result); err != nil { + return ServerVulnerabilityAssessmentsSettingsClientGetResponse{}, err + } + return result, nil +} + +// NewListBySubscriptionPager - Get a list of all the server vulnerability assessments settings over a subscription level +// scope +// +// Generated from API version 2023-05-01 +// - options - ServerVulnerabilityAssessmentsSettingsClientListBySubscriptionOptions contains the optional parameters for the +// ServerVulnerabilityAssessmentsSettingsClient.NewListBySubscriptionPager method. +func (client *ServerVulnerabilityAssessmentsSettingsClient) NewListBySubscriptionPager(options *ServerVulnerabilityAssessmentsSettingsClientListBySubscriptionOptions) *runtime.Pager[ServerVulnerabilityAssessmentsSettingsClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PagingHandler[ServerVulnerabilityAssessmentsSettingsClientListBySubscriptionResponse]{ + More: func(page ServerVulnerabilityAssessmentsSettingsClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ServerVulnerabilityAssessmentsSettingsClientListBySubscriptionResponse) (ServerVulnerabilityAssessmentsSettingsClientListBySubscriptionResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySubscriptionCreateRequest(ctx, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ServerVulnerabilityAssessmentsSettingsClientListBySubscriptionResponse{}, err + } + resp, err := client.internal.Pipeline().Do(req) + if err != nil { + return ServerVulnerabilityAssessmentsSettingsClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ServerVulnerabilityAssessmentsSettingsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) + }, + }) +} + +// listBySubscriptionCreateRequest creates the ListBySubscription request. +func (client *ServerVulnerabilityAssessmentsSettingsClient) listBySubscriptionCreateRequest(ctx context.Context, options *ServerVulnerabilityAssessmentsSettingsClientListBySubscriptionOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/serverVulnerabilityAssessmentsSettings" + 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", "2023-05-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySubscriptionHandleResponse handles the ListBySubscription response. +func (client *ServerVulnerabilityAssessmentsSettingsClient) listBySubscriptionHandleResponse(resp *http.Response) (ServerVulnerabilityAssessmentsSettingsClientListBySubscriptionResponse, error) { + result := ServerVulnerabilityAssessmentsSettingsClientListBySubscriptionResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServerVulnerabilityAssessmentsSettingsList); err != nil { + return ServerVulnerabilityAssessmentsSettingsClientListBySubscriptionResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/settings_client.go b/sdk/resourcemanager/security/armsecurity/settings_client.go index 860e77207af2..735f1e2e0d09 100644 --- a/sdk/resourcemanager/security/armsecurity/settings_client.go +++ b/sdk/resourcemanager/security/armsecurity/settings_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -51,18 +50,21 @@ func NewSettingsClient(subscriptionID string, credential azcore.TokenCredential, // - 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 SettingName, options *SettingsClientGetOptions) (SettingsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, settingName, options) if err != nil { return SettingsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SettingsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SettingsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SettingsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -163,18 +165,21 @@ func (client *SettingsClient) listHandleResponse(resp *http.Response) (SettingsC // - setting - Setting object // - options - SettingsClientUpdateOptions contains the optional parameters for the SettingsClient.Update method. func (client *SettingsClient) Update(ctx context.Context, settingName SettingName, setting SettingClassification, options *SettingsClientUpdateOptions) (SettingsClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, settingName, setting, options) if err != nil { return SettingsClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SettingsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SettingsClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SettingsClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -196,7 +201,10 @@ func (client *SettingsClient) updateCreateRequest(ctx context.Context, settingNa reqQP.Set("api-version", "2022-05-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, setting) + if err := runtime.MarshalAsJSON(req, setting); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. 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 0bb810e20ae8..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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.SettingNameWDATP, 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/e716082ac474f182e2220e4f38f1d6191e7636cf/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.SettingNameWDATP, &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 a7211b312239..65685b0a003c 100644 --- a/sdk/resourcemanager/security/armsecurity/softwareinventories_client.go +++ b/sdk/resourcemanager/security/armsecurity/softwareinventories_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -55,18 +54,21 @@ func NewSoftwareInventoriesClient(subscriptionID string, credential azcore.Token // - softwareName - Name of the installed software. // - options - SoftwareInventoriesClientGetOptions contains the optional parameters for the SoftwareInventoriesClient.Get method. func (client *SoftwareInventoriesClient) Get(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, softwareName string, options *SoftwareInventoriesClientGetOptions) (SoftwareInventoriesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName, options) if err != nil { return SoftwareInventoriesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SoftwareInventoriesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SoftwareInventoriesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SoftwareInventoriesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 f8e2a854acae..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 acda20886458..7e6afe3f1916 100644 --- a/sdk/resourcemanager/security/armsecurity/solutions_client.go +++ b/sdk/resourcemanager/security/armsecurity/solutions_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -53,18 +52,21 @@ func NewSolutionsClient(subscriptionID string, credential azcore.TokenCredential // - securitySolutionName - Name of security solution. // - options - SolutionsClientGetOptions contains the optional parameters for the SolutionsClient.Get method. func (client *SolutionsClient) Get(ctx context.Context, resourceGroupName string, ascLocation string, securitySolutionName string, options *SolutionsClientGetOptions) (SolutionsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, ascLocation, securitySolutionName, options) if err != nil { return SolutionsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SolutionsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SolutionsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SolutionsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 e81e47d06f83..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 751a959fa8eb..04d9355e30f1 100644 --- a/sdk/resourcemanager/security/armsecurity/solutionsreferencedata_client.go +++ b/sdk/resourcemanager/security/armsecurity/solutionsreferencedata_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -51,18 +50,21 @@ func NewSolutionsReferenceDataClient(subscriptionID string, credential azcore.To // - options - SolutionsReferenceDataClientListOptions contains the optional parameters for the SolutionsReferenceDataClient.List // method. func (client *SolutionsReferenceDataClient) List(ctx context.Context, options *SolutionsReferenceDataClientListOptions) (SolutionsReferenceDataClientListResponse, error) { + var err error req, err := client.listCreateRequest(ctx, options) if err != nil { return SolutionsReferenceDataClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SolutionsReferenceDataClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SolutionsReferenceDataClientListResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SolutionsReferenceDataClientListResponse{}, err } - return client.listHandleResponse(resp) + resp, err := client.listHandleResponse(httpResp) + return resp, err } // listCreateRequest creates the List request. @@ -100,18 +102,21 @@ func (client *SolutionsReferenceDataClient) listHandleResponse(resp *http.Respon // - options - SolutionsReferenceDataClientListByHomeRegionOptions contains the optional parameters for the SolutionsReferenceDataClient.ListByHomeRegion // method. func (client *SolutionsReferenceDataClient) ListByHomeRegion(ctx context.Context, ascLocation string, options *SolutionsReferenceDataClientListByHomeRegionOptions) (SolutionsReferenceDataClientListByHomeRegionResponse, error) { + var err error req, err := client.listByHomeRegionCreateRequest(ctx, ascLocation, options) if err != nil { return SolutionsReferenceDataClientListByHomeRegionResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SolutionsReferenceDataClientListByHomeRegionResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SolutionsReferenceDataClientListByHomeRegionResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SolutionsReferenceDataClientListByHomeRegionResponse{}, err } - return client.listByHomeRegionHandleResponse(resp) + resp, err := client.listByHomeRegionHandleResponse(httpResp) + return resp, err } // listByHomeRegionCreateRequest creates the ListByHomeRegion request. 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 d53ade8b8d12..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 a2e6df1c9587..8aa8186d4013 100644 --- a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentbaselinerules_client.go +++ b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentbaselinerules_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -50,18 +49,21 @@ func NewSQLVulnerabilityAssessmentBaselineRulesClient(credential azcore.TokenCre // - options - SQLVulnerabilityAssessmentBaselineRulesClientAddOptions contains the optional parameters for the SQLVulnerabilityAssessmentBaselineRulesClient.Add // method. func (client *SQLVulnerabilityAssessmentBaselineRulesClient) Add(ctx context.Context, workspaceID string, resourceID string, options *SQLVulnerabilityAssessmentBaselineRulesClientAddOptions) (SQLVulnerabilityAssessmentBaselineRulesClientAddResponse, error) { + var err error req, err := client.addCreateRequest(ctx, workspaceID, resourceID, options) if err != nil { return SQLVulnerabilityAssessmentBaselineRulesClientAddResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SQLVulnerabilityAssessmentBaselineRulesClientAddResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SQLVulnerabilityAssessmentBaselineRulesClientAddResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SQLVulnerabilityAssessmentBaselineRulesClientAddResponse{}, err } - return client.addHandleResponse(resp) + resp, err := client.addHandleResponse(httpResp) + return resp, err } // addCreateRequest creates the Add request. @@ -78,7 +80,10 @@ func (client *SQLVulnerabilityAssessmentBaselineRulesClient) addCreateRequest(ct req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { - return req, runtime.MarshalAsJSON(req, *options.Body) + if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { + return nil, err + } + return req, nil } return req, nil } @@ -102,18 +107,21 @@ func (client *SQLVulnerabilityAssessmentBaselineRulesClient) addHandleResponse(r // - options - SQLVulnerabilityAssessmentBaselineRulesClientCreateOrUpdateOptions contains the optional parameters for the SQLVulnerabilityAssessmentBaselineRulesClient.CreateOrUpdate // method. func (client *SQLVulnerabilityAssessmentBaselineRulesClient) CreateOrUpdate(ctx context.Context, ruleID string, workspaceID string, resourceID string, options *SQLVulnerabilityAssessmentBaselineRulesClientCreateOrUpdateOptions) (SQLVulnerabilityAssessmentBaselineRulesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, ruleID, workspaceID, resourceID, options) if err != nil { return SQLVulnerabilityAssessmentBaselineRulesClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SQLVulnerabilityAssessmentBaselineRulesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SQLVulnerabilityAssessmentBaselineRulesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SQLVulnerabilityAssessmentBaselineRulesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -134,7 +142,10 @@ func (client *SQLVulnerabilityAssessmentBaselineRulesClient) createOrUpdateCreat req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Body != nil { - return req, runtime.MarshalAsJSON(req, *options.Body) + if err := runtime.MarshalAsJSON(req, *options.Body); err != nil { + return nil, err + } + return req, nil } return req, nil } @@ -158,16 +169,18 @@ func (client *SQLVulnerabilityAssessmentBaselineRulesClient) createOrUpdateHandl // - options - SQLVulnerabilityAssessmentBaselineRulesClientDeleteOptions contains the optional parameters for the SQLVulnerabilityAssessmentBaselineRulesClient.Delete // method. func (client *SQLVulnerabilityAssessmentBaselineRulesClient) Delete(ctx context.Context, ruleID string, workspaceID string, resourceID string, options *SQLVulnerabilityAssessmentBaselineRulesClientDeleteOptions) (SQLVulnerabilityAssessmentBaselineRulesClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, ruleID, workspaceID, resourceID, options) if err != nil { return SQLVulnerabilityAssessmentBaselineRulesClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SQLVulnerabilityAssessmentBaselineRulesClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return SQLVulnerabilityAssessmentBaselineRulesClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return SQLVulnerabilityAssessmentBaselineRulesClientDeleteResponse{}, err } return SQLVulnerabilityAssessmentBaselineRulesClientDeleteResponse{}, nil } @@ -202,18 +215,21 @@ func (client *SQLVulnerabilityAssessmentBaselineRulesClient) deleteCreateRequest // - options - SQLVulnerabilityAssessmentBaselineRulesClientGetOptions contains the optional parameters for the SQLVulnerabilityAssessmentBaselineRulesClient.Get // method. func (client *SQLVulnerabilityAssessmentBaselineRulesClient) Get(ctx context.Context, ruleID string, workspaceID string, resourceID string, options *SQLVulnerabilityAssessmentBaselineRulesClientGetOptions) (SQLVulnerabilityAssessmentBaselineRulesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, ruleID, workspaceID, resourceID, options) if err != nil { return SQLVulnerabilityAssessmentBaselineRulesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SQLVulnerabilityAssessmentBaselineRulesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SQLVulnerabilityAssessmentBaselineRulesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SQLVulnerabilityAssessmentBaselineRulesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -254,18 +270,21 @@ func (client *SQLVulnerabilityAssessmentBaselineRulesClient) getHandleResponse(r // - options - SQLVulnerabilityAssessmentBaselineRulesClientListOptions contains the optional parameters for the SQLVulnerabilityAssessmentBaselineRulesClient.List // method. func (client *SQLVulnerabilityAssessmentBaselineRulesClient) List(ctx context.Context, workspaceID string, resourceID string, options *SQLVulnerabilityAssessmentBaselineRulesClientListOptions) (SQLVulnerabilityAssessmentBaselineRulesClientListResponse, error) { + var err error req, err := client.listCreateRequest(ctx, workspaceID, resourceID, options) if err != nil { return SQLVulnerabilityAssessmentBaselineRulesClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SQLVulnerabilityAssessmentBaselineRulesClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SQLVulnerabilityAssessmentBaselineRulesClientListResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SQLVulnerabilityAssessmentBaselineRulesClientListResponse{}, err } - return client.listHandleResponse(resp) + resp, err := client.listHandleResponse(httpResp) + return resp, err } // listCreateRequest creates the List request. 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 de40dd8bd46e..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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 22855d050c2f..b7c84e3ab8d2 100644 --- a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscanresults_client.go +++ b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscanresults_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -52,18 +51,21 @@ func NewSQLVulnerabilityAssessmentScanResultsClient(credential azcore.TokenCrede // - options - SQLVulnerabilityAssessmentScanResultsClientGetOptions contains the optional parameters for the SQLVulnerabilityAssessmentScanResultsClient.Get // method. func (client *SQLVulnerabilityAssessmentScanResultsClient) Get(ctx context.Context, scanID string, scanResultID string, workspaceID string, resourceID string, options *SQLVulnerabilityAssessmentScanResultsClientGetOptions) (SQLVulnerabilityAssessmentScanResultsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, scanID, scanResultID, workspaceID, resourceID, options) if err != nil { return SQLVulnerabilityAssessmentScanResultsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SQLVulnerabilityAssessmentScanResultsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SQLVulnerabilityAssessmentScanResultsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SQLVulnerabilityAssessmentScanResultsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -109,18 +111,21 @@ func (client *SQLVulnerabilityAssessmentScanResultsClient) getHandleResponse(res // - options - SQLVulnerabilityAssessmentScanResultsClientListOptions contains the optional parameters for the SQLVulnerabilityAssessmentScanResultsClient.List // method. func (client *SQLVulnerabilityAssessmentScanResultsClient) List(ctx context.Context, scanID string, workspaceID string, resourceID string, options *SQLVulnerabilityAssessmentScanResultsClientListOptions) (SQLVulnerabilityAssessmentScanResultsClientListResponse, error) { + var err error req, err := client.listCreateRequest(ctx, scanID, workspaceID, resourceID, options) if err != nil { return SQLVulnerabilityAssessmentScanResultsClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SQLVulnerabilityAssessmentScanResultsClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SQLVulnerabilityAssessmentScanResultsClientListResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SQLVulnerabilityAssessmentScanResultsClientListResponse{}, err } - return client.listHandleResponse(resp) + resp, err := client.listHandleResponse(httpResp) + return resp, err } // listCreateRequest creates the List request. 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 f6d73b40216e..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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.027771+00:00"); return t}()), - // }, - // ResultsNotInBaseline: [][]*string{ - // }, - // ResultsOnlyInBaseline: [][]*string{ - // }, - // Status: to.Ptr(armsecurity.RuleStatusNonFinding), - // }, - // IsTrimmed: to.Ptr(false), - // QueryResults: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // Remediation: &armsecurity.Remediation{ - // Description: to.Ptr("Remove server firewall rules that grant excessive access"), - // Automated: to.Ptr(false), - // PortalLink: to.Ptr("ReviewServerFirewallRules"), - // Scripts: []*string{ - // to.Ptr("EXECUTE sp_delete_firewall_rule N'Test';")}, - // }, - // RuleID: to.Ptr("VA2063"), - // RuleMetadata: &armsecurity.VaRule{ - // Description: to.Ptr("The Azure SQL server-level firewall helps protect your server by preventing all access to your databases until you specify which IP addresses have permission. Server-level firewall rules grant access to all databases that belong to the server based on the originating IP address of each request.\n\nServer-level firewall rules can only be created and managed through Transact-SQL as well as through the Azure portal or PowerShell. For more details please see: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-firewall-configure\n\nThis check verifies that server-level firewall rules do not grant excessive access."), - // BenchmarkReferences: []*armsecurity.BenchmarkReference{ - // }, - // Category: to.Ptr("SurfaceAreaReduction"), - // QueryCheck: &armsecurity.QueryCheck{ - // ColumnNames: []*string{ - // to.Ptr("Firewall Rule Name"), - // to.Ptr("Start Address"), - // to.Ptr("End Address")}, - // ExpectedResult: [][]*string{ - // }, - // Query: to.Ptr("SELECT name\n ,start_ip_address\n ,end_ip_address\nFROM sys.firewall_rules\nWHERE ( \n (CONVERT(bigint, parsename(end_ip_address, 1)) +\n CONVERT(bigint, parsename(end_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(end_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(end_ip_address, 4)) * 16777216 ) \n - \n (CONVERT(bigint, parsename(start_ip_address, 1)) +\n CONVERT(bigint, parsename(start_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(start_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(start_ip_address, 4)) * 16777216 )\n ) > 255;"), - // }, - // Rationale: to.Ptr("Often, administrators add rules that grant excessive access as part of a troubleshooting process � to eliminate the firewall as the source of a problem, they simply create a rule that allows all traffic to pass to the affected server.\n\nGranting excessive access using server firewall rules is a clear security concern, as it violates the principle of least privilege by allowing unnecessary access to your databases. In fact, it's the equivalent of placing the server outside of the firewall."), - // RuleID: to.Ptr("VA2063"), - // RuleType: to.Ptr(armsecurity.RuleTypeNegativeList), - // Severity: to.Ptr(armsecurity.RuleSeverityHigh), - // Title: to.Ptr("Server-level firewall rules should not grant excessive access"), - // }, - // Status: to.Ptr(armsecurity.RuleStatusFinding), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/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.027771+00:00"); return t}()), - // }, - // ResultsNotInBaseline: [][]*string{ - // }, - // ResultsOnlyInBaseline: [][]*string{ - // }, - // Status: to.Ptr(armsecurity.RuleStatusNonFinding), - // }, - // IsTrimmed: to.Ptr(false), - // QueryResults: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // Remediation: &armsecurity.Remediation{ - // Description: to.Ptr("Remove server firewall rules that grant excessive access"), - // Automated: to.Ptr(false), - // PortalLink: to.Ptr("ReviewServerFirewallRules"), - // Scripts: []*string{ - // to.Ptr("EXECUTE sp_delete_firewall_rule N'Test';")}, - // }, - // RuleID: to.Ptr("VA2063"), - // RuleMetadata: &armsecurity.VaRule{ - // Description: to.Ptr("The Azure SQL server-level firewall helps protect your server by preventing all access to your databases until you specify which IP addresses have permission. Server-level firewall rules grant access to all databases that belong to the server based on the originating IP address of each request.\n\nServer-level firewall rules can only be created and managed through Transact-SQL as well as through the Azure portal or PowerShell. For more details please see: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-firewall-configure\n\nThis check verifies that server-level firewall rules do not grant excessive access."), - // BenchmarkReferences: []*armsecurity.BenchmarkReference{ - // }, - // Category: to.Ptr("SurfaceAreaReduction"), - // QueryCheck: &armsecurity.QueryCheck{ - // ColumnNames: []*string{ - // to.Ptr("Firewall Rule Name"), - // to.Ptr("Start Address"), - // to.Ptr("End Address")}, - // ExpectedResult: [][]*string{ - // }, - // Query: to.Ptr("SELECT name\n ,start_ip_address\n ,end_ip_address\nFROM sys.firewall_rules\nWHERE ( \n (CONVERT(bigint, parsename(end_ip_address, 1)) +\n CONVERT(bigint, parsename(end_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(end_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(end_ip_address, 4)) * 16777216 ) \n - \n (CONVERT(bigint, parsename(start_ip_address, 1)) +\n CONVERT(bigint, parsename(start_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(start_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(start_ip_address, 4)) * 16777216 )\n ) > 255;"), - // }, - // Rationale: to.Ptr("Often, administrators add rules that grant excessive access as part of a troubleshooting process � to eliminate the firewall as the source of a problem, they simply create a rule that allows all traffic to pass to the affected server.\n\nGranting excessive access using server firewall rules is a clear security concern, as it violates the principle of least privilege by allowing unnecessary access to your databases. In fact, it's the equivalent of placing the server outside of the firewall."), - // RuleID: to.Ptr("VA2063"), - // RuleType: to.Ptr(armsecurity.RuleTypeNegativeList), - // Severity: to.Ptr(armsecurity.RuleSeverityHigh), - // Title: to.Ptr("Server-level firewall rules should not grant excessive access"), - // }, - // Status: to.Ptr(armsecurity.RuleStatusFinding), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/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.027771+00:00"); return t}()), - // }, - // ResultsNotInBaseline: [][]*string{ - // }, - // ResultsOnlyInBaseline: [][]*string{ - // }, - // Status: to.Ptr(armsecurity.RuleStatusNonFinding), - // }, - // IsTrimmed: to.Ptr(false), - // QueryResults: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // Remediation: &armsecurity.Remediation{ - // Description: to.Ptr("Remove server firewall rules that grant excessive access"), - // Automated: to.Ptr(false), - // PortalLink: to.Ptr("ReviewServerFirewallRules"), - // Scripts: []*string{ - // to.Ptr("EXECUTE sp_delete_firewall_rule N'Test';")}, - // }, - // RuleID: to.Ptr("VA2063"), - // RuleMetadata: &armsecurity.VaRule{ - // Description: to.Ptr("The Azure SQL server-level firewall helps protect your server by preventing all access to your databases until you specify which IP addresses have permission. Server-level firewall rules grant access to all databases that belong to the server based on the originating IP address of each request.\n\nServer-level firewall rules can only be created and managed through Transact-SQL as well as through the Azure portal or PowerShell. For more details please see: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-firewall-configure\n\nThis check verifies that server-level firewall rules do not grant excessive access."), - // BenchmarkReferences: []*armsecurity.BenchmarkReference{ - // }, - // Category: to.Ptr("SurfaceAreaReduction"), - // QueryCheck: &armsecurity.QueryCheck{ - // ColumnNames: []*string{ - // to.Ptr("Firewall Rule Name"), - // to.Ptr("Start Address"), - // to.Ptr("End Address")}, - // ExpectedResult: [][]*string{ - // }, - // Query: to.Ptr("SELECT name\n ,start_ip_address\n ,end_ip_address\nFROM sys.firewall_rules\nWHERE ( \n (CONVERT(bigint, parsename(end_ip_address, 1)) +\n CONVERT(bigint, parsename(end_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(end_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(end_ip_address, 4)) * 16777216 ) \n - \n (CONVERT(bigint, parsename(start_ip_address, 1)) +\n CONVERT(bigint, parsename(start_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(start_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(start_ip_address, 4)) * 16777216 )\n ) > 255;"), - // }, - // Rationale: to.Ptr("Often, administrators add rules that grant excessive access as part of a troubleshooting process � to eliminate the firewall as the source of a problem, they simply create a rule that allows all traffic to pass to the affected server.\n\nGranting excessive access using server firewall rules is a clear security concern, as it violates the principle of least privilege by allowing unnecessary access to your databases. In fact, it's the equivalent of placing the server outside of the firewall."), - // RuleID: to.Ptr("VA2063"), - // RuleType: to.Ptr(armsecurity.RuleTypeNegativeList), - // Severity: to.Ptr(armsecurity.RuleSeverityHigh), - // Title: to.Ptr("Server-level firewall rules should not grant excessive access"), - // }, - // Status: to.Ptr(armsecurity.RuleStatusFinding), - // }, - // }}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/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.027771+00:00"); return t}()), - // }, - // ResultsNotInBaseline: [][]*string{ - // }, - // ResultsOnlyInBaseline: [][]*string{ - // }, - // Status: to.Ptr(armsecurity.RuleStatusNonFinding), - // }, - // IsTrimmed: to.Ptr(false), - // QueryResults: [][]*string{ - // []*string{ - // to.Ptr("Test"), - // to.Ptr("0.0.0.0"), - // to.Ptr("125.125.125.125")}}, - // Remediation: &armsecurity.Remediation{ - // Description: to.Ptr("Remove server firewall rules that grant excessive access"), - // Automated: to.Ptr(false), - // PortalLink: to.Ptr("ReviewServerFirewallRules"), - // Scripts: []*string{ - // to.Ptr("EXECUTE sp_delete_firewall_rule N'Test';")}, - // }, - // RuleID: to.Ptr("VA2063"), - // RuleMetadata: &armsecurity.VaRule{ - // Description: to.Ptr("The Azure SQL server-level firewall helps protect your server by preventing all access to your databases until you specify which IP addresses have permission. Server-level firewall rules grant access to all databases that belong to the server based on the originating IP address of each request.\n\nServer-level firewall rules can only be created and managed through Transact-SQL as well as through the Azure portal or PowerShell. For more details please see: https://docs.microsoft.com/en-us/azure/sql-database/sql-database-firewall-configure\n\nThis check verifies that server-level firewall rules do not grant excessive access."), - // BenchmarkReferences: []*armsecurity.BenchmarkReference{ - // }, - // Category: to.Ptr("SurfaceAreaReduction"), - // QueryCheck: &armsecurity.QueryCheck{ - // ColumnNames: []*string{ - // to.Ptr("Firewall Rule Name"), - // to.Ptr("Start Address"), - // to.Ptr("End Address")}, - // ExpectedResult: [][]*string{ - // }, - // Query: to.Ptr("SELECT name\n ,start_ip_address\n ,end_ip_address\nFROM sys.firewall_rules\nWHERE ( \n (CONVERT(bigint, parsename(end_ip_address, 1)) +\n CONVERT(bigint, parsename(end_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(end_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(end_ip_address, 4)) * 16777216 ) \n - \n (CONVERT(bigint, parsename(start_ip_address, 1)) +\n CONVERT(bigint, parsename(start_ip_address, 2)) * 256 + \n CONVERT(bigint, parsename(start_ip_address, 3)) * 65536 + \n CONVERT(bigint, parsename(start_ip_address, 4)) * 16777216 )\n ) > 255;"), - // }, - // Rationale: to.Ptr("Often, administrators add rules that grant excessive access as part of a troubleshooting process � to eliminate the firewall as the source of a problem, they simply create a rule that allows all traffic to pass to the affected server.\n\nGranting excessive access using server firewall rules is a clear security concern, as it violates the principle of least privilege by allowing unnecessary access to your databases. In fact, it's the equivalent of placing the server outside of the firewall."), - // RuleID: to.Ptr("VA2063"), - // RuleType: to.Ptr(armsecurity.RuleTypeNegativeList), - // Severity: to.Ptr(armsecurity.RuleSeverityHigh), - // Title: to.Ptr("Server-level firewall rules should not grant excessive access"), - // }, - // Status: to.Ptr(armsecurity.RuleStatusFinding), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client.go b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client.go index 94d0329fa054..cfe7290e2115 100644 --- a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client.go +++ b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -51,18 +50,21 @@ func NewSQLVulnerabilityAssessmentScansClient(credential azcore.TokenCredential, // - options - SQLVulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the SQLVulnerabilityAssessmentScansClient.Get // method. func (client *SQLVulnerabilityAssessmentScansClient) Get(ctx context.Context, scanID string, workspaceID string, resourceID string, options *SQLVulnerabilityAssessmentScansClientGetOptions) (SQLVulnerabilityAssessmentScansClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, scanID, workspaceID, resourceID, options) if err != nil { return SQLVulnerabilityAssessmentScansClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SQLVulnerabilityAssessmentScansClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SQLVulnerabilityAssessmentScansClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SQLVulnerabilityAssessmentScansClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -103,18 +105,21 @@ func (client *SQLVulnerabilityAssessmentScansClient) getHandleResponse(resp *htt // - options - SQLVulnerabilityAssessmentScansClientListOptions contains the optional parameters for the SQLVulnerabilityAssessmentScansClient.List // method. func (client *SQLVulnerabilityAssessmentScansClient) List(ctx context.Context, workspaceID string, resourceID string, options *SQLVulnerabilityAssessmentScansClientListOptions) (SQLVulnerabilityAssessmentScansClientListResponse, error) { + var err error req, err := client.listCreateRequest(ctx, workspaceID, resourceID, options) if err != nil { return SQLVulnerabilityAssessmentScansClientListResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SQLVulnerabilityAssessmentScansClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SQLVulnerabilityAssessmentScansClientListResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SQLVulnerabilityAssessmentScansClientListResponse{}, err } - return client.listHandleResponse(resp) + resp, err := client.listHandleResponse(httpResp) + return resp, err } // listCreateRequest creates the List request. 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 7272c4351369..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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.7236217Z"); 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.6455136+00:00"); 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.6455136+00:00"); return t}()), - // State: to.Ptr(armsecurity.ScanStateFailed), - // TotalFailedRulesCount: to.Ptr[int32](6), - // TotalPassedRulesCount: to.Ptr[int32](20), - // TotalRulesCount: to.Ptr[int32](26), - // TriggerType: to.Ptr(armsecurity.ScanTriggerTypeRecurring), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/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.7236217Z"); 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.6455136+00:00"); 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.6455136+00:00"); return t}()), - // State: to.Ptr(armsecurity.ScanStateFailed), - // TotalFailedRulesCount: to.Ptr[int32](6), - // TotalPassedRulesCount: to.Ptr[int32](20), - // TotalRulesCount: to.Ptr[int32](26), - // TriggerType: to.Ptr(armsecurity.ScanTriggerTypeRecurring), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/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.8606151Z"); 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.6455136+00:00"); 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.1399864Z"); return t}()), - // State: to.Ptr(armsecurity.ScanStateFailed), - // TotalFailedRulesCount: to.Ptr[int32](6), - // TotalPassedRulesCount: to.Ptr[int32](20), - // TotalRulesCount: to.Ptr[int32](26), - // TriggerType: to.Ptr(armsecurity.ScanTriggerTypeRecurring), - // }, - // }, - // { - // Name: to.Ptr("scan_20200226_113429"), - // Type: to.Ptr("Microsoft.Security/sqlVulnerabilityAssessments/scans"), - // ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/scan_20200226_113429"), - // Properties: &armsecurity.ScanProperties{ - // Database: to.Ptr("master"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-26T11:38:07.8606151Z"); return t}()), - // HighSeverityFailedRulesCount: to.Ptr[int32](0), - // IsBaselineApplied: to.Ptr(true), - // LastScanTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-06-23T06:49:00.6455136+00:00"); 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.1399864Z"); return t}()), - // State: to.Ptr(armsecurity.ScanStatePassed), - // TotalFailedRulesCount: to.Ptr[int32](0), - // TotalPassedRulesCount: to.Ptr[int32](26), - // TotalRulesCount: to.Ptr[int32](26), - // TriggerType: to.Ptr(armsecurity.ScanTriggerTypeOnDemand), - // }, - // }}, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/subassessments_client.go b/sdk/resourcemanager/security/armsecurity/subassessments_client.go index 8a54db20fc4b..372db875cdc5 100644 --- a/sdk/resourcemanager/security/armsecurity/subassessments_client.go +++ b/sdk/resourcemanager/security/armsecurity/subassessments_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -51,18 +50,21 @@ func NewSubAssessmentsClient(credential azcore.TokenCredential, options *arm.Cli // - subAssessmentName - The Sub-Assessment Key - Unique key for the sub-assessment type // - options - SubAssessmentsClientGetOptions contains the optional parameters for the SubAssessmentsClient.Get method. func (client *SubAssessmentsClient) Get(ctx context.Context, scope string, assessmentName string, subAssessmentName string, options *SubAssessmentsClientGetOptions) (SubAssessmentsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, scope, assessmentName, subAssessmentName, options) if err != nil { return SubAssessmentsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SubAssessmentsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SubAssessmentsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SubAssessmentsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 3e64ae48e53a..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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/ListSubscriptionSubAssessments_example.json -func ExampleSubAssessmentsClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSubAssessmentsClient().NewListAllPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SubAssessmentList = armsecurity.SubAssessmentList{ - // Value: []*armsecurity.SubAssessment{ - // { - // Name: to.Ptr("8c98f353-8b41-4e77-979b-6adeecd5d168"), - // Type: to.Ptr("Microsoft.Security/assessments/subAssessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.ContainerRegistry/registries/myRegistry/providers/Microsoft.Security/assessments/dbd0cb49-b563-45e7-9724-889e799fa648/subAssessments/8c98f353-8b41-4e77-979b-6adeecd5d168"), - // Properties: &armsecurity.SubAssessmentProperties{ - // Description: to.Ptr("The backdoor 'Back Orifice' was detected on this system. The presence of this backdoor indicates that your system has already been compromised. Unauthorized users can access your host at any time. Unauthorized users can take complete control of the host and manipulate data. They can steal the data or even wipe out the host."), - // AdditionalData: &armsecurity.ContainerRegistryVulnerabilityProperties{ - // AssessedResourceType: to.Ptr(armsecurity.AssessedResourceTypeContainerRegistryVulnerability), - // Type: to.Ptr("Vulnerability"), - // Cve: []*armsecurity.CVE{ - // { - // Link: to.Ptr("http://contoso.com"), - // Title: to.Ptr("CVE-2019-12345"), - // }}, - // Cvss: map[string]*armsecurity.CVSS{ - // "2.0": &armsecurity.CVSS{ - // Base: to.Ptr[float32](10), - // }, - // "3.0": &armsecurity.CVSS{ - // Base: to.Ptr[float32](10), - // }, - // }, - // ImageDigest: to.Ptr("c186fc44-3154-4ce2-ba18-b719d895c3b0"), - // Patchable: to.Ptr(true), - // PublishedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-01T00:00:00.0000000Z"); return t}()), - // RepositoryName: to.Ptr("myRepo"), - // VendorReferences: []*armsecurity.VendorReference{ - // { - // Link: to.Ptr("http://contoso.com"), - // Title: to.Ptr("Reference_1"), - // }}, - // }, - // Category: to.Ptr("Backdoors and trojan horses"), - // DisplayName: to.Ptr("'Back Orifice' Backdoor"), - // ID: to.Ptr("1001"), - // Impact: to.Ptr("3"), - // Remediation: to.Ptr("Use a recent anti-virus program to remove this backdoor and check your system regularly with anti-virus software."), - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("repositories/asc/msi-connector/images/sha256:877a6f2a212c44021281f80cb1f4c73a09dce4e99a8cb8efcc03f7ce3c877a6f"), - // }, - // Status: &armsecurity.SubAssessmentStatus{ - // Description: to.Ptr("The resource is unhealthy"), - // Cause: to.Ptr(""), - // Code: to.Ptr(armsecurity.SubAssessmentStatusCodeUnhealthy), - // Severity: to.Ptr(armsecurity.SeverityHigh), - // }, - // TimeGenerated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-23T12:20:08.7644808Z"); return t}()), - // }, - // }, - // { - // Name: to.Ptr("8fbe5054-e97c-3a7a-fda7-c8308ca8d3cf"), - // Type: to.Ptr("Microsoft.Security/assessments/subAssessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/ascdemoRG/providers/Microsoft.Sql/servers/sqlserver1demo/providers/Microsoft.Security/assessments/82e20e14-edc5-4373-bfc4-f13121257c37/subassessments/8fbe5054-e97c-3a7a-fda7-c8308ca8d3cf"), - // Properties: &armsecurity.SubAssessmentProperties{ - // Description: to.Ptr("The Azure SQL Database-level firewall helps protect your data by preventing all access to your database until you specify which IP addresses have permission. Database-level firewall rules grant access to the specific database based on the originating IP address of each request.\n\nDatabase-level firewall rules for master"), - // AdditionalData: &armsecurity.SQLServerVulnerabilityProperties{ - // AssessedResourceType: to.Ptr(armsecurity.AssessedResourceTypeSQLServerVulnerability), - // Type: to.Ptr("AzureDatabase"), - // Query: to.Ptr("SELECT name\n ,start_ip_address\n ,end_ip_address\nFROM sys.database_firewall_rules"), - // }, - // Category: to.Ptr("SurfaceAreaReduction"), - // DisplayName: to.Ptr("Database-level firewall rules should be tracked and maintained at a strict minimum"), - // ID: to.Ptr("VA2064"), - // Impact: to.Ptr("Firewall rules should be strictly configured to allow access only to client computers that have a valid need to connect to the database. Any superfluous entries in the firewall may pose a threat by allowing an unauthorized source access to your database."), - // Remediation: to.Ptr("Evaluate each of the database-level firewall rules. Remove any rules that grant unnecessary access and set the rest as a baseline. Deviations from the baseline will be identified and brought to your attention in subsequent scans."), - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("/subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/ascdemoRG/providers/Microsoft.Sql/servers/sqlserver1demo/databases/database1"), - // }, - // Status: &armsecurity.SubAssessmentStatus{ - // Cause: to.Ptr("Unknown"), - // Code: to.Ptr(armsecurity.SubAssessmentStatusCodeHealthy), - // Severity: to.Ptr(armsecurity.SeverityHigh), - // }, - // TimeGenerated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-23T12:20:08.7644808Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/ListSubAssessments_example.json -func ExampleSubAssessmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewSubAssessmentsClient().NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "82e20e14-edc5-4373-bfc4-f13121257c37", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.SubAssessmentList = armsecurity.SubAssessmentList{ - // Value: []*armsecurity.SubAssessment{ - // { - // Name: to.Ptr("8fbe5054-e97c-3a7a-fda7-c8308ca8d3cf"), - // Type: to.Ptr("Microsoft.Security/assessments/subAssessments"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/ascdemoRG/providers/Microsoft.Sql/servers/sqlserver1demo/providers/Microsoft.Security/assessments/82e20e14-edc5-4373-bfc4-f13121257c37/subassessments/8fbe5054-e97c-3a7a-fda7-c8308ca8d3cf"), - // Properties: &armsecurity.SubAssessmentProperties{ - // Description: to.Ptr("The Azure SQL Database-level firewall helps protect your data by preventing all access to your database until you specify which IP addresses have permission. Database-level firewall rules grant access to the specific database based on the originating IP address of each request.\n\nDatabase-level firewall rules for master"), - // AdditionalData: &armsecurity.SQLServerVulnerabilityProperties{ - // AssessedResourceType: to.Ptr(armsecurity.AssessedResourceTypeSQLServerVulnerability), - // Type: to.Ptr("AzureDatabase"), - // Query: to.Ptr("SELECT name\n ,start_ip_address\n ,end_ip_address\nFROM sys.database_firewall_rules"), - // }, - // Category: to.Ptr("SurfaceAreaReduction"), - // DisplayName: to.Ptr("Database-level firewall rules should be tracked and maintained at a strict minimum"), - // ID: to.Ptr("VA2064"), - // Impact: to.Ptr("Firewall rules should be strictly configured to allow access only to client computers that have a valid need to connect to the database. Any superfluous entries in the firewall may pose a threat by allowing an unauthorized source access to your database."), - // Remediation: to.Ptr("Evaluate each of the database-level firewall rules. Remove any rules that grant unnecessary access and set the rest as a baseline. Deviations from the baseline will be identified and brought to your attention in subsequent scans."), - // ResourceDetails: &armsecurity.AzureResourceDetails{ - // Source: to.Ptr(armsecurity.SourceAzure), - // ID: to.Ptr("/subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/ascdemoRG/providers/Microsoft.Sql/servers/sqlserver1demo/databases/database1"), - // }, - // Status: &armsecurity.SubAssessmentStatus{ - // Cause: to.Ptr("Unknown"), - // Code: to.Ptr(armsecurity.SubAssessmentStatusCodeHealthy), - // Severity: to.Ptr(armsecurity.SeverityHigh), - // }, - // TimeGenerated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-06-23T12:20:08.7644808Z"); return t}()), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/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 40fb2c1b087a..3f5aacc7cf31 100644 --- a/sdk/resourcemanager/security/armsecurity/tasks_client.go +++ b/sdk/resourcemanager/security/armsecurity/tasks_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -54,18 +53,21 @@ func NewTasksClient(subscriptionID string, credential azcore.TokenCredential, op // - options - TasksClientGetResourceGroupLevelTaskOptions contains the optional parameters for the TasksClient.GetResourceGroupLevelTask // method. func (client *TasksClient) GetResourceGroupLevelTask(ctx context.Context, resourceGroupName string, ascLocation string, taskName string, options *TasksClientGetResourceGroupLevelTaskOptions) (TasksClientGetResourceGroupLevelTaskResponse, error) { + var err error req, err := client.getResourceGroupLevelTaskCreateRequest(ctx, resourceGroupName, ascLocation, taskName, options) if err != nil { return TasksClientGetResourceGroupLevelTaskResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TasksClientGetResourceGroupLevelTaskResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TasksClientGetResourceGroupLevelTaskResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TasksClientGetResourceGroupLevelTaskResponse{}, err } - return client.getResourceGroupLevelTaskHandleResponse(resp) + resp, err := client.getResourceGroupLevelTaskHandleResponse(httpResp) + return resp, err } // getResourceGroupLevelTaskCreateRequest creates the GetResourceGroupLevelTask request. @@ -116,18 +118,21 @@ func (client *TasksClient) getResourceGroupLevelTaskHandleResponse(resp *http.Re // - options - TasksClientGetSubscriptionLevelTaskOptions contains the optional parameters for the TasksClient.GetSubscriptionLevelTask // method. func (client *TasksClient) GetSubscriptionLevelTask(ctx context.Context, ascLocation string, taskName string, options *TasksClientGetSubscriptionLevelTaskOptions) (TasksClientGetSubscriptionLevelTaskResponse, error) { + var err error req, err := client.getSubscriptionLevelTaskCreateRequest(ctx, ascLocation, taskName, options) if err != nil { return TasksClientGetSubscriptionLevelTaskResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TasksClientGetSubscriptionLevelTaskResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TasksClientGetSubscriptionLevelTaskResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TasksClientGetSubscriptionLevelTaskResponse{}, err } - return client.getSubscriptionLevelTaskHandleResponse(resp) + resp, err := client.getSubscriptionLevelTaskHandleResponse(httpResp) + return resp, err } // getSubscriptionLevelTaskCreateRequest creates the GetSubscriptionLevelTask request. @@ -379,16 +384,18 @@ func (client *TasksClient) listByResourceGroupHandleResponse(resp *http.Response // - options - TasksClientUpdateResourceGroupLevelTaskStateOptions contains the optional parameters for the TasksClient.UpdateResourceGroupLevelTaskState // method. func (client *TasksClient) UpdateResourceGroupLevelTaskState(ctx context.Context, resourceGroupName string, ascLocation string, taskName string, taskUpdateActionType TaskUpdateActionType, options *TasksClientUpdateResourceGroupLevelTaskStateOptions) (TasksClientUpdateResourceGroupLevelTaskStateResponse, error) { + var err error req, err := client.updateResourceGroupLevelTaskStateCreateRequest(ctx, resourceGroupName, ascLocation, taskName, taskUpdateActionType, options) if err != nil { return TasksClientUpdateResourceGroupLevelTaskStateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TasksClientUpdateResourceGroupLevelTaskStateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return TasksClientUpdateResourceGroupLevelTaskStateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return TasksClientUpdateResourceGroupLevelTaskStateResponse{}, err } return TasksClientUpdateResourceGroupLevelTaskStateResponse{}, nil } @@ -437,16 +444,18 @@ func (client *TasksClient) updateResourceGroupLevelTaskStateCreateRequest(ctx co // - options - TasksClientUpdateSubscriptionLevelTaskStateOptions contains the optional parameters for the TasksClient.UpdateSubscriptionLevelTaskState // method. func (client *TasksClient) UpdateSubscriptionLevelTaskState(ctx context.Context, ascLocation string, taskName string, taskUpdateActionType TaskUpdateActionType, options *TasksClientUpdateSubscriptionLevelTaskStateOptions) (TasksClientUpdateSubscriptionLevelTaskStateResponse, error) { + var err error req, err := client.updateSubscriptionLevelTaskStateCreateRequest(ctx, ascLocation, taskName, taskUpdateActionType, options) if err != nil { return TasksClientUpdateSubscriptionLevelTaskStateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TasksClientUpdateSubscriptionLevelTaskStateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return TasksClientUpdateSubscriptionLevelTaskStateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return TasksClientUpdateSubscriptionLevelTaskStateResponse{}, err } return TasksClientUpdateSubscriptionLevelTaskStateResponse{}, nil } 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 9a8ef56299d5..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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTasksSubscription_example.json -func ExampleTasksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTasksClient().NewListPager(&armsecurity.TasksClientListOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TaskList = armsecurity.TaskList{ - // Value: []*armsecurity.Task{ - // { - // Name: to.Ptr("62609ee7-d0a5-8616-9fe4-1df5cca7758d"), - // Type: to.Ptr("Microsoft.Security/locations/tasks"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/westeurope/tasks/62609ee7-d0a5-8616-9fe4-1df5cca7758d"), - // Properties: &armsecurity.TaskProperties{ - // CreationTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-05T10:42:03.9935508Z"); return t}()), - // LastStateChangeTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-05T10:42:03.9935508Z"); return t}()), - // SecurityTaskParameters: &armsecurity.TaskParameters{ - // AdditionalProperties: map[string]any{ - // "location": "uksouth", - // "resourceGroup": "myRg", - // "resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/default", - // "resourceName": "default", - // "resourceParent": "vnet1", - // "resourceType": "Subnet", - // "uniqueKey": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/default", - // }, - // Name: to.Ptr("NetworkSecurityGroupMissingOnSubnet"), - // }, - // State: to.Ptr("Active"), - // SubState: to.Ptr("NA"), - // }, - // }, - // { - // Name: to.Ptr("d55b4dc0-779c-c66c-33e5-d7bce24c4222"), - // Type: to.Ptr("Microsoft.Security/locations/tasks"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Security/locations/westeurope/tasks/d55b4dc0-779c-c66c-33e5-d7bce24c4222"), - // Properties: &armsecurity.TaskProperties{ - // CreationTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-02T11:41:27.0541014Z"); return t}()), - // LastStateChangeTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-02T11:41:27.0541014Z"); return t}()), - // SecurityTaskParameters: &armsecurity.TaskParameters{ - // AdditionalProperties: map[string]any{ - // "isDataDiskEncrypted": false, - // "isOsDiskEncrypted": false, - // "resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "severity": "High", - // "uniqueKey": "EncryptionOnVmTaskParameters_/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "vmId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "vmName": "vm1", - // }, - // Name: to.Ptr("EncryptionOnVm"), - // }, - // State: to.Ptr("Active"), - // SubState: to.Ptr("NA"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTasksSubscriptionLocation_example.json -func ExampleTasksClient_NewListByHomeRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTasksClient().NewListByHomeRegionPager("westeurope", &armsecurity.TasksClientListByHomeRegionOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TaskList = armsecurity.TaskList{ - // Value: []*armsecurity.Task{ - // { - // Name: to.Ptr("62609ee7-d0a5-8616-9fe4-1df5cca7758d"), - // Type: to.Ptr("Microsoft.Security/locations/tasks"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/westeurope/tasks/62609ee7-d0a5-8616-9fe4-1df5cca7758d"), - // Properties: &armsecurity.TaskProperties{ - // CreationTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-05T10:42:03.9935508Z"); return t}()), - // LastStateChangeTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-05T10:42:03.9935508Z"); return t}()), - // SecurityTaskParameters: &armsecurity.TaskParameters{ - // AdditionalProperties: map[string]any{ - // "location": "uksouth", - // "resourceGroup": "myRg", - // "resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/default", - // "resourceName": "default", - // "resourceParent": "vnet1", - // "resourceType": "Subnet", - // "uniqueKey": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/default", - // }, - // Name: to.Ptr("NetworkSecurityGroupMissingOnSubnet"), - // }, - // State: to.Ptr("Active"), - // SubState: to.Ptr("NA"), - // }, - // }, - // { - // Name: to.Ptr("d55b4dc0-779c-c66c-33e5-d7bce24c4222"), - // Type: to.Ptr("Microsoft.Security/locations/tasks"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Security/locations/westeurope/tasks/d55b4dc0-779c-c66c-33e5-d7bce24c4222"), - // Properties: &armsecurity.TaskProperties{ - // CreationTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-02T11:41:27.0541014Z"); return t}()), - // LastStateChangeTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-02T11:41:27.0541014Z"); return t}()), - // SecurityTaskParameters: &armsecurity.TaskParameters{ - // AdditionalProperties: map[string]any{ - // "isDataDiskEncrypted": false, - // "isOsDiskEncrypted": false, - // "resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "severity": "High", - // "uniqueKey": "EncryptionOnVmTaskParameters_/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "vmId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "vmName": "vm1", - // }, - // Name: to.Ptr("EncryptionOnVm"), - // }, - // State: to.Ptr("Active"), - // SubState: to.Ptr("NA"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTaskSubscriptionLocation_example.json -func ExampleTasksClient_GetSubscriptionLevelTask() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTasksClient().GetSubscriptionLevelTask(ctx, "westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Task = armsecurity.Task{ - // Name: to.Ptr("62609ee7-d0a5-8616-9fe4-1df5cca7758d"), - // Type: to.Ptr("Microsoft.Security/locations/tasks"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/locations/westeurope/tasks/62609ee7-d0a5-8616-9fe4-1df5cca7758d"), - // Properties: &armsecurity.TaskProperties{ - // CreationTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-05T10:42:03.9935508Z"); return t}()), - // LastStateChangeTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-03-05T10:42:03.9935508Z"); return t}()), - // SecurityTaskParameters: &armsecurity.TaskParameters{ - // AdditionalProperties: map[string]any{ - // "location": "uksouth", - // "resourceGroup": "myRg", - // "resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/default", - // "resourceName": "default", - // "resourceParent": "vnet1", - // "resourceType": "Subnet", - // "uniqueKey": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/default", - // }, - // Name: to.Ptr("NetworkSecurityGroupMissingOnSubnet"), - // }, - // State: to.Ptr("Active"), - // SubState: to.Ptr("NA"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTasksResourceGroupLocation_example.json -func ExampleTasksClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTasksClient().NewListByResourceGroupPager("myRg", "westeurope", &armsecurity.TasksClientListByResourceGroupOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TaskList = armsecurity.TaskList{ - // Value: []*armsecurity.Task{ - // { - // Name: to.Ptr("d55b4dc0-779c-c66c-33e5-d7bce24c4222"), - // Type: to.Ptr("Microsoft.Security/locations/tasks"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Security/locations/westeurope/tasks/d55b4dc0-779c-c66c-33e5-d7bce24c4222"), - // Properties: &armsecurity.TaskProperties{ - // CreationTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-02T11:41:27.0541014Z"); return t}()), - // LastStateChangeTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-02T11:41:27.0541014Z"); return t}()), - // SecurityTaskParameters: &armsecurity.TaskParameters{ - // AdditionalProperties: map[string]any{ - // "isDataDiskEncrypted": false, - // "isOsDiskEncrypted": false, - // "resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "severity": "High", - // "uniqueKey": "EncryptionOnVmTaskParameters_/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "vmId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "vmName": "vm1", - // }, - // Name: to.Ptr("EncryptionOnVm"), - // }, - // State: to.Ptr("Active"), - // SubState: to.Ptr("NA"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTaskResourceGroupLocation_example.json -func ExampleTasksClient_GetResourceGroupLevelTask() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTasksClient().GetResourceGroupLevelTask(ctx, "myRg", "westeurope", "d55b4dc0-779c-c66c-33e5-d7bce24c4222", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Task = armsecurity.Task{ - // Name: to.Ptr("d55b4dc0-779c-c66c-33e5-d7bce24c4222"), - // Type: to.Ptr("Microsoft.Security/locations/tasks"), - // ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Security/locations/westeurope/tasks/d55b4dc0-779c-c66c-33e5-d7bce24c4222"), - // Properties: &armsecurity.TaskProperties{ - // CreationTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-02T11:41:27.0541014Z"); return t}()), - // LastStateChangeTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-04-02T11:41:27.0541014Z"); return t}()), - // SecurityTaskParameters: &armsecurity.TaskParameters{ - // AdditionalProperties: map[string]any{ - // "isDataDiskEncrypted": false, - // "isOsDiskEncrypted": false, - // "resourceId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "severity": "High", - // "uniqueKey": "EncryptionOnVmTaskParameters_/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "vmId": "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachines/vm1", - // "vmName": "vm1", - // }, - // Name: to.Ptr("EncryptionOnVm"), - // }, - // State: to.Ptr("Active"), - // SubState: to.Ptr("NA"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/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 dca739e560f2..a91f43a7ac6b 100644 --- a/sdk/resourcemanager/security/armsecurity/time_rfc3339.go +++ b/sdk/resourcemanager/security/armsecurity/time_rfc3339.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity diff --git a/sdk/resourcemanager/security/armsecurity/topology_client.go b/sdk/resourcemanager/security/armsecurity/topology_client.go index 05b132831516..2edebfbc90ea 100644 --- a/sdk/resourcemanager/security/armsecurity/topology_client.go +++ b/sdk/resourcemanager/security/armsecurity/topology_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -53,18 +52,21 @@ func NewTopologyClient(subscriptionID string, credential azcore.TokenCredential, // - topologyResourceName - Name of a topology resources collection. // - options - TopologyClientGetOptions contains the optional parameters for the TopologyClient.Get method. func (client *TopologyClient) Get(ctx context.Context, resourceGroupName string, ascLocation string, topologyResourceName string, options *TopologyClientGetOptions) (TopologyClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, resourceGroupName, ascLocation, topologyResourceName, options) if err != nil { return TopologyClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return TopologyClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return TopologyClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return TopologyClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. 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 eff8d658f5d4..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/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/GetTopologySubscription_example.json -func ExampleTopologyClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTopologyClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TopologyList = armsecurity.TopologyList{ - // Value: []*armsecurity.TopologyResource{ - // { - // Location: to.Ptr("westus"), - // Name: to.Ptr("vnets"), - // Type: to.Ptr("Microsoft.Security/locations/topologies"), - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Security/locations/centralus/topologies/vnets"), - // Properties: &armsecurity.TopologyResourceProperties{ - // CalculatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-07-10T13:56:10.5755270Z"); return t}()), - // TopologyResources: []*armsecurity.TopologySingleResource{ - // { - // Children: []*armsecurity.TopologySingleResourceChild{ - // { - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet"), - // }}, - // Location: to.Ptr("westus"), - // NetworkZones: to.Ptr("Internal"), - // RecommendationsExist: to.Ptr(false), - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet"), - // Severity: to.Ptr("Healthy"), - // TopologyScore: to.Ptr[int32](0), - // }}, - // }, - // }, - // { - // Location: to.Ptr("westus"), - // Name: to.Ptr("subnets"), - // Type: to.Ptr("Microsoft.Security/locations/topologies"), - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Security/locations/centralus/topologies/subnets"), - // Properties: &armsecurity.TopologyResourceProperties{ - // CalculatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-07-10T13:56:10.5755270Z"); return t}()), - // TopologyResources: []*armsecurity.TopologySingleResource{ - // { - // Location: to.Ptr("westus"), - // NetworkZones: to.Ptr("Internal"), - // Parents: []*armsecurity.TopologySingleResourceParent{ - // { - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet"), - // }}, - // RecommendationsExist: to.Ptr(false), - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet"), - // Severity: to.Ptr("Healthy"), - // TopologyScore: to.Ptr[int32](5), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/GetTopologySubscriptionLocation_example.json -func ExampleTopologyClient_NewListByHomeRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewTopologyClient().NewListByHomeRegionPager("centralus", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.TopologyList = armsecurity.TopologyList{ - // Value: []*armsecurity.TopologyResource{ - // { - // Location: to.Ptr("westus"), - // Name: to.Ptr("vnets"), - // Type: to.Ptr("Microsoft.Security/locations/topologies"), - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Security/locations/centralus/topologies/vnets"), - // Properties: &armsecurity.TopologyResourceProperties{ - // CalculatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-07-10T13:56:10.5755270Z"); return t}()), - // TopologyResources: []*armsecurity.TopologySingleResource{ - // { - // Children: []*armsecurity.TopologySingleResourceChild{ - // { - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet"), - // }}, - // Location: to.Ptr("westus"), - // NetworkZones: to.Ptr("Internal"), - // RecommendationsExist: to.Ptr(false), - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet"), - // Severity: to.Ptr("Healthy"), - // TopologyScore: to.Ptr[int32](0), - // }}, - // }, - // }, - // { - // Location: to.Ptr("westus"), - // Name: to.Ptr("subnets"), - // Type: to.Ptr("Microsoft.Security/locations/topologies"), - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Security/locations/centralus/topologies/subnets"), - // Properties: &armsecurity.TopologyResourceProperties{ - // CalculatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-07-10T13:56:10.5755270Z"); return t}()), - // TopologyResources: []*armsecurity.TopologySingleResource{ - // { - // Location: to.Ptr("westus"), - // NetworkZones: to.Ptr("Internal"), - // Parents: []*armsecurity.TopologySingleResourceParent{ - // { - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet"), - // }}, - // RecommendationsExist: to.Ptr(false), - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet"), - // Severity: to.Ptr("Healthy"), - // TopologyScore: to.Ptr[int32](5), - // }}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e716082ac474f182e2220e4f38f1d6191e7636cf/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/GetTopology_example.json -func ExampleTopologyClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armsecurity.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewTopologyClient().Get(ctx, "myservers", "centralus", "vnets", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TopologyResource = armsecurity.TopologyResource{ - // Location: to.Ptr("westus"), - // Name: to.Ptr("vnets"), - // Type: to.Ptr("Microsoft.Security/locations/topologies"), - // ID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Security/locations/centralus/topologies/vnets"), - // Properties: &armsecurity.TopologyResourceProperties{ - // CalculatedDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-07-10T13:56:10.5755270Z"); return t}()), - // TopologyResources: []*armsecurity.TopologySingleResource{ - // { - // Children: []*armsecurity.TopologySingleResourceChild{ - // { - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet"), - // }}, - // Location: to.Ptr("westus"), - // NetworkZones: to.Ptr("InternetFacing"), - // RecommendationsExist: to.Ptr(false), - // ResourceID: to.Ptr("/subscriptions/3eeab341-f466-499c-a8be-85427e154bad/resourceGroups/myservers/providers/Microsoft.Network/virtualNetworks/myvnet"), - // Severity: to.Ptr("Healthy"), - // TopologyScore: to.Ptr[int32](0), - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/security/armsecurity/workspacesettings_client.go b/sdk/resourcemanager/security/armsecurity/workspacesettings_client.go index 98a396e52dd8..a316db2a8171 100644 --- a/sdk/resourcemanager/security/armsecurity/workspacesettings_client.go +++ b/sdk/resourcemanager/security/armsecurity/workspacesettings_client.go @@ -3,9 +3,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. +// 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. -// DO NOT EDIT. package armsecurity @@ -53,18 +52,21 @@ func NewWorkspaceSettingsClient(subscriptionID string, credential azcore.TokenCr // - options - WorkspaceSettingsClientCreateOptions contains the optional parameters for the WorkspaceSettingsClient.Create // method. func (client *WorkspaceSettingsClient) Create(ctx context.Context, workspaceSettingName string, workspaceSetting WorkspaceSetting, options *WorkspaceSettingsClientCreateOptions) (WorkspaceSettingsClientCreateResponse, error) { + var err error req, err := client.createCreateRequest(ctx, workspaceSettingName, workspaceSetting, options) if err != nil { return WorkspaceSettingsClientCreateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return WorkspaceSettingsClientCreateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WorkspaceSettingsClientCreateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return WorkspaceSettingsClientCreateResponse{}, err } - return client.createHandleResponse(resp) + resp, err := client.createHandleResponse(httpResp) + return resp, err } // createCreateRequest creates the Create request. @@ -86,7 +88,10 @@ func (client *WorkspaceSettingsClient) createCreateRequest(ctx context.Context, reqQP.Set("api-version", "2017-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, workspaceSetting) + if err := runtime.MarshalAsJSON(req, workspaceSetting); err != nil { + return nil, err + } + return req, nil } // createHandleResponse handles the Create response. @@ -106,16 +111,18 @@ func (client *WorkspaceSettingsClient) createHandleResponse(resp *http.Response) // - options - WorkspaceSettingsClientDeleteOptions contains the optional parameters for the WorkspaceSettingsClient.Delete // method. func (client *WorkspaceSettingsClient) Delete(ctx context.Context, workspaceSettingName string, options *WorkspaceSettingsClientDeleteOptions) (WorkspaceSettingsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, workspaceSettingName, options) if err != nil { return WorkspaceSettingsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return WorkspaceSettingsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return WorkspaceSettingsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return WorkspaceSettingsClientDeleteResponse{}, err } return WorkspaceSettingsClientDeleteResponse{}, nil } @@ -150,18 +157,21 @@ func (client *WorkspaceSettingsClient) deleteCreateRequest(ctx context.Context, // - workspaceSettingName - Name of the security setting // - options - WorkspaceSettingsClientGetOptions contains the optional parameters for the WorkspaceSettingsClient.Get method. func (client *WorkspaceSettingsClient) Get(ctx context.Context, workspaceSettingName string, options *WorkspaceSettingsClientGetOptions) (WorkspaceSettingsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, workspaceSettingName, options) if err != nil { return WorkspaceSettingsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return WorkspaceSettingsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WorkspaceSettingsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return WorkspaceSettingsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -265,18 +275,21 @@ func (client *WorkspaceSettingsClient) listHandleResponse(resp *http.Response) ( // - options - WorkspaceSettingsClientUpdateOptions contains the optional parameters for the WorkspaceSettingsClient.Update // method. func (client *WorkspaceSettingsClient) Update(ctx context.Context, workspaceSettingName string, workspaceSetting WorkspaceSetting, options *WorkspaceSettingsClientUpdateOptions) (WorkspaceSettingsClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, workspaceSettingName, workspaceSetting, options) if err != nil { return WorkspaceSettingsClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return WorkspaceSettingsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return WorkspaceSettingsClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return WorkspaceSettingsClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -298,7 +311,10 @@ func (client *WorkspaceSettingsClient) updateCreateRequest(ctx context.Context, reqQP.Set("api-version", "2017-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, workspaceSetting) + if err := runtime.MarshalAsJSON(req, workspaceSetting); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. 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 1860a509790d..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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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/e716082ac474f182e2220e4f38f1d6191e7636cf/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) - } -}