diff --git a/profiles/preview/preview/security/mgmt/security/models.go b/profiles/preview/preview/security/mgmt/security/models.go index 0dc98fbf654d..9cb379f2b653 100644 --- a/profiles/preview/preview/security/mgmt/security/models.go +++ b/profiles/preview/preview/security/mgmt/security/models.go @@ -65,13 +65,6 @@ const ( Internal ConnectionType = original.Internal ) -type Direction = original.Direction - -const ( - Inbound Direction = original.Inbound - Outbound Direction = original.Outbound -) - type ExternalSecuritySolutionKind = original.ExternalSecuritySolutionKind const ( @@ -153,13 +146,6 @@ const ( UserRequested StatusReason = original.UserRequested ) -type TransportProtocol = original.TransportProtocol - -const ( - TransportProtocolTCP TransportProtocol = original.TransportProtocolTCP - TransportProtocolUDP TransportProtocol = original.TransportProtocolUDP -) - type ValueType = original.ValueType const ( @@ -170,14 +156,6 @@ const ( type AadConnectivityState1 = original.AadConnectivityState1 type AadExternalSecuritySolution = original.AadExternalSecuritySolution type AadSolutionProperties = original.AadSolutionProperties -type AdaptiveNetworkHardening = original.AdaptiveNetworkHardening -type AdaptiveNetworkHardeningEnforceRequest = original.AdaptiveNetworkHardeningEnforceRequest -type AdaptiveNetworkHardeningProperties = original.AdaptiveNetworkHardeningProperties -type AdaptiveNetworkHardeningsClient = original.AdaptiveNetworkHardeningsClient -type AdaptiveNetworkHardeningsEnforceFuture = original.AdaptiveNetworkHardeningsEnforceFuture -type AdaptiveNetworkHardeningsList = original.AdaptiveNetworkHardeningsList -type AdaptiveNetworkHardeningsListIterator = original.AdaptiveNetworkHardeningsListIterator -type AdaptiveNetworkHardeningsListPage = original.AdaptiveNetworkHardeningsListPage type AdvancedThreatProtectionClient = original.AdvancedThreatProtectionClient type AdvancedThreatProtectionProperties = original.AdvancedThreatProtectionProperties type AdvancedThreatProtectionSetting = original.AdvancedThreatProtectionSetting @@ -246,7 +224,6 @@ type DiscoveredSecuritySolutionListIterator = original.DiscoveredSecuritySolutio type DiscoveredSecuritySolutionListPage = original.DiscoveredSecuritySolutionListPage type DiscoveredSecuritySolutionProperties = original.DiscoveredSecuritySolutionProperties type DiscoveredSecuritySolutionsClient = original.DiscoveredSecuritySolutionsClient -type EffectiveNetworkSecurityGroups = original.EffectiveNetworkSecurityGroups type ExternalSecuritySolution = original.ExternalSecuritySolution type ExternalSecuritySolutionKind1 = original.ExternalSecuritySolutionKind1 type ExternalSecuritySolutionList = original.ExternalSecuritySolutionList @@ -310,7 +287,6 @@ type RegulatoryComplianceStandardListPage = original.RegulatoryComplianceStandar type RegulatoryComplianceStandardProperties = original.RegulatoryComplianceStandardProperties type RegulatoryComplianceStandardsClient = original.RegulatoryComplianceStandardsClient type Resource = original.Resource -type Rule = original.Rule type SensitivityLabel = original.SensitivityLabel type Setting = original.Setting type SettingResource = original.SettingResource @@ -346,18 +322,6 @@ type WorkspaceSettingsClient = original.WorkspaceSettingsClient func New(subscriptionID string, ascLocation string) BaseClient { return original.New(subscriptionID, ascLocation) } -func NewAdaptiveNetworkHardeningsClient(subscriptionID string, ascLocation string) AdaptiveNetworkHardeningsClient { - return original.NewAdaptiveNetworkHardeningsClient(subscriptionID, ascLocation) -} -func NewAdaptiveNetworkHardeningsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AdaptiveNetworkHardeningsClient { - return original.NewAdaptiveNetworkHardeningsClientWithBaseURI(baseURI, subscriptionID, ascLocation) -} -func NewAdaptiveNetworkHardeningsListIterator(page AdaptiveNetworkHardeningsListPage) AdaptiveNetworkHardeningsListIterator { - return original.NewAdaptiveNetworkHardeningsListIterator(page) -} -func NewAdaptiveNetworkHardeningsListPage(getNextPage func(context.Context, AdaptiveNetworkHardeningsList) (AdaptiveNetworkHardeningsList, error)) AdaptiveNetworkHardeningsListPage { - return original.NewAdaptiveNetworkHardeningsListPage(getNextPage) -} func NewAdvancedThreatProtectionClient(subscriptionID string, ascLocation string) AdvancedThreatProtectionClient { return original.NewAdvancedThreatProtectionClient(subscriptionID, ascLocation) } @@ -616,9 +580,6 @@ func PossibleAutoProvisionValues() []AutoProvision { func PossibleConnectionTypeValues() []ConnectionType { return original.PossibleConnectionTypeValues() } -func PossibleDirectionValues() []Direction { - return original.PossibleDirectionValues() -} func PossibleExternalSecuritySolutionKindValues() []ExternalSecuritySolutionKind { return original.PossibleExternalSecuritySolutionKindValues() } @@ -649,9 +610,6 @@ func PossibleStatusReasonValues() []StatusReason { func PossibleStatusValues() []Status { return original.PossibleStatusValues() } -func PossibleTransportProtocolValues() []TransportProtocol { - return original.PossibleTransportProtocolValues() -} func PossibleValueTypeValues() []ValueType { return original.PossibleValueTypeValues() } diff --git a/profiles/preview/preview/security/mgmt/security/securityapi/models.go b/profiles/preview/preview/security/mgmt/security/securityapi/models.go index 0fbd48d4d36f..fa6fd45e0758 100644 --- a/profiles/preview/preview/security/mgmt/security/securityapi/models.go +++ b/profiles/preview/preview/security/mgmt/security/securityapi/models.go @@ -21,7 +21,6 @@ package securityapi import original "github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v2.0/security/securityapi" -type AdaptiveNetworkHardeningsClientAPI = original.AdaptiveNetworkHardeningsClientAPI type AdvancedThreatProtectionClientAPI = original.AdvancedThreatProtectionClientAPI type AlertsClientAPI = original.AlertsClientAPI type AllowedConnectionsClientAPI = original.AllowedConnectionsClientAPI diff --git a/services/preview/security/mgmt/v1.0/security/adaptivenetworkhardenings.go b/services/preview/security/mgmt/v1.0/security/adaptivenetworkhardenings.go deleted file mode 100644 index 0d6adbf2aba2..000000000000 --- a/services/preview/security/mgmt/v1.0/security/adaptivenetworkhardenings.go +++ /dev/null @@ -1,365 +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" -) - -// AdaptiveNetworkHardeningsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider -type AdaptiveNetworkHardeningsClient struct { - BaseClient -} - -// NewAdaptiveNetworkHardeningsClient creates an instance of the AdaptiveNetworkHardeningsClient client. -func NewAdaptiveNetworkHardeningsClient(subscriptionID string, ascLocation string) AdaptiveNetworkHardeningsClient { - return NewAdaptiveNetworkHardeningsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) -} - -// NewAdaptiveNetworkHardeningsClientWithBaseURI creates an instance of the AdaptiveNetworkHardeningsClient client. -func NewAdaptiveNetworkHardeningsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AdaptiveNetworkHardeningsClient { - return AdaptiveNetworkHardeningsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} -} - -// Enforce enforces the given rules on the NSG(s) listed in the request -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// resourceNamespace - the Namespace of the resource. -// resourceType - the type of the resource. -// resourceName - name of the resource. -// adaptiveNetworkHardeningResourceName - the name of the Adaptive Network Hardening resource. -func (client AdaptiveNetworkHardeningsClient) Enforce(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, adaptiveNetworkHardeningResourceName string, body AdaptiveNetworkHardeningEnforceRequest) (result AdaptiveNetworkHardeningsEnforceFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveNetworkHardeningsClient.Enforce") - 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}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: body, - Constraints: []validation.Constraint{{Target: "body.Rules", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "body.NetworkSecurityGroups", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AdaptiveNetworkHardeningsClient", "Enforce", err.Error()) - } - - req, err := client.EnforcePreparer(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, body) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AdaptiveNetworkHardeningsClient", "Enforce", nil, "Failure preparing request") - return - } - - result, err = client.EnforceSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AdaptiveNetworkHardeningsClient", "Enforce", result.Response(), "Failure sending request") - return - } - - return -} - -// EnforcePreparer prepares the Enforce request. -func (client AdaptiveNetworkHardeningsClient) EnforcePreparer(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, adaptiveNetworkHardeningResourceName string, body AdaptiveNetworkHardeningEnforceRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "adaptiveNetworkHardeningEnforceAction": autorest.Encode("path", "enforce"), - "adaptiveNetworkHardeningResourceName": autorest.Encode("path", adaptiveNetworkHardeningResourceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "resourceName": autorest.Encode("path", resourceName), - "resourceNamespace": autorest.Encode("path", resourceNamespace), - "resourceType": autorest.Encode("path", resourceType), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-06-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}/{adaptiveNetworkHardeningEnforceAction}", pathParameters), - autorest.WithJSON(body), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// EnforceSender sends the Enforce request. The method will close the -// http.Response Body if it receives an error. -func (client AdaptiveNetworkHardeningsClient) EnforceSender(req *http.Request) (future AdaptiveNetworkHardeningsEnforceFuture, err error) { - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - future.Future, err = azure.NewFutureFromResponse(resp) - return -} - -// EnforceResponder handles the response to the Enforce request. The method always -// closes the http.Response Body. -func (client AdaptiveNetworkHardeningsClient) EnforceResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a single Adaptive Network Hardening resource -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// resourceNamespace - the Namespace of the resource. -// resourceType - the type of the resource. -// resourceName - name of the resource. -// adaptiveNetworkHardeningResourceName - the name of the Adaptive Network Hardening resource. -func (client AdaptiveNetworkHardeningsClient) Get(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, adaptiveNetworkHardeningResourceName string) (result AdaptiveNetworkHardening, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveNetworkHardeningsClient.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}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AdaptiveNetworkHardeningsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AdaptiveNetworkHardeningsClient", "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.AdaptiveNetworkHardeningsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AdaptiveNetworkHardeningsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client AdaptiveNetworkHardeningsClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, adaptiveNetworkHardeningResourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "adaptiveNetworkHardeningResourceName": autorest.Encode("path", adaptiveNetworkHardeningResourceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "resourceName": autorest.Encode("path", resourceName), - "resourceNamespace": autorest.Encode("path", resourceNamespace), - "resourceType": autorest.Encode("path", resourceType), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-06-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}", 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 AdaptiveNetworkHardeningsClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AdaptiveNetworkHardeningsClient) GetResponder(resp *http.Response) (result AdaptiveNetworkHardening, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByExtendedResource gets a list of Adaptive Network Hardenings resources in scope of an extended resource. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// resourceNamespace - the Namespace of the resource. -// resourceType - the type of the resource. -// resourceName - name of the resource. -func (client AdaptiveNetworkHardeningsClient) ListByExtendedResource(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (result AdaptiveNetworkHardeningsListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveNetworkHardeningsClient.ListByExtendedResource") - defer func() { - sc := -1 - if result.anhl.Response.Response != nil { - sc = result.anhl.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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AdaptiveNetworkHardeningsClient", "ListByExtendedResource", err.Error()) - } - - result.fn = client.listByExtendedResourceNextResults - req, err := client.ListByExtendedResourcePreparer(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AdaptiveNetworkHardeningsClient", "ListByExtendedResource", nil, "Failure preparing request") - return - } - - resp, err := client.ListByExtendedResourceSender(req) - if err != nil { - result.anhl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.AdaptiveNetworkHardeningsClient", "ListByExtendedResource", resp, "Failure sending request") - return - } - - result.anhl, err = client.ListByExtendedResourceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AdaptiveNetworkHardeningsClient", "ListByExtendedResource", resp, "Failure responding to request") - } - - return -} - -// ListByExtendedResourcePreparer prepares the ListByExtendedResource request. -func (client AdaptiveNetworkHardeningsClient) ListByExtendedResourcePreparer(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "resourceName": autorest.Encode("path", resourceName), - "resourceNamespace": autorest.Encode("path", resourceNamespace), - "resourceType": autorest.Encode("path", resourceType), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-06-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByExtendedResourceSender sends the ListByExtendedResource request. The method will close the -// http.Response Body if it receives an error. -func (client AdaptiveNetworkHardeningsClient) ListByExtendedResourceSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListByExtendedResourceResponder handles the response to the ListByExtendedResource request. The method always -// closes the http.Response Body. -func (client AdaptiveNetworkHardeningsClient) ListByExtendedResourceResponder(resp *http.Response) (result AdaptiveNetworkHardeningsList, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByExtendedResourceNextResults retrieves the next set of results, if any. -func (client AdaptiveNetworkHardeningsClient) listByExtendedResourceNextResults(ctx context.Context, lastResults AdaptiveNetworkHardeningsList) (result AdaptiveNetworkHardeningsList, err error) { - req, err := lastResults.adaptiveNetworkHardeningsListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "security.AdaptiveNetworkHardeningsClient", "listByExtendedResourceNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByExtendedResourceSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "security.AdaptiveNetworkHardeningsClient", "listByExtendedResourceNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByExtendedResourceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AdaptiveNetworkHardeningsClient", "listByExtendedResourceNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByExtendedResourceComplete enumerates all values, automatically crossing page boundaries as required. -func (client AdaptiveNetworkHardeningsClient) ListByExtendedResourceComplete(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (result AdaptiveNetworkHardeningsListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveNetworkHardeningsClient.ListByExtendedResource") - 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.ListByExtendedResource(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName) - return -} diff --git a/services/preview/security/mgmt/v1.0/security/models.go b/services/preview/security/mgmt/v1.0/security/models.go index 0a825cab8835..0e9e9352bb21 100644 --- a/services/preview/security/mgmt/v1.0/security/models.go +++ b/services/preview/security/mgmt/v1.0/security/models.go @@ -21,7 +21,6 @@ import ( "context" "encoding/json" "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/date" "github.com/Azure/go-autorest/autorest/to" "github.com/Azure/go-autorest/tracing" @@ -109,21 +108,6 @@ func PossibleConnectionTypeValues() []ConnectionType { return []ConnectionType{External, Internal} } -// Direction enumerates the values for direction. -type Direction string - -const ( - // Inbound ... - Inbound Direction = "Inbound" - // Outbound ... - Outbound Direction = "Outbound" -) - -// PossibleDirectionValues returns an array of possible values for the Direction const type. -func PossibleDirectionValues() []Direction { - return []Direction{Inbound, Outbound} -} - // ExternalSecuritySolutionKind enumerates the values for external security solution kind. type ExternalSecuritySolutionKind string @@ -296,21 +280,6 @@ func PossibleStatusReasonValues() []StatusReason { return []StatusReason{Expired, NewerRequestInitiated, UserRequested} } -// TransportProtocol enumerates the values for transport protocol. -type TransportProtocol string - -const ( - // TransportProtocolTCP ... - TransportProtocolTCP TransportProtocol = "TCP" - // TransportProtocolUDP ... - TransportProtocolUDP TransportProtocol = "UDP" -) - -// PossibleTransportProtocolValues returns an array of possible values for the TransportProtocol const type. -func PossibleTransportProtocolValues() []TransportProtocol { - return []TransportProtocol{TransportProtocolTCP, TransportProtocolUDP} -} - // ValueType enumerates the values for value type. type ValueType string @@ -407,277 +376,6 @@ type AadSolutionProperties struct { ConnectivityState AadConnectivityState `json:"connectivityState,omitempty"` } -// AdaptiveNetworkHardening the resource whose properties describes the Adaptive Network Hardening settings -// for some Azure resource -type AdaptiveNetworkHardening struct { - autorest.Response `json:"-"` - // AdaptiveNetworkHardeningProperties - Properties of the Adaptive Network Hardening resource - *AdaptiveNetworkHardeningProperties `json:"properties,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` - // Name - Resource name - Name *string `json:"name,omitempty"` - // Type - Resource type - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for AdaptiveNetworkHardening. -func (anh AdaptiveNetworkHardening) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if anh.AdaptiveNetworkHardeningProperties != nil { - objectMap["properties"] = anh.AdaptiveNetworkHardeningProperties - } - if anh.ID != nil { - objectMap["id"] = anh.ID - } - if anh.Name != nil { - objectMap["name"] = anh.Name - } - if anh.Type != nil { - objectMap["type"] = anh.Type - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AdaptiveNetworkHardening struct. -func (anh *AdaptiveNetworkHardening) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var adaptiveNetworkHardeningProperties AdaptiveNetworkHardeningProperties - err = json.Unmarshal(*v, &adaptiveNetworkHardeningProperties) - if err != nil { - return err - } - anh.AdaptiveNetworkHardeningProperties = &adaptiveNetworkHardeningProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - anh.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - anh.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - anh.Type = &typeVar - } - } - } - - return nil -} - -// AdaptiveNetworkHardeningEnforceRequest ... -type AdaptiveNetworkHardeningEnforceRequest struct { - // Rules - The rules to enforce - Rules *[]Rule `json:"rules,omitempty"` - // NetworkSecurityGroups - The Azure resource IDs of the effective network security groups that will be updated with the created security rules from the Adaptive Network Hardening rules - NetworkSecurityGroups *[]string `json:"networkSecurityGroups,omitempty"` -} - -// AdaptiveNetworkHardeningProperties adaptive Network Hardening resource properties -type AdaptiveNetworkHardeningProperties struct { - // Rules - The security rules which are recommended to be effective on the VM - Rules *[]Rule `json:"rules,omitempty"` - // RulesCalculationTime - The UTC time on which the rules were calculated - RulesCalculationTime *date.Time `json:"rulesCalculationTime,omitempty"` - // EffectiveNetworkSecurityGroups - The Network Security Groups effective on the network interfaces of the protected resource - EffectiveNetworkSecurityGroups *[]EffectiveNetworkSecurityGroups `json:"effectiveNetworkSecurityGroups,omitempty"` -} - -// AdaptiveNetworkHardeningsEnforceFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type AdaptiveNetworkHardeningsEnforceFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *AdaptiveNetworkHardeningsEnforceFuture) Result(client AdaptiveNetworkHardeningsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AdaptiveNetworkHardeningsEnforceFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("security.AdaptiveNetworkHardeningsEnforceFuture") - return - } - ar.Response = future.Response() - return -} - -// AdaptiveNetworkHardeningsList response for ListAdaptiveNetworkHardenings API service call -type AdaptiveNetworkHardeningsList struct { - autorest.Response `json:"-"` - // Value - A list of Adaptive Network Hardenings resources - Value *[]AdaptiveNetworkHardening `json:"value,omitempty"` - // NextLink - The URL to get the next set of results - NextLink *string `json:"nextLink,omitempty"` -} - -// AdaptiveNetworkHardeningsListIterator provides access to a complete listing of AdaptiveNetworkHardening -// values. -type AdaptiveNetworkHardeningsListIterator struct { - i int - page AdaptiveNetworkHardeningsListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AdaptiveNetworkHardeningsListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveNetworkHardeningsListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AdaptiveNetworkHardeningsListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AdaptiveNetworkHardeningsListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AdaptiveNetworkHardeningsListIterator) Response() AdaptiveNetworkHardeningsList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AdaptiveNetworkHardeningsListIterator) Value() AdaptiveNetworkHardening { - if !iter.page.NotDone() { - return AdaptiveNetworkHardening{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AdaptiveNetworkHardeningsListIterator type. -func NewAdaptiveNetworkHardeningsListIterator(page AdaptiveNetworkHardeningsListPage) AdaptiveNetworkHardeningsListIterator { - return AdaptiveNetworkHardeningsListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (anhl AdaptiveNetworkHardeningsList) IsEmpty() bool { - return anhl.Value == nil || len(*anhl.Value) == 0 -} - -// adaptiveNetworkHardeningsListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (anhl AdaptiveNetworkHardeningsList) adaptiveNetworkHardeningsListPreparer(ctx context.Context) (*http.Request, error) { - if anhl.NextLink == nil || len(to.String(anhl.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(anhl.NextLink))) -} - -// AdaptiveNetworkHardeningsListPage contains a page of AdaptiveNetworkHardening values. -type AdaptiveNetworkHardeningsListPage struct { - fn func(context.Context, AdaptiveNetworkHardeningsList) (AdaptiveNetworkHardeningsList, error) - anhl AdaptiveNetworkHardeningsList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AdaptiveNetworkHardeningsListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveNetworkHardeningsListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - next, err := page.fn(ctx, page.anhl) - if err != nil { - return err - } - page.anhl = next - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AdaptiveNetworkHardeningsListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AdaptiveNetworkHardeningsListPage) NotDone() bool { - return !page.anhl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AdaptiveNetworkHardeningsListPage) Response() AdaptiveNetworkHardeningsList { - return page.anhl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AdaptiveNetworkHardeningsListPage) Values() []AdaptiveNetworkHardening { - if page.anhl.IsEmpty() { - return nil - } - return *page.anhl.Value -} - -// Creates a new instance of the AdaptiveNetworkHardeningsListPage type. -func NewAdaptiveNetworkHardeningsListPage(getNextPage func(context.Context, AdaptiveNetworkHardeningsList) (AdaptiveNetworkHardeningsList, error)) AdaptiveNetworkHardeningsListPage { - return AdaptiveNetworkHardeningsListPage{fn: getNextPage} -} - // AdvancedThreatProtectionProperties the Advanced Threat Protection settings. type AdvancedThreatProtectionProperties struct { // IsEnabled - Indicates whether Advanced Threat Protection is enabled. @@ -3366,14 +3064,6 @@ type DiscoveredSecuritySolutionProperties struct { Sku *string `json:"sku,omitempty"` } -// EffectiveNetworkSecurityGroups describes the Network Security Groups effective on a network interface -type EffectiveNetworkSecurityGroups struct { - // NetworkInterface - The Azure resource ID of the network interface - NetworkInterface *string `json:"networkInterface,omitempty"` - // NetworkSecurityGroups - The Network Security Groups effective on the network interface - NetworkSecurityGroups *[]string `json:"networkSecurityGroups,omitempty"` -} - // BasicExternalSecuritySolution represents a security solution external to Azure Security Center which sends // information to an OMS workspace and whose data is displayed by Azure Security Center. type BasicExternalSecuritySolution interface { @@ -5566,21 +5256,6 @@ type Resource struct { Type *string `json:"type,omitempty"` } -// Rule describes remote addresses that is recommended to communicate with the Azure resource on some -// (Protocol, Port, Direction). All other remote addresses are recommended to be blocked -type Rule struct { - // Name - The name of the rule - Name *string `json:"name,omitempty"` - // Direction - The rule's direction. Possible values include: 'Inbound', 'Outbound' - Direction Direction `json:"direction,omitempty"` - // DestinationPort - The rule's destination port - DestinationPort *int32 `json:"destinationPort,omitempty"` - // Protocols - The rule's transport protocols - Protocols *[]TransportProtocol `json:"protocols,omitempty"` - // IPAddresses - The remote IP addresses that should be able to communicate with the Azure resource on the rule's destination port and protocol - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} - // SensitivityLabel the sensitivity label. type SensitivityLabel struct { // DisplayName - The name of the sensitivity label. diff --git a/services/preview/security/mgmt/v1.0/security/securityapi/interfaces.go b/services/preview/security/mgmt/v1.0/security/securityapi/interfaces.go index 46a82559bb30..2651baad358f 100644 --- a/services/preview/security/mgmt/v1.0/security/securityapi/interfaces.go +++ b/services/preview/security/mgmt/v1.0/security/securityapi/interfaces.go @@ -225,12 +225,3 @@ type AllowedConnectionsClientAPI interface { } var _ AllowedConnectionsClientAPI = (*security.AllowedConnectionsClient)(nil) - -// AdaptiveNetworkHardeningsClientAPI contains the set of methods on the AdaptiveNetworkHardeningsClient type. -type AdaptiveNetworkHardeningsClientAPI interface { - Enforce(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, adaptiveNetworkHardeningResourceName string, body security.AdaptiveNetworkHardeningEnforceRequest) (result security.AdaptiveNetworkHardeningsEnforceFuture, err error) - Get(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, adaptiveNetworkHardeningResourceName string) (result security.AdaptiveNetworkHardening, err error) - ListByExtendedResource(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (result security.AdaptiveNetworkHardeningsListPage, err error) -} - -var _ AdaptiveNetworkHardeningsClientAPI = (*security.AdaptiveNetworkHardeningsClient)(nil) diff --git a/services/preview/security/mgmt/v2.0/security/adaptivenetworkhardenings.go b/services/preview/security/mgmt/v2.0/security/adaptivenetworkhardenings.go deleted file mode 100644 index 0d6adbf2aba2..000000000000 --- a/services/preview/security/mgmt/v2.0/security/adaptivenetworkhardenings.go +++ /dev/null @@ -1,365 +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" -) - -// AdaptiveNetworkHardeningsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider -type AdaptiveNetworkHardeningsClient struct { - BaseClient -} - -// NewAdaptiveNetworkHardeningsClient creates an instance of the AdaptiveNetworkHardeningsClient client. -func NewAdaptiveNetworkHardeningsClient(subscriptionID string, ascLocation string) AdaptiveNetworkHardeningsClient { - return NewAdaptiveNetworkHardeningsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) -} - -// NewAdaptiveNetworkHardeningsClientWithBaseURI creates an instance of the AdaptiveNetworkHardeningsClient client. -func NewAdaptiveNetworkHardeningsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AdaptiveNetworkHardeningsClient { - return AdaptiveNetworkHardeningsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} -} - -// Enforce enforces the given rules on the NSG(s) listed in the request -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// resourceNamespace - the Namespace of the resource. -// resourceType - the type of the resource. -// resourceName - name of the resource. -// adaptiveNetworkHardeningResourceName - the name of the Adaptive Network Hardening resource. -func (client AdaptiveNetworkHardeningsClient) Enforce(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, adaptiveNetworkHardeningResourceName string, body AdaptiveNetworkHardeningEnforceRequest) (result AdaptiveNetworkHardeningsEnforceFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveNetworkHardeningsClient.Enforce") - 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}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, - {TargetValue: body, - Constraints: []validation.Constraint{{Target: "body.Rules", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "body.NetworkSecurityGroups", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AdaptiveNetworkHardeningsClient", "Enforce", err.Error()) - } - - req, err := client.EnforcePreparer(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName, body) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AdaptiveNetworkHardeningsClient", "Enforce", nil, "Failure preparing request") - return - } - - result, err = client.EnforceSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AdaptiveNetworkHardeningsClient", "Enforce", result.Response(), "Failure sending request") - return - } - - return -} - -// EnforcePreparer prepares the Enforce request. -func (client AdaptiveNetworkHardeningsClient) EnforcePreparer(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, adaptiveNetworkHardeningResourceName string, body AdaptiveNetworkHardeningEnforceRequest) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "adaptiveNetworkHardeningEnforceAction": autorest.Encode("path", "enforce"), - "adaptiveNetworkHardeningResourceName": autorest.Encode("path", adaptiveNetworkHardeningResourceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "resourceName": autorest.Encode("path", resourceName), - "resourceNamespace": autorest.Encode("path", resourceNamespace), - "resourceType": autorest.Encode("path", resourceType), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-06-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}/{adaptiveNetworkHardeningEnforceAction}", pathParameters), - autorest.WithJSON(body), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// EnforceSender sends the Enforce request. The method will close the -// http.Response Body if it receives an error. -func (client AdaptiveNetworkHardeningsClient) EnforceSender(req *http.Request) (future AdaptiveNetworkHardeningsEnforceFuture, err error) { - var resp *http.Response - resp, err = autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - future.Future, err = azure.NewFutureFromResponse(resp) - return -} - -// EnforceResponder handles the response to the Enforce request. The method always -// closes the http.Response Body. -func (client AdaptiveNetworkHardeningsClient) EnforceResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByClosing()) - result.Response = resp - return -} - -// Get gets a single Adaptive Network Hardening resource -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// resourceNamespace - the Namespace of the resource. -// resourceType - the type of the resource. -// resourceName - name of the resource. -// adaptiveNetworkHardeningResourceName - the name of the Adaptive Network Hardening resource. -func (client AdaptiveNetworkHardeningsClient) Get(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, adaptiveNetworkHardeningResourceName string) (result AdaptiveNetworkHardening, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveNetworkHardeningsClient.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}}}, - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AdaptiveNetworkHardeningsClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName, adaptiveNetworkHardeningResourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AdaptiveNetworkHardeningsClient", "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.AdaptiveNetworkHardeningsClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AdaptiveNetworkHardeningsClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client AdaptiveNetworkHardeningsClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, adaptiveNetworkHardeningResourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "adaptiveNetworkHardeningResourceName": autorest.Encode("path", adaptiveNetworkHardeningResourceName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "resourceName": autorest.Encode("path", resourceName), - "resourceNamespace": autorest.Encode("path", resourceNamespace), - "resourceType": autorest.Encode("path", resourceType), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-06-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings/{adaptiveNetworkHardeningResourceName}", 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 AdaptiveNetworkHardeningsClient) GetSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client AdaptiveNetworkHardeningsClient) GetResponder(resp *http.Response) (result AdaptiveNetworkHardening, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// ListByExtendedResource gets a list of Adaptive Network Hardenings resources in scope of an extended resource. -// Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. The name is case -// insensitive. -// resourceNamespace - the Namespace of the resource. -// resourceType - the type of the resource. -// resourceName - name of the resource. -func (client AdaptiveNetworkHardeningsClient) ListByExtendedResource(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (result AdaptiveNetworkHardeningsListPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveNetworkHardeningsClient.ListByExtendedResource") - defer func() { - sc := -1 - if result.anhl.Response.Response != nil { - sc = result.anhl.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: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("security.AdaptiveNetworkHardeningsClient", "ListByExtendedResource", err.Error()) - } - - result.fn = client.listByExtendedResourceNextResults - req, err := client.ListByExtendedResourcePreparer(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AdaptiveNetworkHardeningsClient", "ListByExtendedResource", nil, "Failure preparing request") - return - } - - resp, err := client.ListByExtendedResourceSender(req) - if err != nil { - result.anhl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "security.AdaptiveNetworkHardeningsClient", "ListByExtendedResource", resp, "Failure sending request") - return - } - - result.anhl, err = client.ListByExtendedResourceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AdaptiveNetworkHardeningsClient", "ListByExtendedResource", resp, "Failure responding to request") - } - - return -} - -// ListByExtendedResourcePreparer prepares the ListByExtendedResource request. -func (client AdaptiveNetworkHardeningsClient) ListByExtendedResourcePreparer(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "resourceName": autorest.Encode("path", resourceName), - "resourceNamespace": autorest.Encode("path", resourceNamespace), - "resourceType": autorest.Encode("path", resourceType), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2015-06-01-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.Security/adaptiveNetworkHardenings", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByExtendedResourceSender sends the ListByExtendedResource request. The method will close the -// http.Response Body if it receives an error. -func (client AdaptiveNetworkHardeningsClient) ListByExtendedResourceSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req, - azure.DoRetryWithRegistration(client.Client)) -} - -// ListByExtendedResourceResponder handles the response to the ListByExtendedResource request. The method always -// closes the http.Response Body. -func (client AdaptiveNetworkHardeningsClient) ListByExtendedResourceResponder(resp *http.Response) (result AdaptiveNetworkHardeningsList, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByExtendedResourceNextResults retrieves the next set of results, if any. -func (client AdaptiveNetworkHardeningsClient) listByExtendedResourceNextResults(ctx context.Context, lastResults AdaptiveNetworkHardeningsList) (result AdaptiveNetworkHardeningsList, err error) { - req, err := lastResults.adaptiveNetworkHardeningsListPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "security.AdaptiveNetworkHardeningsClient", "listByExtendedResourceNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByExtendedResourceSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "security.AdaptiveNetworkHardeningsClient", "listByExtendedResourceNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByExtendedResourceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AdaptiveNetworkHardeningsClient", "listByExtendedResourceNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByExtendedResourceComplete enumerates all values, automatically crossing page boundaries as required. -func (client AdaptiveNetworkHardeningsClient) ListByExtendedResourceComplete(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (result AdaptiveNetworkHardeningsListIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveNetworkHardeningsClient.ListByExtendedResource") - 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.ListByExtendedResource(ctx, resourceGroupName, resourceNamespace, resourceType, resourceName) - return -} diff --git a/services/preview/security/mgmt/v2.0/security/models.go b/services/preview/security/mgmt/v2.0/security/models.go index 0b6113108426..01c9549f5281 100644 --- a/services/preview/security/mgmt/v2.0/security/models.go +++ b/services/preview/security/mgmt/v2.0/security/models.go @@ -21,7 +21,6 @@ import ( "context" "encoding/json" "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/date" "github.com/Azure/go-autorest/autorest/to" "github.com/Azure/go-autorest/tracing" @@ -109,21 +108,6 @@ func PossibleConnectionTypeValues() []ConnectionType { return []ConnectionType{External, Internal} } -// Direction enumerates the values for direction. -type Direction string - -const ( - // Inbound ... - Inbound Direction = "Inbound" - // Outbound ... - Outbound Direction = "Outbound" -) - -// PossibleDirectionValues returns an array of possible values for the Direction const type. -func PossibleDirectionValues() []Direction { - return []Direction{Inbound, Outbound} -} - // ExternalSecuritySolutionKind enumerates the values for external security solution kind. type ExternalSecuritySolutionKind string @@ -296,21 +280,6 @@ func PossibleStatusReasonValues() []StatusReason { return []StatusReason{Expired, NewerRequestInitiated, UserRequested} } -// TransportProtocol enumerates the values for transport protocol. -type TransportProtocol string - -const ( - // TransportProtocolTCP ... - TransportProtocolTCP TransportProtocol = "TCP" - // TransportProtocolUDP ... - TransportProtocolUDP TransportProtocol = "UDP" -) - -// PossibleTransportProtocolValues returns an array of possible values for the TransportProtocol const type. -func PossibleTransportProtocolValues() []TransportProtocol { - return []TransportProtocol{TransportProtocolTCP, TransportProtocolUDP} -} - // ValueType enumerates the values for value type. type ValueType string @@ -407,277 +376,6 @@ type AadSolutionProperties struct { ConnectivityState AadConnectivityState `json:"connectivityState,omitempty"` } -// AdaptiveNetworkHardening the resource whose properties describes the Adaptive Network Hardening settings -// for some Azure resource -type AdaptiveNetworkHardening struct { - autorest.Response `json:"-"` - // AdaptiveNetworkHardeningProperties - Properties of the Adaptive Network Hardening resource - *AdaptiveNetworkHardeningProperties `json:"properties,omitempty"` - // ID - Resource Id - ID *string `json:"id,omitempty"` - // Name - Resource name - Name *string `json:"name,omitempty"` - // Type - Resource type - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for AdaptiveNetworkHardening. -func (anh AdaptiveNetworkHardening) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if anh.AdaptiveNetworkHardeningProperties != nil { - objectMap["properties"] = anh.AdaptiveNetworkHardeningProperties - } - if anh.ID != nil { - objectMap["id"] = anh.ID - } - if anh.Name != nil { - objectMap["name"] = anh.Name - } - if anh.Type != nil { - objectMap["type"] = anh.Type - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for AdaptiveNetworkHardening struct. -func (anh *AdaptiveNetworkHardening) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var adaptiveNetworkHardeningProperties AdaptiveNetworkHardeningProperties - err = json.Unmarshal(*v, &adaptiveNetworkHardeningProperties) - if err != nil { - return err - } - anh.AdaptiveNetworkHardeningProperties = &adaptiveNetworkHardeningProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - anh.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - anh.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - anh.Type = &typeVar - } - } - } - - return nil -} - -// AdaptiveNetworkHardeningEnforceRequest ... -type AdaptiveNetworkHardeningEnforceRequest struct { - // Rules - The rules to enforce - Rules *[]Rule `json:"rules,omitempty"` - // NetworkSecurityGroups - The Azure resource IDs of the effective network security groups that will be updated with the created security rules from the Adaptive Network Hardening rules - NetworkSecurityGroups *[]string `json:"networkSecurityGroups,omitempty"` -} - -// AdaptiveNetworkHardeningProperties adaptive Network Hardening resource properties -type AdaptiveNetworkHardeningProperties struct { - // Rules - The security rules which are recommended to be effective on the VM - Rules *[]Rule `json:"rules,omitempty"` - // RulesCalculationTime - The UTC time on which the rules were calculated - RulesCalculationTime *date.Time `json:"rulesCalculationTime,omitempty"` - // EffectiveNetworkSecurityGroups - The Network Security Groups effective on the network interfaces of the protected resource - EffectiveNetworkSecurityGroups *[]EffectiveNetworkSecurityGroups `json:"effectiveNetworkSecurityGroups,omitempty"` -} - -// AdaptiveNetworkHardeningsEnforceFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type AdaptiveNetworkHardeningsEnforceFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *AdaptiveNetworkHardeningsEnforceFuture) Result(client AdaptiveNetworkHardeningsClient) (ar autorest.Response, err error) { - var done bool - done, err = future.Done(client) - if err != nil { - err = autorest.NewErrorWithError(err, "security.AdaptiveNetworkHardeningsEnforceFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("security.AdaptiveNetworkHardeningsEnforceFuture") - return - } - ar.Response = future.Response() - return -} - -// AdaptiveNetworkHardeningsList response for ListAdaptiveNetworkHardenings API service call -type AdaptiveNetworkHardeningsList struct { - autorest.Response `json:"-"` - // Value - A list of Adaptive Network Hardenings resources - Value *[]AdaptiveNetworkHardening `json:"value,omitempty"` - // NextLink - The URL to get the next set of results - NextLink *string `json:"nextLink,omitempty"` -} - -// AdaptiveNetworkHardeningsListIterator provides access to a complete listing of AdaptiveNetworkHardening -// values. -type AdaptiveNetworkHardeningsListIterator struct { - i int - page AdaptiveNetworkHardeningsListPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *AdaptiveNetworkHardeningsListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveNetworkHardeningsListIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *AdaptiveNetworkHardeningsListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter AdaptiveNetworkHardeningsListIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter AdaptiveNetworkHardeningsListIterator) Response() AdaptiveNetworkHardeningsList { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter AdaptiveNetworkHardeningsListIterator) Value() AdaptiveNetworkHardening { - if !iter.page.NotDone() { - return AdaptiveNetworkHardening{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the AdaptiveNetworkHardeningsListIterator type. -func NewAdaptiveNetworkHardeningsListIterator(page AdaptiveNetworkHardeningsListPage) AdaptiveNetworkHardeningsListIterator { - return AdaptiveNetworkHardeningsListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (anhl AdaptiveNetworkHardeningsList) IsEmpty() bool { - return anhl.Value == nil || len(*anhl.Value) == 0 -} - -// adaptiveNetworkHardeningsListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (anhl AdaptiveNetworkHardeningsList) adaptiveNetworkHardeningsListPreparer(ctx context.Context) (*http.Request, error) { - if anhl.NextLink == nil || len(to.String(anhl.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(anhl.NextLink))) -} - -// AdaptiveNetworkHardeningsListPage contains a page of AdaptiveNetworkHardening values. -type AdaptiveNetworkHardeningsListPage struct { - fn func(context.Context, AdaptiveNetworkHardeningsList) (AdaptiveNetworkHardeningsList, error) - anhl AdaptiveNetworkHardeningsList -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *AdaptiveNetworkHardeningsListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/AdaptiveNetworkHardeningsListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - next, err := page.fn(ctx, page.anhl) - if err != nil { - return err - } - page.anhl = next - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *AdaptiveNetworkHardeningsListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page AdaptiveNetworkHardeningsListPage) NotDone() bool { - return !page.anhl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page AdaptiveNetworkHardeningsListPage) Response() AdaptiveNetworkHardeningsList { - return page.anhl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page AdaptiveNetworkHardeningsListPage) Values() []AdaptiveNetworkHardening { - if page.anhl.IsEmpty() { - return nil - } - return *page.anhl.Value -} - -// Creates a new instance of the AdaptiveNetworkHardeningsListPage type. -func NewAdaptiveNetworkHardeningsListPage(getNextPage func(context.Context, AdaptiveNetworkHardeningsList) (AdaptiveNetworkHardeningsList, error)) AdaptiveNetworkHardeningsListPage { - return AdaptiveNetworkHardeningsListPage{fn: getNextPage} -} - // AdvancedThreatProtectionProperties the Advanced Threat Protection settings. type AdvancedThreatProtectionProperties struct { // IsEnabled - Indicates whether Advanced Threat Protection is enabled. @@ -3366,14 +3064,6 @@ type DiscoveredSecuritySolutionProperties struct { Sku *string `json:"sku,omitempty"` } -// EffectiveNetworkSecurityGroups describes the Network Security Groups effective on a network interface -type EffectiveNetworkSecurityGroups struct { - // NetworkInterface - The Azure resource ID of the network interface - NetworkInterface *string `json:"networkInterface,omitempty"` - // NetworkSecurityGroups - The Network Security Groups effective on the network interface - NetworkSecurityGroups *[]string `json:"networkSecurityGroups,omitempty"` -} - // BasicExternalSecuritySolution represents a security solution external to Azure Security Center which sends // information to an OMS workspace and whose data is displayed by Azure Security Center. type BasicExternalSecuritySolution interface { @@ -5429,21 +5119,6 @@ type Resource struct { Type *string `json:"type,omitempty"` } -// Rule describes remote addresses that is recommended to communicate with the Azure resource on some -// (Protocol, Port, Direction). All other remote addresses are recommended to be blocked -type Rule struct { - // Name - The name of the rule - Name *string `json:"name,omitempty"` - // Direction - The rule's direction. Possible values include: 'Inbound', 'Outbound' - Direction Direction `json:"direction,omitempty"` - // DestinationPort - The rule's destination port - DestinationPort *int32 `json:"destinationPort,omitempty"` - // Protocols - The rule's transport protocols - Protocols *[]TransportProtocol `json:"protocols,omitempty"` - // IPAddresses - The remote IP addresses that should be able to communicate with the Azure resource on the rule's destination port and protocol - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} - // SensitivityLabel the sensitivity label. type SensitivityLabel struct { // DisplayName - The name of the sensitivity label. diff --git a/services/preview/security/mgmt/v2.0/security/securityapi/interfaces.go b/services/preview/security/mgmt/v2.0/security/securityapi/interfaces.go index b571ae6fd2a3..e86681e10b6f 100644 --- a/services/preview/security/mgmt/v2.0/security/securityapi/interfaces.go +++ b/services/preview/security/mgmt/v2.0/security/securityapi/interfaces.go @@ -222,12 +222,3 @@ type AllowedConnectionsClientAPI interface { } var _ AllowedConnectionsClientAPI = (*security.AllowedConnectionsClient)(nil) - -// AdaptiveNetworkHardeningsClientAPI contains the set of methods on the AdaptiveNetworkHardeningsClient type. -type AdaptiveNetworkHardeningsClientAPI interface { - Enforce(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, adaptiveNetworkHardeningResourceName string, body security.AdaptiveNetworkHardeningEnforceRequest) (result security.AdaptiveNetworkHardeningsEnforceFuture, err error) - Get(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string, adaptiveNetworkHardeningResourceName string) (result security.AdaptiveNetworkHardening, err error) - ListByExtendedResource(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (result security.AdaptiveNetworkHardeningsListPage, err error) -} - -var _ AdaptiveNetworkHardeningsClientAPI = (*security.AdaptiveNetworkHardeningsClient)(nil)