From 40d62b4ba11fdfe22d693d6bd68fb5b9cc1a81e1 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 26 Mar 2020 02:46:58 +0000 Subject: [PATCH] Generated from 040fb3afa0e1a43471c1219e1e74c014f89c9b2e Update CreateOrUpdateInformationProtectionPolicy_example.json --- .../security/adaptiveapplicationcontrols.go | 80 +++++++++++++++++++ .../security/informationprotectionpolicies.go | 9 ++- .../security/mgmt/v1.0/security/models.go | 27 +++++++ .../v1.0/security/securityapi/interfaces.go | 3 +- 4 files changed, 115 insertions(+), 4 deletions(-) diff --git a/services/preview/security/mgmt/v1.0/security/adaptiveapplicationcontrols.go b/services/preview/security/mgmt/v1.0/security/adaptiveapplicationcontrols.go index 3539525c7196..3c6bb4585652 100644 --- a/services/preview/security/mgmt/v1.0/security/adaptiveapplicationcontrols.go +++ b/services/preview/security/mgmt/v1.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 diff --git a/services/preview/security/mgmt/v1.0/security/informationprotectionpolicies.go b/services/preview/security/mgmt/v1.0/security/informationprotectionpolicies.go index b1ca96db2f94..d2c937c922bd 100644 --- a/services/preview/security/mgmt/v1.0/security/informationprotectionpolicies.go +++ b/services/preview/security/mgmt/v1.0/security/informationprotectionpolicies.go @@ -47,7 +47,8 @@ func NewInformationProtectionPoliciesClientWithBaseURI(baseURI string, subscript // scope - scope of the query, can be subscription (/subscriptions/0b06d9ea-afe6-4779-bd59-30e5c2d9d13f) or // management group (/providers/Microsoft.Management/managementGroups/mgName). // informationProtectionPolicyName - name of the information protection policy. -func (client InformationProtectionPoliciesClient) CreateOrUpdate(ctx context.Context, scope string, informationProtectionPolicyName string) (result InformationProtectionPolicy, err error) { +// informationProtectionPolicy - information protection policy. +func (client InformationProtectionPoliciesClient) CreateOrUpdate(ctx context.Context, scope string, informationProtectionPolicyName string, informationProtectionPolicy InformationProtectionPolicy) (result InformationProtectionPolicy, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/InformationProtectionPoliciesClient.CreateOrUpdate") defer func() { @@ -58,7 +59,7 @@ func (client InformationProtectionPoliciesClient) CreateOrUpdate(ctx context.Con tracing.EndSpan(ctx, sc, err) }() } - req, err := client.CreateOrUpdatePreparer(ctx, scope, informationProtectionPolicyName) + req, err := client.CreateOrUpdatePreparer(ctx, scope, informationProtectionPolicyName, informationProtectionPolicy) if err != nil { err = autorest.NewErrorWithError(err, "security.InformationProtectionPoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -80,7 +81,7 @@ func (client InformationProtectionPoliciesClient) CreateOrUpdate(ctx context.Con } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client InformationProtectionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, scope string, informationProtectionPolicyName string) (*http.Request, error) { +func (client InformationProtectionPoliciesClient) CreateOrUpdatePreparer(ctx context.Context, scope string, informationProtectionPolicyName string, informationProtectionPolicy InformationProtectionPolicy) (*http.Request, error) { pathParameters := map[string]interface{}{ "informationProtectionPolicyName": autorest.Encode("path", informationProtectionPolicyName), "scope": autorest.Encode("path", scope), @@ -92,9 +93,11 @@ func (client InformationProtectionPoliciesClient) CreateOrUpdatePreparer(ctx con } preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/{scope}/providers/Microsoft.Security/informationProtectionPolicies/{informationProtectionPolicyName}", pathParameters), + autorest.WithJSON(informationProtectionPolicy), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/preview/security/mgmt/v1.0/security/models.go b/services/preview/security/mgmt/v1.0/security/models.go index 3bd892fb46d9..355770722269 100644 --- a/services/preview/security/mgmt/v1.0/security/models.go +++ b/services/preview/security/mgmt/v1.0/security/models.go @@ -540,6 +540,27 @@ func PossibleProtocolValues() []Protocol { return []Protocol{All, TCP, UDP} } +// Rank enumerates the values for rank. +type Rank string + +const ( + // RankCritical ... + RankCritical Rank = "Critical" + // RankHigh ... + RankHigh Rank = "High" + // RankLow ... + RankLow Rank = "Low" + // RankMedium ... + RankMedium Rank = "Medium" + // RankNone ... + RankNone Rank = "None" +) + +// PossibleRankValues returns an array of possible values for the Rank const type. +func PossibleRankValues() []Rank { + return []Rank{RankCritical, RankHigh, RankLow, RankMedium, RankNone} +} + // RecommendationAction enumerates the values for recommendation action. type RecommendationAction string @@ -5299,6 +5320,8 @@ func (ippp InformationProtectionPolicyProperties) MarshalJSON() ([]byte, error) type InformationType struct { // DisplayName - The name of the information type. DisplayName *string `json:"displayName,omitempty"` + // Description - The description of the information type. + Description *string `json:"description,omitempty"` // Order - The order of the information type. Order *float64 `json:"order,omitempty"` // RecommendedLabelID - The recommended label id to be associated with this information type. @@ -6985,6 +7008,10 @@ type Rule struct { type SensitivityLabel struct { // DisplayName - The name of the sensitivity label. DisplayName *string `json:"displayName,omitempty"` + // Description - The description of the sensitivity label. + Description *string `json:"description,omitempty"` + // Rank - The rank of the sensitivity label. Possible values include: 'RankNone', 'RankLow', 'RankMedium', 'RankHigh', 'RankCritical' + Rank Rank `json:"rank,omitempty"` // Order - The order of the sensitivity label. Order *float64 `json:"order,omitempty"` // Enabled - Indicates whether the label is enabled or not. 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 9c35c4776471..f48976c7fd74 100644 --- a/services/preview/security/mgmt/v1.0/security/securityapi/interfaces.go +++ b/services/preview/security/mgmt/v1.0/security/securityapi/interfaces.go @@ -163,7 +163,7 @@ var _ SettingsClientAPI = (*security.SettingsClient)(nil) // InformationProtectionPoliciesClientAPI contains the set of methods on the InformationProtectionPoliciesClient type. type InformationProtectionPoliciesClientAPI interface { - CreateOrUpdate(ctx context.Context, scope string, informationProtectionPolicyName string) (result security.InformationProtectionPolicy, err error) + CreateOrUpdate(ctx context.Context, scope string, informationProtectionPolicyName string, informationProtectionPolicy security.InformationProtectionPolicy) (result security.InformationProtectionPolicy, err error) Get(ctx context.Context, scope string, informationProtectionPolicyName string) (result security.InformationProtectionPolicy, err error) List(ctx context.Context, scope string) (result security.InformationProtectionPolicyListPage, err error) ListComplete(ctx context.Context, scope string) (result security.InformationProtectionPolicyListIterator, err error) @@ -255,6 +255,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)