From a8d45fccdf6f7661ceab5f47c46af5a3359160f3 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 1 Mar 2023 13:52:03 +0000 Subject: [PATCH] CodeGen from PR 22841 in Azure/azure-rest-api-specs Merge 5b052e697e7d4cfec8b1fa13c5e65b6e4c3dd507 into 7052a860aca60d769b2c4cec014c8ab587f70a44 --- .../security/armsecurity/CHANGELOG.md | 57 + .../armsecurity/accountconnectors_client.go | 31 +- .../accountconnectors_client_example_test.go | 197 --- .../adaptiveapplicationcontrols_client.go | 38 +- ...applicationcontrols_client_example_test.go | 186 --- .../adaptivenetworkhardenings_client.go | 50 +- ...venetworkhardenings_client_example_test.go | 106 -- .../advancedthreatprotection_client.go | 20 +- ...cedthreatprotection_client_example_test.go | 63 - .../security/armsecurity/alerts_client.go | 140 ++- .../armsecurity/alerts_client_example_test.go | 323 ----- .../alertssuppressionrules_client.go | 34 +- ...rtssuppressionrules_client_example_test.go | 149 --- .../armsecurity/allowedconnections_client.go | 26 +- .../allowedconnections_client_example_test.go | 84 -- .../armsecurity/apicollection_client.go | 192 +++ .../apicollectionoffboarding_client.go | 112 ++ .../apicollectiononboarding_client.go | 122 ++ .../armsecurity/application_client.go | 25 +- .../application_client_example_test.go | 89 -- .../armsecurity/applications_client.go | 9 +- .../applications_client_example_test.go | 41 - .../armsecurity/assessments_client.go | 36 +- .../assessments_client_example_test.go | 125 -- .../armsecurity/assessmentsmetadata_client.go | 44 +- ...assessmentsmetadata_client_example_test.go | 156 --- .../armsecurity/automations_client.go | 50 +- .../automations_client_example_test.go | 299 ----- .../autoprovisioningsettings_client.go | 27 +- ...rovisioningsettings_client_example_test.go | 87 -- .../security/armsecurity/autorest.md | 7 +- .../armsecurity/complianceresults_client.go | 19 +- .../complianceresults_client_example_test.go | 60 - .../armsecurity/compliances_client.go | 20 +- .../compliances_client_example_test.go | 60 - .../connectorapplication_client.go | 41 +- ...onnectorapplication_client_example_test.go | 89 -- .../connectorapplications_client.go | 15 +- ...nnectorapplications_client_example_test.go | 41 - .../connectorgovernancerule_client.go | 125 -- ...ectorgovernancerule_client_example_test.go | 41 - .../connectorgovernancerules_client.go | 233 ---- ...ctorgovernancerules_client_example_test.go | 102 -- ...ctorgovernancerulesexecutestatus_client.go | 129 -- ...erulesexecutestatus_client_example_test.go | 40 - .../security/armsecurity/connectors_client.go | 50 +- .../connectors_client_example_test.go | 176 --- .../security/armsecurity/constants.go | 23 +- .../security/armsecurity/contacts_client.go | 26 +- .../contacts_client_example_test.go | 111 -- .../customassessmentautomations_client.go | 47 +- ...sessmentautomations_client_example_test.go | 130 -- .../customentitystoreassignments_client.go | 47 +- ...itystoreassignments_client_example_test.go | 125 -- .../security/armsecurity/date_type.go | 2 +- .../devicesecuritygroups_client.go | 46 +- ...evicesecuritygroups_client_example_test.go | 108 -- .../discoveredsecuritysolutions_client.go | 29 +- ...edsecuritysolutions_client_example_test.go | 84 -- .../externalsecuritysolutions_client.go | 29 +- ...alsecuritysolutions_client_example_test.go | 84 -- .../security/armsecurity/go.mod | 14 +- .../security/armsecurity/go.sum | 21 +- .../governanceassignments_client.go | 84 +- ...vernanceassignments_client_example_test.go | 118 -- .../armsecurity/governancerule_client.go | 114 -- .../governancerule_client_example_test.go | 41 - .../armsecurity/governancerules_client.go | 371 +++--- .../governancerules_client_example_test.go | 144 --- .../informationprotectionpolicies_client.go | 37 +- ...nprotectionpolicies_client_example_test.go | 147 --- .../armsecurity/ingestionsettings_client.go | 45 +- .../ingestionsettings_client_example_test.go | 134 --- .../armsecurity/iotsecuritysolution_client.go | 56 +- ...iotsecuritysolution_client_example_test.go | 235 ---- .../iotsecuritysolutionanalytics_client.go | 24 +- ...tysolutionanalytics_client_example_test.go | 55 - ...olutionsanalyticsaggregatedalert_client.go | 37 +- ...ticsaggregatedalert_client_example_test.go | 77 -- ...solutionsanalyticsrecommendation_client.go | 26 +- ...yticsrecommendation_client_example_test.go | 60 - .../jitnetworkaccesspolicies_client.go | 78 +- ...tworkaccesspolicies_client_example_test.go | 242 ---- .../security/armsecurity/locations_client.go | 14 +- .../locations_client_example_test.go | 60 - .../armsecurity/mdeonboardings_client.go | 12 +- .../mdeonboardings_client_example_test.go | 55 - .../security/armsecurity/models.go | 402 ++++--- .../security/armsecurity/models_serde.go | 1054 ++++++++++------- .../security/armsecurity/operations_client.go | 7 +- .../armsecurity/polymorphic_helpers.go | 28 +- .../security/armsecurity/pricings_client.go | 21 +- .../pricings_client_example_test.go | 80 -- .../regulatorycomplianceassessments_client.go | 26 +- ...mplianceassessments_client_example_test.go | 60 - .../regulatorycompliancecontrols_client.go | 22 +- ...ycompliancecontrols_client_example_test.go | 60 - .../regulatorycompliancestandards_client.go | 18 +- ...compliancestandards_client_example_test.go | 60 - .../security/armsecurity/response_types.go | 210 ++-- .../securescorecontroldefinitions_client.go | 16 +- ...econtroldefinitions_client_example_test.go | 65 - .../armsecurity/securescorecontrols_client.go | 18 +- ...securescorecontrols_client_example_test.go | 90 -- .../armsecurity/securescores_client.go | 14 +- .../securescores_client_example_test.go | 60 - .../servervulnerabilityassessment_client.go | 59 +- ...erabilityassessment_client_example_test.go | 93 -- .../security/armsecurity/settings_client.go | 21 +- .../settings_client_example_test.go | 85 -- .../armsecurity/softwareinventories_client.go | 37 +- ...softwareinventories_client_example_test.go | 84 -- .../security/armsecurity/solutions_client.go | 18 +- .../solutions_client_example_test.go | 60 - .../solutionsreferencedata_client.go | 18 +- ...utionsreferencedata_client_example_test.go | 55 - ...erabilityassessmentbaselinerules_client.go | 55 +- ...ssmentbaselinerules_client_example_test.go | 184 --- ...lnerabilityassessmentscanresults_client.go | 28 +- ...sessmentscanresults_client_example_test.go | 93 -- .../sqlvulnerabilityassessmentscans_client.go | 24 +- ...lityassessmentscans_client_example_test.go | 74 -- .../armsecurity/subassessments_client.go | 32 +- .../subassessments_client_example_test.go | 84 -- ...tiongovernancerulesexecutestatus_client.go | 119 -- ...erulesexecutestatus_client_example_test.go | 40 - .../security/armsecurity/tasks_client.go | 68 +- .../armsecurity/tasks_client_example_test.go | 161 --- .../security/armsecurity/time_rfc3339.go | 2 +- .../security/armsecurity/topology_client.go | 25 +- .../topology_client_example_test.go | 84 -- .../armsecurity/workspacesettings_client.go | 40 +- .../workspacesettings_client_example_test.go | 131 -- 133 files changed, 2792 insertions(+), 8651 deletions(-) delete mode 100644 sdk/resourcemanager/security/armsecurity/accountconnectors_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/adaptiveapplicationcontrols_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/adaptivenetworkhardenings_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/advancedthreatprotection_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/alerts_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/alertssuppressionrules_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/allowedconnections_client_example_test.go create mode 100644 sdk/resourcemanager/security/armsecurity/apicollection_client.go create mode 100644 sdk/resourcemanager/security/armsecurity/apicollectionoffboarding_client.go create mode 100644 sdk/resourcemanager/security/armsecurity/apicollectiononboarding_client.go delete mode 100644 sdk/resourcemanager/security/armsecurity/application_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/applications_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/assessments_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/assessmentsmetadata_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/automations_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/autoprovisioningsettings_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/complianceresults_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/compliances_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/connectorapplication_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/connectorapplications_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/connectorgovernancerule_client.go delete mode 100644 sdk/resourcemanager/security/armsecurity/connectorgovernancerule_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/connectorgovernancerules_client.go delete mode 100644 sdk/resourcemanager/security/armsecurity/connectorgovernancerules_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/connectorgovernancerulesexecutestatus_client.go delete mode 100644 sdk/resourcemanager/security/armsecurity/connectorgovernancerulesexecutestatus_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/connectors_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/contacts_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/customassessmentautomations_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/customentitystoreassignments_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/devicesecuritygroups_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/discoveredsecuritysolutions_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/externalsecuritysolutions_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/governanceassignments_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/governancerule_client.go delete mode 100644 sdk/resourcemanager/security/armsecurity/governancerule_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/governancerules_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/informationprotectionpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/ingestionsettings_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/iotsecuritysolution_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/iotsecuritysolutionanalytics_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsaggregatedalert_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsrecommendation_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/jitnetworkaccesspolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/locations_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/mdeonboardings_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/pricings_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/regulatorycomplianceassessments_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/regulatorycompliancecontrols_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/regulatorycompliancestandards_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/securescorecontroldefinitions_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/securescorecontrols_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/securescores_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/servervulnerabilityassessment_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/settings_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/softwareinventories_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/solutions_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/solutionsreferencedata_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentbaselinerules_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscanresults_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/subassessments_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/subscriptiongovernancerulesexecutestatus_client.go delete mode 100644 sdk/resourcemanager/security/armsecurity/subscriptiongovernancerulesexecutestatus_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/tasks_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/topology_client_example_test.go delete mode 100644 sdk/resourcemanager/security/armsecurity/workspacesettings_client_example_test.go diff --git a/sdk/resourcemanager/security/armsecurity/CHANGELOG.md b/sdk/resourcemanager/security/armsecurity/CHANGELOG.md index 16e282a184cd..e3986478b752 100644 --- a/sdk/resourcemanager/security/armsecurity/CHANGELOG.md +++ b/sdk/resourcemanager/security/armsecurity/CHANGELOG.md @@ -1,5 +1,62 @@ # Release History +## 0.10.0 (2023-03-01) +### Breaking Changes + +- Function `NewGovernanceRulesClient` parameter(s) have been changed from `(string, azcore.TokenCredential, *arm.ClientOptions)` to `(azcore.TokenCredential, *arm.ClientOptions)` +- Function `*GovernanceRulesClient.CreateOrUpdate` parameter(s) have been changed from `(context.Context, string, GovernanceRule, *GovernanceRulesClientCreateOrUpdateOptions)` to `(context.Context, string, string, GovernanceRule, *GovernanceRulesClientCreateOrUpdateOptions)` +- Function `*GovernanceRulesClient.Get` parameter(s) have been changed from `(context.Context, string, *GovernanceRulesClientGetOptions)` to `(context.Context, string, string, *GovernanceRulesClientGetOptions)` +- Function `NewConnectorGovernanceRuleClient` has been removed +- Function `*ConnectorGovernanceRuleClient.NewListPager` has been removed +- Function `NewConnectorGovernanceRulesClient` has been removed +- Function `*ConnectorGovernanceRulesClient.CreateOrUpdate` has been removed +- Function `*ConnectorGovernanceRulesClient.Delete` has been removed +- Function `*ConnectorGovernanceRulesClient.Get` has been removed +- Function `NewConnectorGovernanceRulesExecuteStatusClient` has been removed +- Function `*ConnectorGovernanceRulesExecuteStatusClient.BeginGet` has been removed +- Function `NewGovernanceRuleClient` has been removed +- Function `*GovernanceRuleClient.NewListPager` has been removed +- Function `*GovernanceRulesClient.BeginRuleIDExecuteSingleSecurityConnector` has been removed +- Function `*GovernanceRulesClient.BeginRuleIDExecuteSingleSubscription` has been removed +- Function `NewSubscriptionGovernanceRulesExecuteStatusClient` has been removed +- Function `*SubscriptionGovernanceRulesExecuteStatusClient.BeginGet` has been removed +- Operation `*GovernanceRulesClient.Delete` has been changed to LRO, use `*GovernanceRulesClient.BeginDelete` instead. +- Struct `ConnectorGovernanceRuleClient` has been removed +- Struct `ConnectorGovernanceRulesClient` has been removed +- Struct `ConnectorGovernanceRulesExecuteStatusClient` has been removed +- Struct `ExecuteRuleStatus` has been removed +- Struct `GovernanceRuleClient` has been removed +- Struct `SubscriptionGovernanceRulesExecuteStatusClient` has been removed + +### Features Added + +- New type alias `OperationResult` with values `OperationResultCanceled`, `OperationResultFailed`, `OperationResultSucceeded` +- New function `NewAPICollectionClient(string, azcore.TokenCredential, *arm.ClientOptions) (*APICollectionClient, error)` +- New function `*APICollectionClient.Get(context.Context, string, string, string, *APICollectionClientGetOptions) (APICollectionClientGetResponse, error)` +- New function `*APICollectionClient.NewListPager(string, string, *APICollectionClientListOptions) *runtime.Pager[APICollectionClientListResponse]` +- New function `NewAPICollectionOffboardingClient(string, azcore.TokenCredential, *arm.ClientOptions) (*APICollectionOffboardingClient, error)` +- New function `*APICollectionOffboardingClient.Delete(context.Context, string, string, string, *APICollectionOffboardingClientDeleteOptions) (APICollectionOffboardingClientDeleteResponse, error)` +- New function `NewAPICollectionOnboardingClient(string, azcore.TokenCredential, *arm.ClientOptions) (*APICollectionOnboardingClient, error)` +- New function `*APICollectionOnboardingClient.Create(context.Context, string, string, string, *APICollectionOnboardingClientCreateOptions) (APICollectionOnboardingClientCreateResponse, error)` +- New function `*GovernanceRulesClient.BeginExecute(context.Context, string, string, *GovernanceRulesClientBeginExecuteOptions) (*runtime.Poller[GovernanceRulesClientExecuteResponse], error)` +- New function `*GovernanceRulesClient.NewListPager(string, *GovernanceRulesClientListOptions) *runtime.Pager[GovernanceRulesClientListResponse]` +- New function `*GovernanceRulesClient.OperationResults(context.Context, string, string, string, *GovernanceRulesClientOperationResultsOptions) (GovernanceRulesClientOperationResultsResponse, error)` +- New struct `APICollectionClient` +- New struct `APICollectionOffboardingClient` +- New struct `APICollectionOnboardingClient` +- New struct `APICollectionProperties` +- New struct `APICollectionResponse` +- New struct `APICollectionResponseList` +- New struct `ErrorDetail` +- New struct `ErrorResponse` +- New struct `GovernanceRuleMetadata` +- New struct `OperationResultAutoGenerated` +- New field `ExcludedScopes` in struct `GovernanceRuleProperties` +- New field `IncludeMemberScopes` in struct `GovernanceRuleProperties` +- New field `Metadata` in struct `GovernanceRuleProperties` +- New field `TenantID` in struct `GovernanceRuleProperties` + + ## 0.9.0 (2022-11-15) ### Breaking Changes diff --git a/sdk/resourcemanager/security/armsecurity/accountconnectors_client.go b/sdk/resourcemanager/security/armsecurity/accountconnectors_client.go index 81cab85c1e61..f11813cda260 100644 --- a/sdk/resourcemanager/security/armsecurity/accountconnectors_client.go +++ b/sdk/resourcemanager/security/armsecurity/accountconnectors_client.go @@ -32,9 +32,9 @@ type AccountConnectorsClient struct { } // NewAccountConnectorsClient creates a new instance of AccountConnectorsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAccountConnectorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AccountConnectorsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -59,11 +59,12 @@ func NewAccountConnectorsClient(subscriptionID string, credential azcore.TokenCr // either account credentials or role-based authentication. For GCP, use account organization // credentials. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01-preview -// connectorName - Name of the cloud account connector -// connectorSetting - Settings for the cloud account connector -// options - AccountConnectorsClientCreateOrUpdateOptions contains the optional parameters for the AccountConnectorsClient.CreateOrUpdate -// method. +// - connectorName - Name of the cloud account connector +// - connectorSetting - Settings for the cloud account connector +// - 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) { req, err := client.createOrUpdateCreateRequest(ctx, connectorName, connectorSetting, options) if err != nil { @@ -112,10 +113,11 @@ func (client *AccountConnectorsClient) createOrUpdateHandleResponse(resp *http.R // Delete - Delete a cloud account connector from a subscription // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01-preview -// connectorName - Name of the cloud account connector -// options - AccountConnectorsClientDeleteOptions contains the optional parameters for the AccountConnectorsClient.Delete -// method. +// - connectorName - Name of the cloud account connector +// - options - AccountConnectorsClientDeleteOptions contains the optional parameters for the AccountConnectorsClient.Delete +// method. func (client *AccountConnectorsClient) Delete(ctx context.Context, connectorName string, options *AccountConnectorsClientDeleteOptions) (AccountConnectorsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, connectorName, options) if err != nil { @@ -155,9 +157,10 @@ func (client *AccountConnectorsClient) deleteCreateRequest(ctx context.Context, // Get - Details of a specific cloud account connector // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01-preview -// connectorName - Name of the cloud account connector -// options - AccountConnectorsClientGetOptions contains the optional parameters for the AccountConnectorsClient.Get method. +// - 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) { req, err := client.getCreateRequest(ctx, connectorName, options) if err != nil { @@ -205,8 +208,10 @@ func (client *AccountConnectorsClient) getHandleResponse(resp *http.Response) (A } // NewListPager - Cloud accounts connectors of a subscription +// // Generated from API version 2020-01-01-preview -// options - AccountConnectorsClientListOptions contains the optional parameters for the AccountConnectorsClient.List method. +// - options - AccountConnectorsClientListOptions contains the optional parameters for the AccountConnectorsClient.NewListPager +// method. func (client *AccountConnectorsClient) NewListPager(options *AccountConnectorsClientListOptions) *runtime.Pager[AccountConnectorsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AccountConnectorsClientListResponse]{ More: func(page AccountConnectorsClientListResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/accountconnectors_client_example_test.go b/sdk/resourcemanager/security/armsecurity/accountconnectors_client_example_test.go deleted file mode 100644 index 472e11b3c208..000000000000 --- a/sdk/resourcemanager/security/armsecurity/accountconnectors_client_example_test.go +++ /dev/null @@ -1,197 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/GetListConnectorSubscription_example.json -func ExampleAccountConnectorsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAccountConnectorsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/GetConnectorSubscription_example.json -func ExampleAccountConnectorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAccountConnectorsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "aws_dev1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/CreateUpdateAwsAssumeRoleConnectorSubscription_example.json -func ExampleAccountConnectorsClient_CreateOrUpdate_awsAssumeRoleCreateACloudAccountConnectorForASubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAccountConnectorsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "aws_dev2", armsecurity.ConnectorSetting{ - Properties: &armsecurity.ConnectorSettingProperties{ - AuthenticationDetails: &armsecurity.AwAssumeRoleAuthenticationDetailsProperties{ - AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeAwsAssumeRole), - AwsAssumeRoleArn: to.Ptr("arn:aws:iam::81231569658:role/AscConnector"), - AwsExternalID: to.Ptr("20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - }, - HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - ProxyServer: &armsecurity.ProxyServerProperties{ - IP: to.Ptr("167.220.197.140"), - Port: to.Ptr("34"), - }, - Region: to.Ptr("West US 2"), - ResourceGroupName: to.Ptr("AwsConnectorRG"), - ServicePrincipal: &armsecurity.ServicePrincipalProperties{ - ApplicationID: to.Ptr("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1"), - Secret: to.Ptr(""), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/CreateUpdateAwsCredConnectorSubscription_example.json -func ExampleAccountConnectorsClient_CreateOrUpdate_awsCredCreateACloudAccountConnectorForASubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAccountConnectorsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "aws_dev1", armsecurity.ConnectorSetting{ - Properties: &armsecurity.ConnectorSettingProperties{ - AuthenticationDetails: &armsecurity.AwsCredsAuthenticationDetailsProperties{ - AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeAwsCreds), - AwsAccessKeyID: to.Ptr("AKIARPZCNODDNAEQFSOE"), - AwsSecretAccessKey: to.Ptr(""), - }, - HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - ProxyServer: &armsecurity.ProxyServerProperties{ - IP: to.Ptr("167.220.197.140"), - Port: to.Ptr("34"), - }, - Region: to.Ptr("West US 2"), - ResourceGroupName: to.Ptr("AwsConnectorRG"), - ServicePrincipal: &armsecurity.ServicePrincipalProperties{ - ApplicationID: to.Ptr("ad9bcd79-be9c-45ab-abd8-80ca1654a7d1"), - Secret: to.Ptr(""), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/CreateUpdateGcpCredentialsConnectorSubscription_example.json -func ExampleAccountConnectorsClient_CreateOrUpdate_gcpCredentialsCreateACloudAccountConnectorForASubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAccountConnectorsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "gcp_dev", armsecurity.ConnectorSetting{ - Properties: &armsecurity.ConnectorSettingProperties{ - AuthenticationDetails: &armsecurity.GcpCredentialsDetailsProperties{ - AuthenticationType: to.Ptr(armsecurity.AuthenticationTypeGcpCredentials), - Type: to.Ptr("service_account"), - AuthProviderX509CertURL: to.Ptr("https://www.googleapis.com/oauth2/v1/certs"), - AuthURI: to.Ptr("https://accounts.google.com/o/oauth2/auth"), - ClientEmail: to.Ptr("asc-135@asc-project-1234.iam.gserviceaccount.com"), - ClientID: to.Ptr("105889053725632919854"), - ClientX509CertURL: to.Ptr("https://www.googleapis.com/robot/v1/metadata/x509/asc-135%40asc-project-1234.iam.gserviceaccount.com"), - OrganizationID: to.Ptr("AscDemoOrg"), - PrivateKey: to.Ptr("-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCpxYHcLzcDZ6/Q\nAeQZnQXM5GTb3p09Xsbjo2T2F61b6I7FZiQXBrbw3Zf0CUCkkqTTpD5xifl82yQ6\n89V7SAe8hxI7esAcVDhm/aJMqzVjHLISAU2L3li1sn0jjY2oYtndwN6bRivP8O6t\n9F+W6E0zMlbCxtpZEHLbb6WxlJJrwEQ0MPH2yOCwZUQi6NHksAtEzX2nNKJNyUC7\nQyBVHHMm34H2bmZwsuQp3y2otpcJ9tJnVmYfC3k/w4x2L+DIK7JnQP/C1wQqu2du\nc0w6sydF6RhLoHButrVdYRJTdfK4k03SsSTyMqZ+f7LNnKw3xenzw1VmEpk8mvoQ\nt08tCBOrAgMBAAECggEAByzz6iyMtLYjNjV+QJ7kad6VbL2iA8AHxANZ9xTVHPdd\nYXaJu/dqsA+NpqDlfI8+LDva782XH/HbPCqmMUnAGfXTjXQIvqnIoIHD5F2wKfpC\nhIRNlMXXFgbvRxtqi11yO+80+XcjzuwuCmgzyhsTeEB+bkkdXXpWgHPdmv3emnM6\nMQM9Zgrug0UndPmiUwKOcJSU4PlmlTpHEV4vA6JfA4bvphy9m1jxO5qWeah5yym2\n6FP5BRIDF98kFrDnSXJjajwgLCQ+MypFQXyax6XkxDxuKXbng1bv7eZDjqazIChk\nm0y14X0s0jnWc+AX8vfeSf7d+EsGdVinEwR1aAawEQKBgQDqDB0qxcIQ1oI1Kww8\n9vXefTiuWsf47F+fJ/DIOEbiRfE8IdCgmOABvcqJIoxW/DFMBEdLCcx73Km7pOmd\nKg1ddScnaO8cOj2v/Ub+fAqVrA4ki4ViYP0A7/Nogga3Jr/x3ey5bitrIfFImteS\nCgBHBzZvoQpvO4lB2tKVgo2P9wKBgQC5sgTEq4sasRGSAY6lIoJno0I8w28a/16D\nes60XQeY1ger8uTGwlT02v/u/arDUmRLPClpujXq6gK29KvtRCHy7JkpGbqW2bZs\nPFKKWR7Tk3XPKYyjv94AIi5/xoFeDhS4lpAvy3Z5tQhYS6wqWKvT6yZQ3kM+Hfxs\npHgvu3mU7QKBgQC9/E1k3hj1cBtMK4CIsHPPQljTd4+iacYJPPPAo6YuoVX8WPqw\nksgrwbN59Fh1d8xQh5yTtgWOegYx8uFMGcm1lpbM7+pBQKm4hWGuzGQPMRZd5f/F\nZzOZIi61I+9tlv/yxxIVR+/ozCm/pSneO04UWi9/F/uPZYW6tnWAtfRR6wKBgGsZ\n8MQaCK4JaI/klAhMghgSQnbXZXKVzUZaA3Rln6cX8u7KtgapOOTMlwaZie8Dy1LV\nTTFstAJcm9o3/h1nyYjZy3C4JTUyNpPwqs6enjf7edxVI4eidwFutZD+xcigqHTa\naikW2atSrZB3fMIjyF7+5meH+hKOqvNiXOty3qn1AoGAZuVxYQy5FVq3YZxzr3Aa\nAm0ShoXTF6QYIbsaUiUGoa/NlHcw9V/lj4AqBRbxbaYMD+hz2J/od9cb268eJKY8\n3b6MvaUqdNhNnWodJXLhgtmGEHDKmTppz2JSTx/tVzCfhFdcOC79StZvcKLhtoFQ\n+/3lEw6NCIXzm5E4+dtJG4k=\n-----END PRIVATE KEY-----\n"), - PrivateKeyID: to.Ptr("6efg587hra2568as34d22326b044cc20dc2af"), - ProjectID: to.Ptr("asc-project-1234"), - TokenURI: to.Ptr("https://oauth2.googleapis.com/token"), - }, - HybridComputeSettings: &armsecurity.HybridComputeSettingsProperties{ - AutoProvision: to.Ptr(armsecurity.AutoProvisionOff), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/Connectors/DeleteConnectorSubscription_example.json -func ExampleAccountConnectorsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAccountConnectorsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "aws_dev1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/adaptiveapplicationcontrols_client.go b/sdk/resourcemanager/security/armsecurity/adaptiveapplicationcontrols_client.go index e52701429fd3..dbb5665cac41 100644 --- a/sdk/resourcemanager/security/armsecurity/adaptiveapplicationcontrols_client.go +++ b/sdk/resourcemanager/security/armsecurity/adaptiveapplicationcontrols_client.go @@ -33,9 +33,9 @@ type AdaptiveApplicationControlsClient struct { } // NewAdaptiveApplicationControlsClient creates a new instance of AdaptiveApplicationControlsClient with the specified values. -// subscriptionID - Azure subscription ID -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAdaptiveApplicationControlsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AdaptiveApplicationControlsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,11 +58,12 @@ func NewAdaptiveApplicationControlsClient(subscriptionID string, credential azco // Delete - Delete an application control machine group // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01 -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// groupName - Name of an application control machine group -// options - AdaptiveApplicationControlsClientDeleteOptions contains the optional parameters for the AdaptiveApplicationControlsClient.Delete -// method. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - groupName - Name of an application control machine group +// - options - AdaptiveApplicationControlsClientDeleteOptions contains the optional parameters for the AdaptiveApplicationControlsClient.Delete +// method. func (client *AdaptiveApplicationControlsClient) Delete(ctx context.Context, ascLocation string, groupName string, options *AdaptiveApplicationControlsClientDeleteOptions) (AdaptiveApplicationControlsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, ascLocation, groupName, options) if err != nil { @@ -106,11 +107,12 @@ func (client *AdaptiveApplicationControlsClient) deleteCreateRequest(ctx context // Get - Gets an application control VM/server group. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01 -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// groupName - Name of an application control machine group -// options - AdaptiveApplicationControlsClientGetOptions contains the optional parameters for the AdaptiveApplicationControlsClient.Get -// method. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - groupName - Name of an application control machine group +// - options - AdaptiveApplicationControlsClientGetOptions contains the optional parameters for the AdaptiveApplicationControlsClient.Get +// method. func (client *AdaptiveApplicationControlsClient) Get(ctx context.Context, ascLocation string, groupName string, options *AdaptiveApplicationControlsClientGetOptions) (AdaptiveApplicationControlsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, ascLocation, groupName, options) if err != nil { @@ -163,9 +165,10 @@ func (client *AdaptiveApplicationControlsClient) getHandleResponse(resp *http.Re // List - Gets a list of application control machine groups for the subscription. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01 -// options - AdaptiveApplicationControlsClientListOptions contains the optional parameters for the AdaptiveApplicationControlsClient.List -// method. +// - options - AdaptiveApplicationControlsClientListOptions contains the optional parameters for the AdaptiveApplicationControlsClient.List +// method. func (client *AdaptiveApplicationControlsClient) List(ctx context.Context, options *AdaptiveApplicationControlsClientListOptions) (AdaptiveApplicationControlsClientListResponse, error) { req, err := client.listCreateRequest(ctx, options) if err != nil { @@ -216,11 +219,12 @@ func (client *AdaptiveApplicationControlsClient) listHandleResponse(resp *http.R // Put - Update an application control machine group // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01 -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// groupName - Name of an application control machine group -// options - AdaptiveApplicationControlsClientPutOptions contains the optional parameters for the AdaptiveApplicationControlsClient.Put -// method. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - groupName - Name of an application control machine group +// - options - AdaptiveApplicationControlsClientPutOptions contains the optional parameters for the AdaptiveApplicationControlsClient.Put +// method. func (client *AdaptiveApplicationControlsClient) Put(ctx context.Context, ascLocation string, groupName string, body AdaptiveApplicationControlGroup, options *AdaptiveApplicationControlsClientPutOptions) (AdaptiveApplicationControlsClientPutResponse, error) { req, err := client.putCreateRequest(ctx, ascLocation, groupName, body, options) if err != nil { diff --git a/sdk/resourcemanager/security/armsecurity/adaptiveapplicationcontrols_client_example_test.go b/sdk/resourcemanager/security/armsecurity/adaptiveapplicationcontrols_client_example_test.go deleted file mode 100644 index baec5716dc12..000000000000 --- a/sdk/resourcemanager/security/armsecurity/adaptiveapplicationcontrols_client_example_test.go +++ /dev/null @@ -1,186 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/GetAdaptiveApplicationControlsSubscription_example.json -func ExampleAdaptiveApplicationControlsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAdaptiveApplicationControlsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, &armsecurity.AdaptiveApplicationControlsClientListOptions{IncludePathRecommendations: to.Ptr(true), - Summary: to.Ptr(false), - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/GetAdaptiveApplicationControlsGroup_example.json -func ExampleAdaptiveApplicationControlsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAdaptiveApplicationControlsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "centralus", "ERELGROUP1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/PutAdaptiveApplicationControls_example.json -func ExampleAdaptiveApplicationControlsClient_Put() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAdaptiveApplicationControlsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Put(ctx, "centralus", "ERELGROUP1", armsecurity.AdaptiveApplicationControlGroup{ - Properties: &armsecurity.AdaptiveApplicationControlGroupData{ - EnforcementMode: to.Ptr(armsecurity.EnforcementModeAudit), - PathRecommendations: []*armsecurity.PathRecommendation{ - { - Type: to.Ptr(armsecurity.RecommendationType("PublisherSignature")), - Path: to.Ptr("[Exe] O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US\\*\\*\\0.0.0.0"), - Action: to.Ptr(armsecurity.RecommendationActionRecommended), - Common: to.Ptr(true), - ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - FileType: to.Ptr(armsecurity.FileTypeExe), - PublisherInfo: &armsecurity.PublisherInfo{ - BinaryName: to.Ptr("*"), - ProductName: to.Ptr("*"), - PublisherName: to.Ptr("O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US"), - Version: to.Ptr("0.0.0.0"), - }, - UserSids: []*string{ - to.Ptr("S-1-1-0")}, - Usernames: []*armsecurity.UserRecommendation{ - { - RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - Username: to.Ptr("Everyone"), - }}, - }, - { - Type: to.Ptr(armsecurity.RecommendationType("ProductSignature")), - Path: to.Ptr("%OSDRIVE%\\WINDOWSAZURE\\SECAGENT\\WASECAGENTPROV.EXE"), - Action: to.Ptr(armsecurity.RecommendationActionRecommended), - Common: to.Ptr(true), - ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - FileType: to.Ptr(armsecurity.FileTypeExe), - PublisherInfo: &armsecurity.PublisherInfo{ - BinaryName: to.Ptr("*"), - ProductName: to.Ptr("MICROSOFT® COREXT"), - PublisherName: to.Ptr("CN=MICROSOFT AZURE DEPENDENCY CODE SIGN"), - Version: to.Ptr("0.0.0.0"), - }, - UserSids: []*string{ - to.Ptr("S-1-1-0")}, - Usernames: []*armsecurity.UserRecommendation{ - { - RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - Username: to.Ptr("NT AUTHORITY\\SYSTEM"), - }}, - }, - { - Type: to.Ptr(armsecurity.RecommendationType("PublisherSignature")), - Path: to.Ptr("%OSDRIVE%\\WINDOWSAZURE\\PACKAGES_201973_7415\\COLLECTGUESTLOGS.EXE"), - Action: to.Ptr(armsecurity.RecommendationActionRecommended), - Common: to.Ptr(true), - ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - FileType: to.Ptr(armsecurity.FileTypeExe), - PublisherInfo: &armsecurity.PublisherInfo{ - BinaryName: to.Ptr("*"), - ProductName: to.Ptr("*"), - PublisherName: to.Ptr("CN=MICROSOFT AZURE DEPENDENCY CODE SIGN"), - Version: to.Ptr("0.0.0.0"), - }, - UserSids: []*string{ - to.Ptr("S-1-1-0")}, - Usernames: []*armsecurity.UserRecommendation{ - { - RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - Username: to.Ptr("NT AUTHORITY\\SYSTEM"), - }}, - }, - { - Type: to.Ptr(armsecurity.RecommendationType("File")), - Path: to.Ptr("C:\\directory\\file.exe"), - Action: to.Ptr(armsecurity.RecommendationActionAdd), - Common: to.Ptr(true), - }}, - ProtectionMode: &armsecurity.ProtectionMode{ - Exe: to.Ptr(armsecurity.EnforcementModeAudit), - Msi: to.Ptr(armsecurity.EnforcementModeNone), - Script: to.Ptr(armsecurity.EnforcementModeNone), - }, - VMRecommendations: []*armsecurity.VMRecommendation{ - { - ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportSupported), - RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/erelh-stable/providers/microsoft.compute/virtualmachines/erelh-16090"), - }, - { - ConfigurationStatus: to.Ptr(armsecurity.ConfigurationStatusConfigured), - EnforcementSupport: to.Ptr(armsecurity.EnforcementSupportSupported), - RecommendationAction: to.Ptr(armsecurity.RecommendationActionRecommended), - ResourceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/matanvs/providers/microsoft.compute/virtualmachines/matanvs19"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ApplicationWhitelistings/DeleteAdaptiveApplicationControls_example.json -func ExampleAdaptiveApplicationControlsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAdaptiveApplicationControlsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "centralus", "GROUP1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/adaptivenetworkhardenings_client.go b/sdk/resourcemanager/security/armsecurity/adaptivenetworkhardenings_client.go index 93a654b5efdd..23dc4d99977f 100644 --- a/sdk/resourcemanager/security/armsecurity/adaptivenetworkhardenings_client.go +++ b/sdk/resourcemanager/security/armsecurity/adaptivenetworkhardenings_client.go @@ -32,9 +32,9 @@ type AdaptiveNetworkHardeningsClient struct { } // NewAdaptiveNetworkHardeningsClient creates a new instance of AdaptiveNetworkHardeningsClient with the specified values. -// subscriptionID - Azure subscription ID -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAdaptiveNetworkHardeningsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AdaptiveNetworkHardeningsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,14 +57,15 @@ func NewAdaptiveNetworkHardeningsClient(subscriptionID string, credential azcore // BeginEnforce - Enforces the given rules on the NSG(s) listed in the request // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// resourceNamespace - The Namespace of the resource. -// resourceType - The type of the resource. -// resourceName - Name of the resource. -// adaptiveNetworkHardeningResourceName - The name of the Adaptive Network Hardening resource. -// options - AdaptiveNetworkHardeningsClientBeginEnforceOptions contains the optional parameters for the AdaptiveNetworkHardeningsClient.BeginEnforce -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - resourceNamespace - The Namespace of the resource. +// - resourceType - The type of the resource. +// - resourceName - Name of the resource. +// - adaptiveNetworkHardeningResourceName - The name of the Adaptive Network Hardening resource. +// - options - AdaptiveNetworkHardeningsClientBeginEnforceOptions contains the optional parameters for the AdaptiveNetworkHardeningsClient.BeginEnforce +// method. func (client *AdaptiveNetworkHardeningsClient) BeginEnforce(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, adaptiveNetworkHardeningResourceName string, body AdaptiveNetworkHardeningEnforceRequest, options *AdaptiveNetworkHardeningsClientBeginEnforceOptions) (*runtime.Poller[AdaptiveNetworkHardeningsClientEnforceResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.enforce(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, body, options) @@ -79,6 +80,7 @@ func (client *AdaptiveNetworkHardeningsClient) BeginEnforce(ctx context.Context, // Enforce - Enforces the given rules on the NSG(s) listed in the request // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01 func (client *AdaptiveNetworkHardeningsClient) enforce(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, adaptiveNetworkHardeningResourceName string, body AdaptiveNetworkHardeningEnforceRequest, options *AdaptiveNetworkHardeningsClientBeginEnforceOptions) (*http.Response, error) { req, err := client.enforceCreateRequest(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, body, options) @@ -136,14 +138,15 @@ func (client *AdaptiveNetworkHardeningsClient) enforceCreateRequest(ctx context. // Get - Gets a single Adaptive Network Hardening resource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// resourceNamespace - The Namespace of the resource. -// resourceType - The type of the resource. -// resourceName - Name of the resource. -// adaptiveNetworkHardeningResourceName - The name of the Adaptive Network Hardening resource. -// options - AdaptiveNetworkHardeningsClientGetOptions contains the optional parameters for the AdaptiveNetworkHardeningsClient.Get -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - resourceNamespace - The Namespace of the resource. +// - resourceType - The type of the resource. +// - resourceName - Name of the resource. +// - adaptiveNetworkHardeningResourceName - The name of the Adaptive Network Hardening resource. +// - options - AdaptiveNetworkHardeningsClientGetOptions contains the optional parameters for the AdaptiveNetworkHardeningsClient.Get +// method. func (client *AdaptiveNetworkHardeningsClient) Get(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, adaptiveNetworkHardeningResourceName string, options *AdaptiveNetworkHardeningsClientGetOptions) (AdaptiveNetworkHardeningsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, options) if err != nil { @@ -207,13 +210,14 @@ func (client *AdaptiveNetworkHardeningsClient) getHandleResponse(resp *http.Resp } // NewListByExtendedResourcePager - Gets a list of Adaptive Network Hardenings resources in scope of an extended resource. +// // Generated from API version 2020-01-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// resourceNamespace - The Namespace of the resource. -// resourceType - The type of the resource. -// resourceName - Name of the resource. -// options - AdaptiveNetworkHardeningsClientListByExtendedResourceOptions contains the optional parameters for the AdaptiveNetworkHardeningsClient.ListByExtendedResource -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - resourceNamespace - The Namespace of the resource. +// - resourceType - The type of the resource. +// - resourceName - Name of the resource. +// - options - AdaptiveNetworkHardeningsClientListByExtendedResourceOptions contains the optional parameters for the AdaptiveNetworkHardeningsClient.NewListByExtendedResourcePager +// method. func (client *AdaptiveNetworkHardeningsClient) NewListByExtendedResourcePager(resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, options *AdaptiveNetworkHardeningsClientListByExtendedResourceOptions) *runtime.Pager[AdaptiveNetworkHardeningsClientListByExtendedResourceResponse] { return runtime.NewPager(runtime.PagingHandler[AdaptiveNetworkHardeningsClientListByExtendedResourceResponse]{ More: func(page AdaptiveNetworkHardeningsClientListByExtendedResourceResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/adaptivenetworkhardenings_client_example_test.go b/sdk/resourcemanager/security/armsecurity/adaptivenetworkhardenings_client_example_test.go deleted file mode 100644 index 44fde258e75b..000000000000 --- a/sdk/resourcemanager/security/armsecurity/adaptivenetworkhardenings_client_example_test.go +++ /dev/null @@ -1,106 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/ListByExtendedResourceAdaptiveNetworkHardenings_example.json -func ExampleAdaptiveNetworkHardeningsClient_NewListByExtendedResourcePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAdaptiveNetworkHardeningsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByExtendedResourcePager("rg1", "Microsoft.Compute", "virtualMachines", "vm1", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/GetAdaptiveNetworkHardening_example.json -func ExampleAdaptiveNetworkHardeningsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAdaptiveNetworkHardeningsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "rg1", "Microsoft.Compute", "virtualMachines", "vm1", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AdaptiveNetworkHardenings/EnforceAdaptiveNetworkHardeningRules_example.json -func ExampleAdaptiveNetworkHardeningsClient_BeginEnforce() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAdaptiveNetworkHardeningsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginEnforce(ctx, "rg1", "Microsoft.Compute", "virtualMachines", "vm1", "default", armsecurity.AdaptiveNetworkHardeningEnforceRequest{ - NetworkSecurityGroups: []*string{ - to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg1/providers/Microsoft.Network/networkSecurityGroups/nsg1"), - to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg2")}, - Rules: []*armsecurity.Rule{ - { - Name: to.Ptr("rule1"), - DestinationPort: to.Ptr[int32](3389), - Direction: to.Ptr(armsecurity.DirectionInbound), - IPAddresses: []*string{ - to.Ptr("100.10.1.1"), - to.Ptr("200.20.2.2"), - to.Ptr("81.199.3.0/24")}, - Protocols: []*armsecurity.TransportProtocol{ - to.Ptr(armsecurity.TransportProtocolTCP)}, - }, - { - Name: to.Ptr("rule2"), - DestinationPort: to.Ptr[int32](22), - Direction: to.Ptr(armsecurity.DirectionInbound), - IPAddresses: []*string{}, - Protocols: []*armsecurity.TransportProtocol{ - to.Ptr(armsecurity.TransportProtocolTCP)}, - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/advancedthreatprotection_client.go b/sdk/resourcemanager/security/armsecurity/advancedthreatprotection_client.go index 6af769e44f1b..12a2b2da3095 100644 --- a/sdk/resourcemanager/security/armsecurity/advancedthreatprotection_client.go +++ b/sdk/resourcemanager/security/armsecurity/advancedthreatprotection_client.go @@ -30,8 +30,8 @@ type AdvancedThreatProtectionClient struct { } // NewAdvancedThreatProtectionClient creates a new instance of AdvancedThreatProtectionClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAdvancedThreatProtectionClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*AdvancedThreatProtectionClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -53,11 +53,12 @@ func NewAdvancedThreatProtectionClient(credential azcore.TokenCredential, option // Create - Creates or updates the Advanced Threat Protection settings on a specified resource. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-01-01 -// resourceID - The identifier of the resource. -// advancedThreatProtectionSetting - Advanced Threat Protection Settings -// options - AdvancedThreatProtectionClientCreateOptions contains the optional parameters for the AdvancedThreatProtectionClient.Create -// method. +// - resourceID - The identifier of the resource. +// - advancedThreatProtectionSetting - Advanced Threat Protection Settings +// - 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) { req, err := client.createCreateRequest(ctx, resourceID, advancedThreatProtectionSetting, options) if err != nil { @@ -100,10 +101,11 @@ func (client *AdvancedThreatProtectionClient) createHandleResponse(resp *http.Re // Get - Gets the Advanced Threat Protection settings for the specified resource. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-01-01 -// resourceID - The identifier of the resource. -// options - AdvancedThreatProtectionClientGetOptions contains the optional parameters for the AdvancedThreatProtectionClient.Get -// method. +// - resourceID - The identifier of the resource. +// - options - AdvancedThreatProtectionClientGetOptions contains the optional parameters for the AdvancedThreatProtectionClient.Get +// method. func (client *AdvancedThreatProtectionClient) Get(ctx context.Context, resourceID string, options *AdvancedThreatProtectionClientGetOptions) (AdvancedThreatProtectionClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceID, options) if err != nil { diff --git a/sdk/resourcemanager/security/armsecurity/advancedthreatprotection_client_example_test.go b/sdk/resourcemanager/security/armsecurity/advancedthreatprotection_client_example_test.go deleted file mode 100644 index b699a5751cfe..000000000000 --- a/sdk/resourcemanager/security/armsecurity/advancedthreatprotection_client_example_test.go +++ /dev/null @@ -1,63 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/AdvancedThreatProtection/GetAdvancedThreatProtectionSettings_example.json -func ExampleAdvancedThreatProtectionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAdvancedThreatProtectionClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2019-01-01/examples/AdvancedThreatProtection/PutAdvancedThreatProtectionSettings_example.json -func ExampleAdvancedThreatProtectionClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAdvancedThreatProtectionClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount", armsecurity.AdvancedThreatProtectionSetting{ - Name: to.Ptr("current"), - Type: to.Ptr("Microsoft.Security/advancedThreatProtectionSettings"), - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Storage/storageAccounts/samplestorageaccount/providers/Microsoft.Security/advancedThreatProtectionSettings/current"), - Properties: &armsecurity.AdvancedThreatProtectionProperties{ - IsEnabled: to.Ptr(true), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/alerts_client.go b/sdk/resourcemanager/security/armsecurity/alerts_client.go index 47c1652825ce..14abb1fbb9af 100644 --- a/sdk/resourcemanager/security/armsecurity/alerts_client.go +++ b/sdk/resourcemanager/security/armsecurity/alerts_client.go @@ -32,9 +32,9 @@ type AlertsClient struct { } // NewAlertsClient creates a new instance of AlertsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAlertsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AlertsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewAlertsClient(subscriptionID string, credential azcore.TokenCredential, o // GetResourceGroupLevel - Get an alert that is associated a resource group or a resource in a resource group // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// alertName - Name of the alert object -// options - AlertsClientGetResourceGroupLevelOptions contains the optional parameters for the AlertsClient.GetResourceGroupLevel -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - alertName - Name of the alert object +// - 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) { req, err := client.getResourceGroupLevelCreateRequest(ctx, resourceGroupName, ascLocation, alertName, options) if err != nil { @@ -119,11 +120,12 @@ func (client *AlertsClient) getResourceGroupLevelHandleResponse(resp *http.Respo // GetSubscriptionLevel - Get an alert that is associated with a subscription // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-01 -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// alertName - Name of the alert object -// options - AlertsClientGetSubscriptionLevelOptions contains the optional parameters for the AlertsClient.GetSubscriptionLevel -// method. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - alertName - Name of the alert object +// - 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) { req, err := client.getSubscriptionLevelCreateRequest(ctx, ascLocation, alertName, options) if err != nil { @@ -175,8 +177,9 @@ func (client *AlertsClient) getSubscriptionLevelHandleResponse(resp *http.Respon } // NewListPager - List all the alerts that are associated with the subscription +// // Generated from API version 2022-01-01 -// options - AlertsClientListOptions contains the optional parameters for the AlertsClient.List method. +// - options - AlertsClientListOptions contains the optional parameters for the AlertsClient.NewListPager method. func (client *AlertsClient) NewListPager(options *AlertsClientListOptions) *runtime.Pager[AlertsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AlertsClientListResponse]{ More: func(page AlertsClientListResponse) bool { @@ -233,10 +236,11 @@ func (client *AlertsClient) listHandleResponse(resp *http.Response) (AlertsClien } // NewListByResourceGroupPager - List all the alerts that are associated with the resource group +// // Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// options - AlertsClientListByResourceGroupOptions contains the optional parameters for the AlertsClient.ListByResourceGroup -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - options - AlertsClientListByResourceGroupOptions contains the optional parameters for the AlertsClient.NewListByResourceGroupPager +// method. func (client *AlertsClient) NewListByResourceGroupPager(resourceGroupName string, options *AlertsClientListByResourceGroupOptions) *runtime.Pager[AlertsClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[AlertsClientListByResourceGroupResponse]{ More: func(page AlertsClientListByResourceGroupResponse) bool { @@ -298,11 +302,12 @@ func (client *AlertsClient) listByResourceGroupHandleResponse(resp *http.Respons // NewListResourceGroupLevelByRegionPager - List all the alerts that are associated with the resource group that are stored // in a specific location +// // Generated from API version 2022-01-01 -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// options - AlertsClientListResourceGroupLevelByRegionOptions contains the optional parameters for the AlertsClient.ListResourceGroupLevelByRegion -// method. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - options - AlertsClientListResourceGroupLevelByRegionOptions contains the optional parameters for the AlertsClient.NewListResourceGroupLevelByRegionPager +// method. func (client *AlertsClient) NewListResourceGroupLevelByRegionPager(ascLocation string, resourceGroupName string, options *AlertsClientListResourceGroupLevelByRegionOptions) *runtime.Pager[AlertsClientListResourceGroupLevelByRegionResponse] { return runtime.NewPager(runtime.PagingHandler[AlertsClientListResourceGroupLevelByRegionResponse]{ More: func(page AlertsClientListResourceGroupLevelByRegionResponse) bool { @@ -368,10 +373,11 @@ func (client *AlertsClient) listResourceGroupLevelByRegionHandleResponse(resp *h // NewListSubscriptionLevelByRegionPager - List all the alerts that are associated with the subscription that are stored in // a specific location +// // Generated from API version 2022-01-01 -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// options - AlertsClientListSubscriptionLevelByRegionOptions contains the optional parameters for the AlertsClient.ListSubscriptionLevelByRegion -// method. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - options - AlertsClientListSubscriptionLevelByRegionOptions contains the optional parameters for the AlertsClient.NewListSubscriptionLevelByRegionPager +// method. func (client *AlertsClient) NewListSubscriptionLevelByRegionPager(ascLocation string, options *AlertsClientListSubscriptionLevelByRegionOptions) *runtime.Pager[AlertsClientListSubscriptionLevelByRegionResponse] { return runtime.NewPager(runtime.PagingHandler[AlertsClientListSubscriptionLevelByRegionResponse]{ More: func(page AlertsClientListSubscriptionLevelByRegionResponse) bool { @@ -433,10 +439,11 @@ func (client *AlertsClient) listSubscriptionLevelByRegionHandleResponse(resp *ht // BeginSimulate - Simulate security alerts // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-01 -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// alertSimulatorRequestBody - Alert Simulator Request Properties -// options - AlertsClientBeginSimulateOptions contains the optional parameters for the AlertsClient.BeginSimulate method. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - alertSimulatorRequestBody - Alert Simulator Request Properties +// - options - AlertsClientBeginSimulateOptions contains the optional parameters for the AlertsClient.BeginSimulate method. func (client *AlertsClient) BeginSimulate(ctx context.Context, ascLocation string, alertSimulatorRequestBody AlertSimulatorRequestBody, options *AlertsClientBeginSimulateOptions) (*runtime.Poller[AlertsClientSimulateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.simulate(ctx, ascLocation, alertSimulatorRequestBody, options) @@ -453,6 +460,7 @@ func (client *AlertsClient) BeginSimulate(ctx context.Context, ascLocation strin // Simulate - Simulate security alerts // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-01 func (client *AlertsClient) simulate(ctx context.Context, ascLocation string, alertSimulatorRequestBody AlertSimulatorRequestBody, options *AlertsClientBeginSimulateOptions) (*http.Response, error) { req, err := client.simulateCreateRequest(ctx, ascLocation, alertSimulatorRequestBody, options) @@ -493,12 +501,13 @@ func (client *AlertsClient) simulateCreateRequest(ctx context.Context, ascLocati // UpdateResourceGroupLevelStateToActivate - Update the alert's state // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// alertName - Name of the alert object -// options - AlertsClientUpdateResourceGroupLevelStateToActivateOptions contains the optional parameters for the AlertsClient.UpdateResourceGroupLevelStateToActivate -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - alertName - Name of the alert object +// - 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) { req, err := client.updateResourceGroupLevelStateToActivateCreateRequest(ctx, resourceGroupName, ascLocation, alertName, options) if err != nil { @@ -546,12 +555,13 @@ func (client *AlertsClient) updateResourceGroupLevelStateToActivateCreateRequest // UpdateResourceGroupLevelStateToDismiss - Update the alert's state // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// alertName - Name of the alert object -// options - AlertsClientUpdateResourceGroupLevelStateToDismissOptions contains the optional parameters for the AlertsClient.UpdateResourceGroupLevelStateToDismiss -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - alertName - Name of the alert object +// - 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) { req, err := client.updateResourceGroupLevelStateToDismissCreateRequest(ctx, resourceGroupName, ascLocation, alertName, options) if err != nil { @@ -599,12 +609,13 @@ func (client *AlertsClient) updateResourceGroupLevelStateToDismissCreateRequest( // UpdateResourceGroupLevelStateToInProgress - Update the alert's state // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// alertName - Name of the alert object -// options - AlertsClientUpdateResourceGroupLevelStateToInProgressOptions contains the optional parameters for the AlertsClient.UpdateResourceGroupLevelStateToInProgress -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - alertName - Name of the alert object +// - 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) { req, err := client.updateResourceGroupLevelStateToInProgressCreateRequest(ctx, resourceGroupName, ascLocation, alertName, options) if err != nil { @@ -652,12 +663,13 @@ func (client *AlertsClient) updateResourceGroupLevelStateToInProgressCreateReque // UpdateResourceGroupLevelStateToResolve - Update the alert's state // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// alertName - Name of the alert object -// options - AlertsClientUpdateResourceGroupLevelStateToResolveOptions contains the optional parameters for the AlertsClient.UpdateResourceGroupLevelStateToResolve -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - alertName - Name of the alert object +// - 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) { req, err := client.updateResourceGroupLevelStateToResolveCreateRequest(ctx, resourceGroupName, ascLocation, alertName, options) if err != nil { @@ -705,11 +717,12 @@ func (client *AlertsClient) updateResourceGroupLevelStateToResolveCreateRequest( // UpdateSubscriptionLevelStateToActivate - Update the alert's state // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-01 -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// alertName - Name of the alert object -// options - AlertsClientUpdateSubscriptionLevelStateToActivateOptions contains the optional parameters for the AlertsClient.UpdateSubscriptionLevelStateToActivate -// method. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - alertName - Name of the alert object +// - 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) { req, err := client.updateSubscriptionLevelStateToActivateCreateRequest(ctx, ascLocation, alertName, options) if err != nil { @@ -753,11 +766,12 @@ func (client *AlertsClient) updateSubscriptionLevelStateToActivateCreateRequest( // UpdateSubscriptionLevelStateToDismiss - Update the alert's state // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-01 -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// alertName - Name of the alert object -// options - AlertsClientUpdateSubscriptionLevelStateToDismissOptions contains the optional parameters for the AlertsClient.UpdateSubscriptionLevelStateToDismiss -// method. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - alertName - Name of the alert object +// - 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) { req, err := client.updateSubscriptionLevelStateToDismissCreateRequest(ctx, ascLocation, alertName, options) if err != nil { @@ -801,11 +815,12 @@ func (client *AlertsClient) updateSubscriptionLevelStateToDismissCreateRequest(c // UpdateSubscriptionLevelStateToInProgress - Update the alert's state // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-01 -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// alertName - Name of the alert object -// options - AlertsClientUpdateSubscriptionLevelStateToInProgressOptions contains the optional parameters for the AlertsClient.UpdateSubscriptionLevelStateToInProgress -// method. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - alertName - Name of the alert object +// - 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) { req, err := client.updateSubscriptionLevelStateToInProgressCreateRequest(ctx, ascLocation, alertName, options) if err != nil { @@ -849,11 +864,12 @@ func (client *AlertsClient) updateSubscriptionLevelStateToInProgressCreateReques // UpdateSubscriptionLevelStateToResolve - Update the alert's state // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-01 -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// alertName - Name of the alert object -// options - AlertsClientUpdateSubscriptionLevelStateToResolveOptions contains the optional parameters for the AlertsClient.UpdateSubscriptionLevelStateToResolve -// method. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - alertName - Name of the alert object +// - 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) { req, err := client.updateSubscriptionLevelStateToResolveCreateRequest(ctx, ascLocation, alertName, options) if err != 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 e50f67dd567e..000000000000 --- a/sdk/resourcemanager/security/armsecurity/alerts_client_example_test.go +++ /dev/null @@ -1,323 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertsSubscription_example.json -func ExampleAlertsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertsResourceGroup_example.json -func ExampleAlertsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("myRg1", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertsSubscriptionsLocation_example.json -func ExampleAlertsClient_NewListSubscriptionLevelByRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListSubscriptionLevelByRegionPager("westeurope", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertsResourceGroupLocation_example.json -func ExampleAlertsClient_NewListResourceGroupLevelByRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListResourceGroupLevelByRegionPager("westeurope", "myRg1", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertSubscriptionLocation_example.json -func ExampleAlertsClient_GetSubscriptionLevel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetSubscriptionLevel(ctx, "westeurope", "2518770965529163669_F144EE95-A3E5-42DA-A279-967D115809AA", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/GetAlertResourceGroupLocation_example.json -func ExampleAlertsClient_GetResourceGroupLevel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetResourceGroupLevel(ctx, "myRg1", "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_dismiss_example.json -func ExampleAlertsClient_UpdateSubscriptionLevelStateToDismiss() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.UpdateSubscriptionLevelStateToDismiss(ctx, "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_resolve_example.json -func ExampleAlertsClient_UpdateSubscriptionLevelStateToResolve() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.UpdateSubscriptionLevelStateToResolve(ctx, "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_activate_example.json -func ExampleAlertsClient_UpdateSubscriptionLevelStateToActivate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.UpdateSubscriptionLevelStateToActivate(ctx, "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertSubscriptionLocation_inProgress_example.json -func ExampleAlertsClient_UpdateSubscriptionLevelStateToInProgress() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.UpdateSubscriptionLevelStateToInProgress(ctx, "westeurope", "2518298467986649999_4d25bfef-2d77-4a08-adc0-3e35715cc92a", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_resolve_example.json -func ExampleAlertsClient_UpdateResourceGroupLevelStateToResolve() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.UpdateResourceGroupLevelStateToResolve(ctx, "myRg2", "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_dismiss_example.json -func ExampleAlertsClient_UpdateResourceGroupLevelStateToDismiss() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.UpdateResourceGroupLevelStateToDismiss(ctx, "myRg2", "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_activate_example.json -func ExampleAlertsClient_UpdateResourceGroupLevelStateToActivate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.UpdateResourceGroupLevelStateToActivate(ctx, "myRg2", "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/UpdateAlertResourceGroupLocation_inProgress_example.json -func ExampleAlertsClient_UpdateResourceGroupLevelStateToInProgress() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.UpdateResourceGroupLevelStateToInProgress(ctx, "myRg2", "westeurope", "2518765996949954086_2325cf9e-42a2-4f72-ae7f-9b863cba2d22", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2022-01-01/examples/Alerts/SimulateAlerts_example.json -func ExampleAlertsClient_BeginSimulate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAlertsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginSimulate(ctx, "centralus", armsecurity.AlertSimulatorRequestBody{ - Properties: &armsecurity.AlertSimulatorBundlesRequestProperties{ - Kind: to.Ptr(armsecurity.KindBundles), - Bundles: []*armsecurity.BundleType{ - to.Ptr(armsecurity.BundleTypeAppServices), - to.Ptr(armsecurity.BundleTypeDNS), - to.Ptr(armsecurity.BundleTypeKeyVaults), - to.Ptr(armsecurity.BundleTypeKubernetesService), - to.Ptr(armsecurity.BundleTypeResourceManager), - to.Ptr(armsecurity.BundleTypeSQLServers), - to.Ptr(armsecurity.BundleTypeStorageAccounts), - to.Ptr(armsecurity.BundleTypeVirtualMachines), - to.Ptr(armsecurity.BundleTypeCosmosDbs)}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/alertssuppressionrules_client.go b/sdk/resourcemanager/security/armsecurity/alertssuppressionrules_client.go index 0752c68e821d..e2383ec8a973 100644 --- a/sdk/resourcemanager/security/armsecurity/alertssuppressionrules_client.go +++ b/sdk/resourcemanager/security/armsecurity/alertssuppressionrules_client.go @@ -32,9 +32,9 @@ type AlertsSuppressionRulesClient struct { } // NewAlertsSuppressionRulesClient creates a new instance of AlertsSuppressionRulesClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAlertsSuppressionRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AlertsSuppressionRulesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,10 +57,11 @@ func NewAlertsSuppressionRulesClient(subscriptionID string, credential azcore.To // Delete - Delete dismiss alert rule for this subscription. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-01-01-preview -// alertsSuppressionRuleName - The unique name of the suppression alert rule -// options - AlertsSuppressionRulesClientDeleteOptions contains the optional parameters for the AlertsSuppressionRulesClient.Delete -// method. +// - alertsSuppressionRuleName - The unique name of the suppression alert rule +// - options - AlertsSuppressionRulesClientDeleteOptions contains the optional parameters for the AlertsSuppressionRulesClient.Delete +// method. func (client *AlertsSuppressionRulesClient) Delete(ctx context.Context, alertsSuppressionRuleName string, options *AlertsSuppressionRulesClientDeleteOptions) (AlertsSuppressionRulesClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, alertsSuppressionRuleName, options) if err != nil { @@ -100,10 +101,11 @@ func (client *AlertsSuppressionRulesClient) deleteCreateRequest(ctx context.Cont // Get - Get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-01-01-preview -// alertsSuppressionRuleName - The unique name of the suppression alert rule -// options - AlertsSuppressionRulesClientGetOptions contains the optional parameters for the AlertsSuppressionRulesClient.Get -// method. +// - alertsSuppressionRuleName - The unique name of the suppression alert rule +// - options - AlertsSuppressionRulesClientGetOptions contains the optional parameters for the AlertsSuppressionRulesClient.Get +// method. func (client *AlertsSuppressionRulesClient) Get(ctx context.Context, alertsSuppressionRuleName string, options *AlertsSuppressionRulesClientGetOptions) (AlertsSuppressionRulesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, alertsSuppressionRuleName, options) if err != nil { @@ -151,9 +153,10 @@ func (client *AlertsSuppressionRulesClient) getHandleResponse(resp *http.Respons } // NewListPager - List of all the dismiss rules for the given subscription +// // Generated from API version 2019-01-01-preview -// options - AlertsSuppressionRulesClientListOptions contains the optional parameters for the AlertsSuppressionRulesClient.List -// method. +// - options - AlertsSuppressionRulesClientListOptions contains the optional parameters for the AlertsSuppressionRulesClient.NewListPager +// method. func (client *AlertsSuppressionRulesClient) NewListPager(options *AlertsSuppressionRulesClientListOptions) *runtime.Pager[AlertsSuppressionRulesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AlertsSuppressionRulesClientListResponse]{ More: func(page AlertsSuppressionRulesClientListResponse) bool { @@ -214,11 +217,12 @@ func (client *AlertsSuppressionRulesClient) listHandleResponse(resp *http.Respon // Update - Update existing rule or create new rule if it doesn't exist // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-01-01-preview -// alertsSuppressionRuleName - The unique name of the suppression alert rule -// alertsSuppressionRule - Suppression rule object -// options - AlertsSuppressionRulesClientUpdateOptions contains the optional parameters for the AlertsSuppressionRulesClient.Update -// method. +// - alertsSuppressionRuleName - The unique name of the suppression alert rule +// - alertsSuppressionRule - Suppression rule object +// - 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) { req, err := client.updateCreateRequest(ctx, alertsSuppressionRuleName, alertsSuppressionRule, options) if err != nil { diff --git a/sdk/resourcemanager/security/armsecurity/alertssuppressionrules_client_example_test.go b/sdk/resourcemanager/security/armsecurity/alertssuppressionrules_client_example_test.go deleted file mode 100644 index 54fa9616bbfc..000000000000 --- a/sdk/resourcemanager/security/armsecurity/alertssuppressionrules_client_example_test.go +++ /dev/null @@ -1,149 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRulesWithAlertType_example.json -func ExampleAlertsSuppressionRulesClient_NewListPager_getSuppressionAlertRuleForSubscriptionFilteredByAlertType() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAlertsSuppressionRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(&armsecurity.AlertsSuppressionRulesClientListOptions{AlertType: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRules_example.json -func ExampleAlertsSuppressionRulesClient_NewListPager_getSuppressionRulesForSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAlertsSuppressionRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(&armsecurity.AlertsSuppressionRulesClientListOptions{AlertType: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/GetAlertsSuppressionRule_example.json -func ExampleAlertsSuppressionRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAlertsSuppressionRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "dismissIpAnomalyAlerts", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/PutAlertsSuppressionRule_example.json -func ExampleAlertsSuppressionRulesClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAlertsSuppressionRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "dismissIpAnomalyAlerts", armsecurity.AlertsSuppressionRule{ - Properties: &armsecurity.AlertsSuppressionRuleProperties{ - AlertType: to.Ptr("IpAnomaly"), - Comment: to.Ptr("Test VM"), - ExpirationDateUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-01T19:50:47.083633Z"); return t }()), - Reason: to.Ptr("FalsePositive"), - State: to.Ptr(armsecurity.RuleStateEnabled), - SuppressionAlertsScope: &armsecurity.SuppressionAlertsScope{ - AllOf: []*armsecurity.ScopeElement{ - { - AdditionalProperties: map[string]interface{}{ - "in": []interface{}{ - "104.215.95.187", - "52.164.206.56", - }, - }, - Field: to.Ptr("entities.ip.address"), - }, - { - AdditionalProperties: map[string]interface{}{ - "contains": "POWERSHELL.EXE", - }, - Field: to.Ptr("entities.process.commandline"), - }}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/AlertsSuppressionRules/DeleteAlertsSuppressionRule_example.json -func ExampleAlertsSuppressionRulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAlertsSuppressionRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "dismissIpAnomalyAlerts", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/allowedconnections_client.go b/sdk/resourcemanager/security/armsecurity/allowedconnections_client.go index 3d1d2ed42cde..f1d2579662e9 100644 --- a/sdk/resourcemanager/security/armsecurity/allowedconnections_client.go +++ b/sdk/resourcemanager/security/armsecurity/allowedconnections_client.go @@ -32,9 +32,9 @@ type AllowedConnectionsClient struct { } // NewAllowedConnectionsClient creates a new instance of AllowedConnectionsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAllowedConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AllowedConnectionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewAllowedConnectionsClient(subscriptionID string, credential azcore.TokenC // Get - Gets the list of all possible traffic between resources for the subscription and location, based on connection type. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// connectionType - The type of allowed connections (Internal, External) -// options - AllowedConnectionsClientGetOptions contains the optional parameters for the AllowedConnectionsClient.Get method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - 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) { req, err := client.getCreateRequest(ctx, resourceGroupName, ascLocation, connectionType, options) if err != nil { @@ -117,8 +118,10 @@ func (client *AllowedConnectionsClient) getHandleResponse(resp *http.Response) ( } // NewListPager - Gets the list of all possible traffic between resources for the subscription +// // Generated from API version 2020-01-01 -// options - AllowedConnectionsClientListOptions contains the optional parameters for the AllowedConnectionsClient.List method. +// - options - AllowedConnectionsClientListOptions contains the optional parameters for the AllowedConnectionsClient.NewListPager +// method. func (client *AllowedConnectionsClient) NewListPager(options *AllowedConnectionsClientListOptions) *runtime.Pager[AllowedConnectionsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AllowedConnectionsClientListResponse]{ More: func(page AllowedConnectionsClientListResponse) bool { @@ -175,10 +178,11 @@ func (client *AllowedConnectionsClient) listHandleResponse(resp *http.Response) } // NewListByHomeRegionPager - Gets the list of all possible traffic between resources for the subscription and location. +// // Generated from API version 2020-01-01 -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// options - AllowedConnectionsClientListByHomeRegionOptions contains the optional parameters for the AllowedConnectionsClient.ListByHomeRegion -// method. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - options - AllowedConnectionsClientListByHomeRegionOptions contains the optional parameters for the AllowedConnectionsClient.NewListByHomeRegionPager +// method. func (client *AllowedConnectionsClient) NewListByHomeRegionPager(ascLocation string, options *AllowedConnectionsClientListByHomeRegionOptions) *runtime.Pager[AllowedConnectionsClientListByHomeRegionResponse] { return runtime.NewPager(runtime.PagingHandler[AllowedConnectionsClientListByHomeRegionResponse]{ More: func(page AllowedConnectionsClientListByHomeRegionResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/allowedconnections_client_example_test.go b/sdk/resourcemanager/security/armsecurity/allowedconnections_client_example_test.go deleted file mode 100644 index 00a316323c4a..000000000000 --- a/sdk/resourcemanager/security/armsecurity/allowedconnections_client_example_test.go +++ /dev/null @@ -1,84 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/GetAllowedConnectionsSubscription_example.json -func ExampleAllowedConnectionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAllowedConnectionsClient("3eeab341-f466-499c-a8be-85427e154bad", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/GetAllowedConnectionsSubscriptionLocation_example.json -func ExampleAllowedConnectionsClient_NewListByHomeRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAllowedConnectionsClient("3eeab341-f466-499c-a8be-85427e154bad", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByHomeRegionPager("centralus", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/AllowedConnections/GetAllowedConnections_example.json -func ExampleAllowedConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAllowedConnectionsClient("3eeab341-f466-499c-a8be-85427e154bad", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myResourceGroup", "centralus", armsecurity.ConnectionTypeInternal, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/apicollection_client.go b/sdk/resourcemanager/security/armsecurity/apicollection_client.go new file mode 100644 index 000000000000..0fa66b0406ae --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/apicollection_client.go @@ -0,0 +1,192 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for 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" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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 { + host string + subscriptionID string + pl runtime.Pipeline +} + +// 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) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &APICollectionClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + 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.pl.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.host, 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.pl.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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-20-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *APICollectionClient) listHandleResponse(resp *http.Response) (APICollectionClientListResponse, error) { + result := APICollectionClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.APICollectionResponseList); err != nil { + return APICollectionClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/apicollectionoffboarding_client.go b/sdk/resourcemanager/security/armsecurity/apicollectionoffboarding_client.go new file mode 100644 index 000000000000..38fd5102a565 --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/apicollectionoffboarding_client.go @@ -0,0 +1,112 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for 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" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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 { + host string + subscriptionID string + pl runtime.Pipeline +} + +// 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) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &APICollectionOffboardingClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + 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.pl.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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-20-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/apicollectiononboarding_client.go b/sdk/resourcemanager/security/armsecurity/apicollectiononboarding_client.go new file mode 100644 index 000000000000..1034f6356b46 --- /dev/null +++ b/sdk/resourcemanager/security/armsecurity/apicollectiononboarding_client.go @@ -0,0 +1,122 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for 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" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "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 { + host string + subscriptionID string + pl runtime.Pipeline +} + +// 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) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &APICollectionOnboardingClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + 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.pl.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.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-20-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// createHandleResponse handles the Create response. +func (client *APICollectionOnboardingClient) createHandleResponse(resp *http.Response) (APICollectionOnboardingClientCreateResponse, error) { + result := APICollectionOnboardingClientCreateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.APICollectionResponse); err != nil { + return APICollectionOnboardingClientCreateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/application_client.go b/sdk/resourcemanager/security/armsecurity/application_client.go index 796f510b90ca..8617efa5c214 100644 --- a/sdk/resourcemanager/security/armsecurity/application_client.go +++ b/sdk/resourcemanager/security/armsecurity/application_client.go @@ -32,9 +32,9 @@ type ApplicationClient struct { } // NewApplicationClient creates a new instance of ApplicationClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewApplicationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewApplicationClient(subscriptionID string, credential azcore.TokenCredenti // CreateOrUpdate - Creates or update a security application on the given subscription. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-07-01-preview -// applicationID - The security Application key - unique key for the standard application -// application - Application over a subscription scope -// options - ApplicationClientCreateOrUpdateOptions contains the optional parameters for the ApplicationClient.CreateOrUpdate -// method. +// - applicationID - The security Application key - unique key for the standard application +// - application - Application over a subscription scope +// - 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) { req, err := client.createOrUpdateCreateRequest(ctx, applicationID, application, options) if err != nil { @@ -110,9 +111,10 @@ func (client *ApplicationClient) createOrUpdateHandleResponse(resp *http.Respons // Delete - Delete an Application over a given scope // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-07-01-preview -// applicationID - The security Application key - unique key for the standard application -// options - ApplicationClientDeleteOptions contains the optional parameters for the ApplicationClient.Delete method. +// - 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) { req, err := client.deleteCreateRequest(ctx, applicationID, options) if err != nil { @@ -151,9 +153,10 @@ func (client *ApplicationClient) deleteCreateRequest(ctx context.Context, applic // Get - Get a specific application for the requested scope by applicationId // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-07-01-preview -// applicationID - The security Application key - unique key for the standard application -// options - ApplicationClientGetOptions contains the optional parameters for the ApplicationClient.Get method. +// - 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) { req, err := client.getCreateRequest(ctx, applicationID, options) if err != nil { diff --git a/sdk/resourcemanager/security/armsecurity/application_client_example_test.go b/sdk/resourcemanager/security/armsecurity/application_client_example_test.go deleted file mode 100644 index 0b14d808a1a2..000000000000 --- a/sdk/resourcemanager/security/armsecurity/application_client_example_test.go +++ /dev/null @@ -1,89 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/GetApplication_example.json -func ExampleApplicationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewApplicationClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/PutApplication_example.json -func ExampleApplicationClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewApplicationClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", armsecurity.Application{ - Properties: &armsecurity.ApplicationProperties{ - Description: to.Ptr("An application on critical recommendations"), - ConditionSets: []interface{}{ - map[string]interface{}{ - "conditions": []interface{}{ - map[string]interface{}{ - "operator": "contains", - "property": "$.Id", - "value": "-bil-", - }, - }, - }}, - DisplayName: to.Ptr("Admin's application"), - SourceResourceType: to.Ptr(armsecurity.ApplicationSourceResourceTypeAssessments), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/DeleteApplication_example.json -func ExampleApplicationClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewApplicationClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/applications_client.go b/sdk/resourcemanager/security/armsecurity/applications_client.go index 656a08325ebb..1ae508f33c22 100644 --- a/sdk/resourcemanager/security/armsecurity/applications_client.go +++ b/sdk/resourcemanager/security/armsecurity/applications_client.go @@ -32,9 +32,9 @@ type ApplicationsClient struct { } // NewApplicationsClient creates a new instance of ApplicationsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewApplicationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,8 +56,9 @@ func NewApplicationsClient(subscriptionID string, credential azcore.TokenCredent } // NewListPager - Get a list of all relevant applications over a subscription level scope +// // Generated from API version 2022-07-01-preview -// options - ApplicationsClientListOptions contains the optional parameters for the ApplicationsClient.List method. +// - options - ApplicationsClientListOptions contains the optional parameters for the ApplicationsClient.NewListPager method. func (client *ApplicationsClient) NewListPager(options *ApplicationsClientListOptions) *runtime.Pager[ApplicationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ApplicationsClientListResponse]{ More: func(page ApplicationsClientListResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/applications_client_example_test.go b/sdk/resourcemanager/security/armsecurity/applications_client_example_test.go deleted file mode 100644 index d652401fa85e..000000000000 --- a/sdk/resourcemanager/security/armsecurity/applications_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ListBySubscriptionApplications_example.json -func ExampleApplicationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewApplicationsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/assessments_client.go b/sdk/resourcemanager/security/armsecurity/assessments_client.go index 76a2f6f3ccc7..1db0d1ac0bc0 100644 --- a/sdk/resourcemanager/security/armsecurity/assessments_client.go +++ b/sdk/resourcemanager/security/armsecurity/assessments_client.go @@ -31,8 +31,8 @@ type AssessmentsClient struct { } // NewAssessmentsClient creates a new instance of AssessmentsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAssessmentsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*AssessmentsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -55,12 +55,13 @@ func NewAssessmentsClient(credential azcore.TokenCredential, options *arm.Client // CreateOrUpdate - Create a security assessment on your resource. An assessment metadata that describes this assessment must // be predefined with the same name before inserting the assessment result // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceID - The identifier of the resource. -// assessmentName - The Assessment Key - Unique key for the assessment type -// assessment - Calculated assessment on a pre-defined assessment metadata -// options - AssessmentsClientCreateOrUpdateOptions contains the optional parameters for the AssessmentsClient.CreateOrUpdate -// method. +// - resourceID - The identifier of the resource. +// - assessmentName - The Assessment Key - Unique key for the assessment type +// - assessment - Calculated assessment on a pre-defined assessment metadata +// - 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) { req, err := client.createOrUpdateCreateRequest(ctx, resourceID, assessmentName, assessment, options) if err != nil { @@ -107,10 +108,11 @@ func (client *AssessmentsClient) createOrUpdateHandleResponse(resp *http.Respons // Delete - Delete a security assessment on your resource. An assessment metadata that describes this assessment must be predefined // with the same name before inserting the assessment result // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceID - The identifier of the resource. -// assessmentName - The Assessment Key - Unique key for the assessment type -// options - AssessmentsClientDeleteOptions contains the optional parameters for the AssessmentsClient.Delete method. +// - resourceID - The identifier of the resource. +// - 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) { req, err := client.deleteCreateRequest(ctx, resourceID, assessmentName, options) if err != nil { @@ -147,10 +149,11 @@ func (client *AssessmentsClient) deleteCreateRequest(ctx context.Context, resour // Get - Get a security assessment on your scanned resource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// resourceID - The identifier of the resource. -// assessmentName - The Assessment Key - Unique key for the assessment type -// options - AssessmentsClientGetOptions contains the optional parameters for the AssessmentsClient.Get method. +// - resourceID - The identifier of the resource. +// - 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) { req, err := client.getCreateRequest(ctx, resourceID, assessmentName, options) if err != nil { @@ -198,10 +201,11 @@ func (client *AssessmentsClient) getHandleResponse(resp *http.Response) (Assessm } // NewListPager - Get security assessments on all your scanned resources inside a scope +// // Generated from API version 2021-06-01 -// scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group -// (/providers/Microsoft.Management/managementGroups/mgName). -// options - AssessmentsClientListOptions contains the optional parameters for the AssessmentsClient.List method. +// - scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group +// (/providers/Microsoft.Management/managementGroups/mgName). +// - options - AssessmentsClientListOptions contains the optional parameters for the AssessmentsClient.NewListPager method. func (client *AssessmentsClient) NewListPager(scope string, options *AssessmentsClientListOptions) *runtime.Pager[AssessmentsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AssessmentsClientListResponse]{ More: func(page AssessmentsClientListResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/assessments_client_example_test.go b/sdk/resourcemanager/security/armsecurity/assessments_client_example_test.go deleted file mode 100644 index f9f558d04999..000000000000 --- a/sdk/resourcemanager/security/armsecurity/assessments_client_example_test.go +++ /dev/null @@ -1,125 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/ListAssessments_example.json -func ExampleAssessmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAssessmentsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/GetAssessment_example.json -func ExampleAssessmentsClient_Get_getSecurityRecommendationTaskFromSecurityDataLocation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAssessmentsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", "21300918-b2e3-0346-785f-c77ff57d243b", &armsecurity.AssessmentsClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/GetAssessmentWithExpand_example.json -func ExampleAssessmentsClient_Get_getSecurityRecommendationTaskFromSecurityDataLocationWithExpandParameter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAssessmentsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", "21300918-b2e3-0346-785f-c77ff57d243b", &armsecurity.AssessmentsClientGetOptions{Expand: to.Ptr(armsecurity.ExpandEnumLinks)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/PutAssessment_example.json -func ExampleAssessmentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAssessmentsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", "8bb8be0a-6010-4789-812f-e4d661c4ed0e", armsecurity.Assessment{ - Properties: &armsecurity.AssessmentProperties{ - ResourceDetails: &armsecurity.AzureResourceDetails{ - Source: to.Ptr(armsecurity.SourceAzure), - }, - Status: &armsecurity.AssessmentStatus{ - Code: to.Ptr(armsecurity.AssessmentStatusCodeHealthy), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/Assessments/DeleteAssessment_example.json -func ExampleAssessmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAssessmentsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.Compute/virtualMachineScaleSets/vmss2", "8bb8be0a-6010-4789-812f-e4d661c4ed0e", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/assessmentsmetadata_client.go b/sdk/resourcemanager/security/armsecurity/assessmentsmetadata_client.go index 20db186eeaf3..fd7963ed3270 100644 --- a/sdk/resourcemanager/security/armsecurity/assessmentsmetadata_client.go +++ b/sdk/resourcemanager/security/armsecurity/assessmentsmetadata_client.go @@ -32,9 +32,9 @@ type AssessmentsMetadataClient struct { } // NewAssessmentsMetadataClient creates a new instance of AssessmentsMetadataClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAssessmentsMetadataClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AssessmentsMetadataClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewAssessmentsMetadataClient(subscriptionID string, credential azcore.Token // CreateInSubscription - Create metadata information on an assessment type in a specific subscription // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// assessmentMetadataName - The Assessment Key - Unique key for the assessment type -// assessmentMetadata - AssessmentMetadata object -// options - AssessmentsMetadataClientCreateInSubscriptionOptions contains the optional parameters for the AssessmentsMetadataClient.CreateInSubscription -// method. +// - assessmentMetadataName - The Assessment Key - Unique key for the assessment type +// - assessmentMetadata - AssessmentMetadata object +// - 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) { req, err := client.createInSubscriptionCreateRequest(ctx, assessmentMetadataName, assessmentMetadata, options) if err != nil { @@ -111,10 +112,11 @@ func (client *AssessmentsMetadataClient) createInSubscriptionHandleResponse(resp // DeleteInSubscription - Delete metadata information on an assessment type in a specific subscription, will cause the deletion // of all the assessments of that type in that subscription // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// assessmentMetadataName - The Assessment Key - Unique key for the assessment type -// options - AssessmentsMetadataClientDeleteInSubscriptionOptions contains the optional parameters for the AssessmentsMetadataClient.DeleteInSubscription -// method. +// - assessmentMetadataName - The Assessment Key - Unique key for the assessment type +// - options - AssessmentsMetadataClientDeleteInSubscriptionOptions contains the optional parameters for the AssessmentsMetadataClient.DeleteInSubscription +// method. func (client *AssessmentsMetadataClient) DeleteInSubscription(ctx context.Context, assessmentMetadataName string, options *AssessmentsMetadataClientDeleteInSubscriptionOptions) (AssessmentsMetadataClientDeleteInSubscriptionResponse, error) { req, err := client.deleteInSubscriptionCreateRequest(ctx, assessmentMetadataName, options) if err != nil { @@ -154,9 +156,10 @@ func (client *AssessmentsMetadataClient) deleteInSubscriptionCreateRequest(ctx c // Get - Get metadata information on an assessment type // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// assessmentMetadataName - The Assessment Key - Unique key for the assessment type -// options - AssessmentsMetadataClientGetOptions contains the optional parameters for the AssessmentsMetadataClient.Get method. +// - 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) { req, err := client.getCreateRequest(ctx, assessmentMetadataName, options) if err != nil { @@ -201,10 +204,11 @@ func (client *AssessmentsMetadataClient) getHandleResponse(resp *http.Response) // GetInSubscription - Get metadata information on an assessment type in a specific subscription // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-06-01 -// assessmentMetadataName - The Assessment Key - Unique key for the assessment type -// options - AssessmentsMetadataClientGetInSubscriptionOptions contains the optional parameters for the AssessmentsMetadataClient.GetInSubscription -// method. +// - assessmentMetadataName - The Assessment Key - Unique key for the assessment type +// - options - AssessmentsMetadataClientGetInSubscriptionOptions contains the optional parameters for the AssessmentsMetadataClient.GetInSubscription +// method. func (client *AssessmentsMetadataClient) GetInSubscription(ctx context.Context, assessmentMetadataName string, options *AssessmentsMetadataClientGetInSubscriptionOptions) (AssessmentsMetadataClientGetInSubscriptionResponse, error) { req, err := client.getInSubscriptionCreateRequest(ctx, assessmentMetadataName, options) if err != nil { @@ -252,9 +256,10 @@ func (client *AssessmentsMetadataClient) getInSubscriptionHandleResponse(resp *h } // NewListPager - Get metadata information on all assessment types +// // Generated from API version 2021-06-01 -// options - AssessmentsMetadataClientListOptions contains the optional parameters for the AssessmentsMetadataClient.List -// method. +// - options - AssessmentsMetadataClientListOptions contains the optional parameters for the AssessmentsMetadataClient.NewListPager +// method. func (client *AssessmentsMetadataClient) NewListPager(options *AssessmentsMetadataClientListOptions) *runtime.Pager[AssessmentsMetadataClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AssessmentsMetadataClientListResponse]{ More: func(page AssessmentsMetadataClientListResponse) bool { @@ -307,9 +312,10 @@ func (client *AssessmentsMetadataClient) listHandleResponse(resp *http.Response) } // NewListBySubscriptionPager - Get metadata information on all assessment types in a specific subscription +// // Generated from API version 2021-06-01 -// options - AssessmentsMetadataClientListBySubscriptionOptions contains the optional parameters for the AssessmentsMetadataClient.ListBySubscription -// method. +// - options - AssessmentsMetadataClientListBySubscriptionOptions contains the optional parameters for the AssessmentsMetadataClient.NewListBySubscriptionPager +// method. func (client *AssessmentsMetadataClient) NewListBySubscriptionPager(options *AssessmentsMetadataClientListBySubscriptionOptions) *runtime.Pager[AssessmentsMetadataClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[AssessmentsMetadataClientListBySubscriptionResponse]{ More: func(page AssessmentsMetadataClientListBySubscriptionResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/assessmentsmetadata_client_example_test.go b/sdk/resourcemanager/security/armsecurity/assessmentsmetadata_client_example_test.go deleted file mode 100644 index 79906f8b6dee..000000000000 --- a/sdk/resourcemanager/security/armsecurity/assessmentsmetadata_client_example_test.go +++ /dev/null @@ -1,156 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/ListAssessmentsMetadata_example.json -func ExampleAssessmentsMetadataClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAssessmentsMetadataClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/GetAssessmentsMetadata_example.json -func ExampleAssessmentsMetadataClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAssessmentsMetadataClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "21300918-b2e3-0346-785f-c77ff57d243b", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/ListAssessmentsMetadata_subscription_example.json -func ExampleAssessmentsMetadataClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAssessmentsMetadataClient("0980887d-03d6-408c-9566-532f3456804e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/GetAssessmentsMetadata_subscription_example.json -func ExampleAssessmentsMetadataClient_GetInSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAssessmentsMetadataClient("0980887d-03d6-408c-9566-532f3456804e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetInSubscription(ctx, "21300918-b2e3-0346-785f-c77ff57d243b", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/CreateAssessmentsMetadata_subscription_example.json -func ExampleAssessmentsMetadataClient_CreateInSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAssessmentsMetadataClient("0980887d-03d6-408c-9566-532f3456804e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateInSubscription(ctx, "ca039e75-a276-4175-aebc-bcd41e4b14b7", armsecurity.AssessmentMetadataResponse{ - Properties: &armsecurity.AssessmentMetadataPropertiesResponse{ - Description: to.Ptr("Install an endpoint protection solution on your virtual machines scale sets, to protect them from threats and vulnerabilities."), - AssessmentType: to.Ptr(armsecurity.AssessmentTypeCustomerManaged), - Categories: []*armsecurity.Categories{ - to.Ptr(armsecurity.CategoriesCompute)}, - DisplayName: to.Ptr("Install endpoint protection solution on virtual machine scale sets"), - ImplementationEffort: to.Ptr(armsecurity.ImplementationEffortLow), - RemediationDescription: to.Ptr("To install an endpoint protection solution: 1. Follow the instructions in How do I turn on antimalware in my virtual machine scale set"), - Severity: to.Ptr(armsecurity.SeverityMedium), - Threats: []*armsecurity.Threats{ - to.Ptr(armsecurity.ThreatsDataExfiltration), - to.Ptr(armsecurity.ThreatsDataSpillage), - to.Ptr(armsecurity.ThreatsMaliciousInsider)}, - UserImpact: to.Ptr(armsecurity.UserImpactLow), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2021-06-01/examples/AssessmentsMetadata/DeleteAssessmentsMetadata_subscription_example.json -func ExampleAssessmentsMetadataClient_DeleteInSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAssessmentsMetadataClient("0980887d-03d6-408c-9566-532f3456804e", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.DeleteInSubscription(ctx, "ca039e75-a276-4175-aebc-bcd41e4b14b7", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/automations_client.go b/sdk/resourcemanager/security/armsecurity/automations_client.go index 6db4c1c63d5d..64729935eb6b 100644 --- a/sdk/resourcemanager/security/armsecurity/automations_client.go +++ b/sdk/resourcemanager/security/armsecurity/automations_client.go @@ -32,9 +32,9 @@ type AutomationsClient struct { } // NewAutomationsClient creates a new instance of AutomationsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAutomationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AutomationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewAutomationsClient(subscriptionID string, credential azcore.TokenCredenti // CreateOrUpdate - Creates or updates a security automation. If a security automation is already created and a subsequent // request is issued for the same automation id, then it will be updated. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-01-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// automationName - The security automation name. -// automation - The security automation resource -// options - AutomationsClientCreateOrUpdateOptions contains the optional parameters for the AutomationsClient.CreateOrUpdate -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - automationName - The security automation name. +// - automation - The security automation resource +// - 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) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, automationName, automation, options) if err != nil { @@ -116,10 +117,11 @@ func (client *AutomationsClient) createOrUpdateHandleResponse(resp *http.Respons // Delete - Deletes a security automation. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-01-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// automationName - The security automation name. -// options - AutomationsClientDeleteOptions contains the optional parameters for the AutomationsClient.Delete method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - 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) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, automationName, options) if err != nil { @@ -163,10 +165,11 @@ func (client *AutomationsClient) deleteCreateRequest(ctx context.Context, resour // Get - Retrieves information about the model of a security automation. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-01-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// automationName - The security automation name. -// options - AutomationsClientGetOptions contains the optional parameters for the AutomationsClient.Get method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - 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) { req, err := client.getCreateRequest(ctx, resourceGroupName, automationName, options) if err != nil { @@ -219,8 +222,9 @@ func (client *AutomationsClient) getHandleResponse(resp *http.Response) (Automat // NewListPager - Lists all the security automations in the specified subscription. Use the 'nextLink' property in the response // to get the next page of security automations for the specified subscription. +// // Generated from API version 2019-01-01-preview -// options - AutomationsClientListOptions contains the optional parameters for the AutomationsClient.List method. +// - options - AutomationsClientListOptions contains the optional parameters for the AutomationsClient.NewListPager method. func (client *AutomationsClient) NewListPager(options *AutomationsClientListOptions) *runtime.Pager[AutomationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AutomationsClientListResponse]{ More: func(page AutomationsClientListResponse) bool { @@ -278,10 +282,11 @@ func (client *AutomationsClient) listHandleResponse(resp *http.Response) (Automa // NewListByResourceGroupPager - Lists all the security automations in the specified resource group. Use the 'nextLink' property // in the response to get the next page of security automations for the specified resource group. +// // Generated from API version 2019-01-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// options - AutomationsClientListByResourceGroupOptions contains the optional parameters for the AutomationsClient.ListByResourceGroup -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - options - AutomationsClientListByResourceGroupOptions contains the optional parameters for the AutomationsClient.NewListByResourceGroupPager +// method. func (client *AutomationsClient) NewListByResourceGroupPager(resourceGroupName string, options *AutomationsClientListByResourceGroupOptions) *runtime.Pager[AutomationsClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[AutomationsClientListByResourceGroupResponse]{ More: func(page AutomationsClientListByResourceGroupResponse) bool { @@ -343,11 +348,12 @@ func (client *AutomationsClient) listByResourceGroupHandleResponse(resp *http.Re // Validate - Validates the security automation model before create or update. Any validation errors are returned to the client. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-01-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// automationName - The security automation name. -// automation - The security automation resource -// options - AutomationsClientValidateOptions contains the optional parameters for the AutomationsClient.Validate method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - automationName - The security automation name. +// - 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) { req, err := client.validateCreateRequest(ctx, resourceGroupName, automationName, automation, options) if err != nil { diff --git a/sdk/resourcemanager/security/armsecurity/automations_client_example_test.go b/sdk/resourcemanager/security/armsecurity/automations_client_example_test.go deleted file mode 100644 index 4f4642ddcbad..000000000000 --- a/sdk/resourcemanager/security/armsecurity/automations_client_example_test.go +++ /dev/null @@ -1,299 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/GetAutomationsSubscription_example.json -func ExampleAutomationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAutomationsClient("a5caac9c-5c04-49af-b3d0-e204f40345d5", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/GetAutomationsResourceGroup_example.json -func ExampleAutomationsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAutomationsClient("a5caac9c-5c04-49af-b3d0-e204f40345d5", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("exampleResourceGroup", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/GetAutomationResourceGroup_example.json -func ExampleAutomationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAutomationsClient("a5caac9c-5c04-49af-b3d0-e204f40345d5", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "exampleResourceGroup", "exampleAutomation", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/PutAutomationAllAssessments_example.json -func ExampleAutomationsClient_CreateOrUpdate_createOrUpdateASecurityAutomationForAllAssessmentsIncludingAllSeverities() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAutomationsClient("a5caac9c-5c04-49af-b3d0-e204f40345d5", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "exampleResourceGroup", "exampleAutomation", armsecurity.Automation{ - Location: to.Ptr("Central US"), - Etag: to.Ptr("etag value (must be supplied for update)"), - Tags: map[string]*string{}, - Properties: &armsecurity.AutomationProperties{ - Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment"), - Actions: []armsecurity.AutomationActionClassification{ - &armsecurity.AutomationActionLogicApp{ - ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - URI: to.Ptr("https://exampleTriggerUri1.com"), - }}, - IsEnabled: to.Ptr(true), - Scopes: []*armsecurity.AutomationScope{ - { - Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - }}, - Sources: []*armsecurity.AutomationSource{ - { - EventSource: to.Ptr(armsecurity.EventSourceAssessments), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/PutAutomationHighSeverityAssessments_example.json -func ExampleAutomationsClient_CreateOrUpdate_createOrUpdateASecurityAutomationForAllHighSeverityAssessments() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAutomationsClient("a5caac9c-5c04-49af-b3d0-e204f40345d5", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "exampleResourceGroup", "exampleAutomation", armsecurity.Automation{ - Location: to.Ptr("Central US"), - Etag: to.Ptr("etag value (must be supplied for update)"), - Tags: map[string]*string{}, - Properties: &armsecurity.AutomationProperties{ - Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any high severity security assessment"), - Actions: []armsecurity.AutomationActionClassification{ - &armsecurity.AutomationActionLogicApp{ - ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - URI: to.Ptr("https://exampleTriggerUri1.com"), - }}, - IsEnabled: to.Ptr(true), - Scopes: []*armsecurity.AutomationScope{ - { - Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - }}, - Sources: []*armsecurity.AutomationSource{ - { - EventSource: to.Ptr(armsecurity.EventSourceAssessments), - RuleSets: []*armsecurity.AutomationRuleSet{ - { - Rules: []*armsecurity.AutomationTriggeringRule{ - { - ExpectedValue: to.Ptr("High"), - Operator: to.Ptr(armsecurity.OperatorEquals), - PropertyJPath: to.Ptr("properties.metadata.severity"), - PropertyType: to.Ptr(armsecurity.PropertyTypeString), - }}, - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/PutDisableAutomation_example.json -func ExampleAutomationsClient_CreateOrUpdate_disableOrEnableASecurityAutomation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAutomationsClient("a5caac9c-5c04-49af-b3d0-e204f40345d5", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "exampleResourceGroup", "exampleAutomation", armsecurity.Automation{ - Location: to.Ptr("Central US"), - Etag: to.Ptr("etag value (must be supplied for update)"), - Tags: map[string]*string{}, - Properties: &armsecurity.AutomationProperties{ - Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment"), - Actions: []armsecurity.AutomationActionClassification{ - &armsecurity.AutomationActionLogicApp{ - ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - URI: to.Ptr("https://exampleTriggerUri1.com"), - }}, - IsEnabled: to.Ptr(false), - Scopes: []*armsecurity.AutomationScope{ - { - Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - }}, - Sources: []*armsecurity.AutomationSource{ - { - EventSource: to.Ptr(armsecurity.EventSourceAssessments), - RuleSets: []*armsecurity.AutomationRuleSet{ - { - Rules: []*armsecurity.AutomationTriggeringRule{ - { - ExpectedValue: to.Ptr("customAssessment"), - Operator: to.Ptr(armsecurity.OperatorEquals), - PropertyJPath: to.Ptr("$.Entity.AssessmentType"), - PropertyType: to.Ptr(armsecurity.PropertyTypeString), - }}, - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/DeleteAutomation_example.json -func ExampleAutomationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAutomationsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "myRg", "myAutomationName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/Automations/ValidateAutomation_example.json -func ExampleAutomationsClient_Validate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAutomationsClient("a5caac9c-5c04-49af-b3d0-e204f40345d5", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Validate(ctx, "exampleResourceGroup", "exampleAutomation", armsecurity.Automation{ - Location: to.Ptr("Central US"), - Tags: map[string]*string{}, - Properties: &armsecurity.AutomationProperties{ - Description: to.Ptr("An example of a security automation that triggers one LogicApp resource (myTest1) on any security assessment of type customAssessment"), - Actions: []armsecurity.AutomationActionClassification{ - &armsecurity.AutomationActionLogicApp{ - ActionType: to.Ptr(armsecurity.ActionTypeLogicApp), - LogicAppResourceID: to.Ptr("/subscriptions/e54a4a18-5b94-4f90-9471-bd3decad8a2e/resourceGroups/sample/providers/Microsoft.Logic/workflows/MyTest1"), - URI: to.Ptr("https://exampleTriggerUri1.com"), - }}, - IsEnabled: to.Ptr(true), - Scopes: []*armsecurity.AutomationScope{ - { - Description: to.Ptr("A description that helps to identify this scope - for example: security assessments that relate to the resource group myResourceGroup within the subscription a5caac9c-5c04-49af-b3d0-e204f40345d5"), - ScopePath: to.Ptr("/subscriptions/a5caac9c-5c04-49af-b3d0-e204f40345d5/resourceGroups/myResourceGroup"), - }}, - Sources: []*armsecurity.AutomationSource{ - { - EventSource: to.Ptr(armsecurity.EventSourceAssessments), - RuleSets: []*armsecurity.AutomationRuleSet{ - { - Rules: []*armsecurity.AutomationTriggeringRule{ - { - ExpectedValue: to.Ptr("customAssessment"), - Operator: to.Ptr(armsecurity.OperatorEquals), - PropertyJPath: to.Ptr("$.Entity.AssessmentType"), - PropertyType: to.Ptr(armsecurity.PropertyTypeString), - }}, - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/autoprovisioningsettings_client.go b/sdk/resourcemanager/security/armsecurity/autoprovisioningsettings_client.go index 67f530d9204f..58bd6840110d 100644 --- a/sdk/resourcemanager/security/armsecurity/autoprovisioningsettings_client.go +++ b/sdk/resourcemanager/security/armsecurity/autoprovisioningsettings_client.go @@ -32,9 +32,9 @@ type AutoProvisioningSettingsClient struct { } // NewAutoProvisioningSettingsClient creates a new instance of AutoProvisioningSettingsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAutoProvisioningSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AutoProvisioningSettingsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewAutoProvisioningSettingsClient(subscriptionID string, credential azcore. // Create - Details of a specific setting // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2017-08-01-preview -// settingName - Auto provisioning setting key -// setting - Auto provisioning setting key -// options - AutoProvisioningSettingsClientCreateOptions contains the optional parameters for the AutoProvisioningSettingsClient.Create -// method. +// - settingName - Auto provisioning setting key +// - setting - Auto provisioning setting key +// - 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) { req, err := client.createCreateRequest(ctx, settingName, setting, options) if err != nil { @@ -110,10 +111,11 @@ func (client *AutoProvisioningSettingsClient) createHandleResponse(resp *http.Re // Get - Details of a specific setting // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2017-08-01-preview -// settingName - Auto provisioning setting key -// options - AutoProvisioningSettingsClientGetOptions contains the optional parameters for the AutoProvisioningSettingsClient.Get -// method. +// - settingName - Auto provisioning setting key +// - options - AutoProvisioningSettingsClientGetOptions contains the optional parameters for the AutoProvisioningSettingsClient.Get +// method. func (client *AutoProvisioningSettingsClient) Get(ctx context.Context, settingName string, options *AutoProvisioningSettingsClientGetOptions) (AutoProvisioningSettingsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, settingName, options) if err != nil { @@ -161,9 +163,10 @@ func (client *AutoProvisioningSettingsClient) getHandleResponse(resp *http.Respo } // NewListPager - Exposes the auto provisioning settings of the subscriptions +// // Generated from API version 2017-08-01-preview -// options - AutoProvisioningSettingsClientListOptions contains the optional parameters for the AutoProvisioningSettingsClient.List -// method. +// - options - AutoProvisioningSettingsClientListOptions contains the optional parameters for the AutoProvisioningSettingsClient.NewListPager +// method. func (client *AutoProvisioningSettingsClient) NewListPager(options *AutoProvisioningSettingsClientListOptions) *runtime.Pager[AutoProvisioningSettingsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[AutoProvisioningSettingsClientListResponse]{ More: func(page AutoProvisioningSettingsClientListResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/autoprovisioningsettings_client_example_test.go b/sdk/resourcemanager/security/armsecurity/autoprovisioningsettings_client_example_test.go deleted file mode 100644 index 672174227791..000000000000 --- a/sdk/resourcemanager/security/armsecurity/autoprovisioningsettings_client_example_test.go +++ /dev/null @@ -1,87 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/AutoProvisioningSettings/GetAutoProvisioningSettingsSubscription_example.json -func ExampleAutoProvisioningSettingsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAutoProvisioningSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/AutoProvisioningSettings/GetAutoProvisioningSettingSubscription_example.json -func ExampleAutoProvisioningSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAutoProvisioningSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/AutoProvisioningSettings/CreateAutoProvisioningSettingsSubscription_example.json -func ExampleAutoProvisioningSettingsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewAutoProvisioningSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, "default", armsecurity.AutoProvisioningSetting{ - Name: to.Ptr("default"), - Type: to.Ptr("Microsoft.Security/autoProvisioningSettings"), - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/autoProvisioningSettings/default"), - Properties: &armsecurity.AutoProvisioningSettingProperties{ - AutoProvision: to.Ptr(armsecurity.AutoProvisionOn), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/autorest.md b/sdk/resourcemanager/security/armsecurity/autorest.md index 3311270df29b..47aabc7eb588 100644 --- a/sdk/resourcemanager/security/armsecurity/autorest.md +++ b/sdk/resourcemanager/security/armsecurity/autorest.md @@ -4,12 +4,11 @@ ``` yaml azure-arm: true -tag: package-composite-v3 require: -- https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/af3f7994582c0cbd61a48b636907ad2ac95d332c/specification/security/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/security/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/security/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.9.0 +module-version: 0.10.0 modelerfour: lenient-model-deduplication: true ``` \ No newline at end of file diff --git a/sdk/resourcemanager/security/armsecurity/complianceresults_client.go b/sdk/resourcemanager/security/armsecurity/complianceresults_client.go index ce13a606e7c6..f02bca3936aa 100644 --- a/sdk/resourcemanager/security/armsecurity/complianceresults_client.go +++ b/sdk/resourcemanager/security/armsecurity/complianceresults_client.go @@ -31,8 +31,8 @@ type ComplianceResultsClient struct { } // NewComplianceResultsClient creates a new instance of ComplianceResultsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewComplianceResultsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*ComplianceResultsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -54,10 +54,11 @@ func NewComplianceResultsClient(credential azcore.TokenCredential, options *arm. // Get - Security Compliance Result // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2017-08-01 -// resourceID - The identifier of the resource. -// complianceResultName - name of the desired assessment compliance result -// options - ComplianceResultsClientGetOptions contains the optional parameters for the ComplianceResultsClient.Get method. +// - resourceID - The identifier of the resource. +// - 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) { req, err := client.getCreateRequest(ctx, resourceID, complianceResultName, options) if err != nil { @@ -102,10 +103,12 @@ func (client *ComplianceResultsClient) getHandleResponse(resp *http.Response) (C } // NewListPager - Security compliance results in the subscription +// // Generated from API version 2017-08-01 -// scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group -// (/providers/Microsoft.Management/managementGroups/mgName). -// options - ComplianceResultsClientListOptions contains the optional parameters for the ComplianceResultsClient.List method. +// - scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group +// (/providers/Microsoft.Management/managementGroups/mgName). +// - options - ComplianceResultsClientListOptions contains the optional parameters for the ComplianceResultsClient.NewListPager +// method. func (client *ComplianceResultsClient) NewListPager(scope string, options *ComplianceResultsClientListOptions) *runtime.Pager[ComplianceResultsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ComplianceResultsClientListResponse]{ More: func(page ComplianceResultsClientListResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/complianceresults_client_example_test.go b/sdk/resourcemanager/security/armsecurity/complianceresults_client_example_test.go deleted file mode 100644 index cf3f0ae0e018..000000000000 --- a/sdk/resourcemanager/security/armsecurity/complianceresults_client_example_test.go +++ /dev/null @@ -1,60 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2017-08-01/examples/ComplianceResults/ListComplianceResults_example.json -func ExampleComplianceResultsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewComplianceResultsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2017-08-01/examples/ComplianceResults/GetComplianceResults_example.json -func ExampleComplianceResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewComplianceResultsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "DesignateMoreThanOneOwner", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/compliances_client.go b/sdk/resourcemanager/security/armsecurity/compliances_client.go index 0a4e34f3ebd8..32e68ad04c02 100644 --- a/sdk/resourcemanager/security/armsecurity/compliances_client.go +++ b/sdk/resourcemanager/security/armsecurity/compliances_client.go @@ -31,8 +31,8 @@ type CompliancesClient struct { } // NewCompliancesClient creates a new instance of CompliancesClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewCompliancesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*CompliancesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -54,11 +54,12 @@ func NewCompliancesClient(credential azcore.TokenCredential, options *arm.Client // Get - Details of a specific Compliance. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2017-08-01-preview -// scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group -// (/providers/Microsoft.Management/managementGroups/mgName). -// complianceName - name of the Compliance -// options - CompliancesClientGetOptions contains the optional parameters for the CompliancesClient.Get method. +// - scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group +// (/providers/Microsoft.Management/managementGroups/mgName). +// - 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) { req, err := client.getCreateRequest(ctx, scope, complianceName, options) if err != nil { @@ -103,10 +104,11 @@ func (client *CompliancesClient) getHandleResponse(resp *http.Response) (Complia } // NewListPager - The Compliance scores of the specific management group. +// // Generated from API version 2017-08-01-preview -// scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group -// (/providers/Microsoft.Management/managementGroups/mgName). -// options - CompliancesClientListOptions contains the optional parameters for the CompliancesClient.List method. +// - scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group +// (/providers/Microsoft.Management/managementGroups/mgName). +// - options - CompliancesClientListOptions contains the optional parameters for the CompliancesClient.NewListPager method. func (client *CompliancesClient) NewListPager(scope string, options *CompliancesClientListOptions) *runtime.Pager[CompliancesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[CompliancesClientListResponse]{ More: func(page CompliancesClientListResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/compliances_client_example_test.go b/sdk/resourcemanager/security/armsecurity/compliances_client_example_test.go deleted file mode 100644 index 3d845b0484d9..000000000000 --- a/sdk/resourcemanager/security/armsecurity/compliances_client_example_test.go +++ /dev/null @@ -1,60 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/Compliances/GetCompliances_example.json -func ExampleCompliancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewCompliancesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/Compliances/GetCompliance_example.json -func ExampleCompliancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewCompliancesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "2018-01-01Z", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/connectorapplication_client.go b/sdk/resourcemanager/security/armsecurity/connectorapplication_client.go index f31036330d1d..0fa89618c18a 100644 --- a/sdk/resourcemanager/security/armsecurity/connectorapplication_client.go +++ b/sdk/resourcemanager/security/armsecurity/connectorapplication_client.go @@ -32,9 +32,9 @@ type ConnectorApplicationClient struct { } // NewConnectorApplicationClient creates a new instance of ConnectorApplicationClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewConnectorApplicationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectorApplicationClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +57,14 @@ func NewConnectorApplicationClient(subscriptionID string, credential azcore.Toke // CreateOrUpdate - Creates or update a security Application on the given security connector. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// securityConnectorName - The security connector name. -// applicationID - The security Application key - unique key for the standard application -// application - Application over a subscription scope -// options - ConnectorApplicationClientCreateOrUpdateOptions contains the optional parameters for the ConnectorApplicationClient.CreateOrUpdate -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - applicationID - The security Application key - unique key for the standard application +// - application - Application over a subscription scope +// - 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) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, securityConnectorName, applicationID, application, options) if err != nil { @@ -120,12 +121,13 @@ func (client *ConnectorApplicationClient) createOrUpdateHandleResponse(resp *htt // Delete - Delete an Application over a given scope // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// securityConnectorName - The security connector name. -// applicationID - The security Application key - unique key for the standard application -// options - ConnectorApplicationClientDeleteOptions contains the optional parameters for the ConnectorApplicationClient.Delete -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - applicationID - The security Application key - unique key for the standard application +// - 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) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, securityConnectorName, applicationID, options) if err != nil { @@ -172,12 +174,13 @@ func (client *ConnectorApplicationClient) deleteCreateRequest(ctx context.Contex // Get - Get a specific application for the requested scope by applicationId // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-07-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// securityConnectorName - The security connector name. -// applicationID - The security Application key - unique key for the standard application -// options - ConnectorApplicationClientGetOptions contains the optional parameters for the ConnectorApplicationClient.Get -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - applicationID - The security Application key - unique key for the standard application +// - 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) { req, err := client.getCreateRequest(ctx, resourceGroupName, securityConnectorName, applicationID, options) if err != nil { diff --git a/sdk/resourcemanager/security/armsecurity/connectorapplication_client_example_test.go b/sdk/resourcemanager/security/armsecurity/connectorapplication_client_example_test.go deleted file mode 100644 index 55e790113bc9..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectorapplication_client_example_test.go +++ /dev/null @@ -1,89 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/GetSecurityConnectorApplication_example.json -func ExampleConnectorApplicationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewConnectorApplicationClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/PutSecurityConnectorApplication_example.json -func ExampleConnectorApplicationClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewConnectorApplicationClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", armsecurity.Application{ - Properties: &armsecurity.ApplicationProperties{ - Description: to.Ptr("An application on critical GCP recommendations"), - ConditionSets: []interface{}{ - map[string]interface{}{ - "conditions": []interface{}{ - map[string]interface{}{ - "operator": "contains", - "property": "$.Id", - "value": "-prod-", - }, - }, - }}, - DisplayName: to.Ptr("GCP Admin's application"), - SourceResourceType: to.Ptr(armsecurity.ApplicationSourceResourceTypeAssessments), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/DeleteSecurityConnectorApplication_example.json -func ExampleConnectorApplicationClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewConnectorApplicationClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/connectorapplications_client.go b/sdk/resourcemanager/security/armsecurity/connectorapplications_client.go index 91eb858bd1ba..cccc386963cd 100644 --- a/sdk/resourcemanager/security/armsecurity/connectorapplications_client.go +++ b/sdk/resourcemanager/security/armsecurity/connectorapplications_client.go @@ -32,9 +32,9 @@ type ConnectorApplicationsClient struct { } // NewConnectorApplicationsClient creates a new instance of ConnectorApplicationsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewConnectorApplicationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectorApplicationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,11 +56,12 @@ func NewConnectorApplicationsClient(subscriptionID string, credential azcore.Tok } // NewListPager - Get a list of all relevant applications over a security connector level scope +// // Generated from API version 2022-07-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 - ConnectorApplicationsClientListOptions contains the optional parameters for the ConnectorApplicationsClient.List -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - securityConnectorName - The security connector name. +// - options - ConnectorApplicationsClientListOptions contains the optional parameters for the ConnectorApplicationsClient.NewListPager +// method. func (client *ConnectorApplicationsClient) NewListPager(resourceGroupName string, securityConnectorName string, options *ConnectorApplicationsClientListOptions) *runtime.Pager[ConnectorApplicationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ConnectorApplicationsClientListResponse]{ More: func(page ConnectorApplicationsClientListResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/connectorapplications_client_example_test.go b/sdk/resourcemanager/security/armsecurity/connectorapplications_client_example_test.go deleted file mode 100644 index 8275aaff3b2c..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectorapplications_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-07-01-preview/examples/Applications/ListBySecurityConnectorApplications_example.json -func ExampleConnectorApplicationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewConnectorApplicationsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("gcpResourceGroup", "gcpconnector", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/connectorgovernancerule_client.go b/sdk/resourcemanager/security/armsecurity/connectorgovernancerule_client.go deleted file mode 100644 index c0fb53be63e9..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectorgovernancerule_client.go +++ /dev/null @@ -1,125 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// 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" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ConnectorGovernanceRuleClient contains the methods for the SecurityConnectorGovernanceRule group. -// Don't use this type directly, use NewConnectorGovernanceRuleClient() instead. -type ConnectorGovernanceRuleClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewConnectorGovernanceRuleClient creates a new instance of ConnectorGovernanceRuleClient with the specified values. -// subscriptionID - Azure subscription ID -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewConnectorGovernanceRuleClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectorGovernanceRuleClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ConnectorGovernanceRuleClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - Get a list of all relevant governanceRules over a security connector level scope -// Generated from API version 2022-01-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// securityConnectorName - The security connector name. -// options - ConnectorGovernanceRuleClientListOptions contains the optional parameters for the ConnectorGovernanceRuleClient.List -// method. -func (client *ConnectorGovernanceRuleClient) NewListPager(resourceGroupName string, securityConnectorName string, options *ConnectorGovernanceRuleClientListOptions) *runtime.Pager[ConnectorGovernanceRuleClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[ConnectorGovernanceRuleClientListResponse]{ - More: func(page ConnectorGovernanceRuleClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *ConnectorGovernanceRuleClientListResponse) (ConnectorGovernanceRuleClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, resourceGroupName, securityConnectorName, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return ConnectorGovernanceRuleClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ConnectorGovernanceRuleClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ConnectorGovernanceRuleClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *ConnectorGovernanceRuleClient) listCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, options *ConnectorGovernanceRuleClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if securityConnectorName == "" { - return nil, errors.New("parameter securityConnectorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *ConnectorGovernanceRuleClient) listHandleResponse(resp *http.Response) (ConnectorGovernanceRuleClientListResponse, error) { - result := ConnectorGovernanceRuleClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GovernanceRuleList); err != nil { - return ConnectorGovernanceRuleClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/security/armsecurity/connectorgovernancerule_client_example_test.go b/sdk/resourcemanager/security/armsecurity/connectorgovernancerule_client_example_test.go deleted file mode 100644 index c76ebbe2b505..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectorgovernancerule_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ListBySecurityConnectorGovernanceRules_example.json -func ExampleConnectorGovernanceRuleClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewConnectorGovernanceRuleClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("gcpResourceGroup", "gcpconnector", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/connectorgovernancerules_client.go b/sdk/resourcemanager/security/armsecurity/connectorgovernancerules_client.go deleted file mode 100644 index 142381cac5e5..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectorgovernancerules_client.go +++ /dev/null @@ -1,233 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for 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" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ConnectorGovernanceRulesClient contains the methods for the SecurityConnectorGovernanceRules group. -// Don't use this type directly, use NewConnectorGovernanceRulesClient() instead. -type ConnectorGovernanceRulesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewConnectorGovernanceRulesClient creates a new instance of ConnectorGovernanceRulesClient with the specified values. -// subscriptionID - Azure subscription ID -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewConnectorGovernanceRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectorGovernanceRulesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ConnectorGovernanceRulesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// CreateOrUpdate - Creates or update a security GovernanceRule on the given security connector. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// securityConnectorName - The security connector name. -// ruleID - The security GovernanceRule key - unique key for the standard GovernanceRule -// governanceRule - GovernanceRule over a subscription scope -// options - ConnectorGovernanceRulesClientCreateOrUpdateOptions contains the optional parameters for the ConnectorGovernanceRulesClient.CreateOrUpdate -// method. -func (client *ConnectorGovernanceRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, securityConnectorName string, ruleID string, governanceRule GovernanceRule, options *ConnectorGovernanceRulesClientCreateOrUpdateOptions) (ConnectorGovernanceRulesClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, securityConnectorName, ruleID, governanceRule, options) - if err != nil { - return ConnectorGovernanceRulesClientCreateOrUpdateResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ConnectorGovernanceRulesClientCreateOrUpdateResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return ConnectorGovernanceRulesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) - } - return client.createOrUpdateHandleResponse(resp) -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ConnectorGovernanceRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, ruleID string, governanceRule GovernanceRule, options *ConnectorGovernanceRulesClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if securityConnectorName == "" { - return nil, errors.New("parameter securityConnectorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) - if ruleID == "" { - return nil, errors.New("parameter ruleID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, governanceRule) -} - -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *ConnectorGovernanceRulesClient) createOrUpdateHandleResponse(resp *http.Response) (ConnectorGovernanceRulesClientCreateOrUpdateResponse, error) { - result := ConnectorGovernanceRulesClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GovernanceRule); err != nil { - return ConnectorGovernanceRulesClientCreateOrUpdateResponse{}, err - } - return result, nil -} - -// Delete - Delete a GovernanceRule over a given scope -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// securityConnectorName - The security connector name. -// ruleID - The security GovernanceRule key - unique key for the standard GovernanceRule -// options - ConnectorGovernanceRulesClientDeleteOptions contains the optional parameters for the ConnectorGovernanceRulesClient.Delete -// method. -func (client *ConnectorGovernanceRulesClient) Delete(ctx context.Context, resourceGroupName string, securityConnectorName string, ruleID string, options *ConnectorGovernanceRulesClientDeleteOptions) (ConnectorGovernanceRulesClientDeleteResponse, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, securityConnectorName, ruleID, options) - if err != nil { - return ConnectorGovernanceRulesClientDeleteResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ConnectorGovernanceRulesClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ConnectorGovernanceRulesClientDeleteResponse{}, runtime.NewResponseError(resp) - } - return ConnectorGovernanceRulesClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ConnectorGovernanceRulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, ruleID string, options *ConnectorGovernanceRulesClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if securityConnectorName == "" { - return nil, errors.New("parameter securityConnectorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) - if ruleID == "" { - return nil, errors.New("parameter ruleID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - return req, nil -} - -// Get - Get a specific governanceRule for the requested scope by ruleId -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// securityConnectorName - The security connector name. -// ruleID - The security GovernanceRule key - unique key for the standard GovernanceRule -// options - ConnectorGovernanceRulesClientGetOptions contains the optional parameters for the ConnectorGovernanceRulesClient.Get -// method. -func (client *ConnectorGovernanceRulesClient) Get(ctx context.Context, resourceGroupName string, securityConnectorName string, ruleID string, options *ConnectorGovernanceRulesClientGetOptions) (ConnectorGovernanceRulesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, securityConnectorName, ruleID, options) - if err != nil { - return ConnectorGovernanceRulesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ConnectorGovernanceRulesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ConnectorGovernanceRulesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ConnectorGovernanceRulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, ruleID string, options *ConnectorGovernanceRulesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if securityConnectorName == "" { - return nil, errors.New("parameter securityConnectorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) - if ruleID == "" { - return nil, errors.New("parameter ruleID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ConnectorGovernanceRulesClient) getHandleResponse(resp *http.Response) (ConnectorGovernanceRulesClientGetResponse, error) { - result := ConnectorGovernanceRulesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GovernanceRule); err != nil { - return ConnectorGovernanceRulesClientGetResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/security/armsecurity/connectorgovernancerules_client_example_test.go b/sdk/resourcemanager/security/armsecurity/connectorgovernancerules_client_example_test.go deleted file mode 100644 index 03efeb59a645..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectorgovernancerules_client_example_test.go +++ /dev/null @@ -1,102 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRule_example.json -func ExampleConnectorGovernanceRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewConnectorGovernanceRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PutSecurityConnectorGovernanceRule_example.json -func ExampleConnectorGovernanceRulesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewConnectorGovernanceRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", armsecurity.GovernanceRule{ - Properties: &armsecurity.GovernanceRuleProperties{ - Description: to.Ptr("A rule on critical GCP recommendations"), - ConditionSets: []interface{}{ - map[string]interface{}{ - "conditions": []interface{}{ - map[string]interface{}{ - "operator": "In", - "property": "$.AssessmentKey", - "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]", - }, - }, - }}, - DisplayName: to.Ptr("GCP Admin's rule"), - GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - DisableManagerEmailNotification: to.Ptr(true), - DisableOwnerEmailNotification: to.Ptr(false), - }, - IsDisabled: to.Ptr(false), - IsGracePeriod: to.Ptr(true), - OwnerSource: &armsecurity.GovernanceRuleOwnerSource{ - Type: to.Ptr(armsecurity.GovernanceRuleOwnerSourceTypeManually), - Value: to.Ptr("user@contoso.com"), - }, - RemediationTimeframe: to.Ptr("7.00:00:00"), - RulePriority: to.Ptr[int32](200), - RuleType: to.Ptr(armsecurity.GovernanceRuleTypeIntegrated), - SourceResourceType: to.Ptr(armsecurity.GovernanceRuleSourceResourceTypeAssessments), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteSecurityConnectorGovernanceRule_example.json -func ExampleConnectorGovernanceRulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewConnectorGovernanceRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/connectorgovernancerulesexecutestatus_client.go b/sdk/resourcemanager/security/armsecurity/connectorgovernancerulesexecutestatus_client.go deleted file mode 100644 index 1183625ebaef..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectorgovernancerulesexecutestatus_client.go +++ /dev/null @@ -1,129 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for 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" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ConnectorGovernanceRulesExecuteStatusClient contains the methods for the SecurityConnectorGovernanceRulesExecuteStatus group. -// Don't use this type directly, use NewConnectorGovernanceRulesExecuteStatusClient() instead. -type ConnectorGovernanceRulesExecuteStatusClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewConnectorGovernanceRulesExecuteStatusClient creates a new instance of ConnectorGovernanceRulesExecuteStatusClient with the specified values. -// subscriptionID - Azure subscription ID -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewConnectorGovernanceRulesExecuteStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectorGovernanceRulesExecuteStatusClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ConnectorGovernanceRulesExecuteStatusClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginGet - Get a specific governanceRule execution status for the requested scope by ruleId and operationId -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// securityConnectorName - The security connector name. -// ruleID - The security GovernanceRule key - unique key for the standard GovernanceRule -// operationID - The security GovernanceRule execution key - unique key for the execution of GovernanceRule -// options - ConnectorGovernanceRulesExecuteStatusClientBeginGetOptions contains the optional parameters for the ConnectorGovernanceRulesExecuteStatusClient.BeginGet -// method. -func (client *ConnectorGovernanceRulesExecuteStatusClient) BeginGet(ctx context.Context, resourceGroupName string, securityConnectorName string, ruleID string, operationID string, options *ConnectorGovernanceRulesExecuteStatusClientBeginGetOptions) (*runtime.Poller[ConnectorGovernanceRulesExecuteStatusClientGetResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.get(ctx, resourceGroupName, securityConnectorName, ruleID, operationID, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[ConnectorGovernanceRulesExecuteStatusClientGetResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[ConnectorGovernanceRulesExecuteStatusClientGetResponse](options.ResumeToken, client.pl, nil) - } -} - -// Get - Get a specific governanceRule execution status for the requested scope by ruleId and operationId -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview -func (client *ConnectorGovernanceRulesExecuteStatusClient) get(ctx context.Context, resourceGroupName string, securityConnectorName string, ruleID string, operationID string, options *ConnectorGovernanceRulesExecuteStatusClientBeginGetOptions) (*http.Response, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, securityConnectorName, ruleID, operationID, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getCreateRequest creates the Get request. -func (client *ConnectorGovernanceRulesExecuteStatusClient) getCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, ruleID string, operationID string, options *ConnectorGovernanceRulesExecuteStatusClientBeginGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if securityConnectorName == "" { - return nil, errors.New("parameter securityConnectorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) - if ruleID == "" { - return nil, errors.New("parameter ruleID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) - if operationID == "" { - return nil, errors.New("parameter operationID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} diff --git a/sdk/resourcemanager/security/armsecurity/connectorgovernancerulesexecutestatus_client_example_test.go b/sdk/resourcemanager/security/armsecurity/connectorgovernancerulesexecutestatus_client_example_test.go deleted file mode 100644 index cdc322f86875..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectorgovernancerulesexecutestatus_client_example_test.go +++ /dev/null @@ -1,40 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetSecurityConnectorGovernanceRuleExecuteStatus_example.json -func ExampleConnectorGovernanceRulesExecuteStatusClient_BeginGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewConnectorGovernanceRulesExecuteStatusClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginGet(ctx, "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/connectors_client.go b/sdk/resourcemanager/security/armsecurity/connectors_client.go index 8a435d88f991..7922aec8f148 100644 --- a/sdk/resourcemanager/security/armsecurity/connectors_client.go +++ b/sdk/resourcemanager/security/armsecurity/connectors_client.go @@ -32,9 +32,9 @@ type ConnectorsClient struct { } // NewConnectorsClient creates a new instance of ConnectorsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewConnectorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ConnectorsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewConnectorsClient(subscriptionID string, credential azcore.TokenCredentia // CreateOrUpdate - Creates or updates a security connector. If a security connector is already created and a subsequent request // is issued for the same security connector id, then it will be updated. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-08-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// securityConnectorName - The security connector name. -// securityConnector - The security connector resource -// options - ConnectorsClientCreateOrUpdateOptions contains the optional parameters for the ConnectorsClient.CreateOrUpdate -// method. +// - 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) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, securityConnectorName, securityConnector, options) if err != nil { @@ -116,10 +117,11 @@ func (client *ConnectorsClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Deletes a security connector. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-08-01-preview -// 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. +// - 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) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, securityConnectorName, options) if err != nil { @@ -163,10 +165,11 @@ func (client *ConnectorsClient) deleteCreateRequest(ctx context.Context, resourc // Get - Retrieves details of a specific security connector // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-08-01-preview -// 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. +// - 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) { req, err := client.getCreateRequest(ctx, resourceGroupName, securityConnectorName, options) if err != nil { @@ -219,8 +222,9 @@ func (client *ConnectorsClient) getHandleResponse(resp *http.Response) (Connecto // NewListPager - Lists all the security connectors in the specified subscription. Use the 'nextLink' property in the response // to get the next page of security connectors for the specified subscription. +// // Generated from API version 2022-08-01-preview -// options - ConnectorsClientListOptions contains the optional parameters for the ConnectorsClient.List method. +// - 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]{ More: func(page ConnectorsClientListResponse) bool { @@ -278,10 +282,11 @@ func (client *ConnectorsClient) listHandleResponse(resp *http.Response) (Connect // NewListByResourceGroupPager - Lists all the security connectors in the specified resource group. Use the 'nextLink' property // in the response to get the next page of security connectors for the specified resource group. +// // Generated from API version 2022-08-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// options - ConnectorsClientListByResourceGroupOptions contains the optional parameters for the ConnectorsClient.ListByResourceGroup -// method. +// - 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. func (client *ConnectorsClient) NewListByResourceGroupPager(resourceGroupName string, options *ConnectorsClientListByResourceGroupOptions) *runtime.Pager[ConnectorsClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[ConnectorsClientListByResourceGroupResponse]{ More: func(page ConnectorsClientListByResourceGroupResponse) bool { @@ -343,11 +348,12 @@ func (client *ConnectorsClient) listByResourceGroupHandleResponse(resp *http.Res // Update - Updates a security connector // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-08-01-preview -// 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. +// - 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) { req, err := client.updateCreateRequest(ctx, resourceGroupName, securityConnectorName, securityConnector, options) if err != nil { diff --git a/sdk/resourcemanager/security/armsecurity/connectors_client_example_test.go b/sdk/resourcemanager/security/armsecurity/connectors_client_example_test.go deleted file mode 100644 index 0183a2fdfe71..000000000000 --- a/sdk/resourcemanager/security/armsecurity/connectors_client_example_test.go +++ /dev/null @@ -1,176 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-08-01-preview/examples/SecurityConnectors/GetSecurityConnectorsSubscription_example.json -func ExampleConnectorsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewConnectorsClient("a5caac9c-5c04-49af-b3d0-e204f40345d5", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-08-01-preview/examples/SecurityConnectors/GetSecurityConnectorsResourceGroup_example.json -func ExampleConnectorsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewConnectorsClient("a5caac9c-5c04-49af-b3d0-e204f40345d5", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("exampleResourceGroup", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-08-01-preview/examples/SecurityConnectors/GetSecurityConnectorSingleResource_example.json -func ExampleConnectorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewConnectorsClient("a5caac9c-5c04-49af-b3d0-e204f40345d5", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "exampleResourceGroup", "exampleSecurityConnectorName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-08-01-preview/examples/SecurityConnectors/PutSecurityConnector_example.json -func ExampleConnectorsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewConnectorsClient("a5caac9c-5c04-49af-b3d0-e204f40345d5", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "exampleResourceGroup", "exampleSecurityConnectorName", armsecurity.Connector{ - Location: to.Ptr("Central US"), - Etag: to.Ptr("etag value (must be supplied for update)"), - Tags: map[string]*string{}, - Properties: &armsecurity.ConnectorProperties{ - EnvironmentData: &armsecurity.AwsEnvironmentData{ - EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeAwsAccount), - }, - EnvironmentName: to.Ptr(armsecurity.CloudNameAWS), - HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - Offerings: []armsecurity.CloudOfferingClassification{ - &armsecurity.CspmMonitorAwsOffering{ - OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorAws), - NativeCloudConnection: &armsecurity.CspmMonitorAwsOfferingNativeCloudConnection{ - CloudRoleArn: to.Ptr("arn:aws:iam::00000000:role/ASCMonitor"), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-08-01-preview/examples/SecurityConnectors/PatchSecurityConnector_example.json -func ExampleConnectorsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewConnectorsClient("a5caac9c-5c04-49af-b3d0-e204f40345d5", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "exampleResourceGroup", "exampleSecurityConnectorName", armsecurity.Connector{ - Location: to.Ptr("Central US"), - Etag: to.Ptr("etag value (must be supplied for update)"), - Tags: map[string]*string{}, - Properties: &armsecurity.ConnectorProperties{ - EnvironmentData: &armsecurity.AwsEnvironmentData{ - EnvironmentType: to.Ptr(armsecurity.EnvironmentTypeAwsAccount), - }, - EnvironmentName: to.Ptr(armsecurity.CloudNameAWS), - HierarchyIdentifier: to.Ptr("exampleHierarchyId"), - Offerings: []armsecurity.CloudOfferingClassification{ - &armsecurity.CspmMonitorAwsOffering{ - OfferingType: to.Ptr(armsecurity.OfferingTypeCspmMonitorAws), - NativeCloudConnection: &armsecurity.CspmMonitorAwsOfferingNativeCloudConnection{ - CloudRoleArn: to.Ptr("arn:aws:iam::00000000:role/ASCMonitor"), - }, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-08-01-preview/examples/SecurityConnectors/DeleteSecurityConnector_example.json -func ExampleConnectorsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewConnectorsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "myRg", "mySecurityConnectorName", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/constants.go b/sdk/resourcemanager/security/armsecurity/constants.go index 8f1ef25f8fc1..09abdc7a16e6 100644 --- a/sdk/resourcemanager/security/armsecurity/constants.go +++ b/sdk/resourcemanager/security/armsecurity/constants.go @@ -11,7 +11,7 @@ package armsecurity const ( moduleName = "armsecurity" - moduleVersion = "v0.9.0" + moduleVersion = "v0.10.0" ) // AADConnectivityState - The connectivity state of the external AAD solution @@ -979,6 +979,27 @@ func PossibleOfferingTypeValues() []OfferingType { } } +// OperationResult - The status of the long run operation result of governance rule +type OperationResult string + +const ( + // OperationResultCanceled - The operation canceled + OperationResultCanceled OperationResult = "Canceled" + // OperationResultFailed - The operation failed + OperationResultFailed OperationResult = "Failed" + // OperationResultSucceeded - The operation succeeded + OperationResultSucceeded OperationResult = "Succeeded" +) + +// PossibleOperationResultValues returns the possible values for the OperationResult const type. +func PossibleOperationResultValues() []OperationResult { + return []OperationResult{ + OperationResultCanceled, + OperationResultFailed, + OperationResultSucceeded, + } +} + // Operator - A valid comparer operator to use. A case-insensitive comparison will be applied for String PropertyType. type Operator string diff --git a/sdk/resourcemanager/security/armsecurity/contacts_client.go b/sdk/resourcemanager/security/armsecurity/contacts_client.go index c5a1de914b3f..09e898de6d3d 100644 --- a/sdk/resourcemanager/security/armsecurity/contacts_client.go +++ b/sdk/resourcemanager/security/armsecurity/contacts_client.go @@ -32,9 +32,9 @@ type ContactsClient struct { } // NewContactsClient creates a new instance of ContactsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewContactsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContactsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,10 +57,11 @@ func NewContactsClient(subscriptionID string, credential azcore.TokenCredential, // Create - Create security contact configurations for the subscription // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01-preview -// securityContactName - Name of the security contact object -// securityContact - Security contact object -// options - ContactsClientCreateOptions contains the optional parameters for the ContactsClient.Create method. +// - securityContactName - Name of the security contact object +// - 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) { req, err := client.createCreateRequest(ctx, securityContactName, securityContact, options) if err != nil { @@ -109,9 +110,10 @@ func (client *ContactsClient) createHandleResponse(resp *http.Response) (Contact // Delete - Delete security contact configurations for the subscription // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01-preview -// securityContactName - Name of the security contact object -// options - ContactsClientDeleteOptions contains the optional parameters for the ContactsClient.Delete method. +// - 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) { req, err := client.deleteCreateRequest(ctx, securityContactName, options) if err != nil { @@ -151,9 +153,10 @@ func (client *ContactsClient) deleteCreateRequest(ctx context.Context, securityC // Get - Get Default Security contact configurations for the subscription // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01-preview -// securityContactName - Name of the security contact object -// options - ContactsClientGetOptions contains the optional parameters for the ContactsClient.Get method. +// - 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) { req, err := client.getCreateRequest(ctx, securityContactName, options) if err != nil { @@ -201,8 +204,9 @@ func (client *ContactsClient) getHandleResponse(resp *http.Response) (ContactsCl } // NewListPager - List all security contact configurations for the subscription +// // Generated from API version 2020-01-01-preview -// options - ContactsClientListOptions contains the optional parameters for the ContactsClient.List method. +// - options - ContactsClientListOptions contains the optional parameters for the ContactsClient.NewListPager method. func (client *ContactsClient) NewListPager(options *ContactsClientListOptions) *runtime.Pager[ContactsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ContactsClientListResponse]{ More: func(page ContactsClientListResponse) bool { 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 db4a4e4d86f6..000000000000 --- a/sdk/resourcemanager/security/armsecurity/contacts_client_example_test.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. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/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() - client, err := armsecurity.NewContactsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/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() - client, err := armsecurity.NewContactsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/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() - client, err := armsecurity.NewContactsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, "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) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2020-01-01-preview/examples/SecurityContacts/DeleteSecurityContact_example.json -func ExampleContactsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewContactsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "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 4118f564ad4e..f24f84628dca 100644 --- a/sdk/resourcemanager/security/armsecurity/customassessmentautomations_client.go +++ b/sdk/resourcemanager/security/armsecurity/customassessmentautomations_client.go @@ -32,9 +32,9 @@ type CustomAssessmentAutomationsClient struct { } // NewCustomAssessmentAutomationsClient creates a new instance of CustomAssessmentAutomationsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewCustomAssessmentAutomationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CustomAssessmentAutomationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewCustomAssessmentAutomationsClient(subscriptionID string, credential azco // Create - Creates or updates a custom assessment automation for the provided subscription. Please note that providing an // existing custom assessment automation will replace the existing record. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-07-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// customAssessmentAutomationName - Name of the Custom Assessment Automation. -// customAssessmentAutomationBody - Custom Assessment Automation body -// options - CustomAssessmentAutomationsClientCreateOptions contains the optional parameters for the CustomAssessmentAutomationsClient.Create -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - customAssessmentAutomationName - Name of the Custom Assessment Automation. +// - customAssessmentAutomationBody - Custom Assessment Automation body +// - 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) { req, err := client.createCreateRequest(ctx, resourceGroupName, customAssessmentAutomationName, customAssessmentAutomationBody, options) if err != nil { @@ -116,11 +117,12 @@ func (client *CustomAssessmentAutomationsClient) createHandleResponse(resp *http // Delete - Deletes a custom assessment automation by name for a provided subscription // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-07-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// customAssessmentAutomationName - Name of the Custom Assessment Automation. -// options - CustomAssessmentAutomationsClientDeleteOptions contains the optional parameters for the CustomAssessmentAutomationsClient.Delete -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - customAssessmentAutomationName - Name of the Custom Assessment Automation. +// - 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) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, customAssessmentAutomationName, options) if err != nil { @@ -164,11 +166,12 @@ func (client *CustomAssessmentAutomationsClient) deleteCreateRequest(ctx context // Get - Gets a single custom assessment automation by name for the provided subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-07-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// customAssessmentAutomationName - Name of the Custom Assessment Automation. -// options - CustomAssessmentAutomationsClientGetOptions contains the optional parameters for the CustomAssessmentAutomationsClient.Get -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - customAssessmentAutomationName - Name of the Custom Assessment Automation. +// - 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) { req, err := client.getCreateRequest(ctx, resourceGroupName, customAssessmentAutomationName, options) if err != nil { @@ -220,10 +223,11 @@ func (client *CustomAssessmentAutomationsClient) getHandleResponse(resp *http.Re } // NewListByResourceGroupPager - List custom assessment automations by provided subscription and resource group +// // Generated from API version 2021-07-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// options - CustomAssessmentAutomationsClientListByResourceGroupOptions contains the optional parameters for the CustomAssessmentAutomationsClient.ListByResourceGroup -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - options - CustomAssessmentAutomationsClientListByResourceGroupOptions contains the optional parameters for the CustomAssessmentAutomationsClient.NewListByResourceGroupPager +// method. func (client *CustomAssessmentAutomationsClient) NewListByResourceGroupPager(resourceGroupName string, options *CustomAssessmentAutomationsClientListByResourceGroupOptions) *runtime.Pager[CustomAssessmentAutomationsClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[CustomAssessmentAutomationsClientListByResourceGroupResponse]{ More: func(page CustomAssessmentAutomationsClientListByResourceGroupResponse) bool { @@ -284,9 +288,10 @@ func (client *CustomAssessmentAutomationsClient) listByResourceGroupHandleRespon } // NewListBySubscriptionPager - List custom assessment automations by provided subscription +// // Generated from API version 2021-07-01-preview -// options - CustomAssessmentAutomationsClientListBySubscriptionOptions contains the optional parameters for the CustomAssessmentAutomationsClient.ListBySubscription -// method. +// - options - CustomAssessmentAutomationsClientListBySubscriptionOptions contains the optional parameters for the CustomAssessmentAutomationsClient.NewListBySubscriptionPager +// method. func (client *CustomAssessmentAutomationsClient) NewListBySubscriptionPager(options *CustomAssessmentAutomationsClientListBySubscriptionOptions) *runtime.Pager[CustomAssessmentAutomationsClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[CustomAssessmentAutomationsClientListBySubscriptionResponse]{ More: func(page CustomAssessmentAutomationsClientListBySubscriptionResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/customassessmentautomations_client_example_test.go b/sdk/resourcemanager/security/armsecurity/customassessmentautomations_client_example_test.go deleted file mode 100644 index c23b5581ce1a..000000000000 --- a/sdk/resourcemanager/security/armsecurity/customassessmentautomations_client_example_test.go +++ /dev/null @@ -1,130 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationGet_example.json -func ExampleCustomAssessmentAutomationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewCustomAssessmentAutomationsClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "TestResourceGroup", "MyCustomAssessmentAutomation", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationCreate_example.json -func ExampleCustomAssessmentAutomationsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewCustomAssessmentAutomationsClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, "TestResourceGroup", "MyCustomAssessmentAutomation", armsecurity.CustomAssessmentAutomationRequest{ - Properties: &armsecurity.CustomAssessmentAutomationRequestProperties{ - Description: to.Ptr("Data should be encrypted"), - CompressedQuery: to.Ptr("DQAKAEkAYQBtAF8ARwByAG8AdQBwAA0ACgB8ACAAZQB4AHQAZQBuAGQAIABIAGUAYQBsAHQAaABTAHQAYQB0AHUAcwAgAD0AIABpAGYAZgAoAHQAbwBzAHQAcgBpAG4AZwAoAFIAZQBjAG8AcgBkAC4AVQBzAGUAcgBOAGEAbQBlACkAIABjAG8AbgB0AGEAaQBuAHMAIAAnAHUAcwBlAHIAJwAsACAAJwBVAE4ASABFAEEATABUAEgAWQAnACwAIAAnAEgARQBBAEwAVABIAFkAJwApAA0ACgA="), - DisplayName: to.Ptr("Password Policy"), - RemediationDescription: to.Ptr("Encrypt store by..."), - Severity: to.Ptr(armsecurity.SeverityEnumMedium), - SupportedCloud: to.Ptr(armsecurity.SupportedCloudEnumAWS), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationDelete_example.json -func ExampleCustomAssessmentAutomationsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewCustomAssessmentAutomationsClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "TestResourceGroup", "MyCustomAssessmentAutomation", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationListByResourceGroup_example.json -func ExampleCustomAssessmentAutomationsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewCustomAssessmentAutomationsClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("TestResourceGroup", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomAssessmentAutomations/customAssessmentAutomationListBySubscription_example.json -func ExampleCustomAssessmentAutomationsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewCustomAssessmentAutomationsClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/customentitystoreassignments_client.go b/sdk/resourcemanager/security/armsecurity/customentitystoreassignments_client.go index f70eb6f9945b..b270eb3c499c 100644 --- a/sdk/resourcemanager/security/armsecurity/customentitystoreassignments_client.go +++ b/sdk/resourcemanager/security/armsecurity/customentitystoreassignments_client.go @@ -32,9 +32,9 @@ type CustomEntityStoreAssignmentsClient struct { } // NewCustomEntityStoreAssignmentsClient creates a new instance of CustomEntityStoreAssignmentsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewCustomEntityStoreAssignmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CustomEntityStoreAssignmentsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewCustomEntityStoreAssignmentsClient(subscriptionID string, credential azc // Create - Creates a custom entity store assignment for the provided subscription, if not already exists. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-07-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// customEntityStoreAssignmentName - Name of the custom entity store assignment. Generated name is GUID. -// customEntityStoreAssignmentRequestBody - Custom entity store assignment body -// options - CustomEntityStoreAssignmentsClientCreateOptions contains the optional parameters for the CustomEntityStoreAssignmentsClient.Create -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - customEntityStoreAssignmentName - Name of the custom entity store assignment. Generated name is GUID. +// - customEntityStoreAssignmentRequestBody - Custom entity store assignment body +// - 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) { req, err := client.createCreateRequest(ctx, resourceGroupName, customEntityStoreAssignmentName, customEntityStoreAssignmentRequestBody, options) if err != nil { @@ -115,11 +116,12 @@ func (client *CustomEntityStoreAssignmentsClient) createHandleResponse(resp *htt // Delete - Delete a custom entity store assignment by name for a provided subscription // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-07-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// customEntityStoreAssignmentName - Name of the custom entity store assignment. Generated name is GUID. -// options - CustomEntityStoreAssignmentsClientDeleteOptions contains the optional parameters for the CustomEntityStoreAssignmentsClient.Delete -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - customEntityStoreAssignmentName - Name of the custom entity store assignment. Generated name is GUID. +// - 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) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, customEntityStoreAssignmentName, options) if err != nil { @@ -163,11 +165,12 @@ func (client *CustomEntityStoreAssignmentsClient) deleteCreateRequest(ctx contex // Get - Gets a single custom entity store assignment by name for the provided subscription and resource group. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-07-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// customEntityStoreAssignmentName - Name of the custom entity store assignment. Generated name is GUID. -// options - CustomEntityStoreAssignmentsClientGetOptions contains the optional parameters for the CustomEntityStoreAssignmentsClient.Get -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - customEntityStoreAssignmentName - Name of the custom entity store assignment. Generated name is GUID. +// - 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) { req, err := client.getCreateRequest(ctx, resourceGroupName, customEntityStoreAssignmentName, options) if err != nil { @@ -219,10 +222,11 @@ func (client *CustomEntityStoreAssignmentsClient) getHandleResponse(resp *http.R } // NewListByResourceGroupPager - List custom entity store assignments by a provided subscription and resource group +// // Generated from API version 2021-07-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// options - CustomEntityStoreAssignmentsClientListByResourceGroupOptions contains the optional parameters for the CustomEntityStoreAssignmentsClient.ListByResourceGroup -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - options - CustomEntityStoreAssignmentsClientListByResourceGroupOptions contains the optional parameters for the CustomEntityStoreAssignmentsClient.NewListByResourceGroupPager +// method. func (client *CustomEntityStoreAssignmentsClient) NewListByResourceGroupPager(resourceGroupName string, options *CustomEntityStoreAssignmentsClientListByResourceGroupOptions) *runtime.Pager[CustomEntityStoreAssignmentsClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[CustomEntityStoreAssignmentsClientListByResourceGroupResponse]{ More: func(page CustomEntityStoreAssignmentsClientListByResourceGroupResponse) bool { @@ -283,9 +287,10 @@ func (client *CustomEntityStoreAssignmentsClient) listByResourceGroupHandleRespo } // NewListBySubscriptionPager - List custom entity store assignments by provided subscription +// // Generated from API version 2021-07-01-preview -// options - CustomEntityStoreAssignmentsClientListBySubscriptionOptions contains the optional parameters for the CustomEntityStoreAssignmentsClient.ListBySubscription -// method. +// - options - CustomEntityStoreAssignmentsClientListBySubscriptionOptions contains the optional parameters for the CustomEntityStoreAssignmentsClient.NewListBySubscriptionPager +// method. func (client *CustomEntityStoreAssignmentsClient) NewListBySubscriptionPager(options *CustomEntityStoreAssignmentsClientListBySubscriptionOptions) *runtime.Pager[CustomEntityStoreAssignmentsClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[CustomEntityStoreAssignmentsClientListBySubscriptionResponse]{ More: func(page CustomEntityStoreAssignmentsClientListBySubscriptionResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/customentitystoreassignments_client_example_test.go b/sdk/resourcemanager/security/armsecurity/customentitystoreassignments_client_example_test.go deleted file mode 100644 index bb836af261f7..000000000000 --- a/sdk/resourcemanager/security/armsecurity/customentitystoreassignments_client_example_test.go +++ /dev/null @@ -1,125 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentGet_example.json -func ExampleCustomEntityStoreAssignmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewCustomEntityStoreAssignmentsClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentCreate_example.json -func ExampleCustomEntityStoreAssignmentsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewCustomEntityStoreAssignmentsClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, "TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", armsecurity.CustomEntityStoreAssignmentRequest{ - Properties: &armsecurity.CustomEntityStoreAssignmentRequestProperties{ - Principal: to.Ptr("aaduser=f3923a3e-ad57-4752-b1a9-fbf3c8e5e082;72f988bf-86f1-41af-91ab-2d7cd011db47"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentDelete_example.json -func ExampleCustomEntityStoreAssignmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewCustomEntityStoreAssignmentsClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "TestResourceGroup", "33e7cc6e-a139-4723-a0e5-76993aee0771", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentListByResourceGroup_example.json -func ExampleCustomEntityStoreAssignmentsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewCustomEntityStoreAssignmentsClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("TestResourceGroup", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2021-07-01-preview/examples/CustomEntityStoreAssignments/customEntityStoreAssignmentListBySubscription_example.json -func ExampleCustomEntityStoreAssignmentsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewCustomEntityStoreAssignmentsClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/date_type.go b/sdk/resourcemanager/security/armsecurity/date_type.go index 9a4998edc1db..6837d033fb82 100644 --- a/sdk/resourcemanager/security/armsecurity/date_type.go +++ b/sdk/resourcemanager/security/armsecurity/date_type.go @@ -35,7 +35,7 @@ func (d *dateType) UnmarshalJSON(data []byte) (err error) { return err } -func populateDateType(m map[string]interface{}, k string, t *time.Time) { +func populateDateType(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { diff --git a/sdk/resourcemanager/security/armsecurity/devicesecuritygroups_client.go b/sdk/resourcemanager/security/armsecurity/devicesecuritygroups_client.go index 07201bebd162..77163f0d6a3b 100644 --- a/sdk/resourcemanager/security/armsecurity/devicesecuritygroups_client.go +++ b/sdk/resourcemanager/security/armsecurity/devicesecuritygroups_client.go @@ -31,8 +31,8 @@ type DeviceSecurityGroupsClient struct { } // NewDeviceSecurityGroupsClient creates a new instance of DeviceSecurityGroupsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDeviceSecurityGroupsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*DeviceSecurityGroupsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -54,13 +54,14 @@ func NewDeviceSecurityGroupsClient(credential azcore.TokenCredential, options *a // CreateOrUpdate - Use this method to creates or updates the device security group on a specified IoT Hub resource. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-08-01 -// resourceID - The identifier of the resource. -// deviceSecurityGroupName - The name of the device security group. Note that the name of the device security group is case -// insensitive. -// deviceSecurityGroup - Security group object. -// options - DeviceSecurityGroupsClientCreateOrUpdateOptions contains the optional parameters for the DeviceSecurityGroupsClient.CreateOrUpdate -// method. +// - resourceID - The identifier of the resource. +// - deviceSecurityGroupName - The name of the device security group. Note that the name of the device security group is case +// insensitive. +// - deviceSecurityGroup - Security group object. +// - 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) { req, err := client.createOrUpdateCreateRequest(ctx, resourceID, deviceSecurityGroupName, deviceSecurityGroup, options) if err != nil { @@ -106,12 +107,13 @@ func (client *DeviceSecurityGroupsClient) createOrUpdateHandleResponse(resp *htt // Delete - User this method to deletes the device security group. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-08-01 -// resourceID - The identifier of the resource. -// deviceSecurityGroupName - The name of the device security group. Note that the name of the device security group is case -// insensitive. -// options - DeviceSecurityGroupsClientDeleteOptions contains the optional parameters for the DeviceSecurityGroupsClient.Delete -// method. +// - resourceID - The identifier of the resource. +// - deviceSecurityGroupName - The name of the device security group. Note that the name of the device security group is case +// insensitive. +// - 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) { req, err := client.deleteCreateRequest(ctx, resourceID, deviceSecurityGroupName, options) if err != nil { @@ -148,12 +150,13 @@ func (client *DeviceSecurityGroupsClient) deleteCreateRequest(ctx context.Contex // Get - Use this method to get the device security group for the specified IoT Hub resource. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-08-01 -// resourceID - The identifier of the resource. -// deviceSecurityGroupName - The name of the device security group. Note that the name of the device security group is case -// insensitive. -// options - DeviceSecurityGroupsClientGetOptions contains the optional parameters for the DeviceSecurityGroupsClient.Get -// method. +// - resourceID - The identifier of the resource. +// - deviceSecurityGroupName - The name of the device security group. Note that the name of the device security group is case +// insensitive. +// - 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) { req, err := client.getCreateRequest(ctx, resourceID, deviceSecurityGroupName, options) if err != nil { @@ -198,10 +201,11 @@ func (client *DeviceSecurityGroupsClient) getHandleResponse(resp *http.Response) } // NewListPager - Use this method get the list of device security groups for the specified IoT Hub resource. +// // Generated from API version 2019-08-01 -// resourceID - The identifier of the resource. -// options - DeviceSecurityGroupsClientListOptions contains the optional parameters for the DeviceSecurityGroupsClient.List -// method. +// - resourceID - The identifier of the resource. +// - options - DeviceSecurityGroupsClientListOptions contains the optional parameters for the DeviceSecurityGroupsClient.NewListPager +// method. func (client *DeviceSecurityGroupsClient) NewListPager(resourceID string, options *DeviceSecurityGroupsClientListOptions) *runtime.Pager[DeviceSecurityGroupsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[DeviceSecurityGroupsClientListResponse]{ More: func(page DeviceSecurityGroupsClientListResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/devicesecuritygroups_client_example_test.go b/sdk/resourcemanager/security/armsecurity/devicesecuritygroups_client_example_test.go deleted file mode 100644 index 5f0d6a23eda5..000000000000 --- a/sdk/resourcemanager/security/armsecurity/devicesecuritygroups_client_example_test.go +++ /dev/null @@ -1,108 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/ListDeviceSecurityGroups_example.json -func ExampleDeviceSecurityGroupsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewDeviceSecurityGroupsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/GetDeviceSecurityGroups_example.json -func ExampleDeviceSecurityGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewDeviceSecurityGroupsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", "samplesecuritygroup", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/PutDeviceSecurityGroups_example.json -func ExampleDeviceSecurityGroupsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewDeviceSecurityGroupsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", "samplesecuritygroup", armsecurity.DeviceSecurityGroup{ - Properties: &armsecurity.DeviceSecurityGroupProperties{ - TimeWindowRules: []armsecurity.TimeWindowCustomAlertRuleClassification{ - &armsecurity.ActiveConnectionsNotInAllowedRange{ - IsEnabled: to.Ptr(true), - RuleType: to.Ptr("ActiveConnectionsNotInAllowedRange"), - MaxThreshold: to.Ptr[int32](30), - MinThreshold: to.Ptr[int32](0), - TimeWindowSize: to.Ptr("PT05M"), - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/DeviceSecurityGroups/DeleteDeviceSecurityGroups_example.json -func ExampleDeviceSecurityGroupsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewDeviceSecurityGroupsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/SampleRG/providers/Microsoft.Devices/iotHubs/sampleiothub", "samplesecuritygroup", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/discoveredsecuritysolutions_client.go b/sdk/resourcemanager/security/armsecurity/discoveredsecuritysolutions_client.go index 37900587ad97..c7bcc7667948 100644 --- a/sdk/resourcemanager/security/armsecurity/discoveredsecuritysolutions_client.go +++ b/sdk/resourcemanager/security/armsecurity/discoveredsecuritysolutions_client.go @@ -32,9 +32,9 @@ type DiscoveredSecuritySolutionsClient struct { } // NewDiscoveredSecuritySolutionsClient creates a new instance of DiscoveredSecuritySolutionsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDiscoveredSecuritySolutionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DiscoveredSecuritySolutionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewDiscoveredSecuritySolutionsClient(subscriptionID string, credential azco // Get - Gets a specific discovered Security Solution. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// discoveredSecuritySolutionName - Name of a discovered security solution. -// options - DiscoveredSecuritySolutionsClientGetOptions contains the optional parameters for the DiscoveredSecuritySolutionsClient.Get -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - discoveredSecuritySolutionName - Name of a discovered security solution. +// - 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) { req, err := client.getCreateRequest(ctx, resourceGroupName, ascLocation, discoveredSecuritySolutionName, options) if err != nil { @@ -118,9 +119,10 @@ func (client *DiscoveredSecuritySolutionsClient) getHandleResponse(resp *http.Re } // NewListPager - Gets a list of discovered Security Solutions for the subscription. +// // Generated from API version 2020-01-01 -// options - DiscoveredSecuritySolutionsClientListOptions contains the optional parameters for the DiscoveredSecuritySolutionsClient.List -// method. +// - options - DiscoveredSecuritySolutionsClientListOptions contains the optional parameters for the DiscoveredSecuritySolutionsClient.NewListPager +// method. func (client *DiscoveredSecuritySolutionsClient) NewListPager(options *DiscoveredSecuritySolutionsClientListOptions) *runtime.Pager[DiscoveredSecuritySolutionsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[DiscoveredSecuritySolutionsClientListResponse]{ More: func(page DiscoveredSecuritySolutionsClientListResponse) bool { @@ -177,10 +179,11 @@ func (client *DiscoveredSecuritySolutionsClient) listHandleResponse(resp *http.R } // NewListByHomeRegionPager - Gets a list of discovered Security Solutions for the subscription and location. +// // Generated from API version 2020-01-01 -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// options - DiscoveredSecuritySolutionsClientListByHomeRegionOptions contains the optional parameters for the DiscoveredSecuritySolutionsClient.ListByHomeRegion -// method. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - options - DiscoveredSecuritySolutionsClientListByHomeRegionOptions contains the optional parameters for the DiscoveredSecuritySolutionsClient.NewListByHomeRegionPager +// method. func (client *DiscoveredSecuritySolutionsClient) NewListByHomeRegionPager(ascLocation string, options *DiscoveredSecuritySolutionsClientListByHomeRegionOptions) *runtime.Pager[DiscoveredSecuritySolutionsClientListByHomeRegionResponse] { return runtime.NewPager(runtime.PagingHandler[DiscoveredSecuritySolutionsClientListByHomeRegionResponse]{ More: func(page DiscoveredSecuritySolutionsClientListByHomeRegionResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/discoveredsecuritysolutions_client_example_test.go b/sdk/resourcemanager/security/armsecurity/discoveredsecuritysolutions_client_example_test.go deleted file mode 100644 index 36927b810e3f..000000000000 --- a/sdk/resourcemanager/security/armsecurity/discoveredsecuritysolutions_client_example_test.go +++ /dev/null @@ -1,84 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionsSubscription_example.json -func ExampleDiscoveredSecuritySolutionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewDiscoveredSecuritySolutionsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionsSubscriptionLocation_example.json -func ExampleDiscoveredSecuritySolutionsClient_NewListByHomeRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewDiscoveredSecuritySolutionsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByHomeRegionPager("centralus", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/DiscoveredSecuritySolutions/GetDiscoveredSecuritySolutionResourceGroupLocation_example.json -func ExampleDiscoveredSecuritySolutionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewDiscoveredSecuritySolutionsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myRg2", "centralus", "paloalto7", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/externalsecuritysolutions_client.go b/sdk/resourcemanager/security/armsecurity/externalsecuritysolutions_client.go index a710174214bd..10e7e79a0672 100644 --- a/sdk/resourcemanager/security/armsecurity/externalsecuritysolutions_client.go +++ b/sdk/resourcemanager/security/armsecurity/externalsecuritysolutions_client.go @@ -32,9 +32,9 @@ type ExternalSecuritySolutionsClient struct { } // NewExternalSecuritySolutionsClient creates a new instance of ExternalSecuritySolutionsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewExternalSecuritySolutionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExternalSecuritySolutionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewExternalSecuritySolutionsClient(subscriptionID string, credential azcore // Get - Gets a specific external Security Solution. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// externalSecuritySolutionsName - Name of an external security solution. -// options - ExternalSecuritySolutionsClientGetOptions contains the optional parameters for the ExternalSecuritySolutionsClient.Get -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - externalSecuritySolutionsName - Name of an external security solution. +// - 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) { req, err := client.getCreateRequest(ctx, resourceGroupName, ascLocation, externalSecuritySolutionsName, options) if err != nil { @@ -118,9 +119,10 @@ func (client *ExternalSecuritySolutionsClient) getHandleResponse(resp *http.Resp } // NewListPager - Gets a list of external security solutions for the subscription. +// // Generated from API version 2020-01-01 -// options - ExternalSecuritySolutionsClientListOptions contains the optional parameters for the ExternalSecuritySolutionsClient.List -// method. +// - options - ExternalSecuritySolutionsClientListOptions contains the optional parameters for the ExternalSecuritySolutionsClient.NewListPager +// method. func (client *ExternalSecuritySolutionsClient) NewListPager(options *ExternalSecuritySolutionsClientListOptions) *runtime.Pager[ExternalSecuritySolutionsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ExternalSecuritySolutionsClientListResponse]{ More: func(page ExternalSecuritySolutionsClientListResponse) bool { @@ -177,10 +179,11 @@ func (client *ExternalSecuritySolutionsClient) listHandleResponse(resp *http.Res } // NewListByHomeRegionPager - Gets a list of external Security Solutions for the subscription and location. +// // Generated from API version 2020-01-01 -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// options - ExternalSecuritySolutionsClientListByHomeRegionOptions contains the optional parameters for the ExternalSecuritySolutionsClient.ListByHomeRegion -// method. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - options - ExternalSecuritySolutionsClientListByHomeRegionOptions contains the optional parameters for the ExternalSecuritySolutionsClient.NewListByHomeRegionPager +// method. func (client *ExternalSecuritySolutionsClient) NewListByHomeRegionPager(ascLocation string, options *ExternalSecuritySolutionsClientListByHomeRegionOptions) *runtime.Pager[ExternalSecuritySolutionsClientListByHomeRegionResponse] { return runtime.NewPager(runtime.PagingHandler[ExternalSecuritySolutionsClientListByHomeRegionResponse]{ More: func(page ExternalSecuritySolutionsClientListByHomeRegionResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/externalsecuritysolutions_client_example_test.go b/sdk/resourcemanager/security/armsecurity/externalsecuritysolutions_client_example_test.go deleted file mode 100644 index ac257b74a868..000000000000 --- a/sdk/resourcemanager/security/armsecurity/externalsecuritysolutions_client_example_test.go +++ /dev/null @@ -1,84 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolutionsSubscription_example.json -func ExampleExternalSecuritySolutionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewExternalSecuritySolutionsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolutionsSubscriptionLocation_example.json -func ExampleExternalSecuritySolutionsClient_NewListByHomeRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewExternalSecuritySolutionsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByHomeRegionPager("centralus", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ExternalSecuritySolutions/GetExternalSecuritySolution_example.json -func ExampleExternalSecuritySolutionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewExternalSecuritySolutionsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "defaultresourcegroup-eus", "centralus", "aad_defaultworkspace-20ff7fc3-e762-44dd-bd96-b71116dcdc23-eus", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/go.mod b/sdk/resourcemanager/security/armsecurity/go.mod index 1bcbad76149d..84a93b93dce3 100644 --- a/sdk/resourcemanager/security/armsecurity/go.mod +++ b/sdk/resourcemanager/security/armsecurity/go.mod @@ -2,20 +2,12 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurit go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0 // indirect - github.com/golang-jwt/jwt/v4 v4.4.2 // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/security/armsecurity/go.sum b/sdk/resourcemanager/security/armsecurity/go.sum index 8c0539b73123..3afb578030a5 100644 --- a/sdk/resourcemanager/security/armsecurity/go.sum +++ b/sdk/resourcemanager/security/armsecurity/go.sum @@ -1,30 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 h1:t/W5MYAuQy81cvM8VUNfRLzhtKpXhVUAN7Cd7KVbTyc= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0/go.mod h1:NBanQUfSWiWn3QEpWDTCU0IjBECKOYvl2R8xdRtMtiM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0 h1:VgSJlZH5u0k2qxSpqyghcFQKmvYckj46uymKK5XzkBM= -github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0/go.mod h1:BDJ5qMFKx9DugEg3+uQSDCdbYPr5s9vBTrL9P8TpqOU= 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.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= -github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/security/armsecurity/governanceassignments_client.go b/sdk/resourcemanager/security/armsecurity/governanceassignments_client.go index 09945ef5d0b5..3b84c3b0031c 100644 --- a/sdk/resourcemanager/security/armsecurity/governanceassignments_client.go +++ b/sdk/resourcemanager/security/armsecurity/governanceassignments_client.go @@ -31,8 +31,8 @@ type GovernanceAssignmentsClient struct { } // NewGovernanceAssignmentsClient creates a new instance of GovernanceAssignmentsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewGovernanceAssignmentsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*GovernanceAssignmentsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -52,16 +52,18 @@ func NewGovernanceAssignmentsClient(credential azcore.TokenCredential, options * return client, nil } -// CreateOrUpdate - Creates or update a security GovernanceAssignment on the given subscription. +// CreateOrUpdate - Creates or updates a governance assignment on the given subscription. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-01-preview -// scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group -// (/providers/Microsoft.Management/managementGroups/mgName). -// assessmentName - The Assessment Key - Unique key for the assessment type -// assignmentKey - The security governance assignment key - the assessment key of the required governance assignment -// governanceAssignment - GovernanceAssignment over a subscription scope -// options - GovernanceAssignmentsClientCreateOrUpdateOptions contains the optional parameters for the GovernanceAssignmentsClient.CreateOrUpdate -// method. +// - scope - The scope of the Governance assignments. Valid scopes are: subscription (format: 'subscriptions/{subscriptionId}'), +// or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - assessmentName - The Assessment Key - A unique key for the assessment type +// - assignmentKey - The governance assignment key - the assessment key of the required governance assignment +// - governanceAssignment - Governance assignment over a subscription scope +// - options - GovernanceAssignmentsClientCreateOrUpdateOptions contains the optional parameters for the GovernanceAssignmentsClient.CreateOrUpdate +// method. func (client *GovernanceAssignmentsClient) CreateOrUpdate(ctx context.Context, scope string, assessmentName string, assignmentKey string, governanceAssignment GovernanceAssignment, options *GovernanceAssignmentsClientCreateOrUpdateOptions) (GovernanceAssignmentsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, scope, assessmentName, assignmentKey, governanceAssignment, options) if err != nil { @@ -80,7 +82,10 @@ func (client *GovernanceAssignmentsClient) CreateOrUpdate(ctx context.Context, s // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *GovernanceAssignmentsClient) createOrUpdateCreateRequest(ctx context.Context, scope string, assessmentName string, assignmentKey string, governanceAssignment GovernanceAssignment, options *GovernanceAssignmentsClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}" - urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) if assessmentName == "" { return nil, errors.New("parameter assessmentName cannot be empty") } @@ -111,13 +116,15 @@ func (client *GovernanceAssignmentsClient) createOrUpdateHandleResponse(resp *ht // Delete - Delete a GovernanceAssignment over a given scope // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-01-preview -// scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group -// (/providers/Microsoft.Management/managementGroups/mgName). -// assessmentName - The Assessment Key - Unique key for the assessment type -// assignmentKey - The security governance assignment key - the assessment key of the required governance assignment -// options - GovernanceAssignmentsClientDeleteOptions contains the optional parameters for the GovernanceAssignmentsClient.Delete -// method. +// - scope - The scope of the Governance assignments. Valid scopes are: subscription (format: 'subscriptions/{subscriptionId}'), +// or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - assessmentName - The Assessment Key - A unique key for the assessment type +// - assignmentKey - The governance assignment key - the assessment key of the required governance assignment +// - options - GovernanceAssignmentsClientDeleteOptions contains the optional parameters for the GovernanceAssignmentsClient.Delete +// method. func (client *GovernanceAssignmentsClient) Delete(ctx context.Context, scope string, assessmentName string, assignmentKey string, options *GovernanceAssignmentsClientDeleteOptions) (GovernanceAssignmentsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, scope, assessmentName, assignmentKey, options) if err != nil { @@ -136,7 +143,10 @@ func (client *GovernanceAssignmentsClient) Delete(ctx context.Context, scope str // deleteCreateRequest creates the Delete request. func (client *GovernanceAssignmentsClient) deleteCreateRequest(ctx context.Context, scope string, assessmentName string, assignmentKey string, options *GovernanceAssignmentsClientDeleteOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}" - urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) if assessmentName == "" { return nil, errors.New("parameter assessmentName cannot be empty") } @@ -157,13 +167,15 @@ func (client *GovernanceAssignmentsClient) deleteCreateRequest(ctx context.Conte // Get - Get a specific governanceAssignment for the requested scope by AssignmentKey // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-01-preview -// scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group -// (/providers/Microsoft.Management/managementGroups/mgName). -// assessmentName - The Assessment Key - Unique key for the assessment type -// assignmentKey - The security governance assignment key - the assessment key of the required governance assignment -// options - GovernanceAssignmentsClientGetOptions contains the optional parameters for the GovernanceAssignmentsClient.Get -// method. +// - scope - The scope of the Governance assignments. Valid scopes are: subscription (format: 'subscriptions/{subscriptionId}'), +// or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - assessmentName - The Assessment Key - A unique key for the assessment type +// - assignmentKey - The governance assignment key - the assessment key of the required governance assignment +// - options - GovernanceAssignmentsClientGetOptions contains the optional parameters for the GovernanceAssignmentsClient.Get +// method. func (client *GovernanceAssignmentsClient) Get(ctx context.Context, scope string, assessmentName string, assignmentKey string, options *GovernanceAssignmentsClientGetOptions) (GovernanceAssignmentsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, scope, assessmentName, assignmentKey, options) if err != nil { @@ -182,7 +194,10 @@ func (client *GovernanceAssignmentsClient) Get(ctx context.Context, scope string // getCreateRequest creates the Get request. func (client *GovernanceAssignmentsClient) getCreateRequest(ctx context.Context, scope string, assessmentName string, assignmentKey string, options *GovernanceAssignmentsClientGetOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments/{assignmentKey}" - urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) if assessmentName == "" { return nil, errors.New("parameter assessmentName cannot be empty") } @@ -211,13 +226,15 @@ func (client *GovernanceAssignmentsClient) getHandleResponse(resp *http.Response return result, nil } -// NewListPager - Get security governanceAssignments on all your resources inside a scope +// NewListPager - Get governance assignments on all of your resources inside a scope +// // Generated from API version 2022-01-01-preview -// scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group -// (/providers/Microsoft.Management/managementGroups/mgName). -// assessmentName - The Assessment Key - Unique key for the assessment type -// options - GovernanceAssignmentsClientListOptions contains the optional parameters for the GovernanceAssignmentsClient.List -// method. +// - scope - The scope of the Governance assignments. Valid scopes are: subscription (format: 'subscriptions/{subscriptionId}'), +// or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - assessmentName - The Assessment Key - A unique key for the assessment type +// - options - GovernanceAssignmentsClientListOptions contains the optional parameters for the GovernanceAssignmentsClient.NewListPager +// method. func (client *GovernanceAssignmentsClient) NewListPager(scope string, assessmentName string, options *GovernanceAssignmentsClientListOptions) *runtime.Pager[GovernanceAssignmentsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[GovernanceAssignmentsClientListResponse]{ More: func(page GovernanceAssignmentsClientListResponse) bool { @@ -249,7 +266,10 @@ func (client *GovernanceAssignmentsClient) NewListPager(scope string, assessment // listCreateRequest creates the List request. func (client *GovernanceAssignmentsClient) listCreateRequest(ctx context.Context, scope string, assessmentName string, options *GovernanceAssignmentsClientListOptions) (*policy.Request, error) { urlPath := "/{scope}/providers/Microsoft.Security/assessments/{assessmentName}/governanceAssignments" - urlPath = strings.ReplaceAll(urlPath, "{scope}", scope) + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) if assessmentName == "" { return nil, errors.New("parameter assessmentName cannot be empty") } diff --git a/sdk/resourcemanager/security/armsecurity/governanceassignments_client_example_test.go b/sdk/resourcemanager/security/armsecurity/governanceassignments_client_example_test.go deleted file mode 100644 index fa60f7b5d251..000000000000 --- a/sdk/resourcemanager/security/armsecurity/governanceassignments_client_example_test.go +++ /dev/null @@ -1,118 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/ListGovernanceAssignments_example.json -func ExampleGovernanceAssignmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewGovernanceAssignmentsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd", "6b9421dd-5555-2251-9b3d-2be58e2f82cd", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/GetGovernanceAssignment_example.json -func ExampleGovernanceAssignmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewGovernanceAssignmentsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", "6b9421dd-5555-2251-9b3d-2be58e2f82cd", "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/PutGovernanceAssignment_example.json -func ExampleGovernanceAssignmentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewGovernanceAssignmentsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", "6b9421dd-5555-2251-9b3d-2be58e2f82cd", "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", armsecurity.GovernanceAssignment{ - Properties: &armsecurity.GovernanceAssignmentProperties{ - AdditionalData: &armsecurity.GovernanceAssignmentAdditionalData{ - TicketLink: to.Ptr("https://snow.com"), - TicketNumber: to.Ptr[int32](123123), - TicketStatus: to.Ptr("Active"), - }, - GovernanceEmailNotification: &armsecurity.GovernanceEmailNotification{ - DisableManagerEmailNotification: to.Ptr(false), - DisableOwnerEmailNotification: to.Ptr(false), - }, - IsGracePeriod: to.Ptr(true), - Owner: to.Ptr("user@contoso.com"), - RemediationDueDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-07T13:00:00.0000000Z"); return t }()), - RemediationEta: &armsecurity.RemediationEta{ - Eta: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2022-01-08T13:00:00.0000000Z"); return t }()), - Justification: to.Ptr("Justification of ETA"), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceAssignments/DeleteGovernanceAssignment_example.json -func ExampleGovernanceAssignmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewGovernanceAssignmentsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "subscriptions/c32e05d9-7207-4e22-bdf4-4f7d9c72e5fd/resourceGroups/compute_servers/providers/Microsoft.Compute/virtualMachines/win2012", "6b9421dd-5555-2251-9b3d-2be58e2f82cd", "6634ff9f-127b-4bf2-8e6e-b1737f5e789c", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/governancerule_client.go b/sdk/resourcemanager/security/armsecurity/governancerule_client.go deleted file mode 100644 index 7db7da579719..000000000000 --- a/sdk/resourcemanager/security/armsecurity/governancerule_client.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 - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// GovernanceRuleClient contains the methods for the GovernanceRule group. -// Don't use this type directly, use NewGovernanceRuleClient() instead. -type GovernanceRuleClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewGovernanceRuleClient creates a new instance of GovernanceRuleClient with the specified values. -// subscriptionID - Azure subscription ID -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewGovernanceRuleClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GovernanceRuleClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &GovernanceRuleClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListPager - Get a list of all relevant governanceRules over a subscription level scope -// Generated from API version 2022-01-01-preview -// options - GovernanceRuleClientListOptions contains the optional parameters for the GovernanceRuleClient.List method. -func (client *GovernanceRuleClient) NewListPager(options *GovernanceRuleClientListOptions) *runtime.Pager[GovernanceRuleClientListResponse] { - return runtime.NewPager(runtime.PagingHandler[GovernanceRuleClientListResponse]{ - More: func(page GovernanceRuleClientListResponse) bool { - return page.NextLink != nil && len(*page.NextLink) > 0 - }, - Fetcher: func(ctx context.Context, page *GovernanceRuleClientListResponse) (GovernanceRuleClientListResponse, error) { - var req *policy.Request - var err error - if page == nil { - req, err = client.listCreateRequest(ctx, options) - } else { - req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) - } - if err != nil { - return GovernanceRuleClientListResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return GovernanceRuleClientListResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return GovernanceRuleClientListResponse{}, runtime.NewResponseError(resp) - } - return client.listHandleResponse(resp) - }, - }) -} - -// listCreateRequest creates the List request. -func (client *GovernanceRuleClient) listCreateRequest(ctx context.Context, options *GovernanceRuleClientListOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listHandleResponse handles the List response. -func (client *GovernanceRuleClient) listHandleResponse(resp *http.Response) (GovernanceRuleClientListResponse, error) { - result := GovernanceRuleClientListResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.GovernanceRuleList); err != nil { - return GovernanceRuleClientListResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/security/armsecurity/governancerule_client_example_test.go b/sdk/resourcemanager/security/armsecurity/governancerule_client_example_test.go deleted file mode 100644 index 989a01b64165..000000000000 --- a/sdk/resourcemanager/security/armsecurity/governancerule_client_example_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/ListBySubscriptionGovernanceRules_example.json -func ExampleGovernanceRuleClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewGovernanceRuleClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/governancerules_client.go b/sdk/resourcemanager/security/armsecurity/governancerules_client.go index b8f65daca535..eccc5b4fa3a4 100644 --- a/sdk/resourcemanager/security/armsecurity/governancerules_client.go +++ b/sdk/resourcemanager/security/armsecurity/governancerules_client.go @@ -26,16 +26,14 @@ import ( // GovernanceRulesClient contains the methods for the GovernanceRules group. // Don't use this type directly, use NewGovernanceRulesClient() instead. type GovernanceRulesClient struct { - host string - subscriptionID string - pl runtime.Pipeline + host string + pl runtime.Pipeline } // NewGovernanceRulesClient creates a new instance of GovernanceRulesClient with the specified values. -// subscriptionID - Azure subscription ID -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewGovernanceRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GovernanceRulesClient, error) { +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewGovernanceRulesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*GovernanceRulesClient, error) { if options == nil { options = &arm.ClientOptions{} } @@ -48,22 +46,26 @@ func NewGovernanceRulesClient(subscriptionID string, credential azcore.TokenCred return nil, err } client := &GovernanceRulesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, + host: ep, + pl: pl, } return client, nil } -// CreateOrUpdate - Creates or update a security GovernanceRule on the given subscription. +// CreateOrUpdate - Creates or updates a governance rule over a given scope // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-01-preview -// ruleID - The security GovernanceRule key - unique key for the standard GovernanceRule -// governanceRule - GovernanceRule over a subscription scope -// options - GovernanceRulesClientCreateOrUpdateOptions contains the optional parameters for the GovernanceRulesClient.CreateOrUpdate -// method. -func (client *GovernanceRulesClient) CreateOrUpdate(ctx context.Context, ruleID string, governanceRule GovernanceRule, options *GovernanceRulesClientCreateOrUpdateOptions) (GovernanceRulesClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, ruleID, governanceRule, options) +// - scope - The scope of the Governance rules. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), +// subscription (format: +// 'subscriptions/{subscriptionId}'), or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - ruleID - The governance rule key - unique key for the standard governance rule (GUID) +// - governanceRule - Governance rule over a given scope +// - options - GovernanceRulesClientCreateOrUpdateOptions contains the optional parameters for the GovernanceRulesClient.CreateOrUpdate +// method. +func (client *GovernanceRulesClient) CreateOrUpdate(ctx context.Context, scope string, ruleID string, governanceRule GovernanceRule, options *GovernanceRulesClientCreateOrUpdateOptions) (GovernanceRulesClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, scope, ruleID, governanceRule, options) if err != nil { return GovernanceRulesClientCreateOrUpdateResponse{}, err } @@ -78,12 +80,12 @@ func (client *GovernanceRulesClient) CreateOrUpdate(ctx context.Context, ruleID } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *GovernanceRulesClient) createOrUpdateCreateRequest(ctx context.Context, ruleID string, governanceRule GovernanceRule, options *GovernanceRulesClientCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") +func (client *GovernanceRulesClient) createOrUpdateCreateRequest(ctx context.Context, scope string, ruleID string, governanceRule GovernanceRule, options *GovernanceRulesClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}" + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) if ruleID == "" { return nil, errors.New("parameter ruleID cannot be empty") } @@ -108,33 +110,57 @@ func (client *GovernanceRulesClient) createOrUpdateHandleResponse(resp *http.Res return result, nil } -// Delete - Delete a GovernanceRule over a given scope +// BeginDelete - Delete a Governance rule over a given scope // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-01-preview -// ruleID - The security GovernanceRule key - unique key for the standard GovernanceRule -// options - GovernanceRulesClientDeleteOptions contains the optional parameters for the GovernanceRulesClient.Delete method. -func (client *GovernanceRulesClient) Delete(ctx context.Context, ruleID string, options *GovernanceRulesClientDeleteOptions) (GovernanceRulesClientDeleteResponse, error) { - req, err := client.deleteCreateRequest(ctx, ruleID, options) +// - scope - The scope of the Governance rules. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), +// subscription (format: +// 'subscriptions/{subscriptionId}'), or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - ruleID - The governance rule key - unique key for the standard governance rule (GUID) +// - options - GovernanceRulesClientBeginDeleteOptions contains the optional parameters for the GovernanceRulesClient.BeginDelete +// method. +func (client *GovernanceRulesClient) BeginDelete(ctx context.Context, scope string, ruleID string, options *GovernanceRulesClientBeginDeleteOptions) (*runtime.Poller[GovernanceRulesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, scope, ruleID, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[GovernanceRulesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[GovernanceRulesClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Delete a Governance rule over a given scope +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-01-01-preview +func (client *GovernanceRulesClient) deleteOperation(ctx context.Context, scope string, ruleID string, options *GovernanceRulesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, scope, ruleID, options) if err != nil { - return GovernanceRulesClientDeleteResponse{}, err + return nil, err } resp, err := client.pl.Do(req) if err != nil { - return GovernanceRulesClientDeleteResponse{}, err + return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return GovernanceRulesClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) } - return GovernanceRulesClientDeleteResponse{}, nil + return resp, nil } // deleteCreateRequest creates the Delete request. -func (client *GovernanceRulesClient) deleteCreateRequest(ctx context.Context, ruleID string, options *GovernanceRulesClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") +func (client *GovernanceRulesClient) deleteCreateRequest(ctx context.Context, scope string, ruleID string, options *GovernanceRulesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}" + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) if ruleID == "" { return nil, errors.New("parameter ruleID cannot be empty") } @@ -149,13 +175,87 @@ func (client *GovernanceRulesClient) deleteCreateRequest(ctx context.Context, ru return req, nil } -// Get - Get a specific governanceRule for the requested scope by ruleId +// BeginExecute - Execute a governance rule +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-01-01-preview +// - scope - The scope of the Governance rules. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), +// subscription (format: +// 'subscriptions/{subscriptionId}'), or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - ruleID - The governance rule key - unique key for the standard governance rule (GUID) +// - options - GovernanceRulesClientBeginExecuteOptions contains the optional parameters for the GovernanceRulesClient.BeginExecute +// method. +func (client *GovernanceRulesClient) BeginExecute(ctx context.Context, scope string, ruleID string, options *GovernanceRulesClientBeginExecuteOptions) (*runtime.Poller[GovernanceRulesClientExecuteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.execute(ctx, scope, ruleID, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[GovernanceRulesClientExecuteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[GovernanceRulesClientExecuteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Execute - Execute a governance rule +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-01-01-preview +func (client *GovernanceRulesClient) execute(ctx context.Context, scope string, ruleID string, options *GovernanceRulesClientBeginExecuteOptions) (*http.Response, error) { + req, err := client.executeCreateRequest(ctx, scope, ruleID, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// executeCreateRequest creates the Execute request. +func (client *GovernanceRulesClient) executeCreateRequest(ctx context.Context, scope string, ruleID string, options *GovernanceRulesClientBeginExecuteOptions) (*policy.Request, error) { + urlPath := "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}/execute" + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) + if ruleID == "" { + return nil, errors.New("parameter ruleID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-01-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if options != nil && options.ExecuteGovernanceRuleParams != nil { + return req, runtime.MarshalAsJSON(req, *options.ExecuteGovernanceRuleParams) + } + return req, nil +} + +// Get - Get a specific governance rule for the requested scope by ruleId // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-01-preview -// ruleID - The security GovernanceRule key - unique key for the standard GovernanceRule -// options - GovernanceRulesClientGetOptions contains the optional parameters for the GovernanceRulesClient.Get method. -func (client *GovernanceRulesClient) Get(ctx context.Context, ruleID string, options *GovernanceRulesClientGetOptions) (GovernanceRulesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, ruleID, options) +// - scope - The scope of the Governance rules. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), +// subscription (format: +// 'subscriptions/{subscriptionId}'), or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - ruleID - The governance rule key - unique key for the standard governance rule (GUID) +// - options - GovernanceRulesClientGetOptions contains the optional parameters for the GovernanceRulesClient.Get method. +func (client *GovernanceRulesClient) Get(ctx context.Context, scope string, ruleID string, options *GovernanceRulesClientGetOptions) (GovernanceRulesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, scope, ruleID, options) if err != nil { return GovernanceRulesClientGetResponse{}, err } @@ -170,12 +270,12 @@ func (client *GovernanceRulesClient) Get(ctx context.Context, ruleID string, opt } // getCreateRequest creates the Get request. -func (client *GovernanceRulesClient) getCreateRequest(ctx context.Context, ruleID string, options *GovernanceRulesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") +func (client *GovernanceRulesClient) getCreateRequest(ctx context.Context, scope string, ruleID string, options *GovernanceRulesClientGetOptions) (*policy.Request, error) { + urlPath := "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}" + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) if ruleID == "" { return nil, errors.New("parameter ruleID cannot be empty") } @@ -200,64 +300,51 @@ func (client *GovernanceRulesClient) getHandleResponse(resp *http.Response) (Gov return result, nil } -// BeginRuleIDExecuteSingleSecurityConnector - Execute a security GovernanceRule on the given security connector. -// If the operation fails it returns an *azcore.ResponseError type. +// NewListPager - Get a list of all relevant governance rules over a scope +// // Generated from API version 2022-01-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// securityConnectorName - The security connector name. -// ruleID - The security GovernanceRule key - unique key for the standard GovernanceRule -// options - GovernanceRulesClientBeginRuleIDExecuteSingleSecurityConnectorOptions contains the optional parameters for the -// GovernanceRulesClient.BeginRuleIDExecuteSingleSecurityConnector method. -func (client *GovernanceRulesClient) BeginRuleIDExecuteSingleSecurityConnector(ctx context.Context, resourceGroupName string, securityConnectorName string, ruleID string, options *GovernanceRulesClientBeginRuleIDExecuteSingleSecurityConnectorOptions) (*runtime.Poller[GovernanceRulesClientRuleIDExecuteSingleSecurityConnectorResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.ruleIDExecuteSingleSecurityConnector(ctx, resourceGroupName, securityConnectorName, ruleID, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[GovernanceRulesClientRuleIDExecuteSingleSecurityConnectorResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[GovernanceRulesClientRuleIDExecuteSingleSecurityConnectorResponse](options.ResumeToken, client.pl, nil) - } +// - scope - The scope of the Governance rules. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), +// subscription (format: +// 'subscriptions/{subscriptionId}'), or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - options - GovernanceRulesClientListOptions contains the optional parameters for the GovernanceRulesClient.NewListPager +// method. +func (client *GovernanceRulesClient) NewListPager(scope string, options *GovernanceRulesClientListOptions) *runtime.Pager[GovernanceRulesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[GovernanceRulesClientListResponse]{ + More: func(page GovernanceRulesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *GovernanceRulesClientListResponse) (GovernanceRulesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, scope, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return GovernanceRulesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GovernanceRulesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GovernanceRulesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) } -// RuleIDExecuteSingleSecurityConnector - Execute a security GovernanceRule on the given security connector. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview -func (client *GovernanceRulesClient) ruleIDExecuteSingleSecurityConnector(ctx context.Context, resourceGroupName string, securityConnectorName string, ruleID string, options *GovernanceRulesClientBeginRuleIDExecuteSingleSecurityConnectorOptions) (*http.Response, error) { - req, err := client.ruleIDExecuteSingleSecurityConnectorCreateRequest(ctx, resourceGroupName, securityConnectorName, ruleID, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err +// listCreateRequest creates the List request. +func (client *GovernanceRulesClient) listCreateRequest(ctx context.Context, scope string, options *GovernanceRulesClientListOptions) (*policy.Request, error) { + urlPath := "/{scope}/providers/Microsoft.Security/governanceRules" + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// ruleIDExecuteSingleSecurityConnectorCreateRequest creates the RuleIDExecuteSingleSecurityConnector request. -func (client *GovernanceRulesClient) ruleIDExecuteSingleSecurityConnectorCreateRequest(ctx context.Context, resourceGroupName string, securityConnectorName string, ruleID string, options *GovernanceRulesClientBeginRuleIDExecuteSingleSecurityConnectorOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName}/providers/Microsoft.Security/governanceRules/{ruleId}/execute" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if securityConnectorName == "" { - return nil, errors.New("parameter securityConnectorName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{securityConnectorName}", url.PathEscape(securityConnectorName)) - if ruleID == "" { - return nil, errors.New("parameter ruleID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } @@ -265,60 +352,61 @@ func (client *GovernanceRulesClient) ruleIDExecuteSingleSecurityConnectorCreateR reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.ExecuteGovernanceRuleParams != nil { - return req, runtime.MarshalAsJSON(req, *options.ExecuteGovernanceRuleParams) - } return req, nil } -// BeginRuleIDExecuteSingleSubscription - Execute a security GovernanceRule on the given subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview -// ruleID - The security GovernanceRule key - unique key for the standard GovernanceRule -// options - GovernanceRulesClientBeginRuleIDExecuteSingleSubscriptionOptions contains the optional parameters for the GovernanceRulesClient.BeginRuleIDExecuteSingleSubscription -// method. -func (client *GovernanceRulesClient) BeginRuleIDExecuteSingleSubscription(ctx context.Context, ruleID string, options *GovernanceRulesClientBeginRuleIDExecuteSingleSubscriptionOptions) (*runtime.Poller[GovernanceRulesClientRuleIDExecuteSingleSubscriptionResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.ruleIDExecuteSingleSubscription(ctx, ruleID, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[GovernanceRulesClientRuleIDExecuteSingleSubscriptionResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[GovernanceRulesClientRuleIDExecuteSingleSubscriptionResponse](options.ResumeToken, client.pl, nil) +// listHandleResponse handles the List response. +func (client *GovernanceRulesClient) listHandleResponse(resp *http.Response) (GovernanceRulesClientListResponse, error) { + result := GovernanceRulesClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.GovernanceRuleList); err != nil { + return GovernanceRulesClientListResponse{}, err } + return result, nil } -// RuleIDExecuteSingleSubscription - Execute a security GovernanceRule on the given subscription. +// OperationResults - Get governance rules long run operation result for the requested scope by ruleId and operationId // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-01-01-preview -func (client *GovernanceRulesClient) ruleIDExecuteSingleSubscription(ctx context.Context, ruleID string, options *GovernanceRulesClientBeginRuleIDExecuteSingleSubscriptionOptions) (*http.Response, error) { - req, err := client.ruleIDExecuteSingleSubscriptionCreateRequest(ctx, ruleID, options) +// - scope - The scope of the Governance rules. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), +// subscription (format: +// 'subscriptions/{subscriptionId}'), or security connector (format: +// 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})' +// - ruleID - The governance rule key - unique key for the standard governance rule (GUID) +// - operationID - The governance rule long running operation unique key +// - options - GovernanceRulesClientOperationResultsOptions contains the optional parameters for the GovernanceRulesClient.OperationResults +// method. +func (client *GovernanceRulesClient) OperationResults(ctx context.Context, scope string, ruleID string, operationID string, options *GovernanceRulesClientOperationResultsOptions) (GovernanceRulesClientOperationResultsResponse, error) { + req, err := client.operationResultsCreateRequest(ctx, scope, ruleID, operationID, options) if err != nil { - return nil, err + return GovernanceRulesClientOperationResultsResponse{}, err } resp, err := client.pl.Do(req) if err != nil { - return nil, err + return GovernanceRulesClientOperationResultsResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return GovernanceRulesClientOperationResultsResponse{}, runtime.NewResponseError(resp) } - return resp, nil + return client.operationResultsHandleResponse(resp) } -// ruleIDExecuteSingleSubscriptionCreateRequest creates the RuleIDExecuteSingleSubscription request. -func (client *GovernanceRulesClient) ruleIDExecuteSingleSubscriptionCreateRequest(ctx context.Context, ruleID string, options *GovernanceRulesClientBeginRuleIDExecuteSingleSubscriptionOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/execute" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") +// operationResultsCreateRequest creates the OperationResults request. +func (client *GovernanceRulesClient) operationResultsCreateRequest(ctx context.Context, scope string, ruleID string, operationID string, options *GovernanceRulesClientOperationResultsOptions) (*policy.Request, error) { + urlPath := "/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}" + if scope == "" { + return nil, errors.New("parameter scope cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + urlPath = strings.ReplaceAll(urlPath, "{scope}", url.PathEscape(scope)) if ruleID == "" { return nil, errors.New("parameter ruleID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) - req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if operationID == "" { + return nil, errors.New("parameter operationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } @@ -326,8 +414,17 @@ func (client *GovernanceRulesClient) ruleIDExecuteSingleSubscriptionCreateReques reqQP.Set("api-version", "2022-01-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - if options != nil && options.ExecuteGovernanceRuleParams != nil { - return req, runtime.MarshalAsJSON(req, *options.ExecuteGovernanceRuleParams) - } return req, nil } + +// operationResultsHandleResponse handles the OperationResults response. +func (client *GovernanceRulesClient) operationResultsHandleResponse(resp *http.Response) (GovernanceRulesClientOperationResultsResponse, error) { + result := GovernanceRulesClientOperationResultsResponse{} + if val := resp.Header.Get("location"); val != "" { + result.Location = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.OperationResultAutoGenerated); err != nil { + return GovernanceRulesClientOperationResultsResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/security/armsecurity/governancerules_client_example_test.go b/sdk/resourcemanager/security/armsecurity/governancerules_client_example_test.go deleted file mode 100644 index 44f38d51d6bf..000000000000 --- a/sdk/resourcemanager/security/armsecurity/governancerules_client_example_test.go +++ /dev/null @@ -1,144 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRule_example.json -func ExampleGovernanceRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewGovernanceRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PutGovernanceRule_example.json -func ExampleGovernanceRulesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewGovernanceRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", armsecurity.GovernanceRule{ - Properties: &armsecurity.GovernanceRuleProperties{ - Description: to.Ptr("A rule on critical recommendations"), - ConditionSets: []interface{}{ - map[string]interface{}{ - "conditions": []interface{}{ - map[string]interface{}{ - "operator": "In", - "property": "$.AssessmentKey", - "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]", - }, - }, - }}, - DisplayName: to.Ptr("Admin's rule"), - GovernanceEmailNotification: &armsecurity.GovernanceRuleEmailNotification{ - DisableManagerEmailNotification: to.Ptr(false), - DisableOwnerEmailNotification: to.Ptr(false), - }, - IsDisabled: to.Ptr(false), - IsGracePeriod: to.Ptr(true), - OwnerSource: &armsecurity.GovernanceRuleOwnerSource{ - Type: to.Ptr(armsecurity.GovernanceRuleOwnerSourceTypeManually), - Value: to.Ptr("user@contoso.com"), - }, - RemediationTimeframe: to.Ptr("7.00:00:00"), - RulePriority: to.Ptr[int32](200), - RuleType: to.Ptr(armsecurity.GovernanceRuleTypeIntegrated), - SourceResourceType: to.Ptr(armsecurity.GovernanceRuleSourceResourceTypeAssessments), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/DeleteGovernanceRule_example.json -func ExampleGovernanceRulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewGovernanceRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PostGovernanceRule_example.json -func ExampleGovernanceRulesClient_BeginRuleIDExecuteSingleSubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewGovernanceRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRuleIDExecuteSingleSubscription(ctx, "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", &armsecurity.GovernanceRulesClientBeginRuleIDExecuteSingleSubscriptionOptions{ExecuteGovernanceRuleParams: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/PostSecurityConnectorGovernanceRule_example.json -func ExampleGovernanceRulesClient_BeginRuleIDExecuteSingleSecurityConnector() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewGovernanceRulesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRuleIDExecuteSingleSecurityConnector(ctx, "gcpResourceGroup", "gcpconnector", "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", &armsecurity.GovernanceRulesClientBeginRuleIDExecuteSingleSecurityConnectorOptions{ExecuteGovernanceRuleParams: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/informationprotectionpolicies_client.go b/sdk/resourcemanager/security/armsecurity/informationprotectionpolicies_client.go index 599e9491c74b..537e29d464bf 100644 --- a/sdk/resourcemanager/security/armsecurity/informationprotectionpolicies_client.go +++ b/sdk/resourcemanager/security/armsecurity/informationprotectionpolicies_client.go @@ -31,8 +31,8 @@ type InformationProtectionPoliciesClient struct { } // NewInformationProtectionPoliciesClient creates a new instance of InformationProtectionPoliciesClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewInformationProtectionPoliciesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*InformationProtectionPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -54,13 +54,14 @@ func NewInformationProtectionPoliciesClient(credential azcore.TokenCredential, o // CreateOrUpdate - Details of the information protection policy. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2017-08-01-preview -// scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group -// (/providers/Microsoft.Management/managementGroups/mgName). -// informationProtectionPolicyName - Name of the information protection policy. -// informationProtectionPolicy - Information protection policy. -// options - InformationProtectionPoliciesClientCreateOrUpdateOptions contains the optional parameters for the InformationProtectionPoliciesClient.CreateOrUpdate -// method. +// - scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group +// (/providers/Microsoft.Management/managementGroups/mgName). +// - informationProtectionPolicyName - Name of the information protection policy. +// - informationProtectionPolicy - Information protection policy. +// - 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) { req, err := client.createOrUpdateCreateRequest(ctx, scope, informationProtectionPolicyName, informationProtectionPolicy, options) if err != nil { @@ -106,12 +107,13 @@ func (client *InformationProtectionPoliciesClient) createOrUpdateHandleResponse( // Get - Details of the information protection policy. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2017-08-01-preview -// scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group -// (/providers/Microsoft.Management/managementGroups/mgName). -// informationProtectionPolicyName - Name of the information protection policy. -// options - InformationProtectionPoliciesClientGetOptions contains the optional parameters for the InformationProtectionPoliciesClient.Get -// method. +// - scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group +// (/providers/Microsoft.Management/managementGroups/mgName). +// - informationProtectionPolicyName - Name of the information protection policy. +// - 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) { req, err := client.getCreateRequest(ctx, scope, informationProtectionPolicyName, options) if err != nil { @@ -156,11 +158,12 @@ func (client *InformationProtectionPoliciesClient) getHandleResponse(resp *http. } // NewListPager - Information protection policies of a specific management group. +// // Generated from API version 2017-08-01-preview -// scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group -// (/providers/Microsoft.Management/managementGroups/mgName). -// options - InformationProtectionPoliciesClientListOptions contains the optional parameters for the InformationProtectionPoliciesClient.List -// method. +// - scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group +// (/providers/Microsoft.Management/managementGroups/mgName). +// - options - InformationProtectionPoliciesClientListOptions contains the optional parameters for the InformationProtectionPoliciesClient.NewListPager +// method. func (client *InformationProtectionPoliciesClient) NewListPager(scope string, options *InformationProtectionPoliciesClientListOptions) *runtime.Pager[InformationProtectionPoliciesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[InformationProtectionPoliciesClientListResponse]{ More: func(page InformationProtectionPoliciesClientListResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/informationprotectionpolicies_client_example_test.go b/sdk/resourcemanager/security/armsecurity/informationprotectionpolicies_client_example_test.go deleted file mode 100644 index 4348e8472f64..000000000000 --- a/sdk/resourcemanager/security/armsecurity/informationprotectionpolicies_client_example_test.go +++ /dev/null @@ -1,147 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/GetCustomInformationProtectionPolicy_example.json -func ExampleInformationProtectionPoliciesClient_Get_getTheCustomizedInformationProtectionPolicyForAManagementGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewInformationProtectionPoliciesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", armsecurity.InformationProtectionPolicyNameCustom, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/GetEffectiveInformationProtectionPolicy_example.json -func ExampleInformationProtectionPoliciesClient_Get_getTheEffectiveInformationProtectionPolicyForAManagementGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewInformationProtectionPoliciesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", armsecurity.InformationProtectionPolicyNameEffective, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/CreateOrUpdateInformationProtectionPolicy_example.json -func ExampleInformationProtectionPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewInformationProtectionPoliciesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", armsecurity.InformationProtectionPolicyNameCustom, armsecurity.InformationProtectionPolicy{ - Properties: &armsecurity.InformationProtectionPolicyProperties{ - InformationTypes: map[string]*armsecurity.InformationType{ - "3bf35491-99b8-41f2-86d5-c1200a7df658": { - Custom: to.Ptr(true), - DisplayName: to.Ptr("Custom"), - Enabled: to.Ptr(true), - Keywords: []*armsecurity.InformationProtectionKeyword{ - { - CanBeNumeric: to.Ptr(true), - Custom: to.Ptr(true), - Pattern: to.Ptr("%custom%"), - }}, - Order: to.Ptr[int32](1400), - RecommendedLabelID: to.Ptr("7aa516c7-5a53-4857-bc6e-6808c6acd542"), - }, - "7fb9419d-2473-4ad8-8e11-b25cc8cf6a07": { - Custom: to.Ptr(false), - DisplayName: to.Ptr("Networking"), - Enabled: to.Ptr(true), - Keywords: []*armsecurity.InformationProtectionKeyword{ - { - CanBeNumeric: to.Ptr(false), - Custom: to.Ptr(true), - Pattern: to.Ptr("%networking%"), - }}, - Order: to.Ptr[int32](100), - RecommendedLabelID: to.Ptr("575739d2-3d53-4df0-9042-4c7772d5c7b1"), - }, - }, - Labels: map[string]*armsecurity.SensitivityLabel{ - "1345da73-bc5a-4a8f-b7dd-3820eb713da8": { - DisplayName: to.Ptr("Public"), - Enabled: to.Ptr(true), - Order: to.Ptr[int32](100), - }, - "575739d2-3d53-4df0-9042-4c7772d5c7b1": { - DisplayName: to.Ptr("Confidential"), - Enabled: to.Ptr(true), - Order: to.Ptr[int32](300), - }, - "7aa516c7-5a53-4857-bc6e-6808c6acd542": { - DisplayName: to.Ptr("General"), - Enabled: to.Ptr(true), - Order: to.Ptr[int32](200), - }, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/InformationProtectionPolicies/ListInformationProtectionPolicies_example.json -func ExampleInformationProtectionPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewInformationProtectionPoliciesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("providers/Microsoft.Management/managementGroups/148059f7-faf3-49a6-ba35-85122112291e", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/ingestionsettings_client.go b/sdk/resourcemanager/security/armsecurity/ingestionsettings_client.go index c3e0e2349fec..db05582b4761 100644 --- a/sdk/resourcemanager/security/armsecurity/ingestionsettings_client.go +++ b/sdk/resourcemanager/security/armsecurity/ingestionsettings_client.go @@ -32,9 +32,9 @@ type IngestionSettingsClient struct { } // 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. +// - 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) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewIngestionSettingsClient(subscriptionID string, credential azcore.TokenCr // 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. +// - 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 { @@ -110,10 +111,11 @@ func (client *IngestionSettingsClient) createHandleResponse(resp *http.Response) // 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. +// - 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 { @@ -153,9 +155,10 @@ func (client *IngestionSettingsClient) deleteCreateRequest(ctx context.Context, // 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. +// - 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 { @@ -203,8 +206,10 @@ func (client *IngestionSettingsClient) getHandleResponse(resp *http.Response) (I } // 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.List method. +// - 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 { @@ -262,10 +267,11 @@ func (client *IngestionSettingsClient) listHandleResponse(resp *http.Response) ( // 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. +// - 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 { @@ -314,10 +320,11 @@ func (client *IngestionSettingsClient) listConnectionStringsHandleResponse(resp // 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. +// - 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 { diff --git a/sdk/resourcemanager/security/armsecurity/ingestionsettings_client_example_test.go b/sdk/resourcemanager/security/armsecurity/ingestionsettings_client_example_test.go deleted file mode 100644 index fef619cca476..000000000000 --- a/sdk/resourcemanager/security/armsecurity/ingestionsettings_client_example_test.go +++ /dev/null @@ -1,134 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/GetIngestionSettings_example.json -func ExampleIngestionSettingsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewIngestionSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/GetIngestionSetting_example.json -func ExampleIngestionSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewIngestionSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/CreateIngestionSetting_example.json -func ExampleIngestionSettingsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewIngestionSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, "default", armsecurity.IngestionSetting{}, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/DeleteIngestionSetting_example.json -func ExampleIngestionSettingsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewIngestionSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/ListTokensIngestionSetting_example.json -func ExampleIngestionSettingsClient_ListTokens() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewIngestionSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListTokens(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2021-01-15-preview/examples/IngestionSettings/ListConnectionStrings_example.json -func ExampleIngestionSettingsClient_ListConnectionStrings() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewIngestionSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListConnectionStrings(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/iotsecuritysolution_client.go b/sdk/resourcemanager/security/armsecurity/iotsecuritysolution_client.go index 40bfaaddc4de..a81f6dbd77f0 100644 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolution_client.go +++ b/sdk/resourcemanager/security/armsecurity/iotsecuritysolution_client.go @@ -32,9 +32,9 @@ type IotSecuritySolutionClient struct { } // NewIotSecuritySolutionClient creates a new instance of IotSecuritySolutionClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewIotSecuritySolutionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IotSecuritySolutionClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewIotSecuritySolutionClient(subscriptionID string, credential azcore.Token // CreateOrUpdate - Use this method to create or update yours IoT Security solution // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-08-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// solutionName - The name of the IoT Security solution. -// iotSecuritySolutionData - The security solution data -// options - IotSecuritySolutionClientCreateOrUpdateOptions contains the optional parameters for the IotSecuritySolutionClient.CreateOrUpdate -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - solutionName - The name of the IoT Security solution. +// - iotSecuritySolutionData - The security solution data +// - 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) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, solutionName, iotSecuritySolutionData, options) if err != nil { @@ -115,11 +116,12 @@ func (client *IotSecuritySolutionClient) createOrUpdateHandleResponse(resp *http // Delete - Use this method to delete yours IoT Security solution // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-08-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// solutionName - The name of the IoT Security solution. -// options - IotSecuritySolutionClientDeleteOptions contains the optional parameters for the IotSecuritySolutionClient.Delete -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - solutionName - The name of the IoT Security solution. +// - 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) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, solutionName, options) if err != nil { @@ -163,10 +165,11 @@ func (client *IotSecuritySolutionClient) deleteCreateRequest(ctx context.Context // Get - User this method to get details of a specific IoT Security solution based on solution name // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-08-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// solutionName - The name of the IoT Security solution. -// options - IotSecuritySolutionClientGetOptions contains the optional parameters for the IotSecuritySolutionClient.Get method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - 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) { req, err := client.getCreateRequest(ctx, resourceGroupName, solutionName, options) if err != nil { @@ -218,10 +221,11 @@ func (client *IotSecuritySolutionClient) getHandleResponse(resp *http.Response) } // NewListByResourceGroupPager - Use this method to get the list IoT Security solutions organized by resource group. +// // Generated from API version 2019-08-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// options - IotSecuritySolutionClientListByResourceGroupOptions contains the optional parameters for the IotSecuritySolutionClient.ListByResourceGroup -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - options - IotSecuritySolutionClientListByResourceGroupOptions contains the optional parameters for the IotSecuritySolutionClient.NewListByResourceGroupPager +// method. func (client *IotSecuritySolutionClient) NewListByResourceGroupPager(resourceGroupName string, options *IotSecuritySolutionClientListByResourceGroupOptions) *runtime.Pager[IotSecuritySolutionClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[IotSecuritySolutionClientListByResourceGroupResponse]{ More: func(page IotSecuritySolutionClientListByResourceGroupResponse) bool { @@ -285,9 +289,10 @@ func (client *IotSecuritySolutionClient) listByResourceGroupHandleResponse(resp } // NewListBySubscriptionPager - Use this method to get the list of IoT Security solutions by subscription. +// // Generated from API version 2019-08-01 -// options - IotSecuritySolutionClientListBySubscriptionOptions contains the optional parameters for the IotSecuritySolutionClient.ListBySubscription -// method. +// - options - IotSecuritySolutionClientListBySubscriptionOptions contains the optional parameters for the IotSecuritySolutionClient.NewListBySubscriptionPager +// method. func (client *IotSecuritySolutionClient) NewListBySubscriptionPager(options *IotSecuritySolutionClientListBySubscriptionOptions) *runtime.Pager[IotSecuritySolutionClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[IotSecuritySolutionClientListBySubscriptionResponse]{ More: func(page IotSecuritySolutionClientListBySubscriptionResponse) bool { @@ -349,12 +354,13 @@ func (client *IotSecuritySolutionClient) listBySubscriptionHandleResponse(resp * // Update - Use this method to update existing IoT Security solution tags or user defined resources. To update other fields // use the CreateOrUpdate method. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-08-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// solutionName - The name of the IoT Security solution. -// updateIotSecuritySolutionData - The security solution data -// options - IotSecuritySolutionClientUpdateOptions contains the optional parameters for the IotSecuritySolutionClient.Update -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - solutionName - The name of the IoT Security solution. +// - updateIotSecuritySolutionData - The security solution data +// - 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) { req, err := client.updateCreateRequest(ctx, resourceGroupName, solutionName, updateIotSecuritySolutionData, options) if err != nil { diff --git a/sdk/resourcemanager/security/armsecurity/iotsecuritysolution_client_example_test.go b/sdk/resourcemanager/security/armsecurity/iotsecuritysolution_client_example_test.go deleted file mode 100644 index 92836e277000..000000000000 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolution_client_example_test.go +++ /dev/null @@ -1,235 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsListByIotHub.json -func ExampleIotSecuritySolutionClient_NewListBySubscriptionPager_listIoTSecuritySolutionsByIoTHub() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewIotSecuritySolutionClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(&armsecurity.IotSecuritySolutionClientListBySubscriptionOptions{Filter: to.Ptr("properties.iotHubs/any(i eq \"/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub\")")}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsList.json -func ExampleIotSecuritySolutionClient_NewListBySubscriptionPager_listIoTSecuritySolutionsBySubscription() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewIotSecuritySolutionClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(&armsecurity.IotSecuritySolutionClientListBySubscriptionOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsListByRg.json -func ExampleIotSecuritySolutionClient_NewListByResourceGroupPager_listIoTSecuritySolutionsByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewIotSecuritySolutionClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("MyGroup", &armsecurity.IotSecuritySolutionClientListByResourceGroupOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolutionsListByIotHubAndRg.json -func ExampleIotSecuritySolutionClient_NewListByResourceGroupPager_listIoTSecuritySolutionsByResourceGroupAndIoTHub() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewIotSecuritySolutionClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("MyRg", &armsecurity.IotSecuritySolutionClientListByResourceGroupOptions{Filter: to.Ptr("properties.iotHubs/any(i eq \"/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub\")")}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/GetIoTSecuritySolution.json -func ExampleIotSecuritySolutionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewIotSecuritySolutionClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "MyGroup", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/CreateIoTSecuritySolution.json -func ExampleIotSecuritySolutionClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewIotSecuritySolutionClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "MyGroup", "default", armsecurity.IoTSecuritySolutionModel{ - Tags: map[string]*string{}, - Location: to.Ptr("East Us"), - Properties: &armsecurity.IoTSecuritySolutionProperties{ - DisabledDataSources: []*armsecurity.DataSource{}, - DisplayName: to.Ptr("Solution Default"), - Export: []*armsecurity.ExportData{}, - IotHubs: []*string{ - to.Ptr("/subscriptions/075423e9-7d33-4166-8bdf-3920b04e3735/resourceGroups/myRg/providers/Microsoft.Devices/IotHubs/FirstIotHub")}, - RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - { - RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - }, - { - RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - }}, - Status: to.Ptr(armsecurity.SecuritySolutionStatusEnabled), - UnmaskedIPLoggingStatus: to.Ptr(armsecurity.UnmaskedIPLoggingStatusEnabled), - UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"iot\""), - QuerySubscriptions: []*string{ - to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - }, - Workspace: to.Ptr("/subscriptions/c4930e90-cd72-4aa5-93e9-2d081d129569/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace1"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/UpdateIoTSecuritySolution.json -func ExampleIotSecuritySolutionClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewIotSecuritySolutionClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "myRg", "default", armsecurity.UpdateIotSecuritySolutionData{ - Tags: map[string]*string{ - "foo": to.Ptr("bar"), - }, - Properties: &armsecurity.UpdateIoTSecuritySolutionProperties{ - RecommendationsConfiguration: []*armsecurity.RecommendationConfigurationProperties{ - { - RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTOpenPorts), - Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - }, - { - RecommendationType: to.Ptr(armsecurity.RecommendationTypeIoTSharedCredentials), - Status: to.Ptr(armsecurity.RecommendationConfigStatusDisabled), - }}, - UserDefinedResources: &armsecurity.UserDefinedResourcesProperties{ - Query: to.Ptr("where type != \"microsoft.devices/iothubs\" | where name contains \"v2\""), - QuerySubscriptions: []*string{ - to.Ptr("075423e9-7d33-4166-8bdf-3920b04e3735")}, - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutions/DeleteIoTSecuritySolution.json -func ExampleIotSecuritySolutionClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewIotSecuritySolutionClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "MyGroup", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionanalytics_client.go b/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionanalytics_client.go index 22dd8c0fe893..f41be8b09037 100644 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionanalytics_client.go +++ b/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionanalytics_client.go @@ -32,9 +32,9 @@ type IotSecuritySolutionAnalyticsClient struct { } // NewIotSecuritySolutionAnalyticsClient creates a new instance of IotSecuritySolutionAnalyticsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewIotSecuritySolutionAnalyticsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IotSecuritySolutionAnalyticsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewIotSecuritySolutionAnalyticsClient(subscriptionID string, credential azc // Get - Use this method to get IoT Security Analytics metrics. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-08-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// solutionName - The name of the IoT Security solution. -// options - IotSecuritySolutionAnalyticsClientGetOptions contains the optional parameters for the IotSecuritySolutionAnalyticsClient.Get -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - solutionName - The name of the IoT Security solution. +// - 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) { req, err := client.getCreateRequest(ctx, resourceGroupName, solutionName, options) if err != nil { @@ -114,11 +115,12 @@ func (client *IotSecuritySolutionAnalyticsClient) getHandleResponse(resp *http.R // List - Use this method to get IoT security Analytics metrics in an array. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-08-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// solutionName - The name of the IoT Security solution. -// options - IotSecuritySolutionAnalyticsClientListOptions contains the optional parameters for the IotSecuritySolutionAnalyticsClient.List -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - solutionName - The name of the IoT Security solution. +// - 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) { req, err := client.listCreateRequest(ctx, resourceGroupName, solutionName, options) if err != nil { diff --git a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionanalytics_client_example_test.go b/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionanalytics_client_example_test.go deleted file mode 100644 index 9fc80ba63653..000000000000 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionanalytics_client_example_test.go +++ /dev/null @@ -1,55 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAnalyticsList.json -func ExampleIotSecuritySolutionAnalyticsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewIotSecuritySolutionAnalyticsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, "MyGroup", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAnalytics.json -func ExampleIotSecuritySolutionAnalyticsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewIotSecuritySolutionAnalyticsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "MyGroup", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsaggregatedalert_client.go b/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsaggregatedalert_client.go index 3816afa853b3..271d55cdd141 100644 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsaggregatedalert_client.go +++ b/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsaggregatedalert_client.go @@ -33,9 +33,9 @@ type IotSecuritySolutionsAnalyticsAggregatedAlertClient struct { } // NewIotSecuritySolutionsAnalyticsAggregatedAlertClient creates a new instance of IotSecuritySolutionsAnalyticsAggregatedAlertClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewIotSecuritySolutionsAnalyticsAggregatedAlertClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IotSecuritySolutionsAnalyticsAggregatedAlertClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewIotSecuritySolutionsAnalyticsAggregatedAlertClient(subscriptionID string // Dismiss - Use this method to dismiss an aggregated IoT Security Solution Alert. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-08-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// solutionName - The name of the IoT Security solution. -// aggregatedAlertName - Identifier of the aggregated alert. -// options - IotSecuritySolutionsAnalyticsAggregatedAlertClientDismissOptions contains the optional parameters for the IotSecuritySolutionsAnalyticsAggregatedAlertClient.Dismiss -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - solutionName - The name of the IoT Security solution. +// - aggregatedAlertName - Identifier of the aggregated alert. +// - 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) { req, err := client.dismissCreateRequest(ctx, resourceGroupName, solutionName, aggregatedAlertName, options) if err != nil { @@ -112,12 +113,13 @@ func (client *IotSecuritySolutionsAnalyticsAggregatedAlertClient) dismissCreateR // Get - Use this method to get a single the aggregated alert of yours IoT Security solution. This aggregation is performed // by alert name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-08-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// solutionName - The name of the IoT Security solution. -// aggregatedAlertName - Identifier of the aggregated alert. -// options - IotSecuritySolutionsAnalyticsAggregatedAlertClientGetOptions contains the optional parameters for the IotSecuritySolutionsAnalyticsAggregatedAlertClient.Get -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - solutionName - The name of the IoT Security solution. +// - aggregatedAlertName - Identifier of the aggregated alert. +// - 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) { req, err := client.getCreateRequest(ctx, resourceGroupName, solutionName, aggregatedAlertName, options) if err != nil { @@ -173,11 +175,12 @@ func (client *IotSecuritySolutionsAnalyticsAggregatedAlertClient) getHandleRespo } // NewListPager - Use this method to get the aggregated alert list of yours IoT Security solution. +// // Generated from API version 2019-08-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// solutionName - The name of the IoT Security solution. -// options - IotSecuritySolutionsAnalyticsAggregatedAlertClientListOptions contains the optional parameters for the IotSecuritySolutionsAnalyticsAggregatedAlertClient.List -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - solutionName - The name of the IoT Security solution. +// - options - IotSecuritySolutionsAnalyticsAggregatedAlertClientListOptions contains the optional parameters for the IotSecuritySolutionsAnalyticsAggregatedAlertClient.NewListPager +// method. func (client *IotSecuritySolutionsAnalyticsAggregatedAlertClient) NewListPager(resourceGroupName string, solutionName string, options *IotSecuritySolutionsAnalyticsAggregatedAlertClientListOptions) *runtime.Pager[IotSecuritySolutionsAnalyticsAggregatedAlertClientListResponse] { return runtime.NewPager(runtime.PagingHandler[IotSecuritySolutionsAnalyticsAggregatedAlertClientListResponse]{ More: func(page IotSecuritySolutionsAnalyticsAggregatedAlertClientListResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsaggregatedalert_client_example_test.go b/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsaggregatedalert_client_example_test.go deleted file mode 100644 index 1e56d218641b..000000000000 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsaggregatedalert_client_example_test.go +++ /dev/null @@ -1,77 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAggregatedAlertList.json -func ExampleIotSecuritySolutionsAnalyticsAggregatedAlertClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewIotSecuritySolutionsAnalyticsAggregatedAlertClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("MyGroup", "default", &armsecurity.IotSecuritySolutionsAnalyticsAggregatedAlertClientListOptions{Top: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityAggregatedAlert.json -func ExampleIotSecuritySolutionsAnalyticsAggregatedAlertClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewIotSecuritySolutionsAnalyticsAggregatedAlertClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "MyGroup", "default", "IoT_Bruteforce_Fail/2019-02-02", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/PostIoTSecuritySolutionsSecurityAggregatedAlertDismiss.json -func ExampleIotSecuritySolutionsAnalyticsAggregatedAlertClient_Dismiss() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewIotSecuritySolutionsAnalyticsAggregatedAlertClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Dismiss(ctx, "IoTEdgeResources", "default", "IoT_Bruteforce_Fail/2019-02-02/dismiss", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsrecommendation_client.go b/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsrecommendation_client.go index 5be04969ed8e..9b09498385aa 100644 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsrecommendation_client.go +++ b/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsrecommendation_client.go @@ -33,9 +33,9 @@ type IotSecuritySolutionsAnalyticsRecommendationClient struct { } // NewIotSecuritySolutionsAnalyticsRecommendationClient creates a new instance of IotSecuritySolutionsAnalyticsRecommendationClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewIotSecuritySolutionsAnalyticsRecommendationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IotSecuritySolutionsAnalyticsRecommendationClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -59,12 +59,13 @@ func NewIotSecuritySolutionsAnalyticsRecommendationClient(subscriptionID string, // Get - Use this method to get the aggregated security analytics recommendation of yours IoT Security solution. This aggregation // is performed by recommendation name. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-08-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// solutionName - The name of the IoT Security solution. -// aggregatedRecommendationName - Name of the recommendation aggregated for this query. -// options - IotSecuritySolutionsAnalyticsRecommendationClientGetOptions contains the optional parameters for the IotSecuritySolutionsAnalyticsRecommendationClient.Get -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - solutionName - The name of the IoT Security solution. +// - aggregatedRecommendationName - Name of the recommendation aggregated for this query. +// - 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) { req, err := client.getCreateRequest(ctx, resourceGroupName, solutionName, aggregatedRecommendationName, options) if err != nil { @@ -120,11 +121,12 @@ func (client *IotSecuritySolutionsAnalyticsRecommendationClient) getHandleRespon } // NewListPager - Use this method to get the list of aggregated security analytics recommendations of yours IoT Security solution. +// // Generated from API version 2019-08-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// solutionName - The name of the IoT Security solution. -// options - IotSecuritySolutionsAnalyticsRecommendationClientListOptions contains the optional parameters for the IotSecuritySolutionsAnalyticsRecommendationClient.List -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - solutionName - The name of the IoT Security solution. +// - options - IotSecuritySolutionsAnalyticsRecommendationClientListOptions contains the optional parameters for the IotSecuritySolutionsAnalyticsRecommendationClient.NewListPager +// method. func (client *IotSecuritySolutionsAnalyticsRecommendationClient) NewListPager(resourceGroupName string, solutionName string, options *IotSecuritySolutionsAnalyticsRecommendationClientListOptions) *runtime.Pager[IotSecuritySolutionsAnalyticsRecommendationClientListResponse] { return runtime.NewPager(runtime.PagingHandler[IotSecuritySolutionsAnalyticsRecommendationClientListResponse]{ More: func(page IotSecuritySolutionsAnalyticsRecommendationClientListResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsrecommendation_client_example_test.go b/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsrecommendation_client_example_test.go deleted file mode 100644 index 92f697e736ff..000000000000 --- a/sdk/resourcemanager/security/armsecurity/iotsecuritysolutionsanalyticsrecommendation_client_example_test.go +++ /dev/null @@ -1,60 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityRecommendation.json -func ExampleIotSecuritySolutionsAnalyticsRecommendationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewIotSecuritySolutionsAnalyticsRecommendationClient("075423e9-7d33-4166-8bdf-3920b04e3735", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "IoTEdgeResources", "default", "OpenPortsOnDevice", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2019-08-01/examples/IoTSecuritySolutionsAnalytics/GetIoTSecuritySolutionsSecurityRecommendationList.json -func ExampleIotSecuritySolutionsAnalyticsRecommendationClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewIotSecuritySolutionsAnalyticsRecommendationClient("075423e9-7d33-4166-8bdf-3920b04e3735", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("IoTEdgeResources", "default", &armsecurity.IotSecuritySolutionsAnalyticsRecommendationClientListOptions{Top: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/jitnetworkaccesspolicies_client.go b/sdk/resourcemanager/security/armsecurity/jitnetworkaccesspolicies_client.go index a123d3a7f6bc..66a1dfba94bf 100644 --- a/sdk/resourcemanager/security/armsecurity/jitnetworkaccesspolicies_client.go +++ b/sdk/resourcemanager/security/armsecurity/jitnetworkaccesspolicies_client.go @@ -32,9 +32,9 @@ type JitNetworkAccessPoliciesClient struct { } // NewJitNetworkAccessPoliciesClient creates a new instance of JitNetworkAccessPoliciesClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewJitNetworkAccessPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JitNetworkAccessPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewJitNetworkAccessPoliciesClient(subscriptionID string, credential azcore. // CreateOrUpdate - Create a policy for protecting resources using Just-in-Time access control // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// jitNetworkAccessPolicyName - Name of a Just-in-Time access configuration policy. -// options - JitNetworkAccessPoliciesClientCreateOrUpdateOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.CreateOrUpdate -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - jitNetworkAccessPolicyName - Name of a Just-in-Time access configuration policy. +// - 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) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body, options) if err != nil { @@ -119,12 +120,13 @@ func (client *JitNetworkAccessPoliciesClient) createOrUpdateHandleResponse(resp // Delete - Delete a Just-in-Time access control policy. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// jitNetworkAccessPolicyName - Name of a Just-in-Time access configuration policy. -// options - JitNetworkAccessPoliciesClientDeleteOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.Delete -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - jitNetworkAccessPolicyName - Name of a Just-in-Time access configuration policy. +// - 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) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, ascLocation, jitNetworkAccessPolicyName, options) if err != nil { @@ -172,12 +174,13 @@ func (client *JitNetworkAccessPoliciesClient) deleteCreateRequest(ctx context.Co // Get - Policies for protecting resources using Just-in-Time access control for the subscription, location // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// jitNetworkAccessPolicyName - Name of a Just-in-Time access configuration policy. -// options - JitNetworkAccessPoliciesClientGetOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.Get -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - jitNetworkAccessPolicyName - Name of a Just-in-Time access configuration policy. +// - 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) { req, err := client.getCreateRequest(ctx, resourceGroupName, ascLocation, jitNetworkAccessPolicyName, options) if err != nil { @@ -234,12 +237,13 @@ func (client *JitNetworkAccessPoliciesClient) getHandleResponse(resp *http.Respo // Initiate - Initiate a JIT access from a specific Just-in-Time policy configuration. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// jitNetworkAccessPolicyName - Name of a Just-in-Time access configuration policy. -// options - JitNetworkAccessPoliciesClientInitiateOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.Initiate -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - jitNetworkAccessPolicyName - Name of a Just-in-Time access configuration policy. +// - 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) { req, err := client.initiateCreateRequest(ctx, resourceGroupName, ascLocation, jitNetworkAccessPolicyName, body, options) if err != nil { @@ -296,9 +300,10 @@ func (client *JitNetworkAccessPoliciesClient) initiateHandleResponse(resp *http. } // NewListPager - Policies for protecting resources using Just-in-Time access control. +// // Generated from API version 2020-01-01 -// options - JitNetworkAccessPoliciesClientListOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.List -// method. +// - options - JitNetworkAccessPoliciesClientListOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.NewListPager +// method. func (client *JitNetworkAccessPoliciesClient) NewListPager(options *JitNetworkAccessPoliciesClientListOptions) *runtime.Pager[JitNetworkAccessPoliciesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[JitNetworkAccessPoliciesClientListResponse]{ More: func(page JitNetworkAccessPoliciesClientListResponse) bool { @@ -355,10 +360,11 @@ func (client *JitNetworkAccessPoliciesClient) listHandleResponse(resp *http.Resp } // NewListByRegionPager - Policies for protecting resources using Just-in-Time access control for the subscription, location +// // Generated from API version 2020-01-01 -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// options - JitNetworkAccessPoliciesClientListByRegionOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.ListByRegion -// method. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - options - JitNetworkAccessPoliciesClientListByRegionOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.NewListByRegionPager +// method. func (client *JitNetworkAccessPoliciesClient) NewListByRegionPager(ascLocation string, options *JitNetworkAccessPoliciesClientListByRegionOptions) *runtime.Pager[JitNetworkAccessPoliciesClientListByRegionResponse] { return runtime.NewPager(runtime.PagingHandler[JitNetworkAccessPoliciesClientListByRegionResponse]{ More: func(page JitNetworkAccessPoliciesClientListByRegionResponse) bool { @@ -420,10 +426,11 @@ func (client *JitNetworkAccessPoliciesClient) listByRegionHandleResponse(resp *h // NewListByResourceGroupPager - Policies for protecting resources using Just-in-Time access control for the subscription, // location +// // Generated from API version 2020-01-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// options - JitNetworkAccessPoliciesClientListByResourceGroupOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.ListByResourceGroup -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - options - JitNetworkAccessPoliciesClientListByResourceGroupOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.NewListByResourceGroupPager +// method. func (client *JitNetworkAccessPoliciesClient) NewListByResourceGroupPager(resourceGroupName string, options *JitNetworkAccessPoliciesClientListByResourceGroupOptions) *runtime.Pager[JitNetworkAccessPoliciesClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[JitNetworkAccessPoliciesClientListByResourceGroupResponse]{ More: func(page JitNetworkAccessPoliciesClientListByResourceGroupResponse) bool { @@ -485,11 +492,12 @@ func (client *JitNetworkAccessPoliciesClient) listByResourceGroupHandleResponse( // NewListByResourceGroupAndRegionPager - Policies for protecting resources using Just-in-Time access control for the subscription, // location +// // Generated from API version 2020-01-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// options - JitNetworkAccessPoliciesClientListByResourceGroupAndRegionOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.ListByResourceGroupAndRegion -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - options - JitNetworkAccessPoliciesClientListByResourceGroupAndRegionOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.NewListByResourceGroupAndRegionPager +// method. func (client *JitNetworkAccessPoliciesClient) NewListByResourceGroupAndRegionPager(resourceGroupName string, ascLocation string, options *JitNetworkAccessPoliciesClientListByResourceGroupAndRegionOptions) *runtime.Pager[JitNetworkAccessPoliciesClientListByResourceGroupAndRegionResponse] { return runtime.NewPager(runtime.PagingHandler[JitNetworkAccessPoliciesClientListByResourceGroupAndRegionResponse]{ More: func(page JitNetworkAccessPoliciesClientListByResourceGroupAndRegionResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/jitnetworkaccesspolicies_client_example_test.go b/sdk/resourcemanager/security/armsecurity/jitnetworkaccesspolicies_client_example_test.go deleted file mode 100644 index 29949c27585c..000000000000 --- a/sdk/resourcemanager/security/armsecurity/jitnetworkaccesspolicies_client_example_test.go +++ /dev/null @@ -1,242 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesSubscription_example.json -func ExampleJitNetworkAccessPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewJitNetworkAccessPoliciesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesSubscriptionLocation_example.json -func ExampleJitNetworkAccessPoliciesClient_NewListByRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewJitNetworkAccessPoliciesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByRegionPager("westeurope", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesResourceGroup_example.json -func ExampleJitNetworkAccessPoliciesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewJitNetworkAccessPoliciesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("myRg1", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPoliciesResourceGroupLocation_example.json -func ExampleJitNetworkAccessPoliciesClient_NewListByResourceGroupAndRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewJitNetworkAccessPoliciesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupAndRegionPager("myRg1", "westeurope", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/GetJitNetworkAccessPolicy_example.json -func ExampleJitNetworkAccessPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewJitNetworkAccessPoliciesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myRg1", "westeurope", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/CreateJitNetworkAccessPolicy_example.json -func ExampleJitNetworkAccessPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewJitNetworkAccessPoliciesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "myRg1", "westeurope", "default", armsecurity.JitNetworkAccessPolicy{ - Kind: to.Ptr("Basic"), - Location: to.Ptr("westeurope"), - Name: to.Ptr("default"), - Type: to.Ptr("Microsoft.Security/locations/jitNetworkAccessPolicies"), - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Security/locations/westeurope/jitNetworkAccessPolicies/default"), - Properties: &armsecurity.JitNetworkAccessPolicyProperties{ - ProvisioningState: to.Ptr("Succeeded"), - Requests: []*armsecurity.JitNetworkAccessRequest{ - { - Requestor: to.Ptr("barbara@contoso.com"), - StartTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T08:06:45.5691611Z"); return t }()), - VirtualMachines: []*armsecurity.JitNetworkAccessRequestVirtualMachine{ - { - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - Ports: []*armsecurity.JitNetworkAccessRequestPort{ - { - AllowedSourceAddressPrefix: to.Ptr("192.127.0.2"), - EndTimeUTC: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-05-17T09:06:45.5691611Z"); return t }()), - Number: to.Ptr[int32](3389), - Status: to.Ptr(armsecurity.StatusInitiated), - StatusReason: to.Ptr(armsecurity.StatusReasonUserRequested), - }}, - }}, - }}, - VirtualMachines: []*armsecurity.JitNetworkAccessPolicyVirtualMachine{ - { - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - Ports: []*armsecurity.JitNetworkAccessPortRule{ - { - AllowedSourceAddressPrefix: to.Ptr("*"), - MaxRequestAccessDuration: to.Ptr("PT3H"), - Number: to.Ptr[int32](22), - Protocol: to.Ptr(armsecurity.ProtocolAll), - }, - { - AllowedSourceAddressPrefix: to.Ptr("*"), - MaxRequestAccessDuration: to.Ptr("PT3H"), - Number: to.Ptr[int32](3389), - Protocol: to.Ptr(armsecurity.ProtocolAll), - }}, - }}, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/DeleteJitNetworkAccessPolicy_example.json -func ExampleJitNetworkAccessPoliciesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewJitNetworkAccessPoliciesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "myRg1", "westeurope", "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/JitNetworkAccessPolicies/InitiateJitNetworkAccessPolicy_example.json -func ExampleJitNetworkAccessPoliciesClient_Initiate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewJitNetworkAccessPoliciesClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Initiate(ctx, "myRg1", "westeurope", "default", armsecurity.JitNetworkAccessPolicyInitiateRequest{ - Justification: to.Ptr("testing a new version of the product"), - VirtualMachines: []*armsecurity.JitNetworkAccessPolicyInitiateVirtualMachine{ - { - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg1/providers/Microsoft.Compute/virtualMachines/vm1"), - Ports: []*armsecurity.JitNetworkAccessPolicyInitiatePort{ - { - AllowedSourceAddressPrefix: to.Ptr("192.127.0.2"), - Number: to.Ptr[int32](3389), - }}, - }}, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/locations_client.go b/sdk/resourcemanager/security/armsecurity/locations_client.go index 0dadb6cab586..e4fdd77203ad 100644 --- a/sdk/resourcemanager/security/armsecurity/locations_client.go +++ b/sdk/resourcemanager/security/armsecurity/locations_client.go @@ -32,9 +32,9 @@ type LocationsClient struct { } // NewLocationsClient creates a new instance of LocationsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewLocationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LocationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,9 +57,10 @@ func NewLocationsClient(subscriptionID string, credential azcore.TokenCredential // Get - Details of a specific location // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2015-06-01-preview -// 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. +// - 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) { req, err := client.getCreateRequest(ctx, ascLocation, options) if err != nil { @@ -109,8 +110,9 @@ func (client *LocationsClient) getHandleResponse(resp *http.Response) (Locations // NewListPager - The location of the responsible ASC of the specific subscription (home region). For each subscription there // is only one responsible location. The location in the response should be used to read or // write other resources in ASC according to their ID. +// // Generated from API version 2015-06-01-preview -// options - LocationsClientListOptions contains the optional parameters for the LocationsClient.List method. +// - options - LocationsClientListOptions contains the optional parameters for the LocationsClient.NewListPager method. func (client *LocationsClient) NewListPager(options *LocationsClientListOptions) *runtime.Pager[LocationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[LocationsClientListResponse]{ More: func(page LocationsClientListResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/locations_client_example_test.go b/sdk/resourcemanager/security/armsecurity/locations_client_example_test.go deleted file mode 100644 index b5f32795ffc7..000000000000 --- a/sdk/resourcemanager/security/armsecurity/locations_client_example_test.go +++ /dev/null @@ -1,60 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Locations/GetLocations_example.json -func ExampleLocationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewLocationsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Locations/GetLocation_example.json -func ExampleLocationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewLocationsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "centralus", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/mdeonboardings_client.go b/sdk/resourcemanager/security/armsecurity/mdeonboardings_client.go index 97c056136dd7..5f3ab7828719 100644 --- a/sdk/resourcemanager/security/armsecurity/mdeonboardings_client.go +++ b/sdk/resourcemanager/security/armsecurity/mdeonboardings_client.go @@ -32,9 +32,9 @@ type MdeOnboardingsClient struct { } // NewMdeOnboardingsClient creates a new instance of MdeOnboardingsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewMdeOnboardingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MdeOnboardingsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,8 +57,9 @@ func NewMdeOnboardingsClient(subscriptionID string, credential azcore.TokenCrede // Get - The default configuration or data needed to onboard the machine to MDE // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-10-01-preview -// options - MdeOnboardingsClientGetOptions contains the optional parameters for the MdeOnboardingsClient.Get method. +// - options - MdeOnboardingsClientGetOptions contains the optional parameters for the MdeOnboardingsClient.Get method. func (client *MdeOnboardingsClient) Get(ctx context.Context, options *MdeOnboardingsClientGetOptions) (MdeOnboardingsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, options) if err != nil { @@ -103,8 +104,9 @@ func (client *MdeOnboardingsClient) getHandleResponse(resp *http.Response) (MdeO // List - The configuration or data needed to onboard the machine to MDE // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-10-01-preview -// options - MdeOnboardingsClientListOptions contains the optional parameters for the MdeOnboardingsClient.List method. +// - options - MdeOnboardingsClientListOptions contains the optional parameters for the MdeOnboardingsClient.List method. func (client *MdeOnboardingsClient) List(ctx context.Context, options *MdeOnboardingsClientListOptions) (MdeOnboardingsClientListResponse, error) { req, err := client.listCreateRequest(ctx, options) if err != nil { diff --git a/sdk/resourcemanager/security/armsecurity/mdeonboardings_client_example_test.go b/sdk/resourcemanager/security/armsecurity/mdeonboardings_client_example_test.go deleted file mode 100644 index 027cd0fdb7ae..000000000000 --- a/sdk/resourcemanager/security/armsecurity/mdeonboardings_client_example_test.go +++ /dev/null @@ -1,55 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2021-10-01-preview/examples/MdeOnboardings/ListMdeOnboardings_example.json -func ExampleMdeOnboardingsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewMdeOnboardingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2021-10-01-preview/examples/MdeOnboardings/GetMdeOnboardings_example.json -func ExampleMdeOnboardingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewMdeOnboardingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/models.go b/sdk/resourcemanager/security/armsecurity/models.go index a1f8693ad4e3..ebcc89ab847a 100644 --- a/sdk/resourcemanager/security/armsecurity/models.go +++ b/sdk/resourcemanager/security/armsecurity/models.go @@ -41,7 +41,7 @@ type AADExternalSecuritySolution struct { // AADSolutionProperties - The external security solution properties for AAD solutions type AADSolutionProperties struct { // OPTIONAL; Contains additional key/value pairs not defined in the schema. - AdditionalProperties map[string]interface{} + AdditionalProperties map[string]any // The connectivity state of the external AAD solution ConnectivityState *AADConnectivityState `json:"connectivityState,omitempty"` @@ -52,6 +52,61 @@ type AADSolutionProperties struct { Workspace *ConnectedWorkspace `json:"workspace,omitempty"` } +// APICollectionClientGetOptions contains the optional parameters for the APICollectionClient.Get method. +type APICollectionClientGetOptions struct { + // placeholder for future optional parameters +} + +// APICollectionClientListOptions contains the optional parameters for the APICollectionClient.NewListPager method. +type APICollectionClientListOptions struct { + // placeholder for future optional parameters +} + +// APICollectionOffboardingClientDeleteOptions contains the optional parameters for the APICollectionOffboardingClient.Delete +// method. +type APICollectionOffboardingClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// APICollectionOnboardingClientCreateOptions contains the optional parameters for the APICollectionOnboardingClient.Create +// method. +type APICollectionOnboardingClientCreateOptions struct { + // placeholder for future optional parameters +} + +// APICollectionProperties - Describes the properties of an API collection. +type APICollectionProperties struct { + // Additional data regarding the API collection. + AdditionalData map[string]*string `json:"additionalData,omitempty"` + + // The display name of the Azure API Management API. + DisplayName *string `json:"displayName,omitempty"` +} + +// APICollectionResponse - An API collection as represented by Defender for APIs. +type APICollectionResponse struct { + // Describes the properties of an API collection. + Properties *APICollectionProperties `json:"properties,omitempty"` + + // READ-ONLY; Resource Id + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Resource type + Type *string `json:"type,omitempty" azure:"ro"` +} + +// APICollectionResponseList - Page of a list of API collections as represented by Defender for APIs. +type APICollectionResponseList struct { + // READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; API collections in this page. + Value []*APICollectionResponse `json:"value,omitempty" azure:"ro"` +} + // AccountConnectorsClientCreateOrUpdateOptions contains the optional parameters for the AccountConnectorsClient.CreateOrUpdate // method. type AccountConnectorsClientCreateOrUpdateOptions struct { @@ -68,7 +123,7 @@ type AccountConnectorsClientGetOptions struct { // placeholder for future optional parameters } -// AccountConnectorsClientListOptions contains the optional parameters for the AccountConnectorsClient.List method. +// AccountConnectorsClientListOptions contains the optional parameters for the AccountConnectorsClient.NewListPager method. type AccountConnectorsClientListOptions struct { // placeholder for future optional parameters } @@ -264,7 +319,7 @@ type AdaptiveNetworkHardeningsClientGetOptions struct { // placeholder for future optional parameters } -// AdaptiveNetworkHardeningsClientListByExtendedResourceOptions contains the optional parameters for the AdaptiveNetworkHardeningsClient.ListByExtendedResource +// AdaptiveNetworkHardeningsClientListByExtendedResourceOptions contains the optional parameters for the AdaptiveNetworkHardeningsClient.NewListByExtendedResourcePager // method. type AdaptiveNetworkHardeningsClientListByExtendedResourceOptions struct { // placeholder for future optional parameters @@ -359,7 +414,7 @@ type Alert struct { // AlertEntity - Changing set of properties depending on the entity type. type AlertEntity struct { // OPTIONAL; Contains additional key/value pairs not defined in the schema. - AdditionalProperties map[string]interface{} + AdditionalProperties map[string]any // READ-ONLY; Type of entity Type *string `json:"type,omitempty" azure:"ro"` @@ -423,8 +478,9 @@ type AlertProperties struct { // READ-ONLY; The name of Azure Security Center pricing tier which powering this alert. Learn more: https://docs.microsoft.com/en-us/azure/security-center/security-center-pricing ProductComponentName *string `json:"productComponentName,omitempty" azure:"ro"` - // READ-ONLY; The name of the product which published this alert (Azure Security Center, Azure ATP, Microsoft Defender ATP, - // O365 ATP, MCAS, and so on). + // READ-ONLY; The name of the product which published this alert (Microsoft Sentinel, Microsoft Defender for Identity, Microsoft + // Defender for Endpoint, Microsoft Defender for Office, Microsoft Defender for Cloud + // Apps, and so on). ProductName *string `json:"productName,omitempty" azure:"ro"` // READ-ONLY; Manual action items to take to remediate the alert. @@ -465,7 +521,7 @@ type AlertProperties struct { // AlertPropertiesSupportingEvidence - Changing set of properties depending on the supportingEvidence type. type AlertPropertiesSupportingEvidence struct { // OPTIONAL; Contains additional key/value pairs not defined in the schema. - AdditionalProperties map[string]interface{} + AdditionalProperties map[string]any // READ-ONLY; Type of the supportingEvidence Type *string `json:"type,omitempty" azure:"ro"` @@ -477,7 +533,7 @@ type AlertSimulatorBundlesRequestProperties struct { Kind *Kind `json:"kind,omitempty"` // OPTIONAL; Contains additional key/value pairs not defined in the schema. - AdditionalProperties map[string]interface{} + AdditionalProperties map[string]any // Bundles list. Bundles []*BundleType `json:"bundles,omitempty"` @@ -512,7 +568,7 @@ type AlertSimulatorRequestProperties struct { Kind *Kind `json:"kind,omitempty"` // OPTIONAL; Contains additional key/value pairs not defined in the schema. - AdditionalProperties map[string]interface{} + AdditionalProperties map[string]any } // GetAlertSimulatorRequestProperties implements the AlertSimulatorRequestPropertiesClassification interface for type AlertSimulatorRequestProperties. @@ -570,23 +626,24 @@ type AlertsClientGetSubscriptionLevelOptions struct { // placeholder for future optional parameters } -// AlertsClientListByResourceGroupOptions contains the optional parameters for the AlertsClient.ListByResourceGroup method. +// 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.List method. +// 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.ListResourceGroupLevelByRegion +// 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.ListSubscriptionLevelByRegion +// AlertsClientListSubscriptionLevelByRegionOptions contains the optional parameters for the AlertsClient.NewListSubscriptionLevelByRegionPager // method. type AlertsClientListSubscriptionLevelByRegionOptions struct { // placeholder for future optional parameters @@ -691,7 +748,8 @@ type AlertsSuppressionRulesClientGetOptions struct { // placeholder for future optional parameters } -// AlertsSuppressionRulesClientListOptions contains the optional parameters for the AlertsSuppressionRulesClient.List method. +// AlertsSuppressionRulesClientListOptions contains the optional parameters for the AlertsSuppressionRulesClient.NewListPager +// method. type AlertsSuppressionRulesClientListOptions struct { // Type of the alert to get rules for AlertType *string @@ -717,13 +775,13 @@ type AllowedConnectionsClientGetOptions struct { // placeholder for future optional parameters } -// AllowedConnectionsClientListByHomeRegionOptions contains the optional parameters for the AllowedConnectionsClient.ListByHomeRegion +// 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.List method. +// AllowedConnectionsClientListOptions contains the optional parameters for the AllowedConnectionsClient.NewListPager method. type AllowedConnectionsClientListOptions struct { // placeholder for future optional parameters } @@ -1042,7 +1100,7 @@ type ApplicationCondition struct { // ApplicationProperties - Describes properties of an application type ApplicationProperties struct { // REQUIRED; The application conditionSets - see examples - ConditionSets []interface{} `json:"conditionSets,omitempty"` + ConditionSets []any `json:"conditionSets,omitempty"` // REQUIRED; The application source, what it affects, e.g. Assessments SourceResourceType *ApplicationSourceResourceType `json:"sourceResourceType,omitempty"` @@ -1054,7 +1112,7 @@ type ApplicationProperties struct { DisplayName *string `json:"displayName,omitempty"` } -// ApplicationsClientListOptions contains the optional parameters for the ApplicationsClient.List method. +// ApplicationsClientListOptions contains the optional parameters for the ApplicationsClient.NewListPager method. type ApplicationsClientListOptions struct { // placeholder for future optional parameters } @@ -1071,7 +1129,7 @@ type ApplicationsList struct { // AscLocation - The ASC location of the subscription is in the "name" field type AscLocation struct { // An empty set of properties - Properties interface{} `json:"properties,omitempty"` + Properties any `json:"properties,omitempty"` // READ-ONLY; Resource Id ID *string `json:"id,omitempty" azure:"ro"` @@ -1394,7 +1452,7 @@ type AssessmentsClientGetOptions struct { Expand *ExpandEnum } -// AssessmentsClientListOptions contains the optional parameters for the AssessmentsClient.List method. +// AssessmentsClientListOptions contains the optional parameters for the AssessmentsClient.NewListPager method. type AssessmentsClientListOptions struct { // placeholder for future optional parameters } @@ -1422,13 +1480,13 @@ type AssessmentsMetadataClientGetOptions struct { // placeholder for future optional parameters } -// AssessmentsMetadataClientListBySubscriptionOptions contains the optional parameters for the AssessmentsMetadataClient.ListBySubscription +// 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.List method. +// AssessmentsMetadataClientListOptions contains the optional parameters for the AssessmentsMetadataClient.NewListPager method. type AssessmentsMetadataClientListOptions struct { // placeholder for future optional parameters } @@ -1457,7 +1515,7 @@ type AtaExternalSecuritySolution struct { // AtaSolutionProperties - The external security solution properties for ATA solutions type AtaSolutionProperties struct { // OPTIONAL; Contains additional key/value pairs not defined in the schema. - AdditionalProperties map[string]interface{} + AdditionalProperties map[string]any DeviceType *string `json:"deviceType,omitempty"` DeviceVendor *string `json:"deviceVendor,omitempty"` LastEventReceived *string `json:"lastEventReceived,omitempty"` @@ -1535,7 +1593,7 @@ type AutoProvisioningSettingsClientGetOptions struct { // placeholder for future optional parameters } -// AutoProvisioningSettingsClientListOptions contains the optional parameters for the AutoProvisioningSettingsClient.List +// AutoProvisioningSettingsClientListOptions contains the optional parameters for the AutoProvisioningSettingsClient.NewListPager // method. type AutoProvisioningSettingsClientListOptions struct { // placeholder for future optional parameters @@ -1750,13 +1808,13 @@ type AutomationsClientGetOptions struct { // placeholder for future optional parameters } -// AutomationsClientListByResourceGroupOptions contains the optional parameters for the AutomationsClient.ListByResourceGroup +// 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.List method. +// AutomationsClientListOptions contains the optional parameters for the AutomationsClient.NewListPager method. type AutomationsClientListOptions struct { // placeholder for future optional parameters } @@ -2030,7 +2088,7 @@ type CefExternalSecuritySolution struct { // CefSolutionProperties - The external security solution properties for CEF solutions type CefSolutionProperties struct { // OPTIONAL; Contains additional key/value pairs not defined in the schema. - AdditionalProperties map[string]interface{} + AdditionalProperties map[string]any Agent *string `json:"agent,omitempty"` DeviceType *string `json:"deviceType,omitempty"` DeviceVendor *string `json:"deviceVendor,omitempty"` @@ -2139,7 +2197,7 @@ type ComplianceResultsClientGetOptions struct { // placeholder for future optional parameters } -// ComplianceResultsClientListOptions contains the optional parameters for the ComplianceResultsClient.List method. +// ComplianceResultsClientListOptions contains the optional parameters for the ComplianceResultsClient.NewListPager method. type ComplianceResultsClientListOptions struct { // placeholder for future optional parameters } @@ -2158,7 +2216,7 @@ type CompliancesClientGetOptions struct { // placeholder for future optional parameters } -// CompliancesClientListOptions contains the optional parameters for the CompliancesClient.List method. +// CompliancesClientListOptions contains the optional parameters for the CompliancesClient.NewListPager method. type CompliancesClientListOptions struct { // placeholder for future optional parameters } @@ -2367,40 +2425,12 @@ type ConnectorApplicationClientGetOptions struct { // placeholder for future optional parameters } -// ConnectorApplicationsClientListOptions contains the optional parameters for the ConnectorApplicationsClient.List method. -type ConnectorApplicationsClientListOptions struct { - // placeholder for future optional parameters -} - -// ConnectorGovernanceRuleClientListOptions contains the optional parameters for the ConnectorGovernanceRuleClient.List method. -type ConnectorGovernanceRuleClientListOptions struct { - // placeholder for future optional parameters -} - -// ConnectorGovernanceRulesClientCreateOrUpdateOptions contains the optional parameters for the ConnectorGovernanceRulesClient.CreateOrUpdate -// method. -type ConnectorGovernanceRulesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ConnectorGovernanceRulesClientDeleteOptions contains the optional parameters for the ConnectorGovernanceRulesClient.Delete +// ConnectorApplicationsClientListOptions contains the optional parameters for the ConnectorApplicationsClient.NewListPager // method. -type ConnectorGovernanceRulesClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ConnectorGovernanceRulesClientGetOptions contains the optional parameters for the ConnectorGovernanceRulesClient.Get method. -type ConnectorGovernanceRulesClientGetOptions struct { +type ConnectorApplicationsClientListOptions struct { // placeholder for future optional parameters } -// ConnectorGovernanceRulesExecuteStatusClientBeginGetOptions contains the optional parameters for the ConnectorGovernanceRulesExecuteStatusClient.BeginGet -// method. -type ConnectorGovernanceRulesExecuteStatusClientBeginGetOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // ConnectorProperties - A set of properties that defines the security connector configuration. type ConnectorProperties struct { // The security connector environment data. @@ -2468,13 +2498,13 @@ type ConnectorsClientGetOptions struct { // placeholder for future optional parameters } -// ConnectorsClientListByResourceGroupOptions contains the optional parameters for the ConnectorsClient.ListByResourceGroup +// 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.List method. +// ConnectorsClientListOptions contains the optional parameters for the ConnectorsClient.NewListPager method. type ConnectorsClientListOptions struct { // placeholder for future optional parameters } @@ -2569,7 +2599,7 @@ type ContactsClientGetOptions struct { // placeholder for future optional parameters } -// ContactsClientListOptions contains the optional parameters for the ContactsClient.List method. +// ContactsClientListOptions contains the optional parameters for the ContactsClient.NewListPager method. type ContactsClientListOptions struct { // placeholder for future optional parameters } @@ -2829,13 +2859,13 @@ type CustomAssessmentAutomationsClientGetOptions struct { // placeholder for future optional parameters } -// CustomAssessmentAutomationsClientListByResourceGroupOptions contains the optional parameters for the CustomAssessmentAutomationsClient.ListByResourceGroup +// 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.ListBySubscription +// CustomAssessmentAutomationsClientListBySubscriptionOptions contains the optional parameters for the CustomAssessmentAutomationsClient.NewListBySubscriptionPager // method. type CustomAssessmentAutomationsClientListBySubscriptionOptions struct { // placeholder for future optional parameters @@ -2907,13 +2937,13 @@ type CustomEntityStoreAssignmentsClientGetOptions struct { // placeholder for future optional parameters } -// CustomEntityStoreAssignmentsClientListByResourceGroupOptions contains the optional parameters for the CustomEntityStoreAssignmentsClient.ListByResourceGroup +// 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.ListBySubscription +// CustomEntityStoreAssignmentsClientListBySubscriptionOptions contains the optional parameters for the CustomEntityStoreAssignmentsClient.NewListBySubscriptionPager // method. type CustomEntityStoreAssignmentsClientListBySubscriptionOptions struct { // placeholder for future optional parameters @@ -3319,7 +3349,7 @@ type DefenderForServersAwsOfferingDefenderForServers struct { // DefenderForServersAwsOfferingMdeAutoProvisioning - The Microsoft Defender for Endpoint autoprovisioning configuration type DefenderForServersAwsOfferingMdeAutoProvisioning struct { // configuration for Microsoft Defender for Endpoint autoprovisioning - Configuration interface{} `json:"configuration,omitempty"` + Configuration any `json:"configuration,omitempty"` // Is Microsoft Defender for Endpoint auto provisioning enabled Enabled *bool `json:"enabled,omitempty"` @@ -3417,7 +3447,7 @@ type DefenderForServersGcpOfferingDefenderForServers struct { // DefenderForServersGcpOfferingMdeAutoProvisioning - The Microsoft Defender for Endpoint autoprovisioning configuration type DefenderForServersGcpOfferingMdeAutoProvisioning struct { // configuration for Microsoft Defender for Endpoint autoprovisioning - Configuration interface{} `json:"configuration,omitempty"` + Configuration any `json:"configuration,omitempty"` // Is Microsoft Defender for Endpoint auto provisioning enabled Enabled *bool `json:"enabled,omitempty"` @@ -3541,7 +3571,8 @@ type DeviceSecurityGroupsClientGetOptions struct { // placeholder for future optional parameters } -// DeviceSecurityGroupsClientListOptions contains the optional parameters for the DeviceSecurityGroupsClient.List method. +// DeviceSecurityGroupsClientListOptions contains the optional parameters for the DeviceSecurityGroupsClient.NewListPager +// method. type DeviceSecurityGroupsClientListOptions struct { // placeholder for future optional parameters } @@ -3649,13 +3680,13 @@ type DiscoveredSecuritySolutionsClientGetOptions struct { // placeholder for future optional parameters } -// DiscoveredSecuritySolutionsClientListByHomeRegionOptions contains the optional parameters for the DiscoveredSecuritySolutionsClient.ListByHomeRegion +// 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.List +// DiscoveredSecuritySolutionsClientListOptions contains the optional parameters for the DiscoveredSecuritySolutionsClient.NewListPager // method. type DiscoveredSecuritySolutionsClientListOptions struct { // placeholder for future optional parameters @@ -3697,24 +3728,43 @@ func (e *EnvironmentData) GetEnvironmentData() *EnvironmentData { return e } // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. - Info interface{} `json:"info,omitempty" azure:"ro"` + Info any `json:"info,omitempty" azure:"ro"` // READ-ONLY; The additional info type. Type *string `json:"type,omitempty" azure:"ro"` } +// ErrorDetail - The error detail. +type ErrorDetail struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"` + + // READ-ONLY; The error code. + Code *string `json:"code,omitempty" azure:"ro"` + + // READ-ONLY; The error details. + Details []*ErrorDetail `json:"details,omitempty" azure:"ro"` + + // READ-ONLY; The error message. + Message *string `json:"message,omitempty" azure:"ro"` + + // READ-ONLY; The error target. + Target *string `json:"target,omitempty" azure:"ro"` +} + +// ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. +// (This also follows the OData error response format.). +type ErrorResponse struct { + // The error object. + Error *ErrorDetail `json:"error,omitempty"` +} + // ExecuteGovernanceRuleParams - Governance rule execution parameters type ExecuteGovernanceRuleParams struct { // Describe if governance rule should be override Override *bool `json:"override,omitempty"` } -// ExecuteRuleStatus - Execute status of Security GovernanceRule over a given scope -type ExecuteRuleStatus struct { - // READ-ONLY; Unique key for the execution of GovernanceRule - OperationID *string `json:"operationId,omitempty" azure:"ro"` -} - // ExternalSecuritySolution - 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. type ExternalSecuritySolution struct { @@ -3750,7 +3800,7 @@ type ExternalSecuritySolutionList struct { // ExternalSecuritySolutionProperties - The solution properties (correspond to the solution kind) type ExternalSecuritySolutionProperties struct { // OPTIONAL; Contains additional key/value pairs not defined in the schema. - AdditionalProperties map[string]interface{} + AdditionalProperties map[string]any DeviceType *string `json:"deviceType,omitempty"` DeviceVendor *string `json:"deviceVendor,omitempty"` @@ -3764,13 +3814,13 @@ type ExternalSecuritySolutionsClientGetOptions struct { // placeholder for future optional parameters } -// ExternalSecuritySolutionsClientListByHomeRegionOptions contains the optional parameters for the ExternalSecuritySolutionsClient.ListByHomeRegion +// 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.List +// ExternalSecuritySolutionsClientListOptions contains the optional parameters for the ExternalSecuritySolutionsClient.NewListPager // method. type ExternalSecuritySolutionsClientListOptions struct { // placeholder for future optional parameters @@ -4053,9 +4103,9 @@ func (g *GithubScopeEnvironmentData) GetEnvironmentData() *EnvironmentData { } } -// GovernanceAssignment - Security GovernanceAssignment over a given scope +// GovernanceAssignment - Governance assignment over a given scope type GovernanceAssignment struct { - // Properties of a security governanceAssignment + // The properties of a governance assignment Properties *GovernanceAssignmentProperties `json:"properties,omitempty"` // READ-ONLY; Resource Id @@ -4068,15 +4118,15 @@ type GovernanceAssignment struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GovernanceAssignmentAdditionalData - Describe the additional data of GovernanceAssignment - optional +// GovernanceAssignmentAdditionalData - Describe the additional data of governance assignment - optional type GovernanceAssignmentAdditionalData struct { - // Ticket link associated with this GovernanceAssignment - for example: https://snow.com + // Ticket link associated with this governance assignment - for example: https://snow.com TicketLink *string `json:"ticketLink,omitempty"` - // Ticket number associated with this GovernanceAssignment + // Ticket number associated with this governance assignment TicketNumber *int32 `json:"ticketNumber,omitempty"` - // The ticket status associated with this GovernanceAssignment - for example: Active + // The ticket status associated with this governance assignment - for example: Active TicketStatus *string `json:"ticketStatus,omitempty"` } @@ -4117,12 +4167,13 @@ type GovernanceAssignmentsClientGetOptions struct { // placeholder for future optional parameters } -// GovernanceAssignmentsClientListOptions contains the optional parameters for the GovernanceAssignmentsClient.List method. +// GovernanceAssignmentsClientListOptions contains the optional parameters for the GovernanceAssignmentsClient.NewListPager +// method. type GovernanceAssignmentsClientListOptions struct { // placeholder for future optional parameters } -// GovernanceAssignmentsList - Page of a security governance assignments list +// GovernanceAssignmentsList - Page of a governance assignments list type GovernanceAssignmentsList struct { // READ-ONLY; The URI to fetch the next page NextLink *string `json:"nextLink,omitempty" azure:"ro"` @@ -4140,9 +4191,9 @@ type GovernanceEmailNotification struct { DisableOwnerEmailNotification *bool `json:"disableOwnerEmailNotification,omitempty"` } -// GovernanceRule - Security GovernanceRule over a given scope +// GovernanceRule - Governance rule over a given scope type GovernanceRule struct { - // Properties of a security governanceRule + // Properties of a governance rule Properties *GovernanceRuleProperties `json:"properties,omitempty"` // READ-ONLY; Resource Id @@ -4155,29 +4206,39 @@ type GovernanceRule struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GovernanceRuleClientListOptions contains the optional parameters for the GovernanceRuleClient.List method. -type GovernanceRuleClientListOptions struct { - // placeholder for future optional parameters -} - -// GovernanceRuleEmailNotification - The governance email weekly notification configuration. +// GovernanceRuleEmailNotification - The governance email weekly notification configuration type GovernanceRuleEmailNotification struct { - // Defines whether manager email notifications are disabled. + // Defines whether manager email notifications are disabled DisableManagerEmailNotification *bool `json:"disableManagerEmailNotification,omitempty"` - // Defines whether owner email notifications are disabled. + // Defines whether owner email notifications are disabled DisableOwnerEmailNotification *bool `json:"disableOwnerEmailNotification,omitempty"` } -// GovernanceRuleList - Page of a security governanceRules list +// GovernanceRuleList - Page of a governance rules list type GovernanceRuleList struct { // READ-ONLY; The URI to fetch the next page NextLink *string `json:"nextLink,omitempty" azure:"ro"` - // READ-ONLY; Collection of governanceRules in this page + // READ-ONLY; Collection of governance rules in this page Value []*GovernanceRule `json:"value,omitempty" azure:"ro"` } +// GovernanceRuleMetadata - The governance rule metadata +type GovernanceRuleMetadata struct { + // READ-ONLY; Governance rule Created by object id (GUID) + CreatedBy *string `json:"createdBy,omitempty" azure:"ro"` + + // READ-ONLY; Governance rule creation date + CreatedOn *time.Time `json:"createdOn,omitempty" azure:"ro"` + + // READ-ONLY; Governance rule last updated by object id (GUID) + UpdatedBy *string `json:"updatedBy,omitempty" azure:"ro"` + + // READ-ONLY; Governance rule last update date + UpdatedOn *time.Time `json:"updatedOn,omitempty" azure:"ro"` +} + // GovernanceRuleOwnerSource - Describe the owner source of governance rule type GovernanceRuleOwnerSource struct { // The owner type for the governance rule owner source @@ -4187,19 +4248,19 @@ type GovernanceRuleOwnerSource struct { Value *string `json:"value,omitempty"` } -// GovernanceRuleProperties - Describes properties of an governanceRule +// GovernanceRuleProperties - Describes properties of an governance rule type GovernanceRuleProperties struct { // REQUIRED; The governance rule conditionSets - see examples - ConditionSets []interface{} `json:"conditionSets,omitempty"` + ConditionSets []any `json:"conditionSets,omitempty"` - // REQUIRED; display name of the governanceRule + // REQUIRED; Display name of the governance rule DisplayName *string `json:"displayName,omitempty"` - // REQUIRED; The Owner source for the governance rule - e.g. Manually by user@contoso.com - see example + // REQUIRED; The owner source for the governance rule - e.g. Manually by user@contoso.com - see example OwnerSource *GovernanceRuleOwnerSource `json:"ownerSource,omitempty"` - // REQUIRED; The governance rule priority, priority to the lower number. Rules with the same priority on the same subscription - // will not be allowed + // REQUIRED; The governance rule priority, priority to the lower number. Rules with the same priority on the same scope will + // not be allowed RulePriority *int32 `json:"rulePriority,omitempty"` // REQUIRED; The rule type of the governance rule, defines the source of the rule e.g. Integrated @@ -4208,36 +4269,44 @@ type GovernanceRuleProperties struct { // REQUIRED; The governance rule source, what the rule affects, e.g. Assessments SourceResourceType *GovernanceRuleSourceResourceType `json:"sourceResourceType,omitempty"` - // description of the governanceRule + // Description of the governance rule Description *string `json:"description,omitempty"` + // Excluded scopes, filter out the descendants of the scope (on management scopes) + ExcludedScopes []*string `json:"excludedScopes,omitempty"` + // The email notifications settings for the governance rule, states whether to disable notifications for mangers and owners GovernanceEmailNotification *GovernanceRuleEmailNotification `json:"governanceEmailNotification,omitempty"` + // Defines whether the rule is management scope rule (master connector as a single scope or management scope) + IncludeMemberScopes *bool `json:"includeMemberScopes,omitempty"` + // Defines whether the rule is active/inactive IsDisabled *bool `json:"isDisabled,omitempty"` // Defines whether there is a grace period on the governance rule IsGracePeriod *bool `json:"isGracePeriod,omitempty"` + // The governance rule metadata + Metadata *GovernanceRuleMetadata `json:"metadata,omitempty"` + // Governance rule remediation timeframe - this is the time that will affect on the grace-period duration e.g. 7.00:00:00 // - means 7 days RemediationTimeframe *string `json:"remediationTimeframe,omitempty"` + + // READ-ONLY; The tenantId (GUID) + TenantID *string `json:"tenantId,omitempty" azure:"ro"` } -// GovernanceRulesClientBeginRuleIDExecuteSingleSecurityConnectorOptions contains the optional parameters for the GovernanceRulesClient.BeginRuleIDExecuteSingleSecurityConnector -// method. -type GovernanceRulesClientBeginRuleIDExecuteSingleSecurityConnectorOptions struct { - // GovernanceRule over a subscription scope - ExecuteGovernanceRuleParams *ExecuteGovernanceRuleParams +// GovernanceRulesClientBeginDeleteOptions contains the optional parameters for the GovernanceRulesClient.BeginDelete method. +type GovernanceRulesClientBeginDeleteOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// GovernanceRulesClientBeginRuleIDExecuteSingleSubscriptionOptions contains the optional parameters for the GovernanceRulesClient.BeginRuleIDExecuteSingleSubscription -// method. -type GovernanceRulesClientBeginRuleIDExecuteSingleSubscriptionOptions struct { - // GovernanceRule over a subscription scope +// GovernanceRulesClientBeginExecuteOptions contains the optional parameters for the GovernanceRulesClient.BeginExecute method. +type GovernanceRulesClientBeginExecuteOptions struct { + // Execute governance rule over a given scope ExecuteGovernanceRuleParams *ExecuteGovernanceRuleParams // Resumes the LRO from the provided token. ResumeToken string @@ -4249,13 +4318,19 @@ type GovernanceRulesClientCreateOrUpdateOptions struct { // placeholder for future optional parameters } -// GovernanceRulesClientDeleteOptions contains the optional parameters for the GovernanceRulesClient.Delete method. -type GovernanceRulesClientDeleteOptions struct { +// GovernanceRulesClientGetOptions contains the optional parameters for the GovernanceRulesClient.Get method. +type GovernanceRulesClientGetOptions struct { // placeholder for future optional parameters } -// GovernanceRulesClientGetOptions contains the optional parameters for the GovernanceRulesClient.Get method. -type GovernanceRulesClientGetOptions struct { +// GovernanceRulesClientListOptions contains the optional parameters for the GovernanceRulesClient.NewListPager method. +type GovernanceRulesClientListOptions struct { + // placeholder for future optional parameters +} + +// GovernanceRulesClientOperationResultsOptions contains the optional parameters for the GovernanceRulesClient.OperationResults +// method. +type GovernanceRulesClientOperationResultsOptions struct { // placeholder for future optional parameters } @@ -4512,7 +4587,7 @@ type InformationProtectionPoliciesClientGetOptions struct { // placeholder for future optional parameters } -// InformationProtectionPoliciesClientListOptions contains the optional parameters for the InformationProtectionPoliciesClient.List +// InformationProtectionPoliciesClientListOptions contains the optional parameters for the InformationProtectionPoliciesClient.NewListPager // method. type InformationProtectionPoliciesClientListOptions struct { // placeholder for future optional parameters @@ -4593,7 +4668,7 @@ type IngestionConnectionString struct { // IngestionSetting - Configures how to correlate scan data and logs with resources associated with the subscription. type IngestionSetting struct { // Ingestion setting data - Properties interface{} `json:"properties,omitempty"` + Properties any `json:"properties,omitempty"` // READ-ONLY; Resource Id ID *string `json:"id,omitempty" azure:"ro"` @@ -4641,7 +4716,7 @@ type IngestionSettingsClientListConnectionStringsOptions struct { // placeholder for future optional parameters } -// IngestionSettingsClientListOptions contains the optional parameters for the IngestionSettingsClient.List method. +// IngestionSettingsClientListOptions contains the optional parameters for the IngestionSettingsClient.NewListPager method. type IngestionSettingsClientListOptions struct { // placeholder for future optional parameters } @@ -4987,14 +5062,14 @@ type IotSecuritySolutionClientGetOptions struct { // placeholder for future optional parameters } -// IotSecuritySolutionClientListByResourceGroupOptions contains the optional parameters for the IotSecuritySolutionClient.ListByResourceGroup +// 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.ListBySubscription +// 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. @@ -5018,7 +5093,7 @@ type IotSecuritySolutionsAnalyticsAggregatedAlertClientGetOptions struct { // placeholder for future optional parameters } -// IotSecuritySolutionsAnalyticsAggregatedAlertClientListOptions contains the optional parameters for the IotSecuritySolutionsAnalyticsAggregatedAlertClient.List +// IotSecuritySolutionsAnalyticsAggregatedAlertClientListOptions contains the optional parameters for the IotSecuritySolutionsAnalyticsAggregatedAlertClient.NewListPager // method. type IotSecuritySolutionsAnalyticsAggregatedAlertClientListOptions struct { // Number of results to retrieve. @@ -5031,7 +5106,7 @@ type IotSecuritySolutionsAnalyticsRecommendationClientGetOptions struct { // placeholder for future optional parameters } -// IotSecuritySolutionsAnalyticsRecommendationClientListOptions contains the optional parameters for the IotSecuritySolutionsAnalyticsRecommendationClient.List +// IotSecuritySolutionsAnalyticsRecommendationClientListOptions contains the optional parameters for the IotSecuritySolutionsAnalyticsRecommendationClient.NewListPager // method. type IotSecuritySolutionsAnalyticsRecommendationClientListOptions struct { // Number of results to retrieve. @@ -5061,25 +5136,25 @@ type JitNetworkAccessPoliciesClientInitiateOptions struct { // placeholder for future optional parameters } -// JitNetworkAccessPoliciesClientListByRegionOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.ListByRegion +// 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.ListByResourceGroupAndRegion +// 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.ListByResourceGroup +// 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.List +// JitNetworkAccessPoliciesClientListOptions contains the optional parameters for the JitNetworkAccessPoliciesClient.NewListPager // method. type JitNetworkAccessPoliciesClientListOptions struct { // placeholder for future optional parameters @@ -5336,7 +5411,7 @@ type LocationsClientGetOptions struct { // placeholder for future optional parameters } -// LocationsClientListOptions contains the optional parameters for the LocationsClient.List method. +// LocationsClientListOptions contains the optional parameters for the LocationsClient.NewListPager method. type LocationsClientListOptions struct { // placeholder for future optional parameters } @@ -5702,7 +5777,13 @@ type OperationList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// OperationResultAutoGenerated - Long run operation status of governance rule over a given scope +type OperationResultAutoGenerated struct { + // READ-ONLY; The status of the long run operation result of governance rule + Status *OperationResult `json:"status,omitempty" azure:"ro"` +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters } @@ -6028,7 +6109,7 @@ type RegulatoryComplianceAssessmentsClientGetOptions struct { // placeholder for future optional parameters } -// RegulatoryComplianceAssessmentsClientListOptions contains the optional parameters for the RegulatoryComplianceAssessmentsClient.List +// RegulatoryComplianceAssessmentsClientListOptions contains the optional parameters for the RegulatoryComplianceAssessmentsClient.NewListPager // method. type RegulatoryComplianceAssessmentsClientListOptions struct { // OData filter. Optional. @@ -6083,7 +6164,7 @@ type RegulatoryComplianceControlsClientGetOptions struct { // placeholder for future optional parameters } -// RegulatoryComplianceControlsClientListOptions contains the optional parameters for the RegulatoryComplianceControlsClient.List +// RegulatoryComplianceControlsClientListOptions contains the optional parameters for the RegulatoryComplianceControlsClient.NewListPager // method. type RegulatoryComplianceControlsClientListOptions struct { // OData filter. Optional. @@ -6138,7 +6219,7 @@ type RegulatoryComplianceStandardsClientGetOptions struct { // placeholder for future optional parameters } -// RegulatoryComplianceStandardsClientListOptions contains the optional parameters for the RegulatoryComplianceStandardsClient.List +// RegulatoryComplianceStandardsClientListOptions contains the optional parameters for the RegulatoryComplianceStandardsClient.NewListPager // method. type RegulatoryComplianceStandardsClientListOptions struct { // OData filter. Optional. @@ -6471,7 +6552,7 @@ type Scans struct { // ScopeElement - A more specific scope used to identify the alerts to suppress. type ScopeElement struct { // OPTIONAL; Contains additional key/value pairs not defined in the schema. - AdditionalProperties map[string]interface{} + AdditionalProperties map[string]any // The alert entity type to suppress by. Field *string `json:"field,omitempty"` @@ -6537,13 +6618,13 @@ type SecureScoreControlDefinitionSource struct { SourceType *ControlType `json:"sourceType,omitempty"` } -// SecureScoreControlDefinitionsClientListBySubscriptionOptions contains the optional parameters for the SecureScoreControlDefinitionsClient.ListBySubscription +// 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.List +// SecureScoreControlDefinitionsClientListOptions contains the optional parameters for the SecureScoreControlDefinitionsClient.NewListPager // method. type SecureScoreControlDefinitionsClientListOptions struct { // placeholder for future optional parameters @@ -6611,14 +6692,14 @@ type SecureScoreControlScoreDetails struct { Weight *int64 `json:"weight,omitempty" azure:"ro"` } -// SecureScoreControlsClientListBySecureScoreOptions contains the optional parameters for the SecureScoreControlsClient.ListBySecureScore +// 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.List method. +// SecureScoreControlsClientListOptions contains the optional parameters for the SecureScoreControlsClient.NewListPager method. type SecureScoreControlsClientListOptions struct { // OData expand. Optional. Expand *ExpandControlsEnum @@ -6656,7 +6737,7 @@ type SecureScoresClientGetOptions struct { // placeholder for future optional parameters } -// SecureScoresClientListOptions contains the optional parameters for the SecureScoresClient.List method. +// SecureScoresClientListOptions contains the optional parameters for the SecureScoresClient.NewListPager method. type SecureScoresClientListOptions struct { // placeholder for future optional parameters } @@ -6815,7 +6896,7 @@ type SettingsClientGetOptions struct { // placeholder for future optional parameters } -// SettingsClientListOptions contains the optional parameters for the SettingsClient.List method. +// SettingsClientListOptions contains the optional parameters for the SettingsClient.NewListPager method. type SettingsClientListOptions struct { // placeholder for future optional parameters } @@ -6854,13 +6935,13 @@ type SoftwareInventoriesClientGetOptions struct { // placeholder for future optional parameters } -// SoftwareInventoriesClientListByExtendedResourceOptions contains the optional parameters for the SoftwareInventoriesClient.ListByExtendedResource +// 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.ListBySubscription +// SoftwareInventoriesClientListBySubscriptionOptions contains the optional parameters for the SoftwareInventoriesClient.NewListBySubscriptionPager // method. type SoftwareInventoriesClientListBySubscriptionOptions struct { // placeholder for future optional parameters @@ -6946,7 +7027,7 @@ type SolutionsClientGetOptions struct { // placeholder for future optional parameters } -// SolutionsClientListOptions contains the optional parameters for the SolutionsClient.List method. +// SolutionsClientListOptions contains the optional parameters for the SolutionsClient.NewListPager method. type SolutionsClientListOptions struct { // placeholder for future optional parameters } @@ -7083,23 +7164,16 @@ type SubAssessmentsClientGetOptions struct { // placeholder for future optional parameters } -// SubAssessmentsClientListAllOptions contains the optional parameters for the SubAssessmentsClient.ListAll method. +// 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.List method. +// SubAssessmentsClientListOptions contains the optional parameters for the SubAssessmentsClient.NewListPager method. type SubAssessmentsClientListOptions struct { // placeholder for future optional parameters } -// SubscriptionGovernanceRulesExecuteStatusClientBeginGetOptions contains the optional parameters for the SubscriptionGovernanceRulesExecuteStatusClient.BeginGet -// method. -type SubscriptionGovernanceRulesExecuteStatusClientBeginGetOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - type SuppressionAlertsScope struct { // REQUIRED; All the conditions inside need to be true in order to suppress the alert AllOf []*ScopeElement `json:"allOf,omitempty"` @@ -7165,7 +7239,7 @@ type TaskList struct { // TaskParameters - Changing set of properties, depending on the task type that is derived from the name field type TaskParameters struct { // OPTIONAL; Contains additional key/value pairs not defined in the schema. - AdditionalProperties map[string]interface{} + AdditionalProperties map[string]any // READ-ONLY; Name of the task type Name *string `json:"name,omitempty" azure:"ro"` @@ -7201,19 +7275,20 @@ type TasksClientGetSubscriptionLevelTaskOptions struct { // placeholder for future optional parameters } -// TasksClientListByHomeRegionOptions contains the optional parameters for the TasksClient.ListByHomeRegion method. +// 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.ListByResourceGroup method. +// 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.List method. +// TasksClientListOptions contains the optional parameters for the TasksClient.NewListPager method. type TasksClientListOptions struct { // OData filter. Optional. Filter *string @@ -7351,12 +7426,13 @@ type TopologyClientGetOptions struct { // placeholder for future optional parameters } -// TopologyClientListByHomeRegionOptions contains the optional parameters for the TopologyClient.ListByHomeRegion method. +// 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.List method. +// TopologyClientListOptions contains the optional parameters for the TopologyClient.NewListPager method. type TopologyClientListOptions struct { // placeholder for future optional parameters } @@ -7711,7 +7787,7 @@ type WorkspaceSettingsClientGetOptions struct { // placeholder for future optional parameters } -// WorkspaceSettingsClientListOptions contains the optional parameters for the WorkspaceSettingsClient.List method. +// WorkspaceSettingsClientListOptions contains the optional parameters for the WorkspaceSettingsClient.NewListPager method. type WorkspaceSettingsClientListOptions 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 7712659e0a20..2b038096025a 100644 --- a/sdk/resourcemanager/security/armsecurity/models_serde.go +++ b/sdk/resourcemanager/security/armsecurity/models_serde.go @@ -20,7 +20,7 @@ import ( // MarshalJSON implements the json.Marshaller interface for type AADConnectivityStateAutoGenerated. func (a AADConnectivityStateAutoGenerated) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "connectivityState", a.ConnectivityState) return json.Marshal(objectMap) } @@ -47,7 +47,7 @@ func (a *AADConnectivityStateAutoGenerated) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AADExternalSecuritySolution. func (a AADExternalSecuritySolution) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "kind", a.Kind) populate(objectMap, "location", a.Location) @@ -94,7 +94,7 @@ func (a *AADExternalSecuritySolution) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AADSolutionProperties. func (a AADSolutionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "connectivityState", a.ConnectivityState) populate(objectMap, "deviceType", a.DeviceType) populate(objectMap, "deviceVendor", a.DeviceVendor) @@ -130,10 +130,10 @@ func (a *AADSolutionProperties) UnmarshalJSON(data []byte) error { delete(rawMsg, key) default: if a.AdditionalProperties == nil { - a.AdditionalProperties = map[string]interface{}{} + a.AdditionalProperties = map[string]any{} } if val != nil { - var aux interface{} + var aux any err = json.Unmarshal(val, &aux) a.AdditionalProperties[key] = aux } @@ -146,9 +146,110 @@ func (a *AADSolutionProperties) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type APICollectionProperties. +func (a APICollectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalData", a.AdditionalData) + populate(objectMap, "displayName", a.DisplayName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APICollectionProperties. +func (a *APICollectionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalData": + err = unpopulate(val, "AdditionalData", &a.AdditionalData) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type APICollectionResponse. +func (a APICollectionResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APICollectionResponse. +func (a *APICollectionResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type APICollectionResponseList. +func (a APICollectionResponseList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APICollectionResponseList. +func (a *APICollectionResponseList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ActiveConnectionsNotInAllowedRange. func (a ActiveConnectionsNotInAllowedRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", a.Description) populate(objectMap, "displayName", a.DisplayName) populate(objectMap, "isEnabled", a.IsEnabled) @@ -199,7 +300,7 @@ func (a *ActiveConnectionsNotInAllowedRange) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AdaptiveApplicationControlGroup. func (a AdaptiveApplicationControlGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "location", a.Location) populate(objectMap, "name", a.Name) @@ -242,7 +343,7 @@ func (a *AdaptiveApplicationControlGroup) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AdaptiveApplicationControlGroupData. func (a AdaptiveApplicationControlGroupData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "configurationStatus", a.ConfigurationStatus) populate(objectMap, "enforcementMode", a.EnforcementMode) populate(objectMap, "issues", a.Issues) @@ -297,7 +398,7 @@ func (a *AdaptiveApplicationControlGroupData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AdaptiveApplicationControlGroups. func (a AdaptiveApplicationControlGroups) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) } @@ -324,7 +425,7 @@ func (a *AdaptiveApplicationControlGroups) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AdaptiveApplicationControlIssueSummary. func (a AdaptiveApplicationControlIssueSummary) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "issue", a.Issue) populate(objectMap, "numberOfVms", a.NumberOfVMs) return json.Marshal(objectMap) @@ -355,7 +456,7 @@ func (a *AdaptiveApplicationControlIssueSummary) UnmarshalJSON(data []byte) erro // MarshalJSON implements the json.Marshaller interface for type AdaptiveNetworkHardening. func (a AdaptiveNetworkHardening) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) @@ -394,7 +495,7 @@ func (a *AdaptiveNetworkHardening) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AdaptiveNetworkHardeningEnforceRequest. func (a AdaptiveNetworkHardeningEnforceRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "networkSecurityGroups", a.NetworkSecurityGroups) populate(objectMap, "rules", a.Rules) return json.Marshal(objectMap) @@ -425,7 +526,7 @@ func (a *AdaptiveNetworkHardeningEnforceRequest) UnmarshalJSON(data []byte) erro // MarshalJSON implements the json.Marshaller interface for type AdaptiveNetworkHardeningProperties. func (a AdaptiveNetworkHardeningProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "effectiveNetworkSecurityGroups", a.EffectiveNetworkSecurityGroups) populate(objectMap, "rules", a.Rules) populateTimeRFC3339(objectMap, "rulesCalculationTime", a.RulesCalculationTime) @@ -460,7 +561,7 @@ func (a *AdaptiveNetworkHardeningProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AdaptiveNetworkHardeningsList. func (a AdaptiveNetworkHardeningsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) @@ -491,7 +592,7 @@ func (a *AdaptiveNetworkHardeningsList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AdditionalData. func (a AdditionalData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["assessedResourceType"] = a.AssessedResourceType return json.Marshal(objectMap) } @@ -518,7 +619,7 @@ func (a *AdditionalData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AdditionalWorkspacesProperties. func (a AdditionalWorkspacesProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "dataTypes", a.DataTypes) populate(objectMap, "type", a.Type) populate(objectMap, "workspace", a.Workspace) @@ -553,7 +654,7 @@ func (a *AdditionalWorkspacesProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AdvancedThreatProtectionProperties. func (a AdvancedThreatProtectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "isEnabled", a.IsEnabled) return json.Marshal(objectMap) } @@ -580,7 +681,7 @@ func (a *AdvancedThreatProtectionProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AdvancedThreatProtectionSetting. func (a AdvancedThreatProtectionSetting) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) @@ -619,7 +720,7 @@ func (a *AdvancedThreatProtectionSetting) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Alert. func (a Alert) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) @@ -658,7 +759,7 @@ func (a *Alert) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AlertEntity. func (a AlertEntity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "type", a.Type) if a.AdditionalProperties != nil { for key, val := range a.AdditionalProperties { @@ -682,10 +783,10 @@ func (a *AlertEntity) UnmarshalJSON(data []byte) error { delete(rawMsg, key) default: if a.AdditionalProperties == nil { - a.AdditionalProperties = map[string]interface{}{} + a.AdditionalProperties = map[string]any{} } if val != nil { - var aux interface{} + var aux any err = json.Unmarshal(val, &aux) a.AdditionalProperties[key] = aux } @@ -700,7 +801,7 @@ func (a *AlertEntity) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AlertList. func (a AlertList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) @@ -731,7 +832,7 @@ func (a *AlertList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AlertProperties. func (a AlertProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "alertDisplayName", a.AlertDisplayName) populate(objectMap, "alertType", a.AlertType) populate(objectMap, "alertUri", a.AlertURI) @@ -862,7 +963,7 @@ func (a *AlertProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AlertPropertiesSupportingEvidence. func (a AlertPropertiesSupportingEvidence) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "type", a.Type) if a.AdditionalProperties != nil { for key, val := range a.AdditionalProperties { @@ -886,10 +987,10 @@ func (a *AlertPropertiesSupportingEvidence) UnmarshalJSON(data []byte) error { delete(rawMsg, key) default: if a.AdditionalProperties == nil { - a.AdditionalProperties = map[string]interface{}{} + a.AdditionalProperties = map[string]any{} } if val != nil { - var aux interface{} + var aux any err = json.Unmarshal(val, &aux) a.AdditionalProperties[key] = aux } @@ -904,7 +1005,7 @@ func (a *AlertPropertiesSupportingEvidence) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AlertSimulatorBundlesRequestProperties. func (a AlertSimulatorBundlesRequestProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "bundles", a.Bundles) objectMap["kind"] = KindBundles if a.AdditionalProperties != nil { @@ -932,10 +1033,10 @@ func (a *AlertSimulatorBundlesRequestProperties) UnmarshalJSON(data []byte) erro delete(rawMsg, key) default: if a.AdditionalProperties == nil { - a.AdditionalProperties = map[string]interface{}{} + a.AdditionalProperties = map[string]any{} } if val != nil { - var aux interface{} + var aux any err = json.Unmarshal(val, &aux) a.AdditionalProperties[key] = aux } @@ -950,7 +1051,7 @@ func (a *AlertSimulatorBundlesRequestProperties) UnmarshalJSON(data []byte) erro // MarshalJSON implements the json.Marshaller interface for type AlertSimulatorRequestBody. func (a AlertSimulatorRequestBody) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "properties", a.Properties) return json.Marshal(objectMap) } @@ -977,7 +1078,7 @@ func (a *AlertSimulatorRequestBody) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AlertSimulatorRequestProperties. func (a AlertSimulatorRequestProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["kind"] = a.Kind if a.AdditionalProperties != nil { for key, val := range a.AdditionalProperties { @@ -1001,10 +1102,10 @@ func (a *AlertSimulatorRequestProperties) UnmarshalJSON(data []byte) error { delete(rawMsg, key) default: if a.AdditionalProperties == nil { - a.AdditionalProperties = map[string]interface{}{} + a.AdditionalProperties = map[string]any{} } if val != nil { - var aux interface{} + var aux any err = json.Unmarshal(val, &aux) a.AdditionalProperties[key] = aux } @@ -1019,7 +1120,7 @@ func (a *AlertSimulatorRequestProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AlertSyncSettingProperties. func (a AlertSyncSettingProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "enabled", a.Enabled) return json.Marshal(objectMap) } @@ -1046,7 +1147,7 @@ func (a *AlertSyncSettingProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AlertSyncSettings. func (a AlertSyncSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) objectMap["kind"] = SettingKindAlertSyncSettings populate(objectMap, "name", a.Name) @@ -1089,7 +1190,7 @@ func (a *AlertSyncSettings) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AlertsSuppressionRule. func (a AlertsSuppressionRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) @@ -1128,7 +1229,7 @@ func (a *AlertsSuppressionRule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AlertsSuppressionRuleProperties. func (a AlertsSuppressionRuleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "alertType", a.AlertType) populate(objectMap, "comment", a.Comment) populateTimeRFC3339(objectMap, "expirationDateUtc", a.ExpirationDateUTC) @@ -1179,7 +1280,7 @@ func (a *AlertsSuppressionRuleProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AlertsSuppressionRulesList. func (a AlertsSuppressionRulesList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) @@ -1210,7 +1311,7 @@ func (a *AlertsSuppressionRulesList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AllowedConnectionsList. func (a AllowedConnectionsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) @@ -1241,7 +1342,7 @@ func (a *AllowedConnectionsList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AllowedConnectionsResource. func (a AllowedConnectionsResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "location", a.Location) populate(objectMap, "name", a.Name) @@ -1284,7 +1385,7 @@ func (a *AllowedConnectionsResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AllowedConnectionsResourceProperties. func (a AllowedConnectionsResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "calculatedDateTime", a.CalculatedDateTime) populate(objectMap, "connectableResources", a.ConnectableResources) return json.Marshal(objectMap) @@ -1315,7 +1416,7 @@ func (a *AllowedConnectionsResourceProperties) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type AllowlistCustomAlertRule. func (a AllowlistCustomAlertRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "allowlistValues", a.AllowlistValues) populate(objectMap, "description", a.Description) populate(objectMap, "displayName", a.DisplayName) @@ -1362,7 +1463,7 @@ func (a *AllowlistCustomAlertRule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AmqpC2DMessagesNotInAllowedRange. func (a AmqpC2DMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", a.Description) populate(objectMap, "displayName", a.DisplayName) populate(objectMap, "isEnabled", a.IsEnabled) @@ -1413,7 +1514,7 @@ func (a *AmqpC2DMessagesNotInAllowedRange) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AmqpC2DRejectedMessagesNotInAllowedRange. func (a AmqpC2DRejectedMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", a.Description) populate(objectMap, "displayName", a.DisplayName) populate(objectMap, "isEnabled", a.IsEnabled) @@ -1464,7 +1565,7 @@ func (a *AmqpC2DRejectedMessagesNotInAllowedRange) UnmarshalJSON(data []byte) er // MarshalJSON implements the json.Marshaller interface for type AmqpD2CMessagesNotInAllowedRange. func (a AmqpD2CMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", a.Description) populate(objectMap, "displayName", a.DisplayName) populate(objectMap, "isEnabled", a.IsEnabled) @@ -1515,7 +1616,7 @@ func (a *AmqpD2CMessagesNotInAllowedRange) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Application. func (a Application) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) @@ -1554,7 +1655,7 @@ func (a *Application) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ApplicationCondition. func (a ApplicationCondition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "operator", a.Operator) populate(objectMap, "property", a.Property) populate(objectMap, "value", a.Value) @@ -1589,7 +1690,7 @@ func (a *ApplicationCondition) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ApplicationProperties. func (a ApplicationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "conditionSets", a.ConditionSets) populate(objectMap, "description", a.Description) populate(objectMap, "displayName", a.DisplayName) @@ -1628,7 +1729,7 @@ func (a *ApplicationProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ApplicationsList. func (a ApplicationsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) @@ -1659,7 +1760,7 @@ func (a *ApplicationsList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AscLocation. func (a AscLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", &a.Properties) @@ -1698,7 +1799,7 @@ func (a *AscLocation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AscLocationList. func (a AscLocationList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) @@ -1729,7 +1830,7 @@ func (a *AscLocationList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Assessment. func (a Assessment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) @@ -1768,7 +1869,7 @@ func (a *Assessment) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssessmentLinks. func (a AssessmentLinks) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "azurePortalUri", a.AzurePortalURI) return json.Marshal(objectMap) } @@ -1795,7 +1896,7 @@ func (a *AssessmentLinks) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssessmentList. func (a AssessmentList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) @@ -1826,7 +1927,7 @@ func (a *AssessmentList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssessmentMetadata. func (a AssessmentMetadata) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) @@ -1865,7 +1966,7 @@ func (a *AssessmentMetadata) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssessmentMetadataPartnerData. func (a AssessmentMetadataPartnerData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "partnerName", a.PartnerName) populate(objectMap, "productName", a.ProductName) populate(objectMap, "secret", a.Secret) @@ -1900,7 +2001,7 @@ func (a *AssessmentMetadataPartnerData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssessmentMetadataProperties. func (a AssessmentMetadataProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "assessmentType", a.AssessmentType) populate(objectMap, "categories", a.Categories) populate(objectMap, "description", a.Description) @@ -1971,7 +2072,7 @@ func (a *AssessmentMetadataProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssessmentMetadataPropertiesResponse. func (a AssessmentMetadataPropertiesResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "assessmentType", a.AssessmentType) populate(objectMap, "categories", a.Categories) populate(objectMap, "description", a.Description) @@ -2058,7 +2159,7 @@ func (a *AssessmentMetadataPropertiesResponse) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type AssessmentMetadataPropertiesResponsePublishDates. func (a AssessmentMetadataPropertiesResponsePublishDates) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "GA", a.GA) populate(objectMap, "public", a.Public) return json.Marshal(objectMap) @@ -2089,7 +2190,7 @@ func (a *AssessmentMetadataPropertiesResponsePublishDates) UnmarshalJSON(data [] // MarshalJSON implements the json.Marshaller interface for type AssessmentMetadataResponse. func (a AssessmentMetadataResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) @@ -2128,7 +2229,7 @@ func (a *AssessmentMetadataResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssessmentMetadataResponseList. func (a AssessmentMetadataResponseList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) @@ -2159,7 +2260,7 @@ func (a *AssessmentMetadataResponseList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssessmentPartnerData. func (a AssessmentPartnerData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "partnerName", a.PartnerName) populate(objectMap, "secret", a.Secret) return json.Marshal(objectMap) @@ -2190,7 +2291,7 @@ func (a *AssessmentPartnerData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssessmentProperties. func (a AssessmentProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "additionalData", a.AdditionalData) populate(objectMap, "displayName", a.DisplayName) populate(objectMap, "links", a.Links) @@ -2241,7 +2342,7 @@ func (a *AssessmentProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssessmentPropertiesBase. func (a AssessmentPropertiesBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "additionalData", a.AdditionalData) populate(objectMap, "displayName", a.DisplayName) populate(objectMap, "links", a.Links) @@ -2288,7 +2389,7 @@ func (a *AssessmentPropertiesBase) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssessmentPropertiesResponse. func (a AssessmentPropertiesResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "additionalData", a.AdditionalData) populate(objectMap, "displayName", a.DisplayName) populate(objectMap, "links", a.Links) @@ -2339,7 +2440,7 @@ func (a *AssessmentPropertiesResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssessmentResponse. func (a AssessmentResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) @@ -2378,7 +2479,7 @@ func (a *AssessmentResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssessmentStatus. func (a AssessmentStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "cause", a.Cause) populate(objectMap, "code", a.Code) populate(objectMap, "description", a.Description) @@ -2413,7 +2514,7 @@ func (a *AssessmentStatus) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AssessmentStatusResponse. func (a AssessmentStatusResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "cause", a.Cause) populate(objectMap, "code", a.Code) populate(objectMap, "description", a.Description) @@ -2456,7 +2557,7 @@ func (a *AssessmentStatusResponse) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AtaExternalSecuritySolution. func (a AtaExternalSecuritySolution) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "kind", a.Kind) populate(objectMap, "location", a.Location) @@ -2503,7 +2604,7 @@ func (a *AtaExternalSecuritySolution) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AtaSolutionProperties. func (a AtaSolutionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "deviceType", a.DeviceType) populate(objectMap, "deviceVendor", a.DeviceVendor) populate(objectMap, "lastEventReceived", a.LastEventReceived) @@ -2539,10 +2640,10 @@ func (a *AtaSolutionProperties) UnmarshalJSON(data []byte) error { delete(rawMsg, key) default: if a.AdditionalProperties == nil { - a.AdditionalProperties = map[string]interface{}{} + a.AdditionalProperties = map[string]any{} } if val != nil { - var aux interface{} + var aux any err = json.Unmarshal(val, &aux) a.AdditionalProperties[key] = aux } @@ -2557,7 +2658,7 @@ func (a *AtaSolutionProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AuthenticationDetailsProperties. func (a AuthenticationDetailsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "authenticationProvisioningState", a.AuthenticationProvisioningState) objectMap["authenticationType"] = a.AuthenticationType populate(objectMap, "grantedPermissions", a.GrantedPermissions) @@ -2592,7 +2693,7 @@ func (a *AuthenticationDetailsProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AutoProvisioningSetting. func (a AutoProvisioningSetting) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) @@ -2631,7 +2732,7 @@ func (a *AutoProvisioningSetting) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AutoProvisioningSettingList. func (a AutoProvisioningSettingList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) @@ -2662,7 +2763,7 @@ func (a *AutoProvisioningSettingList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AutoProvisioningSettingProperties. func (a AutoProvisioningSettingProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "autoProvision", a.AutoProvision) return json.Marshal(objectMap) } @@ -2689,7 +2790,7 @@ func (a *AutoProvisioningSettingProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Automation. func (a Automation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "etag", a.Etag) populate(objectMap, "id", a.ID) populate(objectMap, "kind", a.Kind) @@ -2744,7 +2845,7 @@ func (a *Automation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AutomationAction. func (a AutomationAction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["actionType"] = a.ActionType return json.Marshal(objectMap) } @@ -2771,7 +2872,7 @@ func (a *AutomationAction) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AutomationActionEventHub. func (a AutomationActionEventHub) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["actionType"] = ActionTypeEventHub populate(objectMap, "connectionString", a.ConnectionString) populate(objectMap, "eventHubResourceId", a.EventHubResourceID) @@ -2810,7 +2911,7 @@ func (a *AutomationActionEventHub) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AutomationActionLogicApp. func (a AutomationActionLogicApp) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["actionType"] = ActionTypeLogicApp populate(objectMap, "logicAppResourceId", a.LogicAppResourceID) populate(objectMap, "uri", a.URI) @@ -2845,7 +2946,7 @@ func (a *AutomationActionLogicApp) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AutomationActionWorkspace. func (a AutomationActionWorkspace) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["actionType"] = ActionTypeWorkspace populate(objectMap, "workspaceResourceId", a.WorkspaceResourceID) return json.Marshal(objectMap) @@ -2876,7 +2977,7 @@ func (a *AutomationActionWorkspace) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AutomationList. func (a AutomationList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", a.NextLink) populate(objectMap, "value", a.Value) return json.Marshal(objectMap) @@ -2907,7 +3008,7 @@ func (a *AutomationList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AutomationProperties. func (a AutomationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "actions", a.Actions) populate(objectMap, "description", a.Description) populate(objectMap, "isEnabled", a.IsEnabled) @@ -2950,7 +3051,7 @@ func (a *AutomationProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AutomationRuleSet. func (a AutomationRuleSet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "rules", a.Rules) return json.Marshal(objectMap) } @@ -2977,7 +3078,7 @@ func (a *AutomationRuleSet) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AutomationScope. func (a AutomationScope) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", a.Description) populate(objectMap, "scopePath", a.ScopePath) return json.Marshal(objectMap) @@ -3008,7 +3109,7 @@ func (a *AutomationScope) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AutomationSource. func (a AutomationSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "eventSource", a.EventSource) populate(objectMap, "ruleSets", a.RuleSets) return json.Marshal(objectMap) @@ -3039,7 +3140,7 @@ func (a *AutomationSource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AutomationTriggeringRule. func (a AutomationTriggeringRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "expectedValue", a.ExpectedValue) populate(objectMap, "operator", a.Operator) populate(objectMap, "propertyJPath", a.PropertyJPath) @@ -3078,7 +3179,7 @@ func (a *AutomationTriggeringRule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AutomationValidationStatus. func (a AutomationValidationStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "isValid", a.IsValid) populate(objectMap, "message", a.Message) return json.Marshal(objectMap) @@ -3109,7 +3210,7 @@ func (a *AutomationValidationStatus) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AwAssumeRoleAuthenticationDetailsProperties. func (a AwAssumeRoleAuthenticationDetailsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "accountId", a.AccountID) populate(objectMap, "authenticationProvisioningState", a.AuthenticationProvisioningState) objectMap["authenticationType"] = AuthenticationTypeAwsAssumeRole @@ -3156,7 +3257,7 @@ func (a *AwAssumeRoleAuthenticationDetailsProperties) UnmarshalJSON(data []byte) // MarshalJSON implements the json.Marshaller interface for type AwsCredsAuthenticationDetailsProperties. func (a AwsCredsAuthenticationDetailsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "accountId", a.AccountID) populate(objectMap, "authenticationProvisioningState", a.AuthenticationProvisioningState) objectMap["authenticationType"] = AuthenticationTypeAwsCreds @@ -3203,7 +3304,7 @@ func (a *AwsCredsAuthenticationDetailsProperties) UnmarshalJSON(data []byte) err // MarshalJSON implements the json.Marshaller interface for type AwsEnvironmentData. func (a AwsEnvironmentData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["environmentType"] = EnvironmentTypeAwsAccount populate(objectMap, "organizationalData", a.OrganizationalData) return json.Marshal(objectMap) @@ -3234,7 +3335,7 @@ func (a *AwsEnvironmentData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AwsOrganizationalData. func (a AwsOrganizationalData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["organizationMembershipType"] = a.OrganizationMembershipType return json.Marshal(objectMap) } @@ -3261,7 +3362,7 @@ func (a *AwsOrganizationalData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AwsOrganizationalDataMaster. func (a AwsOrganizationalDataMaster) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "excludedAccountIds", a.ExcludedAccountIDs) objectMap["organizationMembershipType"] = OrganizationMembershipTypeOrganization populate(objectMap, "stacksetName", a.StacksetName) @@ -3296,7 +3397,7 @@ func (a *AwsOrganizationalDataMaster) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AwsOrganizationalDataMember. func (a AwsOrganizationalDataMember) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["organizationMembershipType"] = OrganizationMembershipTypeMember populate(objectMap, "parentHierarchyId", a.ParentHierarchyID) return json.Marshal(objectMap) @@ -3327,7 +3428,7 @@ func (a *AwsOrganizationalDataMember) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureDevOpsScopeEnvironmentData. func (a AzureDevOpsScopeEnvironmentData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["environmentType"] = EnvironmentTypeAzureDevOpsScope return json.Marshal(objectMap) } @@ -3354,7 +3455,7 @@ func (a *AzureDevOpsScopeEnvironmentData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureResourceDetails. func (a AzureResourceDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) objectMap["source"] = SourceAzure return json.Marshal(objectMap) @@ -3385,7 +3486,7 @@ func (a *AzureResourceDetails) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureResourceIdentifier. func (a AzureResourceIdentifier) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "azureResourceId", a.AzureResourceID) objectMap["type"] = ResourceIdentifierTypeAzureResource return json.Marshal(objectMap) @@ -3416,7 +3517,7 @@ func (a *AzureResourceIdentifier) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureResourceLink. func (a AzureResourceLink) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", a.ID) return json.Marshal(objectMap) } @@ -3443,7 +3544,7 @@ func (a *AzureResourceLink) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureTrackedResourceLocation. func (a AzureTrackedResourceLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "location", a.Location) return json.Marshal(objectMap) } @@ -3470,7 +3571,7 @@ func (a *AzureTrackedResourceLocation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Baseline. func (b Baseline) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "expectedResults", b.ExpectedResults) populateTimeRFC3339(objectMap, "updatedTime", b.UpdatedTime) return json.Marshal(objectMap) @@ -3501,7 +3602,7 @@ func (b *Baseline) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type BaselineAdjustedResult. func (b BaselineAdjustedResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "baseline", b.Baseline) populate(objectMap, "resultsNotInBaseline", b.ResultsNotInBaseline) populate(objectMap, "resultsOnlyInBaseline", b.ResultsOnlyInBaseline) @@ -3540,7 +3641,7 @@ func (b *BaselineAdjustedResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type BenchmarkReference. func (b BenchmarkReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "benchmark", b.Benchmark) populate(objectMap, "reference", b.Reference) return json.Marshal(objectMap) @@ -3571,7 +3672,7 @@ func (b *BenchmarkReference) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CVE. func (c CVE) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "link", c.Link) populate(objectMap, "title", c.Title) return json.Marshal(objectMap) @@ -3602,7 +3703,7 @@ func (c *CVE) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CVSS. func (c CVSS) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "base", c.Base) return json.Marshal(objectMap) } @@ -3629,7 +3730,7 @@ func (c *CVSS) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CefExternalSecuritySolution. func (c CefExternalSecuritySolution) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "kind", c.Kind) populate(objectMap, "location", c.Location) @@ -3676,7 +3777,7 @@ func (c *CefExternalSecuritySolution) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CefSolutionProperties. func (c CefSolutionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "agent", c.Agent) populate(objectMap, "deviceType", c.DeviceType) populate(objectMap, "deviceVendor", c.DeviceVendor) @@ -3720,10 +3821,10 @@ func (c *CefSolutionProperties) UnmarshalJSON(data []byte) error { delete(rawMsg, key) default: if c.AdditionalProperties == nil { - c.AdditionalProperties = map[string]interface{}{} + c.AdditionalProperties = map[string]any{} } if val != nil { - var aux interface{} + var aux any err = json.Unmarshal(val, &aux) c.AdditionalProperties[key] = aux } @@ -3738,7 +3839,7 @@ func (c *CefSolutionProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CloudOffering. func (c CloudOffering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", c.Description) objectMap["offeringType"] = c.OfferingType return json.Marshal(objectMap) @@ -3769,7 +3870,7 @@ func (c *CloudOffering) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Compliance. func (c Compliance) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) @@ -3808,7 +3909,7 @@ func (c *Compliance) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ComplianceList. func (c ComplianceList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", c.NextLink) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) @@ -3839,7 +3940,7 @@ func (c *ComplianceList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ComplianceProperties. func (c ComplianceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "assessmentResult", c.AssessmentResult) populateTimeRFC3339(objectMap, "assessmentTimestampUtcDate", c.AssessmentTimestampUTCDate) populate(objectMap, "resourceCount", c.ResourceCount) @@ -3874,7 +3975,7 @@ func (c *ComplianceProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ComplianceResult. func (c ComplianceResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) @@ -3913,7 +4014,7 @@ func (c *ComplianceResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ComplianceResultList. func (c ComplianceResultList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", c.NextLink) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) @@ -3944,7 +4045,7 @@ func (c *ComplianceResultList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ComplianceResultProperties. func (c ComplianceResultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "resourceStatus", c.ResourceStatus) return json.Marshal(objectMap) } @@ -3971,7 +4072,7 @@ func (c *ComplianceResultProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ComplianceSegment. func (c ComplianceSegment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "percentage", c.Percentage) populate(objectMap, "segmentType", c.SegmentType) return json.Marshal(objectMap) @@ -4002,7 +4103,7 @@ func (c *ComplianceSegment) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Condition. func (c Condition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "operator", c.Operator) populate(objectMap, "property", c.Property) populate(objectMap, "value", c.Value) @@ -4037,7 +4138,7 @@ func (c *Condition) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ConnectableResource. func (c ConnectableResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "inboundConnectedResources", c.InboundConnectedResources) populate(objectMap, "outboundConnectedResources", c.OutboundConnectedResources) @@ -4072,7 +4173,7 @@ func (c *ConnectableResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ConnectedResource. func (c ConnectedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "connectedResourceId", c.ConnectedResourceID) populate(objectMap, "tcpPorts", c.TCPPorts) populate(objectMap, "udpPorts", c.UDPPorts) @@ -4107,7 +4208,7 @@ func (c *ConnectedResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ConnectedWorkspace. func (c ConnectedWorkspace) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", c.ID) return json.Marshal(objectMap) } @@ -4134,7 +4235,7 @@ func (c *ConnectedWorkspace) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ConnectionFromIPNotAllowed. func (c ConnectionFromIPNotAllowed) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "allowlistValues", c.AllowlistValues) populate(objectMap, "description", c.Description) populate(objectMap, "displayName", c.DisplayName) @@ -4181,7 +4282,7 @@ func (c *ConnectionFromIPNotAllowed) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ConnectionStrings. func (c ConnectionStrings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } @@ -4208,7 +4309,7 @@ func (c *ConnectionStrings) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ConnectionToIPNotAllowed. func (c ConnectionToIPNotAllowed) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "allowlistValues", c.AllowlistValues) populate(objectMap, "description", c.Description) populate(objectMap, "displayName", c.DisplayName) @@ -4255,7 +4356,7 @@ func (c *ConnectionToIPNotAllowed) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Connector. func (c Connector) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "etag", c.Etag) populate(objectMap, "id", c.ID) populate(objectMap, "kind", c.Kind) @@ -4314,7 +4415,7 @@ func (c *Connector) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ConnectorProperties. func (c ConnectorProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "environmentData", c.EnvironmentData) populate(objectMap, "environmentName", c.EnvironmentName) populate(objectMap, "hierarchyIdentifier", c.HierarchyIdentifier) @@ -4357,7 +4458,7 @@ func (c *ConnectorProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ConnectorSetting. func (c ConnectorSetting) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) @@ -4396,7 +4497,7 @@ func (c *ConnectorSetting) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ConnectorSettingList. func (c ConnectorSettingList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", c.NextLink) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) @@ -4427,7 +4528,7 @@ func (c *ConnectorSettingList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ConnectorSettingProperties. func (c ConnectorSettingProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "authenticationDetails", c.AuthenticationDetails) populate(objectMap, "hybridComputeSettings", c.HybridComputeSettings) return json.Marshal(objectMap) @@ -4458,7 +4559,7 @@ func (c *ConnectorSettingProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ConnectorsList. func (c ConnectorsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", c.NextLink) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) @@ -4489,7 +4590,7 @@ func (c *ConnectorsList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Contact. func (c Contact) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) @@ -4528,7 +4629,7 @@ func (c *Contact) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContactList. func (c ContactList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", c.NextLink) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) @@ -4559,7 +4660,7 @@ func (c *ContactList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContactProperties. func (c ContactProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "alertNotifications", c.AlertNotifications) populate(objectMap, "emails", c.Emails) populate(objectMap, "notificationsByRole", c.NotificationsByRole) @@ -4598,7 +4699,7 @@ func (c *ContactProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContactPropertiesAlertNotifications. func (c ContactPropertiesAlertNotifications) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "minimalSeverity", c.MinimalSeverity) populate(objectMap, "state", c.State) return json.Marshal(objectMap) @@ -4629,7 +4730,7 @@ func (c *ContactPropertiesAlertNotifications) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ContactPropertiesNotificationsByRole. func (c ContactPropertiesNotificationsByRole) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "roles", c.Roles) populate(objectMap, "state", c.State) return json.Marshal(objectMap) @@ -4660,7 +4761,7 @@ func (c *ContactPropertiesNotificationsByRole) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type ContainerRegistryVulnerabilityProperties. func (c ContainerRegistryVulnerabilityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["assessedResourceType"] = AssessedResourceTypeContainerRegistryVulnerability populate(objectMap, "cve", c.Cve) populate(objectMap, "cvss", c.Cvss) @@ -4719,7 +4820,7 @@ func (c *ContainerRegistryVulnerabilityProperties) UnmarshalJSON(data []byte) er // MarshalJSON implements the json.Marshaller interface for type CspmMonitorAwsOffering. func (c CspmMonitorAwsOffering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", c.Description) populate(objectMap, "nativeCloudConnection", c.NativeCloudConnection) objectMap["offeringType"] = OfferingTypeCspmMonitorAws @@ -4754,7 +4855,7 @@ func (c *CspmMonitorAwsOffering) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CspmMonitorAwsOfferingNativeCloudConnection. func (c CspmMonitorAwsOfferingNativeCloudConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "cloudRoleArn", c.CloudRoleArn) return json.Marshal(objectMap) } @@ -4781,7 +4882,7 @@ func (c *CspmMonitorAwsOfferingNativeCloudConnection) UnmarshalJSON(data []byte) // MarshalJSON implements the json.Marshaller interface for type CspmMonitorAzureDevOpsOffering. func (c CspmMonitorAzureDevOpsOffering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", c.Description) objectMap["offeringType"] = OfferingTypeCspmMonitorAzureDevOps return json.Marshal(objectMap) @@ -4812,7 +4913,7 @@ func (c *CspmMonitorAzureDevOpsOffering) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CspmMonitorGcpOffering. func (c CspmMonitorGcpOffering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", c.Description) populate(objectMap, "nativeCloudConnection", c.NativeCloudConnection) objectMap["offeringType"] = OfferingTypeCspmMonitorGcp @@ -4847,7 +4948,7 @@ func (c *CspmMonitorGcpOffering) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CspmMonitorGcpOfferingNativeCloudConnection. func (c CspmMonitorGcpOfferingNativeCloudConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "serviceAccountEmailAddress", c.ServiceAccountEmailAddress) populate(objectMap, "workloadIdentityProviderId", c.WorkloadIdentityProviderID) return json.Marshal(objectMap) @@ -4878,7 +4979,7 @@ func (c *CspmMonitorGcpOfferingNativeCloudConnection) UnmarshalJSON(data []byte) // MarshalJSON implements the json.Marshaller interface for type CspmMonitorGithubOffering. func (c CspmMonitorGithubOffering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", c.Description) objectMap["offeringType"] = OfferingTypeCspmMonitorGithub return json.Marshal(objectMap) @@ -4909,7 +5010,7 @@ func (c *CspmMonitorGithubOffering) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CustomAlertRule. func (c CustomAlertRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", c.Description) populate(objectMap, "displayName", c.DisplayName) populate(objectMap, "isEnabled", c.IsEnabled) @@ -4948,7 +5049,7 @@ func (c *CustomAlertRule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CustomAssessmentAutomation. func (c CustomAssessmentAutomation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) @@ -4991,7 +5092,7 @@ func (c *CustomAssessmentAutomation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CustomAssessmentAutomationProperties. func (c CustomAssessmentAutomationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "assessmentKey", c.AssessmentKey) populate(objectMap, "compressedQuery", c.CompressedQuery) populate(objectMap, "description", c.Description) @@ -5048,7 +5149,7 @@ func (c *CustomAssessmentAutomationProperties) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type CustomAssessmentAutomationRequest. func (c CustomAssessmentAutomationRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) @@ -5087,7 +5188,7 @@ func (c *CustomAssessmentAutomationRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CustomAssessmentAutomationRequestProperties. func (c CustomAssessmentAutomationRequestProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "compressedQuery", c.CompressedQuery) populate(objectMap, "description", c.Description) populate(objectMap, "displayName", c.DisplayName) @@ -5140,7 +5241,7 @@ func (c *CustomAssessmentAutomationRequestProperties) UnmarshalJSON(data []byte) // MarshalJSON implements the json.Marshaller interface for type CustomAssessmentAutomationsListResult. func (c CustomAssessmentAutomationsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", c.NextLink) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) @@ -5171,7 +5272,7 @@ func (c *CustomAssessmentAutomationsListResult) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type CustomEntityStoreAssignment. func (c CustomEntityStoreAssignment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", c.ID) populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) @@ -5214,7 +5315,7 @@ func (c *CustomEntityStoreAssignment) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CustomEntityStoreAssignmentProperties. func (c CustomEntityStoreAssignmentProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "entityStoreDatabaseLink", c.EntityStoreDatabaseLink) populate(objectMap, "principal", c.Principal) return json.Marshal(objectMap) @@ -5245,7 +5346,7 @@ func (c *CustomEntityStoreAssignmentProperties) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type CustomEntityStoreAssignmentRequest. func (c CustomEntityStoreAssignmentRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "properties", c.Properties) return json.Marshal(objectMap) } @@ -5272,7 +5373,7 @@ func (c *CustomEntityStoreAssignmentRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type CustomEntityStoreAssignmentRequestProperties. func (c CustomEntityStoreAssignmentRequestProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "principal", c.Principal) return json.Marshal(objectMap) } @@ -5299,7 +5400,7 @@ func (c *CustomEntityStoreAssignmentRequestProperties) UnmarshalJSON(data []byte // MarshalJSON implements the json.Marshaller interface for type CustomEntityStoreAssignmentsListResult. func (c CustomEntityStoreAssignmentsListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", c.NextLink) populate(objectMap, "value", c.Value) return json.Marshal(objectMap) @@ -5330,7 +5431,7 @@ func (c *CustomEntityStoreAssignmentsListResult) UnmarshalJSON(data []byte) erro // MarshalJSON implements the json.Marshaller interface for type DataExportSettingProperties. func (d DataExportSettingProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } @@ -5357,7 +5458,7 @@ func (d *DataExportSettingProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DataExportSettings. func (d DataExportSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", d.ID) objectMap["kind"] = SettingKindDataExportSettings populate(objectMap, "name", d.Name) @@ -5400,7 +5501,7 @@ func (d *DataExportSettings) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DefenderCspmAwsOffering. func (d DefenderCspmAwsOffering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", d.Description) objectMap["offeringType"] = OfferingTypeDefenderCspmAws populate(objectMap, "vmScanners", d.VMScanners) @@ -5435,7 +5536,7 @@ func (d *DefenderCspmAwsOffering) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DefenderCspmAwsOfferingVMScanners. func (d DefenderCspmAwsOfferingVMScanners) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "configuration", d.Configuration) populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) @@ -5466,7 +5567,7 @@ func (d *DefenderCspmAwsOfferingVMScanners) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DefenderCspmAwsOfferingVMScannersConfiguration. func (d DefenderCspmAwsOfferingVMScannersConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) populate(objectMap, "exclusionTags", d.ExclusionTags) populate(objectMap, "scanningMode", d.ScanningMode) @@ -5501,7 +5602,7 @@ func (d *DefenderCspmAwsOfferingVMScannersConfiguration) UnmarshalJSON(data []by // MarshalJSON implements the json.Marshaller interface for type DefenderCspmGcpOffering. func (d DefenderCspmGcpOffering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", d.Description) objectMap["offeringType"] = OfferingTypeDefenderCspmGcp return json.Marshal(objectMap) @@ -5532,7 +5633,7 @@ func (d *DefenderCspmGcpOffering) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DefenderFoDatabasesAwsOffering. func (d DefenderFoDatabasesAwsOffering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "arcAutoProvisioning", d.ArcAutoProvisioning) populate(objectMap, "description", d.Description) objectMap["offeringType"] = OfferingTypeDefenderForDatabasesAws @@ -5571,7 +5672,7 @@ func (d *DefenderFoDatabasesAwsOffering) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DefenderFoDatabasesAwsOfferingArcAutoProvisioning. func (d DefenderFoDatabasesAwsOfferingArcAutoProvisioning) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) @@ -5602,7 +5703,7 @@ func (d *DefenderFoDatabasesAwsOfferingArcAutoProvisioning) UnmarshalJSON(data [ // MarshalJSON implements the json.Marshaller interface for type DefenderFoDatabasesAwsOfferingRds. func (d DefenderFoDatabasesAwsOfferingRds) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) @@ -5633,7 +5734,7 @@ func (d *DefenderFoDatabasesAwsOfferingRds) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DefenderForContainersAwsOffering. func (d DefenderForContainersAwsOffering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "autoProvisioning", d.AutoProvisioning) populate(objectMap, "cloudWatchToKinesis", d.CloudWatchToKinesis) populate(objectMap, "containerVulnerabilityAssessment", d.ContainerVulnerabilityAssessment) @@ -5704,7 +5805,7 @@ func (d *DefenderForContainersAwsOffering) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DefenderForContainersAwsOfferingCloudWatchToKinesis. func (d DefenderForContainersAwsOfferingCloudWatchToKinesis) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) return json.Marshal(objectMap) } @@ -5731,7 +5832,7 @@ func (d *DefenderForContainersAwsOfferingCloudWatchToKinesis) UnmarshalJSON(data // MarshalJSON implements the json.Marshaller interface for type DefenderForContainersAwsOfferingContainerVulnerabilityAssessment. func (d DefenderForContainersAwsOfferingContainerVulnerabilityAssessment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) return json.Marshal(objectMap) } @@ -5758,7 +5859,7 @@ func (d *DefenderForContainersAwsOfferingContainerVulnerabilityAssessment) Unmar // MarshalJSON implements the json.Marshaller interface for type DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask. func (d DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) return json.Marshal(objectMap) } @@ -5785,7 +5886,7 @@ func (d *DefenderForContainersAwsOfferingContainerVulnerabilityAssessmentTask) U // MarshalJSON implements the json.Marshaller interface for type DefenderForContainersAwsOfferingKinesisToS3. func (d DefenderForContainersAwsOfferingKinesisToS3) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) return json.Marshal(objectMap) } @@ -5812,7 +5913,7 @@ func (d *DefenderForContainersAwsOfferingKinesisToS3) UnmarshalJSON(data []byte) // MarshalJSON implements the json.Marshaller interface for type DefenderForContainersAwsOfferingKubernetesScubaReader. func (d DefenderForContainersAwsOfferingKubernetesScubaReader) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) return json.Marshal(objectMap) } @@ -5839,7 +5940,7 @@ func (d *DefenderForContainersAwsOfferingKubernetesScubaReader) UnmarshalJSON(da // MarshalJSON implements the json.Marshaller interface for type DefenderForContainersAwsOfferingKubernetesService. func (d DefenderForContainersAwsOfferingKubernetesService) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) return json.Marshal(objectMap) } @@ -5866,7 +5967,7 @@ func (d *DefenderForContainersAwsOfferingKubernetesService) UnmarshalJSON(data [ // MarshalJSON implements the json.Marshaller interface for type DefenderForContainersGcpOffering. func (d DefenderForContainersGcpOffering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "auditLogsAutoProvisioningFlag", d.AuditLogsAutoProvisioningFlag) populate(objectMap, "dataPipelineNativeCloudConnection", d.DataPipelineNativeCloudConnection) populate(objectMap, "defenderAgentAutoProvisioningFlag", d.DefenderAgentAutoProvisioningFlag) @@ -5917,7 +6018,7 @@ func (d *DefenderForContainersGcpOffering) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection. func (d DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "serviceAccountEmailAddress", d.ServiceAccountEmailAddress) populate(objectMap, "workloadIdentityProviderId", d.WorkloadIdentityProviderID) return json.Marshal(objectMap) @@ -5948,7 +6049,7 @@ func (d *DefenderForContainersGcpOfferingDataPipelineNativeCloudConnection) Unma // MarshalJSON implements the json.Marshaller interface for type DefenderForContainersGcpOfferingNativeCloudConnection. func (d DefenderForContainersGcpOfferingNativeCloudConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "serviceAccountEmailAddress", d.ServiceAccountEmailAddress) populate(objectMap, "workloadIdentityProviderId", d.WorkloadIdentityProviderID) return json.Marshal(objectMap) @@ -5979,7 +6080,7 @@ func (d *DefenderForContainersGcpOfferingNativeCloudConnection) UnmarshalJSON(da // MarshalJSON implements the json.Marshaller interface for type DefenderForDatabasesGcpOffering. func (d DefenderForDatabasesGcpOffering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "arcAutoProvisioning", d.ArcAutoProvisioning) populate(objectMap, "defenderForDatabasesArcAutoProvisioning", d.DefenderForDatabasesArcAutoProvisioning) populate(objectMap, "description", d.Description) @@ -6018,7 +6119,7 @@ func (d *DefenderForDatabasesGcpOffering) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DefenderForDatabasesGcpOfferingArcAutoProvisioning. func (d DefenderForDatabasesGcpOfferingArcAutoProvisioning) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } @@ -6045,7 +6146,7 @@ func (d *DefenderForDatabasesGcpOfferingArcAutoProvisioning) UnmarshalJSON(data // MarshalJSON implements the json.Marshaller interface for type DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning. func (d DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "serviceAccountEmailAddress", d.ServiceAccountEmailAddress) populate(objectMap, "workloadIdentityProviderId", d.WorkloadIdentityProviderID) return json.Marshal(objectMap) @@ -6076,7 +6177,7 @@ func (d *DefenderForDatabasesGcpOfferingDefenderForDatabasesArcAutoProvisioning) // MarshalJSON implements the json.Marshaller interface for type DefenderForDevOpsAzureDevOpsOffering. func (d DefenderForDevOpsAzureDevOpsOffering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", d.Description) objectMap["offeringType"] = OfferingTypeDefenderForDevOpsAzureDevOps return json.Marshal(objectMap) @@ -6107,7 +6208,7 @@ func (d *DefenderForDevOpsAzureDevOpsOffering) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type DefenderForDevOpsGithubOffering. func (d DefenderForDevOpsGithubOffering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", d.Description) objectMap["offeringType"] = OfferingTypeDefenderForDevOpsGithub return json.Marshal(objectMap) @@ -6138,7 +6239,7 @@ func (d *DefenderForDevOpsGithubOffering) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOffering. func (d DefenderForServersAwsOffering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "arcAutoProvisioning", d.ArcAutoProvisioning) populate(objectMap, "defenderForServers", d.DefenderForServers) populate(objectMap, "description", d.Description) @@ -6193,7 +6294,7 @@ func (d *DefenderForServersAwsOffering) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingArcAutoProvisioning. func (d DefenderForServersAwsOfferingArcAutoProvisioning) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) @@ -6224,7 +6325,7 @@ func (d *DefenderForServersAwsOfferingArcAutoProvisioning) UnmarshalJSON(data [] // MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingDefenderForServers. func (d DefenderForServersAwsOfferingDefenderForServers) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) return json.Marshal(objectMap) } @@ -6251,7 +6352,7 @@ func (d *DefenderForServersAwsOfferingDefenderForServers) UnmarshalJSON(data []b // MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingMdeAutoProvisioning. func (d DefenderForServersAwsOfferingMdeAutoProvisioning) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "configuration", &d.Configuration) populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) @@ -6282,7 +6383,7 @@ func (d *DefenderForServersAwsOfferingMdeAutoProvisioning) UnmarshalJSON(data [] // MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingSubPlan. func (d DefenderForServersAwsOfferingSubPlan) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } @@ -6309,7 +6410,7 @@ func (d *DefenderForServersAwsOfferingSubPlan) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingVMScanners. func (d DefenderForServersAwsOfferingVMScanners) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "configuration", d.Configuration) populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) @@ -6340,7 +6441,7 @@ func (d *DefenderForServersAwsOfferingVMScanners) UnmarshalJSON(data []byte) err // MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingVMScannersConfiguration. func (d DefenderForServersAwsOfferingVMScannersConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "cloudRoleArn", d.CloudRoleArn) populate(objectMap, "exclusionTags", d.ExclusionTags) populate(objectMap, "scanningMode", d.ScanningMode) @@ -6375,7 +6476,7 @@ func (d *DefenderForServersAwsOfferingVMScannersConfiguration) UnmarshalJSON(dat // MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingVaAutoProvisioning. func (d DefenderForServersAwsOfferingVaAutoProvisioning) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "configuration", d.Configuration) populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) @@ -6406,7 +6507,7 @@ func (d *DefenderForServersAwsOfferingVaAutoProvisioning) UnmarshalJSON(data []b // MarshalJSON implements the json.Marshaller interface for type DefenderForServersAwsOfferingVaAutoProvisioningConfiguration. func (d DefenderForServersAwsOfferingVaAutoProvisioningConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } @@ -6433,7 +6534,7 @@ func (d *DefenderForServersAwsOfferingVaAutoProvisioningConfiguration) Unmarshal // MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOffering. func (d DefenderForServersGcpOffering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "arcAutoProvisioning", d.ArcAutoProvisioning) populate(objectMap, "defenderForServers", d.DefenderForServers) populate(objectMap, "description", d.Description) @@ -6484,7 +6585,7 @@ func (d *DefenderForServersGcpOffering) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingArcAutoProvisioning. func (d DefenderForServersGcpOfferingArcAutoProvisioning) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) } @@ -6511,7 +6612,7 @@ func (d *DefenderForServersGcpOfferingArcAutoProvisioning) UnmarshalJSON(data [] // MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingDefenderForServers. func (d DefenderForServersGcpOfferingDefenderForServers) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "serviceAccountEmailAddress", d.ServiceAccountEmailAddress) populate(objectMap, "workloadIdentityProviderId", d.WorkloadIdentityProviderID) return json.Marshal(objectMap) @@ -6542,7 +6643,7 @@ func (d *DefenderForServersGcpOfferingDefenderForServers) UnmarshalJSON(data []b // MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingMdeAutoProvisioning. func (d DefenderForServersGcpOfferingMdeAutoProvisioning) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "configuration", &d.Configuration) populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) @@ -6573,7 +6674,7 @@ func (d *DefenderForServersGcpOfferingMdeAutoProvisioning) UnmarshalJSON(data [] // MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingSubPlan. func (d DefenderForServersGcpOfferingSubPlan) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } @@ -6600,7 +6701,7 @@ func (d *DefenderForServersGcpOfferingSubPlan) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingVaAutoProvisioning. func (d DefenderForServersGcpOfferingVaAutoProvisioning) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "configuration", d.Configuration) populate(objectMap, "enabled", d.Enabled) return json.Marshal(objectMap) @@ -6631,7 +6732,7 @@ func (d *DefenderForServersGcpOfferingVaAutoProvisioning) UnmarshalJSON(data []b // MarshalJSON implements the json.Marshaller interface for type DefenderForServersGcpOfferingVaAutoProvisioningConfiguration. func (d DefenderForServersGcpOfferingVaAutoProvisioningConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "type", d.Type) return json.Marshal(objectMap) } @@ -6658,7 +6759,7 @@ func (d *DefenderForServersGcpOfferingVaAutoProvisioningConfiguration) Unmarshal // MarshalJSON implements the json.Marshaller interface for type DenylistCustomAlertRule. func (d DenylistCustomAlertRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "denylistValues", d.DenylistValues) populate(objectMap, "description", d.Description) populate(objectMap, "displayName", d.DisplayName) @@ -6705,7 +6806,7 @@ func (d *DenylistCustomAlertRule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DeviceSecurityGroup. func (d DeviceSecurityGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", d.ID) populate(objectMap, "name", d.Name) populate(objectMap, "properties", d.Properties) @@ -6744,7 +6845,7 @@ func (d *DeviceSecurityGroup) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DeviceSecurityGroupList. func (d DeviceSecurityGroupList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", d.NextLink) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) @@ -6775,7 +6876,7 @@ func (d *DeviceSecurityGroupList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DeviceSecurityGroupProperties. func (d DeviceSecurityGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "allowlistRules", d.AllowlistRules) populate(objectMap, "denylistRules", d.DenylistRules) populate(objectMap, "thresholdRules", d.ThresholdRules) @@ -6814,7 +6915,7 @@ func (d *DeviceSecurityGroupProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DirectMethodInvokesNotInAllowedRange. func (d DirectMethodInvokesNotInAllowedRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", d.Description) populate(objectMap, "displayName", d.DisplayName) populate(objectMap, "isEnabled", d.IsEnabled) @@ -6865,7 +6966,7 @@ func (d *DirectMethodInvokesNotInAllowedRange) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type DiscoveredSecuritySolution. func (d DiscoveredSecuritySolution) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", d.ID) populate(objectMap, "location", d.Location) populate(objectMap, "name", d.Name) @@ -6908,7 +7009,7 @@ func (d *DiscoveredSecuritySolution) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DiscoveredSecuritySolutionList. func (d DiscoveredSecuritySolutionList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", d.NextLink) populate(objectMap, "value", d.Value) return json.Marshal(objectMap) @@ -6939,7 +7040,7 @@ func (d *DiscoveredSecuritySolutionList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type DiscoveredSecuritySolutionProperties. func (d DiscoveredSecuritySolutionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "offer", d.Offer) populate(objectMap, "publisher", d.Publisher) populate(objectMap, "sku", d.SKU) @@ -6978,7 +7079,7 @@ func (d *DiscoveredSecuritySolutionProperties) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type ETag. func (e ETag) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "etag", e.Etag) return json.Marshal(objectMap) } @@ -7005,7 +7106,7 @@ func (e *ETag) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EffectiveNetworkSecurityGroups. func (e EffectiveNetworkSecurityGroups) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "networkInterface", e.NetworkInterface) populate(objectMap, "networkSecurityGroups", e.NetworkSecurityGroups) return json.Marshal(objectMap) @@ -7036,7 +7137,7 @@ func (e *EffectiveNetworkSecurityGroups) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type EnvironmentData. func (e EnvironmentData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["environmentType"] = e.EnvironmentType return json.Marshal(objectMap) } @@ -7063,7 +7164,7 @@ func (e *EnvironmentData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ErrorAdditionalInfo. func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "info", &e.Info) populate(objectMap, "type", e.Type) return json.Marshal(objectMap) @@ -7092,15 +7193,19 @@ func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ExecuteGovernanceRuleParams. -func (e ExecuteGovernanceRuleParams) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "override", e.Override) +// 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 ExecuteGovernanceRuleParams. -func (e *ExecuteGovernanceRuleParams) UnmarshalJSON(data []byte) error { +// 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) @@ -7108,8 +7213,20 @@ func (e *ExecuteGovernanceRuleParams) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "override": - err = unpopulate(val, "Override", &e.Override) + case "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 { @@ -7119,15 +7236,15 @@ func (e *ExecuteGovernanceRuleParams) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ExecuteRuleStatus. -func (e ExecuteRuleStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "operationId", e.OperationID) +// 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 ExecuteRuleStatus. -func (e *ExecuteRuleStatus) UnmarshalJSON(data []byte) error { +// 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) @@ -7135,8 +7252,35 @@ func (e *ExecuteRuleStatus) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "operationId": - err = unpopulate(val, "OperationID", &e.OperationID) + case "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 { @@ -7148,7 +7292,7 @@ func (e *ExecuteRuleStatus) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ExternalSecuritySolution. func (e ExternalSecuritySolution) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", e.ID) populate(objectMap, "kind", e.Kind) populate(objectMap, "location", e.Location) @@ -7191,7 +7335,7 @@ func (e *ExternalSecuritySolution) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ExternalSecuritySolutionKindAutoGenerated. func (e ExternalSecuritySolutionKindAutoGenerated) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "kind", e.Kind) return json.Marshal(objectMap) } @@ -7218,7 +7362,7 @@ func (e *ExternalSecuritySolutionKindAutoGenerated) UnmarshalJSON(data []byte) e // MarshalJSON implements the json.Marshaller interface for type ExternalSecuritySolutionList. func (e ExternalSecuritySolutionList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", e.NextLink) populate(objectMap, "value", e.Value) return json.Marshal(objectMap) @@ -7249,7 +7393,7 @@ func (e *ExternalSecuritySolutionList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ExternalSecuritySolutionProperties. func (e ExternalSecuritySolutionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "deviceType", e.DeviceType) populate(objectMap, "deviceVendor", e.DeviceVendor) populate(objectMap, "workspace", e.Workspace) @@ -7281,10 +7425,10 @@ func (e *ExternalSecuritySolutionProperties) UnmarshalJSON(data []byte) error { delete(rawMsg, key) default: if e.AdditionalProperties == nil { - e.AdditionalProperties = map[string]interface{}{} + e.AdditionalProperties = map[string]any{} } if val != nil { - var aux interface{} + var aux any err = json.Unmarshal(val, &aux) e.AdditionalProperties[key] = aux } @@ -7299,7 +7443,7 @@ func (e *ExternalSecuritySolutionProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type FailedLocalLoginsNotInAllowedRange. func (f FailedLocalLoginsNotInAllowedRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", f.Description) populate(objectMap, "displayName", f.DisplayName) populate(objectMap, "isEnabled", f.IsEnabled) @@ -7350,7 +7494,7 @@ func (f *FailedLocalLoginsNotInAllowedRange) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type FileUploadsNotInAllowedRange. func (f FileUploadsNotInAllowedRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", f.Description) populate(objectMap, "displayName", f.DisplayName) populate(objectMap, "isEnabled", f.IsEnabled) @@ -7401,7 +7545,7 @@ func (f *FileUploadsNotInAllowedRange) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type GcpCredentialsDetailsProperties. func (g GcpCredentialsDetailsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "authProviderX509CertUrl", g.AuthProviderX509CertURL) populate(objectMap, "authUri", g.AuthURI) populate(objectMap, "authenticationProvisioningState", g.AuthenticationProvisioningState) @@ -7480,7 +7624,7 @@ func (g *GcpCredentialsDetailsProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type GcpOrganizationalData. func (g GcpOrganizationalData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["organizationMembershipType"] = g.OrganizationMembershipType return json.Marshal(objectMap) } @@ -7507,7 +7651,7 @@ func (g *GcpOrganizationalData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type GcpOrganizationalDataMember. func (g GcpOrganizationalDataMember) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "managementProjectNumber", g.ManagementProjectNumber) objectMap["organizationMembershipType"] = OrganizationMembershipTypeMember populate(objectMap, "parentHierarchyId", g.ParentHierarchyID) @@ -7542,7 +7686,7 @@ func (g *GcpOrganizationalDataMember) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type GcpOrganizationalDataOrganization. func (g GcpOrganizationalDataOrganization) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "excludedProjectNumbers", g.ExcludedProjectNumbers) objectMap["organizationMembershipType"] = OrganizationMembershipTypeOrganization populate(objectMap, "serviceAccountEmailAddress", g.ServiceAccountEmailAddress) @@ -7581,7 +7725,7 @@ func (g *GcpOrganizationalDataOrganization) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type GcpProjectDetails. func (g GcpProjectDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "projectId", g.ProjectID) populate(objectMap, "projectNumber", g.ProjectNumber) populate(objectMap, "workloadIdentityPoolId", g.WorkloadIdentityPoolID) @@ -7616,7 +7760,7 @@ func (g *GcpProjectDetails) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type GcpProjectEnvironmentData. func (g GcpProjectEnvironmentData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["environmentType"] = EnvironmentTypeGcpProject populate(objectMap, "organizationalData", g.OrganizationalData) populate(objectMap, "projectDetails", g.ProjectDetails) @@ -7651,7 +7795,7 @@ func (g *GcpProjectEnvironmentData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type GithubScopeEnvironmentData. func (g GithubScopeEnvironmentData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["environmentType"] = EnvironmentTypeGithubScope return json.Marshal(objectMap) } @@ -7678,7 +7822,7 @@ func (g *GithubScopeEnvironmentData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type GovernanceAssignment. func (g GovernanceAssignment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", g.ID) populate(objectMap, "name", g.Name) populate(objectMap, "properties", g.Properties) @@ -7717,7 +7861,7 @@ func (g *GovernanceAssignment) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type GovernanceAssignmentAdditionalData. func (g GovernanceAssignmentAdditionalData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "ticketLink", g.TicketLink) populate(objectMap, "ticketNumber", g.TicketNumber) populate(objectMap, "ticketStatus", g.TicketStatus) @@ -7752,7 +7896,7 @@ func (g *GovernanceAssignmentAdditionalData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type GovernanceAssignmentProperties. func (g GovernanceAssignmentProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "additionalData", g.AdditionalData) populate(objectMap, "governanceEmailNotification", g.GovernanceEmailNotification) populate(objectMap, "isGracePeriod", g.IsGracePeriod) @@ -7799,7 +7943,7 @@ func (g *GovernanceAssignmentProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type GovernanceAssignmentsList. func (g GovernanceAssignmentsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", g.NextLink) populate(objectMap, "value", g.Value) return json.Marshal(objectMap) @@ -7830,7 +7974,7 @@ func (g *GovernanceAssignmentsList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type GovernanceEmailNotification. func (g GovernanceEmailNotification) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "disableManagerEmailNotification", g.DisableManagerEmailNotification) populate(objectMap, "disableOwnerEmailNotification", g.DisableOwnerEmailNotification) return json.Marshal(objectMap) @@ -7861,7 +8005,7 @@ func (g *GovernanceEmailNotification) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type GovernanceRule. func (g GovernanceRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", g.ID) populate(objectMap, "name", g.Name) populate(objectMap, "properties", g.Properties) @@ -7900,7 +8044,7 @@ func (g *GovernanceRule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type GovernanceRuleEmailNotification. func (g GovernanceRuleEmailNotification) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "disableManagerEmailNotification", g.DisableManagerEmailNotification) populate(objectMap, "disableOwnerEmailNotification", g.DisableOwnerEmailNotification) return json.Marshal(objectMap) @@ -7931,7 +8075,7 @@ func (g *GovernanceRuleEmailNotification) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type GovernanceRuleList. func (g GovernanceRuleList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", g.NextLink) populate(objectMap, "value", g.Value) return json.Marshal(objectMap) @@ -7960,9 +8104,48 @@ func (g *GovernanceRuleList) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type GovernanceRuleMetadata. +func (g GovernanceRuleMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "createdBy", g.CreatedBy) + populateTimeRFC3339(objectMap, "createdOn", g.CreatedOn) + populate(objectMap, "updatedBy", g.UpdatedBy) + populateTimeRFC3339(objectMap, "updatedOn", g.UpdatedOn) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GovernanceRuleMetadata. +func (g *GovernanceRuleMetadata) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdBy": + err = unpopulate(val, "CreatedBy", &g.CreatedBy) + delete(rawMsg, key) + case "createdOn": + err = unpopulateTimeRFC3339(val, "CreatedOn", &g.CreatedOn) + delete(rawMsg, key) + case "updatedBy": + err = unpopulate(val, "UpdatedBy", &g.UpdatedBy) + delete(rawMsg, key) + case "updatedOn": + err = unpopulateTimeRFC3339(val, "UpdatedOn", &g.UpdatedOn) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type GovernanceRuleOwnerSource. func (g GovernanceRuleOwnerSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "type", g.Type) populate(objectMap, "value", g.Value) return json.Marshal(objectMap) @@ -7993,18 +8176,22 @@ func (g *GovernanceRuleOwnerSource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type GovernanceRuleProperties. func (g GovernanceRuleProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "conditionSets", g.ConditionSets) populate(objectMap, "description", g.Description) populate(objectMap, "displayName", g.DisplayName) + populate(objectMap, "excludedScopes", g.ExcludedScopes) populate(objectMap, "governanceEmailNotification", g.GovernanceEmailNotification) + populate(objectMap, "includeMemberScopes", g.IncludeMemberScopes) populate(objectMap, "isDisabled", g.IsDisabled) populate(objectMap, "isGracePeriod", g.IsGracePeriod) + populate(objectMap, "metadata", g.Metadata) populate(objectMap, "ownerSource", g.OwnerSource) populate(objectMap, "remediationTimeframe", g.RemediationTimeframe) populate(objectMap, "rulePriority", g.RulePriority) populate(objectMap, "ruleType", g.RuleType) populate(objectMap, "sourceResourceType", g.SourceResourceType) + populate(objectMap, "tenantId", g.TenantID) return json.Marshal(objectMap) } @@ -8026,15 +8213,24 @@ func (g *GovernanceRuleProperties) UnmarshalJSON(data []byte) error { case "displayName": err = unpopulate(val, "DisplayName", &g.DisplayName) delete(rawMsg, key) + case "excludedScopes": + err = unpopulate(val, "ExcludedScopes", &g.ExcludedScopes) + delete(rawMsg, key) case "governanceEmailNotification": err = unpopulate(val, "GovernanceEmailNotification", &g.GovernanceEmailNotification) delete(rawMsg, key) + case "includeMemberScopes": + err = unpopulate(val, "IncludeMemberScopes", &g.IncludeMemberScopes) + delete(rawMsg, key) case "isDisabled": err = unpopulate(val, "IsDisabled", &g.IsDisabled) delete(rawMsg, key) case "isGracePeriod": err = unpopulate(val, "IsGracePeriod", &g.IsGracePeriod) delete(rawMsg, key) + case "metadata": + err = unpopulate(val, "Metadata", &g.Metadata) + delete(rawMsg, key) case "ownerSource": err = unpopulate(val, "OwnerSource", &g.OwnerSource) delete(rawMsg, key) @@ -8050,6 +8246,9 @@ func (g *GovernanceRuleProperties) UnmarshalJSON(data []byte) error { case "sourceResourceType": err = unpopulate(val, "SourceResourceType", &g.SourceResourceType) delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &g.TenantID) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", g, err) @@ -8060,7 +8259,7 @@ func (g *GovernanceRuleProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type HTTPC2DMessagesNotInAllowedRange. func (h HTTPC2DMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", h.Description) populate(objectMap, "displayName", h.DisplayName) populate(objectMap, "isEnabled", h.IsEnabled) @@ -8111,7 +8310,7 @@ func (h *HTTPC2DMessagesNotInAllowedRange) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type HTTPC2DRejectedMessagesNotInAllowedRange. func (h HTTPC2DRejectedMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", h.Description) populate(objectMap, "displayName", h.DisplayName) populate(objectMap, "isEnabled", h.IsEnabled) @@ -8162,7 +8361,7 @@ func (h *HTTPC2DRejectedMessagesNotInAllowedRange) UnmarshalJSON(data []byte) er // MarshalJSON implements the json.Marshaller interface for type HTTPD2CMessagesNotInAllowedRange. func (h HTTPD2CMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", h.Description) populate(objectMap, "displayName", h.DisplayName) populate(objectMap, "isEnabled", h.IsEnabled) @@ -8213,7 +8412,7 @@ func (h *HTTPD2CMessagesNotInAllowedRange) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type HybridComputeSettingsProperties. func (h HybridComputeSettingsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "autoProvision", h.AutoProvision) populate(objectMap, "hybridComputeProvisioningState", h.HybridComputeProvisioningState) populate(objectMap, "proxyServer", h.ProxyServer) @@ -8260,7 +8459,7 @@ func (h *HybridComputeSettingsProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type InformationProtectionAwsOffering. func (i InformationProtectionAwsOffering) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", i.Description) populate(objectMap, "informationProtection", i.InformationProtection) objectMap["offeringType"] = OfferingTypeInformationProtectionAws @@ -8295,7 +8494,7 @@ func (i *InformationProtectionAwsOffering) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type InformationProtectionAwsOfferingInformationProtection. func (i InformationProtectionAwsOfferingInformationProtection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "cloudRoleArn", i.CloudRoleArn) return json.Marshal(objectMap) } @@ -8322,7 +8521,7 @@ func (i *InformationProtectionAwsOfferingInformationProtection) UnmarshalJSON(da // MarshalJSON implements the json.Marshaller interface for type InformationProtectionKeyword. func (i InformationProtectionKeyword) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "canBeNumeric", i.CanBeNumeric) populate(objectMap, "custom", i.Custom) populate(objectMap, "excluded", i.Excluded) @@ -8361,7 +8560,7 @@ func (i *InformationProtectionKeyword) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type InformationProtectionPolicy. func (i InformationProtectionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", i.ID) populate(objectMap, "name", i.Name) populate(objectMap, "properties", i.Properties) @@ -8400,7 +8599,7 @@ func (i *InformationProtectionPolicy) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type InformationProtectionPolicyList. func (i InformationProtectionPolicyList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", i.NextLink) populate(objectMap, "value", i.Value) return json.Marshal(objectMap) @@ -8431,7 +8630,7 @@ func (i *InformationProtectionPolicyList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type InformationProtectionPolicyProperties. func (i InformationProtectionPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "informationTypes", i.InformationTypes) populate(objectMap, "labels", i.Labels) populateTimeRFC3339(objectMap, "lastModifiedUtc", i.LastModifiedUTC) @@ -8470,7 +8669,7 @@ func (i *InformationProtectionPolicyProperties) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type InformationType. func (i InformationType) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "custom", i.Custom) populate(objectMap, "description", i.Description) populate(objectMap, "displayName", i.DisplayName) @@ -8521,7 +8720,7 @@ func (i *InformationType) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IngestionConnectionString. func (i IngestionConnectionString) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "location", i.Location) populate(objectMap, "value", i.Value) return json.Marshal(objectMap) @@ -8552,7 +8751,7 @@ func (i *IngestionConnectionString) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IngestionSetting. func (i IngestionSetting) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", i.ID) populate(objectMap, "name", i.Name) populate(objectMap, "properties", &i.Properties) @@ -8591,7 +8790,7 @@ func (i *IngestionSetting) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IngestionSettingList. func (i IngestionSettingList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", i.NextLink) populate(objectMap, "value", i.Value) return json.Marshal(objectMap) @@ -8622,7 +8821,7 @@ func (i *IngestionSettingList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IngestionSettingToken. func (i IngestionSettingToken) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "token", i.Token) return json.Marshal(objectMap) } @@ -8649,7 +8848,7 @@ func (i *IngestionSettingToken) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IoTSecurityAggregatedAlert. func (i IoTSecurityAggregatedAlert) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", i.ID) populate(objectMap, "name", i.Name) populate(objectMap, "properties", i.Properties) @@ -8692,7 +8891,7 @@ func (i *IoTSecurityAggregatedAlert) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IoTSecurityAggregatedAlertList. func (i IoTSecurityAggregatedAlertList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", i.NextLink) populate(objectMap, "value", i.Value) return json.Marshal(objectMap) @@ -8723,7 +8922,7 @@ func (i *IoTSecurityAggregatedAlertList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IoTSecurityAggregatedAlertProperties. func (i IoTSecurityAggregatedAlertProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "actionTaken", i.ActionTaken) populateDateType(objectMap, "aggregatedDateUtc", i.AggregatedDateUTC) populate(objectMap, "alertDisplayName", i.AlertDisplayName) @@ -8798,7 +8997,7 @@ func (i *IoTSecurityAggregatedAlertProperties) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type IoTSecurityAggregatedAlertPropertiesTopDevicesListItem. func (i IoTSecurityAggregatedAlertPropertiesTopDevicesListItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "alertsCount", i.AlertsCount) populate(objectMap, "deviceId", i.DeviceID) populate(objectMap, "lastOccurrence", i.LastOccurrence) @@ -8833,7 +9032,7 @@ func (i *IoTSecurityAggregatedAlertPropertiesTopDevicesListItem) UnmarshalJSON(d // MarshalJSON implements the json.Marshaller interface for type IoTSecurityAggregatedRecommendation. func (i IoTSecurityAggregatedRecommendation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", i.ID) populate(objectMap, "name", i.Name) populate(objectMap, "properties", i.Properties) @@ -8876,7 +9075,7 @@ func (i *IoTSecurityAggregatedRecommendation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IoTSecurityAggregatedRecommendationList. func (i IoTSecurityAggregatedRecommendationList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", i.NextLink) populate(objectMap, "value", i.Value) return json.Marshal(objectMap) @@ -8907,7 +9106,7 @@ func (i *IoTSecurityAggregatedRecommendationList) UnmarshalJSON(data []byte) err // MarshalJSON implements the json.Marshaller interface for type IoTSecurityAggregatedRecommendationProperties. func (i IoTSecurityAggregatedRecommendationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", i.Description) populate(objectMap, "detectedBy", i.DetectedBy) populate(objectMap, "healthyDevices", i.HealthyDevices) @@ -8970,7 +9169,7 @@ func (i *IoTSecurityAggregatedRecommendationProperties) UnmarshalJSON(data []byt // MarshalJSON implements the json.Marshaller interface for type IoTSecurityAlertedDevice. func (i IoTSecurityAlertedDevice) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "alertsCount", i.AlertsCount) populate(objectMap, "deviceId", i.DeviceID) return json.Marshal(objectMap) @@ -9001,7 +9200,7 @@ func (i *IoTSecurityAlertedDevice) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IoTSecurityDeviceAlert. func (i IoTSecurityDeviceAlert) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "alertDisplayName", i.AlertDisplayName) populate(objectMap, "alertsCount", i.AlertsCount) populate(objectMap, "reportedSeverity", i.ReportedSeverity) @@ -9036,7 +9235,7 @@ func (i *IoTSecurityDeviceAlert) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IoTSecurityDeviceRecommendation. func (i IoTSecurityDeviceRecommendation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "devicesCount", i.DevicesCount) populate(objectMap, "recommendationDisplayName", i.RecommendationDisplayName) populate(objectMap, "reportedSeverity", i.ReportedSeverity) @@ -9071,7 +9270,7 @@ func (i *IoTSecurityDeviceRecommendation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IoTSecuritySolutionAnalyticsModel. func (i IoTSecuritySolutionAnalyticsModel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", i.ID) populate(objectMap, "name", i.Name) populate(objectMap, "properties", i.Properties) @@ -9110,7 +9309,7 @@ func (i *IoTSecuritySolutionAnalyticsModel) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IoTSecuritySolutionAnalyticsModelList. func (i IoTSecuritySolutionAnalyticsModelList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", i.NextLink) populate(objectMap, "value", i.Value) return json.Marshal(objectMap) @@ -9141,7 +9340,7 @@ func (i *IoTSecuritySolutionAnalyticsModelList) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type IoTSecuritySolutionAnalyticsModelProperties. func (i IoTSecuritySolutionAnalyticsModelProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "devicesMetrics", i.DevicesMetrics) populate(objectMap, "metrics", i.Metrics) populate(objectMap, "mostPrevalentDeviceAlerts", i.MostPrevalentDeviceAlerts) @@ -9188,7 +9387,7 @@ func (i *IoTSecuritySolutionAnalyticsModelProperties) UnmarshalJSON(data []byte) // MarshalJSON implements the json.Marshaller interface for type IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem. func (i IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "date", i.Date) populate(objectMap, "devicesMetrics", i.DevicesMetrics) return json.Marshal(objectMap) @@ -9219,7 +9418,7 @@ func (i *IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsItem) Unmarsha // MarshalJSON implements the json.Marshaller interface for type IoTSecuritySolutionModel. func (i IoTSecuritySolutionModel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", i.ID) populate(objectMap, "location", i.Location) populate(objectMap, "name", i.Name) @@ -9270,7 +9469,7 @@ func (i *IoTSecuritySolutionModel) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IoTSecuritySolutionProperties. func (i IoTSecuritySolutionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "additionalWorkspaces", i.AdditionalWorkspaces) populate(objectMap, "autoDiscoveredResources", i.AutoDiscoveredResources) populate(objectMap, "disabledDataSources", i.DisabledDataSources) @@ -9337,7 +9536,7 @@ func (i *IoTSecuritySolutionProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IoTSecuritySolutionsList. func (i IoTSecuritySolutionsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", i.NextLink) populate(objectMap, "value", i.Value) return json.Marshal(objectMap) @@ -9368,7 +9567,7 @@ func (i *IoTSecuritySolutionsList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type IoTSeverityMetrics. func (i IoTSeverityMetrics) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "high", i.High) populate(objectMap, "low", i.Low) populate(objectMap, "medium", i.Medium) @@ -9403,7 +9602,7 @@ func (i *IoTSeverityMetrics) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JitNetworkAccessPoliciesList. func (j JitNetworkAccessPoliciesList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", j.NextLink) populate(objectMap, "value", j.Value) return json.Marshal(objectMap) @@ -9434,7 +9633,7 @@ func (j *JitNetworkAccessPoliciesList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JitNetworkAccessPolicy. func (j JitNetworkAccessPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", j.ID) populate(objectMap, "kind", j.Kind) populate(objectMap, "location", j.Location) @@ -9481,7 +9680,7 @@ func (j *JitNetworkAccessPolicy) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JitNetworkAccessPolicyInitiatePort. func (j JitNetworkAccessPolicyInitiatePort) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "allowedSourceAddressPrefix", j.AllowedSourceAddressPrefix) populateTimeRFC3339(objectMap, "endTimeUtc", j.EndTimeUTC) populate(objectMap, "number", j.Number) @@ -9516,7 +9715,7 @@ func (j *JitNetworkAccessPolicyInitiatePort) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JitNetworkAccessPolicyInitiateRequest. func (j JitNetworkAccessPolicyInitiateRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "justification", j.Justification) populate(objectMap, "virtualMachines", j.VirtualMachines) return json.Marshal(objectMap) @@ -9547,7 +9746,7 @@ func (j *JitNetworkAccessPolicyInitiateRequest) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type JitNetworkAccessPolicyInitiateVirtualMachine. func (j JitNetworkAccessPolicyInitiateVirtualMachine) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", j.ID) populate(objectMap, "ports", j.Ports) return json.Marshal(objectMap) @@ -9578,7 +9777,7 @@ func (j *JitNetworkAccessPolicyInitiateVirtualMachine) UnmarshalJSON(data []byte // MarshalJSON implements the json.Marshaller interface for type JitNetworkAccessPolicyProperties. func (j JitNetworkAccessPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "provisioningState", j.ProvisioningState) populate(objectMap, "requests", j.Requests) populate(objectMap, "virtualMachines", j.VirtualMachines) @@ -9613,7 +9812,7 @@ func (j *JitNetworkAccessPolicyProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JitNetworkAccessPolicyVirtualMachine. func (j JitNetworkAccessPolicyVirtualMachine) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", j.ID) populate(objectMap, "ports", j.Ports) populate(objectMap, "publicIpAddress", j.PublicIPAddress) @@ -9648,7 +9847,7 @@ func (j *JitNetworkAccessPolicyVirtualMachine) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type JitNetworkAccessPortRule. func (j JitNetworkAccessPortRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "allowedSourceAddressPrefix", j.AllowedSourceAddressPrefix) populate(objectMap, "allowedSourceAddressPrefixes", j.AllowedSourceAddressPrefixes) populate(objectMap, "maxRequestAccessDuration", j.MaxRequestAccessDuration) @@ -9691,7 +9890,7 @@ func (j *JitNetworkAccessPortRule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JitNetworkAccessRequest. func (j JitNetworkAccessRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "justification", j.Justification) populate(objectMap, "requestor", j.Requestor) populateTimeRFC3339(objectMap, "startTimeUtc", j.StartTimeUTC) @@ -9730,7 +9929,7 @@ func (j *JitNetworkAccessRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JitNetworkAccessRequestPort. func (j JitNetworkAccessRequestPort) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "allowedSourceAddressPrefix", j.AllowedSourceAddressPrefix) populate(objectMap, "allowedSourceAddressPrefixes", j.AllowedSourceAddressPrefixes) populateTimeRFC3339(objectMap, "endTimeUtc", j.EndTimeUTC) @@ -9781,7 +9980,7 @@ func (j *JitNetworkAccessRequestPort) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type JitNetworkAccessRequestVirtualMachine. func (j JitNetworkAccessRequestVirtualMachine) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", j.ID) populate(objectMap, "ports", j.Ports) return json.Marshal(objectMap) @@ -9812,7 +10011,7 @@ func (j *JitNetworkAccessRequestVirtualMachine) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type KindAutoGenerated. func (k KindAutoGenerated) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "kind", k.Kind) return json.Marshal(objectMap) } @@ -9839,7 +10038,7 @@ func (k *KindAutoGenerated) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ListCustomAlertRule. func (l ListCustomAlertRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", l.Description) populate(objectMap, "displayName", l.DisplayName) populate(objectMap, "isEnabled", l.IsEnabled) @@ -9882,7 +10081,7 @@ func (l *ListCustomAlertRule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LocalUserNotAllowed. func (l LocalUserNotAllowed) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "allowlistValues", l.AllowlistValues) populate(objectMap, "description", l.Description) populate(objectMap, "displayName", l.DisplayName) @@ -9929,7 +10128,7 @@ func (l *LocalUserNotAllowed) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Location. func (l Location) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "location", l.Location) return json.Marshal(objectMap) } @@ -9956,7 +10155,7 @@ func (l *Location) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type LogAnalyticsIdentifier. func (l LogAnalyticsIdentifier) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "agentId", l.AgentID) objectMap["type"] = ResourceIdentifierTypeLogAnalytics populate(objectMap, "workspaceId", l.WorkspaceID) @@ -9999,7 +10198,7 @@ func (l *LogAnalyticsIdentifier) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MdeOnboardingData. func (m MdeOnboardingData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", m.ID) populate(objectMap, "name", m.Name) populate(objectMap, "properties", m.Properties) @@ -10038,7 +10237,7 @@ func (m *MdeOnboardingData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MdeOnboardingDataList. func (m MdeOnboardingDataList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } @@ -10065,7 +10264,7 @@ func (m *MdeOnboardingDataList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MdeOnboardingDataProperties. func (m MdeOnboardingDataProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateByteArray(objectMap, "onboardingPackageLinux", m.OnboardingPackageLinux, runtime.Base64StdFormat) populateByteArray(objectMap, "onboardingPackageWindows", m.OnboardingPackageWindows, runtime.Base64StdFormat) return json.Marshal(objectMap) @@ -10096,7 +10295,7 @@ func (m *MdeOnboardingDataProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MqttC2DMessagesNotInAllowedRange. func (m MqttC2DMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", m.Description) populate(objectMap, "displayName", m.DisplayName) populate(objectMap, "isEnabled", m.IsEnabled) @@ -10147,7 +10346,7 @@ func (m *MqttC2DMessagesNotInAllowedRange) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type MqttC2DRejectedMessagesNotInAllowedRange. func (m MqttC2DRejectedMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", m.Description) populate(objectMap, "displayName", m.DisplayName) populate(objectMap, "isEnabled", m.IsEnabled) @@ -10198,7 +10397,7 @@ func (m *MqttC2DRejectedMessagesNotInAllowedRange) UnmarshalJSON(data []byte) er // MarshalJSON implements the json.Marshaller interface for type MqttD2CMessagesNotInAllowedRange. func (m MqttD2CMessagesNotInAllowedRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", m.Description) populate(objectMap, "displayName", m.DisplayName) populate(objectMap, "isEnabled", m.IsEnabled) @@ -10249,7 +10448,7 @@ func (m *MqttD2CMessagesNotInAllowedRange) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OnPremiseResourceDetails. func (o OnPremiseResourceDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "machineName", o.MachineName) objectMap["source"] = SourceOnPremise populate(objectMap, "sourceComputerId", o.SourceComputerID) @@ -10292,7 +10491,7 @@ func (o *OnPremiseResourceDetails) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OnPremiseSQLResourceDetails. func (o OnPremiseSQLResourceDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "databaseName", o.DatabaseName) populate(objectMap, "machineName", o.MachineName) populate(objectMap, "serverName", o.ServerName) @@ -10343,7 +10542,7 @@ func (o *OnPremiseSQLResourceDetails) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Operation. func (o Operation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "display", o.Display) populate(objectMap, "name", o.Name) populate(objectMap, "origin", o.Origin) @@ -10378,7 +10577,7 @@ func (o *Operation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationDisplay. func (o OperationDisplay) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", o.Description) populate(objectMap, "operation", o.Operation) populate(objectMap, "provider", o.Provider) @@ -10417,7 +10616,7 @@ func (o *OperationDisplay) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type OperationList. func (o OperationList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", o.NextLink) populate(objectMap, "value", o.Value) return json.Marshal(objectMap) @@ -10446,9 +10645,36 @@ func (o *OperationList) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type OperationResultAutoGenerated. +func (o OperationResultAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "status", o.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultAutoGenerated. +func (o *OperationResultAutoGenerated) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "status": + err = unpopulate(val, "Status", &o.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type PathRecommendation. func (p PathRecommendation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "action", p.Action) populate(objectMap, "common", p.Common) populate(objectMap, "configurationStatus", p.ConfigurationStatus) @@ -10507,7 +10733,7 @@ func (p *PathRecommendation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Pricing. func (p Pricing) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) @@ -10546,7 +10772,7 @@ func (p *Pricing) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PricingList. func (p PricingList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } @@ -10573,7 +10799,7 @@ func (p *PricingList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PricingProperties. func (p PricingProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "deprecated", p.Deprecated) populate(objectMap, "freeTrialRemainingTime", p.FreeTrialRemainingTime) populate(objectMap, "pricingTier", p.PricingTier) @@ -10616,7 +10842,7 @@ func (p *PricingProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ProcessNotAllowed. func (p ProcessNotAllowed) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "allowlistValues", p.AllowlistValues) populate(objectMap, "description", p.Description) populate(objectMap, "displayName", p.DisplayName) @@ -10663,7 +10889,7 @@ func (p *ProcessNotAllowed) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ProtectionMode. func (p ProtectionMode) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "exe", p.Exe) populate(objectMap, "executable", p.Executable) populate(objectMap, "msi", p.Msi) @@ -10702,7 +10928,7 @@ func (p *ProtectionMode) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ProxyServerProperties. func (p ProxyServerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "ip", p.IP) populate(objectMap, "port", p.Port) return json.Marshal(objectMap) @@ -10733,7 +10959,7 @@ func (p *ProxyServerProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PublisherInfo. func (p PublisherInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "binaryName", p.BinaryName) populate(objectMap, "productName", p.ProductName) populate(objectMap, "publisherName", p.PublisherName) @@ -10772,7 +10998,7 @@ func (p *PublisherInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type QueryCheck. func (q QueryCheck) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "columnNames", q.ColumnNames) populate(objectMap, "expectedResult", q.ExpectedResult) populate(objectMap, "query", q.Query) @@ -10807,7 +11033,7 @@ func (q *QueryCheck) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type QueuePurgesNotInAllowedRange. func (q QueuePurgesNotInAllowedRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", q.Description) populate(objectMap, "displayName", q.DisplayName) populate(objectMap, "isEnabled", q.IsEnabled) @@ -10858,7 +11084,7 @@ func (q *QueuePurgesNotInAllowedRange) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RecommendationConfigurationProperties. func (r RecommendationConfigurationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", r.Name) populate(objectMap, "recommendationType", r.RecommendationType) populate(objectMap, "status", r.Status) @@ -10893,7 +11119,7 @@ func (r *RecommendationConfigurationProperties) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type RegulatoryComplianceAssessment. func (r RegulatoryComplianceAssessment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) populate(objectMap, "properties", r.Properties) @@ -10932,7 +11158,7 @@ func (r *RegulatoryComplianceAssessment) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RegulatoryComplianceAssessmentList. func (r RegulatoryComplianceAssessmentList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", r.NextLink) populate(objectMap, "value", r.Value) return json.Marshal(objectMap) @@ -10963,7 +11189,7 @@ func (r *RegulatoryComplianceAssessmentList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RegulatoryComplianceAssessmentProperties. func (r RegulatoryComplianceAssessmentProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "assessmentDetailsLink", r.AssessmentDetailsLink) populate(objectMap, "assessmentType", r.AssessmentType) populate(objectMap, "description", r.Description) @@ -11018,7 +11244,7 @@ func (r *RegulatoryComplianceAssessmentProperties) UnmarshalJSON(data []byte) er // MarshalJSON implements the json.Marshaller interface for type RegulatoryComplianceControl. func (r RegulatoryComplianceControl) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) populate(objectMap, "properties", r.Properties) @@ -11057,7 +11283,7 @@ func (r *RegulatoryComplianceControl) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RegulatoryComplianceControlList. func (r RegulatoryComplianceControlList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", r.NextLink) populate(objectMap, "value", r.Value) return json.Marshal(objectMap) @@ -11088,7 +11314,7 @@ func (r *RegulatoryComplianceControlList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RegulatoryComplianceControlProperties. func (r RegulatoryComplianceControlProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", r.Description) populate(objectMap, "failedAssessments", r.FailedAssessments) populate(objectMap, "passedAssessments", r.PassedAssessments) @@ -11131,7 +11357,7 @@ func (r *RegulatoryComplianceControlProperties) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type RegulatoryComplianceStandard. func (r RegulatoryComplianceStandard) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) populate(objectMap, "properties", r.Properties) @@ -11170,7 +11396,7 @@ func (r *RegulatoryComplianceStandard) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RegulatoryComplianceStandardList. func (r RegulatoryComplianceStandardList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", r.NextLink) populate(objectMap, "value", r.Value) return json.Marshal(objectMap) @@ -11201,7 +11427,7 @@ func (r *RegulatoryComplianceStandardList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RegulatoryComplianceStandardProperties. func (r RegulatoryComplianceStandardProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "failedControls", r.FailedControls) populate(objectMap, "passedControls", r.PassedControls) populate(objectMap, "skippedControls", r.SkippedControls) @@ -11244,7 +11470,7 @@ func (r *RegulatoryComplianceStandardProperties) UnmarshalJSON(data []byte) erro // MarshalJSON implements the json.Marshaller interface for type Remediation. func (r Remediation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "automated", r.Automated) populate(objectMap, "description", r.Description) populate(objectMap, "portalLink", r.PortalLink) @@ -11283,7 +11509,7 @@ func (r *Remediation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RemediationEta. func (r RemediationEta) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "eta", r.Eta) populate(objectMap, "justification", r.Justification) return json.Marshal(objectMap) @@ -11314,7 +11540,7 @@ func (r *RemediationEta) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Resource. func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) populate(objectMap, "type", r.Type) @@ -11349,7 +11575,7 @@ func (r *Resource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ResourceDetails. func (r ResourceDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["source"] = r.Source return json.Marshal(objectMap) } @@ -11376,7 +11602,7 @@ func (r *ResourceDetails) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ResourceIdentifier. func (r ResourceIdentifier) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["type"] = r.Type return json.Marshal(objectMap) } @@ -11403,7 +11629,7 @@ func (r *ResourceIdentifier) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Rule. func (r Rule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "destinationPort", r.DestinationPort) populate(objectMap, "direction", r.Direction) populate(objectMap, "ipAddresses", r.IPAddresses) @@ -11446,7 +11672,7 @@ func (r *Rule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RuleResults. func (r RuleResults) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", r.ID) populate(objectMap, "name", r.Name) populate(objectMap, "properties", r.Properties) @@ -11485,7 +11711,7 @@ func (r *RuleResults) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RuleResultsInput. func (r RuleResultsInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "latestScan", r.LatestScan) populate(objectMap, "results", r.Results) return json.Marshal(objectMap) @@ -11516,7 +11742,7 @@ func (r *RuleResultsInput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RuleResultsProperties. func (r RuleResultsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "results", r.Results) return json.Marshal(objectMap) } @@ -11543,7 +11769,7 @@ func (r *RuleResultsProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RulesResults. func (r RulesResults) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } @@ -11570,7 +11796,7 @@ func (r *RulesResults) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type RulesResultsInput. func (r RulesResultsInput) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "latestScan", r.LatestScan) populate(objectMap, "results", r.Results) return json.Marshal(objectMap) @@ -11601,7 +11827,7 @@ func (r *RulesResultsInput) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SQLServerVulnerabilityProperties. func (s SQLServerVulnerabilityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["assessedResourceType"] = AssessedResourceTypeSQLServerVulnerability populate(objectMap, "query", s.Query) populate(objectMap, "type", s.Type) @@ -11636,7 +11862,7 @@ func (s *SQLServerVulnerabilityProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Scan. func (s Scan) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -11675,7 +11901,7 @@ func (s *Scan) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ScanProperties. func (s ScanProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "database", s.Database) populateTimeRFC3339(objectMap, "endTime", s.EndTime) populate(objectMap, "highSeverityFailedRulesCount", s.HighSeverityFailedRulesCount) @@ -11754,7 +11980,7 @@ func (s *ScanProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ScanResult. func (s ScanResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -11793,7 +12019,7 @@ func (s *ScanResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ScanResultProperties. func (s ScanResultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "baselineAdjustedResult", s.BaselineAdjustedResult) populate(objectMap, "isTrimmed", s.IsTrimmed) populate(objectMap, "queryResults", s.QueryResults) @@ -11844,7 +12070,7 @@ func (s *ScanResultProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ScanResults. func (s ScanResults) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } @@ -11871,7 +12097,7 @@ func (s *ScanResults) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Scans. func (s Scans) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } @@ -11898,7 +12124,7 @@ func (s *Scans) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ScopeElement. func (s ScopeElement) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "field", s.Field) if s.AdditionalProperties != nil { for key, val := range s.AdditionalProperties { @@ -11922,10 +12148,10 @@ func (s *ScopeElement) UnmarshalJSON(data []byte) error { delete(rawMsg, key) default: if s.AdditionalProperties == nil { - s.AdditionalProperties = map[string]interface{}{} + s.AdditionalProperties = map[string]any{} } if val != nil { - var aux interface{} + var aux any err = json.Unmarshal(val, &aux) s.AdditionalProperties[key] = aux } @@ -11940,7 +12166,7 @@ func (s *ScopeElement) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ScoreDetails. func (s ScoreDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "current", s.Current) populate(objectMap, "max", s.Max) populate(objectMap, "percentage", s.Percentage) @@ -11975,7 +12201,7 @@ func (s *ScoreDetails) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SecureScoreControlDefinitionItem. func (s SecureScoreControlDefinitionItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -12014,7 +12240,7 @@ func (s *SecureScoreControlDefinitionItem) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SecureScoreControlDefinitionItemProperties. func (s SecureScoreControlDefinitionItemProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "assessmentDefinitions", s.AssessmentDefinitions) populate(objectMap, "description", s.Description) populate(objectMap, "displayName", s.DisplayName) @@ -12057,7 +12283,7 @@ func (s *SecureScoreControlDefinitionItemProperties) UnmarshalJSON(data []byte) // MarshalJSON implements the json.Marshaller interface for type SecureScoreControlDefinitionList. func (s SecureScoreControlDefinitionList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) @@ -12088,7 +12314,7 @@ func (s *SecureScoreControlDefinitionList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SecureScoreControlDefinitionSource. func (s SecureScoreControlDefinitionSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "sourceType", s.SourceType) return json.Marshal(objectMap) } @@ -12115,7 +12341,7 @@ func (s *SecureScoreControlDefinitionSource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SecureScoreControlDetails. func (s SecureScoreControlDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -12154,7 +12380,7 @@ func (s *SecureScoreControlDetails) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SecureScoreControlList. func (s SecureScoreControlList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) @@ -12185,7 +12411,7 @@ func (s *SecureScoreControlList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SecureScoreControlScore. func (s SecureScoreControlScore) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "current", s.Current) populate(objectMap, "max", s.Max) populate(objectMap, "percentage", s.Percentage) @@ -12220,7 +12446,7 @@ func (s *SecureScoreControlScore) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SecureScoreControlScoreDetails. func (s SecureScoreControlScoreDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "definition", s.Definition) populate(objectMap, "displayName", s.DisplayName) populate(objectMap, "healthyResourceCount", s.HealthyResourceCount) @@ -12271,7 +12497,7 @@ func (s *SecureScoreControlScoreDetails) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SecureScoreItem. func (s SecureScoreItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -12310,7 +12536,7 @@ func (s *SecureScoreItem) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SecureScoreItemProperties. func (s SecureScoreItemProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "displayName", s.DisplayName) populate(objectMap, "score", s.Score) populate(objectMap, "weight", s.Weight) @@ -12345,7 +12571,7 @@ func (s *SecureScoreItemProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SecureScoresList. func (s SecureScoresList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) @@ -12376,7 +12602,7 @@ func (s *SecureScoresList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SensitivityLabel. func (s SensitivityLabel) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", s.Description) populate(objectMap, "displayName", s.DisplayName) populate(objectMap, "enabled", s.Enabled) @@ -12419,7 +12645,7 @@ func (s *SensitivityLabel) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ServerVulnerabilityAssessment. func (s ServerVulnerabilityAssessment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -12458,7 +12684,7 @@ func (s *ServerVulnerabilityAssessment) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ServerVulnerabilityAssessmentProperties. func (s ServerVulnerabilityAssessmentProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "provisioningState", s.ProvisioningState) return json.Marshal(objectMap) } @@ -12485,7 +12711,7 @@ func (s *ServerVulnerabilityAssessmentProperties) UnmarshalJSON(data []byte) err // MarshalJSON implements the json.Marshaller interface for type ServerVulnerabilityAssessmentsList. func (s ServerVulnerabilityAssessmentsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } @@ -12512,7 +12738,7 @@ func (s *ServerVulnerabilityAssessmentsList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ServerVulnerabilityProperties. func (s ServerVulnerabilityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["assessedResourceType"] = "ServerVulnerabilityAssessment" populate(objectMap, "cve", s.Cve) populate(objectMap, "cvss", s.Cvss) @@ -12567,7 +12793,7 @@ func (s *ServerVulnerabilityProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ServicePrincipalProperties. func (s ServicePrincipalProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "applicationId", s.ApplicationID) populate(objectMap, "secret", s.Secret) return json.Marshal(objectMap) @@ -12598,7 +12824,7 @@ func (s *ServicePrincipalProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Setting. func (s Setting) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) objectMap["kind"] = s.Kind populate(objectMap, "name", s.Name) @@ -12637,7 +12863,7 @@ func (s *Setting) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SettingsList. func (s SettingsList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) @@ -12668,7 +12894,7 @@ func (s *SettingsList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Software. func (s Software) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -12707,7 +12933,7 @@ func (s *Software) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SoftwareProperties. func (s SoftwareProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "deviceId", s.DeviceID) populate(objectMap, "endOfSupportDate", s.EndOfSupportDate) populate(objectMap, "endOfSupportStatus", s.EndOfSupportStatus) @@ -12766,7 +12992,7 @@ func (s *SoftwareProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SoftwaresList. func (s SoftwaresList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) @@ -12797,7 +13023,7 @@ func (s *SoftwaresList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Solution. func (s Solution) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) @@ -12840,7 +13066,7 @@ func (s *Solution) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SolutionList. func (s SolutionList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) @@ -12871,7 +13097,7 @@ func (s *SolutionList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SolutionProperties. func (s SolutionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "protectionStatus", s.ProtectionStatus) populate(objectMap, "provisioningState", s.ProvisioningState) populate(objectMap, "securityFamily", s.SecurityFamily) @@ -12910,7 +13136,7 @@ func (s *SolutionProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SolutionsReferenceData. func (s SolutionsReferenceData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "location", s.Location) populate(objectMap, "name", s.Name) @@ -12953,7 +13179,7 @@ func (s *SolutionsReferenceData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SolutionsReferenceDataList. func (s SolutionsReferenceDataList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) } @@ -12980,7 +13206,7 @@ func (s *SolutionsReferenceDataList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SolutionsReferenceDataProperties. func (s SolutionsReferenceDataProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "alertVendorName", s.AlertVendorName) populate(objectMap, "packageInfoUrl", s.PackageInfoURL) populate(objectMap, "productName", s.ProductName) @@ -13031,7 +13257,7 @@ func (s *SolutionsReferenceDataProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SubAssessment. func (s SubAssessment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", s.ID) populate(objectMap, "name", s.Name) populate(objectMap, "properties", s.Properties) @@ -13070,7 +13296,7 @@ func (s *SubAssessment) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SubAssessmentList. func (s SubAssessmentList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", s.NextLink) populate(objectMap, "value", s.Value) return json.Marshal(objectMap) @@ -13101,7 +13327,7 @@ func (s *SubAssessmentList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SubAssessmentProperties. func (s SubAssessmentProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "additionalData", s.AdditionalData) populate(objectMap, "category", s.Category) populate(objectMap, "description", s.Description) @@ -13164,7 +13390,7 @@ func (s *SubAssessmentProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SubAssessmentStatus. func (s SubAssessmentStatus) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "cause", s.Cause) populate(objectMap, "code", s.Code) populate(objectMap, "description", s.Description) @@ -13203,7 +13429,7 @@ func (s *SubAssessmentStatus) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SuppressionAlertsScope. func (s SuppressionAlertsScope) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "allOf", s.AllOf) return json.Marshal(objectMap) } @@ -13230,7 +13456,7 @@ func (s *SuppressionAlertsScope) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) @@ -13277,7 +13503,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Tags. func (t Tags) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "tags", t.Tags) return json.Marshal(objectMap) } @@ -13304,7 +13530,7 @@ func (t *Tags) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TagsResource. func (t TagsResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "tags", t.Tags) return json.Marshal(objectMap) } @@ -13331,7 +13557,7 @@ func (t *TagsResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type Task. func (t Task) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", t.ID) populate(objectMap, "name", t.Name) populate(objectMap, "properties", t.Properties) @@ -13370,7 +13596,7 @@ func (t *Task) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TaskList. func (t TaskList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", t.NextLink) populate(objectMap, "value", t.Value) return json.Marshal(objectMap) @@ -13401,7 +13627,7 @@ func (t *TaskList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TaskParameters. func (t TaskParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "name", t.Name) if t.AdditionalProperties != nil { for key, val := range t.AdditionalProperties { @@ -13425,10 +13651,10 @@ func (t *TaskParameters) UnmarshalJSON(data []byte) error { delete(rawMsg, key) default: if t.AdditionalProperties == nil { - t.AdditionalProperties = map[string]interface{}{} + t.AdditionalProperties = map[string]any{} } if val != nil { - var aux interface{} + var aux any err = json.Unmarshal(val, &aux) t.AdditionalProperties[key] = aux } @@ -13443,7 +13669,7 @@ func (t *TaskParameters) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TaskProperties. func (t TaskProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "creationTimeUtc", t.CreationTimeUTC) populateTimeRFC3339(objectMap, "lastStateChangeTimeUtc", t.LastStateChangeTimeUTC) populate(objectMap, "securityTaskParameters", t.SecurityTaskParameters) @@ -13486,7 +13712,7 @@ func (t *TaskProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type ThresholdCustomAlertRule. func (t ThresholdCustomAlertRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", t.Description) populate(objectMap, "displayName", t.DisplayName) populate(objectMap, "isEnabled", t.IsEnabled) @@ -13533,7 +13759,7 @@ func (t *ThresholdCustomAlertRule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TimeWindowCustomAlertRule. func (t TimeWindowCustomAlertRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", t.Description) populate(objectMap, "displayName", t.DisplayName) populate(objectMap, "isEnabled", t.IsEnabled) @@ -13584,7 +13810,7 @@ func (t *TimeWindowCustomAlertRule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TopologyList. func (t TopologyList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", t.NextLink) populate(objectMap, "value", t.Value) return json.Marshal(objectMap) @@ -13615,7 +13841,7 @@ func (t *TopologyList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TopologyResource. func (t TopologyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", t.ID) populate(objectMap, "location", t.Location) populate(objectMap, "name", t.Name) @@ -13658,7 +13884,7 @@ func (t *TopologyResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TopologyResourceProperties. func (t TopologyResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "calculatedDateTime", t.CalculatedDateTime) populate(objectMap, "topologyResources", t.TopologyResources) return json.Marshal(objectMap) @@ -13689,7 +13915,7 @@ func (t *TopologyResourceProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TopologySingleResource. func (t TopologySingleResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "children", t.Children) populate(objectMap, "location", t.Location) populate(objectMap, "networkZones", t.NetworkZones) @@ -13744,7 +13970,7 @@ func (t *TopologySingleResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TopologySingleResourceChild. func (t TopologySingleResourceChild) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "resourceId", t.ResourceID) return json.Marshal(objectMap) } @@ -13771,7 +13997,7 @@ func (t *TopologySingleResourceChild) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TopologySingleResourceParent. func (t TopologySingleResourceParent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "resourceId", t.ResourceID) return json.Marshal(objectMap) } @@ -13798,7 +14024,7 @@ func (t *TopologySingleResourceParent) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TrackedResource. func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "etag", t.Etag) populate(objectMap, "id", t.ID) populate(objectMap, "kind", t.Kind) @@ -13849,7 +14075,7 @@ func (t *TrackedResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type TwinUpdatesNotInAllowedRange. func (t TwinUpdatesNotInAllowedRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", t.Description) populate(objectMap, "displayName", t.DisplayName) populate(objectMap, "isEnabled", t.IsEnabled) @@ -13900,7 +14126,7 @@ func (t *TwinUpdatesNotInAllowedRange) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type UnauthorizedOperationsNotInAllowedRange. func (u UnauthorizedOperationsNotInAllowedRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "description", u.Description) populate(objectMap, "displayName", u.DisplayName) populate(objectMap, "isEnabled", u.IsEnabled) @@ -13951,7 +14177,7 @@ func (u *UnauthorizedOperationsNotInAllowedRange) UnmarshalJSON(data []byte) err // MarshalJSON implements the json.Marshaller interface for type UpdateIoTSecuritySolutionProperties. func (u UpdateIoTSecuritySolutionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "recommendationsConfiguration", u.RecommendationsConfiguration) populate(objectMap, "userDefinedResources", u.UserDefinedResources) return json.Marshal(objectMap) @@ -13982,7 +14208,7 @@ func (u *UpdateIoTSecuritySolutionProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type UpdateIotSecuritySolutionData. func (u UpdateIotSecuritySolutionData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "properties", u.Properties) populate(objectMap, "tags", u.Tags) return json.Marshal(objectMap) @@ -14013,7 +14239,7 @@ func (u *UpdateIotSecuritySolutionData) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type UserDefinedResourcesProperties. func (u UserDefinedResourcesProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "query", u.Query) populate(objectMap, "querySubscriptions", u.QuerySubscriptions) return json.Marshal(objectMap) @@ -14044,7 +14270,7 @@ func (u *UserDefinedResourcesProperties) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type UserRecommendation. func (u UserRecommendation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "recommendationAction", u.RecommendationAction) populate(objectMap, "username", u.Username) return json.Marshal(objectMap) @@ -14075,7 +14301,7 @@ func (u *UserRecommendation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VMRecommendation. func (v VMRecommendation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "configurationStatus", v.ConfigurationStatus) populate(objectMap, "enforcementSupport", v.EnforcementSupport) populate(objectMap, "recommendationAction", v.RecommendationAction) @@ -14114,7 +14340,7 @@ func (v *VMRecommendation) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VaRule. func (v VaRule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "benchmarkReferences", v.BenchmarkReferences) populate(objectMap, "category", v.Category) populate(objectMap, "description", v.Description) @@ -14173,7 +14399,7 @@ func (v *VaRule) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type VendorReference. func (v VendorReference) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "link", v.Link) populate(objectMap, "title", v.Title) return json.Marshal(objectMap) @@ -14204,7 +14430,7 @@ func (v *VendorReference) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type WorkspaceSetting. func (w WorkspaceSetting) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "id", w.ID) populate(objectMap, "name", w.Name) populate(objectMap, "properties", w.Properties) @@ -14243,7 +14469,7 @@ func (w *WorkspaceSetting) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type WorkspaceSettingList. func (w WorkspaceSettingList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "nextLink", w.NextLink) populate(objectMap, "value", w.Value) return json.Marshal(objectMap) @@ -14274,7 +14500,7 @@ func (w *WorkspaceSettingList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type WorkspaceSettingProperties. func (w WorkspaceSettingProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "scope", w.Scope) populate(objectMap, "workspaceId", w.WorkspaceID) return json.Marshal(objectMap) @@ -14303,7 +14529,7 @@ func (w *WorkspaceSettingProperties) UnmarshalJSON(data []byte) error { return nil } -func populate(m map[string]interface{}, k string, v interface{}) { +func populate(m map[string]any, k string, v any) { if v == nil { return } else if azcore.IsNullValue(v) { @@ -14313,7 +14539,7 @@ func populate(m map[string]interface{}, k string, v interface{}) { } } -func populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.Base64Encoding) { +func populateByteArray(m map[string]any, k string, b []byte, f runtime.Base64Encoding) { if azcore.IsNullValue(b) { m[k] = nil } else if len(b) == 0 { @@ -14323,7 +14549,7 @@ func populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.B } } -func unpopulate(data json.RawMessage, fn string, v interface{}) error { +func unpopulate(data json.RawMessage, fn string, v any) error { if data == nil { return nil } diff --git a/sdk/resourcemanager/security/armsecurity/operations_client.go b/sdk/resourcemanager/security/armsecurity/operations_client.go index 08143882dd00..6950f05d1623 100644 --- a/sdk/resourcemanager/security/armsecurity/operations_client.go +++ b/sdk/resourcemanager/security/armsecurity/operations_client.go @@ -28,8 +28,8 @@ type OperationsClient struct { } // NewOperationsClient creates a new instance of OperationsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -50,8 +50,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - Exposes all available operations for discovery purposes. +// // Generated from API version 2015-06-01-preview -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ More: func(page OperationsClientListResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/polymorphic_helpers.go b/sdk/resourcemanager/security/armsecurity/polymorphic_helpers.go index 705cbc0ecb57..47c247b3bf3c 100644 --- a/sdk/resourcemanager/security/armsecurity/polymorphic_helpers.go +++ b/sdk/resourcemanager/security/armsecurity/polymorphic_helpers.go @@ -15,7 +15,7 @@ func unmarshalAdditionalDataClassification(rawMsg json.RawMessage) (AdditionalDa if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -37,7 +37,7 @@ func unmarshalAlertSimulatorRequestPropertiesClassification(rawMsg json.RawMessa if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -55,7 +55,7 @@ func unmarshalAllowlistCustomAlertRuleClassification(rawMsg json.RawMessage) (Al if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -98,7 +98,7 @@ func unmarshalAuthenticationDetailsPropertiesClassification(rawMsg json.RawMessa if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -120,7 +120,7 @@ func unmarshalAutomationActionClassification(rawMsg json.RawMessage) (Automation if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -161,7 +161,7 @@ func unmarshalAwsOrganizationalDataClassification(rawMsg json.RawMessage) (AwsOr if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -181,7 +181,7 @@ func unmarshalCloudOfferingClassification(rawMsg json.RawMessage) (CloudOffering if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -246,7 +246,7 @@ func unmarshalEnvironmentDataClassification(rawMsg json.RawMessage) (Environment if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -270,7 +270,7 @@ func unmarshalGcpOrganizationalDataClassification(rawMsg json.RawMessage) (GcpOr if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -290,7 +290,7 @@ func unmarshalResourceDetailsClassification(rawMsg json.RawMessage) (ResourceDet if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -312,7 +312,7 @@ func unmarshalResourceIdentifierClassification(rawMsg json.RawMessage) (Resource if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -351,7 +351,7 @@ func unmarshalSettingClassification(rawMsg json.RawMessage) (SettingClassificati if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -390,7 +390,7 @@ func unmarshalThresholdCustomAlertRuleClassification(rawMsg json.RawMessage) (Th if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -459,7 +459,7 @@ func unmarshalTimeWindowCustomAlertRuleClassification(rawMsg json.RawMessage) (T if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } diff --git a/sdk/resourcemanager/security/armsecurity/pricings_client.go b/sdk/resourcemanager/security/armsecurity/pricings_client.go index a0a17165cdbe..568c9ece727f 100644 --- a/sdk/resourcemanager/security/armsecurity/pricings_client.go +++ b/sdk/resourcemanager/security/armsecurity/pricings_client.go @@ -32,9 +32,9 @@ type PricingsClient struct { } // NewPricingsClient creates a new instance of PricingsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewPricingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PricingsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,9 +57,10 @@ func NewPricingsClient(subscriptionID string, credential azcore.TokenCredential, // Get - Gets a provided Microsoft Defender for Cloud pricing configuration in the subscription. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// pricingName - name of the pricing configuration -// options - PricingsClientGetOptions contains the optional parameters for the PricingsClient.Get method. +// - 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) { req, err := client.getCreateRequest(ctx, pricingName, options) if err != nil { @@ -108,8 +109,9 @@ func (client *PricingsClient) getHandleResponse(resp *http.Response) (PricingsCl // List - Lists Microsoft Defender for Cloud pricing configurations in the subscription. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// options - PricingsClientListOptions contains the optional parameters for the PricingsClient.List method. +// - options - PricingsClientListOptions contains the optional parameters for the PricingsClient.List method. func (client *PricingsClient) List(ctx context.Context, options *PricingsClientListOptions) (PricingsClientListResponse, error) { req, err := client.listCreateRequest(ctx, options) if err != nil { @@ -154,10 +156,11 @@ func (client *PricingsClient) listHandleResponse(resp *http.Response) (PricingsC // Update - Updates a provided Microsoft Defender for Cloud pricing configuration in the subscription. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-03-01 -// pricingName - name of the pricing configuration -// pricing - Pricing object -// options - PricingsClientUpdateOptions contains the optional parameters for the PricingsClient.Update method. +// - pricingName - name of the pricing configuration +// - 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) { req, err := client.updateCreateRequest(ctx, pricingName, pricing, options) if err != nil { diff --git a/sdk/resourcemanager/security/armsecurity/pricings_client_example_test.go b/sdk/resourcemanager/security/armsecurity/pricings_client_example_test.go deleted file mode 100644 index 48a67c84d2dc..000000000000 --- a/sdk/resourcemanager/security/armsecurity/pricings_client_example_test.go +++ /dev/null @@ -1,80 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2022-03-01/examples/Pricings/ListPricings_example.json -func ExamplePricingsClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewPricingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2022-03-01/examples/Pricings/GetPricingByName_example.json -func ExamplePricingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewPricingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "VirtualMachines", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2022-03-01/examples/Pricings/PutPricingByName_example.json -func ExamplePricingsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewPricingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "VirtualMachines", armsecurity.Pricing{ - Properties: &armsecurity.PricingProperties{ - PricingTier: to.Ptr(armsecurity.PricingTierStandard), - SubPlan: to.Ptr("P2"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/regulatorycomplianceassessments_client.go b/sdk/resourcemanager/security/armsecurity/regulatorycomplianceassessments_client.go index c7f6c9831394..8a222c6afdae 100644 --- a/sdk/resourcemanager/security/armsecurity/regulatorycomplianceassessments_client.go +++ b/sdk/resourcemanager/security/armsecurity/regulatorycomplianceassessments_client.go @@ -32,9 +32,9 @@ type RegulatoryComplianceAssessmentsClient struct { } // NewRegulatoryComplianceAssessmentsClient creates a new instance of RegulatoryComplianceAssessmentsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewRegulatoryComplianceAssessmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RegulatoryComplianceAssessmentsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewRegulatoryComplianceAssessmentsClient(subscriptionID string, credential // Get - Supported regulatory compliance details and state for selected assessment // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-01-01-preview -// regulatoryComplianceStandardName - Name of the regulatory compliance standard object -// regulatoryComplianceControlName - Name of the regulatory compliance control object -// regulatoryComplianceAssessmentName - Name of the regulatory compliance assessment object -// options - RegulatoryComplianceAssessmentsClientGetOptions contains the optional parameters for the RegulatoryComplianceAssessmentsClient.Get -// method. +// - regulatoryComplianceStandardName - Name of the regulatory compliance standard object +// - regulatoryComplianceControlName - Name of the regulatory compliance control object +// - regulatoryComplianceAssessmentName - Name of the regulatory compliance assessment object +// - 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) { req, err := client.getCreateRequest(ctx, regulatoryComplianceStandardName, regulatoryComplianceControlName, regulatoryComplianceAssessmentName, options) if err != nil { @@ -118,11 +119,12 @@ func (client *RegulatoryComplianceAssessmentsClient) getHandleResponse(resp *htt } // NewListPager - Details and state of assessments mapped to selected regulatory compliance control +// // Generated from API version 2019-01-01-preview -// regulatoryComplianceStandardName - Name of the regulatory compliance standard object -// regulatoryComplianceControlName - Name of the regulatory compliance control object -// options - RegulatoryComplianceAssessmentsClientListOptions contains the optional parameters for the RegulatoryComplianceAssessmentsClient.List -// method. +// - regulatoryComplianceStandardName - Name of the regulatory compliance standard object +// - regulatoryComplianceControlName - Name of the regulatory compliance control object +// - options - RegulatoryComplianceAssessmentsClientListOptions contains the optional parameters for the RegulatoryComplianceAssessmentsClient.NewListPager +// method. func (client *RegulatoryComplianceAssessmentsClient) NewListPager(regulatoryComplianceStandardName string, regulatoryComplianceControlName string, options *RegulatoryComplianceAssessmentsClientListOptions) *runtime.Pager[RegulatoryComplianceAssessmentsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[RegulatoryComplianceAssessmentsClientListResponse]{ More: func(page RegulatoryComplianceAssessmentsClientListResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/regulatorycomplianceassessments_client_example_test.go b/sdk/resourcemanager/security/armsecurity/regulatorycomplianceassessments_client_example_test.go deleted file mode 100644 index 287f3054f602..000000000000 --- a/sdk/resourcemanager/security/armsecurity/regulatorycomplianceassessments_client_example_test.go +++ /dev/null @@ -1,60 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceAssessmentList_example.json -func ExampleRegulatoryComplianceAssessmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewRegulatoryComplianceAssessmentsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("PCI-DSS-3.2", "1.1", &armsecurity.RegulatoryComplianceAssessmentsClientListOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceAssessment_example.json -func ExampleRegulatoryComplianceAssessmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewRegulatoryComplianceAssessmentsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "PCI-DSS-3.2", "1.1", "968548cb-02b3-8cd2-11f8-0cf64ab1a347", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/regulatorycompliancecontrols_client.go b/sdk/resourcemanager/security/armsecurity/regulatorycompliancecontrols_client.go index 87ae599a8b87..196ed97d2cee 100644 --- a/sdk/resourcemanager/security/armsecurity/regulatorycompliancecontrols_client.go +++ b/sdk/resourcemanager/security/armsecurity/regulatorycompliancecontrols_client.go @@ -32,9 +32,9 @@ type RegulatoryComplianceControlsClient struct { } // NewRegulatoryComplianceControlsClient creates a new instance of RegulatoryComplianceControlsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewRegulatoryComplianceControlsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RegulatoryComplianceControlsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewRegulatoryComplianceControlsClient(subscriptionID string, credential azc // Get - Selected regulatory compliance control details and state // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-01-01-preview -// regulatoryComplianceStandardName - Name of the regulatory compliance standard object -// regulatoryComplianceControlName - Name of the regulatory compliance control object -// options - RegulatoryComplianceControlsClientGetOptions contains the optional parameters for the RegulatoryComplianceControlsClient.Get -// method. +// - regulatoryComplianceStandardName - Name of the regulatory compliance standard object +// - regulatoryComplianceControlName - Name of the regulatory compliance control object +// - 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) { req, err := client.getCreateRequest(ctx, regulatoryComplianceStandardName, regulatoryComplianceControlName, options) if err != nil { @@ -113,10 +114,11 @@ func (client *RegulatoryComplianceControlsClient) getHandleResponse(resp *http.R } // NewListPager - All supported regulatory compliance controls details and state for selected standard +// // Generated from API version 2019-01-01-preview -// regulatoryComplianceStandardName - Name of the regulatory compliance standard object -// options - RegulatoryComplianceControlsClientListOptions contains the optional parameters for the RegulatoryComplianceControlsClient.List -// method. +// - regulatoryComplianceStandardName - Name of the regulatory compliance standard object +// - options - RegulatoryComplianceControlsClientListOptions contains the optional parameters for the RegulatoryComplianceControlsClient.NewListPager +// method. func (client *RegulatoryComplianceControlsClient) NewListPager(regulatoryComplianceStandardName string, options *RegulatoryComplianceControlsClientListOptions) *runtime.Pager[RegulatoryComplianceControlsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[RegulatoryComplianceControlsClientListResponse]{ More: func(page RegulatoryComplianceControlsClientListResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/regulatorycompliancecontrols_client_example_test.go b/sdk/resourcemanager/security/armsecurity/regulatorycompliancecontrols_client_example_test.go deleted file mode 100644 index 4143eaa4df38..000000000000 --- a/sdk/resourcemanager/security/armsecurity/regulatorycompliancecontrols_client_example_test.go +++ /dev/null @@ -1,60 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceControlList_example.json -func ExampleRegulatoryComplianceControlsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewRegulatoryComplianceControlsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("PCI-DSS-3.2", &armsecurity.RegulatoryComplianceControlsClientListOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceControl_example.json -func ExampleRegulatoryComplianceControlsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewRegulatoryComplianceControlsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "PCI-DSS-3.2", "1.1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/regulatorycompliancestandards_client.go b/sdk/resourcemanager/security/armsecurity/regulatorycompliancestandards_client.go index a5a30a27489b..3b16dc75eb76 100644 --- a/sdk/resourcemanager/security/armsecurity/regulatorycompliancestandards_client.go +++ b/sdk/resourcemanager/security/armsecurity/regulatorycompliancestandards_client.go @@ -32,9 +32,9 @@ type RegulatoryComplianceStandardsClient struct { } // NewRegulatoryComplianceStandardsClient creates a new instance of RegulatoryComplianceStandardsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewRegulatoryComplianceStandardsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RegulatoryComplianceStandardsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,10 +57,11 @@ func NewRegulatoryComplianceStandardsClient(subscriptionID string, credential az // Get - Supported regulatory compliance details state for selected standard // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-01-01-preview -// regulatoryComplianceStandardName - Name of the regulatory compliance standard object -// options - RegulatoryComplianceStandardsClientGetOptions contains the optional parameters for the RegulatoryComplianceStandardsClient.Get -// method. +// - regulatoryComplianceStandardName - Name of the regulatory compliance standard object +// - options - RegulatoryComplianceStandardsClientGetOptions contains the optional parameters for the RegulatoryComplianceStandardsClient.Get +// method. func (client *RegulatoryComplianceStandardsClient) Get(ctx context.Context, regulatoryComplianceStandardName string, options *RegulatoryComplianceStandardsClientGetOptions) (RegulatoryComplianceStandardsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, regulatoryComplianceStandardName, options) if err != nil { @@ -108,9 +109,10 @@ func (client *RegulatoryComplianceStandardsClient) getHandleResponse(resp *http. } // NewListPager - Supported regulatory compliance standards details and state +// // Generated from API version 2019-01-01-preview -// options - RegulatoryComplianceStandardsClientListOptions contains the optional parameters for the RegulatoryComplianceStandardsClient.List -// method. +// - options - RegulatoryComplianceStandardsClientListOptions contains the optional parameters for the RegulatoryComplianceStandardsClient.NewListPager +// method. func (client *RegulatoryComplianceStandardsClient) NewListPager(options *RegulatoryComplianceStandardsClientListOptions) *runtime.Pager[RegulatoryComplianceStandardsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[RegulatoryComplianceStandardsClientListResponse]{ More: func(page RegulatoryComplianceStandardsClientListResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/regulatorycompliancestandards_client_example_test.go b/sdk/resourcemanager/security/armsecurity/regulatorycompliancestandards_client_example_test.go deleted file mode 100644 index 1836d96f28aa..000000000000 --- a/sdk/resourcemanager/security/armsecurity/regulatorycompliancestandards_client_example_test.go +++ /dev/null @@ -1,60 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceStandardList_example.json -func ExampleRegulatoryComplianceStandardsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewRegulatoryComplianceStandardsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(&armsecurity.RegulatoryComplianceStandardsClientListOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/RegulatoryCompliance/getRegulatoryComplianceStandard_example.json -func ExampleRegulatoryComplianceStandardsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewRegulatoryComplianceStandardsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "PCI-DSS-3.2", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/response_types.go b/sdk/resourcemanager/security/armsecurity/response_types.go index 963f079a26de..dd7c809389f9 100644 --- a/sdk/resourcemanager/security/armsecurity/response_types.go +++ b/sdk/resourcemanager/security/armsecurity/response_types.go @@ -9,6 +9,26 @@ package armsecurity +// APICollectionClientGetResponse contains the response from method APICollectionClient.Get. +type APICollectionClientGetResponse struct { + APICollectionResponse +} + +// APICollectionClientListResponse contains the response from method APICollectionClient.NewListPager. +type APICollectionClientListResponse struct { + APICollectionResponseList +} + +// APICollectionOffboardingClientDeleteResponse contains the response from method APICollectionOffboardingClient.Delete. +type APICollectionOffboardingClientDeleteResponse struct { + // placeholder for future response values +} + +// APICollectionOnboardingClientCreateResponse contains the response from method APICollectionOnboardingClient.Create. +type APICollectionOnboardingClientCreateResponse struct { + APICollectionResponse +} + // AccountConnectorsClientCreateOrUpdateResponse contains the response from method AccountConnectorsClient.CreateOrUpdate. type AccountConnectorsClientCreateOrUpdateResponse struct { ConnectorSetting @@ -24,7 +44,7 @@ type AccountConnectorsClientGetResponse struct { ConnectorSetting } -// AccountConnectorsClientListResponse contains the response from method AccountConnectorsClient.List. +// AccountConnectorsClientListResponse contains the response from method AccountConnectorsClient.NewListPager. type AccountConnectorsClientListResponse struct { ConnectorSettingList } @@ -49,7 +69,7 @@ type AdaptiveApplicationControlsClientPutResponse struct { AdaptiveApplicationControlGroup } -// AdaptiveNetworkHardeningsClientEnforceResponse contains the response from method AdaptiveNetworkHardeningsClient.Enforce. +// AdaptiveNetworkHardeningsClientEnforceResponse contains the response from method AdaptiveNetworkHardeningsClient.BeginEnforce. type AdaptiveNetworkHardeningsClientEnforceResponse struct { // placeholder for future response values } @@ -59,7 +79,7 @@ type AdaptiveNetworkHardeningsClientGetResponse struct { AdaptiveNetworkHardening } -// AdaptiveNetworkHardeningsClientListByExtendedResourceResponse contains the response from method AdaptiveNetworkHardeningsClient.ListByExtendedResource. +// AdaptiveNetworkHardeningsClientListByExtendedResourceResponse contains the response from method AdaptiveNetworkHardeningsClient.NewListByExtendedResourcePager. type AdaptiveNetworkHardeningsClientListByExtendedResourceResponse struct { AdaptiveNetworkHardeningsList } @@ -84,27 +104,27 @@ type AlertsClientGetSubscriptionLevelResponse struct { Alert } -// AlertsClientListByResourceGroupResponse contains the response from method AlertsClient.ListByResourceGroup. +// AlertsClientListByResourceGroupResponse contains the response from method AlertsClient.NewListByResourceGroupPager. type AlertsClientListByResourceGroupResponse struct { AlertList } -// AlertsClientListResourceGroupLevelByRegionResponse contains the response from method AlertsClient.ListResourceGroupLevelByRegion. +// AlertsClientListResourceGroupLevelByRegionResponse contains the response from method AlertsClient.NewListResourceGroupLevelByRegionPager. type AlertsClientListResourceGroupLevelByRegionResponse struct { AlertList } -// AlertsClientListResponse contains the response from method AlertsClient.List. +// AlertsClientListResponse contains the response from method AlertsClient.NewListPager. type AlertsClientListResponse struct { AlertList } -// AlertsClientListSubscriptionLevelByRegionResponse contains the response from method AlertsClient.ListSubscriptionLevelByRegion. +// AlertsClientListSubscriptionLevelByRegionResponse contains the response from method AlertsClient.NewListSubscriptionLevelByRegionPager. type AlertsClientListSubscriptionLevelByRegionResponse struct { AlertList } -// AlertsClientSimulateResponse contains the response from method AlertsClient.Simulate. +// AlertsClientSimulateResponse contains the response from method AlertsClient.BeginSimulate. type AlertsClientSimulateResponse struct { // placeholder for future response values } @@ -159,7 +179,7 @@ type AlertsSuppressionRulesClientGetResponse struct { AlertsSuppressionRule } -// AlertsSuppressionRulesClientListResponse contains the response from method AlertsSuppressionRulesClient.List. +// AlertsSuppressionRulesClientListResponse contains the response from method AlertsSuppressionRulesClient.NewListPager. type AlertsSuppressionRulesClientListResponse struct { AlertsSuppressionRulesList } @@ -174,12 +194,12 @@ type AllowedConnectionsClientGetResponse struct { AllowedConnectionsResource } -// AllowedConnectionsClientListByHomeRegionResponse contains the response from method AllowedConnectionsClient.ListByHomeRegion. +// AllowedConnectionsClientListByHomeRegionResponse contains the response from method AllowedConnectionsClient.NewListByHomeRegionPager. type AllowedConnectionsClientListByHomeRegionResponse struct { AllowedConnectionsList } -// AllowedConnectionsClientListResponse contains the response from method AllowedConnectionsClient.List. +// AllowedConnectionsClientListResponse contains the response from method AllowedConnectionsClient.NewListPager. type AllowedConnectionsClientListResponse struct { AllowedConnectionsList } @@ -199,7 +219,7 @@ type ApplicationClientGetResponse struct { Application } -// ApplicationsClientListResponse contains the response from method ApplicationsClient.List. +// ApplicationsClientListResponse contains the response from method ApplicationsClient.NewListPager. type ApplicationsClientListResponse struct { ApplicationsList } @@ -219,7 +239,7 @@ type AssessmentsClientGetResponse struct { AssessmentResponse } -// AssessmentsClientListResponse contains the response from method AssessmentsClient.List. +// AssessmentsClientListResponse contains the response from method AssessmentsClient.NewListPager. type AssessmentsClientListResponse struct { AssessmentList } @@ -244,12 +264,12 @@ type AssessmentsMetadataClientGetResponse struct { AssessmentMetadataResponse } -// AssessmentsMetadataClientListBySubscriptionResponse contains the response from method AssessmentsMetadataClient.ListBySubscription. +// AssessmentsMetadataClientListBySubscriptionResponse contains the response from method AssessmentsMetadataClient.NewListBySubscriptionPager. type AssessmentsMetadataClientListBySubscriptionResponse struct { AssessmentMetadataResponseList } -// AssessmentsMetadataClientListResponse contains the response from method AssessmentsMetadataClient.List. +// AssessmentsMetadataClientListResponse contains the response from method AssessmentsMetadataClient.NewListPager. type AssessmentsMetadataClientListResponse struct { AssessmentMetadataResponseList } @@ -264,7 +284,7 @@ type AutoProvisioningSettingsClientGetResponse struct { AutoProvisioningSetting } -// AutoProvisioningSettingsClientListResponse contains the response from method AutoProvisioningSettingsClient.List. +// AutoProvisioningSettingsClientListResponse contains the response from method AutoProvisioningSettingsClient.NewListPager. type AutoProvisioningSettingsClientListResponse struct { AutoProvisioningSettingList } @@ -284,12 +304,12 @@ type AutomationsClientGetResponse struct { Automation } -// AutomationsClientListByResourceGroupResponse contains the response from method AutomationsClient.ListByResourceGroup. +// AutomationsClientListByResourceGroupResponse contains the response from method AutomationsClient.NewListByResourceGroupPager. type AutomationsClientListByResourceGroupResponse struct { AutomationList } -// AutomationsClientListResponse contains the response from method AutomationsClient.List. +// AutomationsClientListResponse contains the response from method AutomationsClient.NewListPager. type AutomationsClientListResponse struct { AutomationList } @@ -304,7 +324,7 @@ type ComplianceResultsClientGetResponse struct { ComplianceResult } -// ComplianceResultsClientListResponse contains the response from method ComplianceResultsClient.List. +// ComplianceResultsClientListResponse contains the response from method ComplianceResultsClient.NewListPager. type ComplianceResultsClientListResponse struct { ComplianceResultList } @@ -314,7 +334,7 @@ type CompliancesClientGetResponse struct { Compliance } -// CompliancesClientListResponse contains the response from method CompliancesClient.List. +// CompliancesClientListResponse contains the response from method CompliancesClient.NewListPager. type CompliancesClientListResponse struct { ComplianceList } @@ -334,36 +354,11 @@ type ConnectorApplicationClientGetResponse struct { Application } -// ConnectorApplicationsClientListResponse contains the response from method ConnectorApplicationsClient.List. +// ConnectorApplicationsClientListResponse contains the response from method ConnectorApplicationsClient.NewListPager. type ConnectorApplicationsClientListResponse struct { ApplicationsList } -// ConnectorGovernanceRuleClientListResponse contains the response from method ConnectorGovernanceRuleClient.List. -type ConnectorGovernanceRuleClientListResponse struct { - GovernanceRuleList -} - -// ConnectorGovernanceRulesClientCreateOrUpdateResponse contains the response from method ConnectorGovernanceRulesClient.CreateOrUpdate. -type ConnectorGovernanceRulesClientCreateOrUpdateResponse struct { - GovernanceRule -} - -// ConnectorGovernanceRulesClientDeleteResponse contains the response from method ConnectorGovernanceRulesClient.Delete. -type ConnectorGovernanceRulesClientDeleteResponse struct { - // placeholder for future response values -} - -// ConnectorGovernanceRulesClientGetResponse contains the response from method ConnectorGovernanceRulesClient.Get. -type ConnectorGovernanceRulesClientGetResponse struct { - GovernanceRule -} - -// ConnectorGovernanceRulesExecuteStatusClientGetResponse contains the response from method ConnectorGovernanceRulesExecuteStatusClient.Get. -type ConnectorGovernanceRulesExecuteStatusClientGetResponse struct { - ExecuteRuleStatus -} - // ConnectorsClientCreateOrUpdateResponse contains the response from method ConnectorsClient.CreateOrUpdate. type ConnectorsClientCreateOrUpdateResponse struct { Connector @@ -379,12 +374,12 @@ type ConnectorsClientGetResponse struct { Connector } -// ConnectorsClientListByResourceGroupResponse contains the response from method ConnectorsClient.ListByResourceGroup. +// ConnectorsClientListByResourceGroupResponse contains the response from method ConnectorsClient.NewListByResourceGroupPager. type ConnectorsClientListByResourceGroupResponse struct { ConnectorsList } -// ConnectorsClientListResponse contains the response from method ConnectorsClient.List. +// ConnectorsClientListResponse contains the response from method ConnectorsClient.NewListPager. type ConnectorsClientListResponse struct { ConnectorsList } @@ -409,7 +404,7 @@ type ContactsClientGetResponse struct { Contact } -// ContactsClientListResponse contains the response from method ContactsClient.List. +// ContactsClientListResponse contains the response from method ContactsClient.NewListPager. type ContactsClientListResponse struct { ContactList } @@ -429,12 +424,12 @@ type CustomAssessmentAutomationsClientGetResponse struct { CustomAssessmentAutomation } -// CustomAssessmentAutomationsClientListByResourceGroupResponse contains the response from method CustomAssessmentAutomationsClient.ListByResourceGroup. +// CustomAssessmentAutomationsClientListByResourceGroupResponse contains the response from method CustomAssessmentAutomationsClient.NewListByResourceGroupPager. type CustomAssessmentAutomationsClientListByResourceGroupResponse struct { CustomAssessmentAutomationsListResult } -// CustomAssessmentAutomationsClientListBySubscriptionResponse contains the response from method CustomAssessmentAutomationsClient.ListBySubscription. +// CustomAssessmentAutomationsClientListBySubscriptionResponse contains the response from method CustomAssessmentAutomationsClient.NewListBySubscriptionPager. type CustomAssessmentAutomationsClientListBySubscriptionResponse struct { CustomAssessmentAutomationsListResult } @@ -454,12 +449,12 @@ type CustomEntityStoreAssignmentsClientGetResponse struct { CustomEntityStoreAssignment } -// CustomEntityStoreAssignmentsClientListByResourceGroupResponse contains the response from method CustomEntityStoreAssignmentsClient.ListByResourceGroup. +// CustomEntityStoreAssignmentsClientListByResourceGroupResponse contains the response from method CustomEntityStoreAssignmentsClient.NewListByResourceGroupPager. type CustomEntityStoreAssignmentsClientListByResourceGroupResponse struct { CustomEntityStoreAssignmentsListResult } -// CustomEntityStoreAssignmentsClientListBySubscriptionResponse contains the response from method CustomEntityStoreAssignmentsClient.ListBySubscription. +// CustomEntityStoreAssignmentsClientListBySubscriptionResponse contains the response from method CustomEntityStoreAssignmentsClient.NewListBySubscriptionPager. type CustomEntityStoreAssignmentsClientListBySubscriptionResponse struct { CustomEntityStoreAssignmentsListResult } @@ -479,7 +474,7 @@ type DeviceSecurityGroupsClientGetResponse struct { DeviceSecurityGroup } -// DeviceSecurityGroupsClientListResponse contains the response from method DeviceSecurityGroupsClient.List. +// DeviceSecurityGroupsClientListResponse contains the response from method DeviceSecurityGroupsClient.NewListPager. type DeviceSecurityGroupsClientListResponse struct { DeviceSecurityGroupList } @@ -489,12 +484,12 @@ type DiscoveredSecuritySolutionsClientGetResponse struct { DiscoveredSecuritySolution } -// DiscoveredSecuritySolutionsClientListByHomeRegionResponse contains the response from method DiscoveredSecuritySolutionsClient.ListByHomeRegion. +// DiscoveredSecuritySolutionsClientListByHomeRegionResponse contains the response from method DiscoveredSecuritySolutionsClient.NewListByHomeRegionPager. type DiscoveredSecuritySolutionsClientListByHomeRegionResponse struct { DiscoveredSecuritySolutionList } -// DiscoveredSecuritySolutionsClientListResponse contains the response from method DiscoveredSecuritySolutionsClient.List. +// DiscoveredSecuritySolutionsClientListResponse contains the response from method DiscoveredSecuritySolutionsClient.NewListPager. type DiscoveredSecuritySolutionsClientListResponse struct { DiscoveredSecuritySolutionList } @@ -504,12 +499,12 @@ type ExternalSecuritySolutionsClientGetResponse struct { ExternalSecuritySolution } -// ExternalSecuritySolutionsClientListByHomeRegionResponse contains the response from method ExternalSecuritySolutionsClient.ListByHomeRegion. +// ExternalSecuritySolutionsClientListByHomeRegionResponse contains the response from method ExternalSecuritySolutionsClient.NewListByHomeRegionPager. type ExternalSecuritySolutionsClientListByHomeRegionResponse struct { ExternalSecuritySolutionList } -// ExternalSecuritySolutionsClientListResponse contains the response from method ExternalSecuritySolutionsClient.List. +// ExternalSecuritySolutionsClientListResponse contains the response from method ExternalSecuritySolutionsClient.NewListPager. type ExternalSecuritySolutionsClientListResponse struct { ExternalSecuritySolutionList } @@ -529,39 +524,41 @@ type GovernanceAssignmentsClientGetResponse struct { GovernanceAssignment } -// GovernanceAssignmentsClientListResponse contains the response from method GovernanceAssignmentsClient.List. +// GovernanceAssignmentsClientListResponse contains the response from method GovernanceAssignmentsClient.NewListPager. type GovernanceAssignmentsClientListResponse struct { GovernanceAssignmentsList } -// GovernanceRuleClientListResponse contains the response from method GovernanceRuleClient.List. -type GovernanceRuleClientListResponse struct { - GovernanceRuleList -} - // GovernanceRulesClientCreateOrUpdateResponse contains the response from method GovernanceRulesClient.CreateOrUpdate. type GovernanceRulesClientCreateOrUpdateResponse struct { GovernanceRule } -// GovernanceRulesClientDeleteResponse contains the response from method GovernanceRulesClient.Delete. +// GovernanceRulesClientDeleteResponse contains the response from method GovernanceRulesClient.BeginDelete. type GovernanceRulesClientDeleteResponse struct { // placeholder for future response values } +// GovernanceRulesClientExecuteResponse contains the response from method GovernanceRulesClient.BeginExecute. +type GovernanceRulesClientExecuteResponse struct { + // placeholder for future response values +} + // GovernanceRulesClientGetResponse contains the response from method GovernanceRulesClient.Get. type GovernanceRulesClientGetResponse struct { GovernanceRule } -// GovernanceRulesClientRuleIDExecuteSingleSecurityConnectorResponse contains the response from method GovernanceRulesClient.RuleIDExecuteSingleSecurityConnector. -type GovernanceRulesClientRuleIDExecuteSingleSecurityConnectorResponse struct { - // placeholder for future response values +// GovernanceRulesClientListResponse contains the response from method GovernanceRulesClient.NewListPager. +type GovernanceRulesClientListResponse struct { + GovernanceRuleList } -// GovernanceRulesClientRuleIDExecuteSingleSubscriptionResponse contains the response from method GovernanceRulesClient.RuleIDExecuteSingleSubscription. -type GovernanceRulesClientRuleIDExecuteSingleSubscriptionResponse struct { - // placeholder for future response values +// GovernanceRulesClientOperationResultsResponse contains the response from method GovernanceRulesClient.OperationResults. +type GovernanceRulesClientOperationResultsResponse struct { + OperationResultAutoGenerated + // Location contains the information returned from the location header response. + Location *string } // InformationProtectionPoliciesClientCreateOrUpdateResponse contains the response from method InformationProtectionPoliciesClient.CreateOrUpdate. @@ -574,7 +571,7 @@ type InformationProtectionPoliciesClientGetResponse struct { InformationProtectionPolicy } -// InformationProtectionPoliciesClientListResponse contains the response from method InformationProtectionPoliciesClient.List. +// InformationProtectionPoliciesClientListResponse contains the response from method InformationProtectionPoliciesClient.NewListPager. type InformationProtectionPoliciesClientListResponse struct { InformationProtectionPolicyList } @@ -599,7 +596,7 @@ type IngestionSettingsClientListConnectionStringsResponse struct { ConnectionStrings } -// IngestionSettingsClientListResponse contains the response from method IngestionSettingsClient.List. +// IngestionSettingsClientListResponse contains the response from method IngestionSettingsClient.NewListPager. type IngestionSettingsClientListResponse struct { IngestionSettingList } @@ -634,12 +631,12 @@ type IotSecuritySolutionClientGetResponse struct { IoTSecuritySolutionModel } -// IotSecuritySolutionClientListByResourceGroupResponse contains the response from method IotSecuritySolutionClient.ListByResourceGroup. +// IotSecuritySolutionClientListByResourceGroupResponse contains the response from method IotSecuritySolutionClient.NewListByResourceGroupPager. type IotSecuritySolutionClientListByResourceGroupResponse struct { IoTSecuritySolutionsList } -// IotSecuritySolutionClientListBySubscriptionResponse contains the response from method IotSecuritySolutionClient.ListBySubscription. +// IotSecuritySolutionClientListBySubscriptionResponse contains the response from method IotSecuritySolutionClient.NewListBySubscriptionPager. type IotSecuritySolutionClientListBySubscriptionResponse struct { IoTSecuritySolutionsList } @@ -659,7 +656,7 @@ type IotSecuritySolutionsAnalyticsAggregatedAlertClientGetResponse struct { IoTSecurityAggregatedAlert } -// IotSecuritySolutionsAnalyticsAggregatedAlertClientListResponse contains the response from method IotSecuritySolutionsAnalyticsAggregatedAlertClient.List. +// IotSecuritySolutionsAnalyticsAggregatedAlertClientListResponse contains the response from method IotSecuritySolutionsAnalyticsAggregatedAlertClient.NewListPager. type IotSecuritySolutionsAnalyticsAggregatedAlertClientListResponse struct { IoTSecurityAggregatedAlertList } @@ -669,7 +666,7 @@ type IotSecuritySolutionsAnalyticsRecommendationClientGetResponse struct { IoTSecurityAggregatedRecommendation } -// IotSecuritySolutionsAnalyticsRecommendationClientListResponse contains the response from method IotSecuritySolutionsAnalyticsRecommendationClient.List. +// IotSecuritySolutionsAnalyticsRecommendationClientListResponse contains the response from method IotSecuritySolutionsAnalyticsRecommendationClient.NewListPager. type IotSecuritySolutionsAnalyticsRecommendationClientListResponse struct { IoTSecurityAggregatedRecommendationList } @@ -694,22 +691,22 @@ type JitNetworkAccessPoliciesClientInitiateResponse struct { JitNetworkAccessRequest } -// JitNetworkAccessPoliciesClientListByRegionResponse contains the response from method JitNetworkAccessPoliciesClient.ListByRegion. +// JitNetworkAccessPoliciesClientListByRegionResponse contains the response from method JitNetworkAccessPoliciesClient.NewListByRegionPager. type JitNetworkAccessPoliciesClientListByRegionResponse struct { JitNetworkAccessPoliciesList } -// JitNetworkAccessPoliciesClientListByResourceGroupAndRegionResponse contains the response from method JitNetworkAccessPoliciesClient.ListByResourceGroupAndRegion. +// JitNetworkAccessPoliciesClientListByResourceGroupAndRegionResponse contains the response from method JitNetworkAccessPoliciesClient.NewListByResourceGroupAndRegionPager. type JitNetworkAccessPoliciesClientListByResourceGroupAndRegionResponse struct { JitNetworkAccessPoliciesList } -// JitNetworkAccessPoliciesClientListByResourceGroupResponse contains the response from method JitNetworkAccessPoliciesClient.ListByResourceGroup. +// JitNetworkAccessPoliciesClientListByResourceGroupResponse contains the response from method JitNetworkAccessPoliciesClient.NewListByResourceGroupPager. type JitNetworkAccessPoliciesClientListByResourceGroupResponse struct { JitNetworkAccessPoliciesList } -// JitNetworkAccessPoliciesClientListResponse contains the response from method JitNetworkAccessPoliciesClient.List. +// JitNetworkAccessPoliciesClientListResponse contains the response from method JitNetworkAccessPoliciesClient.NewListPager. type JitNetworkAccessPoliciesClientListResponse struct { JitNetworkAccessPoliciesList } @@ -719,7 +716,7 @@ type LocationsClientGetResponse struct { AscLocation } -// LocationsClientListResponse contains the response from method LocationsClient.List. +// LocationsClientListResponse contains the response from method LocationsClient.NewListPager. type LocationsClientListResponse struct { AscLocationList } @@ -734,7 +731,7 @@ type MdeOnboardingsClientListResponse struct { MdeOnboardingDataList } -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { OperationList } @@ -759,7 +756,7 @@ type RegulatoryComplianceAssessmentsClientGetResponse struct { RegulatoryComplianceAssessment } -// RegulatoryComplianceAssessmentsClientListResponse contains the response from method RegulatoryComplianceAssessmentsClient.List. +// RegulatoryComplianceAssessmentsClientListResponse contains the response from method RegulatoryComplianceAssessmentsClient.NewListPager. type RegulatoryComplianceAssessmentsClientListResponse struct { RegulatoryComplianceAssessmentList } @@ -769,7 +766,7 @@ type RegulatoryComplianceControlsClientGetResponse struct { RegulatoryComplianceControl } -// RegulatoryComplianceControlsClientListResponse contains the response from method RegulatoryComplianceControlsClient.List. +// RegulatoryComplianceControlsClientListResponse contains the response from method RegulatoryComplianceControlsClient.NewListPager. type RegulatoryComplianceControlsClientListResponse struct { RegulatoryComplianceControlList } @@ -779,7 +776,7 @@ type RegulatoryComplianceStandardsClientGetResponse struct { RegulatoryComplianceStandard } -// RegulatoryComplianceStandardsClientListResponse contains the response from method RegulatoryComplianceStandardsClient.List. +// RegulatoryComplianceStandardsClientListResponse contains the response from method RegulatoryComplianceStandardsClient.NewListPager. type RegulatoryComplianceStandardsClientListResponse struct { RegulatoryComplianceStandardList } @@ -829,22 +826,22 @@ type SQLVulnerabilityAssessmentScansClientListResponse struct { Scans } -// SecureScoreControlDefinitionsClientListBySubscriptionResponse contains the response from method SecureScoreControlDefinitionsClient.ListBySubscription. +// SecureScoreControlDefinitionsClientListBySubscriptionResponse contains the response from method SecureScoreControlDefinitionsClient.NewListBySubscriptionPager. type SecureScoreControlDefinitionsClientListBySubscriptionResponse struct { SecureScoreControlDefinitionList } -// SecureScoreControlDefinitionsClientListResponse contains the response from method SecureScoreControlDefinitionsClient.List. +// SecureScoreControlDefinitionsClientListResponse contains the response from method SecureScoreControlDefinitionsClient.NewListPager. type SecureScoreControlDefinitionsClientListResponse struct { SecureScoreControlDefinitionList } -// SecureScoreControlsClientListBySecureScoreResponse contains the response from method SecureScoreControlsClient.ListBySecureScore. +// SecureScoreControlsClientListBySecureScoreResponse contains the response from method SecureScoreControlsClient.NewListBySecureScorePager. type SecureScoreControlsClientListBySecureScoreResponse struct { SecureScoreControlList } -// SecureScoreControlsClientListResponse contains the response from method SecureScoreControlsClient.List. +// SecureScoreControlsClientListResponse contains the response from method SecureScoreControlsClient.NewListPager. type SecureScoreControlsClientListResponse struct { SecureScoreControlList } @@ -854,7 +851,7 @@ type SecureScoresClientGetResponse struct { SecureScoreItem } -// SecureScoresClientListResponse contains the response from method SecureScoresClient.List. +// SecureScoresClientListResponse contains the response from method SecureScoresClient.NewListPager. type SecureScoresClientListResponse struct { SecureScoresList } @@ -864,7 +861,7 @@ type ServerVulnerabilityAssessmentClientCreateOrUpdateResponse struct { ServerVulnerabilityAssessment } -// ServerVulnerabilityAssessmentClientDeleteResponse contains the response from method ServerVulnerabilityAssessmentClient.Delete. +// ServerVulnerabilityAssessmentClientDeleteResponse contains the response from method ServerVulnerabilityAssessmentClient.BeginDelete. type ServerVulnerabilityAssessmentClientDeleteResponse struct { // placeholder for future response values } @@ -894,7 +891,7 @@ func (s *SettingsClientGetResponse) UnmarshalJSON(data []byte) error { return nil } -// SettingsClientListResponse contains the response from method SettingsClient.List. +// SettingsClientListResponse contains the response from method SettingsClient.NewListPager. type SettingsClientListResponse struct { SettingsList } @@ -919,12 +916,12 @@ type SoftwareInventoriesClientGetResponse struct { Software } -// SoftwareInventoriesClientListByExtendedResourceResponse contains the response from method SoftwareInventoriesClient.ListByExtendedResource. +// SoftwareInventoriesClientListByExtendedResourceResponse contains the response from method SoftwareInventoriesClient.NewListByExtendedResourcePager. type SoftwareInventoriesClientListByExtendedResourceResponse struct { SoftwaresList } -// SoftwareInventoriesClientListBySubscriptionResponse contains the response from method SoftwareInventoriesClient.ListBySubscription. +// SoftwareInventoriesClientListBySubscriptionResponse contains the response from method SoftwareInventoriesClient.NewListBySubscriptionPager. type SoftwareInventoriesClientListBySubscriptionResponse struct { SoftwaresList } @@ -934,7 +931,7 @@ type SolutionsClientGetResponse struct { Solution } -// SolutionsClientListResponse contains the response from method SolutionsClient.List. +// SolutionsClientListResponse contains the response from method SolutionsClient.NewListPager. type SolutionsClientListResponse struct { SolutionList } @@ -954,21 +951,16 @@ type SubAssessmentsClientGetResponse struct { SubAssessment } -// SubAssessmentsClientListAllResponse contains the response from method SubAssessmentsClient.ListAll. +// SubAssessmentsClientListAllResponse contains the response from method SubAssessmentsClient.NewListAllPager. type SubAssessmentsClientListAllResponse struct { SubAssessmentList } -// SubAssessmentsClientListResponse contains the response from method SubAssessmentsClient.List. +// SubAssessmentsClientListResponse contains the response from method SubAssessmentsClient.NewListPager. type SubAssessmentsClientListResponse struct { SubAssessmentList } -// SubscriptionGovernanceRulesExecuteStatusClientGetResponse contains the response from method SubscriptionGovernanceRulesExecuteStatusClient.Get. -type SubscriptionGovernanceRulesExecuteStatusClientGetResponse struct { - ExecuteRuleStatus -} - // TasksClientGetResourceGroupLevelTaskResponse contains the response from method TasksClient.GetResourceGroupLevelTask. type TasksClientGetResourceGroupLevelTaskResponse struct { Task @@ -979,17 +971,17 @@ type TasksClientGetSubscriptionLevelTaskResponse struct { Task } -// TasksClientListByHomeRegionResponse contains the response from method TasksClient.ListByHomeRegion. +// TasksClientListByHomeRegionResponse contains the response from method TasksClient.NewListByHomeRegionPager. type TasksClientListByHomeRegionResponse struct { TaskList } -// TasksClientListByResourceGroupResponse contains the response from method TasksClient.ListByResourceGroup. +// TasksClientListByResourceGroupResponse contains the response from method TasksClient.NewListByResourceGroupPager. type TasksClientListByResourceGroupResponse struct { TaskList } -// TasksClientListResponse contains the response from method TasksClient.List. +// TasksClientListResponse contains the response from method TasksClient.NewListPager. type TasksClientListResponse struct { TaskList } @@ -1009,12 +1001,12 @@ type TopologyClientGetResponse struct { TopologyResource } -// TopologyClientListByHomeRegionResponse contains the response from method TopologyClient.ListByHomeRegion. +// TopologyClientListByHomeRegionResponse contains the response from method TopologyClient.NewListByHomeRegionPager. type TopologyClientListByHomeRegionResponse struct { TopologyList } -// TopologyClientListResponse contains the response from method TopologyClient.List. +// TopologyClientListResponse contains the response from method TopologyClient.NewListPager. type TopologyClientListResponse struct { TopologyList } @@ -1034,7 +1026,7 @@ type WorkspaceSettingsClientGetResponse struct { WorkspaceSetting } -// WorkspaceSettingsClientListResponse contains the response from method WorkspaceSettingsClient.List. +// WorkspaceSettingsClientListResponse contains the response from method WorkspaceSettingsClient.NewListPager. type WorkspaceSettingsClientListResponse struct { WorkspaceSettingList } diff --git a/sdk/resourcemanager/security/armsecurity/securescorecontroldefinitions_client.go b/sdk/resourcemanager/security/armsecurity/securescorecontroldefinitions_client.go index a7fbfbc1bd78..1042df08cb07 100644 --- a/sdk/resourcemanager/security/armsecurity/securescorecontroldefinitions_client.go +++ b/sdk/resourcemanager/security/armsecurity/securescorecontroldefinitions_client.go @@ -32,9 +32,9 @@ type SecureScoreControlDefinitionsClient struct { } // NewSecureScoreControlDefinitionsClient creates a new instance of SecureScoreControlDefinitionsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSecureScoreControlDefinitionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecureScoreControlDefinitionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,9 +56,10 @@ func NewSecureScoreControlDefinitionsClient(subscriptionID string, credential az } // NewListPager - List the available security controls, their assessments, and the max score +// // Generated from API version 2020-01-01 -// options - SecureScoreControlDefinitionsClientListOptions contains the optional parameters for the SecureScoreControlDefinitionsClient.List -// method. +// - options - SecureScoreControlDefinitionsClientListOptions contains the optional parameters for the SecureScoreControlDefinitionsClient.NewListPager +// method. func (client *SecureScoreControlDefinitionsClient) NewListPager(options *SecureScoreControlDefinitionsClientListOptions) *runtime.Pager[SecureScoreControlDefinitionsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SecureScoreControlDefinitionsClientListResponse]{ More: func(page SecureScoreControlDefinitionsClientListResponse) bool { @@ -112,9 +113,10 @@ func (client *SecureScoreControlDefinitionsClient) listHandleResponse(resp *http // NewListBySubscriptionPager - For a specified subscription, list the available security controls, their assessments, and // the max score +// // Generated from API version 2020-01-01 -// options - SecureScoreControlDefinitionsClientListBySubscriptionOptions contains the optional parameters for the SecureScoreControlDefinitionsClient.ListBySubscription -// method. +// - options - SecureScoreControlDefinitionsClientListBySubscriptionOptions contains the optional parameters for the SecureScoreControlDefinitionsClient.NewListBySubscriptionPager +// method. func (client *SecureScoreControlDefinitionsClient) NewListBySubscriptionPager(options *SecureScoreControlDefinitionsClientListBySubscriptionOptions) *runtime.Pager[SecureScoreControlDefinitionsClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[SecureScoreControlDefinitionsClientListBySubscriptionResponse]{ More: func(page SecureScoreControlDefinitionsClientListBySubscriptionResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/securescorecontroldefinitions_client_example_test.go b/sdk/resourcemanager/security/armsecurity/securescorecontroldefinitions_client_example_test.go deleted file mode 100644 index 3e0d0f8a5be8..000000000000 --- a/sdk/resourcemanager/security/armsecurity/securescorecontroldefinitions_client_example_test.go +++ /dev/null @@ -1,65 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScoreControlDefinitions/ListSecureScoreControlDefinitions_example.json -func ExampleSecureScoreControlDefinitionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSecureScoreControlDefinitionsClient("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScoreControlDefinitions/ListSecureScoreControlDefinitions_subscription_example.json -func ExampleSecureScoreControlDefinitionsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSecureScoreControlDefinitionsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/securescorecontrols_client.go b/sdk/resourcemanager/security/armsecurity/securescorecontrols_client.go index 10a012481b94..953a55f4ec70 100644 --- a/sdk/resourcemanager/security/armsecurity/securescorecontrols_client.go +++ b/sdk/resourcemanager/security/armsecurity/securescorecontrols_client.go @@ -32,9 +32,9 @@ type SecureScoreControlsClient struct { } // NewSecureScoreControlsClient creates a new instance of SecureScoreControlsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSecureScoreControlsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecureScoreControlsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,9 +56,10 @@ func NewSecureScoreControlsClient(subscriptionID string, credential azcore.Token } // NewListPager - Get all security controls within a scope +// // Generated from API version 2020-01-01 -// options - SecureScoreControlsClientListOptions contains the optional parameters for the SecureScoreControlsClient.List -// method. +// - options - SecureScoreControlsClientListOptions contains the optional parameters for the SecureScoreControlsClient.NewListPager +// method. func (client *SecureScoreControlsClient) NewListPager(options *SecureScoreControlsClientListOptions) *runtime.Pager[SecureScoreControlsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SecureScoreControlsClientListResponse]{ More: func(page SecureScoreControlsClientListResponse) bool { @@ -118,10 +119,11 @@ func (client *SecureScoreControlsClient) listHandleResponse(resp *http.Response) } // NewListBySecureScorePager - Get all security controls for a specific initiative within a scope +// // Generated from API version 2020-01-01 -// secureScoreName - The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below. -// options - SecureScoreControlsClientListBySecureScoreOptions contains the optional parameters for the SecureScoreControlsClient.ListBySecureScore -// method. +// - secureScoreName - The initiative name. For the ASC Default initiative, use 'ascScore' as in the sample request below. +// - options - SecureScoreControlsClientListBySecureScoreOptions contains the optional parameters for the SecureScoreControlsClient.NewListBySecureScorePager +// method. func (client *SecureScoreControlsClient) NewListBySecureScorePager(secureScoreName string, options *SecureScoreControlsClientListBySecureScoreOptions) *runtime.Pager[SecureScoreControlsClientListBySecureScoreResponse] { return runtime.NewPager(runtime.PagingHandler[SecureScoreControlsClientListBySecureScoreResponse]{ More: func(page SecureScoreControlsClientListBySecureScoreResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/securescorecontrols_client_example_test.go b/sdk/resourcemanager/security/armsecurity/securescorecontrols_client_example_test.go deleted file mode 100644 index dc9e31d12808..000000000000 --- a/sdk/resourcemanager/security/armsecurity/securescorecontrols_client_example_test.go +++ /dev/null @@ -1,90 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScoreControlsForName_builtin_example.json -func ExampleSecureScoreControlsClient_NewListBySecureScorePager_getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiative() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSecureScoreControlsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySecureScorePager("ascScore", &armsecurity.SecureScoreControlsClientListBySecureScoreOptions{Expand: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScoreControlsForNameWithExpand_builtin_example.json -func ExampleSecureScoreControlsClient_NewListBySecureScorePager_getSecurityControlsAndTheirCurrentScoreForTheSpecifiedInitiativeWithTheExpandParameter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSecureScoreControlsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySecureScorePager("ascScore", &armsecurity.SecureScoreControlsClientListBySecureScoreOptions{Expand: to.Ptr(armsecurity.ExpandControlsEnumDefinition)}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScoreControls_example.json -func ExampleSecureScoreControlsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSecureScoreControlsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(&armsecurity.SecureScoreControlsClientListOptions{Expand: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/security/armsecurity/securescores_client.go b/sdk/resourcemanager/security/armsecurity/securescores_client.go index ea9cc67328a8..dfd1de8ce802 100644 --- a/sdk/resourcemanager/security/armsecurity/securescores_client.go +++ b/sdk/resourcemanager/security/armsecurity/securescores_client.go @@ -32,9 +32,9 @@ type SecureScoresClient struct { } // NewSecureScoresClient creates a new instance of SecureScoresClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSecureScoresClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecureScoresClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,9 +58,10 @@ func NewSecureScoresClient(subscriptionID string, credential azcore.TokenCredent // Get - Get secure score for a specific Microsoft Defender for Cloud initiative within your current scope. For the ASC Default // initiative, use 'ascScore'. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01 -// 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. +// - 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) { req, err := client.getCreateRequest(ctx, secureScoreName, options) if err != nil { @@ -108,8 +109,9 @@ func (client *SecureScoresClient) getHandleResponse(resp *http.Response) (Secure } // NewListPager - List secure scores for all your Microsoft Defender for Cloud initiatives within your current scope. +// // Generated from API version 2020-01-01 -// options - SecureScoresClientListOptions contains the optional parameters for the SecureScoresClient.List method. +// - options - SecureScoresClientListOptions contains the optional parameters for the SecureScoresClient.NewListPager method. func (client *SecureScoresClient) NewListPager(options *SecureScoresClientListOptions) *runtime.Pager[SecureScoresClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SecureScoresClientListResponse]{ More: func(page SecureScoresClientListResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/securescores_client_example_test.go b/sdk/resourcemanager/security/armsecurity/securescores_client_example_test.go deleted file mode 100644 index 506ee95f68e9..000000000000 --- a/sdk/resourcemanager/security/armsecurity/securescores_client_example_test.go +++ /dev/null @@ -1,60 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/ListSecureScores_example.json -func ExampleSecureScoresClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSecureScoresClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/secureScores/GetSecureScoresSingle_example.json -func ExampleSecureScoresClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSecureScoresClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "ascScore", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessment_client.go b/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessment_client.go index 6552c0d8711c..4764d8e1bd28 100644 --- a/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessment_client.go +++ b/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessment_client.go @@ -32,9 +32,9 @@ type ServerVulnerabilityAssessmentClient struct { } // NewServerVulnerabilityAssessmentClient creates a new instance of ServerVulnerabilityAssessmentClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewServerVulnerabilityAssessmentClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerVulnerabilityAssessmentClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ func NewServerVulnerabilityAssessmentClient(subscriptionID string, credential az // CreateOrUpdate - Creating a server vulnerability assessment on a resource, which will onboard a resource for having a vulnerability // assessment on it // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// resourceNamespace - The Namespace of the resource. -// resourceType - The type of the resource. -// resourceName - Name of the resource. -// options - ServerVulnerabilityAssessmentClientCreateOrUpdateOptions contains the optional parameters for the ServerVulnerabilityAssessmentClient.CreateOrUpdate -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - resourceNamespace - The Namespace of the resource. +// - resourceType - The type of the resource. +// - resourceName - Name of the resource. +// - options - 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) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, options) if err != nil { @@ -126,13 +127,14 @@ func (client *ServerVulnerabilityAssessmentClient) createOrUpdateHandleResponse( // BeginDelete - Removing server vulnerability assessment from a resource. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// resourceNamespace - The Namespace of the resource. -// resourceType - The type of the resource. -// resourceName - Name of the resource. -// options - ServerVulnerabilityAssessmentClientBeginDeleteOptions contains the optional parameters for the ServerVulnerabilityAssessmentClient.BeginDelete -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - resourceNamespace - The Namespace of the resource. +// - resourceType - The type of the resource. +// - resourceName - Name of the resource. +// - options - ServerVulnerabilityAssessmentClientBeginDeleteOptions contains the optional parameters for the ServerVulnerabilityAssessmentClient.BeginDelete +// method. func (client *ServerVulnerabilityAssessmentClient) BeginDelete(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, options *ServerVulnerabilityAssessmentClientBeginDeleteOptions) (*runtime.Poller[ServerVulnerabilityAssessmentClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, options) @@ -149,6 +151,7 @@ func (client *ServerVulnerabilityAssessmentClient) BeginDelete(ctx context.Conte // Delete - Removing server vulnerability assessment from a resource. // If the operation fails it returns an *azcore.ResponseError type. +// // 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) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, options) @@ -202,13 +205,14 @@ func (client *ServerVulnerabilityAssessmentClient) deleteCreateRequest(ctx conte // Get - Gets a server vulnerability assessment onboarding statuses on a given resource. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// resourceNamespace - The Namespace of the resource. -// resourceType - The type of the resource. -// resourceName - Name of the resource. -// options - ServerVulnerabilityAssessmentClientGetOptions contains the optional parameters for the ServerVulnerabilityAssessmentClient.Get -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - resourceNamespace - The Namespace of the resource. +// - resourceType - The type of the resource. +// - resourceName - Name of the resource. +// - options - 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) { req, err := client.getCreateRequest(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, options) if err != nil { @@ -270,13 +274,14 @@ func (client *ServerVulnerabilityAssessmentClient) getHandleResponse(resp *http. // ListByExtendedResource - Gets a list of server vulnerability assessment onboarding statuses on a given resource. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// resourceNamespace - The Namespace of the resource. -// resourceType - The type of the resource. -// resourceName - Name of the resource. -// options - ServerVulnerabilityAssessmentClientListByExtendedResourceOptions contains the optional parameters for the ServerVulnerabilityAssessmentClient.ListByExtendedResource -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - resourceNamespace - The Namespace of the resource. +// - resourceType - The type of the resource. +// - resourceName - Name of the resource. +// - options - 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) { req, err := client.listByExtendedResourceCreateRequest(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, options) if err != nil { diff --git a/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessment_client_example_test.go b/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessment_client_example_test.go deleted file mode 100644 index 7c6c55f75211..000000000000 --- a/sdk/resourcemanager/security/armsecurity/servervulnerabilityassessment_client_example_test.go +++ /dev/null @@ -1,93 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/ListByExtendedResourceServerVulnerabilityAssessments_example.json -func ExampleServerVulnerabilityAssessmentClient_ListByExtendedResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewServerVulnerabilityAssessmentClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByExtendedResource(ctx, "rg1", "Microsoft.Compute", "virtualMachines", "vm1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/GetServerVulnerabilityAssessments_example.json -func ExampleServerVulnerabilityAssessmentClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewServerVulnerabilityAssessmentClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "rg1", "Microsoft.Compute", "virtualMachines", "vm1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/CreateServerVulnerabilityAssessments_example.json -func ExampleServerVulnerabilityAssessmentClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewServerVulnerabilityAssessmentClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.CreateOrUpdate(ctx, "rg1", "Microsoft.Compute", "virtualMachines", "vm1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/ServerVulnerabilityAssessments/DeleteServerVulnerabilityAssessments_example.json -func ExampleServerVulnerabilityAssessmentClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewServerVulnerabilityAssessmentClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, "rg1", "Microsoft.Compute", "virtualMachines", "vm1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/settings_client.go b/sdk/resourcemanager/security/armsecurity/settings_client.go index 8642ee568ed1..45fdc1dd311f 100644 --- a/sdk/resourcemanager/security/armsecurity/settings_client.go +++ b/sdk/resourcemanager/security/armsecurity/settings_client.go @@ -32,9 +32,9 @@ type SettingsClient struct { } // NewSettingsClient creates a new instance of SettingsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SettingsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,9 +57,10 @@ func NewSettingsClient(subscriptionID string, credential azcore.TokenCredential, // Get - Settings of different configurations in Microsoft Defender for Cloud // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-05-01 -// settingName - The name of the setting -// options - SettingsClientGetOptions contains the optional parameters for the SettingsClient.Get method. +// - 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) { req, err := client.getCreateRequest(ctx, settingName, options) if err != nil { @@ -107,8 +108,9 @@ func (client *SettingsClient) getHandleResponse(resp *http.Response) (SettingsCl } // NewListPager - Settings about different configurations in Microsoft Defender for Cloud +// // Generated from API version 2022-05-01 -// options - SettingsClientListOptions contains the optional parameters for the SettingsClient.List method. +// - options - SettingsClientListOptions contains the optional parameters for the SettingsClient.NewListPager method. func (client *SettingsClient) NewListPager(options *SettingsClientListOptions) *runtime.Pager[SettingsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SettingsClientListResponse]{ More: func(page SettingsClientListResponse) bool { @@ -166,10 +168,11 @@ func (client *SettingsClient) listHandleResponse(resp *http.Response) (SettingsC // Update - updating settings about different configurations in Microsoft Defender for Cloud // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2022-05-01 -// settingName - The name of the setting -// setting - Setting object -// options - SettingsClientUpdateOptions contains the optional parameters for the SettingsClient.Update method. +// - settingName - The name of the setting +// - setting - Setting object +// - options - SettingsClientUpdateOptions contains the optional parameters for the SettingsClient.Update method. func (client *SettingsClient) Update(ctx context.Context, settingName SettingName, setting SettingClassification, options *SettingsClientUpdateOptions) (SettingsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, settingName, setting, options) if err != nil { diff --git a/sdk/resourcemanager/security/armsecurity/settings_client_example_test.go b/sdk/resourcemanager/security/armsecurity/settings_client_example_test.go deleted file mode 100644 index eec48c963490..000000000000 --- a/sdk/resourcemanager/security/armsecurity/settings_client_example_test.go +++ /dev/null @@ -1,85 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSettings_example.json -func ExampleSettingsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/GetSetting_example.json -func ExampleSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, armsecurity.SettingNameMCAS, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2022-05-01/examples/Settings/UpdateSetting_example.json -func ExampleSettingsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, armsecurity.SettingNameMCAS, &armsecurity.DataExportSettings{ - Kind: to.Ptr(armsecurity.SettingKindDataExportSettings), - Properties: &armsecurity.DataExportSettingProperties{ - Enabled: to.Ptr(true), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/softwareinventories_client.go b/sdk/resourcemanager/security/armsecurity/softwareinventories_client.go index f485c28ea71e..ebc97b83912b 100644 --- a/sdk/resourcemanager/security/armsecurity/softwareinventories_client.go +++ b/sdk/resourcemanager/security/armsecurity/softwareinventories_client.go @@ -32,9 +32,9 @@ type SoftwareInventoriesClient struct { } // NewSoftwareInventoriesClient creates a new instance of SoftwareInventoriesClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSoftwareInventoriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SoftwareInventoriesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +57,14 @@ func NewSoftwareInventoriesClient(subscriptionID string, credential azcore.Token // Get - Gets a single software data of the virtual machine. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// resourceNamespace - The namespace of the resource. -// resourceType - The type of the resource. -// resourceName - Name of the resource. -// softwareName - Name of the installed software. -// options - SoftwareInventoriesClientGetOptions contains the optional parameters for the SoftwareInventoriesClient.Get method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - resourceNamespace - The namespace of the resource. +// - resourceType - The type of the resource. +// - resourceName - Name of the resource. +// - 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) { req, err := client.getCreateRequest(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, softwareName, options) if err != nil { @@ -127,13 +128,14 @@ func (client *SoftwareInventoriesClient) getHandleResponse(resp *http.Response) } // NewListByExtendedResourcePager - Gets the software inventory of the virtual machine. +// // Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// resourceNamespace - The namespace of the resource. -// resourceType - The type of the resource. -// resourceName - Name of the resource. -// options - SoftwareInventoriesClientListByExtendedResourceOptions contains the optional parameters for the SoftwareInventoriesClient.ListByExtendedResource -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - resourceNamespace - The namespace of the resource. +// - resourceType - The type of the resource. +// - resourceName - Name of the resource. +// - options - SoftwareInventoriesClientListByExtendedResourceOptions contains the optional parameters for the SoftwareInventoriesClient.NewListByExtendedResourcePager +// method. func (client *SoftwareInventoriesClient) NewListByExtendedResourcePager(resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, options *SoftwareInventoriesClientListByExtendedResourceOptions) *runtime.Pager[SoftwareInventoriesClientListByExtendedResourceResponse] { return runtime.NewPager(runtime.PagingHandler[SoftwareInventoriesClientListByExtendedResourceResponse]{ More: func(page SoftwareInventoriesClientListByExtendedResourceResponse) bool { @@ -206,9 +208,10 @@ func (client *SoftwareInventoriesClient) listByExtendedResourceHandleResponse(re } // NewListBySubscriptionPager - Gets the software inventory of all virtual machines in the subscriptions. +// // Generated from API version 2021-05-01-preview -// options - SoftwareInventoriesClientListBySubscriptionOptions contains the optional parameters for the SoftwareInventoriesClient.ListBySubscription -// method. +// - options - SoftwareInventoriesClientListBySubscriptionOptions contains the optional parameters for the SoftwareInventoriesClient.NewListBySubscriptionPager +// method. func (client *SoftwareInventoriesClient) NewListBySubscriptionPager(options *SoftwareInventoriesClientListBySubscriptionOptions) *runtime.Pager[SoftwareInventoriesClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[SoftwareInventoriesClientListBySubscriptionResponse]{ More: func(page SoftwareInventoriesClientListBySubscriptionResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/softwareinventories_client_example_test.go b/sdk/resourcemanager/security/armsecurity/softwareinventories_client_example_test.go deleted file mode 100644 index 25c35cd53566..000000000000 --- a/sdk/resourcemanager/security/armsecurity/softwareinventories_client_example_test.go +++ /dev/null @@ -1,84 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/SoftwareInventories/ListByExtendedResourceSoftwareInventories_example.json -func ExampleSoftwareInventoriesClient_NewListByExtendedResourcePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSoftwareInventoriesClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByExtendedResourcePager("EITAN-TESTS", "Microsoft.Compute", "virtualMachines", "Eitan-Test1", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/SoftwareInventories/ListBySubscriptionSoftwareInventories_example.json -func ExampleSoftwareInventoriesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSoftwareInventoriesClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2021-05-01-preview/examples/SoftwareInventories/GetSoftware_example.json -func ExampleSoftwareInventoriesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSoftwareInventoriesClient("e5d1b86c-3051-44d5-8802-aa65d45a279b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "EITAN-TESTS", "Microsoft.Compute", "virtualMachines", "Eitan-Test1", "outlook_16.0.10371.20060", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/solutions_client.go b/sdk/resourcemanager/security/armsecurity/solutions_client.go index 590829c14c93..e1ac033c0fb5 100644 --- a/sdk/resourcemanager/security/armsecurity/solutions_client.go +++ b/sdk/resourcemanager/security/armsecurity/solutions_client.go @@ -32,9 +32,9 @@ type SolutionsClient struct { } // NewSolutionsClient creates a new instance of SolutionsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSolutionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SolutionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewSolutionsClient(subscriptionID string, credential azcore.TokenCredential // Get - Gets a specific Security Solution. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// securitySolutionName - Name of security solution. -// options - SolutionsClientGetOptions contains the optional parameters for the SolutionsClient.Get method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - 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) { req, err := client.getCreateRequest(ctx, resourceGroupName, ascLocation, securitySolutionName, options) if err != nil { @@ -117,8 +118,9 @@ func (client *SolutionsClient) getHandleResponse(resp *http.Response) (Solutions } // NewListPager - Gets a list of Security Solutions for the subscription. +// // Generated from API version 2020-01-01 -// options - SolutionsClientListOptions contains the optional parameters for the SolutionsClient.List method. +// - options - SolutionsClientListOptions contains the optional parameters for the SolutionsClient.NewListPager method. func (client *SolutionsClient) NewListPager(options *SolutionsClientListOptions) *runtime.Pager[SolutionsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SolutionsClientListResponse]{ More: func(page SolutionsClientListResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/solutions_client_example_test.go b/sdk/resourcemanager/security/armsecurity/solutions_client_example_test.go deleted file mode 100644 index f80710a69410..000000000000 --- a/sdk/resourcemanager/security/armsecurity/solutions_client_example_test.go +++ /dev/null @@ -1,60 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutions/GetSecuritySolutionsSubscription_example.json -func ExampleSolutionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSolutionsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutions/GetSecuritySolutionsResourceGroupLocation_example.json -func ExampleSolutionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSolutionsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myRg2", "centralus", "paloalto7", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/solutionsreferencedata_client.go b/sdk/resourcemanager/security/armsecurity/solutionsreferencedata_client.go index 6b87b007d8fb..4cc07f98fdcc 100644 --- a/sdk/resourcemanager/security/armsecurity/solutionsreferencedata_client.go +++ b/sdk/resourcemanager/security/armsecurity/solutionsreferencedata_client.go @@ -32,9 +32,9 @@ type SolutionsReferenceDataClient struct { } // NewSolutionsReferenceDataClient creates a new instance of SolutionsReferenceDataClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSolutionsReferenceDataClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SolutionsReferenceDataClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,9 +57,10 @@ func NewSolutionsReferenceDataClient(subscriptionID string, credential azcore.To // List - Gets a list of all supported Security Solutions for the subscription. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01 -// options - SolutionsReferenceDataClientListOptions contains the optional parameters for the SolutionsReferenceDataClient.List -// method. +// - options - SolutionsReferenceDataClientListOptions contains the optional parameters for the SolutionsReferenceDataClient.List +// method. func (client *SolutionsReferenceDataClient) List(ctx context.Context, options *SolutionsReferenceDataClientListOptions) (SolutionsReferenceDataClientListResponse, error) { req, err := client.listCreateRequest(ctx, options) if err != nil { @@ -104,10 +105,11 @@ func (client *SolutionsReferenceDataClient) listHandleResponse(resp *http.Respon // ListByHomeRegion - Gets list of all supported Security Solutions for subscription and location. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01 -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// options - SolutionsReferenceDataClientListByHomeRegionOptions contains the optional parameters for the SolutionsReferenceDataClient.ListByHomeRegion -// method. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - options - SolutionsReferenceDataClientListByHomeRegionOptions contains the optional parameters for the SolutionsReferenceDataClient.ListByHomeRegion +// method. func (client *SolutionsReferenceDataClient) ListByHomeRegion(ctx context.Context, ascLocation string, options *SolutionsReferenceDataClientListByHomeRegionOptions) (SolutionsReferenceDataClientListByHomeRegionResponse, error) { req, err := client.listByHomeRegionCreateRequest(ctx, ascLocation, options) if err != nil { diff --git a/sdk/resourcemanager/security/armsecurity/solutionsreferencedata_client_example_test.go b/sdk/resourcemanager/security/armsecurity/solutionsreferencedata_client_example_test.go deleted file mode 100644 index 6549edb6a3cc..000000000000 --- a/sdk/resourcemanager/security/armsecurity/solutionsreferencedata_client_example_test.go +++ /dev/null @@ -1,55 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutionsReferenceData/GetSecuritySolutionsReferenceDataSubscription_example.json -func ExampleSolutionsReferenceDataClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSolutionsReferenceDataClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/SecuritySolutionsReferenceData/GetSecuritySolutionsReferenceDataSubscriptionLocation_example.json -func ExampleSolutionsReferenceDataClient_ListByHomeRegion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSolutionsReferenceDataClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByHomeRegion(ctx, "westcentralus", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentbaselinerules_client.go b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentbaselinerules_client.go index a1763526a948..1e915d4bdb55 100644 --- a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentbaselinerules_client.go +++ b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentbaselinerules_client.go @@ -31,8 +31,8 @@ type SQLVulnerabilityAssessmentBaselineRulesClient struct { } // NewSQLVulnerabilityAssessmentBaselineRulesClient creates a new instance of SQLVulnerabilityAssessmentBaselineRulesClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSQLVulnerabilityAssessmentBaselineRulesClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*SQLVulnerabilityAssessmentBaselineRulesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -54,11 +54,12 @@ func NewSQLVulnerabilityAssessmentBaselineRulesClient(credential azcore.TokenCre // Add - Add a list of baseline rules. Will overwrite any previously existing results (for all rules). // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-07-01-preview -// workspaceID - The workspace Id. -// resourceID - The identifier of the resource. -// options - SQLVulnerabilityAssessmentBaselineRulesClientAddOptions contains the optional parameters for the SQLVulnerabilityAssessmentBaselineRulesClient.Add -// method. +// - workspaceID - The workspace Id. +// - resourceID - The identifier of the resource. +// - 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) { req, err := client.addCreateRequest(ctx, workspaceID, resourceID, options) if err != nil { @@ -104,12 +105,13 @@ func (client *SQLVulnerabilityAssessmentBaselineRulesClient) addHandleResponse(r // CreateOrUpdate - Creates a Baseline for a rule in a database. Will overwrite any previously existing results. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-07-01-preview -// ruleID - The rule Id. -// workspaceID - The workspace Id. -// resourceID - The identifier of the resource. -// options - SQLVulnerabilityAssessmentBaselineRulesClientCreateOrUpdateOptions contains the optional parameters for the SQLVulnerabilityAssessmentBaselineRulesClient.CreateOrUpdate -// method. +// - ruleID - The rule Id. +// - workspaceID - The workspace Id. +// - resourceID - The identifier of the resource. +// - 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) { req, err := client.createOrUpdateCreateRequest(ctx, ruleID, workspaceID, resourceID, options) if err != nil { @@ -159,12 +161,13 @@ func (client *SQLVulnerabilityAssessmentBaselineRulesClient) createOrUpdateHandl // Delete - Deletes a rule from the Baseline of a given database. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-07-01-preview -// ruleID - The rule Id. -// workspaceID - The workspace Id. -// resourceID - The identifier of the resource. -// options - SQLVulnerabilityAssessmentBaselineRulesClientDeleteOptions contains the optional parameters for the SQLVulnerabilityAssessmentBaselineRulesClient.Delete -// method. +// - ruleID - The rule Id. +// - workspaceID - The workspace Id. +// - resourceID - The identifier of the resource. +// - 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) { req, err := client.deleteCreateRequest(ctx, ruleID, workspaceID, resourceID, options) if err != nil { @@ -202,12 +205,13 @@ func (client *SQLVulnerabilityAssessmentBaselineRulesClient) deleteCreateRequest // Get - Gets the results for a given rule in the Baseline. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-07-01-preview -// ruleID - The rule Id. -// workspaceID - The workspace Id. -// resourceID - The identifier of the resource. -// options - SQLVulnerabilityAssessmentBaselineRulesClientGetOptions contains the optional parameters for the SQLVulnerabilityAssessmentBaselineRulesClient.Get -// method. +// - ruleID - The rule Id. +// - workspaceID - The workspace Id. +// - resourceID - The identifier of the resource. +// - 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) { req, err := client.getCreateRequest(ctx, ruleID, workspaceID, resourceID, options) if err != nil { @@ -254,11 +258,12 @@ func (client *SQLVulnerabilityAssessmentBaselineRulesClient) getHandleResponse(r // List - Gets the results for all rules in the Baseline. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-07-01-preview -// workspaceID - The workspace Id. -// resourceID - The identifier of the resource. -// options - SQLVulnerabilityAssessmentBaselineRulesClientListOptions contains the optional parameters for the SQLVulnerabilityAssessmentBaselineRulesClient.List -// method. +// - workspaceID - The workspace Id. +// - resourceID - The identifier of the resource. +// - 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) { req, err := client.listCreateRequest(ctx, workspaceID, resourceID, options) if err != nil { diff --git a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentbaselinerules_client_example_test.go b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentbaselinerules_client_example_test.go deleted file mode 100644 index 2a22b9400044..000000000000 --- a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentbaselinerules_client_example_test.go +++ /dev/null @@ -1,184 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Put.json -func ExampleSQLVulnerabilityAssessmentBaselineRulesClient_CreateOrUpdate_createABaseline() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSQLVulnerabilityAssessmentBaselineRulesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "VA1234", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", &armsecurity.SQLVulnerabilityAssessmentBaselineRulesClientCreateOrUpdateOptions{Body: &armsecurity.RuleResultsInput{ - LatestScan: to.Ptr(false), - Results: [][]*string{ - { - to.Ptr("userA"), - to.Ptr("SELECT")}, - { - to.Ptr("userB"), - to.Ptr("SELECT")}}, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_PutLatest.json -func ExampleSQLVulnerabilityAssessmentBaselineRulesClient_CreateOrUpdate_createABaselineUsingTheLatestScanResults() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSQLVulnerabilityAssessmentBaselineRulesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, "VA1234", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", &armsecurity.SQLVulnerabilityAssessmentBaselineRulesClientCreateOrUpdateOptions{Body: &armsecurity.RuleResultsInput{ - LatestScan: to.Ptr(true), - Results: [][]*string{}, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Get.json -func ExampleSQLVulnerabilityAssessmentBaselineRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSQLVulnerabilityAssessmentBaselineRulesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "VA1234", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Delete.json -func ExampleSQLVulnerabilityAssessmentBaselineRulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSQLVulnerabilityAssessmentBaselineRulesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "VA1234", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_List.json -func ExampleSQLVulnerabilityAssessmentBaselineRulesClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSQLVulnerabilityAssessmentBaselineRulesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_Add.json -func ExampleSQLVulnerabilityAssessmentBaselineRulesClient_Add_createABaselineForAllRules() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSQLVulnerabilityAssessmentBaselineRulesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Add(ctx, "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", &armsecurity.SQLVulnerabilityAssessmentBaselineRulesClientAddOptions{Body: &armsecurity.RulesResultsInput{ - LatestScan: to.Ptr(false), - Results: map[string][][]*string{ - "VA1234": { - { - to.Ptr("userA"), - to.Ptr("SELECT")}, - { - to.Ptr("userB"), - to.Ptr("SELECT")}}, - "VA5678": { - { - to.Ptr("Test"), - to.Ptr("0.0.0.0"), - to.Ptr("125.125.125.125")}}, - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsBaselineRuleOperations/ArcMachineBaselineRules_AddLatest.json -func ExampleSQLVulnerabilityAssessmentBaselineRulesClient_Add_createABaselineForAllRulesUsingTheLatestScanResults() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSQLVulnerabilityAssessmentBaselineRulesClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Add(ctx, "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", &armsecurity.SQLVulnerabilityAssessmentBaselineRulesClientAddOptions{Body: &armsecurity.RulesResultsInput{ - LatestScan: to.Ptr(true), - Results: map[string][][]*string{}, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscanresults_client.go b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscanresults_client.go index cfe79a9f6c49..6a38b40db67e 100644 --- a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscanresults_client.go +++ b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscanresults_client.go @@ -31,8 +31,8 @@ type SQLVulnerabilityAssessmentScanResultsClient struct { } // NewSQLVulnerabilityAssessmentScanResultsClient creates a new instance of SQLVulnerabilityAssessmentScanResultsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSQLVulnerabilityAssessmentScanResultsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*SQLVulnerabilityAssessmentScanResultsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -54,13 +54,14 @@ func NewSQLVulnerabilityAssessmentScanResultsClient(credential azcore.TokenCrede // Get - Gets the scan results of a single rule in a scan record. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-07-01-preview -// scanID - The scan Id. Type 'latest' to get the scan results for the latest scan. -// scanResultID - The rule Id of the results. -// workspaceID - The workspace Id. -// resourceID - The identifier of the resource. -// options - SQLVulnerabilityAssessmentScanResultsClientGetOptions contains the optional parameters for the SQLVulnerabilityAssessmentScanResultsClient.Get -// method. +// - scanID - The scan Id. Type 'latest' to get the scan results for the latest scan. +// - scanResultID - The rule Id of the results. +// - workspaceID - The workspace Id. +// - resourceID - The identifier of the resource. +// - 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) { req, err := client.getCreateRequest(ctx, scanID, scanResultID, workspaceID, resourceID, options) if err != nil { @@ -111,12 +112,13 @@ func (client *SQLVulnerabilityAssessmentScanResultsClient) getHandleResponse(res // List - Gets a list of scan results for a single scan record. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-07-01-preview -// scanID - The scan Id. Type 'latest' to get the scan results for the latest scan. -// workspaceID - The workspace Id. -// resourceID - The identifier of the resource. -// options - SQLVulnerabilityAssessmentScanResultsClientListOptions contains the optional parameters for the SQLVulnerabilityAssessmentScanResultsClient.List -// method. +// - scanID - The scan Id. Type 'latest' to get the scan results for the latest scan. +// - workspaceID - The workspace Id. +// - resourceID - The identifier of the resource. +// - 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) { req, err := client.listCreateRequest(ctx, scanID, workspaceID, resourceID, options) if err != nil { diff --git a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscanresults_client_example_test.go b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscanresults_client_example_test.go deleted file mode 100644 index 4dd6cf8aa996..000000000000 --- a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscanresults_client_example_test.go +++ /dev/null @@ -1,93 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_Get.json -func ExampleSQLVulnerabilityAssessmentScanResultsClient_Get_getScanDetailsOfAScanRecord() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSQLVulnerabilityAssessmentScanResultsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "Scheduled-20200623", "VA2063", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_GetLatest.json -func ExampleSQLVulnerabilityAssessmentScanResultsClient_Get_getScanDetailsOfTheLatestScanRecord() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSQLVulnerabilityAssessmentScanResultsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "latest", "VA2063", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_List.json -func ExampleSQLVulnerabilityAssessmentScanResultsClient_List_listScanResults() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSQLVulnerabilityAssessmentScanResultsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, "Scheduled-20200623", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentsScanResultsOperations/ArcMachineScanResults_ListLatest.json -func ExampleSQLVulnerabilityAssessmentScanResultsClient_List_listScanResultsOfTheLatestScan() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSQLVulnerabilityAssessmentScanResultsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, "latest", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client.go b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client.go index 901be98f3029..19cda19c6a20 100644 --- a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client.go +++ b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client.go @@ -31,8 +31,8 @@ type SQLVulnerabilityAssessmentScansClient struct { } // NewSQLVulnerabilityAssessmentScansClient creates a new instance of SQLVulnerabilityAssessmentScansClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSQLVulnerabilityAssessmentScansClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*SQLVulnerabilityAssessmentScansClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -54,12 +54,13 @@ func NewSQLVulnerabilityAssessmentScansClient(credential azcore.TokenCredential, // Get - Gets the scan details of a single scan record. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-07-01-preview -// scanID - The scan Id. Type 'latest' to get the scan record for the latest scan. -// workspaceID - The workspace Id. -// resourceID - The identifier of the resource. -// options - SQLVulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the SQLVulnerabilityAssessmentScansClient.Get -// method. +// - scanID - The scan Id. Type 'latest' to get the scan record for the latest scan. +// - workspaceID - The workspace Id. +// - resourceID - The identifier of the resource. +// - 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) { req, err := client.getCreateRequest(ctx, scanID, workspaceID, resourceID, options) if err != nil { @@ -106,11 +107,12 @@ func (client *SQLVulnerabilityAssessmentScansClient) getHandleResponse(resp *htt // List - Gets a list of scan records. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-07-01-preview -// workspaceID - The workspace Id. -// resourceID - The identifier of the resource. -// options - SQLVulnerabilityAssessmentScansClientListOptions contains the optional parameters for the SQLVulnerabilityAssessmentScansClient.List -// method. +// - workspaceID - The workspace Id. +// - resourceID - The identifier of the resource. +// - 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) { req, err := client.listCreateRequest(ctx, workspaceID, resourceID, options) if err != nil { diff --git a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client_example_test.go b/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client_example_test.go deleted file mode 100644 index abfbbb717cf4..000000000000 --- a/sdk/resourcemanager/security/armsecurity/sqlvulnerabilityassessmentscans_client_example_test.go +++ /dev/null @@ -1,74 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_Get.json -func ExampleSQLVulnerabilityAssessmentScansClient_Get_getScanDetailsOfAScanRecord() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSQLVulnerabilityAssessmentScansClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "Scheduled-20200623", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_GetLatest.json -func ExampleSQLVulnerabilityAssessmentScansClient_Get_getScanDetailsOfTheLatestScanRecord() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSQLVulnerabilityAssessmentScansClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "latest", "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2020-07-01-preview/examples/sqlVulnerabilityAssessmentScanOperations/ArcMachineScans_List.json -func ExampleSQLVulnerabilityAssessmentScansClient_List() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSQLVulnerabilityAssessmentScansClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.List(ctx, "55555555-6666-7777-8888-999999999999", "subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Rg/providers/Microsoft.HybridCompute/machines/MyMachine/sqlServers/server1/databases/master", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/subassessments_client.go b/sdk/resourcemanager/security/armsecurity/subassessments_client.go index d258b9b39e79..0f0e0a0e28bd 100644 --- a/sdk/resourcemanager/security/armsecurity/subassessments_client.go +++ b/sdk/resourcemanager/security/armsecurity/subassessments_client.go @@ -31,8 +31,8 @@ type SubAssessmentsClient struct { } // NewSubAssessmentsClient creates a new instance of SubAssessmentsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSubAssessmentsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*SubAssessmentsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -54,12 +54,13 @@ func NewSubAssessmentsClient(credential azcore.TokenCredential, options *arm.Cli // Get - Get a security sub-assessment on your scanned resource // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2019-01-01-preview -// scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group -// (/providers/Microsoft.Management/managementGroups/mgName). -// assessmentName - The Assessment Key - Unique key for the assessment type -// subAssessmentName - The Sub-Assessment Key - Unique key for the sub-assessment type -// options - SubAssessmentsClientGetOptions contains the optional parameters for the SubAssessmentsClient.Get method. +// - scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group +// (/providers/Microsoft.Management/managementGroups/mgName). +// - assessmentName - The Assessment Key - Unique key for the assessment type +// - 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) { req, err := client.getCreateRequest(ctx, scope, assessmentName, subAssessmentName, options) if err != nil { @@ -108,11 +109,12 @@ func (client *SubAssessmentsClient) getHandleResponse(resp *http.Response) (SubA } // NewListPager - Get security sub-assessments on all your scanned resources inside a scope +// // Generated from API version 2019-01-01-preview -// scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group -// (/providers/Microsoft.Management/managementGroups/mgName). -// assessmentName - The Assessment Key - Unique key for the assessment type -// options - SubAssessmentsClientListOptions contains the optional parameters for the SubAssessmentsClient.List method. +// - scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group +// (/providers/Microsoft.Management/managementGroups/mgName). +// - assessmentName - The Assessment Key - Unique key for the assessment type +// - options - SubAssessmentsClientListOptions contains the optional parameters for the SubAssessmentsClient.NewListPager method. func (client *SubAssessmentsClient) NewListPager(scope string, assessmentName string, options *SubAssessmentsClientListOptions) *runtime.Pager[SubAssessmentsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SubAssessmentsClientListResponse]{ More: func(page SubAssessmentsClientListResponse) bool { @@ -170,10 +172,12 @@ func (client *SubAssessmentsClient) listHandleResponse(resp *http.Response) (Sub } // NewListAllPager - Get security sub-assessments on all your scanned resources inside a subscription scope +// // Generated from API version 2019-01-01-preview -// scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group -// (/providers/Microsoft.Management/managementGroups/mgName). -// options - SubAssessmentsClientListAllOptions contains the optional parameters for the SubAssessmentsClient.ListAll method. +// - scope - Scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or management group +// (/providers/Microsoft.Management/managementGroups/mgName). +// - options - SubAssessmentsClientListAllOptions contains the optional parameters for the SubAssessmentsClient.NewListAllPager +// method. func (client *SubAssessmentsClient) NewListAllPager(scope string, options *SubAssessmentsClientListAllOptions) *runtime.Pager[SubAssessmentsClientListAllResponse] { return runtime.NewPager(runtime.PagingHandler[SubAssessmentsClientListAllResponse]{ More: func(page SubAssessmentsClientListAllResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/subassessments_client_example_test.go b/sdk/resourcemanager/security/armsecurity/subassessments_client_example_test.go deleted file mode 100644 index eed818e3d0d0..000000000000 --- a/sdk/resourcemanager/security/armsecurity/subassessments_client_example_test.go +++ /dev/null @@ -1,84 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/ListSubscriptionSubAssessments_example.json -func ExampleSubAssessmentsClient_NewListAllPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSubAssessmentsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListAllPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/ListSubAssessments_example.json -func ExampleSubAssessmentsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSubAssessmentsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23", "82e20e14-edc5-4373-bfc4-f13121257c37", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2019-01-01-preview/examples/SubAssessments/GetSubAssessment_example.json -func ExampleSubAssessmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSubAssessmentsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "subscriptions/212f9889-769e-45ae-ab43-6da33674bd26/resourceGroups/DEMORG/providers/Microsoft.Compute/virtualMachines/vm2", "1195afff-c881-495e-9bc5-1486211ae03f", "95f7da9c-a2a4-1322-0758-fcd24ef09b85", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/subscriptiongovernancerulesexecutestatus_client.go b/sdk/resourcemanager/security/armsecurity/subscriptiongovernancerulesexecutestatus_client.go deleted file mode 100644 index c1910b6103fd..000000000000 --- a/sdk/resourcemanager/security/armsecurity/subscriptiongovernancerulesexecutestatus_client.go +++ /dev/null @@ -1,119 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for 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" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// SubscriptionGovernanceRulesExecuteStatusClient contains the methods for the SubscriptionGovernanceRulesExecuteStatus group. -// Don't use this type directly, use NewSubscriptionGovernanceRulesExecuteStatusClient() instead. -type SubscriptionGovernanceRulesExecuteStatusClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewSubscriptionGovernanceRulesExecuteStatusClient creates a new instance of SubscriptionGovernanceRulesExecuteStatusClient with the specified values. -// subscriptionID - Azure subscription ID -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewSubscriptionGovernanceRulesExecuteStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SubscriptionGovernanceRulesExecuteStatusClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &SubscriptionGovernanceRulesExecuteStatusClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginGet - Get a specific governanceRule execution status for the requested scope by ruleId and operationId -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview -// ruleID - The security GovernanceRule key - unique key for the standard GovernanceRule -// operationID - The security GovernanceRule execution key - unique key for the execution of GovernanceRule -// options - SubscriptionGovernanceRulesExecuteStatusClientBeginGetOptions contains the optional parameters for the SubscriptionGovernanceRulesExecuteStatusClient.BeginGet -// method. -func (client *SubscriptionGovernanceRulesExecuteStatusClient) BeginGet(ctx context.Context, ruleID string, operationID string, options *SubscriptionGovernanceRulesExecuteStatusClientBeginGetOptions) (*runtime.Poller[SubscriptionGovernanceRulesExecuteStatusClientGetResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.get(ctx, ruleID, operationID, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[SubscriptionGovernanceRulesExecuteStatusClientGetResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[SubscriptionGovernanceRulesExecuteStatusClientGetResponse](options.ResumeToken, client.pl, nil) - } -} - -// Get - Get a specific governanceRule execution status for the requested scope by ruleId and operationId -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-01-01-preview -func (client *SubscriptionGovernanceRulesExecuteStatusClient) get(ctx context.Context, ruleID string, operationID string, options *SubscriptionGovernanceRulesExecuteStatusClientBeginGetOptions) (*http.Response, error) { - req, err := client.getCreateRequest(ctx, ruleID, operationID, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// getCreateRequest creates the Get request. -func (client *SubscriptionGovernanceRulesExecuteStatusClient) getCreateRequest(ctx context.Context, ruleID string, operationID string, options *SubscriptionGovernanceRulesExecuteStatusClientBeginGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Security/governanceRules/{ruleId}/operationResults/{operationId}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if ruleID == "" { - return nil, errors.New("parameter ruleID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) - if operationID == "" { - return nil, errors.New("parameter operationID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-01-01-preview") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} diff --git a/sdk/resourcemanager/security/armsecurity/subscriptiongovernancerulesexecutestatus_client_example_test.go b/sdk/resourcemanager/security/armsecurity/subscriptiongovernancerulesexecutestatus_client_example_test.go deleted file mode 100644 index a064c657c0dd..000000000000 --- a/sdk/resourcemanager/security/armsecurity/subscriptiongovernancerulesexecutestatus_client_example_test.go +++ /dev/null @@ -1,40 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2022-01-01-preview/examples/GovernanceRules/GetGovernanceRuleExecuteStatus_example.json -func ExampleSubscriptionGovernanceRulesExecuteStatusClient_BeginGet() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewSubscriptionGovernanceRulesExecuteStatusClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginGet(ctx, "ad9a8e26-29d9-4829-bb30-e597a58cdbb8", "58b33f4f-c8c7-4b01-99cc-d437db4d40dd", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/tasks_client.go b/sdk/resourcemanager/security/armsecurity/tasks_client.go index a63c83694ac1..a1ad5fd24db9 100644 --- a/sdk/resourcemanager/security/armsecurity/tasks_client.go +++ b/sdk/resourcemanager/security/armsecurity/tasks_client.go @@ -32,9 +32,9 @@ type TasksClient struct { } // NewTasksClient creates a new instance of TasksClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewTasksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TasksClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewTasksClient(subscriptionID string, credential azcore.TokenCredential, op // GetResourceGroupLevelTask - Recommended tasks that will help improve the security of the subscription proactively // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2015-06-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// taskName - Name of the task object, will be a GUID -// options - TasksClientGetResourceGroupLevelTaskOptions contains the optional parameters for the TasksClient.GetResourceGroupLevelTask -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - taskName - Name of the task object, will be a GUID +// - 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) { req, err := client.getResourceGroupLevelTaskCreateRequest(ctx, resourceGroupName, ascLocation, taskName, options) if err != nil { @@ -119,11 +120,12 @@ func (client *TasksClient) getResourceGroupLevelTaskHandleResponse(resp *http.Re // GetSubscriptionLevelTask - Recommended tasks that will help improve the security of the subscription proactively // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2015-06-01-preview -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// taskName - Name of the task object, will be a GUID -// options - TasksClientGetSubscriptionLevelTaskOptions contains the optional parameters for the TasksClient.GetSubscriptionLevelTask -// method. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - taskName - Name of the task object, will be a GUID +// - 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) { req, err := client.getSubscriptionLevelTaskCreateRequest(ctx, ascLocation, taskName, options) if err != nil { @@ -175,8 +177,9 @@ func (client *TasksClient) getSubscriptionLevelTaskHandleResponse(resp *http.Res } // NewListPager - Recommended tasks that will help improve the security of the subscription proactively +// // Generated from API version 2015-06-01-preview -// options - TasksClientListOptions contains the optional parameters for the TasksClient.List method. +// - options - TasksClientListOptions contains the optional parameters for the TasksClient.NewListPager method. func (client *TasksClient) NewListPager(options *TasksClientListOptions) *runtime.Pager[TasksClientListResponse] { return runtime.NewPager(runtime.PagingHandler[TasksClientListResponse]{ More: func(page TasksClientListResponse) bool { @@ -236,9 +239,11 @@ func (client *TasksClient) listHandleResponse(resp *http.Response) (TasksClientL } // NewListByHomeRegionPager - Recommended tasks that will help improve the security of the subscription proactively +// // Generated from API version 2015-06-01-preview -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// options - TasksClientListByHomeRegionOptions contains the optional parameters for the TasksClient.ListByHomeRegion method. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - options - TasksClientListByHomeRegionOptions contains the optional parameters for the TasksClient.NewListByHomeRegionPager +// method. func (client *TasksClient) NewListByHomeRegionPager(ascLocation string, options *TasksClientListByHomeRegionOptions) *runtime.Pager[TasksClientListByHomeRegionResponse] { return runtime.NewPager(runtime.PagingHandler[TasksClientListByHomeRegionResponse]{ More: func(page TasksClientListByHomeRegionResponse) bool { @@ -302,11 +307,12 @@ func (client *TasksClient) listByHomeRegionHandleResponse(resp *http.Response) ( } // NewListByResourceGroupPager - Recommended tasks that will help improve the security of the subscription proactively +// // Generated from API version 2015-06-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// options - TasksClientListByResourceGroupOptions contains the optional parameters for the TasksClient.ListByResourceGroup -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - options - TasksClientListByResourceGroupOptions contains the optional parameters for the TasksClient.NewListByResourceGroupPager +// method. func (client *TasksClient) NewListByResourceGroupPager(resourceGroupName string, ascLocation string, options *TasksClientListByResourceGroupOptions) *runtime.Pager[TasksClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[TasksClientListByResourceGroupResponse]{ More: func(page TasksClientListByResourceGroupResponse) bool { @@ -375,13 +381,14 @@ func (client *TasksClient) listByResourceGroupHandleResponse(resp *http.Response // UpdateResourceGroupLevelTaskState - Recommended tasks that will help improve the security of the subscription proactively // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2015-06-01-preview -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// taskName - Name of the task object, will be a GUID -// taskUpdateActionType - Type of the action to do on the task -// options - TasksClientUpdateResourceGroupLevelTaskStateOptions contains the optional parameters for the TasksClient.UpdateResourceGroupLevelTaskState -// method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - taskName - Name of the task object, will be a GUID +// - taskUpdateActionType - Type of the action to do on the task +// - 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) { req, err := client.updateResourceGroupLevelTaskStateCreateRequest(ctx, resourceGroupName, ascLocation, taskName, taskUpdateActionType, options) if err != nil { @@ -433,12 +440,13 @@ func (client *TasksClient) updateResourceGroupLevelTaskStateCreateRequest(ctx co // UpdateSubscriptionLevelTaskState - Recommended tasks that will help improve the security of the subscription proactively // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2015-06-01-preview -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// taskName - Name of the task object, will be a GUID -// taskUpdateActionType - Type of the action to do on the task -// options - TasksClientUpdateSubscriptionLevelTaskStateOptions contains the optional parameters for the TasksClient.UpdateSubscriptionLevelTaskState -// method. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - taskName - Name of the task object, will be a GUID +// - taskUpdateActionType - Type of the action to do on the task +// - 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) { req, err := client.updateSubscriptionLevelTaskStateCreateRequest(ctx, ascLocation, taskName, taskUpdateActionType, options) if err != 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 ac7b1ad7073a..000000000000 --- a/sdk/resourcemanager/security/armsecurity/tasks_client_example_test.go +++ /dev/null @@ -1,161 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTasksSubscription_example.json -func ExampleTasksClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewTasksClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(&armsecurity.TasksClientListOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTasksSubscriptionLocation_example.json -func ExampleTasksClient_NewListByHomeRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewTasksClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByHomeRegionPager("westeurope", &armsecurity.TasksClientListByHomeRegionOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTaskSubscriptionLocation_example.json -func ExampleTasksClient_GetSubscriptionLevelTask() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewTasksClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetSubscriptionLevelTask(ctx, "westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/UpdateTaskSubscriptionLocation_example.json -func ExampleTasksClient_UpdateSubscriptionLevelTaskState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewTasksClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.UpdateSubscriptionLevelTaskState(ctx, "westeurope", "62609ee7-d0a5-8616-9fe4-1df5cca7758d", armsecurity.TaskUpdateActionTypeDismiss, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTasksResourceGroupLocation_example.json -func ExampleTasksClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewTasksClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("myRg", "westeurope", &armsecurity.TasksClientListByResourceGroupOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/GetTaskResourceGroupLocation_example.json -func ExampleTasksClient_GetResourceGroupLevelTask() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewTasksClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetResourceGroupLevelTask(ctx, "myRg", "westeurope", "d55b4dc0-779c-c66c-33e5-d7bce24c4222", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2015-06-01-preview/examples/Tasks/UpdateTaskResourceGroupLocation_example.json -func ExampleTasksClient_UpdateResourceGroupLevelTaskState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewTasksClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.UpdateResourceGroupLevelTaskState(ctx, "myRg", "westeurope", "d55b4dc0-779c-c66c-33e5-d7bce24c4222", armsecurity.TaskUpdateActionTypeDismiss, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/security/armsecurity/time_rfc3339.go b/sdk/resourcemanager/security/armsecurity/time_rfc3339.go index b848c8724164..dca739e560f2 100644 --- a/sdk/resourcemanager/security/armsecurity/time_rfc3339.go +++ b/sdk/resourcemanager/security/armsecurity/time_rfc3339.go @@ -62,7 +62,7 @@ func (t *timeRFC3339) Parse(layout, value string) error { return err } -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { diff --git a/sdk/resourcemanager/security/armsecurity/topology_client.go b/sdk/resourcemanager/security/armsecurity/topology_client.go index 4a14bd0604d3..f0159096a89d 100644 --- a/sdk/resourcemanager/security/armsecurity/topology_client.go +++ b/sdk/resourcemanager/security/armsecurity/topology_client.go @@ -32,9 +32,9 @@ type TopologyClient struct { } // NewTopologyClient creates a new instance of TopologyClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewTopologyClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TopologyClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewTopologyClient(subscriptionID string, credential azcore.TokenCredential, // Get - Gets a specific topology component. // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2020-01-01 -// resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// topologyResourceName - Name of a topology resources collection. -// options - TopologyClientGetOptions contains the optional parameters for the TopologyClient.Get method. +// - resourceGroupName - The name of the resource group within the user's subscription. The name is case insensitive. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - 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) { req, err := client.getCreateRequest(ctx, resourceGroupName, ascLocation, topologyResourceName, options) if err != nil { @@ -117,8 +118,9 @@ func (client *TopologyClient) getHandleResponse(resp *http.Response) (TopologyCl } // NewListPager - Gets a list that allows to build a topology view of a subscription. +// // Generated from API version 2020-01-01 -// options - TopologyClientListOptions contains the optional parameters for the TopologyClient.List method. +// - options - TopologyClientListOptions contains the optional parameters for the TopologyClient.NewListPager method. func (client *TopologyClient) NewListPager(options *TopologyClientListOptions) *runtime.Pager[TopologyClientListResponse] { return runtime.NewPager(runtime.PagingHandler[TopologyClientListResponse]{ More: func(page TopologyClientListResponse) bool { @@ -175,10 +177,11 @@ func (client *TopologyClient) listHandleResponse(resp *http.Response) (TopologyC } // NewListByHomeRegionPager - Gets a list that allows to build a topology view of a subscription and location. +// // Generated from API version 2020-01-01 -// ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations -// options - TopologyClientListByHomeRegionOptions contains the optional parameters for the TopologyClient.ListByHomeRegion -// method. +// - ascLocation - The location where ASC stores the data of the subscription. can be retrieved from Get locations +// - options - TopologyClientListByHomeRegionOptions contains the optional parameters for the TopologyClient.NewListByHomeRegionPager +// method. func (client *TopologyClient) NewListByHomeRegionPager(ascLocation string, options *TopologyClientListByHomeRegionOptions) *runtime.Pager[TopologyClientListByHomeRegionResponse] { return runtime.NewPager(runtime.PagingHandler[TopologyClientListByHomeRegionResponse]{ More: func(page TopologyClientListByHomeRegionResponse) bool { diff --git a/sdk/resourcemanager/security/armsecurity/topology_client_example_test.go b/sdk/resourcemanager/security/armsecurity/topology_client_example_test.go deleted file mode 100644 index 9403d4bcdcfa..000000000000 --- a/sdk/resourcemanager/security/armsecurity/topology_client_example_test.go +++ /dev/null @@ -1,84 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/GetTopologySubscription_example.json -func ExampleTopologyClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewTopologyClient("3eeab341-f466-499c-a8be-85427e154bad", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/GetTopologySubscriptionLocation_example.json -func ExampleTopologyClient_NewListByHomeRegionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewTopologyClient("3eeab341-f466-499c-a8be-85427e154bad", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByHomeRegionPager("centralus", nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/stable/2020-01-01/examples/Topology/GetTopology_example.json -func ExampleTopologyClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewTopologyClient("3eeab341-f466-499c-a8be-85427e154bad", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "myservers", "centralus", "vnets", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/security/armsecurity/workspacesettings_client.go b/sdk/resourcemanager/security/armsecurity/workspacesettings_client.go index b7308ef3042b..3a4f8674ea60 100644 --- a/sdk/resourcemanager/security/armsecurity/workspacesettings_client.go +++ b/sdk/resourcemanager/security/armsecurity/workspacesettings_client.go @@ -32,9 +32,9 @@ type WorkspaceSettingsClient struct { } // NewWorkspaceSettingsClient creates a new instance of WorkspaceSettingsClient 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. +// - subscriptionID - Azure subscription ID +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewWorkspaceSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WorkspaceSettingsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewWorkspaceSettingsClient(subscriptionID string, credential azcore.TokenCr // Create - creating settings about where we should store your security data and logs // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2017-08-01-preview -// workspaceSettingName - Name of the security setting -// workspaceSetting - Security data setting object -// options - WorkspaceSettingsClientCreateOptions contains the optional parameters for the WorkspaceSettingsClient.Create -// method. +// - workspaceSettingName - Name of the security setting +// - workspaceSetting - Security data setting object +// - 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) { req, err := client.createCreateRequest(ctx, workspaceSettingName, workspaceSetting, options) if err != nil { @@ -110,10 +111,11 @@ func (client *WorkspaceSettingsClient) createHandleResponse(resp *http.Response) // Delete - Deletes the custom workspace settings for this subscription. new VMs will report to the default workspace // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2017-08-01-preview -// workspaceSettingName - Name of the security setting -// options - WorkspaceSettingsClientDeleteOptions contains the optional parameters for the WorkspaceSettingsClient.Delete -// method. +// - workspaceSettingName - Name of the security setting +// - options - WorkspaceSettingsClientDeleteOptions contains the optional parameters for the WorkspaceSettingsClient.Delete +// method. func (client *WorkspaceSettingsClient) Delete(ctx context.Context, workspaceSettingName string, options *WorkspaceSettingsClientDeleteOptions) (WorkspaceSettingsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, workspaceSettingName, options) if err != nil { @@ -154,9 +156,10 @@ func (client *WorkspaceSettingsClient) deleteCreateRequest(ctx context.Context, // Get - Settings about where we should store your security data and logs. If the result is empty, it means that no custom-workspace // configuration was set // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2017-08-01-preview -// workspaceSettingName - Name of the security setting -// options - WorkspaceSettingsClientGetOptions contains the optional parameters for the WorkspaceSettingsClient.Get method. +// - 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) { req, err := client.getCreateRequest(ctx, workspaceSettingName, options) if err != nil { @@ -205,8 +208,10 @@ func (client *WorkspaceSettingsClient) getHandleResponse(resp *http.Response) (W // NewListPager - Settings about where we should store your security data and logs. If the result is empty, it means that // no custom-workspace configuration was set +// // Generated from API version 2017-08-01-preview -// options - WorkspaceSettingsClientListOptions contains the optional parameters for the WorkspaceSettingsClient.List method. +// - options - WorkspaceSettingsClientListOptions contains the optional parameters for the WorkspaceSettingsClient.NewListPager +// method. func (client *WorkspaceSettingsClient) NewListPager(options *WorkspaceSettingsClientListOptions) *runtime.Pager[WorkspaceSettingsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[WorkspaceSettingsClientListResponse]{ More: func(page WorkspaceSettingsClientListResponse) bool { @@ -264,11 +269,12 @@ func (client *WorkspaceSettingsClient) listHandleResponse(resp *http.Response) ( // Update - Settings about where we should store your security data and logs // If the operation fails it returns an *azcore.ResponseError type. +// // Generated from API version 2017-08-01-preview -// workspaceSettingName - Name of the security setting -// workspaceSetting - Security data setting object -// options - WorkspaceSettingsClientUpdateOptions contains the optional parameters for the WorkspaceSettingsClient.Update -// method. +// - workspaceSettingName - Name of the security setting +// - workspaceSetting - Security data setting object +// - 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) { req, err := client.updateCreateRequest(ctx, workspaceSettingName, workspaceSetting, options) if err != nil { diff --git a/sdk/resourcemanager/security/armsecurity/workspacesettings_client_example_test.go b/sdk/resourcemanager/security/armsecurity/workspacesettings_client_example_test.go deleted file mode 100644 index 8801d9cb6368..000000000000 --- a/sdk/resourcemanager/security/armsecurity/workspacesettings_client_example_test.go +++ /dev/null @@ -1,131 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsecurity_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/security/armsecurity" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/GetWorkspaceSettings_example.json -func ExampleWorkspaceSettingsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewWorkspaceSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/GetWorkspaceSetting_example.json -func ExampleWorkspaceSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewWorkspaceSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/CreateWorkspaceSetting_example.json -func ExampleWorkspaceSettingsClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewWorkspaceSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, "default", armsecurity.WorkspaceSetting{ - Name: to.Ptr("default"), - Type: to.Ptr("Microsoft.Security/workspaceSettings"), - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/workspaceSettings/default"), - Properties: &armsecurity.WorkspaceSettingProperties{ - Scope: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23"), - WorkspaceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/UpdateWorkspaceSetting_example.json -func ExampleWorkspaceSettingsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewWorkspaceSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, "default", armsecurity.WorkspaceSetting{ - Name: to.Ptr("default"), - Type: to.Ptr("Microsoft.Security/workspaceSettings"), - ID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/workspaceSettings/default"), - Properties: &armsecurity.WorkspaceSettingProperties{ - WorkspaceID: to.Ptr("/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/myRg/providers/Microsoft.OperationalInsights/workspaces/myWorkspace"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/security/resource-manager/Microsoft.Security/preview/2017-08-01-preview/examples/WorkspaceSettings/DeleteWorkspaceSetting_example.json -func ExampleWorkspaceSettingsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsecurity.NewWorkspaceSettingsClient("20ff7fc3-e762-44dd-bd96-b71116dcdc23", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, "default", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -}