From 2f5a107d77bbd46d0fce15ccf507aea3f793afe7 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 12 Nov 2020 10:13:21 +0000 Subject: [PATCH] CodeGen from PR 11577 in Azure/azure-rest-api-specs Add SecureScores & SecureScoreControls as new supported datatypes in Automations resource (#11577) * Add SubAssessment event source type and add more automations examples * Change Location isReadOnlu to false * Test * Add new read/write location and add new type TrackedResourceLocation * Minor * minor * prettier fixes * Change variable name to TrackedResourceLocation * Change type name TrackedResourceLocation to AzureTrackedResourceLocation * Update automations example * Add SecureScores & SecureScoreControls as new supported datatypes in Automations resource --- .../security/mgmt/v3.0/security/alerts.go | 316 ++-- .../security/mgmt/v3.0/security/connectors.go | 4 +- .../security/mgmt/v3.0/security/device.go | 116 ++ .../mgmt/v3.0/security/devicesforhub.go | 167 ++ .../v3.0/security/devicesforsubscription.go | 174 ++ .../security/mgmt/v3.0/security/enums.go | 302 ++- .../security/mgmt/v3.0/security/iotalerts.go | 217 +++ .../mgmt/v3.0/security/iotalerttypes.go | 155 ++ .../mgmt/v3.0/security/iotrecommendations.go | 205 ++ .../v3.0/security/iotrecommendationtypes.go | 155 ++ .../security/mgmt/v3.0/security/models.go | 1653 +++++++++++++++-- .../security/securescorecontroldefinitions.go | 4 +- .../mgmt/v3.0/security/securescorecontrols.go | 4 +- .../mgmt/v3.0/security/securescores.go | 4 +- .../v3.0/security/securityapi/interfaces.go | 80 +- ...sqlvulnerabilityassessmentbaselinerules.go | 432 +++++ .../sqlvulnerabilityassessmentscanresults.go | 199 ++ .../sqlvulnerabilityassessmentscans.go | 194 ++ 18 files changed, 3974 insertions(+), 407 deletions(-) create mode 100644 services/preview/security/mgmt/v3.0/security/device.go create mode 100644 services/preview/security/mgmt/v3.0/security/devicesforhub.go create mode 100644 services/preview/security/mgmt/v3.0/security/devicesforsubscription.go create mode 100644 services/preview/security/mgmt/v3.0/security/sqlvulnerabilityassessmentbaselinerules.go create mode 100644 services/preview/security/mgmt/v3.0/security/sqlvulnerabilityassessmentscanresults.go create mode 100644 services/preview/security/mgmt/v3.0/security/sqlvulnerabilityassessmentscans.go diff --git a/services/preview/security/mgmt/v3.0/security/alerts.go b/services/preview/security/mgmt/v3.0/security/alerts.go index 7b6f2a156e83..4e76a7c0cce1 100644 --- a/services/preview/security/mgmt/v3.0/security/alerts.go +++ b/services/preview/security/mgmt/v3.0/security/alerts.go @@ -42,14 +42,14 @@ func NewAlertsClientWithBaseURI(baseURI string, subscriptionID string, ascLocati return AlertsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} } -// GetResourceGroupLevel get an alert that is associated a resource group or a resource in a resource group +// GetResourceGroupLevelAlerts get an alert that is associated a resource group or a resource in a resource group // Parameters: // alertName - name of the alert object // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. -func (client AlertsClient) GetResourceGroupLevel(ctx context.Context, alertName string, resourceGroupName string) (result Alert, err error) { +func (client AlertsClient) GetResourceGroupLevelAlerts(ctx context.Context, alertName string, resourceGroupName string) (result Alert, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.GetResourceGroupLevel") + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.GetResourceGroupLevelAlerts") defer func() { sc := -1 if result.Response.Response != nil { @@ -65,32 +65,32 @@ func (client AlertsClient) GetResourceGroupLevel(ctx context.Context, alertName Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AlertsClient", "GetResourceGroupLevel", err.Error()) + return result, validation.NewError("security.AlertsClient", "GetResourceGroupLevelAlerts", err.Error()) } - req, err := client.GetResourceGroupLevelPreparer(ctx, alertName, resourceGroupName) + req, err := client.GetResourceGroupLevelAlertsPreparer(ctx, alertName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetResourceGroupLevel", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetResourceGroupLevelAlerts", nil, "Failure preparing request") return } - resp, err := client.GetResourceGroupLevelSender(req) + resp, err := client.GetResourceGroupLevelAlertsSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetResourceGroupLevel", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetResourceGroupLevelAlerts", resp, "Failure sending request") return } - result, err = client.GetResourceGroupLevelResponder(resp) + result, err = client.GetResourceGroupLevelAlertsResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetResourceGroupLevel", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetResourceGroupLevelAlerts", resp, "Failure responding to request") } return } -// GetResourceGroupLevelPreparer prepares the GetResourceGroupLevel request. -func (client AlertsClient) GetResourceGroupLevelPreparer(ctx context.Context, alertName string, resourceGroupName string) (*http.Request, error) { +// GetResourceGroupLevelAlertsPreparer prepares the GetResourceGroupLevelAlerts request. +func (client AlertsClient) GetResourceGroupLevelAlertsPreparer(ctx context.Context, alertName string, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), "ascLocation": autorest.Encode("path", client.AscLocation), @@ -111,15 +111,15 @@ func (client AlertsClient) GetResourceGroupLevelPreparer(ctx context.Context, al return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetResourceGroupLevelSender sends the GetResourceGroupLevel request. The method will close the +// GetResourceGroupLevelAlertsSender sends the GetResourceGroupLevelAlerts request. The method will close the // http.Response Body if it receives an error. -func (client AlertsClient) GetResourceGroupLevelSender(req *http.Request) (*http.Response, error) { +func (client AlertsClient) GetResourceGroupLevelAlertsSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// GetResourceGroupLevelResponder handles the response to the GetResourceGroupLevel request. The method always +// GetResourceGroupLevelAlertsResponder handles the response to the GetResourceGroupLevelAlerts request. The method always // closes the http.Response Body. -func (client AlertsClient) GetResourceGroupLevelResponder(resp *http.Response) (result Alert, err error) { +func (client AlertsClient) GetResourceGroupLevelAlertsResponder(resp *http.Response) (result Alert, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -129,12 +129,12 @@ func (client AlertsClient) GetResourceGroupLevelResponder(resp *http.Response) ( return } -// GetSubscriptionLevel get an alert that is associated with a subscription +// GetSubscriptionLevelAlert get an alert that is associated with a subscription // Parameters: // alertName - name of the alert object -func (client AlertsClient) GetSubscriptionLevel(ctx context.Context, alertName string) (result Alert, err error) { +func (client AlertsClient) GetSubscriptionLevelAlert(ctx context.Context, alertName string) (result Alert, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.GetSubscriptionLevel") + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.GetSubscriptionLevelAlert") defer func() { sc := -1 if result.Response.Response != nil { @@ -146,32 +146,32 @@ func (client AlertsClient) GetSubscriptionLevel(ctx context.Context, alertName s if err := validation.Validate([]validation.Validation{ {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AlertsClient", "GetSubscriptionLevel", err.Error()) + return result, validation.NewError("security.AlertsClient", "GetSubscriptionLevelAlert", err.Error()) } - req, err := client.GetSubscriptionLevelPreparer(ctx, alertName) + req, err := client.GetSubscriptionLevelAlertPreparer(ctx, alertName) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetSubscriptionLevel", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetSubscriptionLevelAlert", nil, "Failure preparing request") return } - resp, err := client.GetSubscriptionLevelSender(req) + resp, err := client.GetSubscriptionLevelAlertSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetSubscriptionLevel", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetSubscriptionLevelAlert", resp, "Failure sending request") return } - result, err = client.GetSubscriptionLevelResponder(resp) + result, err = client.GetSubscriptionLevelAlertResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetSubscriptionLevel", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "GetSubscriptionLevelAlert", resp, "Failure responding to request") } return } -// GetSubscriptionLevelPreparer prepares the GetSubscriptionLevel request. -func (client AlertsClient) GetSubscriptionLevelPreparer(ctx context.Context, alertName string) (*http.Request, error) { +// GetSubscriptionLevelAlertPreparer prepares the GetSubscriptionLevelAlert request. +func (client AlertsClient) GetSubscriptionLevelAlertPreparer(ctx context.Context, alertName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), "ascLocation": autorest.Encode("path", client.AscLocation), @@ -191,15 +191,15 @@ func (client AlertsClient) GetSubscriptionLevelPreparer(ctx context.Context, ale return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetSubscriptionLevelSender sends the GetSubscriptionLevel request. The method will close the +// GetSubscriptionLevelAlertSender sends the GetSubscriptionLevelAlert request. The method will close the // http.Response Body if it receives an error. -func (client AlertsClient) GetSubscriptionLevelSender(req *http.Request) (*http.Response, error) { +func (client AlertsClient) GetSubscriptionLevelAlertSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// GetSubscriptionLevelResponder handles the response to the GetSubscriptionLevel request. The method always +// GetSubscriptionLevelAlertResponder handles the response to the GetSubscriptionLevelAlert request. The method always // closes the http.Response Body. -func (client AlertsClient) GetSubscriptionLevelResponder(resp *http.Response) (result Alert, err error) { +func (client AlertsClient) GetSubscriptionLevelAlertResponder(resp *http.Response) (result Alert, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -451,14 +451,14 @@ func (client AlertsClient) ListByResourceGroupComplete(ctx context.Context, reso return } -// ListResourceGroupLevelByRegion list all the alerts that are associated with the resource group that are stored in a -// specific location +// ListResourceGroupLevelAlertsByRegion list all the alerts that are associated with the resource group that are stored +// in a specific location // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. -func (client AlertsClient) ListResourceGroupLevelByRegion(ctx context.Context, resourceGroupName string) (result AlertListPage, err error) { +func (client AlertsClient) ListResourceGroupLevelAlertsByRegion(ctx context.Context, resourceGroupName string) (result AlertListPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListResourceGroupLevelByRegion") + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListResourceGroupLevelAlertsByRegion") defer func() { sc := -1 if result.al.Response.Response != nil { @@ -474,26 +474,26 @@ func (client AlertsClient) ListResourceGroupLevelByRegion(ctx context.Context, r Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AlertsClient", "ListResourceGroupLevelByRegion", err.Error()) + return result, validation.NewError("security.AlertsClient", "ListResourceGroupLevelAlertsByRegion", err.Error()) } - result.fn = client.listResourceGroupLevelByRegionNextResults - req, err := client.ListResourceGroupLevelByRegionPreparer(ctx, resourceGroupName) + result.fn = client.listResourceGroupLevelAlertsByRegionNextResults + req, err := client.ListResourceGroupLevelAlertsByRegionPreparer(ctx, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListResourceGroupLevelByRegion", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListResourceGroupLevelAlertsByRegion", nil, "Failure preparing request") return } - resp, err := client.ListResourceGroupLevelByRegionSender(req) + resp, err := client.ListResourceGroupLevelAlertsByRegionSender(req) if err != nil { result.al.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListResourceGroupLevelByRegion", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListResourceGroupLevelAlertsByRegion", resp, "Failure sending request") return } - result.al, err = client.ListResourceGroupLevelByRegionResponder(resp) + result.al, err = client.ListResourceGroupLevelAlertsByRegionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListResourceGroupLevelByRegion", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListResourceGroupLevelAlertsByRegion", resp, "Failure responding to request") } if result.al.hasNextLink() && result.al.IsEmpty() { err = result.NextWithContext(ctx) @@ -502,8 +502,8 @@ func (client AlertsClient) ListResourceGroupLevelByRegion(ctx context.Context, r return } -// ListResourceGroupLevelByRegionPreparer prepares the ListResourceGroupLevelByRegion request. -func (client AlertsClient) ListResourceGroupLevelByRegionPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { +// ListResourceGroupLevelAlertsByRegionPreparer prepares the ListResourceGroupLevelAlertsByRegion request. +func (client AlertsClient) ListResourceGroupLevelAlertsByRegionPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "ascLocation": autorest.Encode("path", client.AscLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -523,15 +523,15 @@ func (client AlertsClient) ListResourceGroupLevelByRegionPreparer(ctx context.Co return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListResourceGroupLevelByRegionSender sends the ListResourceGroupLevelByRegion request. The method will close the +// ListResourceGroupLevelAlertsByRegionSender sends the ListResourceGroupLevelAlertsByRegion request. The method will close the // http.Response Body if it receives an error. -func (client AlertsClient) ListResourceGroupLevelByRegionSender(req *http.Request) (*http.Response, error) { +func (client AlertsClient) ListResourceGroupLevelAlertsByRegionSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// ListResourceGroupLevelByRegionResponder handles the response to the ListResourceGroupLevelByRegion request. The method always +// ListResourceGroupLevelAlertsByRegionResponder handles the response to the ListResourceGroupLevelAlertsByRegion request. The method always // closes the http.Response Body. -func (client AlertsClient) ListResourceGroupLevelByRegionResponder(resp *http.Response) (result AlertList, err error) { +func (client AlertsClient) ListResourceGroupLevelAlertsByRegionResponder(resp *http.Response) (result AlertList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -541,31 +541,31 @@ func (client AlertsClient) ListResourceGroupLevelByRegionResponder(resp *http.Re return } -// listResourceGroupLevelByRegionNextResults retrieves the next set of results, if any. -func (client AlertsClient) listResourceGroupLevelByRegionNextResults(ctx context.Context, lastResults AlertList) (result AlertList, err error) { +// listResourceGroupLevelAlertsByRegionNextResults retrieves the next set of results, if any. +func (client AlertsClient) listResourceGroupLevelAlertsByRegionNextResults(ctx context.Context, lastResults AlertList) (result AlertList, err error) { req, err := lastResults.alertListPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "security.AlertsClient", "listResourceGroupLevelByRegionNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "security.AlertsClient", "listResourceGroupLevelAlertsByRegionNextResults", nil, "Failure preparing next results request") } if req == nil { return } - resp, err := client.ListResourceGroupLevelByRegionSender(req) + resp, err := client.ListResourceGroupLevelAlertsByRegionSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "security.AlertsClient", "listResourceGroupLevelByRegionNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "security.AlertsClient", "listResourceGroupLevelAlertsByRegionNextResults", resp, "Failure sending next results request") } - result, err = client.ListResourceGroupLevelByRegionResponder(resp) + result, err = client.ListResourceGroupLevelAlertsByRegionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "listResourceGroupLevelByRegionNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "listResourceGroupLevelAlertsByRegionNextResults", resp, "Failure responding to next results request") } return } -// ListResourceGroupLevelByRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AlertsClient) ListResourceGroupLevelByRegionComplete(ctx context.Context, resourceGroupName string) (result AlertListIterator, err error) { +// ListResourceGroupLevelAlertsByRegionComplete enumerates all values, automatically crossing page boundaries as required. +func (client AlertsClient) ListResourceGroupLevelAlertsByRegionComplete(ctx context.Context, resourceGroupName string) (result AlertListIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListResourceGroupLevelByRegion") + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListResourceGroupLevelAlertsByRegion") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -574,15 +574,15 @@ func (client AlertsClient) ListResourceGroupLevelByRegionComplete(ctx context.Co tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListResourceGroupLevelByRegion(ctx, resourceGroupName) + result.page, err = client.ListResourceGroupLevelAlertsByRegion(ctx, resourceGroupName) return } -// ListSubscriptionLevelByRegion list all the alerts that are associated with the subscription that are stored in a -// specific location -func (client AlertsClient) ListSubscriptionLevelByRegion(ctx context.Context) (result AlertListPage, err error) { +// ListSubscriptionLevelAlertsByRegion list all the alerts that are associated with the subscription that are stored in +// a specific location +func (client AlertsClient) ListSubscriptionLevelAlertsByRegion(ctx context.Context) (result AlertListPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListSubscriptionLevelByRegion") + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListSubscriptionLevelAlertsByRegion") defer func() { sc := -1 if result.al.Response.Response != nil { @@ -594,26 +594,26 @@ func (client AlertsClient) ListSubscriptionLevelByRegion(ctx context.Context) (r if err := validation.Validate([]validation.Validation{ {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AlertsClient", "ListSubscriptionLevelByRegion", err.Error()) + return result, validation.NewError("security.AlertsClient", "ListSubscriptionLevelAlertsByRegion", err.Error()) } - result.fn = client.listSubscriptionLevelByRegionNextResults - req, err := client.ListSubscriptionLevelByRegionPreparer(ctx) + result.fn = client.listSubscriptionLevelAlertsByRegionNextResults + req, err := client.ListSubscriptionLevelAlertsByRegionPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListSubscriptionLevelByRegion", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListSubscriptionLevelAlertsByRegion", nil, "Failure preparing request") return } - resp, err := client.ListSubscriptionLevelByRegionSender(req) + resp, err := client.ListSubscriptionLevelAlertsByRegionSender(req) if err != nil { result.al.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListSubscriptionLevelByRegion", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListSubscriptionLevelAlertsByRegion", resp, "Failure sending request") return } - result.al, err = client.ListSubscriptionLevelByRegionResponder(resp) + result.al, err = client.ListSubscriptionLevelAlertsByRegionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListSubscriptionLevelByRegion", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListSubscriptionLevelAlertsByRegion", resp, "Failure responding to request") } if result.al.hasNextLink() && result.al.IsEmpty() { err = result.NextWithContext(ctx) @@ -622,8 +622,8 @@ func (client AlertsClient) ListSubscriptionLevelByRegion(ctx context.Context) (r return } -// ListSubscriptionLevelByRegionPreparer prepares the ListSubscriptionLevelByRegion request. -func (client AlertsClient) ListSubscriptionLevelByRegionPreparer(ctx context.Context) (*http.Request, error) { +// ListSubscriptionLevelAlertsByRegionPreparer prepares the ListSubscriptionLevelAlertsByRegion request. +func (client AlertsClient) ListSubscriptionLevelAlertsByRegionPreparer(ctx context.Context) (*http.Request, error) { pathParameters := map[string]interface{}{ "ascLocation": autorest.Encode("path", client.AscLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -642,15 +642,15 @@ func (client AlertsClient) ListSubscriptionLevelByRegionPreparer(ctx context.Con return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListSubscriptionLevelByRegionSender sends the ListSubscriptionLevelByRegion request. The method will close the +// ListSubscriptionLevelAlertsByRegionSender sends the ListSubscriptionLevelAlertsByRegion request. The method will close the // http.Response Body if it receives an error. -func (client AlertsClient) ListSubscriptionLevelByRegionSender(req *http.Request) (*http.Response, error) { +func (client AlertsClient) ListSubscriptionLevelAlertsByRegionSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// ListSubscriptionLevelByRegionResponder handles the response to the ListSubscriptionLevelByRegion request. The method always +// ListSubscriptionLevelAlertsByRegionResponder handles the response to the ListSubscriptionLevelAlertsByRegion request. The method always // closes the http.Response Body. -func (client AlertsClient) ListSubscriptionLevelByRegionResponder(resp *http.Response) (result AlertList, err error) { +func (client AlertsClient) ListSubscriptionLevelAlertsByRegionResponder(resp *http.Response) (result AlertList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -660,31 +660,31 @@ func (client AlertsClient) ListSubscriptionLevelByRegionResponder(resp *http.Res return } -// listSubscriptionLevelByRegionNextResults retrieves the next set of results, if any. -func (client AlertsClient) listSubscriptionLevelByRegionNextResults(ctx context.Context, lastResults AlertList) (result AlertList, err error) { +// listSubscriptionLevelAlertsByRegionNextResults retrieves the next set of results, if any. +func (client AlertsClient) listSubscriptionLevelAlertsByRegionNextResults(ctx context.Context, lastResults AlertList) (result AlertList, err error) { req, err := lastResults.alertListPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "security.AlertsClient", "listSubscriptionLevelByRegionNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "security.AlertsClient", "listSubscriptionLevelAlertsByRegionNextResults", nil, "Failure preparing next results request") } if req == nil { return } - resp, err := client.ListSubscriptionLevelByRegionSender(req) + resp, err := client.ListSubscriptionLevelAlertsByRegionSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "security.AlertsClient", "listSubscriptionLevelByRegionNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "security.AlertsClient", "listSubscriptionLevelAlertsByRegionNextResults", resp, "Failure sending next results request") } - result, err = client.ListSubscriptionLevelByRegionResponder(resp) + result, err = client.ListSubscriptionLevelAlertsByRegionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "listSubscriptionLevelByRegionNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "listSubscriptionLevelAlertsByRegionNextResults", resp, "Failure responding to next results request") } return } -// ListSubscriptionLevelByRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AlertsClient) ListSubscriptionLevelByRegionComplete(ctx context.Context) (result AlertListIterator, err error) { +// ListSubscriptionLevelAlertsByRegionComplete enumerates all values, automatically crossing page boundaries as required. +func (client AlertsClient) ListSubscriptionLevelAlertsByRegionComplete(ctx context.Context) (result AlertListIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListSubscriptionLevelByRegion") + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListSubscriptionLevelAlertsByRegion") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -693,18 +693,18 @@ func (client AlertsClient) ListSubscriptionLevelByRegionComplete(ctx context.Con tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListSubscriptionLevelByRegion(ctx) + result.page, err = client.ListSubscriptionLevelAlertsByRegion(ctx) return } -// UpdateResourceGroupLevelStateToActivate update the alert's state +// UpdateResourceGroupLevelAlertStateToDismiss update the alert's state // Parameters: // alertName - name of the alert object // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. -func (client AlertsClient) UpdateResourceGroupLevelStateToActivate(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) { +func (client AlertsClient) UpdateResourceGroupLevelAlertStateToDismiss(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateResourceGroupLevelStateToActivate") + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateResourceGroupLevelAlertStateToDismiss") defer func() { sc := -1 if result.Response != nil { @@ -720,32 +720,32 @@ func (client AlertsClient) UpdateResourceGroupLevelStateToActivate(ctx context.C Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AlertsClient", "UpdateResourceGroupLevelStateToActivate", err.Error()) + return result, validation.NewError("security.AlertsClient", "UpdateResourceGroupLevelAlertStateToDismiss", err.Error()) } - req, err := client.UpdateResourceGroupLevelStateToActivatePreparer(ctx, alertName, resourceGroupName) + req, err := client.UpdateResourceGroupLevelAlertStateToDismissPreparer(ctx, alertName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelStateToActivate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelAlertStateToDismiss", nil, "Failure preparing request") return } - resp, err := client.UpdateResourceGroupLevelStateToActivateSender(req) + resp, err := client.UpdateResourceGroupLevelAlertStateToDismissSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelStateToActivate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelAlertStateToDismiss", resp, "Failure sending request") return } - result, err = client.UpdateResourceGroupLevelStateToActivateResponder(resp) + result, err = client.UpdateResourceGroupLevelAlertStateToDismissResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelStateToActivate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelAlertStateToDismiss", resp, "Failure responding to request") } return } -// UpdateResourceGroupLevelStateToActivatePreparer prepares the UpdateResourceGroupLevelStateToActivate request. -func (client AlertsClient) UpdateResourceGroupLevelStateToActivatePreparer(ctx context.Context, alertName string, resourceGroupName string) (*http.Request, error) { +// UpdateResourceGroupLevelAlertStateToDismissPreparer prepares the UpdateResourceGroupLevelAlertStateToDismiss request. +func (client AlertsClient) UpdateResourceGroupLevelAlertStateToDismissPreparer(ctx context.Context, alertName string, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), "ascLocation": autorest.Encode("path", client.AscLocation), @@ -761,20 +761,20 @@ func (client AlertsClient) UpdateResourceGroupLevelStateToActivatePreparer(ctx c preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// UpdateResourceGroupLevelStateToActivateSender sends the UpdateResourceGroupLevelStateToActivate request. The method will close the +// UpdateResourceGroupLevelAlertStateToDismissSender sends the UpdateResourceGroupLevelAlertStateToDismiss request. The method will close the // http.Response Body if it receives an error. -func (client AlertsClient) UpdateResourceGroupLevelStateToActivateSender(req *http.Request) (*http.Response, error) { +func (client AlertsClient) UpdateResourceGroupLevelAlertStateToDismissSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// UpdateResourceGroupLevelStateToActivateResponder handles the response to the UpdateResourceGroupLevelStateToActivate request. The method always +// UpdateResourceGroupLevelAlertStateToDismissResponder handles the response to the UpdateResourceGroupLevelAlertStateToDismiss request. The method always // closes the http.Response Body. -func (client AlertsClient) UpdateResourceGroupLevelStateToActivateResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AlertsClient) UpdateResourceGroupLevelAlertStateToDismissResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), @@ -783,14 +783,14 @@ func (client AlertsClient) UpdateResourceGroupLevelStateToActivateResponder(resp return } -// UpdateResourceGroupLevelStateToDismiss update the alert's state +// UpdateResourceGroupLevelAlertStateToReactivate update the alert's state // Parameters: // alertName - name of the alert object // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. -func (client AlertsClient) UpdateResourceGroupLevelStateToDismiss(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) { +func (client AlertsClient) UpdateResourceGroupLevelAlertStateToReactivate(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateResourceGroupLevelStateToDismiss") + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateResourceGroupLevelAlertStateToReactivate") defer func() { sc := -1 if result.Response != nil { @@ -806,32 +806,32 @@ func (client AlertsClient) UpdateResourceGroupLevelStateToDismiss(ctx context.Co Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AlertsClient", "UpdateResourceGroupLevelStateToDismiss", err.Error()) + return result, validation.NewError("security.AlertsClient", "UpdateResourceGroupLevelAlertStateToReactivate", err.Error()) } - req, err := client.UpdateResourceGroupLevelStateToDismissPreparer(ctx, alertName, resourceGroupName) + req, err := client.UpdateResourceGroupLevelAlertStateToReactivatePreparer(ctx, alertName, resourceGroupName) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelStateToDismiss", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelAlertStateToReactivate", nil, "Failure preparing request") return } - resp, err := client.UpdateResourceGroupLevelStateToDismissSender(req) + resp, err := client.UpdateResourceGroupLevelAlertStateToReactivateSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelStateToDismiss", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelAlertStateToReactivate", resp, "Failure sending request") return } - result, err = client.UpdateResourceGroupLevelStateToDismissResponder(resp) + result, err = client.UpdateResourceGroupLevelAlertStateToReactivateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelStateToDismiss", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateResourceGroupLevelAlertStateToReactivate", resp, "Failure responding to request") } return } -// UpdateResourceGroupLevelStateToDismissPreparer prepares the UpdateResourceGroupLevelStateToDismiss request. -func (client AlertsClient) UpdateResourceGroupLevelStateToDismissPreparer(ctx context.Context, alertName string, resourceGroupName string) (*http.Request, error) { +// UpdateResourceGroupLevelAlertStateToReactivatePreparer prepares the UpdateResourceGroupLevelAlertStateToReactivate request. +func (client AlertsClient) UpdateResourceGroupLevelAlertStateToReactivatePreparer(ctx context.Context, alertName string, resourceGroupName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), "ascLocation": autorest.Encode("path", client.AscLocation), @@ -847,20 +847,20 @@ func (client AlertsClient) UpdateResourceGroupLevelStateToDismissPreparer(ctx co preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// UpdateResourceGroupLevelStateToDismissSender sends the UpdateResourceGroupLevelStateToDismiss request. The method will close the +// UpdateResourceGroupLevelAlertStateToReactivateSender sends the UpdateResourceGroupLevelAlertStateToReactivate request. The method will close the // http.Response Body if it receives an error. -func (client AlertsClient) UpdateResourceGroupLevelStateToDismissSender(req *http.Request) (*http.Response, error) { +func (client AlertsClient) UpdateResourceGroupLevelAlertStateToReactivateSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// UpdateResourceGroupLevelStateToDismissResponder handles the response to the UpdateResourceGroupLevelStateToDismiss request. The method always +// UpdateResourceGroupLevelAlertStateToReactivateResponder handles the response to the UpdateResourceGroupLevelAlertStateToReactivate request. The method always // closes the http.Response Body. -func (client AlertsClient) UpdateResourceGroupLevelStateToDismissResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AlertsClient) UpdateResourceGroupLevelAlertStateToReactivateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), @@ -955,12 +955,12 @@ func (client AlertsClient) UpdateResourceGroupLevelStateToResolveResponder(resp return } -// UpdateSubscriptionLevelStateToActivate update the alert's state +// UpdateSubscriptionLevelAlertStateToDismiss update the alert's state // Parameters: // alertName - name of the alert object -func (client AlertsClient) UpdateSubscriptionLevelStateToActivate(ctx context.Context, alertName string) (result autorest.Response, err error) { +func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismiss(ctx context.Context, alertName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateSubscriptionLevelStateToActivate") + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateSubscriptionLevelAlertStateToDismiss") defer func() { sc := -1 if result.Response != nil { @@ -972,32 +972,32 @@ func (client AlertsClient) UpdateSubscriptionLevelStateToActivate(ctx context.Co if err := validation.Validate([]validation.Validation{ {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AlertsClient", "UpdateSubscriptionLevelStateToActivate", err.Error()) + return result, validation.NewError("security.AlertsClient", "UpdateSubscriptionLevelAlertStateToDismiss", err.Error()) } - req, err := client.UpdateSubscriptionLevelStateToActivatePreparer(ctx, alertName) + req, err := client.UpdateSubscriptionLevelAlertStateToDismissPreparer(ctx, alertName) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelStateToActivate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelAlertStateToDismiss", nil, "Failure preparing request") return } - resp, err := client.UpdateSubscriptionLevelStateToActivateSender(req) + resp, err := client.UpdateSubscriptionLevelAlertStateToDismissSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelStateToActivate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelAlertStateToDismiss", resp, "Failure sending request") return } - result, err = client.UpdateSubscriptionLevelStateToActivateResponder(resp) + result, err = client.UpdateSubscriptionLevelAlertStateToDismissResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelStateToActivate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelAlertStateToDismiss", resp, "Failure responding to request") } return } -// UpdateSubscriptionLevelStateToActivatePreparer prepares the UpdateSubscriptionLevelStateToActivate request. -func (client AlertsClient) UpdateSubscriptionLevelStateToActivatePreparer(ctx context.Context, alertName string) (*http.Request, error) { +// UpdateSubscriptionLevelAlertStateToDismissPreparer prepares the UpdateSubscriptionLevelAlertStateToDismiss request. +func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismissPreparer(ctx context.Context, alertName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), "ascLocation": autorest.Encode("path", client.AscLocation), @@ -1012,20 +1012,20 @@ func (client AlertsClient) UpdateSubscriptionLevelStateToActivatePreparer(ctx co preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// UpdateSubscriptionLevelStateToActivateSender sends the UpdateSubscriptionLevelStateToActivate request. The method will close the +// UpdateSubscriptionLevelAlertStateToDismissSender sends the UpdateSubscriptionLevelAlertStateToDismiss request. The method will close the // http.Response Body if it receives an error. -func (client AlertsClient) UpdateSubscriptionLevelStateToActivateSender(req *http.Request) (*http.Response, error) { +func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismissSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// UpdateSubscriptionLevelStateToActivateResponder handles the response to the UpdateSubscriptionLevelStateToActivate request. The method always +// UpdateSubscriptionLevelAlertStateToDismissResponder handles the response to the UpdateSubscriptionLevelAlertStateToDismiss request. The method always // closes the http.Response Body. -func (client AlertsClient) UpdateSubscriptionLevelStateToActivateResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismissResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), @@ -1034,12 +1034,12 @@ func (client AlertsClient) UpdateSubscriptionLevelStateToActivateResponder(resp return } -// UpdateSubscriptionLevelStateToDismiss update the alert's state +// UpdateSubscriptionLevelAlertStateToReactivate update the alert's state // Parameters: // alertName - name of the alert object -func (client AlertsClient) UpdateSubscriptionLevelStateToDismiss(ctx context.Context, alertName string) (result autorest.Response, err error) { +func (client AlertsClient) UpdateSubscriptionLevelAlertStateToReactivate(ctx context.Context, alertName string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateSubscriptionLevelStateToDismiss") + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.UpdateSubscriptionLevelAlertStateToReactivate") defer func() { sc := -1 if result.Response != nil { @@ -1051,32 +1051,32 @@ func (client AlertsClient) UpdateSubscriptionLevelStateToDismiss(ctx context.Con if err := validation.Validate([]validation.Validation{ {TargetValue: client.SubscriptionID, Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AlertsClient", "UpdateSubscriptionLevelStateToDismiss", err.Error()) + return result, validation.NewError("security.AlertsClient", "UpdateSubscriptionLevelAlertStateToReactivate", err.Error()) } - req, err := client.UpdateSubscriptionLevelStateToDismissPreparer(ctx, alertName) + req, err := client.UpdateSubscriptionLevelAlertStateToReactivatePreparer(ctx, alertName) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelStateToDismiss", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelAlertStateToReactivate", nil, "Failure preparing request") return } - resp, err := client.UpdateSubscriptionLevelStateToDismissSender(req) + resp, err := client.UpdateSubscriptionLevelAlertStateToReactivateSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelStateToDismiss", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelAlertStateToReactivate", resp, "Failure sending request") return } - result, err = client.UpdateSubscriptionLevelStateToDismissResponder(resp) + result, err = client.UpdateSubscriptionLevelAlertStateToReactivateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelStateToDismiss", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "security.AlertsClient", "UpdateSubscriptionLevelAlertStateToReactivate", resp, "Failure responding to request") } return } -// UpdateSubscriptionLevelStateToDismissPreparer prepares the UpdateSubscriptionLevelStateToDismiss request. -func (client AlertsClient) UpdateSubscriptionLevelStateToDismissPreparer(ctx context.Context, alertName string) (*http.Request, error) { +// UpdateSubscriptionLevelAlertStateToReactivatePreparer prepares the UpdateSubscriptionLevelAlertStateToReactivate request. +func (client AlertsClient) UpdateSubscriptionLevelAlertStateToReactivatePreparer(ctx context.Context, alertName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "alertName": autorest.Encode("path", alertName), "ascLocation": autorest.Encode("path", client.AscLocation), @@ -1091,20 +1091,20 @@ func (client AlertsClient) UpdateSubscriptionLevelStateToDismissPreparer(ctx con preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/dismiss", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/alerts/{alertName}/activate", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// UpdateSubscriptionLevelStateToDismissSender sends the UpdateSubscriptionLevelStateToDismiss request. The method will close the +// UpdateSubscriptionLevelAlertStateToReactivateSender sends the UpdateSubscriptionLevelAlertStateToReactivate request. The method will close the // http.Response Body if it receives an error. -func (client AlertsClient) UpdateSubscriptionLevelStateToDismissSender(req *http.Request) (*http.Response, error) { +func (client AlertsClient) UpdateSubscriptionLevelAlertStateToReactivateSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// UpdateSubscriptionLevelStateToDismissResponder handles the response to the UpdateSubscriptionLevelStateToDismiss request. The method always +// UpdateSubscriptionLevelAlertStateToReactivateResponder handles the response to the UpdateSubscriptionLevelAlertStateToReactivate request. The method always // closes the http.Response Body. -func (client AlertsClient) UpdateSubscriptionLevelStateToDismissResponder(resp *http.Response) (result autorest.Response, err error) { +func (client AlertsClient) UpdateSubscriptionLevelAlertStateToReactivateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), diff --git a/services/preview/security/mgmt/v3.0/security/connectors.go b/services/preview/security/mgmt/v3.0/security/connectors.go index 283167416f16..f49e28025643 100644 --- a/services/preview/security/mgmt/v3.0/security/connectors.go +++ b/services/preview/security/mgmt/v3.0/security/connectors.go @@ -42,8 +42,8 @@ func NewConnectorsClientWithBaseURI(baseURI string, subscriptionID string, ascLo return ConnectorsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} } -// CreateOrUpdate create a cloud account connector or update an existing one. Connect to your AWS cloud account using -// either account credentials or role-based authentication. +// CreateOrUpdate create a cloud account connector or update an existing one. Connect to your cloud account. For AWS, +// use either account credentials or role-based authentication. For GCP, use account organization credentials. // Parameters: // connectorName - name of the cloud account connector // connectorSetting - settings for the cloud account connector diff --git a/services/preview/security/mgmt/v3.0/security/device.go b/services/preview/security/mgmt/v3.0/security/device.go new file mode 100644 index 000000000000..6aeda8f4cc42 --- /dev/null +++ b/services/preview/security/mgmt/v3.0/security/device.go @@ -0,0 +1,116 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DeviceClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type DeviceClient struct { + BaseClient +} + +// NewDeviceClient creates an instance of the DeviceClient client. +func NewDeviceClient(subscriptionID string, ascLocation string) DeviceClient { + return NewDeviceClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewDeviceClientWithBaseURI creates an instance of the DeviceClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewDeviceClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) DeviceClient { + return DeviceClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// Get get device. +// Parameters: +// resourceID - the identifier of the resource. +// deviceID - identifier of the device. +func (client DeviceClient) Get(ctx context.Context, resourceID string, deviceID string) (result Device, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeviceClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceID, deviceID) + if err != nil { + err = autorest.NewErrorWithError(err, "security.DeviceClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.DeviceClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.DeviceClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DeviceClient) GetPreparer(ctx context.Context, resourceID string, deviceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deviceId": autorest.Encode("path", deviceID), + "resourceId": resourceID, + } + + const APIVersion = "2020-08-06-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceId}/providers/Microsoft.Security/devices/{deviceId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DeviceClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DeviceClient) GetResponder(resp *http.Response) (result Device, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/security/mgmt/v3.0/security/devicesforhub.go b/services/preview/security/mgmt/v3.0/security/devicesforhub.go new file mode 100644 index 000000000000..99cca3e97110 --- /dev/null +++ b/services/preview/security/mgmt/v3.0/security/devicesforhub.go @@ -0,0 +1,167 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DevicesForHubClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type DevicesForHubClient struct { + BaseClient +} + +// NewDevicesForHubClient creates an instance of the DevicesForHubClient client. +func NewDevicesForHubClient(subscriptionID string, ascLocation string) DevicesForHubClient { + return NewDevicesForHubClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewDevicesForHubClientWithBaseURI creates an instance of the DevicesForHubClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewDevicesForHubClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) DevicesForHubClient { + return DevicesForHubClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// List get list of the devices for the specified IoT Hub resource. +// Parameters: +// resourceID - the identifier of the resource. +// limit - limit the number of items returned in a single page +// skipToken - skip token used for pagination +// deviceManagementType - get devices only from specific type, Managed or Unmanaged. +func (client DevicesForHubClient) List(ctx context.Context, resourceID string, limit *int32, skipToken string, deviceManagementType ManagementState) (result DeviceListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesForHubClient.List") + defer func() { + sc := -1 + if result.dl.Response.Response != nil { + sc = result.dl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceID, limit, skipToken, deviceManagementType) + if err != nil { + err = autorest.NewErrorWithError(err, "security.DevicesForHubClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.dl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.DevicesForHubClient", "List", resp, "Failure sending request") + return + } + + result.dl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.DevicesForHubClient", "List", resp, "Failure responding to request") + } + if result.dl.hasNextLink() && result.dl.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// ListPreparer prepares the List request. +func (client DevicesForHubClient) ListPreparer(ctx context.Context, resourceID string, limit *int32, skipToken string, deviceManagementType ManagementState) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceId": resourceID, + } + + const APIVersion = "2020-08-06-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if limit != nil { + queryParameters["$limit"] = autorest.Encode("query", *limit) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + if len(string(deviceManagementType)) > 0 { + queryParameters["deviceManagementType"] = autorest.Encode("query", deviceManagementType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceId}/providers/Microsoft.Security/devices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client DevicesForHubClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client DevicesForHubClient) ListResponder(resp *http.Response) (result DeviceList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client DevicesForHubClient) listNextResults(ctx context.Context, lastResults DeviceList) (result DeviceList, err error) { + req, err := lastResults.deviceListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.DevicesForHubClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.DevicesForHubClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.DevicesForHubClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client DevicesForHubClient) ListComplete(ctx context.Context, resourceID string, limit *int32, skipToken string, deviceManagementType ManagementState) (result DeviceListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesForHubClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceID, limit, skipToken, deviceManagementType) + return +} diff --git a/services/preview/security/mgmt/v3.0/security/devicesforsubscription.go b/services/preview/security/mgmt/v3.0/security/devicesforsubscription.go new file mode 100644 index 000000000000..3f37062e011f --- /dev/null +++ b/services/preview/security/mgmt/v3.0/security/devicesforsubscription.go @@ -0,0 +1,174 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DevicesForSubscriptionClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type DevicesForSubscriptionClient struct { + BaseClient +} + +// NewDevicesForSubscriptionClient creates an instance of the DevicesForSubscriptionClient client. +func NewDevicesForSubscriptionClient(subscriptionID string, ascLocation string) DevicesForSubscriptionClient { + return NewDevicesForSubscriptionClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewDevicesForSubscriptionClientWithBaseURI creates an instance of the DevicesForSubscriptionClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewDevicesForSubscriptionClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) DevicesForSubscriptionClient { + return DevicesForSubscriptionClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// List get list of the devices by their subscription. +// Parameters: +// limit - limit the number of items returned in a single page +// skipToken - skip token used for pagination +// deviceManagementType - get devices only from specific type, Managed or Unmanaged. +func (client DevicesForSubscriptionClient) List(ctx context.Context, limit *int32, skipToken string, deviceManagementType ManagementState) (result DeviceListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesForSubscriptionClient.List") + defer func() { + sc := -1 + if result.dl.Response.Response != nil { + sc = result.dl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.DevicesForSubscriptionClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, limit, skipToken, deviceManagementType) + if err != nil { + err = autorest.NewErrorWithError(err, "security.DevicesForSubscriptionClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.dl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.DevicesForSubscriptionClient", "List", resp, "Failure sending request") + return + } + + result.dl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.DevicesForSubscriptionClient", "List", resp, "Failure responding to request") + } + if result.dl.hasNextLink() && result.dl.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// ListPreparer prepares the List request. +func (client DevicesForSubscriptionClient) ListPreparer(ctx context.Context, limit *int32, skipToken string, deviceManagementType ManagementState) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-08-06-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if limit != nil { + queryParameters["$limit"] = autorest.Encode("query", *limit) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + if len(string(deviceManagementType)) > 0 { + queryParameters["deviceManagementType"] = autorest.Encode("query", deviceManagementType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/devices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client DevicesForSubscriptionClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client DevicesForSubscriptionClient) ListResponder(resp *http.Response) (result DeviceList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client DevicesForSubscriptionClient) listNextResults(ctx context.Context, lastResults DeviceList) (result DeviceList, err error) { + req, err := lastResults.deviceListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.DevicesForSubscriptionClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.DevicesForSubscriptionClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.DevicesForSubscriptionClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client DevicesForSubscriptionClient) ListComplete(ctx context.Context, limit *int32, skipToken string, deviceManagementType ManagementState) (result DeviceListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DevicesForSubscriptionClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, limit, skipToken, deviceManagementType) + return +} diff --git a/services/preview/security/mgmt/v3.0/security/enums.go b/services/preview/security/mgmt/v3.0/security/enums.go index 34e9b3e51a97..28f2efb55d0b 100644 --- a/services/preview/security/mgmt/v3.0/security/enums.go +++ b/services/preview/security/mgmt/v3.0/security/enums.go @@ -240,7 +240,7 @@ func PossibleAssessmentTypeValues() []AssessmentType { type AuthenticationProvisioningState string const ( - // Expired the connection is expired + // Expired the connection has expired Expired AuthenticationProvisioningState = "Expired" // IncorrectPolicy Incorrect policy of the connector IncorrectPolicy AuthenticationProvisioningState = "IncorrectPolicy" @@ -274,6 +274,21 @@ func PossibleAuthenticationTypeValues() []AuthenticationType { return []AuthenticationType{AuthenticationTypeAuthenticationDetailsProperties, AuthenticationTypeAwsAssumeRole, AuthenticationTypeAwsCreds, AuthenticationTypeGcpCredentials} } +// AuthorizationState enumerates the values for authorization state. +type AuthorizationState string + +const ( + // Authorized ... + Authorized AuthorizationState = "Authorized" + // Unauthorized ... + Unauthorized AuthorizationState = "Unauthorized" +) + +// PossibleAuthorizationStateValues returns an array of possible values for the AuthorizationState const type. +func PossibleAuthorizationStateValues() []AuthorizationState { + return []AuthorizationState{Authorized, Unauthorized} +} + // AutoProvision enumerates the values for auto provision. type AutoProvision string @@ -416,6 +431,36 @@ func PossibleDataSourceValues() []DataSource { return []DataSource{TwinData} } +// DeviceCriticality enumerates the values for device criticality. +type DeviceCriticality string + +const ( + // Important ... + Important DeviceCriticality = "Important" + // Standard ... + Standard DeviceCriticality = "Standard" +) + +// PossibleDeviceCriticalityValues returns an array of possible values for the DeviceCriticality const type. +func PossibleDeviceCriticalityValues() []DeviceCriticality { + return []DeviceCriticality{Important, Standard} +} + +// DeviceStatus enumerates the values for device status. +type DeviceStatus string + +const ( + // DeviceStatusActive ... + DeviceStatusActive DeviceStatus = "Active" + // DeviceStatusRemoved ... + DeviceStatusRemoved DeviceStatus = "Removed" +) + +// PossibleDeviceStatusValues returns an array of possible values for the DeviceStatus const type. +func PossibleDeviceStatusValues() []DeviceStatus { + return []DeviceStatus{DeviceStatusActive, DeviceStatusRemoved} +} + // Direction enumerates the values for direction. type Direction string @@ -473,13 +518,17 @@ const ( Alerts EventSource = "Alerts" // Assessments ... Assessments EventSource = "Assessments" + // SecureScoreControls ... + SecureScoreControls EventSource = "SecureScoreControls" + // SecureScores ... + SecureScores EventSource = "SecureScores" // SubAssessments ... SubAssessments EventSource = "SubAssessments" ) // PossibleEventSourceValues returns an array of possible values for the EventSource const type. func PossibleEventSourceValues() []EventSource { - return []EventSource{Alerts, Assessments, SubAssessments} + return []EventSource{Alerts, Assessments, SecureScoreControls, SecureScores, SubAssessments} } // Exe enumerates the values for exe. @@ -773,6 +822,36 @@ func PossibleKindEnum1Values() []KindEnum1 { return []KindEnum1{KindAAD, KindATA, KindCEF, KindExternalSecuritySolution} } +// MacSignificance enumerates the values for mac significance. +type MacSignificance string + +const ( + // Primary ... + Primary MacSignificance = "Primary" + // Secondary ... + Secondary MacSignificance = "Secondary" +) + +// PossibleMacSignificanceValues returns an array of possible values for the MacSignificance const type. +func PossibleMacSignificanceValues() []MacSignificance { + return []MacSignificance{Primary, Secondary} +} + +// ManagementState enumerates the values for management state. +type ManagementState string + +const ( + // Managed ... + Managed ManagementState = "Managed" + // Unmanaged ... + Unmanaged ManagementState = "Unmanaged" +) + +// PossibleManagementStateValues returns an array of possible values for the ManagementState const type. +func PossibleManagementStateValues() []ManagementState { + return []ManagementState{Managed, Unmanaged} +} + // Msi enumerates the values for msi. type Msi string @@ -843,15 +922,30 @@ func PossiblePermissionPropertyValues() []PermissionProperty { type PricingTier string const ( - // Free Get free Azure security center experience with basic security features - Free PricingTier = "Free" - // Standard Get the standard Azure security center experience with advanced security features - Standard PricingTier = "Standard" + // PricingTierFree Get free Azure security center experience with basic security features + PricingTierFree PricingTier = "Free" + // PricingTierStandard Get the standard Azure security center experience with advanced security features + PricingTierStandard PricingTier = "Standard" ) // PossiblePricingTierValues returns an array of possible values for the PricingTier const type. func PossiblePricingTierValues() []PricingTier { - return []PricingTier{Free, Standard} + return []PricingTier{PricingTierFree, PricingTierStandard} +} + +// ProgrammingState enumerates the values for programming state. +type ProgrammingState string + +const ( + // NotProgrammingDevice ... + NotProgrammingDevice ProgrammingState = "NotProgrammingDevice" + // ProgrammingDevice ... + ProgrammingDevice ProgrammingState = "ProgrammingDevice" +) + +// PossibleProgrammingStateValues returns an array of possible values for the ProgrammingState const type. +func PossibleProgrammingStateValues() []ProgrammingState { + return []ProgrammingState{NotProgrammingDevice, ProgrammingDevice} } // PropertyType enumerates the values for property type. @@ -928,6 +1022,23 @@ func PossibleProvisioningState1Values() []ProvisioningState1 { return []ProvisioningState1{ProvisioningState1Canceled, ProvisioningState1Deprovisioning, ProvisioningState1Failed, ProvisioningState1Provisioning, ProvisioningState1Succeeded} } +// PurdueLevel enumerates the values for purdue level. +type PurdueLevel string + +const ( + // Enterprise ... + Enterprise PurdueLevel = "Enterprise" + // ProcessControl ... + ProcessControl PurdueLevel = "ProcessControl" + // Supervisory ... + Supervisory PurdueLevel = "Supervisory" +) + +// PossiblePurdueLevelValues returns an array of possible values for the PurdueLevel const type. +func PossiblePurdueLevelValues() []PurdueLevel { + return []PurdueLevel{Enterprise, ProcessControl, Supervisory} +} + // Rank enumerates the values for rank. type Rank string @@ -1097,6 +1208,21 @@ func PossibleRecommendationTypeValues() []RecommendationType { return []RecommendationType{IoTACRAuthentication, IoTAgentSendsUnutilizedMessages, IoTBaseline, IoTEdgeHubMemOptimize, IoTEdgeLoggingOptions, IoTInconsistentModuleSettings, IoTInstallAgent, IoTIPFilterDenyAll, IoTIPFilterPermissiveRule, IoTOpenPorts, IoTPermissiveFirewallPolicy, IoTPermissiveInputFirewallRules, IoTPermissiveOutputFirewallRules, IoTPrivilegedDockerOptions, IoTSharedCredentials, IoTVulnerableTLSCipherSuite} } +// RelationToIPStatus enumerates the values for relation to ip status. +type RelationToIPStatus string + +const ( + // Certain ... + Certain RelationToIPStatus = "Certain" + // Guess ... + Guess RelationToIPStatus = "Guess" +) + +// PossibleRelationToIPStatusValues returns an array of possible values for the RelationToIPStatus const type. +func PossibleRelationToIPStatusValues() []RelationToIPStatus { + return []RelationToIPStatus{Certain, Guess} +} + // ReportedSeverity enumerates the values for reported severity. type ReportedSeverity string @@ -1135,6 +1261,27 @@ func PossibleResourceStatusValues() []ResourceStatus { return []ResourceStatus{ResourceStatusHealthy, ResourceStatusNotApplicable, ResourceStatusNotHealthy, ResourceStatusOffByPolicy} } +// RuleSeverity enumerates the values for rule severity. +type RuleSeverity string + +const ( + // RuleSeverityHigh High + RuleSeverityHigh RuleSeverity = "High" + // RuleSeverityInformational Informational + RuleSeverityInformational RuleSeverity = "Informational" + // RuleSeverityLow Low + RuleSeverityLow RuleSeverity = "Low" + // RuleSeverityMedium Medium + RuleSeverityMedium RuleSeverity = "Medium" + // RuleSeverityObsolete Obsolete + RuleSeverityObsolete RuleSeverity = "Obsolete" +) + +// PossibleRuleSeverityValues returns an array of possible values for the RuleSeverity const type. +func PossibleRuleSeverityValues() []RuleSeverity { + return []RuleSeverity{RuleSeverityHigh, RuleSeverityInformational, RuleSeverityLow, RuleSeverityMedium, RuleSeverityObsolete} +} + // RuleState enumerates the values for rule state. type RuleState string @@ -1152,65 +1299,150 @@ func PossibleRuleStateValues() []RuleState { return []RuleState{RuleStateDisabled, RuleStateEnabled, RuleStateExpired} } +// RuleStatus enumerates the values for rule status. +type RuleStatus string + +const ( + // Finding Finding + Finding RuleStatus = "Finding" + // InternalError InternalError + InternalError RuleStatus = "InternalError" + // NonFinding NonFinding + NonFinding RuleStatus = "NonFinding" +) + +// PossibleRuleStatusValues returns an array of possible values for the RuleStatus const type. +func PossibleRuleStatusValues() []RuleStatus { + return []RuleStatus{Finding, InternalError, NonFinding} +} + // RuleType enumerates the values for rule type. type RuleType string +const ( + // BaselineExpected BaselineExpected + BaselineExpected RuleType = "BaselineExpected" + // Binary Binary + Binary RuleType = "Binary" + // NegativeList NegativeList + NegativeList RuleType = "NegativeList" + // PositiveList PositiveList + PositiveList RuleType = "PositiveList" +) + +// PossibleRuleTypeValues returns an array of possible values for the RuleType const type. +func PossibleRuleTypeValues() []RuleType { + return []RuleType{BaselineExpected, Binary, NegativeList, PositiveList} +} + +// RuleTypeBasicCustomAlertRule enumerates the values for rule type basic custom alert rule. +type RuleTypeBasicCustomAlertRule string + const ( // RuleTypeActiveConnectionsNotInAllowedRange ... - RuleTypeActiveConnectionsNotInAllowedRange RuleType = "ActiveConnectionsNotInAllowedRange" + RuleTypeActiveConnectionsNotInAllowedRange RuleTypeBasicCustomAlertRule = "ActiveConnectionsNotInAllowedRange" // RuleTypeAllowlistCustomAlertRule ... - RuleTypeAllowlistCustomAlertRule RuleType = "AllowlistCustomAlertRule" + RuleTypeAllowlistCustomAlertRule RuleTypeBasicCustomAlertRule = "AllowlistCustomAlertRule" // RuleTypeAmqpC2DMessagesNotInAllowedRange ... - RuleTypeAmqpC2DMessagesNotInAllowedRange RuleType = "AmqpC2DMessagesNotInAllowedRange" + RuleTypeAmqpC2DMessagesNotInAllowedRange RuleTypeBasicCustomAlertRule = "AmqpC2DMessagesNotInAllowedRange" // RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange ... - RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange RuleType = "AmqpC2DRejectedMessagesNotInAllowedRange" + RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange RuleTypeBasicCustomAlertRule = "AmqpC2DRejectedMessagesNotInAllowedRange" // RuleTypeAmqpD2CMessagesNotInAllowedRange ... - RuleTypeAmqpD2CMessagesNotInAllowedRange RuleType = "AmqpD2CMessagesNotInAllowedRange" + RuleTypeAmqpD2CMessagesNotInAllowedRange RuleTypeBasicCustomAlertRule = "AmqpD2CMessagesNotInAllowedRange" // RuleTypeConnectionToIPNotAllowed ... - RuleTypeConnectionToIPNotAllowed RuleType = "ConnectionToIpNotAllowed" + RuleTypeConnectionToIPNotAllowed RuleTypeBasicCustomAlertRule = "ConnectionToIpNotAllowed" // RuleTypeCustomAlertRule ... - RuleTypeCustomAlertRule RuleType = "CustomAlertRule" + RuleTypeCustomAlertRule RuleTypeBasicCustomAlertRule = "CustomAlertRule" // RuleTypeDenylistCustomAlertRule ... - RuleTypeDenylistCustomAlertRule RuleType = "DenylistCustomAlertRule" + RuleTypeDenylistCustomAlertRule RuleTypeBasicCustomAlertRule = "DenylistCustomAlertRule" // RuleTypeDirectMethodInvokesNotInAllowedRange ... - RuleTypeDirectMethodInvokesNotInAllowedRange RuleType = "DirectMethodInvokesNotInAllowedRange" + RuleTypeDirectMethodInvokesNotInAllowedRange RuleTypeBasicCustomAlertRule = "DirectMethodInvokesNotInAllowedRange" // RuleTypeFailedLocalLoginsNotInAllowedRange ... - RuleTypeFailedLocalLoginsNotInAllowedRange RuleType = "FailedLocalLoginsNotInAllowedRange" + RuleTypeFailedLocalLoginsNotInAllowedRange RuleTypeBasicCustomAlertRule = "FailedLocalLoginsNotInAllowedRange" // RuleTypeFileUploadsNotInAllowedRange ... - RuleTypeFileUploadsNotInAllowedRange RuleType = "FileUploadsNotInAllowedRange" + RuleTypeFileUploadsNotInAllowedRange RuleTypeBasicCustomAlertRule = "FileUploadsNotInAllowedRange" // RuleTypeHTTPC2DMessagesNotInAllowedRange ... - RuleTypeHTTPC2DMessagesNotInAllowedRange RuleType = "HttpC2DMessagesNotInAllowedRange" + RuleTypeHTTPC2DMessagesNotInAllowedRange RuleTypeBasicCustomAlertRule = "HttpC2DMessagesNotInAllowedRange" // RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange ... - RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange RuleType = "HttpC2DRejectedMessagesNotInAllowedRange" + RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange RuleTypeBasicCustomAlertRule = "HttpC2DRejectedMessagesNotInAllowedRange" // RuleTypeHTTPD2CMessagesNotInAllowedRange ... - RuleTypeHTTPD2CMessagesNotInAllowedRange RuleType = "HttpD2CMessagesNotInAllowedRange" + RuleTypeHTTPD2CMessagesNotInAllowedRange RuleTypeBasicCustomAlertRule = "HttpD2CMessagesNotInAllowedRange" // RuleTypeListCustomAlertRule ... - RuleTypeListCustomAlertRule RuleType = "ListCustomAlertRule" + RuleTypeListCustomAlertRule RuleTypeBasicCustomAlertRule = "ListCustomAlertRule" // RuleTypeLocalUserNotAllowed ... - RuleTypeLocalUserNotAllowed RuleType = "LocalUserNotAllowed" + RuleTypeLocalUserNotAllowed RuleTypeBasicCustomAlertRule = "LocalUserNotAllowed" // RuleTypeMqttC2DMessagesNotInAllowedRange ... - RuleTypeMqttC2DMessagesNotInAllowedRange RuleType = "MqttC2DMessagesNotInAllowedRange" + RuleTypeMqttC2DMessagesNotInAllowedRange RuleTypeBasicCustomAlertRule = "MqttC2DMessagesNotInAllowedRange" // RuleTypeMqttC2DRejectedMessagesNotInAllowedRange ... - RuleTypeMqttC2DRejectedMessagesNotInAllowedRange RuleType = "MqttC2DRejectedMessagesNotInAllowedRange" + RuleTypeMqttC2DRejectedMessagesNotInAllowedRange RuleTypeBasicCustomAlertRule = "MqttC2DRejectedMessagesNotInAllowedRange" // RuleTypeMqttD2CMessagesNotInAllowedRange ... - RuleTypeMqttD2CMessagesNotInAllowedRange RuleType = "MqttD2CMessagesNotInAllowedRange" + RuleTypeMqttD2CMessagesNotInAllowedRange RuleTypeBasicCustomAlertRule = "MqttD2CMessagesNotInAllowedRange" // RuleTypeProcessNotAllowed ... - RuleTypeProcessNotAllowed RuleType = "ProcessNotAllowed" + RuleTypeProcessNotAllowed RuleTypeBasicCustomAlertRule = "ProcessNotAllowed" // RuleTypeQueuePurgesNotInAllowedRange ... - RuleTypeQueuePurgesNotInAllowedRange RuleType = "QueuePurgesNotInAllowedRange" + RuleTypeQueuePurgesNotInAllowedRange RuleTypeBasicCustomAlertRule = "QueuePurgesNotInAllowedRange" // RuleTypeThresholdCustomAlertRule ... - RuleTypeThresholdCustomAlertRule RuleType = "ThresholdCustomAlertRule" + RuleTypeThresholdCustomAlertRule RuleTypeBasicCustomAlertRule = "ThresholdCustomAlertRule" // RuleTypeTimeWindowCustomAlertRule ... - RuleTypeTimeWindowCustomAlertRule RuleType = "TimeWindowCustomAlertRule" + RuleTypeTimeWindowCustomAlertRule RuleTypeBasicCustomAlertRule = "TimeWindowCustomAlertRule" // RuleTypeTwinUpdatesNotInAllowedRange ... - RuleTypeTwinUpdatesNotInAllowedRange RuleType = "TwinUpdatesNotInAllowedRange" + RuleTypeTwinUpdatesNotInAllowedRange RuleTypeBasicCustomAlertRule = "TwinUpdatesNotInAllowedRange" // RuleTypeUnauthorizedOperationsNotInAllowedRange ... - RuleTypeUnauthorizedOperationsNotInAllowedRange RuleType = "UnauthorizedOperationsNotInAllowedRange" + RuleTypeUnauthorizedOperationsNotInAllowedRange RuleTypeBasicCustomAlertRule = "UnauthorizedOperationsNotInAllowedRange" ) -// PossibleRuleTypeValues returns an array of possible values for the RuleType const type. -func PossibleRuleTypeValues() []RuleType { - return []RuleType{RuleTypeActiveConnectionsNotInAllowedRange, RuleTypeAllowlistCustomAlertRule, RuleTypeAmqpC2DMessagesNotInAllowedRange, RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange, RuleTypeAmqpD2CMessagesNotInAllowedRange, RuleTypeConnectionToIPNotAllowed, RuleTypeCustomAlertRule, RuleTypeDenylistCustomAlertRule, RuleTypeDirectMethodInvokesNotInAllowedRange, RuleTypeFailedLocalLoginsNotInAllowedRange, RuleTypeFileUploadsNotInAllowedRange, RuleTypeHTTPC2DMessagesNotInAllowedRange, RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange, RuleTypeHTTPD2CMessagesNotInAllowedRange, RuleTypeListCustomAlertRule, RuleTypeLocalUserNotAllowed, RuleTypeMqttC2DMessagesNotInAllowedRange, RuleTypeMqttC2DRejectedMessagesNotInAllowedRange, RuleTypeMqttD2CMessagesNotInAllowedRange, RuleTypeProcessNotAllowed, RuleTypeQueuePurgesNotInAllowedRange, RuleTypeThresholdCustomAlertRule, RuleTypeTimeWindowCustomAlertRule, RuleTypeTwinUpdatesNotInAllowedRange, RuleTypeUnauthorizedOperationsNotInAllowedRange} +// PossibleRuleTypeBasicCustomAlertRuleValues returns an array of possible values for the RuleTypeBasicCustomAlertRule const type. +func PossibleRuleTypeBasicCustomAlertRuleValues() []RuleTypeBasicCustomAlertRule { + return []RuleTypeBasicCustomAlertRule{RuleTypeActiveConnectionsNotInAllowedRange, RuleTypeAllowlistCustomAlertRule, RuleTypeAmqpC2DMessagesNotInAllowedRange, RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange, RuleTypeAmqpD2CMessagesNotInAllowedRange, RuleTypeConnectionToIPNotAllowed, RuleTypeCustomAlertRule, RuleTypeDenylistCustomAlertRule, RuleTypeDirectMethodInvokesNotInAllowedRange, RuleTypeFailedLocalLoginsNotInAllowedRange, RuleTypeFileUploadsNotInAllowedRange, RuleTypeHTTPC2DMessagesNotInAllowedRange, RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange, RuleTypeHTTPD2CMessagesNotInAllowedRange, RuleTypeListCustomAlertRule, RuleTypeLocalUserNotAllowed, RuleTypeMqttC2DMessagesNotInAllowedRange, RuleTypeMqttC2DRejectedMessagesNotInAllowedRange, RuleTypeMqttD2CMessagesNotInAllowedRange, RuleTypeProcessNotAllowed, RuleTypeQueuePurgesNotInAllowedRange, RuleTypeThresholdCustomAlertRule, RuleTypeTimeWindowCustomAlertRule, RuleTypeTwinUpdatesNotInAllowedRange, RuleTypeUnauthorizedOperationsNotInAllowedRange} +} + +// ScanningFunctionality enumerates the values for scanning functionality. +type ScanningFunctionality string + +const ( + // NotScannerDevice ... + NotScannerDevice ScanningFunctionality = "NotScannerDevice" + // ScannerDevice ... + ScannerDevice ScanningFunctionality = "ScannerDevice" +) + +// PossibleScanningFunctionalityValues returns an array of possible values for the ScanningFunctionality const type. +func PossibleScanningFunctionalityValues() []ScanningFunctionality { + return []ScanningFunctionality{NotScannerDevice, ScannerDevice} +} + +// ScanState enumerates the values for scan state. +type ScanState string + +const ( + // ScanStateFailed Failed + ScanStateFailed ScanState = "Failed" + // ScanStateFailedToRun FailedToRun + ScanStateFailedToRun ScanState = "FailedToRun" + // ScanStateInProgress InProgress + ScanStateInProgress ScanState = "InProgress" + // ScanStatePassed Passed + ScanStatePassed ScanState = "Passed" +) + +// PossibleScanStateValues returns an array of possible values for the ScanState const type. +func PossibleScanStateValues() []ScanState { + return []ScanState{ScanStateFailed, ScanStateFailedToRun, ScanStateInProgress, ScanStatePassed} +} + +// ScanTriggerType enumerates the values for scan trigger type. +type ScanTriggerType string + +const ( + // OnDemand OnDemand + OnDemand ScanTriggerType = "OnDemand" + // Recurring Recurring + Recurring ScanTriggerType = "Recurring" +) + +// PossibleScanTriggerTypeValues returns an array of possible values for the ScanTriggerType const type. +func PossibleScanTriggerTypeValues() []ScanTriggerType { + return []ScanTriggerType{OnDemand, Recurring} } // Script enumerates the values for script. diff --git a/services/preview/security/mgmt/v3.0/security/iotalerts.go b/services/preview/security/mgmt/v3.0/security/iotalerts.go index ff136c455da6..656a3fb1c03f 100644 --- a/services/preview/security/mgmt/v3.0/security/iotalerts.go +++ b/services/preview/security/mgmt/v3.0/security/iotalerts.go @@ -130,6 +130,81 @@ func (client IotAlertsClient) GetResponder(resp *http.Response) (result IotAlert return } +// Get1 get IoT alert +// Parameters: +// scope - scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. +// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}) +// iotAlertID - id of the alert +func (client IotAlertsClient) Get1(ctx context.Context, scope string, iotAlertID string) (result IotAlertModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotAlertsClient.Get1") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.Get1Preparer(ctx, scope, iotAlertID) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotAlertsClient", "Get1", nil, "Failure preparing request") + return + } + + resp, err := client.Get1Sender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IotAlertsClient", "Get1", resp, "Failure sending request") + return + } + + result, err = client.Get1Responder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotAlertsClient", "Get1", resp, "Failure responding to request") + } + + return +} + +// Get1Preparer prepares the Get1 request. +func (client IotAlertsClient) Get1Preparer(ctx context.Context, scope string, iotAlertID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "iotAlertId": autorest.Encode("path", iotAlertID), + "scope": scope, + } + + const APIVersion = "2020-08-06-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/iotAlerts/{iotAlertId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Get1Sender sends the Get1 request. The method will close the +// http.Response Body if it receives an error. +func (client IotAlertsClient) Get1Sender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Get1Responder handles the response to the Get1 request. The method always +// closes the http.Response Body. +func (client IotAlertsClient) Get1Responder(resp *http.Response) (result IotAlertModel, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // List list IoT alerts // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case @@ -280,3 +355,145 @@ func (client IotAlertsClient) ListComplete(ctx context.Context, resourceGroupNam result.page, err = client.List(ctx, resourceGroupName, solutionName, minStartTimeUtc, maxStartTimeUtc, alertType, compromisedEntity, limit, skipToken) return } + +// List1 list IoT alerts +// Parameters: +// scope - scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. +// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}) +// minStartTimeUtc - filter by minimum startTimeUtc (ISO 8601 format) +// maxStartTimeUtc - filter by maximum startTimeUtc (ISO 8601 format) +// alertType - filter by alert type +// deviceManagementType - get devices only from specific type, Managed or Unmanaged. +// compromisedEntity - filter by compromised device +// limit - limit the number of items returned in a single page +// skipToken - skip token used for pagination +func (client IotAlertsClient) List1(ctx context.Context, scope string, minStartTimeUtc string, maxStartTimeUtc string, alertType string, deviceManagementType ManagementState, compromisedEntity string, limit *int32, skipToken string) (result IotAlertListModelPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotAlertsClient.List1") + defer func() { + sc := -1 + if result.ialm.Response.Response != nil { + sc = result.ialm.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.list1NextResults + req, err := client.List1Preparer(ctx, scope, minStartTimeUtc, maxStartTimeUtc, alertType, deviceManagementType, compromisedEntity, limit, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotAlertsClient", "List1", nil, "Failure preparing request") + return + } + + resp, err := client.List1Sender(req) + if err != nil { + result.ialm.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IotAlertsClient", "List1", resp, "Failure sending request") + return + } + + result.ialm, err = client.List1Responder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotAlertsClient", "List1", resp, "Failure responding to request") + } + if result.ialm.hasNextLink() && result.ialm.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// List1Preparer prepares the List1 request. +func (client IotAlertsClient) List1Preparer(ctx context.Context, scope string, minStartTimeUtc string, maxStartTimeUtc string, alertType string, deviceManagementType ManagementState, compromisedEntity string, limit *int32, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "scope": scope, + } + + const APIVersion = "2020-08-06-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(minStartTimeUtc) > 0 { + queryParameters["startTimeUtc>"] = autorest.Encode("query", minStartTimeUtc) + } + if len(maxStartTimeUtc) > 0 { + queryParameters["startTimeUtc<"] = autorest.Encode("query", maxStartTimeUtc) + } + if len(alertType) > 0 { + queryParameters["alertType"] = autorest.Encode("query", alertType) + } + if len(string(deviceManagementType)) > 0 { + queryParameters["deviceManagementType"] = autorest.Encode("query", deviceManagementType) + } + if len(compromisedEntity) > 0 { + queryParameters["compromisedEntity"] = autorest.Encode("query", compromisedEntity) + } + if limit != nil { + queryParameters["$limit"] = autorest.Encode("query", *limit) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/iotAlerts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// List1Sender sends the List1 request. The method will close the +// http.Response Body if it receives an error. +func (client IotAlertsClient) List1Sender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// List1Responder handles the response to the List1 request. The method always +// closes the http.Response Body. +func (client IotAlertsClient) List1Responder(resp *http.Response) (result IotAlertListModel, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// list1NextResults retrieves the next set of results, if any. +func (client IotAlertsClient) list1NextResults(ctx context.Context, lastResults IotAlertListModel) (result IotAlertListModel, err error) { + req, err := lastResults.iotAlertListModelPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.IotAlertsClient", "list1NextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.List1Sender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.IotAlertsClient", "list1NextResults", resp, "Failure sending next results request") + } + result, err = client.List1Responder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotAlertsClient", "list1NextResults", resp, "Failure responding to next results request") + } + return +} + +// List1Complete enumerates all values, automatically crossing page boundaries as required. +func (client IotAlertsClient) List1Complete(ctx context.Context, scope string, minStartTimeUtc string, maxStartTimeUtc string, alertType string, deviceManagementType ManagementState, compromisedEntity string, limit *int32, skipToken string) (result IotAlertListModelIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotAlertsClient.List1") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List1(ctx, scope, minStartTimeUtc, maxStartTimeUtc, alertType, deviceManagementType, compromisedEntity, limit, skipToken) + return +} diff --git a/services/preview/security/mgmt/v3.0/security/iotalerttypes.go b/services/preview/security/mgmt/v3.0/security/iotalerttypes.go index 808b7a24ecd2..4f1e6439a4f7 100644 --- a/services/preview/security/mgmt/v3.0/security/iotalerttypes.go +++ b/services/preview/security/mgmt/v3.0/security/iotalerttypes.go @@ -130,6 +130,85 @@ func (client IotAlertTypesClient) GetResponder(resp *http.Response) (result IotA return } +// Get1 get IoT alert type +// Parameters: +// iotAlertTypeName - name of the alert type +func (client IotAlertTypesClient) Get1(ctx context.Context, iotAlertTypeName string) (result IotAlertType, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotAlertTypesClient.Get1") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.IotAlertTypesClient", "Get1", err.Error()) + } + + req, err := client.Get1Preparer(ctx, iotAlertTypeName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotAlertTypesClient", "Get1", nil, "Failure preparing request") + return + } + + resp, err := client.Get1Sender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IotAlertTypesClient", "Get1", resp, "Failure sending request") + return + } + + result, err = client.Get1Responder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotAlertTypesClient", "Get1", resp, "Failure responding to request") + } + + return +} + +// Get1Preparer prepares the Get1 request. +func (client IotAlertTypesClient) Get1Preparer(ctx context.Context, iotAlertTypeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "iotAlertTypeName": autorest.Encode("path", iotAlertTypeName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-08-06-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes/{iotAlertTypeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Get1Sender sends the Get1 request. The method will close the +// http.Response Body if it receives an error. +func (client IotAlertTypesClient) Get1Sender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// Get1Responder handles the response to the Get1 request. The method always +// closes the http.Response Body. +func (client IotAlertTypesClient) Get1Responder(resp *http.Response) (result IotAlertType, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // List list IoT alert types // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case @@ -215,3 +294,79 @@ func (client IotAlertTypesClient) ListResponder(resp *http.Response) (result Iot result.Response = autorest.Response{Response: resp} return } + +// List1 list IoT alert types +func (client IotAlertTypesClient) List1(ctx context.Context) (result IotAlertTypeList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotAlertTypesClient.List1") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.IotAlertTypesClient", "List1", err.Error()) + } + + req, err := client.List1Preparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotAlertTypesClient", "List1", nil, "Failure preparing request") + return + } + + resp, err := client.List1Sender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IotAlertTypesClient", "List1", resp, "Failure sending request") + return + } + + result, err = client.List1Responder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotAlertTypesClient", "List1", resp, "Failure responding to request") + } + + return +} + +// List1Preparer prepares the List1 request. +func (client IotAlertTypesClient) List1Preparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-08-06-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotAlertTypes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// List1Sender sends the List1 request. The method will close the +// http.Response Body if it receives an error. +func (client IotAlertTypesClient) List1Sender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// List1Responder handles the response to the List1 request. The method always +// closes the http.Response Body. +func (client IotAlertTypesClient) List1Responder(resp *http.Response) (result IotAlertTypeList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/security/mgmt/v3.0/security/iotrecommendations.go b/services/preview/security/mgmt/v3.0/security/iotrecommendations.go index d73d52fbd099..ae60245c0e83 100644 --- a/services/preview/security/mgmt/v3.0/security/iotrecommendations.go +++ b/services/preview/security/mgmt/v3.0/security/iotrecommendations.go @@ -131,6 +131,81 @@ func (client IotRecommendationsClient) GetResponder(resp *http.Response) (result return } +// Get1 get IoT recommendation +// Parameters: +// scope - scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. +// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}) +// iotRecommendationID - id of the recommendation +func (client IotRecommendationsClient) Get1(ctx context.Context, scope string, iotRecommendationID string) (result IotRecommendationModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotRecommendationsClient.Get1") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.Get1Preparer(ctx, scope, iotRecommendationID) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "Get1", nil, "Failure preparing request") + return + } + + resp, err := client.Get1Sender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "Get1", resp, "Failure sending request") + return + } + + result, err = client.Get1Responder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "Get1", resp, "Failure responding to request") + } + + return +} + +// Get1Preparer prepares the Get1 request. +func (client IotRecommendationsClient) Get1Preparer(ctx context.Context, scope string, iotRecommendationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "iotRecommendationId": autorest.Encode("path", iotRecommendationID), + "scope": scope, + } + + const APIVersion = "2020-08-06-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/iotRecommendations/{iotRecommendationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Get1Sender sends the Get1 request. The method will close the +// http.Response Body if it receives an error. +func (client IotRecommendationsClient) Get1Sender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// Get1Responder handles the response to the Get1 request. The method always +// closes the http.Response Body. +func (client IotRecommendationsClient) Get1Responder(resp *http.Response) (result IotRecommendationModel, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // List list IoT recommendations // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case @@ -273,3 +348,133 @@ func (client IotRecommendationsClient) ListComplete(ctx context.Context, resourc result.page, err = client.List(ctx, resourceGroupName, solutionName, recommendationType, deviceID, limit, skipToken) return } + +// List1 list IoT recommendations +// Parameters: +// scope - scope of the query: Subscription (i.e. /subscriptions/{subscriptionId}) or IoT Hub (i.e. +// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Devices/iotHubs/{iotHubName}) +// recommendationType - filter by recommendation type +// deviceID - filter by device id +// limit - limit the number of items returned in a single page +// skipToken - skip token used for pagination +func (client IotRecommendationsClient) List1(ctx context.Context, scope string, recommendationType string, deviceID string, limit *int32, skipToken string) (result IotRecommendationListModelPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotRecommendationsClient.List1") + defer func() { + sc := -1 + if result.irlm.Response.Response != nil { + sc = result.irlm.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.list1NextResults + req, err := client.List1Preparer(ctx, scope, recommendationType, deviceID, limit, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "List1", nil, "Failure preparing request") + return + } + + resp, err := client.List1Sender(req) + if err != nil { + result.irlm.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "List1", resp, "Failure sending request") + return + } + + result.irlm, err = client.List1Responder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "List1", resp, "Failure responding to request") + } + if result.irlm.hasNextLink() && result.irlm.IsEmpty() { + err = result.NextWithContext(ctx) + } + + return +} + +// List1Preparer prepares the List1 request. +func (client IotRecommendationsClient) List1Preparer(ctx context.Context, scope string, recommendationType string, deviceID string, limit *int32, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "scope": scope, + } + + const APIVersion = "2020-08-06-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(recommendationType) > 0 { + queryParameters["recommendationType"] = autorest.Encode("query", recommendationType) + } + if len(deviceID) > 0 { + queryParameters["deviceId"] = autorest.Encode("query", deviceID) + } + if limit != nil { + queryParameters["$limit"] = autorest.Encode("query", *limit) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/iotRecommendations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// List1Sender sends the List1 request. The method will close the +// http.Response Body if it receives an error. +func (client IotRecommendationsClient) List1Sender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// List1Responder handles the response to the List1 request. The method always +// closes the http.Response Body. +func (client IotRecommendationsClient) List1Responder(resp *http.Response) (result IotRecommendationListModel, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// list1NextResults retrieves the next set of results, if any. +func (client IotRecommendationsClient) list1NextResults(ctx context.Context, lastResults IotRecommendationListModel) (result IotRecommendationListModel, err error) { + req, err := lastResults.iotRecommendationListModelPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "list1NextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.List1Sender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "list1NextResults", resp, "Failure sending next results request") + } + result, err = client.List1Responder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotRecommendationsClient", "list1NextResults", resp, "Failure responding to next results request") + } + return +} + +// List1Complete enumerates all values, automatically crossing page boundaries as required. +func (client IotRecommendationsClient) List1Complete(ctx context.Context, scope string, recommendationType string, deviceID string, limit *int32, skipToken string) (result IotRecommendationListModelIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotRecommendationsClient.List1") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List1(ctx, scope, recommendationType, deviceID, limit, skipToken) + return +} diff --git a/services/preview/security/mgmt/v3.0/security/iotrecommendationtypes.go b/services/preview/security/mgmt/v3.0/security/iotrecommendationtypes.go index 2737e3dfa7df..7a0e045e2e16 100644 --- a/services/preview/security/mgmt/v3.0/security/iotrecommendationtypes.go +++ b/services/preview/security/mgmt/v3.0/security/iotrecommendationtypes.go @@ -131,6 +131,85 @@ func (client IotRecommendationTypesClient) GetResponder(resp *http.Response) (re return } +// Get1 get IoT recommendation type +// Parameters: +// iotRecommendationTypeName - name of the recommendation type +func (client IotRecommendationTypesClient) Get1(ctx context.Context, iotRecommendationTypeName string) (result IotRecommendationType, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotRecommendationTypesClient.Get1") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.IotRecommendationTypesClient", "Get1", err.Error()) + } + + req, err := client.Get1Preparer(ctx, iotRecommendationTypeName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotRecommendationTypesClient", "Get1", nil, "Failure preparing request") + return + } + + resp, err := client.Get1Sender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IotRecommendationTypesClient", "Get1", resp, "Failure sending request") + return + } + + result, err = client.Get1Responder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotRecommendationTypesClient", "Get1", resp, "Failure responding to request") + } + + return +} + +// Get1Preparer prepares the Get1 request. +func (client IotRecommendationTypesClient) Get1Preparer(ctx context.Context, iotRecommendationTypeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "iotRecommendationTypeName": autorest.Encode("path", iotRecommendationTypeName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-08-06-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes/{iotRecommendationTypeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// Get1Sender sends the Get1 request. The method will close the +// http.Response Body if it receives an error. +func (client IotRecommendationTypesClient) Get1Sender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// Get1Responder handles the response to the Get1 request. The method always +// closes the http.Response Body. +func (client IotRecommendationTypesClient) Get1Responder(resp *http.Response) (result IotRecommendationType, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // List list IoT recommendation types // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case @@ -216,3 +295,79 @@ func (client IotRecommendationTypesClient) ListResponder(resp *http.Response) (r result.Response = autorest.Response{Response: resp} return } + +// List1 list IoT recommendation types +func (client IotRecommendationTypesClient) List1(ctx context.Context) (result IotRecommendationTypeList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotRecommendationTypesClient.List1") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.IotRecommendationTypesClient", "List1", err.Error()) + } + + req, err := client.List1Preparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotRecommendationTypesClient", "List1", nil, "Failure preparing request") + return + } + + resp, err := client.List1Sender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.IotRecommendationTypesClient", "List1", resp, "Failure sending request") + return + } + + result, err = client.List1Responder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.IotRecommendationTypesClient", "List1", resp, "Failure responding to request") + } + + return +} + +// List1Preparer prepares the List1 request. +func (client IotRecommendationTypesClient) List1Preparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-08-06-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/iotRecommendationTypes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// List1Sender sends the List1 request. The method will close the +// http.Response Body if it receives an error. +func (client IotRecommendationTypesClient) List1Sender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// List1Responder handles the response to the List1 request. The method always +// closes the http.Response Body. +func (client IotRecommendationTypesClient) List1Responder(resp *http.Response) (result IotRecommendationTypeList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/security/mgmt/v3.0/security/models.go b/services/preview/security/mgmt/v3.0/security/models.go index 84532d78c22f..13691412f014 100644 --- a/services/preview/security/mgmt/v3.0/security/models.go +++ b/services/preview/security/mgmt/v3.0/security/models.go @@ -117,7 +117,7 @@ type ActiveConnectionsNotInAllowedRange struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } // MarshalJSON is the custom marshaler for ActiveConnectionsNotInAllowedRange. @@ -375,8 +375,8 @@ func (aacg *AdaptiveApplicationControlGroup) UnmarshalJSON(body []byte) error { return nil } -// AdaptiveApplicationControlGroupData represents a machines group and set of rules to be allowed running on a -// machine +// AdaptiveApplicationControlGroupData represents a machines group and set of rules to be allowed running +// on a machine type AdaptiveApplicationControlGroupData struct { // EnforcementMode - Possible values include: 'Audit', 'Enforce', 'None' EnforcementMode EnforcementMode `json:"enforcementMode,omitempty"` @@ -411,8 +411,8 @@ func (aacgd AdaptiveApplicationControlGroupData) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// AdaptiveApplicationControlGroups represents a list of machine groups and set of rules that are recommended -// by Azure Security Center to be allowed +// AdaptiveApplicationControlGroups represents a list of machine groups and set of rules that are +// recommended by Azure Security Center to be allowed type AdaptiveApplicationControlGroups struct { autorest.Response `json:"-"` Value *[]AdaptiveApplicationControlGroup `json:"value,omitempty"` @@ -426,8 +426,8 @@ type AdaptiveApplicationControlIssueSummary struct { NumberOfVms *float64 `json:"numberOfVms,omitempty"` } -// AdaptiveNetworkHardening the resource whose properties describes the Adaptive Network Hardening settings for -// some Azure resource +// AdaptiveNetworkHardening the resource whose properties describes the Adaptive Network Hardening settings +// for some Azure resource type AdaptiveNetworkHardening struct { autorest.Response `json:"-"` // AdaptiveNetworkHardeningProperties - Properties of the Adaptive Network Hardening resource @@ -694,8 +694,11 @@ func (page AdaptiveNetworkHardeningsListPage) Values() []AdaptiveNetworkHardenin } // Creates a new instance of the AdaptiveNetworkHardeningsListPage type. -func NewAdaptiveNetworkHardeningsListPage(getNextPage func(context.Context, AdaptiveNetworkHardeningsList) (AdaptiveNetworkHardeningsList, error)) AdaptiveNetworkHardeningsListPage { - return AdaptiveNetworkHardeningsListPage{fn: getNextPage} +func NewAdaptiveNetworkHardeningsListPage(cur AdaptiveNetworkHardeningsList, getNextPage func(context.Context, AdaptiveNetworkHardeningsList) (AdaptiveNetworkHardeningsList, error)) AdaptiveNetworkHardeningsListPage { + return AdaptiveNetworkHardeningsListPage{ + fn: getNextPage, + anhl: cur, + } } // BasicAdditionalData details of the sub-assessment @@ -1157,8 +1160,11 @@ func (page AlertListPage) Values() []Alert { } // Creates a new instance of the AlertListPage type. -func NewAlertListPage(getNextPage func(context.Context, AlertList) (AlertList, error)) AlertListPage { - return AlertListPage{fn: getNextPage} +func NewAlertListPage(cur AlertList, getNextPage func(context.Context, AlertList) (AlertList, error)) AlertListPage { + return AlertListPage{ + fn: getNextPage, + al: cur, + } } // AlertProperties describes security alert properties. @@ -1572,7 +1578,8 @@ func (asrl AlertsSuppressionRulesList) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// AlertsSuppressionRulesListIterator provides access to a complete listing of AlertsSuppressionRule values. +// AlertsSuppressionRulesListIterator provides access to a complete listing of AlertsSuppressionRule +// values. type AlertsSuppressionRulesListIterator struct { i int page AlertsSuppressionRulesListPage @@ -1715,8 +1722,11 @@ func (page AlertsSuppressionRulesListPage) Values() []AlertsSuppressionRule { } // Creates a new instance of the AlertsSuppressionRulesListPage type. -func NewAlertsSuppressionRulesListPage(getNextPage func(context.Context, AlertsSuppressionRulesList) (AlertsSuppressionRulesList, error)) AlertsSuppressionRulesListPage { - return AlertsSuppressionRulesListPage{fn: getNextPage} +func NewAlertsSuppressionRulesListPage(cur AlertsSuppressionRulesList, getNextPage func(context.Context, AlertsSuppressionRulesList) (AlertsSuppressionRulesList, error)) AlertsSuppressionRulesListPage { + return AlertsSuppressionRulesListPage{ + fn: getNextPage, + asrl: cur, + } } // AllowedConnectionsList list of all possible traffic between Azure resources @@ -1728,7 +1738,8 @@ type AllowedConnectionsList struct { NextLink *string `json:"nextLink,omitempty"` } -// AllowedConnectionsListIterator provides access to a complete listing of AllowedConnectionsResource values. +// AllowedConnectionsListIterator provides access to a complete listing of AllowedConnectionsResource +// values. type AllowedConnectionsListIterator struct { i int page AllowedConnectionsListPage @@ -1871,8 +1882,11 @@ func (page AllowedConnectionsListPage) Values() []AllowedConnectionsResource { } // Creates a new instance of the AllowedConnectionsListPage type. -func NewAllowedConnectionsListPage(getNextPage func(context.Context, AllowedConnectionsList) (AllowedConnectionsList, error)) AllowedConnectionsListPage { - return AllowedConnectionsListPage{fn: getNextPage} +func NewAllowedConnectionsListPage(cur AllowedConnectionsList, getNextPage func(context.Context, AllowedConnectionsList) (AllowedConnectionsList, error)) AllowedConnectionsListPage { + return AllowedConnectionsListPage{ + fn: getNextPage, + ACL: cur, + } } // AllowedConnectionsResource the resource whose properties describes the allowed traffic between Azure @@ -1988,7 +2002,7 @@ type AllowlistCustomAlertRule struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } func unmarshalBasicAllowlistCustomAlertRule(body []byte) (BasicAllowlistCustomAlertRule, error) { @@ -2202,7 +2216,8 @@ func (acar AllowlistCustomAlertRule) AsBasicCustomAlertRule() (BasicCustomAlertR return &acar, true } -// AmqpC2DMessagesNotInAllowedRange number of cloud to device messages (AMQP protocol) is not in allowed range. +// AmqpC2DMessagesNotInAllowedRange number of cloud to device messages (AMQP protocol) is not in allowed +// range. type AmqpC2DMessagesNotInAllowedRange struct { // TimeWindowSize - The time window size in iso8601 format. TimeWindowSize *string `json:"timeWindowSize,omitempty"` @@ -2217,7 +2232,7 @@ type AmqpC2DMessagesNotInAllowedRange struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } // MarshalJSON is the custom marshaler for AmqpC2DMessagesNotInAllowedRange. @@ -2392,8 +2407,8 @@ func (acmniar AmqpC2DMessagesNotInAllowedRange) AsBasicCustomAlertRule() (BasicC return &acmniar, true } -// AmqpC2DRejectedMessagesNotInAllowedRange number of rejected cloud to device messages (AMQP protocol) is not -// in allowed range. +// AmqpC2DRejectedMessagesNotInAllowedRange number of rejected cloud to device messages (AMQP protocol) is +// not in allowed range. type AmqpC2DRejectedMessagesNotInAllowedRange struct { // TimeWindowSize - The time window size in iso8601 format. TimeWindowSize *string `json:"timeWindowSize,omitempty"` @@ -2408,7 +2423,7 @@ type AmqpC2DRejectedMessagesNotInAllowedRange struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } // MarshalJSON is the custom marshaler for AmqpC2DRejectedMessagesNotInAllowedRange. @@ -2583,7 +2598,8 @@ func (acrmniar AmqpC2DRejectedMessagesNotInAllowedRange) AsBasicCustomAlertRule( return &acrmniar, true } -// AmqpD2CMessagesNotInAllowedRange number of device to cloud messages (AMQP protocol) is not in allowed range. +// AmqpD2CMessagesNotInAllowedRange number of device to cloud messages (AMQP protocol) is not in allowed +// range. type AmqpD2CMessagesNotInAllowedRange struct { // TimeWindowSize - The time window size in iso8601 format. TimeWindowSize *string `json:"timeWindowSize,omitempty"` @@ -2598,7 +2614,7 @@ type AmqpD2CMessagesNotInAllowedRange struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } // MarshalJSON is the custom marshaler for AmqpD2CMessagesNotInAllowedRange. @@ -2946,8 +2962,11 @@ func (page AscLocationListPage) Values() []AscLocation { } // Creates a new instance of the AscLocationListPage type. -func NewAscLocationListPage(getNextPage func(context.Context, AscLocationList) (AscLocationList, error)) AscLocationListPage { - return AscLocationListPage{fn: getNextPage} +func NewAscLocationListPage(cur AscLocationList, getNextPage func(context.Context, AscLocationList) (AscLocationList, error)) AscLocationListPage { + return AscLocationListPage{ + fn: getNextPage, + all: cur, + } } // Assessment security assessment on a resource @@ -3180,8 +3199,11 @@ func (page AssessmentListPage) Values() []Assessment { } // Creates a new instance of the AssessmentListPage type. -func NewAssessmentListPage(getNextPage func(context.Context, AssessmentList) (AssessmentList, error)) AssessmentListPage { - return AssessmentListPage{fn: getNextPage} +func NewAssessmentListPage(cur AssessmentList, getNextPage func(context.Context, AssessmentList) (AssessmentList, error)) AssessmentListPage { + return AssessmentListPage{ + fn: getNextPage, + al: cur, + } } // AssessmentMetadata security assessment metadata @@ -3408,8 +3430,11 @@ func (page AssessmentMetadataListPage) Values() []AssessmentMetadata { } // Creates a new instance of the AssessmentMetadataListPage type. -func NewAssessmentMetadataListPage(getNextPage func(context.Context, AssessmentMetadataList) (AssessmentMetadataList, error)) AssessmentMetadataListPage { - return AssessmentMetadataListPage{fn: getNextPage} +func NewAssessmentMetadataListPage(cur AssessmentMetadataList, getNextPage func(context.Context, AssessmentMetadataList) (AssessmentMetadataList, error)) AssessmentMetadataListPage { + return AssessmentMetadataListPage{ + fn: getNextPage, + aml: cur, + } } // AssessmentMetadataPartnerData describes the partner that created the assessment @@ -4190,11 +4215,11 @@ func (aala AutomationActionLogicApp) AsBasicAutomationAction() (BasicAutomationA return &aala, true } -// AutomationActionWorkspace the Log Analytics Workspace to which event data will be exported. Security alerts -// data will reside in the 'SecurityAlert' table and the assessments data will reside in the -// 'SecurityRecommendation' table (under the 'Security'/'SecurityCenterFree' solutions). Note that in order to -// view the data in the workspace, the Security Center Log Analytics free/standard solution needs to be enabled -// on that workspace. To learn more about Security Center continuous export capabilities, visit +// AutomationActionWorkspace the Log Analytics Workspace to which event data will be exported. Security +// alerts data will reside in the 'SecurityAlert' table and the assessments data will reside in the +// 'SecurityRecommendation' table (under the 'Security'/'SecurityCenterFree' solutions). Note that in order +// to view the data in the workspace, the Security Center Log Analytics free/standard solution needs to be +// enabled on that workspace. To learn more about Security Center continuous export capabilities, visit // https://aka.ms/ASCExportLearnMore type AutomationActionWorkspace struct { // WorkspaceResourceID - The fully qualified Log Analytics Workspace Azure Resource ID. @@ -4402,12 +4427,15 @@ func (page AutomationListPage) Values() []Automation { } // Creates a new instance of the AutomationListPage type. -func NewAutomationListPage(getNextPage func(context.Context, AutomationList) (AutomationList, error)) AutomationListPage { - return AutomationListPage{fn: getNextPage} +func NewAutomationListPage(cur AutomationList, getNextPage func(context.Context, AutomationList) (AutomationList, error)) AutomationListPage { + return AutomationListPage{ + fn: getNextPage, + al: cur, + } } -// AutomationProperties a set of properties that defines the behavior of the automation configuration. To learn -// more about the supported security events data models schemas - please visit +// AutomationProperties a set of properties that defines the behavior of the automation configuration. To +// learn more about the supported security events data models schemas - please visit // https://aka.ms/ASCAutomationSchemas. type AutomationProperties struct { // Description - The security automation description. @@ -4495,19 +4523,19 @@ type AutomationScope struct { ScopePath *string `json:"scopePath,omitempty"` } -// AutomationSource the source event types which evaluate the security automation set of rules. For example - -// security alerts and security assessments. To learn more about the supported security events data models -// schemas - please visit https://aka.ms/ASCAutomationSchemas. +// AutomationSource the source event types which evaluate the security automation set of rules. For example +// - security alerts and security assessments. To learn more about the supported security events data +// models schemas - please visit https://aka.ms/ASCAutomationSchemas. type AutomationSource struct { - // EventSource - A valid event source type. Possible values include: 'Assessments', 'SubAssessments', 'Alerts' + // EventSource - A valid event source type. Possible values include: 'Assessments', 'SubAssessments', 'Alerts', 'SecureScores', 'SecureScoreControls' EventSource EventSource `json:"eventSource,omitempty"` // RuleSets - A set of rules which evaluate upon event interception. A logical disjunction is applied between defined rule sets (logical 'or'). RuleSets *[]AutomationRuleSet `json:"ruleSets,omitempty"` } // AutomationTriggeringRule a rule which is evaluated upon event interception. The rule is configured by -// comparing a specific value from the event model to an expected value. This comparison is done by using one -// of the supported operators set. +// comparing a specific value from the event model to an expected value. This comparison is done by using +// one of the supported operators set. type AutomationTriggeringRule struct { // PropertyJPath - The JPath of the entity model property that should be checked. PropertyJPath *string `json:"propertyJPath,omitempty"` @@ -4619,7 +4647,8 @@ func (apsl AutoProvisioningSettingList) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// AutoProvisioningSettingListIterator provides access to a complete listing of AutoProvisioningSetting values. +// AutoProvisioningSettingListIterator provides access to a complete listing of AutoProvisioningSetting +// values. type AutoProvisioningSettingListIterator struct { i int page AutoProvisioningSettingListPage @@ -4762,8 +4791,11 @@ func (page AutoProvisioningSettingListPage) Values() []AutoProvisioningSetting { } // Creates a new instance of the AutoProvisioningSettingListPage type. -func NewAutoProvisioningSettingListPage(getNextPage func(context.Context, AutoProvisioningSettingList) (AutoProvisioningSettingList, error)) AutoProvisioningSettingListPage { - return AutoProvisioningSettingListPage{fn: getNextPage} +func NewAutoProvisioningSettingListPage(cur AutoProvisioningSettingList, getNextPage func(context.Context, AutoProvisioningSettingList) (AutoProvisioningSettingList, error)) AutoProvisioningSettingListPage { + return AutoProvisioningSettingListPage{ + fn: getNextPage, + apsl: cur, + } } // AutoProvisioningSettingProperties describes properties of an auto provisioning setting @@ -4772,10 +4804,11 @@ type AutoProvisioningSettingProperties struct { AutoProvision AutoProvision `json:"autoProvision,omitempty"` } -// AwAssumeRoleAuthenticationDetailsProperties AWS cloud account connector based assume role, the role enables -// delegating access to your AWS resources. The role is composed of role arn and external id, for more details, -// refer to Creating a -// Role to Delegate Permissions to an IAM User (write only) +// AwAssumeRoleAuthenticationDetailsProperties AWS cloud account connector based assume role, the role +// enables delegating access to your AWS resources. The role is composed of role Amazon Resource Name (ARN) +// and external ID. For more details, refer to Creating a Role to +// Delegate Permissions to an IAM User (write only) type AwAssumeRoleAuthenticationDetailsProperties struct { // AccountID - READ-ONLY; The ID of the cloud account AccountID *string `json:"accountId,omitempty"` @@ -4832,10 +4865,10 @@ func (aaradp AwAssumeRoleAuthenticationDetailsProperties) AsBasicAuthenticationD return &aaradp, true } -// AwsCredsAuthenticationDetailsProperties AWS cloud account connector based credentials, the credentials is -// composed of access key id and secret key, for more details, refer to Creating an IAM User in Your -// AWS Account (write only) +// AwsCredsAuthenticationDetailsProperties AWS cloud account connector based credentials, the credentials +// is composed of access key ID and secret key, for more details, refer to Creating an IAM User in +// Your AWS Account (write only) type AwsCredsAuthenticationDetailsProperties struct { // AccountID - READ-ONLY; The ID of the cloud account AccountID *string `json:"accountId,omitempty"` @@ -4990,6 +5023,33 @@ type AzureTrackedResourceLocation struct { Location *string `json:"location,omitempty"` } +// Baseline baseline details. +type Baseline struct { + // ExpectedResults - Expected results. + ExpectedResults *[][]string `json:"expectedResults,omitempty"` + // UpdatedTime - Baseline update time (UTC). + UpdatedTime *date.Time `json:"updatedTime,omitempty"` +} + +// BaselineAdjustedResult the rule result adjusted with baseline. +type BaselineAdjustedResult struct { + Baseline *Baseline `json:"baseline,omitempty"` + // Status - Possible values include: 'NonFinding', 'Finding', 'InternalError' + Status RuleStatus `json:"status,omitempty"` + // ResultsNotInBaseline - Results the are not in baseline. + ResultsNotInBaseline *[][]string `json:"resultsNotInBaseline,omitempty"` + // ResultsOnlyInBaseline - Results the are in baseline. + ResultsOnlyInBaseline *[][]string `json:"resultsOnlyInBaseline,omitempty"` +} + +// BenchmarkReference the benchmark references. +type BenchmarkReference struct { + // Benchmark - The benchmark name. + Benchmark *string `json:"benchmark,omitempty"` + // Reference - The benchmark reference. + Reference *string `json:"reference,omitempty"` +} + // CefExternalSecuritySolution represents a security solution which sends CEF logs to an OMS workspace type CefExternalSecuritySolution struct { Properties *CefSolutionProperties `json:"properties,omitempty"` @@ -5444,8 +5504,11 @@ func (page ComplianceListPage) Values() []Compliance { } // Creates a new instance of the ComplianceListPage type. -func NewComplianceListPage(getNextPage func(context.Context, ComplianceList) (ComplianceList, error)) ComplianceListPage { - return ComplianceListPage{fn: getNextPage} +func NewComplianceListPage(cur ComplianceList, getNextPage func(context.Context, ComplianceList) (ComplianceList, error)) ComplianceListPage { + return ComplianceListPage{ + fn: getNextPage, + cl: cur, + } } // ComplianceProperties the Compliance score (percentage) of a Subscription is a sum of all Resources' @@ -5694,8 +5757,11 @@ func (page ComplianceResultListPage) Values() []ComplianceResult { } // Creates a new instance of the ComplianceResultListPage type. -func NewComplianceResultListPage(getNextPage func(context.Context, ComplianceResultList) (ComplianceResultList, error)) ComplianceResultListPage { - return ComplianceResultListPage{fn: getNextPage} +func NewComplianceResultListPage(cur ComplianceResultList, getNextPage func(context.Context, ComplianceResultList) (ComplianceResultList, error)) ComplianceResultListPage { + return ComplianceResultListPage{ + fn: getNextPage, + crl: cur, + } } // ComplianceResultProperties compliance result data @@ -5752,7 +5818,7 @@ type ConnectionToIPNotAllowed struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } // MarshalJSON is the custom marshaler for ConnectionToIPNotAllowed. @@ -6155,13 +6221,16 @@ func (page ConnectorSettingListPage) Values() []ConnectorSetting { } // Creates a new instance of the ConnectorSettingListPage type. -func NewConnectorSettingListPage(getNextPage func(context.Context, ConnectorSettingList) (ConnectorSettingList, error)) ConnectorSettingListPage { - return ConnectorSettingListPage{fn: getNextPage} +func NewConnectorSettingListPage(cur ConnectorSettingList, getNextPage func(context.Context, ConnectorSettingList) (ConnectorSettingList, error)) ConnectorSettingListPage { + return ConnectorSettingListPage{ + fn: getNextPage, + csl: cur, + } } -// ConnectorSettingProperties describes properties of an connector setting +// ConnectorSettingProperties describes properties of a connector setting type ConnectorSettingProperties struct { - // HybridComputeSettings - Settings for hybrid compute management, these settings are relevant only Arc autoProvision (Hybrid Compute). + // HybridComputeSettings - Settings for hybrid compute management. These settings are relevant only for Arc autoProvision (Hybrid Compute). HybridComputeSettings *HybridComputeSettingsProperties `json:"hybridComputeSettings,omitempty"` // AuthenticationDetails - Settings for authentication management, these settings are relevant only for the cloud connector. AuthenticationDetails BasicAuthenticationDetailsProperties `json:"authenticationDetails,omitempty"` @@ -6424,8 +6493,11 @@ func (page ContactListPage) Values() []Contact { } // Creates a new instance of the ContactListPage type. -func NewContactListPage(getNextPage func(context.Context, ContactList) (ContactList, error)) ContactListPage { - return ContactListPage{fn: getNextPage} +func NewContactListPage(cur ContactList, getNextPage func(context.Context, ContactList) (ContactList, error)) ContactListPage { + return ContactListPage{ + fn: getNextPage, + cl: cur, + } } // ContactProperties describes security contact properties @@ -6540,7 +6612,7 @@ type CustomAlertRule struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } func unmarshalBasicCustomAlertRule(body []byte) (BasicCustomAlertRule, error) { @@ -6981,7 +7053,7 @@ type DenylistCustomAlertRule struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } // MarshalJSON is the custom marshaler for DenylistCustomAlertRule. @@ -7150,6 +7222,326 @@ func (dcar DenylistCustomAlertRule) AsBasicCustomAlertRule() (BasicCustomAlertRu return &dcar, true } +// Device device model +type Device struct { + autorest.Response `json:"-"` + // DeviceProperties - Device data + *DeviceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Device. +func (d Device) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.DeviceProperties != nil { + objectMap["properties"] = d.DeviceProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Device struct. +func (d *Device) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var deviceProperties DeviceProperties + err = json.Unmarshal(*v, &deviceProperties) + if err != nil { + return err + } + d.DeviceProperties = &deviceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + d.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + d.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + d.Type = &typeVar + } + } + } + + return nil +} + +// DeviceList list of Devices +type DeviceList struct { + autorest.Response `json:"-"` + // Value - List of devices + Value *[]Device `json:"value,omitempty"` + // NextLink - READ-ONLY; When there are too many devices for one page, use this URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeviceList. +func (dl DeviceList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dl.Value != nil { + objectMap["value"] = dl.Value + } + return json.Marshal(objectMap) +} + +// DeviceListIterator provides access to a complete listing of Device values. +type DeviceListIterator struct { + i int + page DeviceListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DeviceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeviceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DeviceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DeviceListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DeviceListIterator) Response() DeviceList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DeviceListIterator) Value() Device { + if !iter.page.NotDone() { + return Device{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DeviceListIterator type. +func NewDeviceListIterator(page DeviceListPage) DeviceListIterator { + return DeviceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dl DeviceList) IsEmpty() bool { + return dl.Value == nil || len(*dl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dl DeviceList) hasNextLink() bool { + return dl.NextLink != nil && len(*dl.NextLink) != 0 +} + +// deviceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dl DeviceList) deviceListPreparer(ctx context.Context) (*http.Request, error) { + if !dl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dl.NextLink))) +} + +// DeviceListPage contains a page of Device values. +type DeviceListPage struct { + fn func(context.Context, DeviceList) (DeviceList, error) + dl DeviceList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DeviceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeviceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.dl) + if err != nil { + return err + } + page.dl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DeviceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DeviceListPage) NotDone() bool { + return !page.dl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DeviceListPage) Response() DeviceList { + return page.dl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DeviceListPage) Values() []Device { + if page.dl.IsEmpty() { + return nil + } + return *page.dl.Value +} + +// Creates a new instance of the DeviceListPage type. +func NewDeviceListPage(cur DeviceList, getNextPage func(context.Context, DeviceList) (DeviceList, error)) DeviceListPage { + return DeviceListPage{ + fn: getNextPage, + dl: cur, + } +} + +// DeviceProperties device Information +type DeviceProperties struct { + // DisplayName - Device display name given by the collector + DisplayName *string `json:"displayName,omitempty"` + // DeviceType - Device type. + DeviceType *string `json:"deviceType,omitempty"` + // SourceName - READ-ONLY; The source that created the device + SourceName *string `json:"sourceName,omitempty"` + // NetworkInterfaces - READ-ONLY; List of network interfaces. + NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` + // Vendor - READ-ONLY; Device vendor + Vendor *string `json:"vendor,omitempty"` + // OsName - Device operating system name. + OsName *string `json:"osName,omitempty"` + // Protocols - READ-ONLY; List of protocols. + Protocols *[]Protocol1 `json:"protocols,omitempty"` + // LastActiveTime - READ-ONLY; last time the device was active in the network + LastActiveTime *date.Time `json:"lastActiveTime,omitempty"` + // LastUpdateTime - READ-ONLY; last time the device was updated + LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` + // ManagementState - READ-ONLY; Managed state of the device. Possible values include: 'Managed', 'Unmanaged' + ManagementState ManagementState `json:"managementState,omitempty"` + // AuthorizationState - Authorized state of the device. Possible values include: 'Authorized', 'Unauthorized' + AuthorizationState AuthorizationState `json:"authorizationState,omitempty"` + // DeviceCriticality - Device criticality. Possible values include: 'Important', 'Standard' + DeviceCriticality DeviceCriticality `json:"deviceCriticality,omitempty"` + // PurdueLevel - Purdue level of the device. Possible values include: 'ProcessControl', 'Supervisory', 'Enterprise' + PurdueLevel PurdueLevel `json:"purdueLevel,omitempty"` + // Notes - user notes for the device, up to 300 characters. + Notes *string `json:"notes,omitempty"` + // Firmwares - READ-ONLY; List of device firmwares. + Firmwares *[]Firmware `json:"firmwares,omitempty"` + // DiscoveryTime - READ-ONLY; Discovered time of the device. + DiscoveryTime *date.Time `json:"discoveryTime,omitempty"` + // ProgrammingState - READ-ONLY; Indicates whether this device is programming. Possible values include: 'ProgrammingDevice', 'NotProgrammingDevice' + ProgrammingState ProgrammingState `json:"programmingState,omitempty"` + // LastProgrammingTime - READ-ONLY; last time the device was programming or programed. + LastProgrammingTime *date.Time `json:"lastProgrammingTime,omitempty"` + // ScanningFunctionality - READ-ONLY; Indicates whether the device is a scanner. Possible values include: 'ScannerDevice', 'NotScannerDevice' + ScanningFunctionality ScanningFunctionality `json:"scanningFunctionality,omitempty"` + // LastScanTime - READ-ONLY; last time the device was scanning. + LastScanTime *date.Time `json:"lastScanTime,omitempty"` + // RiskScore - READ-ONLY; risk score of the device. + RiskScore *int32 `json:"riskScore,omitempty"` + // Sensors - READ-ONLY; List of sensors that scanned this device. + Sensors *[]Sensor `json:"sensors,omitempty"` + // Site - READ-ONLY + Site *Site `json:"site,omitempty"` + // DeviceStatus - READ-ONLY; Device status. Possible values include: 'DeviceStatusActive', 'DeviceStatusRemoved' + DeviceStatus DeviceStatus `json:"deviceStatus,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeviceProperties. +func (dp DeviceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dp.DisplayName != nil { + objectMap["displayName"] = dp.DisplayName + } + if dp.DeviceType != nil { + objectMap["deviceType"] = dp.DeviceType + } + if dp.OsName != nil { + objectMap["osName"] = dp.OsName + } + if dp.AuthorizationState != "" { + objectMap["authorizationState"] = dp.AuthorizationState + } + if dp.DeviceCriticality != "" { + objectMap["deviceCriticality"] = dp.DeviceCriticality + } + if dp.PurdueLevel != "" { + objectMap["purdueLevel"] = dp.PurdueLevel + } + if dp.Notes != nil { + objectMap["notes"] = dp.Notes + } + return json.Marshal(objectMap) +} + // DeviceSecurityGroup the device security group resource type DeviceSecurityGroup struct { autorest.Response `json:"-"` @@ -7384,8 +7776,11 @@ func (page DeviceSecurityGroupListPage) Values() []DeviceSecurityGroup { } // Creates a new instance of the DeviceSecurityGroupListPage type. -func NewDeviceSecurityGroupListPage(getNextPage func(context.Context, DeviceSecurityGroupList) (DeviceSecurityGroupList, error)) DeviceSecurityGroupListPage { - return DeviceSecurityGroupListPage{fn: getNextPage} +func NewDeviceSecurityGroupListPage(cur DeviceSecurityGroupList, getNextPage func(context.Context, DeviceSecurityGroupList) (DeviceSecurityGroupList, error)) DeviceSecurityGroupListPage { + return DeviceSecurityGroupListPage{ + fn: getNextPage, + dsgl: cur, + } } // DeviceSecurityGroupProperties describes properties of a security group. @@ -7463,7 +7858,7 @@ type DirectMethodInvokesNotInAllowedRange struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } // MarshalJSON is the custom marshaler for DirectMethodInvokesNotInAllowedRange. @@ -7738,8 +8133,8 @@ func (dssl DiscoveredSecuritySolutionList) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// DiscoveredSecuritySolutionListIterator provides access to a complete listing of DiscoveredSecuritySolution -// values. +// DiscoveredSecuritySolutionListIterator provides access to a complete listing of +// DiscoveredSecuritySolution values. type DiscoveredSecuritySolutionListIterator struct { i int page DiscoveredSecuritySolutionListPage @@ -7882,8 +8277,11 @@ func (page DiscoveredSecuritySolutionListPage) Values() []DiscoveredSecuritySolu } // Creates a new instance of the DiscoveredSecuritySolutionListPage type. -func NewDiscoveredSecuritySolutionListPage(getNextPage func(context.Context, DiscoveredSecuritySolutionList) (DiscoveredSecuritySolutionList, error)) DiscoveredSecuritySolutionListPage { - return DiscoveredSecuritySolutionListPage{fn: getNextPage} +func NewDiscoveredSecuritySolutionListPage(cur DiscoveredSecuritySolutionList, getNextPage func(context.Context, DiscoveredSecuritySolutionList) (DiscoveredSecuritySolutionList, error)) DiscoveredSecuritySolutionListPage { + return DiscoveredSecuritySolutionListPage{ + fn: getNextPage, + dssl: cur, + } } // DiscoveredSecuritySolutionProperties ... @@ -8216,8 +8614,11 @@ func (page ExternalSecuritySolutionListPage) Values() []BasicExternalSecuritySol } // Creates a new instance of the ExternalSecuritySolutionListPage type. -func NewExternalSecuritySolutionListPage(getNextPage func(context.Context, ExternalSecuritySolutionList) (ExternalSecuritySolutionList, error)) ExternalSecuritySolutionListPage { - return ExternalSecuritySolutionListPage{fn: getNextPage} +func NewExternalSecuritySolutionListPage(cur ExternalSecuritySolutionList, getNextPage func(context.Context, ExternalSecuritySolutionList) (ExternalSecuritySolutionList, error)) ExternalSecuritySolutionListPage { + return ExternalSecuritySolutionListPage{ + fn: getNextPage, + essl: cur, + } } // ExternalSecuritySolutionModel ... @@ -8333,7 +8734,7 @@ type FailedLocalLoginsNotInAllowedRange struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } // MarshalJSON is the custom marshaler for FailedLocalLoginsNotInAllowedRange. @@ -8523,7 +8924,7 @@ type FileUploadsNotInAllowedRange struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } // MarshalJSON is the custom marshaler for FileUploadsNotInAllowedRange. @@ -8698,30 +9099,48 @@ func (funiar FileUploadsNotInAllowedRange) AsBasicCustomAlertRule() (BasicCustom return &funiar, true } +// Firmware firmware information +type Firmware struct { + // ModuleAddress - READ-ONLY; Address of the specific module a firmware is related to + ModuleAddress *string `json:"moduleAddress,omitempty"` + // Rack - READ-ONLY; Rack number of the module a firmware is related to. + Rack *string `json:"rack,omitempty"` + // Slot - READ-ONLY; Slot number in the rack of the module a firmware is related to + Slot *string `json:"slot,omitempty"` + // Serial - READ-ONLY; Serial of the firmware + Serial *string `json:"serial,omitempty"` + // Model - READ-ONLY; Firmware model + Model *string `json:"model,omitempty"` + // Version - READ-ONLY; Firmware version + Version *string `json:"version,omitempty"` + // AdditionalData - READ-ONLY; A bag of fields which extends the firmware information. + AdditionalData interface{} `json:"additionalData,omitempty"` +} + // GcpCredentialsDetailsProperties GCP cloud account connector based service to service credentials, the -// credentials is composed of organization id and json api key (write only) +// credentials are composed of the organization ID and a JSON API key (write only) type GcpCredentialsDetailsProperties struct { - // OrganizationID - The Organization ID of the GCP cloud account + // OrganizationID - The organization ID of the GCP cloud account OrganizationID *string `json:"organizationId,omitempty"` // Type - Type field of the API key (write only) Type *string `json:"type,omitempty"` - // ProjectID - Project Id field of the API key (write only) + // ProjectID - Project ID field of the API key (write only) ProjectID *string `json:"projectId,omitempty"` - // PrivateKeyID - Private key Id field of the API key (write only) + // PrivateKeyID - Private key ID field of the API key (write only) PrivateKeyID *string `json:"privateKeyId,omitempty"` // PrivateKey - Private key field of the API key (write only) PrivateKey *string `json:"privateKey,omitempty"` // ClientEmail - Client email field of the API key (write only) ClientEmail *string `json:"clientEmail,omitempty"` - // ClientID - Client Id field of the API key (write only) + // ClientID - Client ID field of the API key (write only) ClientID *string `json:"clientId,omitempty"` - // AuthURI - Auth Uri field of the API key (write only) + // AuthURI - Auth URI field of the API key (write only) AuthURI *string `json:"authUri,omitempty"` - // TokenURI - Token Uri field of the API key (write only) + // TokenURI - Token URI field of the API key (write only) TokenURI *string `json:"tokenUri,omitempty"` - // AuthProviderX509CertURL - Auth provider x509 certificate url field of the API key (write only) + // AuthProviderX509CertURL - Auth provider x509 certificate URL field of the API key (write only) AuthProviderX509CertURL *string `json:"authProviderX509CertUrl,omitempty"` - // ClientX509CertURL - Client x509 certificate url field of the API key (write only) + // ClientX509CertURL - Client x509 certificate URL field of the API key (write only) ClientX509CertURL *string `json:"clientX509CertUrl,omitempty"` // AuthenticationProvisioningState - READ-ONLY; State of the multi-cloud connector. Possible values include: 'Valid', 'Invalid', 'Expired', 'IncorrectPolicy' AuthenticationProvisioningState AuthenticationProvisioningState `json:"authenticationProvisioningState,omitempty"` @@ -8799,7 +9218,8 @@ func (gcdp GcpCredentialsDetailsProperties) AsBasicAuthenticationDetailsProperti return &gcdp, true } -// HTTPC2DMessagesNotInAllowedRange number of cloud to device messages (HTTP protocol) is not in allowed range. +// HTTPC2DMessagesNotInAllowedRange number of cloud to device messages (HTTP protocol) is not in allowed +// range. type HTTPC2DMessagesNotInAllowedRange struct { // TimeWindowSize - The time window size in iso8601 format. TimeWindowSize *string `json:"timeWindowSize,omitempty"` @@ -8814,7 +9234,7 @@ type HTTPC2DMessagesNotInAllowedRange struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } // MarshalJSON is the custom marshaler for HTTPC2DMessagesNotInAllowedRange. @@ -8989,8 +9409,8 @@ func (hcmniar HTTPC2DMessagesNotInAllowedRange) AsBasicCustomAlertRule() (BasicC return &hcmniar, true } -// HTTPC2DRejectedMessagesNotInAllowedRange number of rejected cloud to device messages (HTTP protocol) is not -// in allowed range. +// HTTPC2DRejectedMessagesNotInAllowedRange number of rejected cloud to device messages (HTTP protocol) is +// not in allowed range. type HTTPC2DRejectedMessagesNotInAllowedRange struct { // TimeWindowSize - The time window size in iso8601 format. TimeWindowSize *string `json:"timeWindowSize,omitempty"` @@ -9005,7 +9425,7 @@ type HTTPC2DRejectedMessagesNotInAllowedRange struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } // MarshalJSON is the custom marshaler for HTTPC2DRejectedMessagesNotInAllowedRange. @@ -9180,7 +9600,8 @@ func (hcrmniar HTTPC2DRejectedMessagesNotInAllowedRange) AsBasicCustomAlertRule( return &hcrmniar, true } -// HTTPD2CMessagesNotInAllowedRange number of device to cloud messages (HTTP protocol) is not in allowed range. +// HTTPD2CMessagesNotInAllowedRange number of device to cloud messages (HTTP protocol) is not in allowed +// range. type HTTPD2CMessagesNotInAllowedRange struct { // TimeWindowSize - The time window size in iso8601 format. TimeWindowSize *string `json:"timeWindowSize,omitempty"` @@ -9195,7 +9616,7 @@ type HTTPD2CMessagesNotInAllowedRange struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } // MarshalJSON is the custom marshaler for HTTPD2CMessagesNotInAllowedRange. @@ -9378,7 +9799,7 @@ type HybridComputeSettingsProperties struct { AutoProvision AutoProvision `json:"autoProvision,omitempty"` // ResourceGroupName - The name of the resource group where Arc (Hybrid Compute) connectors are connected. ResourceGroupName *string `json:"resourceGroupName,omitempty"` - // Region - The location where the meta data of machines will be stored + // Region - The location where the metadata of machines will be stored Region *string `json:"region,omitempty"` // ProxyServer - For a non-Azure machine that is not connected directly to the internet, specify a proxy server that the non-Azure machine can use. ProxyServer *ProxyServerProperties `json:"proxyServer,omitempty"` @@ -9510,8 +9931,8 @@ func (ippl InformationProtectionPolicyList) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// InformationProtectionPolicyListIterator provides access to a complete listing of InformationProtectionPolicy -// values. +// InformationProtectionPolicyListIterator provides access to a complete listing of +// InformationProtectionPolicy values. type InformationProtectionPolicyListIterator struct { i int page InformationProtectionPolicyListPage @@ -9654,8 +10075,11 @@ func (page InformationProtectionPolicyListPage) Values() []InformationProtection } // Creates a new instance of the InformationProtectionPolicyListPage type. -func NewInformationProtectionPolicyListPage(getNextPage func(context.Context, InformationProtectionPolicyList) (InformationProtectionPolicyList, error)) InformationProtectionPolicyListPage { - return InformationProtectionPolicyListPage{fn: getNextPage} +func NewInformationProtectionPolicyListPage(cur InformationProtectionPolicyList, getNextPage func(context.Context, InformationProtectionPolicyList) (InformationProtectionPolicyList, error)) InformationProtectionPolicyListPage { + return InformationProtectionPolicyListPage{ + fn: getNextPage, + ippl: cur, + } } // InformationProtectionPolicyProperties describes properties of an information protection policy. @@ -9814,30 +10238,189 @@ func NewIotAlertListIterator(page IotAlertListPage) IotAlertListIterator { return IotAlertListIterator{page: page} } -// IsEmpty returns true if the ListResult contains no values. -func (ial IotAlertList) IsEmpty() bool { - return ial.Value == nil || len(*ial.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (ial IotAlertList) hasNextLink() bool { - return ial.NextLink != nil && len(*ial.NextLink) != 0 +// IotAlertListModel list of IoT alerts +type IotAlertListModel struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List data + Value *[]IotAlertModel `json:"value,omitempty"` + // NextLink - READ-ONLY; When available, follow the URI to get the next page of data + NextLink *string `json:"nextLink,omitempty"` } -// iotAlertListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (ial IotAlertList) iotAlertListPreparer(ctx context.Context) (*http.Request, error) { - if !ial.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(ial.NextLink))) +// IotAlertListModelIterator provides access to a complete listing of IotAlertModel values. +type IotAlertListModelIterator struct { + i int + page IotAlertListModelPage } -// IotAlertListPage contains a page of IotAlert values. -type IotAlertListPage struct { +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *IotAlertListModelIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotAlertListModelIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *IotAlertListModelIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IotAlertListModelIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter IotAlertListModelIterator) Response() IotAlertListModel { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter IotAlertListModelIterator) Value() IotAlertModel { + if !iter.page.NotDone() { + return IotAlertModel{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IotAlertListModelIterator type. +func NewIotAlertListModelIterator(page IotAlertListModelPage) IotAlertListModelIterator { + return IotAlertListModelIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ialm IotAlertListModel) IsEmpty() bool { + return ialm.Value == nil || len(*ialm.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ialm IotAlertListModel) hasNextLink() bool { + return ialm.NextLink != nil && len(*ialm.NextLink) != 0 +} + +// iotAlertListModelPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ialm IotAlertListModel) iotAlertListModelPreparer(ctx context.Context) (*http.Request, error) { + if !ialm.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ialm.NextLink))) +} + +// IotAlertListModelPage contains a page of IotAlertModel values. +type IotAlertListModelPage struct { + fn func(context.Context, IotAlertListModel) (IotAlertListModel, error) + ialm IotAlertListModel +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *IotAlertListModelPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotAlertListModelPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ialm) + if err != nil { + return err + } + page.ialm = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *IotAlertListModelPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IotAlertListModelPage) NotDone() bool { + return !page.ialm.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IotAlertListModelPage) Response() IotAlertListModel { + return page.ialm +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IotAlertListModelPage) Values() []IotAlertModel { + if page.ialm.IsEmpty() { + return nil + } + return *page.ialm.Value +} + +// Creates a new instance of the IotAlertListModelPage type. +func NewIotAlertListModelPage(cur IotAlertListModel, getNextPage func(context.Context, IotAlertListModel) (IotAlertListModel, error)) IotAlertListModelPage { + return IotAlertListModelPage{ + fn: getNextPage, + ialm: cur, + } +} + +// IsEmpty returns true if the ListResult contains no values. +func (ial IotAlertList) IsEmpty() bool { + return ial.Value == nil || len(*ial.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ial IotAlertList) hasNextLink() bool { + return ial.NextLink != nil && len(*ial.NextLink) != 0 +} + +// iotAlertListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ial IotAlertList) iotAlertListPreparer(ctx context.Context) (*http.Request, error) { + if !ial.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ial.NextLink))) +} + +// IotAlertListPage contains a page of IotAlert values. +type IotAlertListPage struct { fn func(context.Context, IotAlertList) (IotAlertList, error) ial IotAlertList } @@ -9894,8 +10477,51 @@ func (page IotAlertListPage) Values() []IotAlert { } // Creates a new instance of the IotAlertListPage type. -func NewIotAlertListPage(getNextPage func(context.Context, IotAlertList) (IotAlertList, error)) IotAlertListPage { - return IotAlertListPage{fn: getNextPage} +func NewIotAlertListPage(cur IotAlertList, getNextPage func(context.Context, IotAlertList) (IotAlertList, error)) IotAlertListPage { + return IotAlertListPage{ + fn: getNextPage, + ial: cur, + } +} + +// IotAlertModel ioT alert +type IotAlertModel struct { + autorest.Response `json:"-"` + // IotAlertPropertiesModel - Alert properties + *IotAlertPropertiesModel `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for IotAlertModel. +func (iam IotAlertModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if iam.IotAlertPropertiesModel != nil { + objectMap["properties"] = iam.IotAlertPropertiesModel + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IotAlertModel struct. +func (iam *IotAlertModel) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var iotAlertPropertiesModel IotAlertPropertiesModel + err = json.Unmarshal(*v, &iotAlertPropertiesModel) + if err != nil { + return err + } + iam.IotAlertPropertiesModel = &iotAlertPropertiesModel + } + } + } + + return nil } // IotAlertProperties ioT alert properties @@ -9928,6 +10554,36 @@ func (iap IotAlertProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// IotAlertPropertiesModel ioT alert properties +type IotAlertPropertiesModel struct { + // SystemAlertID - READ-ONLY; Holds the product canonical identifier of the alert within the scope of a product + SystemAlertID *string `json:"systemAlertId,omitempty"` + // CompromisedEntity - READ-ONLY; Display name of the main entity being reported on + CompromisedEntity *string `json:"compromisedEntity,omitempty"` + // AlertType - READ-ONLY; The type name of the alert + AlertType *string `json:"alertType,omitempty"` + // StartTimeUtc - READ-ONLY; The impact start time of the alert (the time of the first event or activity included in the alert) + StartTimeUtc *string `json:"startTimeUtc,omitempty"` + // EndTimeUtc - READ-ONLY; The impact end time of the alert (the time of the last event or activity included in the alert) + EndTimeUtc *string `json:"endTimeUtc,omitempty"` + // Entities - A list of entities related to the alert + Entities *[]interface{} `json:"entities,omitempty"` + // ExtendedProperties - A bag of fields which extends the alert information + ExtendedProperties interface{} `json:"extendedProperties,omitempty"` +} + +// MarshalJSON is the custom marshaler for IotAlertPropertiesModel. +func (iapm IotAlertPropertiesModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if iapm.Entities != nil { + objectMap["entities"] = iapm.Entities + } + if iapm.ExtendedProperties != nil { + objectMap["extendedProperties"] = iapm.ExtendedProperties + } + return json.Marshal(objectMap) +} + // IotAlertType ioT alert type. type IotAlertType struct { autorest.Response `json:"-"` @@ -10265,6 +10921,166 @@ func NewIotRecommendationListIterator(page IotRecommendationListPage) IotRecomme return IotRecommendationListIterator{page: page} } +// IotRecommendationListModel list of IoT recommendations +type IotRecommendationListModel struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List data + Value *[]IotRecommendationModel `json:"value,omitempty"` + // NextLink - READ-ONLY; When available, follow the URI to get the next page of data + NextLink *string `json:"nextLink,omitempty"` +} + +// IotRecommendationListModelIterator provides access to a complete listing of IotRecommendationModel +// values. +type IotRecommendationListModelIterator struct { + i int + page IotRecommendationListModelPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *IotRecommendationListModelIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotRecommendationListModelIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *IotRecommendationListModelIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IotRecommendationListModelIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter IotRecommendationListModelIterator) Response() IotRecommendationListModel { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter IotRecommendationListModelIterator) Value() IotRecommendationModel { + if !iter.page.NotDone() { + return IotRecommendationModel{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IotRecommendationListModelIterator type. +func NewIotRecommendationListModelIterator(page IotRecommendationListModelPage) IotRecommendationListModelIterator { + return IotRecommendationListModelIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (irlm IotRecommendationListModel) IsEmpty() bool { + return irlm.Value == nil || len(*irlm.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (irlm IotRecommendationListModel) hasNextLink() bool { + return irlm.NextLink != nil && len(*irlm.NextLink) != 0 +} + +// iotRecommendationListModelPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (irlm IotRecommendationListModel) iotRecommendationListModelPreparer(ctx context.Context) (*http.Request, error) { + if !irlm.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(irlm.NextLink))) +} + +// IotRecommendationListModelPage contains a page of IotRecommendationModel values. +type IotRecommendationListModelPage struct { + fn func(context.Context, IotRecommendationListModel) (IotRecommendationListModel, error) + irlm IotRecommendationListModel +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *IotRecommendationListModelPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotRecommendationListModelPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.irlm) + if err != nil { + return err + } + page.irlm = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *IotRecommendationListModelPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IotRecommendationListModelPage) NotDone() bool { + return !page.irlm.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IotRecommendationListModelPage) Response() IotRecommendationListModel { + return page.irlm +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IotRecommendationListModelPage) Values() []IotRecommendationModel { + if page.irlm.IsEmpty() { + return nil + } + return *page.irlm.Value +} + +// Creates a new instance of the IotRecommendationListModelPage type. +func NewIotRecommendationListModelPage(cur IotRecommendationListModel, getNextPage func(context.Context, IotRecommendationListModel) (IotRecommendationListModel, error)) IotRecommendationListModelPage { + return IotRecommendationListModelPage{ + fn: getNextPage, + irlm: cur, + } +} + // IsEmpty returns true if the ListResult contains no values. func (irl IotRecommendationList) IsEmpty() bool { return irl.Value == nil || len(*irl.Value) == 0 @@ -10345,8 +11161,84 @@ func (page IotRecommendationListPage) Values() []IotRecommendation { } // Creates a new instance of the IotRecommendationListPage type. -func NewIotRecommendationListPage(getNextPage func(context.Context, IotRecommendationList) (IotRecommendationList, error)) IotRecommendationListPage { - return IotRecommendationListPage{fn: getNextPage} +func NewIotRecommendationListPage(cur IotRecommendationList, getNextPage func(context.Context, IotRecommendationList) (IotRecommendationList, error)) IotRecommendationListPage { + return IotRecommendationListPage{ + fn: getNextPage, + irl: cur, + } +} + +// IotRecommendationModel ioT recommendation +type IotRecommendationModel struct { + autorest.Response `json:"-"` + // IotRecommendationPropertiesModel - Recommendation properties + *IotRecommendationPropertiesModel `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IotRecommendationModel. +func (irm IotRecommendationModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if irm.IotRecommendationPropertiesModel != nil { + objectMap["properties"] = irm.IotRecommendationPropertiesModel + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IotRecommendationModel struct. +func (irm *IotRecommendationModel) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var iotRecommendationPropertiesModel IotRecommendationPropertiesModel + err = json.Unmarshal(*v, &iotRecommendationPropertiesModel) + if err != nil { + return err + } + irm.IotRecommendationPropertiesModel = &iotRecommendationPropertiesModel + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + irm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + irm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + irm.Type = &typeVar + } + } + } + + return nil } // IotRecommendationProperties ioT recommendation properties @@ -10370,6 +11262,27 @@ func (irp IotRecommendationProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// IotRecommendationPropertiesModel ioT recommendation properties +type IotRecommendationPropertiesModel struct { + // DeviceID - READ-ONLY; Identifier of the device being reported on + DeviceID *string `json:"deviceId,omitempty"` + // RecommendationType - READ-ONLY; The type name of the recommendation + RecommendationType *string `json:"recommendationType,omitempty"` + // DiscoveredTimeUtc - READ-ONLY; The discovery time of the recommendation + DiscoveredTimeUtc *string `json:"discoveredTimeUtc,omitempty"` + // RecommendationAdditionalData - A bag of fields which extends the recommendation information + RecommendationAdditionalData interface{} `json:"recommendationAdditionalData,omitempty"` +} + +// MarshalJSON is the custom marshaler for IotRecommendationPropertiesModel. +func (irpm IotRecommendationPropertiesModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if irpm.RecommendationAdditionalData != nil { + objectMap["recommendationAdditionalData"] = irpm.RecommendationAdditionalData + } + return json.Marshal(objectMap) +} + // IotRecommendationType ioT recommendation type. type IotRecommendationType struct { autorest.Response `json:"-"` @@ -10577,8 +11490,8 @@ func (itsaal IoTSecurityAggregatedAlertList) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// IoTSecurityAggregatedAlertListIterator provides access to a complete listing of IoTSecurityAggregatedAlert -// values. +// IoTSecurityAggregatedAlertListIterator provides access to a complete listing of +// IoTSecurityAggregatedAlert values. type IoTSecurityAggregatedAlertListIterator struct { i int page IoTSecurityAggregatedAlertListPage @@ -10721,8 +11634,11 @@ func (page IoTSecurityAggregatedAlertListPage) Values() []IoTSecurityAggregatedA } // Creates a new instance of the IoTSecurityAggregatedAlertListPage type. -func NewIoTSecurityAggregatedAlertListPage(getNextPage func(context.Context, IoTSecurityAggregatedAlertList) (IoTSecurityAggregatedAlertList, error)) IoTSecurityAggregatedAlertListPage { - return IoTSecurityAggregatedAlertListPage{fn: getNextPage} +func NewIoTSecurityAggregatedAlertListPage(cur IoTSecurityAggregatedAlertList, getNextPage func(context.Context, IoTSecurityAggregatedAlertList) (IoTSecurityAggregatedAlertList, error)) IoTSecurityAggregatedAlertListPage { + return IoTSecurityAggregatedAlertListPage{ + fn: getNextPage, + itsaal: cur, + } } // IoTSecurityAggregatedAlertProperties ioT Security solution aggregated alert details. @@ -10956,7 +11872,8 @@ func (itsarl IoTSecurityAggregatedRecommendationList) ioTSecurityAggregatedRecom autorest.WithBaseURL(to.String(itsarl.NextLink))) } -// IoTSecurityAggregatedRecommendationListPage contains a page of IoTSecurityAggregatedRecommendation values. +// IoTSecurityAggregatedRecommendationListPage contains a page of IoTSecurityAggregatedRecommendation +// values. type IoTSecurityAggregatedRecommendationListPage struct { fn func(context.Context, IoTSecurityAggregatedRecommendationList) (IoTSecurityAggregatedRecommendationList, error) itsarl IoTSecurityAggregatedRecommendationList @@ -11014,11 +11931,15 @@ func (page IoTSecurityAggregatedRecommendationListPage) Values() []IoTSecurityAg } // Creates a new instance of the IoTSecurityAggregatedRecommendationListPage type. -func NewIoTSecurityAggregatedRecommendationListPage(getNextPage func(context.Context, IoTSecurityAggregatedRecommendationList) (IoTSecurityAggregatedRecommendationList, error)) IoTSecurityAggregatedRecommendationListPage { - return IoTSecurityAggregatedRecommendationListPage{fn: getNextPage} +func NewIoTSecurityAggregatedRecommendationListPage(cur IoTSecurityAggregatedRecommendationList, getNextPage func(context.Context, IoTSecurityAggregatedRecommendationList) (IoTSecurityAggregatedRecommendationList, error)) IoTSecurityAggregatedRecommendationListPage { + return IoTSecurityAggregatedRecommendationListPage{ + fn: getNextPage, + itsarl: cur, + } } -// IoTSecurityAggregatedRecommendationProperties ioT Security solution aggregated recommendation information +// IoTSecurityAggregatedRecommendationProperties ioT Security solution aggregated recommendation +// information type IoTSecurityAggregatedRecommendationProperties struct { // RecommendationName - Name of the recommendation. RecommendationName *string `json:"recommendationName,omitempty"` @@ -11071,8 +11992,8 @@ type IoTSecurityDeviceAlert struct { AlertsCount *int32 `json:"alertsCount,omitempty"` } -// IoTSecurityDeviceRecommendation statistical information about the number of recommendations per device, per -// recommendation type. +// IoTSecurityDeviceRecommendation statistical information about the number of recommendations per device, +// per recommendation type. type IoTSecurityDeviceRecommendation struct { // RecommendationDisplayName - READ-ONLY; Display name of the recommendation. RecommendationDisplayName *string `json:"recommendationDisplayName,omitempty"` @@ -11386,7 +12307,8 @@ func (itssl IoTSecuritySolutionsList) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// IoTSecuritySolutionsListIterator provides access to a complete listing of IoTSecuritySolutionModel values. +// IoTSecuritySolutionsListIterator provides access to a complete listing of IoTSecuritySolutionModel +// values. type IoTSecuritySolutionsListIterator struct { i int page IoTSecuritySolutionsListPage @@ -11529,8 +12451,11 @@ func (page IoTSecuritySolutionsListPage) Values() []IoTSecuritySolutionModel { } // Creates a new instance of the IoTSecuritySolutionsListPage type. -func NewIoTSecuritySolutionsListPage(getNextPage func(context.Context, IoTSecuritySolutionsList) (IoTSecuritySolutionsList, error)) IoTSecuritySolutionsListPage { - return IoTSecuritySolutionsListPage{fn: getNextPage} +func NewIoTSecuritySolutionsListPage(cur IoTSecuritySolutionsList, getNextPage func(context.Context, IoTSecuritySolutionsList) (IoTSecuritySolutionsList, error)) IoTSecuritySolutionsListPage { + return IoTSecuritySolutionsListPage{ + fn: getNextPage, + itssl: cur, + } } // IotSensor ioT sensor @@ -11572,6 +12497,20 @@ type IoTSeverityMetrics struct { Low *int32 `json:"low,omitempty"` } +// IPAddress IP Address information +type IPAddress struct { + // V4Address - READ-ONLY; IPV4 address + V4Address *string `json:"v4Address,omitempty"` + // DetectionTime - READ-ONLY; Detection time of the ip address. + DetectionTime *date.Time `json:"detectionTime,omitempty"` + // SubnetCidr - READ-ONLY; Subnet Classless Inter-Domain Routing + SubnetCidr *string `json:"subnetCidr,omitempty"` + // Fqdn - READ-ONLY; Fully qualified domain name + Fqdn *string `json:"fqdn,omitempty"` + // FqdnLastLookupTime - READ-ONLY; FQDN last lookup time. + FqdnLastLookupTime *date.Time `json:"fqdnLastLookupTime,omitempty"` +} + // JitNetworkAccessPoliciesList ... type JitNetworkAccessPoliciesList struct { autorest.Response `json:"-"` @@ -11589,7 +12528,8 @@ func (jnapl JitNetworkAccessPoliciesList) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// JitNetworkAccessPoliciesListIterator provides access to a complete listing of JitNetworkAccessPolicy values. +// JitNetworkAccessPoliciesListIterator provides access to a complete listing of JitNetworkAccessPolicy +// values. type JitNetworkAccessPoliciesListIterator struct { i int page JitNetworkAccessPoliciesListPage @@ -11732,8 +12672,11 @@ func (page JitNetworkAccessPoliciesListPage) Values() []JitNetworkAccessPolicy { } // Creates a new instance of the JitNetworkAccessPoliciesListPage type. -func NewJitNetworkAccessPoliciesListPage(getNextPage func(context.Context, JitNetworkAccessPoliciesList) (JitNetworkAccessPoliciesList, error)) JitNetworkAccessPoliciesListPage { - return JitNetworkAccessPoliciesListPage{fn: getNextPage} +func NewJitNetworkAccessPoliciesListPage(cur JitNetworkAccessPoliciesList, getNextPage func(context.Context, JitNetworkAccessPoliciesList) (JitNetworkAccessPoliciesList, error)) JitNetworkAccessPoliciesListPage { + return JitNetworkAccessPoliciesListPage{ + fn: getNextPage, + jnapl: cur, + } } // JitNetworkAccessPolicy ... @@ -11967,7 +12910,7 @@ type ListCustomAlertRule struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } func unmarshalBasicListCustomAlertRule(body []byte) (BasicListCustomAlertRule, error) { @@ -12186,7 +13129,8 @@ func (lcar ListCustomAlertRule) AsBasicCustomAlertRule() (BasicCustomAlertRule, return &lcar, true } -// LocalUserNotAllowed login by a local user that isn't allowed. Allow list consists of login names to allow. +// LocalUserNotAllowed login by a local user that isn't allowed. Allow list consists of login names to +// allow. type LocalUserNotAllowed struct { // AllowlistValues - The values to allow. The format of the values depends on the rule type. AllowlistValues *[]string `json:"allowlistValues,omitempty"` @@ -12199,7 +13143,7 @@ type LocalUserNotAllowed struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } // MarshalJSON is the custom marshaler for LocalUserNotAllowed. @@ -12418,7 +13362,20 @@ func (lai LogAnalyticsIdentifier) AsBasicResourceIdentifier() (BasicResourceIden return &lai, true } -// MqttC2DMessagesNotInAllowedRange number of cloud to device messages (MQTT protocol) is not in allowed range. +// MacAddress MAC Address information +type MacAddress struct { + // Address - READ-ONLY; MAC address + Address *string `json:"address,omitempty"` + // DetectionTime - READ-ONLY; Detection time of the mac address. + DetectionTime *date.Time `json:"detectionTime,omitempty"` + // Significance - READ-ONLY; Indicates whether this is the primary secondary MAC address of the device. Possible values include: 'Primary', 'Secondary' + Significance MacSignificance `json:"significance,omitempty"` + // RelationToIPStatus - READ-ONLY; Indicates whether the relation of the mac to the ip address is certain or a guess. Possible values include: 'Guess', 'Certain' + RelationToIPStatus RelationToIPStatus `json:"relationToIpStatus,omitempty"` +} + +// MqttC2DMessagesNotInAllowedRange number of cloud to device messages (MQTT protocol) is not in allowed +// range. type MqttC2DMessagesNotInAllowedRange struct { // TimeWindowSize - The time window size in iso8601 format. TimeWindowSize *string `json:"timeWindowSize,omitempty"` @@ -12433,7 +13390,7 @@ type MqttC2DMessagesNotInAllowedRange struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } // MarshalJSON is the custom marshaler for MqttC2DMessagesNotInAllowedRange. @@ -12608,8 +13565,8 @@ func (mcmniar MqttC2DMessagesNotInAllowedRange) AsBasicCustomAlertRule() (BasicC return &mcmniar, true } -// MqttC2DRejectedMessagesNotInAllowedRange number of rejected cloud to device messages (MQTT protocol) is not -// in allowed range. +// MqttC2DRejectedMessagesNotInAllowedRange number of rejected cloud to device messages (MQTT protocol) is +// not in allowed range. type MqttC2DRejectedMessagesNotInAllowedRange struct { // TimeWindowSize - The time window size in iso8601 format. TimeWindowSize *string `json:"timeWindowSize,omitempty"` @@ -12624,7 +13581,7 @@ type MqttC2DRejectedMessagesNotInAllowedRange struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } // MarshalJSON is the custom marshaler for MqttC2DRejectedMessagesNotInAllowedRange. @@ -12799,7 +13756,8 @@ func (mcrmniar MqttC2DRejectedMessagesNotInAllowedRange) AsBasicCustomAlertRule( return &mcrmniar, true } -// MqttD2CMessagesNotInAllowedRange number of device to cloud messages (MQTT protocol) is not in allowed range. +// MqttD2CMessagesNotInAllowedRange number of device to cloud messages (MQTT protocol) is not in allowed +// range. type MqttD2CMessagesNotInAllowedRange struct { // TimeWindowSize - The time window size in iso8601 format. TimeWindowSize *string `json:"timeWindowSize,omitempty"` @@ -12814,7 +13772,7 @@ type MqttD2CMessagesNotInAllowedRange struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } // MarshalJSON is the custom marshaler for MqttD2CMessagesNotInAllowedRange. @@ -12989,6 +13947,26 @@ func (mdmniar MqttD2CMessagesNotInAllowedRange) AsBasicCustomAlertRule() (BasicC return &mdmniar, true } +// NetworkInterface network interface +type NetworkInterface struct { + IPAddress *IPAddress `json:"ipAddress,omitempty"` + MacAddress *MacAddress `json:"macAddress,omitempty"` + // Vlans - READ-ONLY; List of device vlans. + Vlans *[]string `json:"vlans,omitempty"` +} + +// MarshalJSON is the custom marshaler for NetworkInterface. +func (ni NetworkInterface) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ni.IPAddress != nil { + objectMap["ipAddress"] = ni.IPAddress + } + if ni.MacAddress != nil { + objectMap["macAddress"] = ni.MacAddress + } + return json.Marshal(objectMap) +} + // OnPremiseIotSensor on-premise IoT sensor type OnPremiseIotSensor struct { autorest.Response `json:"-"` @@ -13394,8 +14372,11 @@ func (page OperationListPage) Values() []Operation { } // Creates a new instance of the OperationListPage type. -func NewOperationListPage(getNextPage func(context.Context, OperationList) (OperationList, error)) OperationListPage { - return OperationListPage{fn: getNextPage} +func NewOperationListPage(cur OperationList, getNextPage func(context.Context, OperationList) (OperationList, error)) OperationListPage { + return OperationListPage{ + fn: getNextPage, + ol: cur, + } } // PackageDownloadInfo information on a specific package download @@ -13526,9 +14507,9 @@ type PathRecommendation struct { ConfigurationStatus ConfigurationStatus1 `json:"configurationStatus,omitempty"` } -// Pricing azure Security Center is provided in two pricing tiers: free and standard, with the standard tier -// available with a trial period. The standard tier offers advanced security capabilities, while the free tier -// offers basic security features. +// Pricing azure Security Center is provided in two pricing tiers: free and standard, with the standard +// tier available with a trial period. The standard tier offers advanced security capabilities, while the +// free tier offers basic security features. type Pricing struct { autorest.Response `json:"-"` // PricingProperties - Pricing data @@ -13610,7 +14591,7 @@ type PricingList struct { // PricingProperties pricing properties for the relevant scope type PricingProperties struct { - // PricingTier - The pricing tier value. Azure Security Center is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features. Possible values include: 'Free', 'Standard' + // PricingTier - The pricing tier value. Azure Security Center is provided in two pricing tiers: free and standard, with the standard tier available with a trial period. The standard tier offers advanced security capabilities, while the free tier offers basic security features. Possible values include: 'PricingTierFree', 'PricingTierStandard' PricingTier PricingTier `json:"pricingTier,omitempty"` // FreeTrialRemainingTime - READ-ONLY; The duration left for the subscriptions free trial period - in ISO 8601 format (e.g. P3Y6M4DT12H30M5S). FreeTrialRemainingTime *string `json:"freeTrialRemainingTime,omitempty"` @@ -13625,7 +14606,8 @@ func (pp PricingProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// ProcessNotAllowed execution of a process that isn't allowed. Allow list consists of process names to allow. +// ProcessNotAllowed execution of a process that isn't allowed. Allow list consists of process names to +// allow. type ProcessNotAllowed struct { // AllowlistValues - The values to allow. The format of the values depends on the rule type. AllowlistValues *[]string `json:"allowlistValues,omitempty"` @@ -13638,7 +14620,7 @@ type ProcessNotAllowed struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } // MarshalJSON is the custom marshaler for ProcessNotAllowed. @@ -13820,6 +14802,23 @@ type ProtectionMode struct { Executable Executable `json:"executable,omitempty"` } +// Protocol1 protocol data +type Protocol1 struct { + // Name - READ-ONLY; Protocol name + Name *string `json:"name,omitempty"` + // Identifiers - list of protocol identifiers. + Identifiers *string `json:"identifiers,omitempty"` +} + +// MarshalJSON is the custom marshaler for Protocol1. +func (p1 Protocol1) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p1.Identifiers != nil { + objectMap["identifiers"] = p1.Identifiers + } + return json.Marshal(objectMap) +} + // ProxyServerProperties for a non-Azure machine that is not connected directly to the internet, specify a // proxy server that the non-Azure machine can use. type ProxyServerProperties struct { @@ -13841,6 +14840,16 @@ type PublisherInfo struct { Version *string `json:"version,omitempty"` } +// QueryCheck the rule query details. +type QueryCheck struct { + // Query - The rule query. + Query *string `json:"query,omitempty"` + // ExpectedResult - Expected result. + ExpectedResult *[][]string `json:"expectedResult,omitempty"` + // ColumnNames - Column names of expected result. + ColumnNames *[]string `json:"columnNames,omitempty"` +} + // QueuePurgesNotInAllowedRange number of device queue purges is not in allowed range. type QueuePurgesNotInAllowedRange struct { // TimeWindowSize - The time window size in iso8601 format. @@ -13856,7 +14865,7 @@ type QueuePurgesNotInAllowedRange struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } // MarshalJSON is the custom marshaler for QueuePurgesNotInAllowedRange. @@ -14293,8 +15302,11 @@ func (page RegulatoryComplianceAssessmentListPage) Values() []RegulatoryComplian } // Creates a new instance of the RegulatoryComplianceAssessmentListPage type. -func NewRegulatoryComplianceAssessmentListPage(getNextPage func(context.Context, RegulatoryComplianceAssessmentList) (RegulatoryComplianceAssessmentList, error)) RegulatoryComplianceAssessmentListPage { - return RegulatoryComplianceAssessmentListPage{fn: getNextPage} +func NewRegulatoryComplianceAssessmentListPage(cur RegulatoryComplianceAssessmentList, getNextPage func(context.Context, RegulatoryComplianceAssessmentList) (RegulatoryComplianceAssessmentList, error)) RegulatoryComplianceAssessmentListPage { + return RegulatoryComplianceAssessmentListPage{ + fn: getNextPage, + rcal: cur, + } } // RegulatoryComplianceAssessmentProperties regulatory compliance assessment data @@ -14417,8 +15429,8 @@ func (rccl RegulatoryComplianceControlList) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// RegulatoryComplianceControlListIterator provides access to a complete listing of RegulatoryComplianceControl -// values. +// RegulatoryComplianceControlListIterator provides access to a complete listing of +// RegulatoryComplianceControl values. type RegulatoryComplianceControlListIterator struct { i int page RegulatoryComplianceControlListPage @@ -14561,8 +15573,11 @@ func (page RegulatoryComplianceControlListPage) Values() []RegulatoryComplianceC } // Creates a new instance of the RegulatoryComplianceControlListPage type. -func NewRegulatoryComplianceControlListPage(getNextPage func(context.Context, RegulatoryComplianceControlList) (RegulatoryComplianceControlList, error)) RegulatoryComplianceControlListPage { - return RegulatoryComplianceControlListPage{fn: getNextPage} +func NewRegulatoryComplianceControlListPage(cur RegulatoryComplianceControlList, getNextPage func(context.Context, RegulatoryComplianceControlList) (RegulatoryComplianceControlList, error)) RegulatoryComplianceControlListPage { + return RegulatoryComplianceControlListPage{ + fn: getNextPage, + rccl: cur, + } } // RegulatoryComplianceControlProperties regulatory compliance control data @@ -14822,8 +15837,11 @@ func (page RegulatoryComplianceStandardListPage) Values() []RegulatoryCompliance } // Creates a new instance of the RegulatoryComplianceStandardListPage type. -func NewRegulatoryComplianceStandardListPage(getNextPage func(context.Context, RegulatoryComplianceStandardList) (RegulatoryComplianceStandardList, error)) RegulatoryComplianceStandardListPage { - return RegulatoryComplianceStandardListPage{fn: getNextPage} +func NewRegulatoryComplianceStandardListPage(cur RegulatoryComplianceStandardList, getNextPage func(context.Context, RegulatoryComplianceStandardList) (RegulatoryComplianceStandardList, error)) RegulatoryComplianceStandardListPage { + return RegulatoryComplianceStandardListPage{ + fn: getNextPage, + rcsl: cur, + } } // RegulatoryComplianceStandardProperties regulatory compliance standard data @@ -14849,6 +15867,18 @@ func (rcsp RegulatoryComplianceStandardProperties) MarshalJSON() ([]byte, error) return json.Marshal(objectMap) } +// Remediation remediation details. +type Remediation struct { + // Description - Remediation description. + Description *string `json:"description,omitempty"` + // Scripts - Remediation script. + Scripts *[]string `json:"scripts,omitempty"` + // Automated - Is remediation automated. + Automated *bool `json:"automated,omitempty"` + // PortalLink - Optional link to remediate in Azure Portal. + PortalLink *string `json:"portalLink,omitempty"` +} + // Resource describes an Azure resource. type Resource struct { // ID - READ-ONLY; Resource Id @@ -15060,6 +16090,173 @@ type Rule struct { IPAddresses *[]string `json:"ipAddresses,omitempty"` } +// RuleResults rule results. +type RuleResults struct { + autorest.Response `json:"-"` + Properties *RuleResultsProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RuleResults. +func (rr RuleResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rr.Properties != nil { + objectMap["properties"] = rr.Properties + } + return json.Marshal(objectMap) +} + +// RuleResultsInput rule results input. +type RuleResultsInput struct { + // LatestScan - Take results from latest scan. + LatestScan *bool `json:"latestScan,omitempty"` + // Results - Expected results to be inserted into the baseline. + // Leave this field empty it LatestScan == true. + Results *[][]string `json:"results,omitempty"` +} + +// RuleResultsProperties rule results properties. +type RuleResultsProperties struct { + // Results - Expected results in the baseline. + Results *[][]string `json:"results,omitempty"` +} + +// RulesResults a list of rules results. +type RulesResults struct { + autorest.Response `json:"-"` + // Value - List of rule results. + Value *[]RuleResults `json:"value,omitempty"` +} + +// RulesResultsInput rules results input. +type RulesResultsInput struct { + // LatestScan - Take results from latest scan. + LatestScan *bool `json:"latestScan,omitempty"` + // Results - Expected results to be inserted into the baseline. + // Leave this field empty it LatestScan == true. + Results map[string][][]string `json:"results"` +} + +// MarshalJSON is the custom marshaler for RulesResultsInput. +func (rri RulesResultsInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rri.LatestScan != nil { + objectMap["latestScan"] = rri.LatestScan + } + if rri.Results != nil { + objectMap["results"] = rri.Results + } + return json.Marshal(objectMap) +} + +// Scan a vulnerability assessment scan record. +type Scan struct { + autorest.Response `json:"-"` + Properties *ScanProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Scan. +func (s Scan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.Properties != nil { + objectMap["properties"] = s.Properties + } + return json.Marshal(objectMap) +} + +// ScanProperties a vulnerability assessment scan record properties. +type ScanProperties struct { + // TriggerType - Possible values include: 'OnDemand', 'Recurring' + TriggerType ScanTriggerType `json:"triggerType,omitempty"` + // State - Possible values include: 'ScanStateFailed', 'ScanStateFailedToRun', 'ScanStateInProgress', 'ScanStatePassed' + State ScanState `json:"state,omitempty"` + // Server - The server name. + Server *string `json:"server,omitempty"` + // Database - The database name. + Database *string `json:"database,omitempty"` + // SQLVersion - The SQL version. + SQLVersion *string `json:"sqlVersion,omitempty"` + // StartTime - The scan start time (UTC). + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - Scan results are valid until end time (UTC). + EndTime *date.Time `json:"endTime,omitempty"` + // HighSeverityFailedRulesCount - The number of failed rules with high severity. + HighSeverityFailedRulesCount *int32 `json:"highSeverityFailedRulesCount,omitempty"` + // MediumSeverityFailedRulesCount - The number of failed rules with medium severity. + MediumSeverityFailedRulesCount *int32 `json:"mediumSeverityFailedRulesCount,omitempty"` + // LowSeverityFailedRulesCount - The number of failed rules with low severity. + LowSeverityFailedRulesCount *int32 `json:"lowSeverityFailedRulesCount,omitempty"` + // TotalPassedRulesCount - The number of total passed rules. + TotalPassedRulesCount *int32 `json:"totalPassedRulesCount,omitempty"` + // TotalFailedRulesCount - The number of total failed rules. + TotalFailedRulesCount *int32 `json:"totalFailedRulesCount,omitempty"` + // TotalRulesCount - The number of total rules assessed. + TotalRulesCount *int32 `json:"totalRulesCount,omitempty"` + // IsBaselineApplied - Baseline created for this database, and has one or more rules. + IsBaselineApplied *bool `json:"isBaselineApplied,omitempty"` +} + +// ScanResult a vulnerability assessment scan result for a single rule. +type ScanResult struct { + autorest.Response `json:"-"` + Properties *ScanResultProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScanResult. +func (sr ScanResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sr.Properties != nil { + objectMap["properties"] = sr.Properties + } + return json.Marshal(objectMap) +} + +// ScanResultProperties a vulnerability assessment scan result properties for a single rule. +type ScanResultProperties struct { + // RuleID - The rule Id. + RuleID *string `json:"ruleId,omitempty"` + // Status - Possible values include: 'NonFinding', 'Finding', 'InternalError' + Status RuleStatus `json:"status,omitempty"` + // IsTrimmed - Indicated whether the results specified here are trimmed. + IsTrimmed *bool `json:"isTrimmed,omitempty"` + // QueryResults - The results of the query that was run. + QueryResults *[][]string `json:"queryResults,omitempty"` + Remediation *Remediation `json:"remediation,omitempty"` + BaselineAdjustedResult *BaselineAdjustedResult `json:"baselineAdjustedResult,omitempty"` + RuleMetadata *VaRule `json:"ruleMetadata,omitempty"` +} + +// ScanResults a list of vulnerability assessment scan results. +type ScanResults struct { + autorest.Response `json:"-"` + // Value - List of vulnerability assessment scan results. + Value *[]ScanResult `json:"value,omitempty"` +} + +// Scans a list of vulnerability assessment scan records. +type Scans struct { + autorest.Response `json:"-"` + // Value - List of vulnerability assessment scan records. + Value *[]Scan `json:"value,omitempty"` +} + // ScopeElement a more specific scope used to identify the alerts to suppress. type ScopeElement struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection @@ -15364,8 +16561,11 @@ func (page SecureScoreControlDefinitionListPage) Values() []SecureScoreControlDe } // Creates a new instance of the SecureScoreControlDefinitionListPage type. -func NewSecureScoreControlDefinitionListPage(getNextPage func(context.Context, SecureScoreControlDefinitionList) (SecureScoreControlDefinitionList, error)) SecureScoreControlDefinitionListPage { - return SecureScoreControlDefinitionListPage{fn: getNextPage} +func NewSecureScoreControlDefinitionListPage(cur SecureScoreControlDefinitionList, getNextPage func(context.Context, SecureScoreControlDefinitionList) (SecureScoreControlDefinitionList, error)) SecureScoreControlDefinitionListPage { + return SecureScoreControlDefinitionListPage{ + fn: getNextPage, + sscdl: cur, + } } // SecureScoreControlDefinitionSource the type of the security control (For example, BuiltIn) @@ -15374,8 +16574,8 @@ type SecureScoreControlDefinitionSource struct { SourceType ControlType `json:"sourceType,omitempty"` } -// SecureScoreControlDetails details of the security control, its score, and the health status of the relevant -// resources. +// SecureScoreControlDetails details of the security control, its score, and the health status of the +// relevant resources. type SecureScoreControlDetails struct { *SecureScoreControlScoreDetails `json:"properties,omitempty"` // ID - READ-ONLY; Resource Id @@ -15455,7 +16655,8 @@ type SecureScoreControlList struct { NextLink *string `json:"nextLink,omitempty"` } -// SecureScoreControlListIterator provides access to a complete listing of SecureScoreControlDetails values. +// SecureScoreControlListIterator provides access to a complete listing of SecureScoreControlDetails +// values. type SecureScoreControlListIterator struct { i int page SecureScoreControlListPage @@ -15598,8 +16799,11 @@ func (page SecureScoreControlListPage) Values() []SecureScoreControlDetails { } // Creates a new instance of the SecureScoreControlListPage type. -func NewSecureScoreControlListPage(getNextPage func(context.Context, SecureScoreControlList) (SecureScoreControlList, error)) SecureScoreControlListPage { - return SecureScoreControlListPage{fn: getNextPage} +func NewSecureScoreControlListPage(cur SecureScoreControlList, getNextPage func(context.Context, SecureScoreControlList) (SecureScoreControlList, error)) SecureScoreControlListPage { + return SecureScoreControlListPage{ + fn: getNextPage, + sscl: cur, + } } // SecureScoreControlScore calculation result data @@ -15999,8 +17203,11 @@ func (page SecureScoresListPage) Values() []SecureScoreItem { } // Creates a new instance of the SecureScoresListPage type. -func NewSecureScoresListPage(getNextPage func(context.Context, SecureScoresList) (SecureScoresList, error)) SecureScoresListPage { - return SecureScoresListPage{fn: getNextPage} +func NewSecureScoresListPage(cur SecureScoresList, getNextPage func(context.Context, SecureScoresList) (SecureScoresList, error)) SecureScoresListPage { + return SecureScoresListPage{ + fn: getNextPage, + ssl: cur, + } } // SensitivityLabel the sensitivity label. @@ -16017,6 +17224,14 @@ type SensitivityLabel struct { Enabled *bool `json:"enabled,omitempty"` } +// Sensor sensor data +type Sensor struct { + // Name - READ-ONLY; Sensor name + Name *string `json:"name,omitempty"` + // Zone - READ-ONLY; Zone Name. + Zone *string `json:"zone,omitempty"` +} + // ServerVulnerabilityAssessment describes the server vulnerability assessment details on a resource type ServerVulnerabilityAssessment struct { autorest.Response `json:"-"` @@ -16158,7 +17373,7 @@ func (svp ServerVulnerabilityProperties) AsBasicAdditionalData() (BasicAdditiona // ServicePrincipalProperties details of the service principal. type ServicePrincipalProperties struct { - // ApplicationID - Application id of service principal. + // ApplicationID - Application ID of service principal. ApplicationID *string `json:"applicationId,omitempty"` // Secret - A secret string that the application uses to prove its identity, also can be referred to as application password (write only). Secret *string `json:"secret,omitempty"` @@ -16544,8 +17759,17 @@ func (page SettingsListPage) Values() []BasicSetting { } // Creates a new instance of the SettingsListPage type. -func NewSettingsListPage(getNextPage func(context.Context, SettingsList) (SettingsList, error)) SettingsListPage { - return SettingsListPage{fn: getNextPage} +func NewSettingsListPage(cur SettingsList, getNextPage func(context.Context, SettingsList) (SettingsList, error)) SettingsListPage { + return SettingsListPage{ + fn: getNextPage, + sl: cur, + } +} + +// Site site data +type Site struct { + // DisplayName - READ-ONLY; Site display name + DisplayName *string `json:"displayName,omitempty"` } // Solution ... @@ -16791,8 +18015,11 @@ func (page SolutionListPage) Values() []Solution { } // Creates a new instance of the SolutionListPage type. -func NewSolutionListPage(getNextPage func(context.Context, SolutionList) (SolutionList, error)) SolutionListPage { - return SolutionListPage{fn: getNextPage} +func NewSolutionListPage(cur SolutionList, getNextPage func(context.Context, SolutionList) (SolutionList, error)) SolutionListPage { + return SolutionListPage{ + fn: getNextPage, + sl: cur, + } } // SolutionProperties ... @@ -17182,8 +18409,11 @@ func (page SubAssessmentListPage) Values() []SubAssessment { } // Creates a new instance of the SubAssessmentListPage type. -func NewSubAssessmentListPage(getNextPage func(context.Context, SubAssessmentList) (SubAssessmentList, error)) SubAssessmentListPage { - return SubAssessmentListPage{fn: getNextPage} +func NewSubAssessmentListPage(cur SubAssessmentList, getNextPage func(context.Context, SubAssessmentList) (SubAssessmentList, error)) SubAssessmentListPage { + return SubAssessmentListPage{ + fn: getNextPage, + sal: cur, + } } // SubAssessmentProperties describes properties of an sub-assessment. @@ -17593,11 +18823,15 @@ func (page TaskListPage) Values() []Task { } // Creates a new instance of the TaskListPage type. -func NewTaskListPage(getNextPage func(context.Context, TaskList) (TaskList, error)) TaskListPage { - return TaskListPage{fn: getNextPage} +func NewTaskListPage(cur TaskList, getNextPage func(context.Context, TaskList) (TaskList, error)) TaskListPage { + return TaskListPage{ + fn: getNextPage, + tl: cur, + } } -// TaskParameters changing set of properties, depending on the task type that is derived from the name field +// TaskParameters changing set of properties, depending on the task type that is derived from the name +// field type TaskParameters struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` @@ -17710,7 +18944,7 @@ type ThresholdCustomAlertRule struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } func unmarshalBasicThresholdCustomAlertRule(body []byte) (BasicThresholdCustomAlertRule, error) { @@ -18021,7 +19255,7 @@ type TimeWindowCustomAlertRule struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } func unmarshalBasicTimeWindowCustomAlertRule(body []byte) (BasicTimeWindowCustomAlertRule, error) { @@ -18445,8 +19679,11 @@ func (page TopologyListPage) Values() []TopologyResource { } // Creates a new instance of the TopologyListPage type. -func NewTopologyListPage(getNextPage func(context.Context, TopologyList) (TopologyList, error)) TopologyListPage { - return TopologyListPage{fn: getNextPage} +func NewTopologyListPage(cur TopologyList, getNextPage func(context.Context, TopologyList) (TopologyList, error)) TopologyListPage { + return TopologyListPage{ + fn: getNextPage, + tl: cur, + } } // TopologyResource ... @@ -18621,7 +19858,7 @@ type TwinUpdatesNotInAllowedRange struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } // MarshalJSON is the custom marshaler for TwinUpdatesNotInAllowedRange. @@ -18811,7 +20048,7 @@ type UnauthorizedOperationsNotInAllowedRange struct { // IsEnabled - Status of the custom alert. IsEnabled *bool `json:"isEnabled,omitempty"` // RuleType - Possible values include: 'RuleTypeCustomAlertRule', 'RuleTypeThresholdCustomAlertRule', 'RuleTypeTimeWindowCustomAlertRule', 'RuleTypeAllowlistCustomAlertRule', 'RuleTypeDenylistCustomAlertRule', 'RuleTypeListCustomAlertRule', 'RuleTypeConnectionToIPNotAllowed', 'RuleTypeLocalUserNotAllowed', 'RuleTypeProcessNotAllowed', 'RuleTypeActiveConnectionsNotInAllowedRange', 'RuleTypeAmqpC2DMessagesNotInAllowedRange', 'RuleTypeMqttC2DMessagesNotInAllowedRange', 'RuleTypeHTTPC2DMessagesNotInAllowedRange', 'RuleTypeAmqpC2DRejectedMessagesNotInAllowedRange', 'RuleTypeMqttC2DRejectedMessagesNotInAllowedRange', 'RuleTypeHTTPC2DRejectedMessagesNotInAllowedRange', 'RuleTypeAmqpD2CMessagesNotInAllowedRange', 'RuleTypeMqttD2CMessagesNotInAllowedRange', 'RuleTypeHTTPD2CMessagesNotInAllowedRange', 'RuleTypeDirectMethodInvokesNotInAllowedRange', 'RuleTypeFailedLocalLoginsNotInAllowedRange', 'RuleTypeFileUploadsNotInAllowedRange', 'RuleTypeQueuePurgesNotInAllowedRange', 'RuleTypeTwinUpdatesNotInAllowedRange', 'RuleTypeUnauthorizedOperationsNotInAllowedRange' - RuleType RuleType `json:"ruleType,omitempty"` + RuleType RuleTypeBasicCustomAlertRule `json:"ruleType,omitempty"` } // MarshalJSON is the custom marshaler for UnauthorizedOperationsNotInAllowedRange. @@ -19061,6 +20298,27 @@ type UserRecommendation struct { RecommendationAction RecommendationAction1 `json:"recommendationAction,omitempty"` } +// VaRule vulnerability assessment rule metadata details. +type VaRule struct { + // RuleID - The rule Id. + RuleID *string `json:"ruleId,omitempty"` + // Severity - Possible values include: 'RuleSeverityHigh', 'RuleSeverityMedium', 'RuleSeverityLow', 'RuleSeverityInformational', 'RuleSeverityObsolete' + Severity RuleSeverity `json:"severity,omitempty"` + // Category - The rule category. + Category *string `json:"category,omitempty"` + // RuleType - Possible values include: 'Binary', 'BaselineExpected', 'PositiveList', 'NegativeList' + RuleType RuleType `json:"ruleType,omitempty"` + // Title - The rule title. + Title *string `json:"title,omitempty"` + // Description - The rule description. + Description *string `json:"description,omitempty"` + // Rationale - The rule rationale. + Rationale *string `json:"rationale,omitempty"` + QueryCheck *QueryCheck `json:"queryCheck,omitempty"` + // BenchmarkReferences - The benchmark references. + BenchmarkReferences *[]BenchmarkReference `json:"benchmarkReferences,omitempty"` +} + // VendorReference vendor reference type VendorReference struct { // Title - READ-ONLY; Link title @@ -19314,8 +20572,11 @@ func (page WorkspaceSettingListPage) Values() []WorkspaceSetting { } // Creates a new instance of the WorkspaceSettingListPage type. -func NewWorkspaceSettingListPage(getNextPage func(context.Context, WorkspaceSettingList) (WorkspaceSettingList, error)) WorkspaceSettingListPage { - return WorkspaceSettingListPage{fn: getNextPage} +func NewWorkspaceSettingListPage(cur WorkspaceSettingList, getNextPage func(context.Context, WorkspaceSettingList) (WorkspaceSettingList, error)) WorkspaceSettingListPage { + return WorkspaceSettingListPage{ + fn: getNextPage, + wsl: cur, + } } // WorkspaceSettingProperties workspace setting data diff --git a/services/preview/security/mgmt/v3.0/security/securescorecontroldefinitions.go b/services/preview/security/mgmt/v3.0/security/securescorecontroldefinitions.go index ec41c4bb8a07..dcad4fa4af0d 100644 --- a/services/preview/security/mgmt/v3.0/security/securescorecontroldefinitions.go +++ b/services/preview/security/mgmt/v3.0/security/securescorecontroldefinitions.go @@ -82,7 +82,7 @@ func (client SecureScoreControlDefinitionsClient) List(ctx context.Context) (res // ListPreparer prepares the List request. func (client SecureScoreControlDefinitionsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2020-01-01-preview" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -200,7 +200,7 @@ func (client SecureScoreControlDefinitionsClient) ListBySubscriptionPreparer(ctx "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01-preview" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/security/mgmt/v3.0/security/securescorecontrols.go b/services/preview/security/mgmt/v3.0/security/securescorecontrols.go index 5b1ccb5acd6e..2c3d9aa33a68 100644 --- a/services/preview/security/mgmt/v3.0/security/securescorecontrols.go +++ b/services/preview/security/mgmt/v3.0/security/securescorecontrols.go @@ -94,7 +94,7 @@ func (client SecureScoreControlsClient) ListPreparer(ctx context.Context, expand "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01-preview" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -219,7 +219,7 @@ func (client SecureScoreControlsClient) ListBySecureScorePreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01-preview" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/security/mgmt/v3.0/security/securescores.go b/services/preview/security/mgmt/v3.0/security/securescores.go index 1b2511acfa6a..eb5848e0065a 100644 --- a/services/preview/security/mgmt/v3.0/security/securescores.go +++ b/services/preview/security/mgmt/v3.0/security/securescores.go @@ -92,7 +92,7 @@ func (client SecureScoresClient) GetPreparer(ctx context.Context, secureScoreNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01-preview" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -172,7 +172,7 @@ func (client SecureScoresClient) ListPreparer(ctx context.Context) (*http.Reques "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2020-01-01-preview" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go b/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go index f088bd0a321a..fee9eda6d0e1 100644 --- a/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go +++ b/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go @@ -114,7 +114,9 @@ var _ IotSecuritySolutionsAnalyticsRecommendationClientAPI = (*security.IotSecur // IotAlertTypesClientAPI contains the set of methods on the IotAlertTypesClient type. type IotAlertTypesClientAPI interface { Get(ctx context.Context, resourceGroupName string, solutionName string, iotAlertTypeName string) (result security.IotAlertType, err error) + Get1(ctx context.Context, iotAlertTypeName string) (result security.IotAlertType, err error) List(ctx context.Context, resourceGroupName string, solutionName string) (result security.IotAlertTypeList, err error) + List1(ctx context.Context) (result security.IotAlertTypeList, err error) } var _ IotAlertTypesClientAPI = (*security.IotAlertTypesClient)(nil) @@ -122,8 +124,11 @@ var _ IotAlertTypesClientAPI = (*security.IotAlertTypesClient)(nil) // IotAlertsClientAPI contains the set of methods on the IotAlertsClient type. type IotAlertsClientAPI interface { Get(ctx context.Context, resourceGroupName string, solutionName string, iotAlertID string) (result security.IotAlert, err error) + Get1(ctx context.Context, scope string, iotAlertID string) (result security.IotAlertModel, err error) List(ctx context.Context, resourceGroupName string, solutionName string, minStartTimeUtc string, maxStartTimeUtc string, alertType string, compromisedEntity string, limit *int32, skipToken string) (result security.IotAlertListPage, err error) ListComplete(ctx context.Context, resourceGroupName string, solutionName string, minStartTimeUtc string, maxStartTimeUtc string, alertType string, compromisedEntity string, limit *int32, skipToken string) (result security.IotAlertListIterator, err error) + List1(ctx context.Context, scope string, minStartTimeUtc string, maxStartTimeUtc string, alertType string, deviceManagementType security.ManagementState, compromisedEntity string, limit *int32, skipToken string) (result security.IotAlertListModelPage, err error) + List1Complete(ctx context.Context, scope string, minStartTimeUtc string, maxStartTimeUtc string, alertType string, deviceManagementType security.ManagementState, compromisedEntity string, limit *int32, skipToken string) (result security.IotAlertListModelIterator, err error) } var _ IotAlertsClientAPI = (*security.IotAlertsClient)(nil) @@ -131,7 +136,9 @@ var _ IotAlertsClientAPI = (*security.IotAlertsClient)(nil) // IotRecommendationTypesClientAPI contains the set of methods on the IotRecommendationTypesClient type. type IotRecommendationTypesClientAPI interface { Get(ctx context.Context, resourceGroupName string, solutionName string, iotRecommendationTypeName string) (result security.IotRecommendationType, err error) + Get1(ctx context.Context, iotRecommendationTypeName string) (result security.IotRecommendationType, err error) List(ctx context.Context, resourceGroupName string, solutionName string) (result security.IotRecommendationTypeList, err error) + List1(ctx context.Context) (result security.IotRecommendationTypeList, err error) } var _ IotRecommendationTypesClientAPI = (*security.IotRecommendationTypesClient)(nil) @@ -139,8 +146,11 @@ var _ IotRecommendationTypesClientAPI = (*security.IotRecommendationTypesClient) // IotRecommendationsClientAPI contains the set of methods on the IotRecommendationsClient type. type IotRecommendationsClientAPI interface { Get(ctx context.Context, resourceGroupName string, solutionName string, iotRecommendationID string) (result security.IotRecommendation, err error) + Get1(ctx context.Context, scope string, iotRecommendationID string) (result security.IotRecommendationModel, err error) List(ctx context.Context, resourceGroupName string, solutionName string, recommendationType string, deviceID string, limit *int32, skipToken string) (result security.IotRecommendationListPage, err error) ListComplete(ctx context.Context, resourceGroupName string, solutionName string, recommendationType string, deviceID string, limit *int32, skipToken string) (result security.IotRecommendationListIterator, err error) + List1(ctx context.Context, scope string, recommendationType string, deviceID string, limit *int32, skipToken string) (result security.IotRecommendationListModelPage, err error) + List1Complete(ctx context.Context, scope string, recommendationType string, deviceID string, limit *int32, skipToken string) (result security.IotRecommendationListModelIterator, err error) } var _ IotRecommendationsClientAPI = (*security.IotRecommendationsClient)(nil) @@ -373,21 +383,21 @@ var _ TopologyClientAPI = (*security.TopologyClient)(nil) // AlertsClientAPI contains the set of methods on the AlertsClient type. type AlertsClientAPI interface { - GetResourceGroupLevel(ctx context.Context, alertName string, resourceGroupName string) (result security.Alert, err error) - GetSubscriptionLevel(ctx context.Context, alertName string) (result security.Alert, err error) + GetResourceGroupLevelAlerts(ctx context.Context, alertName string, resourceGroupName string) (result security.Alert, err error) + GetSubscriptionLevelAlert(ctx context.Context, alertName string) (result security.Alert, err error) List(ctx context.Context) (result security.AlertListPage, err error) ListComplete(ctx context.Context) (result security.AlertListIterator, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result security.AlertListPage, err error) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result security.AlertListIterator, err error) - ListResourceGroupLevelByRegion(ctx context.Context, resourceGroupName string) (result security.AlertListPage, err error) - ListResourceGroupLevelByRegionComplete(ctx context.Context, resourceGroupName string) (result security.AlertListIterator, err error) - ListSubscriptionLevelByRegion(ctx context.Context) (result security.AlertListPage, err error) - ListSubscriptionLevelByRegionComplete(ctx context.Context) (result security.AlertListIterator, err error) - UpdateResourceGroupLevelStateToActivate(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) - UpdateResourceGroupLevelStateToDismiss(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) + ListResourceGroupLevelAlertsByRegion(ctx context.Context, resourceGroupName string) (result security.AlertListPage, err error) + ListResourceGroupLevelAlertsByRegionComplete(ctx context.Context, resourceGroupName string) (result security.AlertListIterator, err error) + ListSubscriptionLevelAlertsByRegion(ctx context.Context) (result security.AlertListPage, err error) + ListSubscriptionLevelAlertsByRegionComplete(ctx context.Context) (result security.AlertListIterator, err error) + UpdateResourceGroupLevelAlertStateToDismiss(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) + UpdateResourceGroupLevelAlertStateToReactivate(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) UpdateResourceGroupLevelStateToResolve(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) - UpdateSubscriptionLevelStateToActivate(ctx context.Context, alertName string) (result autorest.Response, err error) - UpdateSubscriptionLevelStateToDismiss(ctx context.Context, alertName string) (result autorest.Response, err error) + UpdateSubscriptionLevelAlertStateToDismiss(ctx context.Context, alertName string) (result autorest.Response, err error) + UpdateSubscriptionLevelAlertStateToReactivate(ctx context.Context, alertName string) (result autorest.Response, err error) UpdateSubscriptionLevelStateToResolve(ctx context.Context, alertName string) (result autorest.Response, err error) } @@ -490,6 +500,33 @@ type ConnectorsClientAPI interface { var _ ConnectorsClientAPI = (*security.ConnectorsClient)(nil) +// SQLVulnerabilityAssessmentScansClientAPI contains the set of methods on the SQLVulnerabilityAssessmentScansClient type. +type SQLVulnerabilityAssessmentScansClientAPI interface { + Get(ctx context.Context, scanID string, workspaceID string, APIVersion string, resourceID string) (result security.Scan, err error) + List(ctx context.Context, workspaceID string, APIVersion string, resourceID string) (result security.Scans, err error) +} + +var _ SQLVulnerabilityAssessmentScansClientAPI = (*security.SQLVulnerabilityAssessmentScansClient)(nil) + +// SQLVulnerabilityAssessmentScanResultsClientAPI contains the set of methods on the SQLVulnerabilityAssessmentScanResultsClient type. +type SQLVulnerabilityAssessmentScanResultsClientAPI interface { + Get(ctx context.Context, scanID string, scanResultID string, workspaceID string, APIVersion string, resourceID string) (result security.ScanResult, err error) + List(ctx context.Context, scanID string, workspaceID string, APIVersion string, resourceID string) (result security.ScanResults, err error) +} + +var _ SQLVulnerabilityAssessmentScanResultsClientAPI = (*security.SQLVulnerabilityAssessmentScanResultsClient)(nil) + +// SQLVulnerabilityAssessmentBaselineRulesClientAPI contains the set of methods on the SQLVulnerabilityAssessmentBaselineRulesClient type. +type SQLVulnerabilityAssessmentBaselineRulesClientAPI interface { + Add(ctx context.Context, workspaceID string, APIVersion string, resourceID string, body *security.RulesResultsInput) (result security.RulesResults, err error) + CreateOrUpdate(ctx context.Context, ruleID string, workspaceID string, APIVersion string, resourceID string, body *security.RuleResultsInput) (result security.RuleResults, err error) + Delete(ctx context.Context, ruleID string, workspaceID string, APIVersion string, resourceID string) (result autorest.Response, err error) + Get(ctx context.Context, ruleID string, workspaceID string, APIVersion string, resourceID string) (result security.RuleResults, err error) + List(ctx context.Context, workspaceID string, APIVersion string, resourceID string) (result security.RulesResults, err error) +} + +var _ SQLVulnerabilityAssessmentBaselineRulesClientAPI = (*security.SQLVulnerabilityAssessmentBaselineRulesClient)(nil) + // IotDefenderSettingsClientAPI contains the set of methods on the IotDefenderSettingsClient type. type IotDefenderSettingsClientAPI interface { CreateOrUpdate(ctx context.Context, iotDefenderSettingsModel security.IotDefenderSettingsModel) (result security.IotDefenderSettingsModel, err error) @@ -512,6 +549,29 @@ type IotSensorsClientAPI interface { var _ IotSensorsClientAPI = (*security.IotSensorsClient)(nil) +// DevicesForSubscriptionClientAPI contains the set of methods on the DevicesForSubscriptionClient type. +type DevicesForSubscriptionClientAPI interface { + List(ctx context.Context, limit *int32, skipToken string, deviceManagementType security.ManagementState) (result security.DeviceListPage, err error) + ListComplete(ctx context.Context, limit *int32, skipToken string, deviceManagementType security.ManagementState) (result security.DeviceListIterator, err error) +} + +var _ DevicesForSubscriptionClientAPI = (*security.DevicesForSubscriptionClient)(nil) + +// DevicesForHubClientAPI contains the set of methods on the DevicesForHubClient type. +type DevicesForHubClientAPI interface { + List(ctx context.Context, resourceID string, limit *int32, skipToken string, deviceManagementType security.ManagementState) (result security.DeviceListPage, err error) + ListComplete(ctx context.Context, resourceID string, limit *int32, skipToken string, deviceManagementType security.ManagementState) (result security.DeviceListIterator, err error) +} + +var _ DevicesForHubClientAPI = (*security.DevicesForHubClient)(nil) + +// DeviceClientAPI contains the set of methods on the DeviceClient type. +type DeviceClientAPI interface { + Get(ctx context.Context, resourceID string, deviceID string) (result security.Device, err error) +} + +var _ DeviceClientAPI = (*security.DeviceClient)(nil) + // OnPremiseIotSensorsClientAPI contains the set of methods on the OnPremiseIotSensorsClient type. type OnPremiseIotSensorsClientAPI interface { CreateOrUpdate(ctx context.Context, onPremiseIotSensorName string) (result security.OnPremiseIotSensor, err error) diff --git a/services/preview/security/mgmt/v3.0/security/sqlvulnerabilityassessmentbaselinerules.go b/services/preview/security/mgmt/v3.0/security/sqlvulnerabilityassessmentbaselinerules.go new file mode 100644 index 000000000000..4d5d80df050e --- /dev/null +++ b/services/preview/security/mgmt/v3.0/security/sqlvulnerabilityassessmentbaselinerules.go @@ -0,0 +1,432 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SQLVulnerabilityAssessmentBaselineRulesClient is the API spec for Microsoft.Security (Azure Security Center) +// resource provider +type SQLVulnerabilityAssessmentBaselineRulesClient struct { + BaseClient +} + +// NewSQLVulnerabilityAssessmentBaselineRulesClient creates an instance of the +// SQLVulnerabilityAssessmentBaselineRulesClient client. +func NewSQLVulnerabilityAssessmentBaselineRulesClient(subscriptionID string, ascLocation string) SQLVulnerabilityAssessmentBaselineRulesClient { + return NewSQLVulnerabilityAssessmentBaselineRulesClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewSQLVulnerabilityAssessmentBaselineRulesClientWithBaseURI creates an instance of the +// SQLVulnerabilityAssessmentBaselineRulesClient client using a custom endpoint. Use this when interacting with an +// Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewSQLVulnerabilityAssessmentBaselineRulesClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SQLVulnerabilityAssessmentBaselineRulesClient { + return SQLVulnerabilityAssessmentBaselineRulesClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// Add sends the add request. +// Parameters: +// workspaceID - the workspace Id. +// APIVersion - the api version. +// resourceID - the identifier of the resource. +// body - the baseline rules. +func (client SQLVulnerabilityAssessmentBaselineRulesClient) Add(ctx context.Context, workspaceID string, APIVersion string, resourceID string, body *RulesResultsInput) (result RulesResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLVulnerabilityAssessmentBaselineRulesClient.Add") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AddPreparer(ctx, workspaceID, APIVersion, resourceID, body) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentBaselineRulesClient", "Add", nil, "Failure preparing request") + return + } + + resp, err := client.AddSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentBaselineRulesClient", "Add", resp, "Failure sending request") + return + } + + result, err = client.AddResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentBaselineRulesClient", "Add", resp, "Failure responding to request") + } + + return +} + +// AddPreparer prepares the Add request. +func (client SQLVulnerabilityAssessmentBaselineRulesClient) AddPreparer(ctx context.Context, workspaceID string, APIVersion string, resourceID string, body *RulesResultsInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceId": resourceID, + } + + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "workspaceId": autorest.Encode("query", workspaceID), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if body != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(body)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddSender sends the Add request. The method will close the +// http.Response Body if it receives an error. +func (client SQLVulnerabilityAssessmentBaselineRulesClient) AddSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// AddResponder handles the response to the Add request. The method always +// closes the http.Response Body. +func (client SQLVulnerabilityAssessmentBaselineRulesClient) AddResponder(resp *http.Response) (result RulesResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdate sends the create or update request. +// Parameters: +// ruleID - the rule Id. +// workspaceID - the workspace Id. +// APIVersion - the api version. +// resourceID - the identifier of the resource. +// body - the baseline results for this rule. +func (client SQLVulnerabilityAssessmentBaselineRulesClient) CreateOrUpdate(ctx context.Context, ruleID string, workspaceID string, APIVersion string, resourceID string, body *RuleResultsInput) (result RuleResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLVulnerabilityAssessmentBaselineRulesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, ruleID, workspaceID, APIVersion, resourceID, body) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentBaselineRulesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentBaselineRulesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentBaselineRulesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SQLVulnerabilityAssessmentBaselineRulesClient) CreateOrUpdatePreparer(ctx context.Context, ruleID string, workspaceID string, APIVersion string, resourceID string, body *RuleResultsInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceId": resourceID, + "ruleId": autorest.Encode("path", ruleID), + } + + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "workspaceId": autorest.Encode("query", workspaceID), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if body != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(body)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client SQLVulnerabilityAssessmentBaselineRulesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client SQLVulnerabilityAssessmentBaselineRulesClient) CreateOrUpdateResponder(resp *http.Response) (result RuleResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete sends the delete request. +// Parameters: +// ruleID - the rule Id. +// workspaceID - the workspace Id. +// APIVersion - the api version. +// resourceID - the identifier of the resource. +func (client SQLVulnerabilityAssessmentBaselineRulesClient) Delete(ctx context.Context, ruleID string, workspaceID string, APIVersion string, resourceID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLVulnerabilityAssessmentBaselineRulesClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, ruleID, workspaceID, APIVersion, resourceID) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentBaselineRulesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentBaselineRulesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentBaselineRulesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SQLVulnerabilityAssessmentBaselineRulesClient) DeletePreparer(ctx context.Context, ruleID string, workspaceID string, APIVersion string, resourceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceId": resourceID, + "ruleId": autorest.Encode("path", ruleID), + } + + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "workspaceId": autorest.Encode("query", workspaceID), + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SQLVulnerabilityAssessmentBaselineRulesClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SQLVulnerabilityAssessmentBaselineRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get sends the get request. +// Parameters: +// ruleID - the rule Id. +// workspaceID - the workspace Id. +// APIVersion - the api version. +// resourceID - the identifier of the resource. +func (client SQLVulnerabilityAssessmentBaselineRulesClient) Get(ctx context.Context, ruleID string, workspaceID string, APIVersion string, resourceID string) (result RuleResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLVulnerabilityAssessmentBaselineRulesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, ruleID, workspaceID, APIVersion, resourceID) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentBaselineRulesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentBaselineRulesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentBaselineRulesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SQLVulnerabilityAssessmentBaselineRulesClient) GetPreparer(ctx context.Context, ruleID string, workspaceID string, APIVersion string, resourceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceId": resourceID, + "ruleId": autorest.Encode("path", ruleID), + } + + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "workspaceId": autorest.Encode("query", workspaceID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules/{ruleId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SQLVulnerabilityAssessmentBaselineRulesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SQLVulnerabilityAssessmentBaselineRulesClient) GetResponder(resp *http.Response) (result RuleResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List sends the list request. +// Parameters: +// workspaceID - the workspace Id. +// APIVersion - the api version. +// resourceID - the identifier of the resource. +func (client SQLVulnerabilityAssessmentBaselineRulesClient) List(ctx context.Context, workspaceID string, APIVersion string, resourceID string) (result RulesResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLVulnerabilityAssessmentBaselineRulesClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, workspaceID, APIVersion, resourceID) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentBaselineRulesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentBaselineRulesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentBaselineRulesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SQLVulnerabilityAssessmentBaselineRulesClient) ListPreparer(ctx context.Context, workspaceID string, APIVersion string, resourceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceId": resourceID, + } + + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "workspaceId": autorest.Encode("query", workspaceID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/baselineRules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SQLVulnerabilityAssessmentBaselineRulesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SQLVulnerabilityAssessmentBaselineRulesClient) ListResponder(resp *http.Response) (result RulesResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/security/mgmt/v3.0/security/sqlvulnerabilityassessmentscanresults.go b/services/preview/security/mgmt/v3.0/security/sqlvulnerabilityassessmentscanresults.go new file mode 100644 index 000000000000..a0d9caa08ef9 --- /dev/null +++ b/services/preview/security/mgmt/v3.0/security/sqlvulnerabilityassessmentscanresults.go @@ -0,0 +1,199 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SQLVulnerabilityAssessmentScanResultsClient is the API spec for Microsoft.Security (Azure Security Center) resource +// provider +type SQLVulnerabilityAssessmentScanResultsClient struct { + BaseClient +} + +// NewSQLVulnerabilityAssessmentScanResultsClient creates an instance of the +// SQLVulnerabilityAssessmentScanResultsClient client. +func NewSQLVulnerabilityAssessmentScanResultsClient(subscriptionID string, ascLocation string) SQLVulnerabilityAssessmentScanResultsClient { + return NewSQLVulnerabilityAssessmentScanResultsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewSQLVulnerabilityAssessmentScanResultsClientWithBaseURI creates an instance of the +// SQLVulnerabilityAssessmentScanResultsClient client using a custom endpoint. Use this when interacting with an Azure +// cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewSQLVulnerabilityAssessmentScanResultsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SQLVulnerabilityAssessmentScanResultsClient { + return SQLVulnerabilityAssessmentScanResultsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// Get sends the get request. +// Parameters: +// 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. +// APIVersion - the api version. +// resourceID - the identifier of the resource. +func (client SQLVulnerabilityAssessmentScanResultsClient) Get(ctx context.Context, scanID string, scanResultID string, workspaceID string, APIVersion string, resourceID string) (result ScanResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLVulnerabilityAssessmentScanResultsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, scanID, scanResultID, workspaceID, APIVersion, resourceID) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentScanResultsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentScanResultsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentScanResultsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SQLVulnerabilityAssessmentScanResultsClient) GetPreparer(ctx context.Context, scanID string, scanResultID string, workspaceID string, APIVersion string, resourceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceId": resourceID, + "scanId": autorest.Encode("path", scanID), + "scanResultId": autorest.Encode("path", scanResultID), + } + + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "workspaceId": autorest.Encode("query", workspaceID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults/{scanResultId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SQLVulnerabilityAssessmentScanResultsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SQLVulnerabilityAssessmentScanResultsClient) GetResponder(resp *http.Response) (result ScanResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List sends the list request. +// Parameters: +// scanID - the scan Id. Type 'latest' to get the scan results for the latest scan. +// workspaceID - the workspace Id. +// APIVersion - the api version. +// resourceID - the identifier of the resource. +func (client SQLVulnerabilityAssessmentScanResultsClient) List(ctx context.Context, scanID string, workspaceID string, APIVersion string, resourceID string) (result ScanResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLVulnerabilityAssessmentScanResultsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, scanID, workspaceID, APIVersion, resourceID) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentScanResultsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentScanResultsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentScanResultsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SQLVulnerabilityAssessmentScanResultsClient) ListPreparer(ctx context.Context, scanID string, workspaceID string, APIVersion string, resourceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceId": resourceID, + "scanId": autorest.Encode("path", scanID), + } + + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "workspaceId": autorest.Encode("query", workspaceID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}/scanResults", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SQLVulnerabilityAssessmentScanResultsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SQLVulnerabilityAssessmentScanResultsClient) ListResponder(resp *http.Response) (result ScanResults, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/security/mgmt/v3.0/security/sqlvulnerabilityassessmentscans.go b/services/preview/security/mgmt/v3.0/security/sqlvulnerabilityassessmentscans.go new file mode 100644 index 000000000000..417f3081f74c --- /dev/null +++ b/services/preview/security/mgmt/v3.0/security/sqlvulnerabilityassessmentscans.go @@ -0,0 +1,194 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SQLVulnerabilityAssessmentScansClient is the API spec for Microsoft.Security (Azure Security Center) resource +// provider +type SQLVulnerabilityAssessmentScansClient struct { + BaseClient +} + +// NewSQLVulnerabilityAssessmentScansClient creates an instance of the SQLVulnerabilityAssessmentScansClient client. +func NewSQLVulnerabilityAssessmentScansClient(subscriptionID string, ascLocation string) SQLVulnerabilityAssessmentScansClient { + return NewSQLVulnerabilityAssessmentScansClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewSQLVulnerabilityAssessmentScansClientWithBaseURI creates an instance of the SQLVulnerabilityAssessmentScansClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewSQLVulnerabilityAssessmentScansClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SQLVulnerabilityAssessmentScansClient { + return SQLVulnerabilityAssessmentScansClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// Get sends the get request. +// Parameters: +// scanID - the scan Id. Type 'latest' to get the scan record for the latest scan. +// workspaceID - the workspace Id. +// APIVersion - the api version. +// resourceID - the identifier of the resource. +func (client SQLVulnerabilityAssessmentScansClient) Get(ctx context.Context, scanID string, workspaceID string, APIVersion string, resourceID string) (result Scan, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLVulnerabilityAssessmentScansClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, scanID, workspaceID, APIVersion, resourceID) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentScansClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentScansClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentScansClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SQLVulnerabilityAssessmentScansClient) GetPreparer(ctx context.Context, scanID string, workspaceID string, APIVersion string, resourceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceId": resourceID, + "scanId": autorest.Encode("path", scanID), + } + + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "workspaceId": autorest.Encode("query", workspaceID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans/{scanId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SQLVulnerabilityAssessmentScansClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SQLVulnerabilityAssessmentScansClient) GetResponder(resp *http.Response) (result Scan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List sends the list request. +// Parameters: +// workspaceID - the workspace Id. +// APIVersion - the api version. +// resourceID - the identifier of the resource. +func (client SQLVulnerabilityAssessmentScansClient) List(ctx context.Context, workspaceID string, APIVersion string, resourceID string) (result Scans, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLVulnerabilityAssessmentScansClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, workspaceID, APIVersion, resourceID) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentScansClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentScansClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SQLVulnerabilityAssessmentScansClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SQLVulnerabilityAssessmentScansClient) ListPreparer(ctx context.Context, workspaceID string, APIVersion string, resourceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceId": resourceID, + } + + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "workspaceId": autorest.Encode("query", workspaceID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/{resourceId}/providers/Microsoft.Security/sqlVulnerabilityAssessments/default/scans", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SQLVulnerabilityAssessmentScansClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SQLVulnerabilityAssessmentScansClient) ListResponder(resp *http.Response) (result Scans, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +}