From 6e151ff1b167e464b9f0549f3e4c7f90d3904cbf Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Fri, 28 Feb 2020 02:33:10 +0000 Subject: [PATCH] Generated from d9d0078a69cbd2a20067beaff0df3ae38481d833 added 202 Accepted when performing delete in the background --- .../security/adaptiveapplicationcontrols.go | 89 +++- .../v3.0/security/advancedthreatprotection.go | 10 +- .../security/mgmt/v3.0/security/alerts.go | 30 +- .../mgmt/v3.0/security/allowedconnections.go | 9 +- .../mgmt/v3.0/security/assessments.go | 31 +- .../mgmt/v3.0/security/assessmentsmetadata.go | 377 +++++++++++++++- .../assessmentsmetadatasubscription.go | 410 ------------------ .../mgmt/v3.0/security/automations.go | 18 +- .../v3.0/security/autoprovisioningsettings.go | 9 +- .../mgmt/v3.0/security/complianceresults.go | 6 +- .../mgmt/v3.0/security/compliances.go | 6 +- .../security/mgmt/v3.0/security/contacts.go | 15 +- .../v3.0/security/devicesecuritygroups.go | 12 +- .../security/discoveredsecuritysolutions.go | 9 +- .../security/externalsecuritysolutions.go | 9 +- .../security/informationprotectionpolicies.go | 9 +- .../mgmt/v3.0/security/iotsecuritysolution.go | 18 +- .../security/iotsecuritysolutionanalytics.go | 6 +- ...curitysolutionsanalyticsaggregatedalert.go | 9 +- ...ecuritysolutionsanalyticsrecommendation.go | 6 +- .../v3.0/security/jitnetworkaccesspolicies.go | 24 +- .../security/mgmt/v3.0/security/locations.go | 6 +- .../security/mgmt/v3.0/security/models.go | 76 +++- .../security/mgmt/v3.0/security/operations.go | 3 +- .../security/mgmt/v3.0/security/pricings.go | 9 +- .../regulatorycomplianceassessments.go | 6 +- .../security/regulatorycompliancecontrols.go | 6 +- .../security/regulatorycompliancestandards.go | 6 +- .../v3.0/security/securityapi/interfaces.go | 33 +- .../security/servervulnerabilityassessment.go | 12 +- .../security/mgmt/v3.0/security/settings.go | 9 +- .../mgmt/v3.0/security/subassessments.go | 9 +- .../security/mgmt/v3.0/security/tasks.go | 21 +- .../security/mgmt/v3.0/security/topology.go | 9 +- .../mgmt/v3.0/security/workspacesettings.go | 15 +- 35 files changed, 664 insertions(+), 668 deletions(-) delete mode 100644 services/preview/security/mgmt/v3.0/security/assessmentsmetadatasubscription.go diff --git a/services/preview/security/mgmt/v3.0/security/adaptiveapplicationcontrols.go b/services/preview/security/mgmt/v3.0/security/adaptiveapplicationcontrols.go index 3ac61acc5526..3c6bb4585652 100644 --- a/services/preview/security/mgmt/v3.0/security/adaptiveapplicationcontrols.go +++ b/services/preview/security/mgmt/v3.0/security/adaptiveapplicationcontrols.go @@ -43,6 +43,86 @@ func NewAdaptiveApplicationControlsClientWithBaseURI(baseURI string, subscriptio return AdaptiveApplicationControlsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} } +// Delete delete an application control VM/server group +// Parameters: +// groupName - name of an application control VM/server group +func (client AdaptiveApplicationControlsClient) Delete(ctx context.Context, groupName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveApplicationControlsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.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.AdaptiveApplicationControlsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, groupName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AdaptiveApplicationControlsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AdaptiveApplicationControlsClient) DeletePreparer(ctx context.Context, groupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "ascLocation": autorest.Encode("path", client.AscLocation), + "groupName": autorest.Encode("path", groupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2015-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/locations/{ascLocation}/applicationWhitelistings/{groupName}", 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 AdaptiveApplicationControlsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client AdaptiveApplicationControlsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + // Get gets an application control VM/server group. // Parameters: // groupName - name of an application control VM/server group @@ -108,8 +188,7 @@ func (client AdaptiveApplicationControlsClient) GetPreparer(ctx context.Context, // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client AdaptiveApplicationControlsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -195,8 +274,7 @@ func (client AdaptiveApplicationControlsClient) ListPreparer(ctx context.Context // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client AdaptiveApplicationControlsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always @@ -280,8 +358,7 @@ func (client AdaptiveApplicationControlsClient) PutPreparer(ctx context.Context, // PutSender sends the Put request. The method will close the // http.Response Body if it receives an error. func (client AdaptiveApplicationControlsClient) PutSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // PutResponder handles the response to the Put request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/advancedthreatprotection.go b/services/preview/security/mgmt/v3.0/security/advancedthreatprotection.go index 227375e3f00e..02352fa1862b 100644 --- a/services/preview/security/mgmt/v3.0/security/advancedthreatprotection.go +++ b/services/preview/security/mgmt/v3.0/security/advancedthreatprotection.go @@ -85,7 +85,7 @@ func (client AdvancedThreatProtectionClient) CreatePreparer(ctx context.Context, "settingName": autorest.Encode("path", "current"), } - const APIVersion = "2017-08-01-preview" + const APIVersion = "2019-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -103,8 +103,7 @@ func (client AdvancedThreatProtectionClient) CreatePreparer(ctx context.Context, // CreateSender sends the Create request. The method will close the // http.Response Body if it receives an error. func (client AdvancedThreatProtectionClient) CreateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateResponder handles the response to the Create request. The method always @@ -162,7 +161,7 @@ func (client AdvancedThreatProtectionClient) GetPreparer(ctx context.Context, re "settingName": autorest.Encode("path", "current"), } - const APIVersion = "2017-08-01-preview" + const APIVersion = "2019-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -178,8 +177,7 @@ func (client AdvancedThreatProtectionClient) GetPreparer(ctx context.Context, re // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client AdvancedThreatProtectionClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/alerts.go b/services/preview/security/mgmt/v3.0/security/alerts.go index ab1902b95caf..27c79ff77b33 100644 --- a/services/preview/security/mgmt/v3.0/security/alerts.go +++ b/services/preview/security/mgmt/v3.0/security/alerts.go @@ -114,8 +114,7 @@ func (client AlertsClient) GetResourceGroupLevelAlertsPreparer(ctx context.Conte // GetResourceGroupLevelAlertsSender sends the GetResourceGroupLevelAlerts request. The method will close the // http.Response Body if it receives an error. func (client AlertsClient) GetResourceGroupLevelAlertsSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResourceGroupLevelAlertsResponder handles the response to the GetResourceGroupLevelAlerts request. The method always @@ -196,8 +195,7 @@ func (client AlertsClient) GetSubscriptionLevelAlertPreparer(ctx context.Context // GetSubscriptionLevelAlertSender sends the GetSubscriptionLevelAlert request. The method will close the // http.Response Body if it receives an error. func (client AlertsClient) GetSubscriptionLevelAlertSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetSubscriptionLevelAlertResponder handles the response to the GetSubscriptionLevelAlert request. The method always @@ -288,8 +286,7 @@ func (client AlertsClient) ListPreparer(ctx context.Context, filter string, sele // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client AlertsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always @@ -424,8 +421,7 @@ func (client AlertsClient) ListByResourceGroupPreparer(ctx context.Context, reso // ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the // http.Response Body if it receives an error. func (client AlertsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always @@ -562,8 +558,7 @@ func (client AlertsClient) ListResourceGroupLevelAlertsByRegionPreparer(ctx cont // ListResourceGroupLevelAlertsByRegionSender sends the ListResourceGroupLevelAlertsByRegion request. The method will close the // http.Response Body if it receives an error. func (client AlertsClient) ListResourceGroupLevelAlertsByRegionSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResourceGroupLevelAlertsByRegionResponder handles the response to the ListResourceGroupLevelAlertsByRegion request. The method always @@ -693,8 +688,7 @@ func (client AlertsClient) ListSubscriptionLevelAlertsByRegionPreparer(ctx conte // ListSubscriptionLevelAlertsByRegionSender sends the ListSubscriptionLevelAlertsByRegion request. The method will close the // http.Response Body if it receives an error. func (client AlertsClient) ListSubscriptionLevelAlertsByRegionSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListSubscriptionLevelAlertsByRegionResponder handles the response to the ListSubscriptionLevelAlertsByRegion request. The method always @@ -819,8 +813,7 @@ func (client AlertsClient) UpdateResourceGroupLevelAlertStateToDismissPreparer(c // UpdateResourceGroupLevelAlertStateToDismissSender sends the UpdateResourceGroupLevelAlertStateToDismiss request. The method will close the // http.Response Body if it receives an error. func (client AlertsClient) UpdateResourceGroupLevelAlertStateToDismissSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResourceGroupLevelAlertStateToDismissResponder handles the response to the UpdateResourceGroupLevelAlertStateToDismiss request. The method always @@ -907,8 +900,7 @@ func (client AlertsClient) UpdateResourceGroupLevelAlertStateToReactivatePrepare // UpdateResourceGroupLevelAlertStateToReactivateSender sends the UpdateResourceGroupLevelAlertStateToReactivate request. The method will close the // http.Response Body if it receives an error. func (client AlertsClient) UpdateResourceGroupLevelAlertStateToReactivateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResourceGroupLevelAlertStateToReactivateResponder handles the response to the UpdateResourceGroupLevelAlertStateToReactivate request. The method always @@ -988,8 +980,7 @@ func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismissPreparer(ct // UpdateSubscriptionLevelAlertStateToDismissSender sends the UpdateSubscriptionLevelAlertStateToDismiss request. The method will close the // http.Response Body if it receives an error. func (client AlertsClient) UpdateSubscriptionLevelAlertStateToDismissSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateSubscriptionLevelAlertStateToDismissResponder handles the response to the UpdateSubscriptionLevelAlertStateToDismiss request. The method always @@ -1069,8 +1060,7 @@ func (client AlertsClient) UpdateSubscriptionLevelAlertStateToReactivatePreparer // UpdateSubscriptionLevelAlertStateToReactivateSender sends the UpdateSubscriptionLevelAlertStateToReactivate request. The method will close the // http.Response Body if it receives an error. func (client AlertsClient) UpdateSubscriptionLevelAlertStateToReactivateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateSubscriptionLevelAlertStateToReactivateResponder handles the response to the UpdateSubscriptionLevelAlertStateToReactivate request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/allowedconnections.go b/services/preview/security/mgmt/v3.0/security/allowedconnections.go index c761a4c3ccce..0eeca0685693 100644 --- a/services/preview/security/mgmt/v3.0/security/allowedconnections.go +++ b/services/preview/security/mgmt/v3.0/security/allowedconnections.go @@ -116,8 +116,7 @@ func (client AllowedConnectionsClient) GetPreparer(ctx context.Context, resource // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client AllowedConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -195,8 +194,7 @@ func (client AllowedConnectionsClient) ListPreparer(ctx context.Context) (*http. // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client AllowedConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always @@ -312,8 +310,7 @@ func (client AllowedConnectionsClient) ListByHomeRegionPreparer(ctx context.Cont // ListByHomeRegionSender sends the ListByHomeRegion request. The method will close the // http.Response Body if it receives an error. func (client AllowedConnectionsClient) ListByHomeRegionSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByHomeRegionResponder handles the response to the ListByHomeRegion request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/assessments.go b/services/preview/security/mgmt/v3.0/security/assessments.go index 8743d85a7e85..847c6f1e4e29 100644 --- a/services/preview/security/mgmt/v3.0/security/assessments.go +++ b/services/preview/security/mgmt/v3.0/security/assessments.go @@ -64,6 +64,17 @@ func (client AssessmentsClient) CreateOrUpdate(ctx context.Context, resourceID s Constraints: []validation.Constraint{{Target: "assessment.AssessmentProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "assessment.AssessmentProperties.ResourceDetails", Name: validation.Null, Rule: true, Chain: nil}, {Target: "assessment.AssessmentProperties.Status", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "assessment.AssessmentProperties.Metadata", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "assessment.AssessmentProperties.Metadata.DisplayName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "assessment.AssessmentProperties.Metadata.PartnerData", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "assessment.AssessmentProperties.Metadata.PartnerData.PartnerName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "assessment.AssessmentProperties.Metadata.PartnerData.Secret", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + {Target: "assessment.AssessmentProperties.PartnersData", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "assessment.AssessmentProperties.PartnersData.PartnerName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "assessment.AssessmentProperties.PartnersData.Secret", Name: validation.Null, Rule: true, Chain: nil}, + }}, }}}}}); err != nil { return result, validation.NewError("security.AssessmentsClient", "CreateOrUpdate", err.Error()) } @@ -96,7 +107,7 @@ func (client AssessmentsClient) CreateOrUpdatePreparer(ctx context.Context, reso "resourceId": autorest.Encode("path", resourceID), } - const APIVersion = "2019-01-01-preview" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -114,8 +125,7 @@ func (client AssessmentsClient) CreateOrUpdatePreparer(ctx context.Context, reso // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client AssessmentsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -175,7 +185,7 @@ func (client AssessmentsClient) DeletePreparer(ctx context.Context, resourceID s "resourceId": autorest.Encode("path", resourceID), } - const APIVersion = "2019-01-01-preview" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -191,8 +201,7 @@ func (client AssessmentsClient) DeletePreparer(ctx context.Context, resourceID s // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client AssessmentsClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always @@ -251,7 +260,7 @@ func (client AssessmentsClient) GetPreparer(ctx context.Context, resourceID stri "resourceId": autorest.Encode("path", resourceID), } - const APIVersion = "2019-01-01-preview" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -270,8 +279,7 @@ func (client AssessmentsClient) GetPreparer(ctx context.Context, resourceID stri // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client AssessmentsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -330,7 +338,7 @@ func (client AssessmentsClient) ListPreparer(ctx context.Context, scope string) "scope": autorest.Encode("path", scope), } - const APIVersion = "2019-01-01-preview" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -346,8 +354,7 @@ func (client AssessmentsClient) ListPreparer(ctx context.Context, scope string) // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client AssessmentsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/assessmentsmetadata.go b/services/preview/security/mgmt/v3.0/security/assessmentsmetadata.go index 7cceb0291042..f9f51ef349c1 100644 --- a/services/preview/security/mgmt/v3.0/security/assessmentsmetadata.go +++ b/services/preview/security/mgmt/v3.0/security/assessmentsmetadata.go @@ -21,6 +21,7 @@ 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" ) @@ -42,6 +43,177 @@ func NewAssessmentsMetadataClientWithBaseURI(baseURI string, subscriptionID stri return AssessmentsMetadataClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} } +// CreateInSubscription create metadata information on an assessment type in a specific subscription +// Parameters: +// assessmentMetadataName - the Assessment Key - Unique key for the assessment type +// assessmentMetadata - assessmentMetadata object +func (client AssessmentsMetadataClient) CreateInSubscription(ctx context.Context, assessmentMetadataName string, assessmentMetadata AssessmentMetadata) (result AssessmentMetadata, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataClient.CreateInSubscription") + 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}}}, + {TargetValue: assessmentMetadata, + Constraints: []validation.Constraint{{Target: "assessmentMetadata.AssessmentMetadataProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "assessmentMetadata.AssessmentMetadataProperties.DisplayName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "assessmentMetadata.AssessmentMetadataProperties.PartnerData", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "assessmentMetadata.AssessmentMetadataProperties.PartnerData.PartnerName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "assessmentMetadata.AssessmentMetadataProperties.PartnerData.Secret", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("security.AssessmentsMetadataClient", "CreateInSubscription", err.Error()) + } + + req, err := client.CreateInSubscriptionPreparer(ctx, assessmentMetadataName, assessmentMetadata) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "CreateInSubscription", nil, "Failure preparing request") + return + } + + resp, err := client.CreateInSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "CreateInSubscription", resp, "Failure sending request") + return + } + + result, err = client.CreateInSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "CreateInSubscription", resp, "Failure responding to request") + } + + return +} + +// CreateInSubscriptionPreparer prepares the CreateInSubscription request. +func (client AssessmentsMetadataClient) CreateInSubscriptionPreparer(ctx context.Context, assessmentMetadataName string, assessmentMetadata AssessmentMetadata) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "assessmentMetadataName": autorest.Encode("path", assessmentMetadataName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}", pathParameters), + autorest.WithJSON(assessmentMetadata), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateInSubscriptionSender sends the CreateInSubscription request. The method will close the +// http.Response Body if it receives an error. +func (client AssessmentsMetadataClient) CreateInSubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateInSubscriptionResponder handles the response to the CreateInSubscription request. The method always +// closes the http.Response Body. +func (client AssessmentsMetadataClient) CreateInSubscriptionResponder(resp *http.Response) (result AssessmentMetadata, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteInSubscription delete metadata information on an assessment type in a specific subscription, will cause the +// deletion of all the assessments of that type in that subscription +// Parameters: +// assessmentMetadataName - the Assessment Key - Unique key for the assessment type +func (client AssessmentsMetadataClient) DeleteInSubscription(ctx context.Context, assessmentMetadataName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataClient.DeleteInSubscription") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.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.AssessmentsMetadataClient", "DeleteInSubscription", err.Error()) + } + + req, err := client.DeleteInSubscriptionPreparer(ctx, assessmentMetadataName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "DeleteInSubscription", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteInSubscriptionSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "DeleteInSubscription", resp, "Failure sending request") + return + } + + result, err = client.DeleteInSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "DeleteInSubscription", resp, "Failure responding to request") + } + + return +} + +// DeleteInSubscriptionPreparer prepares the DeleteInSubscription request. +func (client AssessmentsMetadataClient) DeleteInSubscriptionPreparer(ctx context.Context, assessmentMetadataName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "assessmentMetadataName": autorest.Encode("path", assessmentMetadataName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteInSubscriptionSender sends the DeleteInSubscription request. The method will close the +// http.Response Body if it receives an error. +func (client AssessmentsMetadataClient) DeleteInSubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteInSubscriptionResponder handles the response to the DeleteInSubscription request. The method always +// closes the http.Response Body. +func (client AssessmentsMetadataClient) DeleteInSubscriptionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + // Get get metadata information on an assessment type // Parameters: // assessmentMetadataName - the Assessment Key - Unique key for the assessment type @@ -83,7 +255,7 @@ func (client AssessmentsMetadataClient) GetPreparer(ctx context.Context, assessm "assessmentMetadataName": autorest.Encode("path", assessmentMetadataName), } - const APIVersion = "2019-01-01-preview" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -99,8 +271,7 @@ func (client AssessmentsMetadataClient) GetPreparer(ctx context.Context, assessm // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client AssessmentsMetadataClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -116,6 +287,86 @@ func (client AssessmentsMetadataClient) GetResponder(resp *http.Response) (resul return } +// GetInSubscription get metadata information on an assessment type in a specific subscription +// Parameters: +// assessmentMetadataName - the Assessment Key - Unique key for the assessment type +func (client AssessmentsMetadataClient) GetInSubscription(ctx context.Context, assessmentMetadataName string) (result AssessmentMetadata, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataClient.GetInSubscription") + 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.AssessmentsMetadataClient", "GetInSubscription", err.Error()) + } + + req, err := client.GetInSubscriptionPreparer(ctx, assessmentMetadataName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "GetInSubscription", nil, "Failure preparing request") + return + } + + resp, err := client.GetInSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "GetInSubscription", resp, "Failure sending request") + return + } + + result, err = client.GetInSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "GetInSubscription", resp, "Failure responding to request") + } + + return +} + +// GetInSubscriptionPreparer prepares the GetInSubscription request. +func (client AssessmentsMetadataClient) GetInSubscriptionPreparer(ctx context.Context, assessmentMetadataName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "assessmentMetadataName": autorest.Encode("path", assessmentMetadataName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetInSubscriptionSender sends the GetInSubscription request. The method will close the +// http.Response Body if it receives an error. +func (client AssessmentsMetadataClient) GetInSubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetInSubscriptionResponder handles the response to the GetInSubscription request. The method always +// closes the http.Response Body. +func (client AssessmentsMetadataClient) GetInSubscriptionResponder(resp *http.Response) (result AssessmentMetadata, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // List get metadata information on all assessment types func (client AssessmentsMetadataClient) List(ctx context.Context) (result AssessmentMetadataListPage, err error) { if tracing.IsEnabled() { @@ -152,7 +403,7 @@ func (client AssessmentsMetadataClient) List(ctx context.Context) (result Assess // ListPreparer prepares the List request. func (client AssessmentsMetadataClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2019-01-01-preview" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -168,8 +419,7 @@ func (client AssessmentsMetadataClient) ListPreparer(ctx context.Context) (*http // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client AssessmentsMetadataClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always @@ -221,3 +471,118 @@ func (client AssessmentsMetadataClient) ListComplete(ctx context.Context) (resul result.page, err = client.List(ctx) return } + +// ListBySubscription get metadata information on all assessment types in a specific subscription +func (client AssessmentsMetadataClient) ListBySubscription(ctx context.Context) (result AssessmentMetadataListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataClient.ListBySubscription") + defer func() { + sc := -1 + if result.aml.Response.Response != nil { + sc = result.aml.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.AssessmentsMetadataClient", "ListBySubscription", err.Error()) + } + + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.aml.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.aml, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client AssessmentsMetadataClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client AssessmentsMetadataClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client AssessmentsMetadataClient) ListBySubscriptionResponder(resp *http.Response) (result AssessmentMetadataList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client AssessmentsMetadataClient) listBySubscriptionNextResults(ctx context.Context, lastResults AssessmentMetadataList) (result AssessmentMetadataList, err error) { + req, err := lastResults.assessmentMetadataListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client AssessmentsMetadataClient) ListBySubscriptionComplete(ctx context.Context) (result AssessmentMetadataListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataClient.ListBySubscription") + 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.ListBySubscription(ctx) + return +} diff --git a/services/preview/security/mgmt/v3.0/security/assessmentsmetadatasubscription.go b/services/preview/security/mgmt/v3.0/security/assessmentsmetadatasubscription.go deleted file mode 100644 index 9f7b9b2fe377..000000000000 --- a/services/preview/security/mgmt/v3.0/security/assessmentsmetadatasubscription.go +++ /dev/null @@ -1,410 +0,0 @@ -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" -) - -// AssessmentsMetadataSubscriptionClient is the API spec for Microsoft.Security (Azure Security Center) resource -// provider -type AssessmentsMetadataSubscriptionClient struct { - BaseClient -} - -// NewAssessmentsMetadataSubscriptionClient creates an instance of the AssessmentsMetadataSubscriptionClient client. -func NewAssessmentsMetadataSubscriptionClient(subscriptionID string, ascLocation string) AssessmentsMetadataSubscriptionClient { - return NewAssessmentsMetadataSubscriptionClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) -} - -// NewAssessmentsMetadataSubscriptionClientWithBaseURI creates an instance of the AssessmentsMetadataSubscriptionClient -// 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 NewAssessmentsMetadataSubscriptionClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AssessmentsMetadataSubscriptionClient { - return AssessmentsMetadataSubscriptionClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} -} - -// Create create metadata information on an assessment type in a specific subscription -// Parameters: -// assessmentMetadataName - the Assessment Key - Unique key for the assessment type -// assessmentMetadata - assessmentMetadata object -func (client AssessmentsMetadataSubscriptionClient) Create(ctx context.Context, assessmentMetadataName string, assessmentMetadata AssessmentMetadata) (result AssessmentMetadata, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataSubscriptionClient.Create") - 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}}}, - {TargetValue: assessmentMetadata, - Constraints: []validation.Constraint{{Target: "assessmentMetadata.AssessmentMetadataProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "assessmentMetadata.AssessmentMetadataProperties.DisplayName", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { - return result, validation.NewError("security.AssessmentsMetadataSubscriptionClient", "Create", err.Error()) - } - - req, err := client.CreatePreparer(ctx, assessmentMetadataName, assessmentMetadata) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Create", nil, "Failure preparing request") - return - } - - resp, err := client.CreateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Create", resp, "Failure sending request") - return - } - - result, err = client.CreateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Create", resp, "Failure responding to request") - } - - return -} - -// CreatePreparer prepares the Create request. -func (client AssessmentsMetadataSubscriptionClient) CreatePreparer(ctx context.Context, assessmentMetadataName string, assessmentMetadata AssessmentMetadata) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "assessmentMetadataName": autorest.Encode("path", assessmentMetadataName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-01-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}", pathParameters), - autorest.WithJSON(assessmentMetadata), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateSender sends the Create request. The method will close the -// http.Response Body if it receives an error. -func (client AssessmentsMetadataSubscriptionClient) CreateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client AssessmentsMetadataSubscriptionClient) CreateResponder(resp *http.Response) (result AssessmentMetadata, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete delete metadata information on an assessment type in a specific subscription, will cause the deletion of all -// the assessments of that type in that subscription -// Parameters: -// assessmentMetadataName - the Assessment Key - Unique key for the assessment type -func (client AssessmentsMetadataSubscriptionClient) Delete(ctx context.Context, assessmentMetadataName string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataSubscriptionClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.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.AssessmentsMetadataSubscriptionClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, assessmentMetadataName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client AssessmentsMetadataSubscriptionClient) DeletePreparer(ctx context.Context, assessmentMetadataName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "assessmentMetadataName": autorest.Encode("path", assessmentMetadataName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-01-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}", 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 AssessmentsMetadataSubscriptionClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client AssessmentsMetadataSubscriptionClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get get metadata information on an assessment type in a specific subscription -// Parameters: -// assessmentMetadataName - the Assessment Key - Unique key for the assessment type -func (client AssessmentsMetadataSubscriptionClient) Get(ctx context.Context, assessmentMetadataName string) (result AssessmentMetadata, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataSubscriptionClient.Get") - 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.AssessmentsMetadataSubscriptionClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, assessmentMetadataName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "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.AssessmentsMetadataSubscriptionClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client AssessmentsMetadataSubscriptionClient) GetPreparer(ctx context.Context, assessmentMetadataName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "assessmentMetadataName": autorest.Encode("path", assessmentMetadataName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-01-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata/{assessmentMetadataName}", 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 AssessmentsMetadataSubscriptionClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AssessmentsMetadataSubscriptionClient) GetResponder(resp *http.Response) (result AssessmentMetadata, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List get metadata information on all assessment types in a specific subscription -func (client AssessmentsMetadataSubscriptionClient) List(ctx context.Context) (result AssessmentMetadataListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataSubscriptionClient.List") - defer func() { - sc := -1 - if result.aml.Response.Response != nil { - sc = result.aml.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.AssessmentsMetadataSubscriptionClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.aml.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "List", resp, "Failure sending request") - return - } - - result.aml, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client AssessmentsMetadataSubscriptionClient) ListPreparer(ctx context.Context) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2019-01-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/assessmentMetadata", 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 AssessmentsMetadataSubscriptionClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client AssessmentsMetadataSubscriptionClient) ListResponder(resp *http.Response) (result AssessmentMetadataList, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - 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 AssessmentsMetadataSubscriptionClient) listNextResults(ctx context.Context, lastResults AssessmentMetadataList) (result AssessmentMetadataList, err error) { - req, err := lastResults.assessmentMetadataListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "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.AssessmentsMetadataSubscriptionClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AssessmentsMetadataSubscriptionClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AssessmentsMetadataSubscriptionClient) ListComplete(ctx context.Context) (result AssessmentMetadataListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AssessmentsMetadataSubscriptionClient.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) - return -} diff --git a/services/preview/security/mgmt/v3.0/security/automations.go b/services/preview/security/mgmt/v3.0/security/automations.go index 855f8dd218f2..d4e9b1c35bcd 100644 --- a/services/preview/security/mgmt/v3.0/security/automations.go +++ b/services/preview/security/mgmt/v3.0/security/automations.go @@ -117,8 +117,7 @@ func (client AutomationsClient) CreateOrUpdatePreparer(ctx context.Context, reso // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client AutomationsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -205,8 +204,7 @@ func (client AutomationsClient) DeletePreparer(ctx context.Context, resourceGrou // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client AutomationsClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always @@ -292,8 +290,7 @@ func (client AutomationsClient) GetPreparer(ctx context.Context, resourceGroupNa // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client AutomationsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -372,8 +369,7 @@ func (client AutomationsClient) ListPreparer(ctx context.Context) (*http.Request // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client AutomationsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always @@ -497,8 +493,7 @@ func (client AutomationsClient) ListByResourceGroupPreparer(ctx context.Context, // ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the // http.Response Body if it receives an error. func (client AutomationsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always @@ -626,8 +621,7 @@ func (client AutomationsClient) ValidatePreparer(ctx context.Context, resourceGr // ValidateSender sends the Validate request. The method will close the // http.Response Body if it receives an error. func (client AutomationsClient) ValidateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ValidateResponder handles the response to the Validate request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/autoprovisioningsettings.go b/services/preview/security/mgmt/v3.0/security/autoprovisioningsettings.go index 6e3b8c64871e..433630bd659d 100644 --- a/services/preview/security/mgmt/v3.0/security/autoprovisioningsettings.go +++ b/services/preview/security/mgmt/v3.0/security/autoprovisioningsettings.go @@ -110,8 +110,7 @@ func (client AutoProvisioningSettingsClient) CreatePreparer(ctx context.Context, // CreateSender sends the Create request. The method will close the // http.Response Body if it receives an error. func (client AutoProvisioningSettingsClient) CreateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateResponder handles the response to the Create request. The method always @@ -191,8 +190,7 @@ func (client AutoProvisioningSettingsClient) GetPreparer(ctx context.Context, se // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client AutoProvisioningSettingsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -270,8 +268,7 @@ func (client AutoProvisioningSettingsClient) ListPreparer(ctx context.Context) ( // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client AutoProvisioningSettingsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/complianceresults.go b/services/preview/security/mgmt/v3.0/security/complianceresults.go index 273d0cd13578..6142721ad274 100644 --- a/services/preview/security/mgmt/v3.0/security/complianceresults.go +++ b/services/preview/security/mgmt/v3.0/security/complianceresults.go @@ -101,8 +101,7 @@ func (client ComplianceResultsClient) GetPreparer(ctx context.Context, resourceI // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client ComplianceResultsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -177,8 +176,7 @@ func (client ComplianceResultsClient) ListPreparer(ctx context.Context, scope st // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client ComplianceResultsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/compliances.go b/services/preview/security/mgmt/v3.0/security/compliances.go index f7b5b7351067..2f0fa49be6a0 100644 --- a/services/preview/security/mgmt/v3.0/security/compliances.go +++ b/services/preview/security/mgmt/v3.0/security/compliances.go @@ -101,8 +101,7 @@ func (client CompliancesClient) GetPreparer(ctx context.Context, scope string, c // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client CompliancesClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -177,8 +176,7 @@ func (client CompliancesClient) ListPreparer(ctx context.Context, scope string) // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client CompliancesClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/contacts.go b/services/preview/security/mgmt/v3.0/security/contacts.go index abb4374767a9..bbf7b35c4675 100644 --- a/services/preview/security/mgmt/v3.0/security/contacts.go +++ b/services/preview/security/mgmt/v3.0/security/contacts.go @@ -112,8 +112,7 @@ func (client ContactsClient) CreatePreparer(ctx context.Context, securityContact // CreateSender sends the Create request. The method will close the // http.Response Body if it receives an error. func (client ContactsClient) CreateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateResponder handles the response to the Create request. The method always @@ -193,8 +192,7 @@ func (client ContactsClient) DeletePreparer(ctx context.Context, securityContact // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client ContactsClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always @@ -273,8 +271,7 @@ func (client ContactsClient) GetPreparer(ctx context.Context, securityContactNam // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client ContactsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -352,8 +349,7 @@ func (client ContactsClient) ListPreparer(ctx context.Context) (*http.Request, e // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client ContactsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always @@ -473,8 +469,7 @@ func (client ContactsClient) UpdatePreparer(ctx context.Context, securityContact // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client ContactsClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/devicesecuritygroups.go b/services/preview/security/mgmt/v3.0/security/devicesecuritygroups.go index ca98116aa12e..b60d94c6bd9c 100644 --- a/services/preview/security/mgmt/v3.0/security/devicesecuritygroups.go +++ b/services/preview/security/mgmt/v3.0/security/devicesecuritygroups.go @@ -105,8 +105,7 @@ func (client DeviceSecurityGroupsClient) CreateOrUpdatePreparer(ctx context.Cont // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client DeviceSecurityGroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -182,8 +181,7 @@ func (client DeviceSecurityGroupsClient) DeletePreparer(ctx context.Context, res // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client DeviceSecurityGroupsClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // DeleteResponder handles the response to the Delete request. The method always @@ -258,8 +256,7 @@ func (client DeviceSecurityGroupsClient) GetPreparer(ctx context.Context, resour // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client DeviceSecurityGroupsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -333,8 +330,7 @@ func (client DeviceSecurityGroupsClient) ListPreparer(ctx context.Context, resou // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client DeviceSecurityGroupsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/discoveredsecuritysolutions.go b/services/preview/security/mgmt/v3.0/security/discoveredsecuritysolutions.go index f994891f6a74..5cad25154319 100644 --- a/services/preview/security/mgmt/v3.0/security/discoveredsecuritysolutions.go +++ b/services/preview/security/mgmt/v3.0/security/discoveredsecuritysolutions.go @@ -115,8 +115,7 @@ func (client DiscoveredSecuritySolutionsClient) GetPreparer(ctx context.Context, // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client DiscoveredSecuritySolutionsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -194,8 +193,7 @@ func (client DiscoveredSecuritySolutionsClient) ListPreparer(ctx context.Context // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client DiscoveredSecuritySolutionsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always @@ -311,8 +309,7 @@ func (client DiscoveredSecuritySolutionsClient) ListByHomeRegionPreparer(ctx con // ListByHomeRegionSender sends the ListByHomeRegion request. The method will close the // http.Response Body if it receives an error. func (client DiscoveredSecuritySolutionsClient) ListByHomeRegionSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByHomeRegionResponder handles the response to the ListByHomeRegion request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/externalsecuritysolutions.go b/services/preview/security/mgmt/v3.0/security/externalsecuritysolutions.go index 405d18b2de94..614aa067c07b 100644 --- a/services/preview/security/mgmt/v3.0/security/externalsecuritysolutions.go +++ b/services/preview/security/mgmt/v3.0/security/externalsecuritysolutions.go @@ -115,8 +115,7 @@ func (client ExternalSecuritySolutionsClient) GetPreparer(ctx context.Context, r // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client ExternalSecuritySolutionsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -194,8 +193,7 @@ func (client ExternalSecuritySolutionsClient) ListPreparer(ctx context.Context) // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client ExternalSecuritySolutionsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always @@ -311,8 +309,7 @@ func (client ExternalSecuritySolutionsClient) ListByHomeRegionPreparer(ctx conte // ListByHomeRegionSender sends the ListByHomeRegion request. The method will close the // http.Response Body if it receives an error. func (client ExternalSecuritySolutionsClient) ListByHomeRegionSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByHomeRegionResponder handles the response to the ListByHomeRegion request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/informationprotectionpolicies.go b/services/preview/security/mgmt/v3.0/security/informationprotectionpolicies.go index 4202bb463fd3..b1ca96db2f94 100644 --- a/services/preview/security/mgmt/v3.0/security/informationprotectionpolicies.go +++ b/services/preview/security/mgmt/v3.0/security/informationprotectionpolicies.go @@ -102,8 +102,7 @@ func (client InformationProtectionPoliciesClient) CreateOrUpdatePreparer(ctx con // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client InformationProtectionPoliciesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -179,8 +178,7 @@ func (client InformationProtectionPoliciesClient) GetPreparer(ctx context.Contex // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client InformationProtectionPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -255,8 +253,7 @@ func (client InformationProtectionPoliciesClient) ListPreparer(ctx context.Conte // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client InformationProtectionPoliciesClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/iotsecuritysolution.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolution.go index ac144796e9a2..bcedd492e4e8 100644 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolution.go +++ b/services/preview/security/mgmt/v3.0/security/iotsecuritysolution.go @@ -130,8 +130,7 @@ func (client IotSecuritySolutionClient) CreateOrUpdatePreparer(ctx context.Conte // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client IotSecuritySolutionClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -218,8 +217,7 @@ func (client IotSecuritySolutionClient) DeletePreparer(ctx context.Context, reso // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client IotSecuritySolutionClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always @@ -305,8 +303,7 @@ func (client IotSecuritySolutionClient) GetPreparer(ctx context.Context, resourc // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client IotSecuritySolutionClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -396,8 +393,7 @@ func (client IotSecuritySolutionClient) ListByResourceGroupPreparer(ctx context. // ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the // http.Response Body if it receives an error. func (client IotSecuritySolutionClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always @@ -517,8 +513,7 @@ func (client IotSecuritySolutionClient) ListBySubscriptionPreparer(ctx context.C // ListBySubscriptionSender sends the ListBySubscription request. The method will close the // http.Response Body if it receives an error. func (client IotSecuritySolutionClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always @@ -646,8 +641,7 @@ func (client IotSecuritySolutionClient) UpdatePreparer(ctx context.Context, reso // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client IotSecuritySolutionClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionanalytics.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionanalytics.go index 689654cfbe0a..05f89b37d815 100644 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionanalytics.go +++ b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionanalytics.go @@ -114,8 +114,7 @@ func (client IotSecuritySolutionAnalyticsClient) GetPreparer(ctx context.Context // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client IotSecuritySolutionAnalyticsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -202,8 +201,7 @@ func (client IotSecuritySolutionAnalyticsClient) ListPreparer(ctx context.Contex // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client IotSecuritySolutionAnalyticsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsaggregatedalert.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsaggregatedalert.go index 043fd6171430..b99c93d8ea9c 100644 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsaggregatedalert.go +++ b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsaggregatedalert.go @@ -118,8 +118,7 @@ func (client IotSecuritySolutionsAnalyticsAggregatedAlertClient) DismissPreparer // DismissSender sends the Dismiss request. The method will close the // http.Response Body if it receives an error. func (client IotSecuritySolutionsAnalyticsAggregatedAlertClient) DismissSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DismissResponder handles the response to the Dismiss request. The method always @@ -208,8 +207,7 @@ func (client IotSecuritySolutionsAnalyticsAggregatedAlertClient) GetPreparer(ctx // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client IotSecuritySolutionsAnalyticsAggregatedAlertClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -301,8 +299,7 @@ func (client IotSecuritySolutionsAnalyticsAggregatedAlertClient) ListPreparer(ct // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client IotSecuritySolutionsAnalyticsAggregatedAlertClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsrecommendation.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsrecommendation.go index b2e227faa2bf..11766ff25f33 100644 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsrecommendation.go +++ b/services/preview/security/mgmt/v3.0/security/iotsecuritysolutionsanalyticsrecommendation.go @@ -119,8 +119,7 @@ func (client IotSecuritySolutionsAnalyticsRecommendationClient) GetPreparer(ctx // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client IotSecuritySolutionsAnalyticsRecommendationClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -213,8 +212,7 @@ func (client IotSecuritySolutionsAnalyticsRecommendationClient) ListPreparer(ctx // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client IotSecuritySolutionsAnalyticsRecommendationClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/jitnetworkaccesspolicies.go b/services/preview/security/mgmt/v3.0/security/jitnetworkaccesspolicies.go index b5aead1c6d04..82115488a008 100644 --- a/services/preview/security/mgmt/v3.0/security/jitnetworkaccesspolicies.go +++ b/services/preview/security/mgmt/v3.0/security/jitnetworkaccesspolicies.go @@ -124,8 +124,7 @@ func (client JitNetworkAccessPoliciesClient) CreateOrUpdatePreparer(ctx context. // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client JitNetworkAccessPoliciesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -213,8 +212,7 @@ func (client JitNetworkAccessPoliciesClient) DeletePreparer(ctx context.Context, // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client JitNetworkAccessPoliciesClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always @@ -301,8 +299,7 @@ func (client JitNetworkAccessPoliciesClient) GetPreparer(ctx context.Context, re // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client JitNetworkAccessPoliciesClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -395,8 +392,7 @@ func (client JitNetworkAccessPoliciesClient) InitiatePreparer(ctx context.Contex // InitiateSender sends the Initiate request. The method will close the // http.Response Body if it receives an error. func (client JitNetworkAccessPoliciesClient) InitiateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // InitiateResponder handles the response to the Initiate request. The method always @@ -474,8 +470,7 @@ func (client JitNetworkAccessPoliciesClient) ListPreparer(ctx context.Context) ( // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client JitNetworkAccessPoliciesClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always @@ -591,8 +586,7 @@ func (client JitNetworkAccessPoliciesClient) ListByRegionPreparer(ctx context.Co // ListByRegionSender sends the ListByRegion request. The method will close the // http.Response Body if it receives an error. func (client JitNetworkAccessPoliciesClient) ListByRegionSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByRegionResponder handles the response to the ListByRegion request. The method always @@ -716,8 +710,7 @@ func (client JitNetworkAccessPoliciesClient) ListByResourceGroupPreparer(ctx con // ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the // http.Response Body if it receives an error. func (client JitNetworkAccessPoliciesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always @@ -842,8 +835,7 @@ func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegionPrepare // ListByResourceGroupAndRegionSender sends the ListByResourceGroupAndRegion request. The method will close the // http.Response Body if it receives an error. func (client JitNetworkAccessPoliciesClient) ListByResourceGroupAndRegionSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByResourceGroupAndRegionResponder handles the response to the ListByResourceGroupAndRegion request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/locations.go b/services/preview/security/mgmt/v3.0/security/locations.go index 18ecc473ff74..cd6fdf271b9a 100644 --- a/services/preview/security/mgmt/v3.0/security/locations.go +++ b/services/preview/security/mgmt/v3.0/security/locations.go @@ -104,8 +104,7 @@ func (client LocationsClient) GetPreparer(ctx context.Context) (*http.Request, e // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client LocationsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -185,8 +184,7 @@ func (client LocationsClient) ListPreparer(ctx context.Context) (*http.Request, // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client LocationsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/models.go b/services/preview/security/mgmt/v3.0/security/models.go index dca78bb964d7..fd736271261b 100644 --- a/services/preview/security/mgmt/v3.0/security/models.go +++ b/services/preview/security/mgmt/v3.0/security/models.go @@ -162,11 +162,13 @@ const ( // CustomPolicy User defined policies that are automatically ingested from Azure Policy to Azure Security // Center CustomPolicy AssessmentType = "CustomPolicy" + // VerifiedPartner An assessment that was created by a verified 3rd party if the user connected it to ASC + VerifiedPartner AssessmentType = "VerifiedPartner" ) // PossibleAssessmentTypeValues returns an array of possible values for the AssessmentType const type. func PossibleAssessmentTypeValues() []AssessmentType { - return []AssessmentType{BuiltIn, CustomerManaged, CustomPolicy} + return []AssessmentType{BuiltIn, CustomerManaged, CustomPolicy, VerifiedPartner} } // AutoProvision enumerates the values for auto provision. @@ -330,6 +332,23 @@ func PossibleEnforcementMode1Values() []EnforcementMode1 { return []EnforcementMode1{EnforcementMode1Audit, EnforcementMode1Enforce, EnforcementMode1None} } +// EnforcementSupport enumerates the values for enforcement support. +type EnforcementSupport string + +const ( + // NotSupported ... + NotSupported EnforcementSupport = "NotSupported" + // Supported ... + Supported EnforcementSupport = "Supported" + // Unknown ... + Unknown EnforcementSupport = "Unknown" +) + +// PossibleEnforcementSupportValues returns an array of possible values for the EnforcementSupport const type. +func PossibleEnforcementSupportValues() []EnforcementSupport { + return []EnforcementSupport{NotSupported, Supported, Unknown} +} + // EventSource enumerates the values for event source. type EventSource string @@ -2634,6 +2653,16 @@ func NewAssessmentMetadataListPage(getNextPage func(context.Context, AssessmentM return AssessmentMetadataListPage{fn: getNextPage} } +// AssessmentMetadataPartnerData describes the partner that created the assessment +type AssessmentMetadataPartnerData struct { + // PartnerName - Name of the company of the partner + PartnerName *string `json:"partnerName,omitempty"` + // ProductName - Name of the product of the partner that created the assessment + ProductName *string `json:"productName,omitempty"` + // Secret - Secret to authenticate the partner and verify it created the assessment - write only + Secret *string `json:"secret,omitempty"` +} + // AssessmentMetadataProperties describes properties of an assessment metadata. type AssessmentMetadataProperties struct { // DisplayName - User friendly display name of the assessment @@ -2654,8 +2683,17 @@ type AssessmentMetadataProperties struct { Threats *[]Threats `json:"threats,omitempty"` // Preview - True if this assessment is in preview release status Preview *bool `json:"preview,omitempty"` - // AssessmentType - BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure Policy definition. Possible values include: 'BuiltIn', 'CustomPolicy', 'CustomerManaged' - AssessmentType AssessmentType `json:"assessmentType,omitempty"` + // AssessmentType - BuiltIn if the assessment based on built-in Azure Policy definition, Custom if the assessment based on custom Azure Policy definition. Possible values include: 'BuiltIn', 'CustomPolicy', 'CustomerManaged', 'VerifiedPartner' + AssessmentType AssessmentType `json:"assessmentType,omitempty"` + PartnerData *AssessmentMetadataPartnerData `json:"partnerData,omitempty"` +} + +// AssessmentPartnerData data regarding 3rd party partner integration +type AssessmentPartnerData struct { + // PartnerName - Name of the company of the partner + PartnerName *string `json:"partnerName,omitempty"` + // Secret - secret to authenticate the partner - write only + Secret *string `json:"secret,omitempty"` } // AssessmentProperties describes properties of an assessment. @@ -2665,8 +2703,10 @@ type AssessmentProperties struct { DisplayName *string `json:"displayName,omitempty"` Status *AssessmentStatus `json:"status,omitempty"` // AdditionalData - Additional data regarding the assessment - AdditionalData map[string]*string `json:"additionalData"` - Links *AssessmentLinks `json:"links,omitempty"` + AdditionalData map[string]*string `json:"additionalData"` + Links *AssessmentLinks `json:"links,omitempty"` + Metadata *AssessmentMetadataProperties `json:"metadata,omitempty"` + PartnersData *AssessmentPartnerData `json:"partnersData,omitempty"` } // MarshalJSON is the custom marshaler for AssessmentProperties. @@ -2682,6 +2722,12 @@ func (ap AssessmentProperties) MarshalJSON() ([]byte, error) { if ap.Links != nil { objectMap["links"] = ap.Links } + if ap.Metadata != nil { + objectMap["metadata"] = ap.Metadata + } + if ap.PartnersData != nil { + objectMap["partnersData"] = ap.PartnersData + } return json.Marshal(objectMap) } @@ -2738,6 +2784,24 @@ func (ap *AssessmentProperties) UnmarshalJSON(body []byte) error { } ap.Links = &links } + case "metadata": + if v != nil { + var metadata AssessmentMetadataProperties + err = json.Unmarshal(*v, &metadata) + if err != nil { + return err + } + ap.Metadata = &metadata + } + case "partnersData": + if v != nil { + var partnersData AssessmentPartnerData + err = json.Unmarshal(*v, &partnersData) + if err != nil { + return err + } + ap.PartnersData = &partnersData + } } } @@ -10020,6 +10084,8 @@ type VMRecommendation struct { // RecommendationAction - Possible values include: 'RecommendationActionRecommended', 'RecommendationActionAdd', 'RecommendationActionRemove' RecommendationAction RecommendationAction `json:"recommendationAction,omitempty"` ResourceID *string `json:"resourceId,omitempty"` + // EnforcementSupport - Possible values include: 'Supported', 'NotSupported', 'Unknown' + EnforcementSupport EnforcementSupport `json:"enforcementSupport,omitempty"` } // WorkspaceSetting configures where to store the OMS agent data for workspaces under a scope diff --git a/services/preview/security/mgmt/v3.0/security/operations.go b/services/preview/security/mgmt/v3.0/security/operations.go index b4a74214e886..916396d2b42f 100644 --- a/services/preview/security/mgmt/v3.0/security/operations.go +++ b/services/preview/security/mgmt/v3.0/security/operations.go @@ -93,8 +93,7 @@ func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/pricings.go b/services/preview/security/mgmt/v3.0/security/pricings.go index fff068706738..c1bf0d78ce22 100644 --- a/services/preview/security/mgmt/v3.0/security/pricings.go +++ b/services/preview/security/mgmt/v3.0/security/pricings.go @@ -106,8 +106,7 @@ func (client PricingsClient) GetPreparer(ctx context.Context, pricingName string // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client PricingsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -184,8 +183,7 @@ func (client PricingsClient) ListPreparer(ctx context.Context) (*http.Request, e // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client PricingsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always @@ -268,8 +266,7 @@ func (client PricingsClient) UpdatePreparer(ctx context.Context, pricingName str // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client PricingsClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/regulatorycomplianceassessments.go b/services/preview/security/mgmt/v3.0/security/regulatorycomplianceassessments.go index bed3ced573e3..77deedf9991a 100644 --- a/services/preview/security/mgmt/v3.0/security/regulatorycomplianceassessments.go +++ b/services/preview/security/mgmt/v3.0/security/regulatorycomplianceassessments.go @@ -112,8 +112,7 @@ func (client RegulatoryComplianceAssessmentsClient) GetPreparer(ctx context.Cont // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client RegulatoryComplianceAssessmentsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -200,8 +199,7 @@ func (client RegulatoryComplianceAssessmentsClient) ListPreparer(ctx context.Con // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client RegulatoryComplianceAssessmentsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/regulatorycompliancecontrols.go b/services/preview/security/mgmt/v3.0/security/regulatorycompliancecontrols.go index 1d590b52a497..197250e80444 100644 --- a/services/preview/security/mgmt/v3.0/security/regulatorycompliancecontrols.go +++ b/services/preview/security/mgmt/v3.0/security/regulatorycompliancecontrols.go @@ -109,8 +109,7 @@ func (client RegulatoryComplianceControlsClient) GetPreparer(ctx context.Context // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client RegulatoryComplianceControlsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -195,8 +194,7 @@ func (client RegulatoryComplianceControlsClient) ListPreparer(ctx context.Contex // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client RegulatoryComplianceControlsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/regulatorycompliancestandards.go b/services/preview/security/mgmt/v3.0/security/regulatorycompliancestandards.go index 86e2892938b1..4ef6e1a66d78 100644 --- a/services/preview/security/mgmt/v3.0/security/regulatorycompliancestandards.go +++ b/services/preview/security/mgmt/v3.0/security/regulatorycompliancestandards.go @@ -107,8 +107,7 @@ func (client RegulatoryComplianceStandardsClient) GetPreparer(ctx context.Contex // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client RegulatoryComplianceStandardsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -191,8 +190,7 @@ func (client RegulatoryComplianceStandardsClient) ListPreparer(ctx context.Conte // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client RegulatoryComplianceStandardsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always 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 05aee44e38c7..221ca4995e26 100644 --- a/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go +++ b/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go @@ -71,6 +71,14 @@ type SettingsClientAPI interface { var _ SettingsClientAPI = (*security.SettingsClient)(nil) +// AdvancedThreatProtectionClientAPI contains the set of methods on the AdvancedThreatProtectionClient type. +type AdvancedThreatProtectionClientAPI interface { + Create(ctx context.Context, resourceID string, advancedThreatProtectionSetting security.AdvancedThreatProtectionSetting) (result security.AdvancedThreatProtectionSetting, err error) + Get(ctx context.Context, resourceID string) (result security.AdvancedThreatProtectionSetting, err error) +} + +var _ AdvancedThreatProtectionClientAPI = (*security.AdvancedThreatProtectionClient)(nil) + // DeviceSecurityGroupsClientAPI contains the set of methods on the DeviceSecurityGroupsClient type. type DeviceSecurityGroupsClientAPI interface { CreateOrUpdate(ctx context.Context, resourceID string, deviceSecurityGroupName string, deviceSecurityGroup security.DeviceSecurityGroup) (result security.DeviceSecurityGroup, err error) @@ -176,6 +184,7 @@ var _ JitNetworkAccessPoliciesClientAPI = (*security.JitNetworkAccessPoliciesCli // AdaptiveApplicationControlsClientAPI contains the set of methods on the AdaptiveApplicationControlsClient type. type AdaptiveApplicationControlsClientAPI interface { + Delete(ctx context.Context, groupName string) (result autorest.Response, err error) Get(ctx context.Context, groupName string) (result security.AppWhitelistingGroup, err error) List(ctx context.Context, includePathRecommendations *bool, summary *bool) (result security.AppWhitelistingGroups, err error) Put(ctx context.Context, groupName string, body security.AppWhitelistingPutGroupData) (result security.AppWhitelistingGroup, err error) @@ -227,14 +236,6 @@ type TopologyClientAPI interface { var _ TopologyClientAPI = (*security.TopologyClient)(nil) -// AdvancedThreatProtectionClientAPI contains the set of methods on the AdvancedThreatProtectionClient type. -type AdvancedThreatProtectionClientAPI interface { - Create(ctx context.Context, resourceID string, advancedThreatProtectionSetting security.AdvancedThreatProtectionSetting) (result security.AdvancedThreatProtectionSetting, err error) - Get(ctx context.Context, resourceID string) (result security.AdvancedThreatProtectionSetting, err error) -} - -var _ AdvancedThreatProtectionClientAPI = (*security.AdvancedThreatProtectionClient)(nil) - // AutoProvisioningSettingsClientAPI contains the set of methods on the AutoProvisioningSettingsClient type. type AutoProvisioningSettingsClientAPI interface { Create(ctx context.Context, settingName string, setting security.AutoProvisioningSetting) (result security.AutoProvisioningSetting, err error) @@ -352,24 +353,18 @@ var _ AutomationsClientAPI = (*security.AutomationsClient)(nil) // AssessmentsMetadataClientAPI contains the set of methods on the AssessmentsMetadataClient type. type AssessmentsMetadataClientAPI interface { + CreateInSubscription(ctx context.Context, assessmentMetadataName string, assessmentMetadata security.AssessmentMetadata) (result security.AssessmentMetadata, err error) + DeleteInSubscription(ctx context.Context, assessmentMetadataName string) (result autorest.Response, err error) Get(ctx context.Context, assessmentMetadataName string) (result security.AssessmentMetadata, err error) + GetInSubscription(ctx context.Context, assessmentMetadataName string) (result security.AssessmentMetadata, err error) List(ctx context.Context) (result security.AssessmentMetadataListPage, err error) ListComplete(ctx context.Context) (result security.AssessmentMetadataListIterator, err error) + ListBySubscription(ctx context.Context) (result security.AssessmentMetadataListPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result security.AssessmentMetadataListIterator, err error) } var _ AssessmentsMetadataClientAPI = (*security.AssessmentsMetadataClient)(nil) -// AssessmentsMetadataSubscriptionClientAPI contains the set of methods on the AssessmentsMetadataSubscriptionClient type. -type AssessmentsMetadataSubscriptionClientAPI interface { - Create(ctx context.Context, assessmentMetadataName string, assessmentMetadata security.AssessmentMetadata) (result security.AssessmentMetadata, err error) - Delete(ctx context.Context, assessmentMetadataName string) (result autorest.Response, err error) - Get(ctx context.Context, assessmentMetadataName string) (result security.AssessmentMetadata, err error) - List(ctx context.Context) (result security.AssessmentMetadataListPage, err error) - ListComplete(ctx context.Context) (result security.AssessmentMetadataListIterator, err error) -} - -var _ AssessmentsMetadataSubscriptionClientAPI = (*security.AssessmentsMetadataSubscriptionClient)(nil) - // AssessmentsClientAPI contains the set of methods on the AssessmentsClient type. type AssessmentsClientAPI interface { CreateOrUpdate(ctx context.Context, resourceID string, assessmentName string, assessment security.Assessment) (result security.Assessment, err error) diff --git a/services/preview/security/mgmt/v3.0/security/servervulnerabilityassessment.go b/services/preview/security/mgmt/v3.0/security/servervulnerabilityassessment.go index adeed1509332..b1e50b758d83 100644 --- a/services/preview/security/mgmt/v3.0/security/servervulnerabilityassessment.go +++ b/services/preview/security/mgmt/v3.0/security/servervulnerabilityassessment.go @@ -120,8 +120,7 @@ func (client ServerVulnerabilityAssessmentClient) CreateOrUpdatePreparer(ctx con // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. func (client ServerVulnerabilityAssessmentClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -213,8 +212,7 @@ func (client ServerVulnerabilityAssessmentClient) DeletePreparer(ctx context.Con // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client ServerVulnerabilityAssessmentClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always @@ -305,8 +303,7 @@ func (client ServerVulnerabilityAssessmentClient) GetPreparer(ctx context.Contex // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client ServerVulnerabilityAssessmentClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -397,8 +394,7 @@ func (client ServerVulnerabilityAssessmentClient) ListByExtendedResourcePreparer // ListByExtendedResourceSender sends the ListByExtendedResource request. The method will close the // http.Response Body if it receives an error. func (client ServerVulnerabilityAssessmentClient) ListByExtendedResourceSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByExtendedResourceResponder handles the response to the ListByExtendedResource request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/settings.go b/services/preview/security/mgmt/v3.0/security/settings.go index fdf82f2225d5..cf1b4f08f2c9 100644 --- a/services/preview/security/mgmt/v3.0/security/settings.go +++ b/services/preview/security/mgmt/v3.0/security/settings.go @@ -106,8 +106,7 @@ func (client SettingsClient) GetPreparer(ctx context.Context, settingName string // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client SettingsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -185,8 +184,7 @@ func (client SettingsClient) ListPreparer(ctx context.Context) (*http.Request, e // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client SettingsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always @@ -306,8 +304,7 @@ func (client SettingsClient) UpdatePreparer(ctx context.Context, settingName str // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client SettingsClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/subassessments.go b/services/preview/security/mgmt/v3.0/security/subassessments.go index 82430e79385f..4b1a429a3e90 100644 --- a/services/preview/security/mgmt/v3.0/security/subassessments.go +++ b/services/preview/security/mgmt/v3.0/security/subassessments.go @@ -103,8 +103,7 @@ func (client SubAssessmentsClient) GetPreparer(ctx context.Context, scope string // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client SubAssessmentsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // GetResponder handles the response to the Get request. The method always @@ -181,8 +180,7 @@ func (client SubAssessmentsClient) ListPreparer(ctx context.Context, scope strin // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client SubAssessmentsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListResponder handles the response to the List request. The method always @@ -294,8 +292,7 @@ func (client SubAssessmentsClient) ListAllPreparer(ctx context.Context, scope st // ListAllSender sends the ListAll request. The method will close the // http.Response Body if it receives an error. func (client SubAssessmentsClient) ListAllSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) } // ListAllResponder handles the response to the ListAll request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/tasks.go b/services/preview/security/mgmt/v3.0/security/tasks.go index bc6628d115d3..5215444c7a73 100644 --- a/services/preview/security/mgmt/v3.0/security/tasks.go +++ b/services/preview/security/mgmt/v3.0/security/tasks.go @@ -114,8 +114,7 @@ func (client TasksClient) GetResourceGroupLevelTaskPreparer(ctx context.Context, // GetResourceGroupLevelTaskSender sends the GetResourceGroupLevelTask request. The method will close the // http.Response Body if it receives an error. func (client TasksClient) GetResourceGroupLevelTaskSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResourceGroupLevelTaskResponder handles the response to the GetResourceGroupLevelTask request. The method always @@ -196,8 +195,7 @@ func (client TasksClient) GetSubscriptionLevelTaskPreparer(ctx context.Context, // GetSubscriptionLevelTaskSender sends the GetSubscriptionLevelTask request. The method will close the // http.Response Body if it receives an error. func (client TasksClient) GetSubscriptionLevelTaskSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetSubscriptionLevelTaskResponder handles the response to the GetSubscriptionLevelTask request. The method always @@ -280,8 +278,7 @@ func (client TasksClient) ListPreparer(ctx context.Context, filter string) (*htt // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client TasksClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always @@ -402,8 +399,7 @@ func (client TasksClient) ListByHomeRegionPreparer(ctx context.Context, filter s // ListByHomeRegionSender sends the ListByHomeRegion request. The method will close the // http.Response Body if it receives an error. func (client TasksClient) ListByHomeRegionSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByHomeRegionResponder handles the response to the ListByHomeRegion request. The method always @@ -531,8 +527,7 @@ func (client TasksClient) ListByResourceGroupPreparer(ctx context.Context, resou // ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the // http.Response Body if it receives an error. func (client TasksClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always @@ -660,8 +655,7 @@ func (client TasksClient) UpdateResourceGroupLevelTaskStatePreparer(ctx context. // UpdateResourceGroupLevelTaskStateSender sends the UpdateResourceGroupLevelTaskState request. The method will close the // http.Response Body if it receives an error. func (client TasksClient) UpdateResourceGroupLevelTaskStateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResourceGroupLevelTaskStateResponder handles the response to the UpdateResourceGroupLevelTaskState request. The method always @@ -744,8 +738,7 @@ func (client TasksClient) UpdateSubscriptionLevelTaskStatePreparer(ctx context.C // UpdateSubscriptionLevelTaskStateSender sends the UpdateSubscriptionLevelTaskState request. The method will close the // http.Response Body if it receives an error. func (client TasksClient) UpdateSubscriptionLevelTaskStateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateSubscriptionLevelTaskStateResponder handles the response to the UpdateSubscriptionLevelTaskState request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/topology.go b/services/preview/security/mgmt/v3.0/security/topology.go index efb4716fa9a4..5a020bc9863c 100644 --- a/services/preview/security/mgmt/v3.0/security/topology.go +++ b/services/preview/security/mgmt/v3.0/security/topology.go @@ -114,8 +114,7 @@ func (client TopologyClient) GetPreparer(ctx context.Context, resourceGroupName // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client TopologyClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -193,8 +192,7 @@ func (client TopologyClient) ListPreparer(ctx context.Context) (*http.Request, e // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client TopologyClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always @@ -310,8 +308,7 @@ func (client TopologyClient) ListByHomeRegionPreparer(ctx context.Context) (*htt // ListByHomeRegionSender sends the ListByHomeRegion request. The method will close the // http.Response Body if it receives an error. func (client TopologyClient) ListByHomeRegionSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByHomeRegionResponder handles the response to the ListByHomeRegion request. The method always diff --git a/services/preview/security/mgmt/v3.0/security/workspacesettings.go b/services/preview/security/mgmt/v3.0/security/workspacesettings.go index 7165e8698a55..e34ac16bdae2 100644 --- a/services/preview/security/mgmt/v3.0/security/workspacesettings.go +++ b/services/preview/security/mgmt/v3.0/security/workspacesettings.go @@ -115,8 +115,7 @@ func (client WorkspaceSettingsClient) CreatePreparer(ctx context.Context, worksp // CreateSender sends the Create request. The method will close the // http.Response Body if it receives an error. func (client WorkspaceSettingsClient) CreateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateResponder handles the response to the Create request. The method always @@ -196,8 +195,7 @@ func (client WorkspaceSettingsClient) DeletePreparer(ctx context.Context, worksp // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client WorkspaceSettingsClient) DeleteSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always @@ -277,8 +275,7 @@ func (client WorkspaceSettingsClient) GetPreparer(ctx context.Context, workspace // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. func (client WorkspaceSettingsClient) GetSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always @@ -357,8 +354,7 @@ func (client WorkspaceSettingsClient) ListPreparer(ctx context.Context) (*http.R // ListSender sends the List request. The method will close the // http.Response Body if it receives an error. func (client WorkspaceSettingsClient) ListSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListResponder handles the response to the List request. The method always @@ -478,8 +474,7 @@ func (client WorkspaceSettingsClient) UpdatePreparer(ctx context.Context, worksp // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client WorkspaceSettingsClient) UpdateSender(req *http.Request) (*http.Response, error) { - sd := autorest.GetSendDecorators(req.Context(), azure.DoRetryWithRegistration(client.Client)) - return autorest.SendWithSender(client, req, sd...) + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always